Skip to content

Commit a462dad

Browse files
committed
Fix musl copy
1 parent 2a90a65 commit a462dad

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

compiler/ghc/default.nix

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -798,19 +798,17 @@ stdenv.mkDerivation (rec {
798798
then ''
799799
mkdir $out
800800
cp -r _build/stage1/bin $out
801-
${
802-
# These are needed when building the reinstallable lib ghc
803-
if targetPlatform.isMusl
804-
then ''
805-
cp _build/stageBoot/bin/genprimopcode $out/bin
806-
cp _build/stageBoot/bin/deriveConstants $out/bin
807-
'' else ''
808-
cp _build/stageBoot/bin/${targetPrefix}genprimopcode $out/bin
809-
ln -s $out/bin/${targetPrefix}genprimopcode $out/bin/genprimopcode
810-
cp _build/stageBoot/bin/${targetPrefix}deriveConstants $out/bin
811-
ln -s $out/bin/${targetPrefix}deriveConstants $out/bin/deriveConstants
812-
''
813-
}
801+
# let's assume that if we find a non-prefixed genprimop,
802+
# we also find a non-prefixed deriveConstants
803+
if [ -f _build/stage1/bin/genprimopcode ]; then
804+
cp _build/stageBoot/bin/genprimopcode $out/bin
805+
cp _build/stageBoot/bin/deriveConstants $out/bin
806+
else
807+
cp _build/stageBoot/bin/${targetPrefix}genprimopcode $out/bin
808+
ln -s $out/bin/${targetPrefix}genprimopcode $out/bin/genprimopcode
809+
cp _build/stageBoot/bin/${targetPrefix}deriveConstants $out/bin
810+
ln -s $out/bin/${targetPrefix}deriveConstants $out/bin/deriveConstants
811+
fi
814812
cp -r _build/stage1/lib $out
815813
mkdir $doc
816814
cp -r _build/stage1/share $doc

0 commit comments

Comments
 (0)