Skip to content

Commit

Permalink
Merge pull request #3 from nberth/fix-ocaml-osx
Browse files Browse the repository at this point in the history
ocaml-osx: use opam way to set `sysroot` variable
  • Loading branch information
nberth authored Jul 30, 2024
2 parents 9cad29c + 508d47f commit 9a65a29
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ ocamlmklib(osx) = "%{prefix}%/osx-sysroot/bin/ocamlmklib"
ocamlmktop(osx) = "%{prefix}%/bin/ocamlmktop"
ocamldoc(osx) = "%{prefix}%/bin/ocamldoc"
ocamldep(osx) = "%{prefix}%/bin/ocamldep"
ocaml(osx) = "%{prefix}%/bin/ocaml"
2 changes: 1 addition & 1 deletion packages/ocaml-osx-a64/ocaml-osx-a64.4.14.1/opam
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ conflicts: [
]
synopsis: "OCaml cross-compiler for ARM 64-bit OSX targets"
extra-files: [
["osx.conf.in" "md5=35f05317e15cc87c9e76f25b0efa5c96"]
["osx.conf.in" "md5=78bcfd75764edd01d83c1a1d08ded2fd"]
["build.sh" "md5=3026069500fab03a75373ac8100acf5e"]
["install.sh" "md5=c08afd8e166a799d25ed86a6a48a7df7"]
["patches/ostype-fix.patch" "md5=0da73e29a493025ed3cbbfb5226034e4"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ ocamlmklib(osx) = "%{prefix}%/osx-sysroot/bin/ocamlmklib"
ocamlmktop(osx) = "%{prefix}%/bin/ocamlmktop"
ocamldoc(osx) = "%{prefix}%/bin/ocamldoc"
ocamldep(osx) = "%{prefix}%/bin/ocamldep"
ocaml(osx) = "%{prefix}%/bin/ocaml"
2 changes: 1 addition & 1 deletion packages/ocaml-osx-i64/ocaml-osx-i64.4.14.1/opam
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ conflicts: [
]
synopsis: "OCaml cross-compiler for Intel 64-bit OSX targets"
extra-files: [
["osx.conf.in" "md5=35f05317e15cc87c9e76f25b0efa5c96"]
["osx.conf.in" "md5=78bcfd75764edd01d83c1a1d08ded2fd"]
["build.sh" "md5=3026069500fab03a75373ac8100acf5e"]
["install.sh" "md5=c08afd8e166a799d25ed86a6a48a7df7"]
["patches/ostype-fix.patch" "md5=0da73e29a493025ed3cbbfb5226034e4"]
Expand Down
7 changes: 6 additions & 1 deletion packages/ocaml-osx/ocaml-osx.4.14.1/files/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
OPAM_PREFIX="$1"
HOST="$2"

echo "sysroot: \"${OPAM_PREFIX}/osx-sysroot\"" > ${OPAM_PREFIX}/.opam-switch/config/ocaml-osx.config
cat > "ocaml-osx.config" <<EOF
opam-version: "2.0"
variables {
sysroot: "${OPAM_PREFIX}/osx-sysroot"
}
EOF

for bin in ocamlc ocamlopt ocamlmklib; do
ln -s "${OPAM_PREFIX}/osx-sysroot/bin/${bin}" "${OPAM_PREFIX}/bin/${HOST}-${bin}"
Expand Down
2 changes: 0 additions & 2 deletions packages/ocaml-osx/ocaml-osx.4.14.1/files/remove.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
OPAM_PREFIX="$1"
HOST="$2"

rm ${OPAM_PREFIX}/.opam-switch/config/ocaml-osx.config

for bin in ocamlc ocamlopt ocamlcp ocamlmklib ocamlmktop ocamldoc ocamldep; do
rm -f "${OPAM_PREFIX}/bin/${HOST}-${bin}"
done
4 changes: 2 additions & 2 deletions packages/ocaml-osx/ocaml-osx.4.14.1/opam
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ depends: [
]
synopsis: "A meta-package depending on any OCaml 64-bit OSX cross-compiler"
extra-files: [
["remove.sh" "md5=5bfce83b4866826b27d38aee7b7f34a5"]
["install.sh" "md5=91af927717fe6b01b8877eab86da9340"]
["remove.sh" "md5=871758a71eca37824ee76a6cba004ab1"]
["install.sh" "md5=ec5aa7be9ac5b4b2d0cd6ea92ffeaba2"]
]

0 comments on commit 9a65a29

Please sign in to comment.