diff --git a/packages/conf-zig-cross/conf-zig-cross.aarch64-al2023/opam b/packages/conf-zig-cross/conf-zig-cross.aarch64-al2023/opam new file mode 100644 index 0000000..c4375ec --- /dev/null +++ b/packages/conf-zig-cross/conf-zig-cross.aarch64-al2023/opam @@ -0,0 +1,8 @@ +opam-version: "2.0" +maintainer: "hello@chrisarmstrong.dev" +build: [ + ["sh" "-c" "echo 'ocaml_triple: \"aarch64-linux-gnu\"' >> conf-zig-cross.config"] + ["sh" "-c" "echo 'zig_triple: \"aarch64-linux-gnu.2.34\"' >> conf-zig-cross.config"] +] +synopsis: + "Configuration package to target ARM64 Amazon Linux from zig-cross" diff --git a/packages/conf-zig-cross/conf-zig-cross.rpi/opam b/packages/conf-zig-cross/conf-zig-cross.rpi/opam new file mode 100644 index 0000000..afb798f --- /dev/null +++ b/packages/conf-zig-cross/conf-zig-cross.rpi/opam @@ -0,0 +1,8 @@ +opam-version: "2.0" +maintainer: "hello@chrisarmstrong.dev" +build: [ + ["sh" "-c" "echo 'ocaml_triple: \"aarch64-linux-gnu\"' >> conf-zig-cross.config"] + ["sh" "-c" "echo 'zig_triple: \"aarch64-linux-gnu -mcpu=generic\"' >> conf-zig-cross.config"] +] +synopsis: + "Configuration package to target the Raspberry Pi from zig-cross" diff --git a/packages/conf-zig-cross/conf-zig-cross.x86_64-al2023/opam b/packages/conf-zig-cross/conf-zig-cross.x86_64-al2023/opam new file mode 100644 index 0000000..7631d95 --- /dev/null +++ b/packages/conf-zig-cross/conf-zig-cross.x86_64-al2023/opam @@ -0,0 +1,8 @@ +opam-version: "2.0" +maintainer: "hello@chrisarmstrong.dev" +build: [ + ["sh" "-c" "echo 'ocaml_triple: \"x86_64-linux-gnu\"' >> conf-zig-cross.config"] + ["sh" "-c" "echo 'zig_triple: \"x86_64-linux-gnu.2.34\"' >> conf-zig-cross.config"] +] +synopsis: + "Configuration package to target x86_64 Amazon Linux from zig-cross" diff --git a/packages/conf-zig-wrapper-cross-aarch64-al2023/conf-zig-wrapper-cross-aarch64-al2023.0/files/build.sh b/packages/conf-zig-wrapper-cross-aarch64-al2023/conf-zig-wrapper-cross-aarch64-al2023.0/files/build.sh deleted file mode 100644 index d9049ee..0000000 --- a/packages/conf-zig-wrapper-cross-aarch64-al2023/conf-zig-wrapper-cross-aarch64-al2023.0/files/build.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -CROSS_NAME=$1 -ZIG=$(which zig) - -echo "zig_path: \"${ZIG}\"" >> "conf-zig-wrapper-${CROSS_NAME}.config" diff --git a/packages/conf-zig-wrapper-cross-aarch64-al2023/conf-zig-wrapper-cross-aarch64-al2023.0/files/install.sh b/packages/conf-zig-wrapper-cross-aarch64-al2023/conf-zig-wrapper-cross-aarch64-al2023.0/files/install.sh deleted file mode 100644 index 97a0afe..0000000 --- a/packages/conf-zig-wrapper-cross-aarch64-al2023/conf-zig-wrapper-cross-aarch64-al2023.0/files/install.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash - -PREFIX=$1 -CROSS_NAME=$2 -HOST_TARGET=$3 -ZIG=$(which zig) - -if [ -z "${ZIG}" ] -then - echo "Zig not found in path!" - exit 1 -fi - -case "$(uname -s)" in - Linux*) machine=Linux;; - Darwin*) machine=Mac;; - CYGWIN*) machine=Cygwin;; - MINGW*) machine=MinGW;; - MSYS_NT*) machine=MSys;; - *) machine="UNKNOWN:${unameOut}" -esac - -# Make a shell wrapper for $2 that passes its arguments appended -# to the end, stored in $1 -function make_wrapper() { - wrapper_script_path=$1 - caml_bin=$2 - cat << EOF > "$wrapper_script_path" -#!/bin/bash - -NEW_ARGS="" - -for ARG in "\$@"; do NEW_ARGS="\$NEW_ARGS \"\$ARG\""; done -eval "${caml_bin} \$NEW_ARGS" -EOF - chmod u+x "$wrapper_script_path" -} - -# Make a `.cmd` wrapper that can be called from ocamlmklib -# using the standard windows cmd.exe shell (using Unix.command) -function make_windows_cmd_wrapper() { - if [[ "$machine" == "Cygwin" ]] - then - wrapper_script_path=$1 - cmd_script_path=$(dirname "$1")/$(basename "$1").cmd - cat << EOF > "$cmd_script_path" -@echo off -setlocal - -if not exist "%~dpn0" echo Script "%~dpn0" not found & exit 2 - -set _CYGBIN=$(cygpath -w /)\\bin\\ -if not exist "%_CYGBIN%" echo Couldn't find Cygwin at "%_CYGBIN%" & exit 3 - -:: Resolve ___.sh to /cygdrive based *nix path and store in %_CYGSCRIPT -for /f "delims=" %%A in ('%_CYGBIN%cygpath.exe "%~dpn0"') do set _CYGSCRIPT=%%A - -:: Throw away temporary env vars and invoke script, passing any args that were passed to us -endlocal & %_CYGBIN%bash "%_CYGSCRIPT%" %* -EOF - fi -} -# -- target C compiler wrapper scripts (these need to be added to the prefix straight away) -mkdir -p "${PREFIX}/bin" - -zig_cc_wrapper="${PREFIX}/bin/$CROSS_NAME-target-cc" -make_wrapper "$zig_cc_wrapper" "${ZIG} cc -target ${HOST_TARGET}" -make_windows_cmd_wrapper "$zig_cc_wrapper" - -zig_aspp_wrapper="${PREFIX}/bin/$CROSS_NAME-target-aspp" -make_wrapper "$zig_aspp_wrapper" "${ZIG} cc -target ${HOST_TARGET} -c" -make_windows_cmd_wrapper "$zig_aspp_wrapper" - -zig_ar_wrapper="${PREFIX}/bin/$CROSS_NAME-target-ar" -make_wrapper "$zig_ar_wrapper" "${ZIG} ar" -make_windows_cmd_wrapper "$zig_ar_wrapper" - -zig_ar_wrapper="${PREFIX}/bin/$CROSS_NAME-target-ranlib" -make_wrapper "$zig_ar_wrapper" "${ZIG} ranlib -target ${HOST_TARGET}" -make_windows_cmd_wrapper "$zig_ar_wrapper" diff --git a/packages/conf-zig-wrapper-cross-aarch64-al2023/conf-zig-wrapper-cross-aarch64-al2023.0/opam b/packages/conf-zig-wrapper-cross-aarch64-al2023/conf-zig-wrapper-cross-aarch64-al2023.0/opam deleted file mode 100644 index 971e2a0..0000000 --- a/packages/conf-zig-wrapper-cross-aarch64-al2023/conf-zig-wrapper-cross-aarch64-al2023.0/opam +++ /dev/null @@ -1,14 +0,0 @@ -opam-version: "2.0" -maintainer: "hello@chrisarmstrong.dev" -build: [ - ["bash" "build.sh" "cross-aarch64-al2023"] -] -install: [ - ["bash" "install.sh" "%{prefix}%" "aarch64-al2023" "aarch64-linux-gnu.2.34"] -] -extra-files: [ - [ "install.sh" "sha256=ce868d40fb02ddf5aaaa33dc4dda05bd987ab2181beac0ad9cf1e24781eab05d" ] - [ "build.sh" "sha256=097c83837b6d88321e87ddde9587b375a6c4780cdaf6d5461e3fd00775486c04"] -] -synopsis: - "Virtual package specifying ocaml-cross zig wrapper utilities configuration" diff --git a/packages/conf-zig-wrapper-cross-x86_64-al2023/conf-zig-wrapper-cross-x86_64-al2023.0/files/build.sh b/packages/conf-zig-wrapper-cross-x86_64-al2023/conf-zig-wrapper-cross-x86_64-al2023.0/files/build.sh deleted file mode 100644 index d9049ee..0000000 --- a/packages/conf-zig-wrapper-cross-x86_64-al2023/conf-zig-wrapper-cross-x86_64-al2023.0/files/build.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -CROSS_NAME=$1 -ZIG=$(which zig) - -echo "zig_path: \"${ZIG}\"" >> "conf-zig-wrapper-${CROSS_NAME}.config" diff --git a/packages/conf-zig-wrapper-cross-x86_64-al2023/conf-zig-wrapper-cross-x86_64-al2023.0/opam b/packages/conf-zig-wrapper-cross-x86_64-al2023/conf-zig-wrapper-cross-x86_64-al2023.0/opam deleted file mode 100644 index 5a5f210..0000000 --- a/packages/conf-zig-wrapper-cross-x86_64-al2023/conf-zig-wrapper-cross-x86_64-al2023.0/opam +++ /dev/null @@ -1,14 +0,0 @@ -opam-version: "2.0" -maintainer: "hello@chrisarmstrong.dev" -build: [ - ["bash" "build.sh" "cross-x86_64-al2023"] -] -install: [ - ["bash" "install.sh" "%{prefix}%" "x86_64-al2023" "x86_64-linux-gnu.2.34"] -] -extra-files: [ - [ "install.sh" "sha256=ce868d40fb02ddf5aaaa33dc4dda05bd987ab2181beac0ad9cf1e24781eab05d" ] - [ "build.sh" "sha256=097c83837b6d88321e87ddde9587b375a6c4780cdaf6d5461e3fd00775486c04"] -] -synopsis: - "Virtual package specifying ocaml-cross zig wrapper utilities configuration" diff --git a/packages/conf-zig-wrapper-cross-x86_64-al2023/conf-zig-wrapper-cross-x86_64-al2023.0/files/install.sh b/packages/conf-zig-wrapper/conf-zig-wrapper.0/files/install.sh similarity index 93% rename from packages/conf-zig-wrapper-cross-x86_64-al2023/conf-zig-wrapper-cross-x86_64-al2023.0/files/install.sh rename to packages/conf-zig-wrapper/conf-zig-wrapper.0/files/install.sh index 97a0afe..db49f59 100644 --- a/packages/conf-zig-wrapper-cross-x86_64-al2023/conf-zig-wrapper-cross-x86_64-al2023.0/files/install.sh +++ b/packages/conf-zig-wrapper/conf-zig-wrapper.0/files/install.sh @@ -67,6 +67,10 @@ zig_cc_wrapper="${PREFIX}/bin/$CROSS_NAME-target-cc" make_wrapper "$zig_cc_wrapper" "${ZIG} cc -target ${HOST_TARGET}" make_windows_cmd_wrapper "$zig_cc_wrapper" +zig_cxx_wrapper="${PREFIX}/bin/$CROSS_NAME-target-c++" +make_wrapper "$zig_cxx_wrapper" "${ZIG} c++ -target ${HOST_TARGET}" +make_windows_cmd_wrapper "$zig_cxx_wrapper" + zig_aspp_wrapper="${PREFIX}/bin/$CROSS_NAME-target-aspp" make_wrapper "$zig_aspp_wrapper" "${ZIG} cc -target ${HOST_TARGET} -c" make_windows_cmd_wrapper "$zig_aspp_wrapper" diff --git a/packages/conf-zig-wrapper/conf-zig-wrapper.0/opam b/packages/conf-zig-wrapper/conf-zig-wrapper.0/opam new file mode 100644 index 0000000..f1116f4 --- /dev/null +++ b/packages/conf-zig-wrapper/conf-zig-wrapper.0/opam @@ -0,0 +1,11 @@ +opam-version: "2.0" +maintainer: "hello@chrisarmstrong.dev" +install: [ + ["bash" "install.sh" "%{prefix}%" "zig-cross" "%{conf-zig-cross:zig_triple}%"] +] +extra-files: [ + [ "install.sh" "sha256=73690c04b4779d2ec7bae905eb8d18da21bef48b765056fa892801416582473f" ] +] +depends: [ "conf-zig" "conf-zig-cross" ] +synopsis: + "Virtual package specifying ocaml-cross zig wrapper utilities configuration" diff --git a/packages/ocaml-cross-x86_64-al2023/ocaml-cross-x86_64-al2023.5.3.0/files/build.sh b/packages/ocaml-cross-x86_64-al2023/ocaml-cross-x86_64-al2023.5.3.0/files/build.sh deleted file mode 100755 index 5e77de1..0000000 --- a/packages/ocaml-cross-x86_64-al2023/ocaml-cross-x86_64-al2023.5.3.0/files/build.sh +++ /dev/null @@ -1,395 +0,0 @@ -#!/bin/sh - -set -eux - -# determine runtime machine -unameOut=$(uname -s) -case "$unameOut" in - Linux*) machine=Linux;; - Darwin*) machine=Mac;; - CYGWIN*) machine=Cygwin;; - MINGW*) machine=MinGW;; - MSYS_NT*) machine=MSys;; - *) machine="UNKNOWN:${unameOut}" -esac - -PREFIX= -CPU_COUNT=4 -SOURCE_DIR=$(realpath "${PWD}") -HOST_SWITCH= -ZIG=zig -EXTRA_CONFIG_OPTS= -OCAML_VERSION=5.2 -FLEXDLL_PATH= - -usage () { echo "$0 -p -o -c -t [-j ] [-s ] [-z ] [-a ] -f -v "; exit 1; } - -while getopts ":hp:t:j:s:z:g:o:a:v:t:f:c:" option; do - case $option in - p) - PREFIX=${OPTARG} - [ "$machine" = "Cygwin" ] && PREFIX=$(cygpath "$PREFIX") - ;; - j) - CPU_COUNT=${OPTARG} - ;; - s) - SOURCE_DIR=${OPTARG} - [ "$machine" = "Cygwin" ] && SOURCE_DIR=$(cygpath "$SOURCE_DIR") - ;; - z) - ZIG=${OPTARG} - ;; - v) - OCAML_VERSION=${OPTARG} - ;; - c) - CROSS_NAME=${OPTARG} - ;; - t) - OCAML_TARGET=${OPTARG} - ;; - o) - HOST_SWITCH=${OPTARG} - [ "$machine" = "Cygwin" ] && HOST_SWITCH=$(cygpath "$HOST_SWITCH") - ;; - a) - EXTRA_CONFIG_OPTS=${OPTARG} - ;; - f) - FLEXDLL_PATH=${OPTARG} - ;; - h | *) - usage - ;; - esac -done - -echo "Build plan" -echo "----------" -echo "" -echo "Prefix: ${PREFIX}" -echo "Cores: ${CPU_COUNT}" -echo "Cross Name: ${CROSS_NAME}" -echo "OCaml Target: ${OCAML_TARGET}" -echo "Zig Compiler: ${ZIG}" -echo "Host Switch: ${HOST_SWITCH}" -echo "Sources Dir: ${SOURCE_DIR}" -echo "OCaml Version: ${OCAML_VERSION}" -echo "Flexdll path: ${FLEXDLL_PATH}" - -if [ -z "${PREFIX}" ] -then - echo "Prefix directory not specified" - exit 1 -fi - -if ! which -s "$ZIG" > /dev/null -then - echo "Zig binary not executable" - exit 1 -fi - -if [ ! -d "${SOURCE_DIR}" ] -then - echo "Sources directory not found." - exit 1 -fi - -if [ ! -d "${HOST_SWITCH}" ] -then - echo "Host switch directory not found" - exit 1 -fi - -if [ ! -x "${HOST_SWITCH}/bin/ocamlc.opt" ] || [ ! -x "${HOST_SWITCH}/bin/ocamlopt.opt" ] -then - echo "Host compiler not found" - exit 1 -fi - -# OCaml is built in its source directory -BUILD_ROOT="${SOURCE_DIR}" - -# Configuration of host switch -HOST_MAKEFILE_CONFIG="$HOST_SWITCH/lib/ocaml/Makefile.config" - -# make_wrapper -# Make a shell wrapper for $2 that passes its arguments appended -# to the end, stored in $1 -make_wrapper() { - wrapper_script_path=$1 - caml_bin=$2 - cat << EOF > "$wrapper_script_path" -#!/bin/bash - -NEW_ARGS="" - -for ARG in "\$@"; do NEW_ARGS="\$NEW_ARGS \"\$ARG\""; done -eval "${caml_bin} \$NEW_ARGS" -EOF - chmod +x "$wrapper_script_path" -} - -# make_windows_cmd_wrapper -# -# Make a `.cmd` wrapper that can be called from ocamlmklib -# using the standard windows cmd.exe shell (using Unix.command) -# to run the specified script in Cygwin bash -make_windows_cmd_wrapper() { - if [ "$machine" = "Cygwin" ] - then - wrapper_script_path=$1 - cmd_script_path="$(dirname "$1")/$(basename "$1").cmd" - cat << EOF > "$cmd_script_path" -@echo off -setlocal - -if not exist "%~dpn0" echo Script "%~dpn0" not found & exit 2 - -set _CYGBIN=$(cygpath -w /)\\bin\\ -if not exist "%_CYGBIN%" echo Couldn't find Cygwin at "%_CYGBIN%" & exit 3 - -:: Resolve ___.sh to /cygdrive based *nix path and store in %_CYGSCRIPT -for /f "delims=" %%A in ('%_CYGBIN%cygpath.exe "%~dpn0"') do set _CYGSCRIPT=%%A - -:: Throw away temporary env vars and invoke script, passing any args that were passed to us -endlocal & %_CYGBIN%bash "%_CYGSCRIPT%" %* -EOF - fi -} - -# trim -# -# trim the specified string of leading and trailing whitespace -trim() { - echo "$1" | sed -e 's/^[[:space:]]*//;s/[[:space:]]*$//' -} - -# get_host_variable -# -# get a variable from variable from the Makefile.config of the host switch -get_host_variable () { - grep "^$1=" "$HOST_MAKEFILE_CONFIG" | awk -F '=' '{print $2}' -} - -# get_host_ocamlc_variable -# -# retrieve variable from `ocamlc -config` of host switch -get_host_ocamlc_variable () { - trim "$("$HOST_SWITCH/bin/ocamlc" -config | grep "^$1:" | cut -d ':' -f 2)" -} - -# ############################### -# Create OCaml and Compiler wrapper scripts (assists with multi-arg changes) - -# -- host compiler wrapper scripts (anchored in the build root) -host_compiler_path="$BUILD_ROOT/host-bin" -mkdir -p "$host_compiler_path" - -# Get the native path (in Windows terms) of the host switch -host_switch_native="$HOST_SWITCH" -[ "$machine" = "Cygwin" ] && host_switch_native=$(cygpath -m "$host_switch_native") - -host_ocamlc_wrapper="$host_compiler_path/host-ocamlc" -if [ "$machine" = "Cygwin" ] || [ "$machine" = "MinGW" ] -then - make_wrapper "$host_ocamlc_wrapper" "$host_switch_native/bin/ocamlc.opt -I ${host_switch_native}/lib/ocaml -I $host_switch_native/lib/ocaml/flexdll -I ${host_switch_native}/lib/ocaml/stublibs -I +unix -nostdlib " -else - make_wrapper "$host_ocamlc_wrapper" "$host_switch_native/bin/ocamlc.opt -I ${host_switch_native}/lib/ocaml -I ${host_switch_native}/lib/ocaml/stublibs -I +unix -nostdlib " -fi -make_windows_cmd_wrapper "$host_ocamlc_wrapper" - -host_ocamlopt_wrapper="$host_compiler_path/host-ocamlopt" -if [ "$machine" = "Cygwin" ] || [ "$machine" = "MinGW" ] -then - make_wrapper "$host_ocamlopt_wrapper" "${host_switch_native}/bin/ocamlopt.opt -I ${host_switch_native}/lib/ocaml -I $host_switch_native/lib/ocaml/flexdll -I +unix -nostdlib " -else - make_wrapper "$host_ocamlopt_wrapper" "${host_switch_native}/bin/ocamlopt.opt -I ${host_switch_native}/lib/ocaml -I +unix -nostdlib " -fi -make_windows_cmd_wrapper "$host_ocamlopt_wrapper" - -# Anchor the BUILD_ROOT with a native (windows) path that works outside cygwin -build_root_native=$BUILD_ROOT -[ "$machine" = "Cygwin" ] && build_root_native=$(cygpath -m "$BUILD_ROOT") - -# -- target ocaml compiler wrapper scripts (stored in temporary directory) -target_ocamlc_wrapper=$(mktemp -t target-ocamlc-XXXXX) -make_wrapper "$target_ocamlc_wrapper" "$build_root_native/ocamlc.opt -I $build_root_native/stdlib -I $build_root_native/otherlibs/unix -I ${host_switch_native}/lib/ocaml/stublibs -nostdlib " # trailing space is important -make_windows_cmd_wrapper "$target_ocamlc_wrapper" - -target_ocamlopt_wrapper=$(mktemp -t target-ocamlopt-XXXXX) -make_wrapper "$target_ocamlopt_wrapper" "$build_root_native/ocamlopt.opt -I $build_root_native/stdlib -I $build_root_native/otherlibs/unix -nostdlib " # trailing space is important -make_windows_cmd_wrapper "$target_ocamlopt_wrapper" - -# Disable function sections if the build machine doesn't support it -if [ "$(get_host_ocamlc_variable "function_sections")" != "true" ] -then - EXTRA_CONFIG_OPTS="${EXTRA_CONFIG_OPTS} --disable-function-sections" - echo "--- function sections disabled on host, disabling for target" -fi - -if [ $(expr "$OCAML_TARGET" : "^x86_64-w64-") -gt 0 ] -then - echo "--- x86_64-w64-* target means we need flexdll" - EXTRA_CONFIG_OPTS="${EXTRA_CONFIG_OPTS} --with-flexdll=${FLEXDLL_PATH}" -else - EXTRA_CONFIG_OPTS="${EXTRA_CONFIG_OPTS} --disable-flexdll" -fi - -echo "--- transposing host compiler configuration" - -echo "======= > ocamlc -config" -"$HOST_SWITCH/bin/ocamlc" -config -echo "======= > Makefile.config" -cat "$HOST_MAKEFILE_CONFIG" -echo "=======" - -host_cc=$(get_host_variable "CC") -host_cflags=$(get_host_variable "CFLAGS") -host_c_libraries=$(get_host_variable "LDFLAGS") -host_cppflags=$(get_host_variable "CPPFLAGS") -windows_unicode="$(get_host_ocamlc_variable "windows_unicode")" - -echo "--- host_cc=${host_cc}" -echo "--- host_cflags=${host_cflags}" -echo "--- host_c_libraries=${host_c_libraries}" -echo "--- host_cppflags=${host_cppflags}" -echo "--- windows_unicode='${windows_unicode}'" - -echo "--- Clean all configuration and previous builds" -cd "${BUILD_ROOT}" -rm -f config.cache -make distclean - -# bootstrap -echo "--- Build bootstrap (build -> host) compiler" -prefix_native="$PREFIX" -[ "$machine" = "Cygwin" ] && prefix_native=$(cygpath -m "$PREFIX") -ln_use="ln -s " -[ "$machine" = "Cygwin" ] && ln_use="cp " -echo "configuring with --host=${OCAML_TARGET} --prefix=${prefix_native} ${EXTRA_CONFIG_OPTS}" -export "PATH=$PREFIX/bin:$PATH" -# FIXME: patch configure to ignore flexlink when the host triplet is not Cygwin/MingW -zig_native="$ZIG" -[ "$machine" = "Cygwin" ] && zig_native=$(cygpath -m "$ZIG") -./configure --host="${OCAML_TARGET}" --prefix="$prefix_native" --disable-ocamldoc --disable-stdlib-manpages --disable-ocamltest --disable-ocamldebug \ - ${EXTRA_CONFIG_OPTS} \ - -C "CC=${CROSS_NAME}-target-cc" \ - "AR=${CROSS_NAME}-target-ar" \ - "RANLIB=${CROSS_NAME}-target-ranlib" \ - "ASPP=${CROSS_NAME}-target-aspp" \ - "MIN64CC=${CROSS_NAME}-target-cc" \ - "PARTIALLD=${CROSS_NAME}-target-cc -r " \ - "LD=${CROSS_NAME}-target-cc" \ - "LN=${ln_use}" || { echo " --- configure failed!"; cat config.log; exit 1; } - -# Set up sak compiler -cp Makefile.config Makefile.config.bak -echo "SAK_CC=${zig_native} cc" >> Makefile.config # fuck it lets just use zig because x86_64-w64-mingw32-gcc wants to be broken on Windows -# shellcheck disable=SC2016 -echo 'SAK_CFLAGS=$(OC_CFLAGS) $(OC_CPPFLAGS)' >> Makefile.config -if [ "$windows_unicode" = "true" ] -then - echo "SAK_LINK=\$(SAK_CC) -municode \$(SAK_CFLAGS) \$(OUTPUTEXE)\$(1) \$(2)" >> Makefile.config -else - echo "SAK_LINK=\$(SAK_CC) \$(SAK_CFLAGS) \$(OUTPUTEXE)\$(1) \$(2)" >> Makefile.config -fi -echo 'LN=cp ' >> Makefile.build_config - -# Set paths to host switch -OCAMLRUN="$HOST_SWITCH/bin/ocamlrun" -OCAMLLEX="$HOST_SWITCH/bin/ocamllex" -OCAMLYACC="$HOST_SWITCH/bin/ocamlyacc" -CAMLDEP="$HOST_SWITCH/bin/ocamlc" - -NATDYNLINK=$(get_host_variable "NATDYNLINK") -NATDYNLINKOPTS=$(get_host_variable "NATDYNLINKOPTS") - -has_zstd="false" -if [ "$(expr "$(get_host_ocamlc_variable "bytecomp_c_libraries")" : ".*zstd" )" -gt 0 ] -then - echo "-- zstd detected in host compiler! --" - has_zstd="true" -else - echo "-- zstd not detected in host compiler! -- $( "${HOST_SWITCH}/bin/ocamlopt.opt" -config | grep "^bytecomp_c_libraries:")" -fi - -make_caml () { - echo "-> make_caml $*" - make "-j$CPU_COUNT" \ - CAMLDEP="$CAMLDEP -depend" \ - OCAMLLEX="$OCAMLLEX" \ - OCAMLYACC="$OCAMLYACC" CAMLYACC="$OCAMLYACC" \ - CAMLRUN="$OCAMLRUN" OCAMLRUN="$OCAMLRUN" \ - NEW_OCAMLRUN="$OCAMLRUN" \ - CAMLC="$CAMLC" OCAMLC="$CAMLC" \ - CAMLOPT="$CAMLOPT" OCAMLOPT="$CAMLOPT" \ - MIN64CC="$MIN64CC" \ - "$@" -} - -make_host () { - echo "--making host: $*--" - CAMLC="$host_compiler_path/host-ocamlc" - [ "$machine" = "Cygwin" ] && CAMLC=$(cygpath -m "$(which "$CAMLC")") - CAMLOPT="$host_compiler_path/host-ocamlopt" - [ "$machine" = "Cygwin" ] && CAMLOPT=$(cygpath -m "$(which "$CAMLOPT")") - - ZSTD_LIBS=$(get_host_variable "ZSTD_LIBS") - BYTECC_LIBS=$(get_host_variable "BYTECC_LIBS") - MIN64CC="${CROSS_NAME}-target-cc" - make_caml \ - NATDYNLINK="$NATDYNLINK" \ - NATDYNLINKOPTS="$NATDYNLINKOPTS" \ - ZSTD_LIBS="${ZSTD_LIBS}" \ - BYTECC_LIBS="${BYTECC_LIBS}" \ - MIN64CC="$MIN64CC" \ - "$@" -} - -make_target () { - echo "making target: $*" - CAMLC="${target_ocamlc_wrapper}" - [ "$machine" = "Cygwin" ] && CAMLC=$(cygpath -m "$CAMLC") - CAMLOPT="${target_ocamlopt_wrapper}" - [ "$machine" = "Cygwin" ] && CAMLOPT=$(cygpath -m "$CAMLOPT") - - MIN64CC="${CROSS_NAME}-target-cc" - make_caml \ - BUILD_ROOT="$build_root_native" \ - CAMLC="$CAMLC" \ - CAMLOPT="$CAMLOPT" \ - MIN64CC="$MIN64CC" \ - "$@" -} -echo "---- MAKING HOST ----" -make_host runtime -make_host coreall -make_host opt-core -make_host ocamlc.opt -make_host ocamlopt.opt -make_host compilerlibs/ocamltoplevel.cma -make_host otherlibraries -make_host ocamltoolsopt ocamltoolsopt.opt -# make_host othertools - -echo "---- MAKING TARGET ----" -rm $(find . | grep -E '\.cm.?.$') -make_target -C stdlib all allopt -make_target ocaml ocamlc -make_target ocamlopt -make_target otherlibraries otherlibrariesopt ocamltoolsopt \ - driver/main.cmx driver/optmain.cmx - -# build the compiler shared libraries with the target `zstd.npic.o` -cp Makefile.config.bak Makefile.config -echo "SAK_CC=${CROSS_NAME}-target-cc" >> Makefile.config -make_target compilerlibs/ocamlcommon.cmxa \ - compilerlibs/ocamlbytecomp.cmxa \ - compilerlibs/ocamloptcomp.cmxa - # compilerlibs/ocamltoplevel.cmxa -if [ $(expr "$OCAML_VERSION" : '^5\.') -gt 0 ] -then - make_target -C otherlibs all allopt -fi diff --git a/packages/ocaml-cross-x86_64-al2023/ocaml-cross-x86_64-al2023.5.3.0/files/cross_5_3.patch b/packages/ocaml-cross-x86_64-al2023/ocaml-cross-x86_64-al2023.5.3.0/files/cross_5_3.patch deleted file mode 100644 index 026a96d..0000000 --- a/packages/ocaml-cross-x86_64-al2023/ocaml-cross-x86_64-al2023.5.3.0/files/cross_5_3.patch +++ /dev/null @@ -1,200 +0,0 @@ -diff --git a/Makefile b/Makefile -index b23c9c30de..ebb2bc7116 100644 ---- a/Makefile -+++ b/Makefile -@@ -1405,7 +1405,8 @@ runtime/build_config.h: $(ROOTDIR)/Makefile.config $(SAK) - ## Runtime libraries and programs - - runtime/ocamlrun$(EXE): runtime/prims.$(O) runtime/libcamlrun.$(A) -- $(V_MKEXE)$(MKEXE) -o $@ $^ $(BYTECCLIBS) -+ cp $(OCAMLRUN) $@ -+ chmod 755 $@ - - runtime/ocamlruns$(EXE): runtime/prims.$(O) runtime/libcamlrun_non_shared.$(A) - $(V_MKEXE)$(call MKEXE_VIA_CC,$@,$^ $(BYTECCLIBS)) -@@ -1492,6 +1493,8 @@ runtime/%.npic.$(O): OC_CFLAGS = $(OC_NATIVE_CFLAGS) $(SHAREDLIB_CFLAGS) - runtime/%.npic.$(O): OC_CPPFLAGS = $(OC_NATIVE_CPPFLAGS) - $(DEPDIR)/runtime/%.npic.$(D): OC_CPPFLAGS = $(OC_NATIVE_CPPFLAGS) - -+runtime/zstd.npic.$(O): CC=$(SAK_CC) -+ - ## Compilation of runtime C files - - # The COMPILE_C_FILE macro below receives as argument the pattern -@@ -2444,7 +2447,7 @@ ocamltex_SOURCES = tools/ocamltex.mli tools/ocamltex.ml - # configuration. - # Note: the following definitions apply to all the prerequisites - # of ocamltex. --$(ocamltex): CAMLC = $(OCAMLRUN) $(ROOTDIR)/ocamlc$(EXE) $(STDLIBFLAGS) -+$(ocamltex): CAMLC = $(CAMLC) $(STDLIBFLAGS) - $(ocamltex): OC_COMMON_LINKFLAGS += -linkall - $(ocamltex): VPATH += $(addprefix otherlibs/,str unix) - -@@ -2927,8 +2930,6 @@ ifeq "$(BOOTSTRAPPING_FLEXDLL)" "true" - endif - $(INSTALL_DATA) \ - utils/*.cmx parsing/*.cmx typing/*.cmx bytecomp/*.cmx \ -- toplevel/*.cmx toplevel/native/*.cmx \ -- toplevel/native/tophooks.cmi \ - file_formats/*.cmx \ - lambda/*.cmx \ - driver/*.cmx asmcomp/*.cmx middle_end/*.cmx \ -@@ -2942,7 +2943,6 @@ endif - $(INSTALL_DATA) \ - $(ocamlc_CMX_FILES) $(ocamlc_CMX_FILES:.cmx=.$(O)) \ - $(ocamlopt_CMX_FILES) $(ocamlopt_CMX_FILES:.cmx=.$(O)) \ -- $(ocamlnat_CMX_FILES:.cmx=.$(O)) \ - "$(INSTALL_COMPLIBDIR)" - ifeq "$(INSTALL_OCAMLNAT)" "true" - $(INSTALL_PROG) ocamlnat$(EXE) "$(INSTALL_BINDIR)" ---- a/configure -+++ b/configure -@@ -1,60 +1,4 @@ - #! /bin/sh -- --if test -e '.git' ; then : -- if test -z "$ac_read_git_config" ; then : -- extra_args=$(git config ocaml.configure 2>/dev/null) -- extended_cache=$(git config ocaml.configure-cache 2>/dev/null) -- cache_file= -- -- # If ocaml.configure-cache is set, parse the command-line for the --host -- # option, in order to determine the name of the cache file. -- if test -n "$extended_cache" ; then : -- echo "Detected Git configuration option ocaml.configure-cache set to \ --\"$extended_cache\"" -- dashdash= -- prev= -- host=default -- # The logic here is pretty borrowed from autoconf's -- for option in $extra_args "$@" -- do -- if test -n "$prev" ; then : -- host=$option -- continue -- fi -- -- case $dashdash$option in -- --) -- dashdash=yes ;; -- -host | --host | --hos | --ho) -- prev=host ;; -- -host=* | --host=* | --hos=* | --ho=*) -- case $option in -- *=?*) host=$(expr "X$option" : '[^=]*=\(.*\)') ;; -- *=) host= ;; -- esac ;; -- esac -- done -- cache_file="`dirname "$0"`/$extended_cache/ocaml-$host.cache" -- fi -- -- # If either option has a value, re-invoke configure -- if test -n "$extra_args$cache_file" ; then : -- echo "Detected Git configuration option ocaml.configure set to \ --\"$extra_args\"" -- # Too much effort to get the echo to show appropriate quoting - the -- # invocation itself intentionally quotes $0 and passes $@ exactly as given -- # but allows a single expansion of ocaml.configure -- if test -n "$cache_file" ; then : -- echo "Re-running $0 $extra_args --cache-file \"$cache_file\" $@" -- ac_read_git_config=true exec "$0" $extra_args \ -- --cache-file "$cache_file" "$@" -- else -- echo "Re-running $0 $extra_args $@" -- ac_read_git_config=true exec "$0" $extra_args "$@" -- fi -- fi -- fi --fi - # Guess values for system-dependent variables and create Makefiles. - # Generated by GNU Autoconf 2.71 for OCaml 5.3.0. - # -@@ -14114,6 +14058,13 @@ - common_cflags="-O2 -fno-strict-aliasing -fwrapv -mms-bitfields" - internal_cppflags='-D__USE_MINGW_ANSI_STDIO=0 -DUNICODE -D_UNICODE' - internal_cppflags="$internal_cppflags -DWINDOWS_UNICODE=$windows_unicode" ;; #( -+ mingw-*-*-clang-*) : -+ internal_cflags="-Wno-unused $cc_warnings \ -+-fexcess-precision=standard" -+ # TODO: see whether the code can be fixed to avoid -Wno-unused -+ common_cflags="-O2 -fno-strict-aliasing -fwrapv -mms-bitfields" -+ internal_cppflags='-D__USE_MINGW_ANSI_STDIO=0 -DUNICODE -D_UNICODE' -+ internal_cppflags="$internal_cppflags -DWINDOWS_UNICODE=$windows_unicode" ;; #( - mingw-*) : - as_fn_error $? "Unsupported C compiler for a MinGW-w64 build" "$LINENO" 5 ;; #( - msvc-0*|msvc-1[0-8]*|msvc-19[012]*|msvc-193[0-7]) : -@@ -14305,7 +14249,9 @@ fi ;; - esac - fi - -- # Extract the first word of "flexlink", so it can be a program name with args. -+ case $target in #( -+ *-*-cygwin*|*-w64-mingw32*|*-pc-windows) : -+ # Extract the first word of "flexlink", so it can be a program name with args. - set dummy flexlink; ac_word=$2 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - printf %s "checking for $ac_word... " >&6; } -@@ -14346,7 +14292,10 @@ else - printf "%s\n" "no" >&6; } - fi - -- -+ ;; #( -+ *) : -+ ;; -+esac - - if test -n "$flexlink" && test -z "$flexdll_source_dir" - then : -@@ -22414,9 +22363,9 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" - } --/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\r?\$)/ { -+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 -- split(line, arg, /[ \r\t]/) -+ split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] ---- a/configure.ac -+++ b/configure.ac - -@@ -900,6 +900,13 @@ - common_cflags="-O2 -fno-strict-aliasing -fwrapv -mms-bitfields" - internal_cppflags='-D__USE_MINGW_ANSI_STDIO=0 -DUNICODE -D_UNICODE' - internal_cppflags="$internal_cppflags -DWINDOWS_UNICODE=$windows_unicode"], -+ [mingw-*-*-clang-*], -+ [internal_cflags="-Wno-unused $cc_warnings \ -+-fexcess-precision=standard" -+ # TODO: see whether the code can be fixed to avoid -Wno-unused -+ common_cflags="-O2 -fno-strict-aliasing -fwrapv -mms-bitfields" -+ internal_cppflags='-D__USE_MINGW_ANSI_STDIO=0 -DUNICODE -D_UNICODE' -+ internal_cppflags="$internal_cppflags -DWINDOWS_UNICODE=$windows_unicode"], - [mingw-*], - [AC_MSG_ERROR([Unsupported C compiler for a MinGW-w64 build])], - [msvc-0*|msvc-1[[0-8]]*|msvc-19[[012]]*|msvc-193[[0-7]]], -@@ -1015,7 +1015,9 @@ AS_IF([test x"$supports_shared_libraries" != 'xfalse'], [ - [AC_MSG_RESULT([requested but not supported]) - AC_MSG_ERROR([exiting])])])]) - -- AC_CHECK_PROG([flexlink],[flexlink],[flexlink]) -+ AS_CASE([$target], -+ [*-*-cygwin*|*-w64-mingw32*|*-pc-windows], -+ [AC_CHECK_PROG([flexlink],[flexlink],[flexlink])]) - - AS_IF([test -n "$flexlink" && test -z "$flexdll_source_dir"],[ - OCAML_TEST_FLEXLINK([$flexlink], [$flexdll_chain], -diff -r -u ocaml-5.3.0/stdlib/Makefile ocaml-5.3.0-new/stdlib/Makefile ---- a/stdlib/Makefile 2025-01-08 09:01:04.000000000 +0000 -+++ b/stdlib/Makefile 2025-02-03 22:14:58.048866819 +0000 -@@ -96,7 +96,6 @@ - .INTERMEDIATE: tmpheader.exe - tmpheader.exe: $(HEADERPROGRAM).$(O) - $(V_MKEXE)$(call MKEXE_VIA_CC,$@,$^) -- $(STRIP) $@ - - stdlib.cma: $(OBJS) - $(V_LINKC)$(CAMLC) -a -o $@ $^ diff --git a/packages/ocaml-cross-x86_64-al2023/ocaml-cross-x86_64-al2023.5.3.0/files/install.sh b/packages/ocaml-cross-x86_64-al2023/ocaml-cross-x86_64-al2023.5.3.0/files/install.sh deleted file mode 100644 index ba1d310..0000000 --- a/packages/ocaml-cross-x86_64-al2023/ocaml-cross-x86_64-al2023.5.3.0/files/install.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash - -set -exu - -PREFIX=$1 -HOST_SWITCH=$2 -CROSS_NAME=$3 - -# determine runtime machine -unameOut=$(uname -s) -case "$unameOut" in - Linux*) machine=Linux;; - Darwin*) machine=Mac;; - CYGWIN*) machine=Cygwin;; - MINGW*) machine=MinGW;; - MSYS_NT*) machine=MSys;; - *) machine="UNKNOWN:${unameOut}" -esac - -# update paths to use cygpath format -mkdir -p "$PREFIX" -[ "$machine" = "Cygwin" ] && PREFIX=$(cygpath "$PREFIX") -[ "$machine" = "Cygwin" ] && HOST_SWITCH=$(cygpath "$HOST_SWITCH") - -if [ ! -d "${PREFIX}" ] -then - echo "Prefix directory \"$PREFIX\" is not a directory / does not exist" - exit 1 -fi - -if [ ! -d "${HOST_SWITCH}" ] -then - echo "Host switch directory \"$HOST_SWITCH\" does not exist" - exit 1 -fi - -if [ -z "$CROSS_NAME" ] -then - echo "A toolchain name must be specified" - exit 1 -fi - -echo "-- making directories in $PREFIX" -mkdir -p "$PREFIX/bin" -mkdir -p "$PREFIX/lib" -mkdir -p "$PREFIX/lib/ocaml/caml" -mkdir -p "$PREFIX/lib/ocaml/stublibs" -mkdir -p "$PREFIX/lib/stublibs" - -echo "-- installing compiler tooling to $PREFIX" -OCAMLRUN="$HOST_SWITCH/bin/ocamlrun" make install - -echo "-- seting up ocamlfind config for host switch $HOST_SWITCH with toolchain $CROSS_NAME" -mv "$HOST_SWITCH/lib/findlib.conf" "$HOST_SWITCH/lib/findlib.conf.bak" -sed -e "/(${CROSS_NAME})/d" "$HOST_SWITCH/lib/findlib.conf.bak" > "$HOST_SWITCH/lib/findlib.conf" -prefix_native="${PREFIX}" -[ "$machine" = "Cygwin" ] && prefix_native=$(cygpath -m "$prefix_native") -cat << EOF >> "$HOST_SWITCH/lib/findlib.conf" -path($CROSS_NAME)="$prefix_native/lib:$PREFIX/lib/ocaml" -destdir($CROSS_NAME)="$prefix_native/lib" -stdlib($CROSS_NAME)="$prefix_native/lib/ocaml" -ocamlc($CROSS_NAME)="$prefix_native/bin/ocamlc" -ocamlopt($CROSS_NAME)="$prefix_native/bin/ocamlopt" -ocamldep($CROSS_NAME)="$prefix_native/bin/ocamldep" -ocamlmklib($CROSS_NAME)="$prefix_native/bin/ocamlmklib" -ldconf($CROSS_NAME)="$prefix_native/lib/ocaml/ld.conf" -EOF - -cat << EOF > "$PREFIX/lib/ocaml/ld.conf" -$prefix_native/lib/ocaml/stublibs -$prefix_native/lib/ocaml -EOF diff --git a/packages/ocaml-cross-x86_64-al2023/ocaml-cross-x86_64-al2023.5.3.0/opam b/packages/ocaml-cross-x86_64-al2023/ocaml-cross-x86_64-al2023.5.3.0/opam deleted file mode 100644 index dfefe56..0000000 --- a/packages/ocaml-cross-x86_64-al2023/ocaml-cross-x86_64-al2023.5.3.0/opam +++ /dev/null @@ -1,94 +0,0 @@ -opam-version: "2.0" -license: "LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception" -synopsis: "OCaml 5.3.0 cross-compiled for x86_64-al2023" -maintainer: [ - "Chris Armstrong " -] -authors: [ - "Xavier Leroy" - "Damien Doligez" - "Alain Frisch" - "Jacques Garrigue" - "Didier Rémy" - "KC Sivaramakrishnan" - "Jérôme Vouillon" -] -homepage: "https://ocaml.org" -bug-reports: "https://github.com/ocaml/opam-repository/issues" -dev-repo: "git+https://github.com/ocaml/ocaml.git#5.3" -depends: [ - # This is OCaml 5.3.0 - "ocaml" {= "5.3.0" & post} - - # General base- packages - "base-unix" {post} - "base-bigarray" {post} - "base-threads" {post} - "base-domains" {post} - "base-nnp" {post} - "base-effects" {post} - - # Port selection (Windows) - # amd64 mingw-w64 / MSVC - (("arch-x86_64" {os = "win32" & arch = "x86_64"} & - (("system-mingw" & "mingw-w64-shims" {os-distribution = "cygwin" & build}) | - ("system-msvc" & "winpthreads" & "ocaml-option-no-compression" {os = "win32"}))) | - # i686 mingw-w64 / MSVC - ("arch-x86_32" {os = "win32"} & "ocaml-option-bytecode-only" {os = "win32"} & - (("system-mingw" & "mingw-w64-shims" {os-distribution = "cygwin" & build}) | - ("system-msvc" & "winpthreads" & "ocaml-option-no-compression" {os = "win32"}))) | - # Non-Windows systems need to install something to satisfy this formula, so - # repeat the base-unix dependency - "base-unix" {os != "win32" & post}) - - # All the 32-bit architectures are bytecode-only - "ocaml-option-bytecode-only" {arch != "arm64" & arch != "x86_64" & arch != "s390x" & arch != "riscv64" & arch != "ppc64"} - - # Support Packages - "conf-zig-wrapper-cross-x86_64-al2023" - - # ocamlfind (needed for findlib extension) - "ocamlfind" -] -setenv: CAML_LD_LIBRARY_PATH = "%{lib}%/stublibs" -x-env-path-rewrite: [ - [CAML_LD_LIBRARY_PATH (";" {os = "win32"} ":" {os != "win32"}) "target"] -] -build-env: [ - [MSYS2_ARG_CONV_EXCL = "*"] - [LSAN_OPTIONS = "detect_leaks=0,exitcode=0"] - [ASAN_OPTIONS = "detect_leaks=0,exitcode=0"] -] -build: [ - [ "sh" "-x" "./build.sh" - "-p" "%{prefix}%/cross-sysroot" - "-o" "%{prefix}%" - "-c" "x86_64-al2023" - "-t" "x86_64-linux-gnu" # ocaml target triple - "-j" "%{jobs}%" - "-z" "%{conf-zig-wrapper-cross-x86_64-al2023:zig_path}%" - "-f" "%{flexdll:share}%" - "-v" "5.3" - ] -] -install: [ "sh" "install.sh" "%{prefix}%/cross-sysroot" "%{prefix}%" "cross"] -url { - src: "https://github.com/ocaml/ocaml/releases/download/5.3.0/ocaml-5.3.0.tar.gz" - checksum: "sha256=22c1dd9de21bf43b62d1909041fb5fad648905227bf69550a6a6bef31e654f38" -} -extra-files: [ - [ "build.sh" "sha256=09c02764edaffb4cb3bf050cbc388c5bbf9f9ad0ec925010deff28e6db4adb34" ] - [ "install.sh" "sha256=99ab924fbd2821b81779395294b2254ed7ae791d64f48b66dcfdf8eaec8f64ad" ] - [ "cross_5_3.patch" "sha256=a65899d6ec53f166963d6b11b08eda7b571b729b6b25a03034451160a229896c" ] -] -extra-source "ocaml-cross.install" { - src: - "https://raw.githubusercontent.com/ocaml/opam-source-archives/main/patches/ocaml-base-compiler/ocaml-base-compiler.install" - checksum: [ - "sha256=79f2a1a5044a91350a0eb6ce12e261a72a2855c094c425cddf3860e58c486678" - "md5=3e969b841df1f51ca448e6e6295cb451" - ] -} -patches: [ - "cross_5_3.patch" -] diff --git a/packages/ocaml-cross-aarch64-al2023/ocaml-cross-aarch64-al2023.5.3.0/files/build.sh b/packages/ocaml-zig-cross/ocaml-zig-cross.5.3.0/files/build.sh similarity index 98% rename from packages/ocaml-cross-aarch64-al2023/ocaml-cross-aarch64-al2023.5.3.0/files/build.sh rename to packages/ocaml-zig-cross/ocaml-zig-cross.5.3.0/files/build.sh index 5e77de1..fc1de37 100755 --- a/packages/ocaml-cross-aarch64-al2023/ocaml-cross-aarch64-al2023.5.3.0/files/build.sh +++ b/packages/ocaml-zig-cross/ocaml-zig-cross.5.3.0/files/build.sh @@ -17,12 +17,14 @@ PREFIX= CPU_COUNT=4 SOURCE_DIR=$(realpath "${PWD}") HOST_SWITCH= -ZIG=zig +ZIG=$(which zig) EXTRA_CONFIG_OPTS= OCAML_VERSION=5.2 FLEXDLL_PATH= +export ZIG_GLOBAL_CACHE_DIR=$TMPDIR/zig-cache +export ZIG_LOCAL_CACHE_DIR=$TMPDIR/zig-cache-local -usage () { echo "$0 -p -o -c -t [-j ] [-s ] [-z ] [-a ] -f -v "; exit 1; } +usage () { echo "$0 -p -o -c -t [-j ] [-s ] [-a ] -f -v "; exit 1; } while getopts ":hp:t:j:s:z:g:o:a:v:t:f:c:" option; do case $option in diff --git a/packages/ocaml-cross-aarch64-al2023/ocaml-cross-aarch64-al2023.5.3.0/files/cross_5_3.patch b/packages/ocaml-zig-cross/ocaml-zig-cross.5.3.0/files/cross_5_3.patch similarity index 100% rename from packages/ocaml-cross-aarch64-al2023/ocaml-cross-aarch64-al2023.5.3.0/files/cross_5_3.patch rename to packages/ocaml-zig-cross/ocaml-zig-cross.5.3.0/files/cross_5_3.patch diff --git a/packages/ocaml-cross-aarch64-al2023/ocaml-cross-aarch64-al2023.5.3.0/files/install.sh b/packages/ocaml-zig-cross/ocaml-zig-cross.5.3.0/files/install.sh similarity index 94% rename from packages/ocaml-cross-aarch64-al2023/ocaml-cross-aarch64-al2023.5.3.0/files/install.sh rename to packages/ocaml-zig-cross/ocaml-zig-cross.5.3.0/files/install.sh index ba1d310..f2892f0 100644 --- a/packages/ocaml-cross-aarch64-al2023/ocaml-cross-aarch64-al2023.5.3.0/files/install.sh +++ b/packages/ocaml-zig-cross/ocaml-zig-cross.5.3.0/files/install.sh @@ -6,6 +6,9 @@ PREFIX=$1 HOST_SWITCH=$2 CROSS_NAME=$3 +export ZIG_GLOBAL_CACHE_DIR=${TMPDIR:-/tmp}/zig-cache +export ZIG_LOCAL_CACHE_DIR=${TMPDIR:-/tmp}/zig-cache-local + # determine runtime machine unameOut=$(uname -s) case "$unameOut" in diff --git a/packages/ocaml-cross-aarch64-al2023/ocaml-cross-aarch64-al2023.5.3.0/opam b/packages/ocaml-zig-cross/ocaml-zig-cross.5.3.0/opam similarity index 84% rename from packages/ocaml-cross-aarch64-al2023/ocaml-cross-aarch64-al2023.5.3.0/opam rename to packages/ocaml-zig-cross/ocaml-zig-cross.5.3.0/opam index e2c4e26..af021f4 100644 --- a/packages/ocaml-cross-aarch64-al2023/ocaml-cross-aarch64-al2023.5.3.0/opam +++ b/packages/ocaml-zig-cross/ocaml-zig-cross.5.3.0/opam @@ -44,8 +44,7 @@ depends: [ # All the 32-bit architectures are bytecode-only "ocaml-option-bytecode-only" {arch != "arm64" & arch != "x86_64" & arch != "s390x" & arch != "riscv64" & arch != "ppc64"} - # Support Packages - "conf-zig-wrapper-cross-aarch64-al2023" + "conf-zig-wrapper" # ocamlfind (needed for findlib extension) "ocamlfind" @@ -60,13 +59,12 @@ build-env: [ [ASAN_OPTIONS = "detect_leaks=0,exitcode=0"] ] build: [ - [ "sh" "-x" "./build.sh" - "-p" "%{prefix}%/cross-sysroot" + [ "sh" "-x" "./build.sh" + "-p" "%{prefix}%/cross-sysroot" "-o" "%{prefix}%" - "-c" "aarch64-al2023" # zig target triple (can differ from gnu variants) - "-t" "aarch64-linux-gnu" # ocaml target triple - "-j" "%{jobs}%" - "-z" "%{conf-zig-wrapper-cross-aarch64-al2023:zig_path}%" + "-c" "zig-cross" + "-t" "%{conf-zig-cross:ocaml_triple}%" + "-j" "%{jobs}%" "-f" "%{flexdll:share}%" "-v" "5.3" ] @@ -77,8 +75,8 @@ url { checksum: "sha256=22c1dd9de21bf43b62d1909041fb5fad648905227bf69550a6a6bef31e654f38" } extra-files: [ - [ "build.sh" "sha256=09c02764edaffb4cb3bf050cbc388c5bbf9f9ad0ec925010deff28e6db4adb34" ] - [ "install.sh" "sha256=99ab924fbd2821b81779395294b2254ed7ae791d64f48b66dcfdf8eaec8f64ad" ] + [ "build.sh" "sha256=9a1a7bdcd1685844e5f0efd9125535c1da66ada253767e28189532b04cf2403e" ] + [ "install.sh" "sha256=1a99f3df4d160874c3c85db995f5a080164f235f02ce73fd1b8ec7ad5f01c22e" ] [ "cross_5_3.patch" "sha256=a65899d6ec53f166963d6b11b08eda7b571b729b6b25a03034451160a229896c" ] ] extra-source "ocaml-cross.install" {