From c6166af1e7e592826870db75c448eb055f0b435a Mon Sep 17 00:00:00 2001 From: Quinton Miller Date: Tue, 5 Nov 2024 14:34:43 +0800 Subject: [PATCH 1/3] [new package] crystal 1.15.0 --- mingw-w64-crystal/PKGBUILD | 70 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 mingw-w64-crystal/PKGBUILD diff --git a/mingw-w64-crystal/PKGBUILD b/mingw-w64-crystal/PKGBUILD new file mode 100644 index 0000000000000..fe97a054fd34d --- /dev/null +++ b/mingw-w64-crystal/PKGBUILD @@ -0,0 +1,70 @@ +# Maintainer: Quinton Miller + +_realname=crystal +pkgbase="mingw-w64-${_realname}" +pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" +_major=1 +_minor=15 +_patch=0 +_version="${_major}.${_minor}.${_patch}" +_tag=${_version} +pkgver=${_version} +pkgrel=1 +pkgdesc="Fast and statically typed, compiled language with Ruby-like syntax" +arch=('x86_64') +mingw_arch=('ucrt64' 'mingw64' 'clang64') +url="https://crystal-lang.org/" +msys2_repository_url="https://github.com/crystal-lang/crystal" +msys2_documentation_url="https://crystal-lang.org/reference/${_major}.${_minor}/" +msys2_changelog_url="https://github.com/crystal-lang/crystal/releases/tag/${_tag}" +msys2_references=( + "archlinux: crystal" +) +license=('spdx:Apache-2.0 WITH Swift-exception') +depends=( + "${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-gc" + "${MINGW_PACKAGE_PREFIX}-pcre2" + "${MINGW_PACKAGE_PREFIX}-gmp" + "${MINGW_PACKAGE_PREFIX}-libffi" + "${MINGW_PACKAGE_PREFIX}-libiconv" + "${MINGW_PACKAGE_PREFIX}-libxml2" + "${MINGW_PACKAGE_PREFIX}-libyaml" + "${MINGW_PACKAGE_PREFIX}-llvm" + "${MINGW_PACKAGE_PREFIX}-openssl" + "${MINGW_PACKAGE_PREFIX}-zlib" +) +makedepends=( + "git" +) +checkdepends=( + "${MINGW_PACKAGE_PREFIX}-lld" # needed for linking std_spec +) +source=( + https://github.com/crystal-lang/crystal/releases/download/1.15.0/crystal-1.15.0-windows-x86_64-gnu-unsupported.zip # stage 0 compiler +) +sha256sums=( + '7d7df1b4a99cb3f938106ba45e0b55ce1d9913491999f1acaa57da168a18becb' +) + +prepare() { + # workaround for lack of native symlink support in Git + git clone https://github.com/crystal-lang/crystal.git "$pkgname-$pkgver" -c core.symlinks=true || \ + (cd "$pkgname-$pkgver" && MSYS='winsymlinks:nativestrict' git restore --source=HEAD :/) +} + +build() { + cd "$pkgname-$pkgver" + CRYSTAL="$srcdir/bin/crystal.exe" make interpreter=1 release=1 +} + +check() { + cd "$pkgname-$pkgver" + # the full suite is run on the crystal-lang/crystal repo's own CI + CRYSTAL_SPEC_COMPILER_BIN="$(pwd)/.build/crystal.exe" make std_spec +} + +package() { + cd "$pkgname-$pkgver" + make install DESTDIR="$pkgdir" PREFIX="${MINGW_PREFIX}" deref_symlinks=1 +} From d64d5d8a0b65c05d93feb5d86938bedfd5340b85 Mon Sep 17 00:00:00 2001 From: Quinton Miller Date: Mon, 27 Jan 2025 00:06:52 +0800 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Biswapriyo Nath --- mingw-w64-crystal/PKGBUILD | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mingw-w64-crystal/PKGBUILD b/mingw-w64-crystal/PKGBUILD index fe97a054fd34d..017fc540955be 100644 --- a/mingw-w64-crystal/PKGBUILD +++ b/mingw-w64-crystal/PKGBUILD @@ -10,8 +10,8 @@ _version="${_major}.${_minor}.${_patch}" _tag=${_version} pkgver=${_version} pkgrel=1 -pkgdesc="Fast and statically typed, compiled language with Ruby-like syntax" -arch=('x86_64') +pkgdesc="Fast and statically typed, compiled language with Ruby-like syntax (mingw-w64)" +arch=('any') mingw_arch=('ucrt64' 'mingw64' 'clang64') url="https://crystal-lang.org/" msys2_repository_url="https://github.com/crystal-lang/crystal" From c647e9fe6b4372012b89457cd69f599712f620f6 Mon Sep 17 00:00:00 2001 From: Quinton Miller Date: Tue, 28 Jan 2025 22:40:26 +0800 Subject: [PATCH 3/3] use git url --- mingw-w64-crystal/PKGBUILD | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mingw-w64-crystal/PKGBUILD b/mingw-w64-crystal/PKGBUILD index 017fc540955be..18aaec8f0c911 100644 --- a/mingw-w64-crystal/PKGBUILD +++ b/mingw-w64-crystal/PKGBUILD @@ -41,16 +41,21 @@ checkdepends=( "${MINGW_PACKAGE_PREFIX}-lld" # needed for linking std_spec ) source=( + "$pkgname-$pkgver::git+${msys2_repository_url}.git#tag=${_version}" https://github.com/crystal-lang/crystal/releases/download/1.15.0/crystal-1.15.0-windows-x86_64-gnu-unsupported.zip # stage 0 compiler ) sha256sums=( + '6be663c5f0c9410696ed3fb5bd6006cafc2ab0bd0813651b62ca65982360f512' '7d7df1b4a99cb3f938106ba45e0b55ce1d9913491999f1acaa57da168a18becb' ) prepare() { - # workaround for lack of native symlink support in Git - git clone https://github.com/crystal-lang/crystal.git "$pkgname-$pkgver" -c core.symlinks=true || \ - (cd "$pkgname-$pkgver" && MSYS='winsymlinks:nativestrict' git restore --source=HEAD :/) + cd "$pkgname-$pkgver" + if test true != "$(git config core.symlinks)" + then + git config core.symlinks true && + MSYS='winsymlinks:nativestrict' git restore --source=HEAD :/ + fi } build() {