Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkgs/development/haskell-modules/configuration-nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ self: super: builtins.intersectAttrs super {
# Won't find it's header files without help.
sfml-audio = appendConfigureFlag super.sfml-audio "--extra-include-dirs=${pkgs.openal}/include/AL";

cachix = enableSeparateBinOutput super.cachix;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think this should be in configuration-nix?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, could be also in common?


hzk = overrideCabal super.hzk (drv: {
preConfigure = "sed -i -e /include-dirs/d hzk.cabal";
configureFlags = "--extra-include-dirs=${pkgs.zookeeper_mt}/include/zookeeper";
Expand Down
20 changes: 15 additions & 5 deletions pkgs/development/haskell-modules/generic-builder.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ in
, coreSetup ? false # Use only core packages to build Setup.hs.
, useCpphs ? false
, hardeningDisable ? stdenv.lib.optional (ghc.isHaLVM or false) "all"
, enableSeparateBinOutput ? false
, enableSeparateDataOutput ? false
, enableSeparateDocOutput ? doHaddock
, # Don't fail at configure time if there are multiple versions of the
Expand Down Expand Up @@ -111,6 +112,8 @@ let
# the target dir for haddock documentation
docdir = docoutput: docoutput + "/share/doc/" + pname + "-" + version;

binDir = if enableSeparateBinOutput then "$bin/bin" else "$out/bin";

newCabalFileUrl = "http://hackage.haskell.org/package/${pname}-${version}/revision/${revision}.cabal";
newCabalFile = fetchurl {
url = newCabalFileUrl;
Expand Down Expand Up @@ -143,7 +146,10 @@ let
buildFlagsString = optionalString (buildFlags != []) (" " + concatStringsSep " " buildFlags);

defaultConfigureFlags = [
"--verbose" "--prefix=$out" "--libdir=\\$prefix/lib/\\$compiler" "--libsubdir=\\$abi/\\$libname"
"--verbose"
"--prefix=$out"
"--libdir=\\$prefix/lib/\\$compiler"
"--libsubdir=\\$abi/\\$libname"
(optionalString enableSeparateDataOutput "--datadir=$data/share/${ghc.name}")
(optionalString enableSeparateDocOutput "--docdir=${docdir "$doc"}")
"--with-gcc=$CC" # Clang won't work without that extra information.
Expand Down Expand Up @@ -173,7 +179,8 @@ let
"--ghcjs"
] ++ optionals isCross ([
"--configure-option=--host=${stdenv.hostPlatform.config}"
] ++ crossCabalFlags);
] ++ crossCabalFlags
) ++ optionals enableSeparateBinOutput ["--bindir=${binDir}"];

setupCompileFlags = [
(optionalString (!coreSetup) "-${nativePackageDbFlag}=$setupPackageConfDir")
Expand Down Expand Up @@ -233,7 +240,10 @@ assert allPkgconfigDepends != [] -> pkgconfig != null;
stdenv.mkDerivation ({
name = "${pname}-${version}";

outputs = [ "out" ] ++ (optional enableSeparateDataOutput "data") ++ (optional enableSeparateDocOutput "doc");
outputs = [ "out" ]
++ (optional enableSeparateDataOutput "data")
++ (optional enableSeparateDocOutput "doc")
++ (optional enableSeparateBinOutput "bin");
setOutputFlags = false;

pos = builtins.unsafeGetAttrPos "pname" args;
Expand Down Expand Up @@ -414,7 +424,7 @@ stdenv.mkDerivation ({
find $packageConfDir -maxdepth 0 -empty -delete;
''}
${optionalString isGhcjs ''
for exeDir in "$out/bin/"*.jsexe; do
for exeDir in "${binDir}/"*.jsexe; do
exe="''${exeDir%.jsexe}"
printWords '#!${nodejs}/bin/node' > "$exe"
echo >> "$exe"
Expand All @@ -424,7 +434,7 @@ stdenv.mkDerivation ({
''}
${optionalString doCoverage "mkdir -p $out/share && cp -r dist/hpc $out/share"}
${optionalString (enableSharedExecutables && isExecutable && !isGhcjs && stdenv.isDarwin && stdenv.lib.versionOlder ghc.version "7.10") ''
for exe in "$out/bin/"* ; do
for exe in "${binDir}/"* ; do
install_name_tool -add_rpath "$out/lib/ghc-${ghc.version}/${pname}-${version}" "$exe"
done
''}
Expand Down
2 changes: 2 additions & 0 deletions pkgs/development/haskell-modules/lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ rec {
enableStaticLibraries = drv: overrideCabal drv (drv: { enableStaticLibraries = true; });
disableStaticLibraries = drv: overrideCabal drv (drv: { enableStaticLibraries = false; });

enableSeparateBinOutput = drv: overrideCabal drv (drv: { enableSeparateBinOutput = true; });

appendPatch = drv: x: appendPatches drv [x];
appendPatches = drv: xs: overrideCabal drv (drv: { patches = (drv.patches or []) ++ xs; });

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/tools/cachix/default.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{ haskellPackages, haskell }:

haskell.lib.justStaticExecutables haskellPackages.cachix
(haskell.lib.doDistribute haskellPackages.cachix).bin
6 changes: 1 addition & 5 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9601,11 +9601,7 @@ in

c-blosc = callPackage ../development/libraries/c-blosc { };

cachix = (callPackage ../development/tools/cachix { }).overrideAttrs (drv: {
meta = drv.meta // {
hydraPlatforms = stdenv.lib.platforms.unix;
};
});
cachix = callPackage ../development/tools/cachix { };

capnproto = callPackage ../development/libraries/capnproto { };

Expand Down