git.iko.soy/typeable/cabal2nix
on master help sign in
hmatrix: disable "sed" hack for versions newer than 0.18.1.0.

hmatrix hard-codes all kinds of bogus paths into the Cabal file which break the build with Nix. https://github.com/albertoruiz/hmatrix/pull/219 fixed this issue, but unfortunately a version that contains these changes was never released (https://github.com/albertoruiz/hmatrix/issues/243). This means that we still need the "sed" hack in place for all current releases of hmatrix, but applying that hack to a current git version of hmatrix breaks the build. To work around this issue, we restrict the application of the sed hack to versions older than 0.18.1.1, which is what current git version call themselves. Therefore, a call like $ cabal2nix -fdisable-default-paths --subpath=packages/base https://github.com/albertoruiz/hmatrix generates a Nix file without the "sed" hack, but Nix builds for the current release versions still have it. Fixes https://github.com/NixOS/cabal2nix/issues/327.

commit08768660b1e4e4104153007728b1fe5c55122657 authorPeter Simons <simons@cryp.to> dateThu 18 Jan 2018, 11:48 (9 years ago) parentf139000
2 files changed+2−2
src/Distribution/Nixpkgs/Haskell/FromCabal/Flags.hs+1−1 src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs+1−1
src/Distribution/Nixpkgs/Haskell/FromCabal/Flags.hs+1−1
@@ -41,7 +41,7 @@ configureCabalFlags (PackageIdentifier name version)
4141 | name == "highlighting-kate" = [enable "pcre-light"]
4242 | name == "hlibsass" && version >= mkVersion [0,1,5]
4343 = [enable "externalLibsass"]
44− | name == "hmatrix" = [enable "openblas"]
44+ | name == "hmatrix" = [enable "openblas", enable "disable-default-paths"]
4545 | name == "hslua" = [enable "system-lua"]
4646 | name == "idris" = [enable "gmp", enable "ffi", enable "curses", ("execonly", version `withinRange` (orLaterVersion (mkVersion [1,1,1]))) ]
4747 | name == "io-streams" = [enable "NoInteractiveTests"]
src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs+1−1
@@ -75,7 +75,7 @@ hooks =
7575 , ("hfsevents", hfseventsOverrides)
7676 , ("HFuse", set phaseOverrides hfusePreConfigure)
7777 , ("hlibgit2 >= 0.18.0.14", set (testDepends . tool . contains (pkg "git")) True)
78− , ("hmatrix", set phaseOverrides "preConfigure = \"sed -i hmatrix.cabal -e '/\\\\/usr\\\\//D'\";")
78+ , ("hmatrix < 0.18.1.1", set phaseOverrides "preConfigure = \"sed -i hmatrix.cabal -e '/\\\\/usr\\\\//D'\";")
7979 , ("holy-project", set doCheck False) -- attempts to access the network
8080 , ("hoogle", set testTarget "--test-option=--no-net")
8181 , ("hsignal < 0.2.7.4", set phaseOverrides "prePatch = \"rm -v Setup.lhs\";") -- https://github.com/amcphail/hsignal/issues/1