cabal2nix 1.60 → 1.61
raw patch · 4 files changed
+42/−6 lines, 4 files
Files
- cabal2nix.cabal +3/−3
- src/Cabal2Nix/PostProcess.hs +37/−1
- src/Distribution/NixOS/Derivation/Cabal.hs +1/−1
- src/hackage4nix.hs +1/−1
cabal2nix.cabal view
@@ -1,5 +1,5 @@ Name: cabal2nix-Version: 1.60+Version: 1.61 Copyright: Peter Simons, Andres Loeh License: BSD3 License-File: LICENSE@@ -34,8 +34,8 @@ . The only required argument is the path to the cabal file. For example: .- > cabal2nix http://hackage.haskell.org/packages/archive/cabal2nix/1.60/cabal2nix.cabal- > cabal2nix cabal://cabal2nix-1.60+ > cabal2nix http://hackage.haskell.org/packages/archive/cabal2nix/1.61/cabal2nix.cabal+ > cabal2nix cabal://cabal2nix-1.61 . If the @--sha256@ option has not been specified, cabal2nix calls @nix-prefetch-url@ to determine the hash automatically. This causes
src/Cabal2Nix/PostProcess.hs view
@@ -7,6 +7,9 @@ postProcess :: Derivation -> Derivation postProcess deriv@(MkDerivation {..})+ | pname == "aeson" && version > Version [0,7] []+ = deriv { buildDepends = "blazeBuilder":buildDepends }+ | pname == "Agda" = deriv { buildTools = "emacs":buildTools, phaseOverrides = agdaPostInstall } | pname == "alex" && version < Version [3,1] [] = deriv { buildTools = "perl":buildTools } | pname == "alex" && version >= Version [3,1] []@@ -57,6 +60,7 @@ | pname == "llvm-general-pure"= deriv { doCheck = False } | pname == "markdown-unlit" = deriv { runHaddock = True, phaseOverrides = markdownUnlitNoHaddock } | pname == "multiarg" = deriv { buildDepends = "utf8String":buildDepends }+ | pname == "mysql" = deriv { buildTools = "mysqlConfig":buildTools, extraLibs = "zlib":extraLibs } | pname == "ncurses" = deriv { phaseOverrides = ncursesPatchPhase } | pname == "OpenAL" = deriv { extraLibs = "openal":extraLibs } | pname == "OpenGL" = deriv { extraLibs = "mesa":"libX11":extraLibs }@@ -70,10 +74,13 @@ | pname == "SDL-image" = deriv { extraLibs = "SDL_image":extraLibs } | pname == "SDL-mixer" = deriv { extraLibs = "SDL_mixer":extraLibs } | pname == "SDL-ttf" = deriv { extraLibs = "SDL_ttf":extraLibs }+ | pname == "sloane" = deriv { phaseOverrides = sloanePostInstall }+ | pname == "structured-haskell-mode" = deriv { buildTools = "emacs":buildTools, phaseOverrides = structuredHaskellModePostInstall } | pname == "svgcairo" = deriv { extraLibs = "libc":extraLibs } | pname == "terminfo" = deriv { extraLibs = "ncurses":extraLibs } | pname == "threadscope" = deriv { configureFlags = "--ghc-options=-rtsopts":configureFlags } | pname == "trifecta" = deriv { phaseOverrides = trifectaPostPatch }+ | pname == "unix-time" = deriv { phaseOverrides = unixTimeConfigureFlags } | pname == "vacuum" = deriv { extraLibs = "ghcPaths":extraLibs } | pname == "wxc" = deriv { extraLibs = "wxGTK":"mesa":"libX11":extraLibs, phaseOverrides = wxcPostInstall } | pname == "wxcore" = deriv { extraLibs = "wxGTK":"mesa":"libX11":extraLibs }@@ -165,8 +172,9 @@ xmonadPostInstall :: String xmonadPostInstall = unlines [ "postInstall = ''"+ , " shopt -s globstar" , " mkdir -p $out/share/man/man1"- , " mv $out/share/xmonad-*/man/*.1 $out/share/man/man1/"+ , " mv \"$out/\"**\"/man/\"*.1 $out/share/man/man1/" , "'';" ] @@ -243,3 +251,31 @@ eitherNoHaddock :: String eitherNoHaddock = "noHaddock = self.stdenv.lib.versionOlder self.ghc.version \"7.6\";"++agdaPostInstall :: String+agdaPostInstall = unlines+ [ "postInstall = ''"+ , " $out/bin/agda-mode compile"+ , "'';"+ ]++structuredHaskellModePostInstall :: String+structuredHaskellModePostInstall = unlines+ [ "postInstall = ''"+ , " emacs -L elisp --batch -f batch-byte-compile \"elisp/\"*.el"+ , " install -d $out/share/emacs/site-lisp"+ , " install \"elisp/\"*.el \"elisp/\"*.elc $out/share/emacs/site-lisp"+ , "'';"+ ]++unixTimeConfigureFlags :: String+unixTimeConfigureFlags =+ "configureFlags = self.stdenv.lib.optionalString self.enableSharedLibraries \"--ghc-option=-fPIC\";"++sloanePostInstall :: String+sloanePostInstall = unlines+ [ "postInstall = ''"+ , " mkdir -p $out/share/man/man1"+ , " cp sloane.1 $out/share/man/man1/"+ , "'';"+ ]
src/Distribution/NixOS/Derivation/Cabal.hs view
@@ -112,8 +112,8 @@ , [vers'] <- buf `regsubmatch` "version *= *\"([^\"]+)\"" , Just vers <- simpleParse vers' , [sha] <- buf `regsubmatch` "sha256 *= *\"([^\"]+)\""- , plats <- buf `regsubmatch` "platforms *= *([^;]+);" , hplats <- buf `regsubmatch` "hydraPlatforms *= *([^;]+);"+ , plats <- buf `regsubmatch` "platforms *= *([^;]+);" , maint <- buf `regsubmatch` "maintainers *= *\\[([^\"]+)]" , noHaddock <- buf `regsubmatch` "noHaddock *= *(true|false) *;" , jailBreak <- buf `regsubmatch` "jailbreak *= *(true|false) *;"
src/hackage4nix.hs view
@@ -162,7 +162,7 @@ | otherwise = [ "--platform=" ++ p | p <- platforms meta ] hplats' | ["self.ghc.meta.platforms"] == platforms meta = []- | otherwise = [ "--hydra-platform=" ++ p | p <- platforms meta ]+ | otherwise = [ "--hydra-platform=" ++ p | p <- hydraPlatforms meta ] path' | path =~ "/[0-9\\.]+\\.nix$" = replaceFileName path (display (version deriv) <.> "nix") | otherwise = path