Download raw body.
lang/crystal: use DIST_TUPLE
On Mon, 23 Dec 2024 at 12:15:15 +0000, Stuart Henderson wrote:
> here's a diff to use the relatively new DIST_TUPLE mechanism to
> tidy up fetch/extract. ok?
>
> (I was looking at the port to see if it could be updated to use
> llvm 18; chromium browsers will soon switch to llvm 19, and this
> will be the only thing left using 17 - which takes about 3.5h to
> build - but hitting a "can't reopen enum and add more constants
> to it" error when trying to generate a new bootstrap on OpenBSD).
Here's an update to 1.14.0 that incorporates those changes, uses a
bootstrap built against llvm 18, and switches the port to use it.
diff --git lang/crystal/Makefile lang/crystal/Makefile
index 6d978c85add..e06f9ecc8de 100644
--- lang/crystal/Makefile
+++ lang/crystal/Makefile
@@ -3,9 +3,14 @@ ONLY_FOR_ARCHS= amd64
USE_NOBTCFI = Yes
-V = 1.13.2
+V = 1.14.0
V_SHARDS = 0.18.0
V_MOLINILLO = 0.2.0
+
+DIST_TUPLE = github crystal-lang crystal ${V} . \
+ github crystal-lang shards v${V_SHARDS} shards-${V_SHARDS} \
+ github crystal-lang crystal-molinillo v${V_MOLINILLO} shards-${V_SHARDS}/lib/molinillo
+
COMMENT = statically typed object oriented language
DISTNAME = crystal-${V}
CATEGORIES = lang
@@ -30,20 +35,15 @@ WANTLIB += yaml-0
# The result will be built at .build/crystal.o
#
-SITES = https://github.com/crystal-lang/crystal/archive/
-SITES.a = https://jcs.org/distfiles/
-SITES.b = https://github.com/crystal-lang/shards/archive/
-SITES.c = https://github.com/crystal-lang/crystal-molinillo/archive/
-DISTFILES = crystal-${V}{${V}}.tar.gz
-DISTFILES.a = crystal-${V}-OpenBSD7.6.tar.gz
-DISTFILES.b = shards-${V}{v${V_SHARDS}}.tar.gz
-DISTFILES.c = crystal-molinillo-${V}{v${V_MOLINILLO}}.tar.gz
+SITES = https://jcs.org/distfiles/
+DISTFILES = crystal-${V}-OpenBSD7.6.tar.gz
# Build requires llvm-config from ports, not from base. When changing
# MODCLANG_VERSION, keep paths in patches/ in sync here and in bootstrap
# environment.
MODULES = lang/clang
-MODCLANG_VERSION = 17
+MODCLANG_VERSION = 18
+MODCLANG_RUNDEP= yes
COMPILER = ports-clang
LLVM_CONFIG = llvm-config-${MODCLANG_VERSION}
@@ -51,19 +51,14 @@ LIB_DEPENDS = converters/libiconv \
devel/boehm-gc \
devel/libevent2 \
devel/pcre2 \
- devel/libyaml
+ devel/libyaml \
+ ${MODCLANG_LIB_DEPENDS}
USE_GMAKE = Yes
ALL_TARGET = crystal release=1
TEST_TARGET = smoke_test
SUBST_VARS = MODCLANG_VERSION
-post-extract:
- mv ${WRKDIR}/shards-${V_SHARDS} ${WRKSRC}/
- mkdir ${WRKSRC}/shards-${V_SHARDS}/lib
- mv ${WRKDIR}/crystal-molinillo-${V_MOLINILLO} \
- ${WRKSRC}/shards-${V_SHARDS}/lib/molinillo
-
do-build:
mkdir -p ${WRKSRC}/.build
# Link the compiler from the pre-built bootstrap object
diff --git lang/crystal/distinfo lang/crystal/distinfo
index 1eb9dc1fa64..70fdef09dba 100644
--- lang/crystal/distinfo
+++ lang/crystal/distinfo
@@ -1,8 +1,8 @@
-SHA256 (crystal-1.13.2-OpenBSD7.6.tar.gz) = qzmlylaK5m20xfa/2+QaZxAt+avm37Ua71fQ5thcWVQ=
-SHA256 (crystal-1.13.2.tar.gz) = xTczbBD/DZzTZz4ZUWVmfkeL6S4KjMZmS97FuWB0XEs=
-SHA256 (crystal-molinillo-1.13.2.tar.gz) = 4jHPJBGmoRoVOJg8f7UrGeZQrMMzi9PN9v2xPWRjhho=
-SHA256 (shards-1.13.2.tar.gz) = Rqgwr9kpKAc112XlnYwnrJupLt3elkeufT/IWt3DjMU=
-SIZE (crystal-1.13.2-OpenBSD7.6.tar.gz) = 10272541
-SIZE (crystal-1.13.2.tar.gz) = 3687101
-SIZE (crystal-molinillo-1.13.2.tar.gz) = 23959
-SIZE (shards-1.13.2.tar.gz) = 79910
+SHA256 (crystal-1.14.0-OpenBSD7.6.tar.gz) = GyfucZVCOozdMwxPD20hOoXbff28vpyXnVNVAJ/gD9g=
+SHA256 (crystal-lang-crystal-1.14.0.tar.gz) = hcdNhlSg4RHi6uxt44RwvJy2divFt5ndNpPRjM5LyAc=
+SHA256 (crystal-lang-crystal-molinillo-v0.2.0.tar.gz) = 4jHPJBGmoRoVOJg8f7UrGeZQrMMzi9PN9v2xPWRjhho=
+SHA256 (crystal-lang-shards-v0.18.0.tar.gz) = Rqgwr9kpKAc112XlnYwnrJupLt3elkeufT/IWt3DjMU=
+SIZE (crystal-1.14.0-OpenBSD7.6.tar.gz) = 10325242
+SIZE (crystal-lang-crystal-1.14.0.tar.gz) = 3726474
+SIZE (crystal-lang-crystal-molinillo-v0.2.0.tar.gz) = 23959
+SIZE (crystal-lang-shards-v0.18.0.tar.gz) = 79910
diff --git lang/crystal/patches/patch-bin_crystal lang/crystal/patches/patch-bin_crystal
index 3151a401a21..a808db68878 100644
--- lang/crystal/patches/patch-bin_crystal
+++ lang/crystal/patches/patch-bin_crystal
@@ -11,8 +11,8 @@ Index: bin/crystal
if [ -x "$CRYSTAL_DIR/crystal" ]; then
__warning_msg "Using compiled compiler at ${CRYSTAL_DIR#"$PWD/"}/crystal"
-+ export LD_LIBRARY_PATH=/usr/local/llvm17/lib
-+ export LLVM_CONFIG=/usr/local/llvm17/bin/llvm-config
++ export LD_LIBRARY_PATH=/usr/local/llvm18/lib
++ export LLVM_CONFIG=/usr/local/llvm18/bin/llvm-config
exec "$CRYSTAL_DIR/crystal" "$@"
elif !($PARENT_CRYSTAL_EXISTS); then
__error_msg 'You need to have a crystal executable in your path! or set CRYSTAL env variable'
diff --git lang/crystal/patches/patch-src_compiler_crystal_compiler_cr lang/crystal/patches/patch-src_compiler_crystal_compiler_cr
index e57fc4fd555..f185e02e758 100644
--- lang/crystal/patches/patch-src_compiler_crystal_compiler_cr
+++ lang/crystal/patches/patch-src_compiler_crystal_compiler_cr
@@ -3,13 +3,13 @@
Index: src/compiler/crystal/compiler.cr
--- src/compiler/crystal/compiler.cr.orig
+++ src/compiler/crystal/compiler.cr
-@@ -463,6 +463,11 @@ module Crystal
+@@ -495,6 +495,11 @@ module Crystal
else
link_flags = @link_flags || ""
link_flags += " -rdynamic"
+
+ if program.has_flag? "openbsd"
-+ link_flags += " -L/usr/local/lib -L/usr/local/llvm17/lib -Wl,-z,nobtcfi"
++ link_flags += " -L/usr/local/lib -L/usr/local/llvm18/lib -Wl,-z,nobtcfi"
+ end
+
{DEFAULT_LINKER, %(#{DEFAULT_LINKER} "${@}" -o #{Process.quote_posix(output_filename)} #{link_flags} #{program.lib_flags}), object_names}
diff --git lang/crystal/pkg/PLIST lang/crystal/pkg/PLIST
index 8f385936ba4..cb60617d3f2 100644
--- lang/crystal/pkg/PLIST
+++ lang/crystal/pkg/PLIST
@@ -24,7 +24,12 @@ lib/crystal/big/yaml.cr
lib/crystal/bit_array.cr
lib/crystal/bool.cr
lib/crystal/box.cr
+lib/crystal/channel/
lib/crystal/channel.cr
+lib/crystal/channel/select/
+lib/crystal/channel/select.cr
+lib/crystal/channel/select/select_action.cr
+lib/crystal/channel/select/timeout_action.cr
lib/crystal/char/
lib/crystal/char.cr
lib/crystal/char/reader.cr
@@ -367,6 +372,7 @@ lib/crystal/crystal/syntax_highlighter/colorize.cr
lib/crystal/crystal/syntax_highlighter/html.cr
lib/crystal/crystal/system/
lib/crystal/crystal/system.cr
+lib/crystal/crystal/system/addrinfo.cr
lib/crystal/crystal/system/dir.cr
lib/crystal/crystal/system/env.cr
lib/crystal/crystal/system/event_loop/
@@ -393,6 +399,7 @@ lib/crystal/crystal/system/thread_mutex.cr
lib/crystal/crystal/system/time.cr
lib/crystal/crystal/system/unix/
lib/crystal/crystal/system/unix.cr
+lib/crystal/crystal/system/unix/addrinfo.cr
lib/crystal/crystal/system/unix/arc4random.cr
lib/crystal/crystal/system/unix/dir.cr
lib/crystal/crystal/system/unix/env.cr
@@ -422,6 +429,7 @@ lib/crystal/crystal/system/unix/urandom.cr
lib/crystal/crystal/system/unix/user.cr
lib/crystal/crystal/system/user.cr
lib/crystal/crystal/system/wasi/
+lib/crystal/crystal/system/wasi/addrinfo.cr
lib/crystal/crystal/system/wasi/cpucount.cr
lib/crystal/crystal/system/wasi/dir.cr
lib/crystal/crystal/system/wasi/event_loop.cr
@@ -443,6 +451,8 @@ lib/crystal/crystal/system/wasi/thread_mutex.cr
lib/crystal/crystal/system/wasi/user.cr
lib/crystal/crystal/system/wasi/wasi.cr
lib/crystal/crystal/system/win32/
+lib/crystal/crystal/system/win32/addrinfo.cr
+lib/crystal/crystal/system/win32/addrinfo_win7.cr
lib/crystal/crystal/system/win32/cpucount.cr
lib/crystal/crystal/system/win32/crypto.cr
lib/crystal/crystal/system/win32/dir.cr
@@ -452,6 +462,7 @@ lib/crystal/crystal/system/win32/fiber.cr
lib/crystal/crystal/system/win32/file.cr
lib/crystal/crystal/system/win32/file_descriptor.cr
lib/crystal/crystal/system/win32/file_info.cr
+lib/crystal/crystal/system/win32/group.cr
lib/crystal/crystal/system/win32/hostname.cr
lib/crystal/crystal/system/win32/iocp.cr
lib/crystal/crystal/system/win32/library_archive.cr
@@ -465,6 +476,7 @@ lib/crystal/crystal/system/win32/thread.cr
lib/crystal/crystal/system/win32/thread_condition_variable.cr
lib/crystal/crystal/system/win32/thread_mutex.cr
lib/crystal/crystal/system/win32/time.cr
+lib/crystal/crystal/system/win32/user.cr
lib/crystal/crystal/system/win32/visual_studio.cr
lib/crystal/crystal/system/win32/windows_registry.cr
lib/crystal/crystal/system/win32/windows_sdk.cr
@@ -804,6 +816,7 @@ lib/crystal/lib_c/aarch64-linux-musl/c/sys/wait.cr
lib/crystal/lib_c/aarch64-linux-musl/c/termios.cr
lib/crystal/lib_c/aarch64-linux-musl/c/time.cr
lib/crystal/lib_c/aarch64-linux-musl/c/unistd.cr
+lib/crystal/lib_c/aarch64-windows-msvc
lib/crystal/lib_c/amd64-unknown-openbsd
lib/crystal/lib_c/arm-linux-gnueabihf/
lib/crystal/lib_c/arm-linux-gnueabihf/c/
@@ -1310,6 +1323,7 @@ lib/crystal/lib_c/x86_64-windows-msvc/c/ioapiset.cr
lib/crystal/lib_c/x86_64-windows-msvc/c/jobapi2.cr
lib/crystal/lib_c/x86_64-windows-msvc/c/knownfolders.cr
lib/crystal/lib_c/x86_64-windows-msvc/c/libloaderapi.cr
+lib/crystal/lib_c/x86_64-windows-msvc/c/lm.cr
lib/crystal/lib_c/x86_64-windows-msvc/c/malloc.cr
lib/crystal/lib_c/x86_64-windows-msvc/c/memoryapi.cr
lib/crystal/lib_c/x86_64-windows-msvc/c/minwinbase.cr
@@ -1322,7 +1336,9 @@ lib/crystal/lib_c/x86_64-windows-msvc/c/processenv.cr
lib/crystal/lib_c/x86_64-windows-msvc/c/processthreadsapi.cr
lib/crystal/lib_c/x86_64-windows-msvc/c/profileapi.cr
lib/crystal/lib_c/x86_64-windows-msvc/c/regapix.cr
+lib/crystal/lib_c/x86_64-windows-msvc/c/sddl.cr
lib/crystal/lib_c/x86_64-windows-msvc/c/sdkddkver.cr
+lib/crystal/lib_c/x86_64-windows-msvc/c/security.cr
lib/crystal/lib_c/x86_64-windows-msvc/c/shlobj_core.cr
lib/crystal/lib_c/x86_64-windows-msvc/c/signal.cr
lib/crystal/lib_c/x86_64-windows-msvc/c/stdarg.cr
@@ -1340,6 +1356,7 @@ lib/crystal/lib_c/x86_64-windows-msvc/c/sys/utime.cr
lib/crystal/lib_c/x86_64-windows-msvc/c/sysinfoapi.cr
lib/crystal/lib_c/x86_64-windows-msvc/c/timezoneapi.cr
lib/crystal/lib_c/x86_64-windows-msvc/c/tlhelp32.cr
+lib/crystal/lib_c/x86_64-windows-msvc/c/userenv.cr
lib/crystal/lib_c/x86_64-windows-msvc/c/win_def.cr
lib/crystal/lib_c/x86_64-windows-msvc/c/winbase.cr
lib/crystal/lib_c/x86_64-windows-msvc/c/wincrypt.cr
@@ -1389,6 +1406,7 @@ lib/crystal/llvm/jit_compiler.cr
lib/crystal/llvm/lib_llvm/
lib/crystal/llvm/lib_llvm.cr
lib/crystal/llvm/lib_llvm/analysis.cr
+lib/crystal/llvm/lib_llvm/bit_reader.cr
lib/crystal/llvm/lib_llvm/bit_writer.cr
lib/crystal/llvm/lib_llvm/core.cr
lib/crystal/llvm/lib_llvm/debug_info.cr
@@ -1396,6 +1414,8 @@ lib/crystal/llvm/lib_llvm/error.cr
lib/crystal/llvm/lib_llvm/execution_engine.cr
lib/crystal/llvm/lib_llvm/initialization.cr
lib/crystal/llvm/lib_llvm/ir_reader.cr
+lib/crystal/llvm/lib_llvm/lljit.cr
+lib/crystal/llvm/lib_llvm/orc.cr
lib/crystal/llvm/lib_llvm/target.cr
lib/crystal/llvm/lib_llvm/target_machine.cr
lib/crystal/llvm/lib_llvm/transforms/
@@ -1407,6 +1427,12 @@ lib/crystal/llvm/memory_buffer.cr
lib/crystal/llvm/module.cr
lib/crystal/llvm/module_pass_manager.cr
lib/crystal/llvm/operand_bundle_def.cr
+lib/crystal/llvm/orc/
+lib/crystal/llvm/orc/jit_dylib.cr
+lib/crystal/llvm/orc/lljit.cr
+lib/crystal/llvm/orc/lljit_builder.cr
+lib/crystal/llvm/orc/thread_safe_context.cr
+lib/crystal/llvm/orc/thread_safe_module.cr
lib/crystal/llvm/parameter_collection.cr
lib/crystal/llvm/pass_builder_options.cr
lib/crystal/llvm/pass_manager_builder.cr
@@ -1619,7 +1645,11 @@ lib/crystal/uri/
lib/crystal/uri.cr
lib/crystal/uri/encoding.cr
lib/crystal/uri/json.cr
+lib/crystal/uri/params/
lib/crystal/uri/params.cr
+lib/crystal/uri/params/from_www_form.cr
+lib/crystal/uri/params/serializable.cr
+lib/crystal/uri/params/to_www_form.cr
lib/crystal/uri/punycode.cr
lib/crystal/uri/uri_parser.cr
lib/crystal/uri/yaml.cr
lang/crystal: use DIST_TUPLE