diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index 971365eda48f..6ff29d600fc0 100644 --- a/pkgs/development/compilers/ghc/head.nix +++ b/pkgs/development/compilers/ghc/head.nix @@ -85,8 +85,17 @@ in stdenv.mkDerivation (rec { } // stdenv.lib.optionalAttrs (cross != null) { name = "${cross.config}-ghc-${version}"; + patches = [ ./ios-linker.patch ]; + preConfigure = commonPreConfigure + '' - sed 's|#BuildFlavour = quick-cross|BuildFlavour = perf-cross|' mk/build.mk.sample > mk/build.mk + sed 's|#BuildFlavour = quick-cross|BuildFlavour = quick-cross|' mk/build.mk.sample > mk/build.mk + echo "GhcRtsCcOpts = -glldb -Og" >> mk/build.mk + ''; + + postUnpack = '' + mkdir -p $out/nix-support + mv $sourceRoot $out/nix-support/source + sourceRoot=$out/nix-support/source ''; configureFlags = [ @@ -103,6 +112,8 @@ in stdenv.mkDerivation (rec { dontSetConfigureCross = true; + dontStrip = true; + passthru = { inherit bootPkgs cross; diff --git a/pkgs/os-specific/darwin/ghc-standalone-archive/default.nix b/pkgs/os-specific/darwin/ghc-standalone-archive/default.nix new file mode 100644 index 000000000000..d23328d362e0 --- /dev/null +++ b/pkgs/os-specific/darwin/ghc-standalone-archive/default.nix @@ -0,0 +1,14 @@ +{ runCommand, cctools }: +{ haskellPackages, src, deps ? p : [], name }: let + inherit (haskellPackages) ghc ghcWithPackages; + with-env = ghcWithPackages deps; + crossPrefix = if (ghc.cross or null) != null then "${ghc.cross.config}-" else ""; + ghcName = "${crossPrefix}ghc"; +in runCommand name { buildInputs = [ with-env cctools ]; } '' + mkdir -p $out/lib + mkdir -p $out/include + ${ghcName} ${src} -staticlib -outputdir . -o $out/lib/${name}.a -stubdir $out/include + for file in ${ghc}/lib/${ghcName}-${ghc.version}/include/*; do + ln -sv $file $out/include + done +'' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 944f9c9d2258..8d2b4cf52014 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18042,4 +18042,6 @@ in simplenote = callPackage ../applications/misc/simplenote { }; hy = callPackage ../development/interpreters/hy {}; + + ghc-standalone-archive = callPackage ../os-specific/darwin/ghc-standalone-archive { inherit (darwin) cctools; }; }