diff options
-rw-r--r-- | packages/base/hmatrix.cabal | 30 | ||||
-rw-r--r-- | packages/glpk/hmatrix-glpk.cabal | 16 | ||||
-rw-r--r-- | packages/gsl/hmatrix-gsl.cabal | 21 |
3 files changed, 45 insertions, 22 deletions
diff --git a/packages/base/hmatrix.cabal b/packages/base/hmatrix.cabal index f1bc8e6..4d01e57 100644 --- a/packages/base/hmatrix.cabal +++ b/packages/base/hmatrix.cabal | |||
@@ -31,6 +31,11 @@ flag openblas | |||
31 | default: False | 31 | default: False |
32 | manual: True | 32 | manual: True |
33 | 33 | ||
34 | flag disable-default-paths | ||
35 | description: When enabled, don't add default hardcoded include/link dirs by default. Needed for hermetic builds like in nix. | ||
36 | default: False | ||
37 | manual: True | ||
38 | |||
34 | library | 39 | library |
35 | 40 | ||
36 | Build-Depends: base >= 4.8 && < 5, | 41 | Build-Depends: base >= 4.8 && < 5, |
@@ -95,29 +100,33 @@ library | |||
95 | 100 | ||
96 | if os(OSX) | 101 | if os(OSX) |
97 | if flag(openblas) | 102 | if flag(openblas) |
98 | extra-lib-dirs: /opt/local/lib/openblas/lib | 103 | if !flag(disable-default-paths) |
104 | extra-lib-dirs: /opt/local/lib/openblas/lib | ||
99 | extra-libraries: openblas | 105 | extra-libraries: openblas |
100 | else | 106 | else |
101 | extra-libraries: blas lapack | 107 | extra-libraries: blas lapack |
102 | 108 | ||
103 | extra-lib-dirs: /opt/local/lib/ | 109 | if !flag(disable-default-paths) |
104 | include-dirs: /opt/local/include/ | 110 | extra-lib-dirs: /opt/local/lib/ |
105 | extra-lib-dirs: /usr/local/lib/ | 111 | include-dirs: /opt/local/include/ |
106 | include-dirs: /usr/local/include/ | 112 | extra-lib-dirs: /usr/local/lib/ |
113 | include-dirs: /usr/local/include/ | ||
107 | if arch(i386) | 114 | if arch(i386) |
108 | cc-options: -arch i386 | 115 | cc-options: -arch i386 |
109 | frameworks: Accelerate | 116 | frameworks: Accelerate |
110 | 117 | ||
111 | if os(freebsd) | 118 | if os(freebsd) |
112 | if flag(openblas) | 119 | if flag(openblas) |
113 | extra-lib-dirs: /usr/local/lib/openblas/lib | 120 | if !flag(disable-default-paths) |
121 | extra-lib-dirs: /usr/local/lib/openblas/lib | ||
114 | extra-libraries: openblas | 122 | extra-libraries: openblas |
115 | else | 123 | else |
116 | extra-libraries: blas lapack | 124 | extra-libraries: blas lapack |
117 | 125 | ||
118 | extra-lib-dirs: /usr/local/lib | 126 | if !flag(disable-default-paths) |
119 | include-dirs: /usr/local/include | 127 | extra-lib-dirs: /usr/local/lib |
120 | extra-libraries: gfortran | 128 | include-dirs: /usr/local/include |
129 | extra-libraries: gfortran | ||
121 | 130 | ||
122 | if os(windows) | 131 | if os(windows) |
123 | if flag(openblas) | 132 | if flag(openblas) |
@@ -127,7 +136,8 @@ library | |||
127 | 136 | ||
128 | if os(linux) | 137 | if os(linux) |
129 | if flag(openblas) | 138 | if flag(openblas) |
130 | extra-lib-dirs: /usr/lib/openblas/lib | 139 | if !flag(disable-default-paths) |
140 | extra-lib-dirs: /usr/lib/openblas/lib | ||
131 | extra-libraries: openblas | 141 | extra-libraries: openblas |
132 | else | 142 | else |
133 | extra-libraries: blas lapack | 143 | extra-libraries: blas lapack |
diff --git a/packages/glpk/hmatrix-glpk.cabal b/packages/glpk/hmatrix-glpk.cabal index 7453398..6b0032b 100644 --- a/packages/glpk/hmatrix-glpk.cabal +++ b/packages/glpk/hmatrix-glpk.cabal | |||
@@ -22,6 +22,11 @@ extra-source-files: examples/simplex1.hs | |||
22 | examples/simplex4.hs | 22 | examples/simplex4.hs |
23 | examples/simplex5.hs | 23 | examples/simplex5.hs |
24 | 24 | ||
25 | flag disable-default-paths | ||
26 | description: When enabled, don't add default hardcoded include/link dirs by default. Needed for hermetic builds like in nix. | ||
27 | default: False | ||
28 | manual: True | ||
29 | |||
25 | library | 30 | library |
26 | Build-Depends: base <5, hmatrix >= 0.17, containers | 31 | Build-Depends: base <5, hmatrix >= 0.17, containers |
27 | 32 | ||
@@ -37,11 +42,12 @@ library | |||
37 | extra-libraries: glpk | 42 | extra-libraries: glpk |
38 | 43 | ||
39 | if os(OSX) | 44 | if os(OSX) |
40 | extra-lib-dirs: /usr/lib | 45 | if !flag(disable-default-paths) |
41 | extra-lib-dirs: /opt/local/lib/ | 46 | extra-lib-dirs: /usr/lib |
42 | include-dirs: /opt/local/include/ | 47 | extra-lib-dirs: /opt/local/lib/ |
43 | extra-lib-dirs: /usr/local/lib/ | 48 | include-dirs: /opt/local/include/ |
44 | include-dirs: /usr/local/include/ | 49 | extra-lib-dirs: /usr/local/lib/ |
50 | include-dirs: /usr/local/include/ | ||
45 | if arch(i386) | 51 | if arch(i386) |
46 | cc-options: -arch i386 | 52 | cc-options: -arch i386 |
47 | 53 | ||
diff --git a/packages/gsl/hmatrix-gsl.cabal b/packages/gsl/hmatrix-gsl.cabal index c81f241..d463ee8 100644 --- a/packages/gsl/hmatrix-gsl.cabal +++ b/packages/gsl/hmatrix-gsl.cabal | |||
@@ -23,6 +23,11 @@ flag onlygsl | |||
23 | description: don't link gslcblas | 23 | description: don't link gslcblas |
24 | default: False | 24 | default: False |
25 | 25 | ||
26 | flag disable-default-paths | ||
27 | description: When enabled, don't add default hardcoded include/link dirs by default. Needed for hermetic builds like in nix. | ||
28 | default: False | ||
29 | manual: True | ||
30 | |||
26 | library | 31 | library |
27 | 32 | ||
28 | Build-Depends: base<5, hmatrix>=0.18, array, vector, | 33 | Build-Depends: base<5, hmatrix>=0.18, array, vector, |
@@ -65,19 +70,21 @@ library | |||
65 | -fno-warn-unused-binds | 70 | -fno-warn-unused-binds |
66 | 71 | ||
67 | if os(OSX) | 72 | if os(OSX) |
68 | extra-lib-dirs: /opt/local/lib/ | 73 | if !flag(disable-default-paths) |
69 | include-dirs: /opt/local/include/ | 74 | extra-lib-dirs: /opt/local/lib/ |
70 | extra-lib-dirs: /usr/local/lib/ | 75 | include-dirs: /opt/local/include/ |
71 | include-dirs: /usr/local/include/ | 76 | extra-lib-dirs: /usr/local/lib/ |
77 | include-dirs: /usr/local/include/ | ||
72 | extra-libraries: gsl | 78 | extra-libraries: gsl |
73 | if arch(i386) | 79 | if arch(i386) |
74 | cc-options: -arch i386 | 80 | cc-options: -arch i386 |
75 | frameworks: Accelerate | 81 | frameworks: Accelerate |
76 | 82 | ||
77 | if os(freebsd) | 83 | if os(freebsd) |
78 | extra-lib-dirs: /usr/local/lib | 84 | if !flag(disable-default-paths) |
79 | include-dirs: /usr/local/include | 85 | extra-lib-dirs: /usr/local/lib |
80 | extra-libraries: gsl | 86 | include-dirs: /usr/local/include |
87 | extra-libraries: gsl | ||
81 | 88 | ||
82 | if os(windows) | 89 | if os(windows) |
83 | extra-libraries: gsl-0 | 90 | extra-libraries: gsl-0 |