Skip to content

Commit fad48e3

Browse files
authored
Merge pull request #102833 from hercules-ci/ghc8102BinaryMinimal-fix-docs
ghc8102BinaryMinimal: fix docs as legally required
2 parents 73f591a + 6b377f2 commit fad48e3

1 file changed

Lines changed: 9 additions & 14 deletions

File tree

pkgs/development/compilers/ghc/8.10.2-binary.nix

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
# regular builds and GHC bootstrapping.
88
# This is "useful" for staying within hydra's output limits for at least the
99
# aarch64-linux architecture.
10-
# Examples of unnecessary files are the bundled documentation and files that
11-
# are only needed for profiling builds.
1210
, minimal ? false
1311
}:
1412

@@ -182,11 +180,15 @@ stdenv.mkDerivation rec {
182180
done
183181
'' +
184182
stdenv.lib.optionalString minimal ''
185-
# Remove profiling objects
183+
# Remove profiling files
186184
find $out -type f -name '*.p_o' -delete
185+
find $out -type f -name '*.p_hi' -delete
186+
find $out -type f -name '*_p.a' -delete
187187
rm $out/lib/ghc-*/bin/ghc-iserv-prof
188-
# Remove docs
189-
rm -r $out/share/{doc,man}
188+
# Hydra will redistribute this derivation, so we have to keep the docs for
189+
# legal reasons (retaining the legal notices etc)
190+
# As a last resort we could unpack the docs separately and symlink them in.
191+
# They're in $out/share/{doc,man}.
190192
'';
191193

192194
doInstallCheck = true;
@@ -210,18 +212,11 @@ stdenv.mkDerivation rec {
210212
enableShared = true;
211213
};
212214

213-
meta = let
214-
platforms = ["x86_64-linux" "armv7l-linux" "aarch64-linux" "i686-linux" "x86_64-darwin"];
215-
in {
215+
meta = {
216216
homepage = "http://haskell.org/ghc";
217217
description = "The Glasgow Haskell Compiler";
218218
license = stdenv.lib.licenses.bsd3;
219-
220-
# The minimal variation can not be distributed because it removes the
221-
# documentation, including licensing information that is required for
222-
# distribution.
223-
inherit platforms;
224-
hydraPlatforms = stdenv.lib.optionals (!minimal) platforms;
219+
platforms = ["x86_64-linux" "armv7l-linux" "aarch64-linux" "i686-linux" "x86_64-darwin"];
225220
maintainers = with stdenv.lib.maintainers; [ lostnet ];
226221
};
227222
}

0 commit comments

Comments
 (0)