Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
33169ea
Revert "Merge pull request #32333 from NixOS/revert-32112-hask-split-…
domenkozar Dec 13, 2017
3410fdd
hevm: disable bin output to prevent a cycle
domenkozar Dec 13, 2017
e3534e5
symlinkJoin: support multiple outputs
domenkozar Dec 13, 2017
2b62c51
elm: fix with separate bin output
domenkozar Dec 13, 2017
bbe1dc3
ghcjs: fix with separate lib/bin outputs
domenkozar Dec 13, 2017
75018d5
Agda: fix with separate data output
domenkozar Dec 13, 2017
0e447b1
haskell: generic builder produces working binaries with separate outputs
domenkozar Dec 13, 2017
f6c946d
zsh-git-prompt: fix build for multiple outputs
domenkozar Dec 13, 2017
23485c6
haskell: add tests covering ghcWith{Packages,Hoogle}
domenkozar Dec 13, 2017
5d31589
elmPackages: statically link haskell deps in executables
domenkozar Dec 13, 2017
35c51fd
elmPackages: properly override the whole dep tree
domenkozar Dec 23, 2017
49af796
haskell generic builder: remove references only for .conf in libdir
domenkozar Dec 23, 2017
e62a5a8
haskell generic builder: add missing closing quote
bennofs Dec 25, 2017
3dc0648
haskellPackages.happy: fix circular reference caused by separate bin
roberth Jul 3, 2018
9027a69
haskell generic builder: make robust against missing lib directory
roberth Jul 4, 2018
5ebdc4e
haskellPackages.hspec-{meta,discover}: resolve store reference cycles
roberth Jul 4, 2018
9c9ff37
haskellPackages.uuagc-bootstrap: don't haddock
roberth Jul 4, 2018
68cc2a4
haskell generic builder: broaden datadir removal from lib
roberth Jul 4, 2018
709289b
haskell generic builder: avoid redundant lib output on darwin
roberth Jul 9, 2018
981458a
haskell generic builder: use setup dependency libs
roberth Jul 10, 2018
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/applications/altcoins/hevm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ lib.overrideDerivation (mkDerivation rec {
isLibrary = false;
isExecutable = true;
enableSharedExecutables = false;
# TODO: it creates cycle between out and bin
enableSeparateBinOutput = false;

postInstall = ''
wrapProgram $out/bin/hevm \
Expand Down
22 changes: 19 additions & 3 deletions pkgs/build-support/trivial-builders.nix
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,31 @@ rec {
, preferLocalBuild ? true
, allowSubstitutes ? false
, postBuild ? ""
, extraOutputsToInstall ? []
, ...
}:
let
args = removeAttrs args_ [ "name" "postBuild" ]
// { inherit preferLocalBuild allowSubstitutes; }; # pass the defaults
# Handle multiple outputs
dirs = (map (drv:
# First add the usual output(s): respect if user has chosen explicitly,
# and otherwise use `meta.outputsToInstall`. The attribute is guaranteed
# to exist in mkDerivation-created cases. The other cases (e.g. runCommand)
# aren't expected to have multiple outputs.
(if drv.outputUnspecified or false
&& drv.meta.outputsToInstall or null != null
then map (outName: drv.${outName}) drv.meta.outputsToInstall
else [ drv ])
# Add any extra outputs specified by the caller of `buildEnv`.
++ lib.filter (p: p!=null)
(builtins.map (outName: drv.${outName} or null) extraOutputsToInstall)
) paths);

args = removeAttrs args_ [ "name" "postBuild" "paths"]
// { inherit preferLocalBuild allowSubstitutes dirs; }; # pass the defaults
in runCommand name args
''
mkdir -p $out
for i in $paths; do
for i in $dirs; do
${lndir}/bin/lndir -silent $i $out
done
${postBuild}
Expand Down
6 changes: 5 additions & 1 deletion pkgs/development/compilers/elm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ let
postInstall =
let bins = lib.makeBinPath [ nodejs self.elm-make ];
in ''
wrapProgram $out/bin/elm-repl \
wrapProgram $bin/bin/elm-repl \
--prefix PATH ':' ${bins}
'';
});
Expand Down Expand Up @@ -97,6 +97,10 @@ let
sha256 = "16lz21bp9j14xilnq8yym22p3saxvc9fsgfcf5awn2a6i6n527xn";
libraryHaskellDepends = drv.libraryHaskellDepends ++ [super.concatenative];
});
mkDerivation = args: super.mkDerivation (args // {
# reduce closure size for bin outputs
enableSharedExecutables = false;
});
};
};
in hsPkgs.elmPkgs // {
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/elm/packages/elm-format.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ mkDerivation {
];
jailbreak = true;
postInstall = ''
ln -s $out/bin/elm-format-0.18 $out/bin/elm-format
ln -s $bin/bin/elm-format-0.18 $bin/bin/elm-format
'';
postPatch = ''
sed -i "s|desc <-.*||" ./Setup.hs
Expand Down
20 changes: 12 additions & 8 deletions pkgs/development/compilers/ghcjs/base.nix
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,14 @@ in mkDerivation (rec {
jailbreak = true;
doHaddock = false;
doCheck = false;
enableSeparateDataOutput = true;
buildDepends = [
filepath HTTP mtl network random stm time zlib aeson attoparsec
bzlib data-default ghc-paths hashable haskell-src-exts haskell-src-meta
lens optparse-applicative parallel safe shelly split
stringsearch syb system-fileio system-filepath tar terminfo text-binary
unordered-containers vector wl-pprint-text yaml
alex happy git gnumake autoconf automake libtool patch gmp
(stdenv.lib.getBin alex) (stdenv.lib.getBin happy) git gnumake autoconf automake libtool patch gmp
base16-bytestring cryptohash executable-path haddock-api
transformers-compat QuickCheck haddock hspec xhtml
regex-posix libiconv
Expand All @@ -128,17 +129,17 @@ in mkDerivation (rec {
--replace "/usr/bin/env" "${coreutils}/bin/env"

substituteInPlace src/Compiler/Info.hs \
--replace "@PREFIX@" "$out" \
--replace "@PREFIX@" "$lib" \
--replace "@VERSION@" "${version}"

substituteInPlace src-bin/Boot.hs \
--replace "@PREFIX@" "$out" \
--replace "@PREFIX@" "$lib" \
--replace "@CC@" "${stdenv.cc}/bin/cc"
'';
preBuild = ''
export HOME="$TMP"

local topDir=$out/lib/ghcjs-${version}
local topDir=$lib/lib/ghcjs-${version}
mkdir -p $topDir

cp -r ${ghcjsBoot} $topDir/ghcjs-boot
Expand All @@ -158,15 +159,18 @@ in mkDerivation (rec {
# This is necessary due to: https://github.com/haskell/cabal/commit/af19fb2c2d231d8deff1cb24164a2bf7efb8905a
# Cabal otherwise fails to build: http://hydra.nixos.org/build/31824079/nixlog/1/raw
postInstall = ''
PATH=$out/bin:$PATH LD_LIBRARY_PATH=${gmp.out}/lib:${stdenv.cc}/lib64:$LD_LIBRARY_PATH \
env -u GHC_PACKAGE_PATH $out/bin/ghcjs-boot \
PATH=$bin/bin:$PATH LD_LIBRARY_PATH=${gmp.out}/lib:${stdenv.cc}/lib64:$LD_LIBRARY_PATH \
env -u GHC_PACKAGE_PATH $bin/bin/ghcjs-boot \
--dev \
--quick \
--with-cabal ${cabal-install}/bin/cabal \
--with-gmp-includes ${gmp.dev}/include \
--with-gmp-libraries ${gmp.out}/lib
--with-gmp-libraries ${gmp.out}/lib \
--with-datadir $data/share/ghc-*/*/ghcjs-*/ \
--with-ghcjs-bin $bin/bin
find $lib -name setup-config -o -name config.log -o -name config.status | xargs rm
'' + lib.optionalString (ghcLibdir != null) ''
printf '%s' '${ghcLibdir}' > "$out/lib/ghcjs-${version}/ghc_libdir"
printf '%s' '${ghcLibdir}' > "$lib/lib/ghcjs-${version}/ghc_libdir"
'';
passthru = {
inherit bootPkgs;
Expand Down
4 changes: 4 additions & 0 deletions pkgs/development/haskell-modules/configuration-common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,9 @@ self: super: {
# no haddock since this is an umbrella package.
cloud-haskell = dontHaddock super.cloud-haskell;

# Don't haddock because it is only used for bootstrapping.
uuagc-bootstrap = dontHaddock super.uuagc-bootstrap;

# This packages compiles 4+ hours on a fast machine. That's just unreasonable.
CHXHtml = dontDistribute super.CHXHtml;

Expand Down Expand Up @@ -842,6 +845,7 @@ self: super: {
# Don't install internal mkReadme tool.
hastache = overrideCabal super.hastache (drv: {
doCheck = false;
enableSeparateBinOutput = false;
postInstall = "rm $out/bin/mkReadme && rmdir $out/bin";
});

Expand Down
64 changes: 63 additions & 1 deletion pkgs/development/haskell-modules/configuration-nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,10 @@ self: super: builtins.intersectAttrs super {

# wxc supports wxGTX >= 3.0, but our current default version points to 2.8.
# http://hydra.cryp.to/build/1331287/log/raw
wxc = (addBuildDepend super.wxc self.split).override { wxGTK = pkgs.wxGTK30; };
wxc = (overrideCabal super.wxc (drv: {
buildDepends = (drv.buildDepends or []) ++ [self.split];
postInstall = "cp -v dist/build/libwxc.so.0.92.3.0 $lib/lib/libwxc.so";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this related to the multiple-outputs changes or something else? Hardcoding the exact version number here also seems a little brittle. And why is the copy needed, shoudn't cabal install take care to install the wxc library?

})).override { wxGTK = pkgs.wxGTK30; };
wxcore = super.wxcore.override { wxGTK = pkgs.wxGTK30; };

# Test suite wants to connect to $DISPLAY.
Expand Down Expand Up @@ -509,11 +512,70 @@ self: super: builtins.intersectAttrs super {
partial-semigroup = dontCheck super.partial-semigroup;
colour = dontCheck super.colour;

# Alex has some weird files in /usr/share that create a cyclic ref with
# its bin dir.
alex = hasNoBinOutput super.alex;

# Disable separate bin outputs for these specific packages that break with it.
H = hasNoBinOutput super.H;
cryptol = hasNoBinOutput super.cryptol;
hscolour = hasNoBinOutput super.hscolour;
sproxy = hasNoBinOutput super.sproxy;
sproxy2 = hasNoBinOutput super.sproxy2;
sproxy-web = hasNoBinOutput super.sproxy-web;
juandelacosa = hasNoBinOutput super.juandelacosa;
mywatch = hasNoBinOutput super.mywatch;
sugarhaskell = hasNoBinOutput super.sugarhaskell;
zerobin = hasNoBinOutput super.zerobin;

git-annex = overrideCabal super.git-annex (drv: {
enableSeparateBinOutput = false;
enableSeparateEtcOutput = false;
});

# Has extra data files which are referred to from the binary output,
# creating a store reference cycle. Putting data in separate output
# solves the problem.
happy = overrideCabal super.happy (drv: {
enableSeparateDataOutput = true;
configureFlags = drv.configureFlags or [] ++ ["--libdir=/var/empty"];
});

hspec-meta = overrideCabal super.hspec-meta (drv: {
enableSeparateDataOutput = true;
});
hspec-discover = overrideCabal super.hspec-discover (drv: {
enableSeparateDataOutput = true;
});

# Override a number of packages with specific references to $out in their
# derivations
stack = overrideCabal super.stack (drv: {
postInstall = ''
exe=$bin/bin/stack
mkdir -p $bin/share/bash-completion/completions
$exe --bash-completion-script $exe >$bin/share/bash-completion/completions/stack
'';
});
Agda = overrideCabal super.Agda (drv: {
postInstall = ''
files=("$data/share/ghc-"*"/"*"-ghc-"*"/Agda-"*"/lib/prim/Agda/"{Primitive.agda,Builtin"/"*.agda})
for f in "''${files[@]}" ; do
$bin/bin/agda $f
done
for f in "''${files[@]}" ; do
$bin/bin/agda -c --no-main $f
done
$bin/bin/agda-mode compile
'';
});

LDAP = dontCheck (overrideCabal super.LDAP (drv: {
librarySystemDepends = drv.librarySystemDepends or [] ++ [ pkgs.cyrus_sasl.dev ];
}));

# Tests require a browser: https://github.com/ku-fpg/blank-canvas/issues/73
blank-canvas = dontCheck super.blank-canvas;
blank-canvas_0_6_2 = dontCheck super.blank-canvas_0_6_2;

}
Loading