Skip to content

Commit

Permalink
Fix the environment in opam env as well for macOS
Browse files Browse the repository at this point in the history
This has to be done using a separate package since setenv cannot be
filtered and opam 2.0.10/2.1.4 and earlier cannot handle a setenv with
an empty string in the environment update.
  • Loading branch information
dra27 committed Feb 7, 2024
1 parent 8ddd144 commit 6cf5424
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
25 changes: 25 additions & 0 deletions packages/conf-openblas-macOS-env/conf-openblas-macOS-env.1/opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
opam-version: "2.0"
maintainer: "David Allsopp"
authors: [ "David Allsopp" ]
homepage: "https://opam.ocaml.org"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
license: "ISC"
build: [
"sh"
"-exc"
"printf 'opam-version: \"2.0\"\\nvariables {\\n pkg-config-homebrew: \"%s/lib/pkgconfig\"\\n}' \"$(brew --prefix openblas)\" > %{_:name}%.config"
]
depends: [
"conf-openblas" {>= "0.2.1"}
]
setenv: [
PKG_CONFIG_PATH += "%{_:pkg-config-homebrew}%"
]
synopsis: "Virtual package to set the environment correctly for OpenBLAS in Homebrew"
description: """
Homebrew requires an update to PKG_CONFIG_PATH in order to detect the openblas
package. opam 2.0.10 and earlier and 2.1.4 and earlier cannot handle a setenv
update of "", and setenv updates cannot be filtered. This package exists to
workaround these two limitations."""
flags: conf
available: os = "macos" & os-distribution = "homebrew"
1 change: 1 addition & 0 deletions packages/conf-openblas/conf-openblas.0.2.1/opam
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ build: [
]
depends: [
"conf-pkg-config" {os = "macos" & os-distribution = "homebrew"}
"conf-openblas-macOS-env" {post & os = "macos" & os-distribution = "homebrew"}
]
depexts: [
["libc-dev" "openblas-dev" "lapack-dev"] {os-distribution = "alpine"}
Expand Down

0 comments on commit 6cf5424

Please # to comment.