ghc: Normalize derivations
This commit is contained in:
parent
63e5b3ce71
commit
9ce15ea60c
@ -68,7 +68,6 @@ let
|
|||||||
targetCC = builtins.head toolsForTarget;
|
targetCC = builtins.head toolsForTarget;
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "7.10.3";
|
version = "7.10.3";
|
||||||
name = "${targetPrefix}ghc-${version}";
|
name = "${targetPrefix}ghc-${version}";
|
||||||
@ -87,6 +86,8 @@ stdenv.mkDerivation rec {
|
|||||||
./relocation.patch
|
./relocation.patch
|
||||||
];
|
];
|
||||||
|
|
||||||
|
postPatch = "patchShebangs .";
|
||||||
|
|
||||||
# GHC is a bit confused on its cross terminology.
|
# GHC is a bit confused on its cross terminology.
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
|
for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
|
||||||
@ -103,6 +104,7 @@ stdenv.mkDerivation rec {
|
|||||||
export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
|
export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
|
||||||
export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
|
export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
|
||||||
export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
|
export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
|
||||||
|
|
||||||
echo -n "${buildMK}" > mk/build.mk
|
echo -n "${buildMK}" > mk/build.mk
|
||||||
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
||||||
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
|
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
|
||||||
@ -135,7 +137,8 @@ stdenv.mkDerivation rec {
|
|||||||
crossConfig = true;
|
crossConfig = true;
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
ghc perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42 hscolour
|
perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42
|
||||||
|
ghc hscolour
|
||||||
];
|
];
|
||||||
|
|
||||||
# For building runtime libs
|
# For building runtime libs
|
||||||
|
@ -87,6 +87,8 @@ stdenv.mkDerivation rec {
|
|||||||
++ stdenv.lib.optional stdenv.isDarwin ./ghc-8.0.2-no-cpp-warnings.patch
|
++ stdenv.lib.optional stdenv.isDarwin ./ghc-8.0.2-no-cpp-warnings.patch
|
||||||
++ stdenv.lib.optional stdenv.isDarwin ./backport-dylib-command-size-limit.patch;
|
++ stdenv.lib.optional stdenv.isDarwin ./backport-dylib-command-size-limit.patch;
|
||||||
|
|
||||||
|
postPatch = "patchShebangs .";
|
||||||
|
|
||||||
# GHC is a bit confused on its cross terminology.
|
# GHC is a bit confused on its cross terminology.
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
|
for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
|
||||||
@ -103,6 +105,7 @@ stdenv.mkDerivation rec {
|
|||||||
export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
|
export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
|
||||||
export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
|
export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
|
||||||
export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
|
export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
|
||||||
|
|
||||||
echo -n "${buildMK}" > mk/build.mk
|
echo -n "${buildMK}" > mk/build.mk
|
||||||
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
||||||
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
|
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
|
||||||
@ -134,7 +137,10 @@ stdenv.mkDerivation rec {
|
|||||||
# masss-rebuild.
|
# masss-rebuild.
|
||||||
crossConfig = true;
|
crossConfig = true;
|
||||||
|
|
||||||
nativeBuildInputs = [ ghc perl hscolour sphinx ];
|
nativeBuildInputs = [
|
||||||
|
perl sphinx
|
||||||
|
ghc hscolour
|
||||||
|
];
|
||||||
|
|
||||||
# For building runtime libs
|
# For building runtime libs
|
||||||
depsBuildTarget = toolsForTarget;
|
depsBuildTarget = toolsForTarget;
|
||||||
|
@ -23,10 +23,8 @@
|
|||||||
|
|
||||||
, # Whether to build dynamic libs for the standard library (on the target
|
, # Whether to build dynamic libs for the standard library (on the target
|
||||||
# platform). Static libs are always built.
|
# platform). Static libs are always built.
|
||||||
enableShared ?
|
enableShared ? true
|
||||||
!(targetPlatform.isDarwin
|
|
||||||
# On iOS, dynamic linking is not supported
|
|
||||||
&& (targetPlatform.isAarch64 || targetPlatform.isAarch32))
|
|
||||||
, # Whether to backport https://phabricator.haskell.org/D4388 for
|
, # Whether to backport https://phabricator.haskell.org/D4388 for
|
||||||
# deterministic profiling symbol names, at the cost of a slightly
|
# deterministic profiling symbol names, at the cost of a slightly
|
||||||
# non-standard GHC API
|
# non-standard GHC API
|
||||||
@ -153,7 +151,10 @@ stdenv.mkDerivation rec {
|
|||||||
# masss-rebuild.
|
# masss-rebuild.
|
||||||
crossConfig = true;
|
crossConfig = true;
|
||||||
|
|
||||||
nativeBuildInputs = [ alex autoconf autoreconfHook automake ghc happy hscolour perl python3 sphinx ];
|
nativeBuildInputs = [
|
||||||
|
autoconf autoreconfHook automake perl python3 sphinx
|
||||||
|
ghc alex happy hscolour
|
||||||
|
];
|
||||||
|
|
||||||
# For building runtime libs
|
# For building runtime libs
|
||||||
depsBuildTarget = toolsForTarget;
|
depsBuildTarget = toolsForTarget;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
# build-tools
|
# build-tools
|
||||||
, bootPkgs, alex, happy
|
, bootPkgs, alex, happy
|
||||||
, autoconf, automake, coreutils, fetchurl, fetchpatch, perl, python3
|
, autoconf, automake, coreutils, fetchurl, fetchpatch, perl, python3, m4
|
||||||
|
|
||||||
, libffi, libiconv ? null, ncurses
|
, libffi, libiconv ? null, ncurses
|
||||||
|
|
||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
, # If enabled, GHC will be built with the GPL-free but slower integer-simple
|
, # If enabled, GHC will be built with the GPL-free but slower integer-simple
|
||||||
# library instead of the faster but GPLed integer-gmp library.
|
# library instead of the faster but GPLed integer-gmp library.
|
||||||
enableIntegerSimple ? false, gmp ? null, m4
|
enableIntegerSimple ? false, gmp ? null
|
||||||
|
|
||||||
, # If enabled, use -fPIC when compiling static libs.
|
, # If enabled, use -fPIC when compiling static libs.
|
||||||
enableRelocatedStaticLibs ? targetPlatform != hostPlatform
|
enableRelocatedStaticLibs ? targetPlatform != hostPlatform
|
||||||
@ -24,7 +24,6 @@
|
|||||||
# platform). Static libs are always built.
|
# platform). Static libs are always built.
|
||||||
enableShared ? !targetPlatform.useAndroidPrebuilt
|
enableShared ? !targetPlatform.useAndroidPrebuilt
|
||||||
|
|
||||||
, version ? "8.4.2"
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert !enableIntegerSimple -> gmp != null;
|
assert !enableIntegerSimple -> gmp != null;
|
||||||
@ -69,7 +68,7 @@ let
|
|||||||
|
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
inherit version;
|
version = "8.4.2";
|
||||||
name = "${targetPrefix}ghc-${version}";
|
name = "${targetPrefix}ghc-${version}";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
@ -144,7 +143,10 @@ stdenv.mkDerivation rec {
|
|||||||
# masss-rebuild.
|
# masss-rebuild.
|
||||||
crossConfig = true;
|
crossConfig = true;
|
||||||
|
|
||||||
nativeBuildInputs = [ ghc perl autoconf automake m4 happy alex python3 ];
|
nativeBuildInputs = [
|
||||||
|
perl autoconf automake m4 python3
|
||||||
|
ghc alex happy
|
||||||
|
];
|
||||||
|
|
||||||
# For building runtime libs
|
# For building runtime libs
|
||||||
depsBuildTarget = toolsForTarget;
|
depsBuildTarget = toolsForTarget;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
# build-tools
|
# build-tools
|
||||||
, bootPkgs, alex, happy
|
, bootPkgs, alex, happy
|
||||||
, autoconf, automake, coreutils, fetchgit, perl, python3
|
, autoconf, automake, coreutils, fetchgit, perl, python3, m4
|
||||||
|
|
||||||
, libffi, libiconv ? null, ncurses
|
, libffi, libiconv ? null, ncurses
|
||||||
|
|
||||||
@ -141,7 +141,10 @@ stdenv.mkDerivation rec {
|
|||||||
# masss-rebuild.
|
# masss-rebuild.
|
||||||
crossConfig = true;
|
crossConfig = true;
|
||||||
|
|
||||||
nativeBuildInputs = [ ghc perl autoconf automake happy alex python3 ];
|
nativeBuildInputs = [
|
||||||
|
perl autoconf automake m4 python3
|
||||||
|
ghc alex happy
|
||||||
|
];
|
||||||
|
|
||||||
# For building runtime libs
|
# For building runtime libs
|
||||||
depsBuildTarget = toolsForTarget;
|
depsBuildTarget = toolsForTarget;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user