git.iko.soy/typeable/cabal2nix
on master help sign in
nix-paths: add allow-relative-paths flag tp allow building on systems that don't have Nix
commitdd74ac472634698acc841591fc4b9a1cf237e5e1 authorPeter Simons <simons@cryp.to> dateWed 9 Sep 2015, 22:26 (11 years ago) parentb073bdd
3 files changed+12−3
.travis.yml+1−1 nix-paths/Setup.lhs+1−1 nix-paths/nix-paths.cabal+10−1
.travis.yml+1−1
@@ -20,4 +20,4 @@ install:
2020 - stack build --only-snapshot
2121
2222script:
23− - stack build --pedantic --test --haddock
23+ - stack build --pedantic --test --haddock --flag=nix-paths:allow-relative-paths
nix-paths/Setup.lhs+1−1
@@ -22,7 +22,7 @@
2222> configure :: (GenericPackageDescription, HookedBuildInfo) -> ConfigFlags -> IO LocalBuildInfo
2323> configure (gpd, hbi) flags = do
2424> lbi' <- confHook simpleUserHooks (gpd, hbi) flags
25−> let paths = [ (p, programPath pc) | p <- programs, Just pc <- [lookupProgram (simpleProgram p) (withPrograms lbi)] ]
25+> let paths = map (\p -> (p, maybe p programPath (lookupProgram (simpleProgram p) (withPrograms lbi)))) programs
2626> descr = localPkgDescr lbi'
2727> lib = fromJust (library descr)
2828> libbi = libBuildInfo lib
nix-paths/nix-paths.cabal+10−1
@@ -17,9 +17,18 @@ source-repository head
1717 type: git
1818 location: https://github.com/nixos/cabal2nix
1919
20+flag allow-relative-paths
21+ description: If any of the required Nix tools are missing at
22+ build-time, compile a run-time @$PATH@ dependent
23+ variant of this library instead of failing. This is
24+ useful for test environment such as Travis-CI, which
25+ may not have Nix installed.
26+ default: False
27+
2028library
2129 default-language: Haskell2010
2230 hs-source-dirs: src
2331 exposed-modules: Nix.Paths, Nix.FindFile
2432 build-depends: base < 5, process
25− build-tools: nix-instantiate, nix-build, nix-env, nix-store
33+ if !flag(allow-relative-paths)
34+ build-tools: nix-instantiate, nix-build, nix-env, nix-store