Skip to content

Commit

Permalink
Package variables don't work in available field
Browse files Browse the repository at this point in the history
Package variables like `conf-ios:arch` don't work in the `available` field. See the "Now let's get to the funny details..." section in ocaml/opam#2537 (comment). The limitation is also mentioned in the opam docs: https://opam.ocaml.org/doc/Manual.html#opamfield-available.

I'm not sure of the right fix but here's an idea. Change `available` field to rely on a global variable rather than a package variable. I defined a global variable `conf-ios-arch` at my command line like this:

```
opam config set conf-ios-arch "amd64"
```
  • Loading branch information
Adam Comella authored and abate committed Nov 6, 2019
1 parent 5307693 commit 82c6cb9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,27 @@ Pin some prerequisite packages that don't yet have fixes merged upstream:

Configure the compiler for 32-bit ARM:

ARCH=arm SUBARCH=armv7s PLATFORM=iPhoneOS SDK=9.3 VER=8.0 \
opam install conf-ios
(export ARCH=arm SUBARCH=armv7s PLATFORM=iPhoneOS SDK=11.2 VER=8.0 \
&& opam config set conf-ios-arch $ARCH \
&& opam install conf-ios)

... for 64-bit ARM

ARCH=arm64 SUBARCH=arm64 PLATFORM=iPhoneOS SDK=9.3 VER=8.0 \
opam install conf-ios
(export ARCH=arm64 SUBARCH=arm64 PLATFORM=iPhoneOS SDK=11.2 VER=8.0 \
&& opam config set conf-ios-arch $ARCH \
&& opam install conf-ios)

... for 32-bit x86:

ARCH=i386 SUBARCH=i386 PLATFORM=iPhoneSimulator SDK=9.3 VER=8.0 \
opam install conf-ios
(export ARCH=i386 SUBARCH=i386 PLATFORM=iPhoneSimulator SDK=11.2 VER=8.0 \
&& opam config set conf-ios-arch $ARCH \
&& opam install conf-ios)

... for 64-bit x86:

ARCH=amd64 SUBARCH=x86_64 PLATFORM=iPhoneSimulator SDK=9.3 VER=8.0 \
opam install conf-ios
(export ARCH=amd64 SUBARCH=x86_64 PLATFORM=iPhoneSimulator SDK=11.2 VER=8.0 \
&& opam config set conf-ios-arch $ARCH \
&& opam install conf-ios)

Some options can be further tweaked:

Expand Down
2 changes: 1 addition & 1 deletion packages/ocaml-ios32.4.04.0/opam
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ depopts: [
conflicts: [
"ocaml-ios64"
]
available: [ ocaml-version = "4.04.0" & (conf-ios:arch = "arm" | conf-ios:arch = "i386") ]
available: [ ocaml-version = "4.04.0" & (conf-ios-arch = "arm" | conf-ios-arch = "i386") ]
2 changes: 1 addition & 1 deletion packages/ocaml-ios64.4.04.0/opam
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ depopts: [
conflicts: [
"ocaml-ios32"
]
available: [ ocaml-version = "4.04.0" & (conf-ios:arch = "arm64" | conf-ios:arch = "amd64") ]
available: [ ocaml-version = "4.04.0" & (conf-ios-arch = "arm64" | conf-ios-arch = "amd64") ]

0 comments on commit 82c6cb9

Please sign in to comment.