Merge branch 'binutils-always-patch' into ios-mini-staging
This commit is contained in:
@@ -4,13 +4,13 @@ with builtins;
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "arachne-pnr-${version}";
|
||||
version = "2018.03.07";
|
||||
version = "2018.05.03";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "cseed";
|
||||
repo = "arachne-pnr";
|
||||
rev = "6701132cbd5c7b31edd0ff18ca6727eb3691186b";
|
||||
sha256 = "1c55k9gpq042mkyxrblwskbmr3v0baj4gkwm45v1gvmhdza6gfw8";
|
||||
rev = "ea2d04215bc0fd6072cda244caeb6670892033b3";
|
||||
sha256 = "0qhf5djyh0pzmgv33rjnnqq6asmmwxjdadvr18a83iy9pll6gg5k";
|
||||
};
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "closure-compiler-${version}";
|
||||
version = "20180402";
|
||||
version = "20180506";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://dl.google.com/closure-compiler/compiler-${version}.tar.gz";
|
||||
sha256 = "1xbr2wvppzhq189z9m70zqry2a3hh6cdydwbc1jm2z7imsg1i6c1";
|
||||
sha256 = "10w9vs61fs14k8g3wlng0ifj0knfm0xfc4rsnd2c75464hkdxvr9";
|
||||
};
|
||||
|
||||
sourceRoot = ".";
|
||||
|
||||
@@ -99,22 +99,6 @@ let version = "4.8.5";
|
||||
|
||||
javaAwtGtk = langJava && x11Support;
|
||||
|
||||
/* Platform flags */
|
||||
platformFlags = let
|
||||
gccArch = targetPlatform.platform.gcc.arch or null;
|
||||
gccCpu = targetPlatform.platform.gcc.cpu or null;
|
||||
gccAbi = targetPlatform.platform.gcc.abi or null;
|
||||
gccFpu = targetPlatform.platform.gcc.fpu or null;
|
||||
gccFloat = targetPlatform.platform.gcc.float or null;
|
||||
gccMode = targetPlatform.platform.gcc.mode or null;
|
||||
in
|
||||
optional (gccArch != null) "--with-arch=${gccArch}" ++
|
||||
optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
|
||||
optional (gccAbi != null) "--with-abi=${gccAbi}" ++
|
||||
optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
|
||||
optional (gccFloat != null) "--with-float=${gccFloat}" ++
|
||||
optional (gccMode != null) "--with-mode=${gccMode}";
|
||||
|
||||
/* Cross-gcc settings (build == host != target) */
|
||||
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
||||
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
||||
@@ -200,11 +184,7 @@ stdenv.mkDerivation ({
|
||||
libc_dev = stdenv.cc.libc_dev;
|
||||
|
||||
postPatch =
|
||||
if (hostPlatform.isHurd
|
||||
|| (libcCross != null # e.g., building `gcc.crossDrv'
|
||||
&& libcCross ? crossConfig
|
||||
&& libcCross.crossConfig == "i586-pc-gnu")
|
||||
|| (crossGNU && libcCross != null))
|
||||
if targetPlatform.isHurd
|
||||
then
|
||||
# On GNU/Hurd glibc refers to Hurd & Mach headers and libpthread is not
|
||||
# in glibc, so add the right `-I' flags to the default spec string.
|
||||
@@ -356,7 +336,7 @@ stdenv.mkDerivation ({
|
||||
optional javaAwtGtk "--enable-java-awt=gtk" ++
|
||||
optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
|
||||
|
||||
platformFlags ++
|
||||
(import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
|
||||
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
|
||||
optional (!bootstrap) "--disable-bootstrap" ++
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ stdenv, targetPackages, fetchurl, noSysDirs
|
||||
{ stdenv, targetPackages, fetchurl, noSysDirs, fetchpatch
|
||||
, langC ? true, langCC ? true, langFortran ? false
|
||||
, langObjC ? targetPlatform.isDarwin
|
||||
, langObjCpp ? targetPlatform.isDarwin
|
||||
@@ -65,7 +65,21 @@ let version = "4.9.4";
|
||||
++ optional noSysDirs ../no-sys-dirs.patch
|
||||
++ optional langFortran ../gfortran-driving.patch
|
||||
++ [ ../struct-ucontext.patch ../struct-sigaltstack-4.9.patch ] # glibc-2.26
|
||||
;
|
||||
# Retpoline patches pulled from the branch hjl/indirect/gcc-4_9-branch (by H.J. Lu, the author of GCC upstream retpoline commits)
|
||||
++ builtins.map ({commit, sha256}: fetchpatch {url = "https://github.com/hjl-tools/gcc/commit/${commit}.patch"; inherit sha256;})
|
||||
[{ commit = "e623d21608e96ecd6b65f0d06312117d20488a38"; sha256 = "1ix8i4d2r3ygbv7npmsdj790rhxqrnfwcqzv48b090r9c3ij8ay3"; }
|
||||
{ commit = "2015a09e332309f12de1dadfe179afa6a29368b8"; sha256 = "0xcfs0cbb63llj2gbcdrvxim79ax4k4aswn0a3yjavxsj71s1n91"; }
|
||||
{ commit = "6b11591f4494f705e8746e7d58b7f423191f4e92"; sha256 = "0aydyhsm2ig0khgbp27am7vq7liyqrq6kfhfi2ki0ij0ab1hfbga"; }
|
||||
{ commit = "203c7d9c3e9cb0f88816b481ef8e7e87b3ecc373"; sha256 = "0wqn16y7wy5kg8ngfcni5qdwfphl01axczibbk49bxclwnzvldqa"; }
|
||||
{ commit = "f039c6f284b2c9ce97c8353d6034978795c4872e"; sha256 = "13fkgdb17lpyxfksz1zanxhgpsm0jrss9w61nbl7an4im22hz7ci"; }
|
||||
{ commit = "ed42606bdab1c5d9e5ad828cd6fe1a0557f193b7"; sha256 = "0gdnn8v3p03imj3qga2mzdhpgbmjcklkxdl97jvz5xia2ikzknxm"; }
|
||||
{ commit = "5278e062ef292fd2fbf987d25389785f4c5c0f99"; sha256 = "0j81x758wf8v7j4rx5wc1cy7yhkvhlhv3wmnarwakxiwsspq0vrs"; }
|
||||
{ commit = "76f1ffbbb6cd9f6ecde6c82cd16e20a27242e890"; sha256 = "1py56y6gp7fjf4f8bbsfwh5bs1gnmlqda1ycsmnwlzfm0cshdp0c"; }
|
||||
{ commit = "4ca48b2b688b135c0390f54ea9077ef10aedd52c"; sha256 = "15r019pzr3k0lpgyvdc92c8fayw8b5lrzncna4bqmamcsdz7vsaw"; }
|
||||
{ commit = "98c7bf9ddc80db965d69d61521b1c7a1cec32d9a"; sha256 = "1d7pfdv1q23nf0wadw7jbp6d6r7pnzjpbyxgbdfv7j1vr9l1bp60"; }
|
||||
{ commit = "3dc76b53ad896494ca62550a7a752fecbca3f7a2"; sha256 = "0jvdzfpvfdmklfcjwqblwq1i22iqis7ljpvm7adra5d7zf2xk7xz"; }
|
||||
{ commit = "1e961ed49b18e176c7457f53df2433421387c23b"; sha256 = "04dnqqs4qsvz4g8cq6db5id41kzys7hzhcaycwmc9rpqygs2ajwz"; }
|
||||
{ commit = "e137c72d099f9b3b47f4cc718aa11eab14df1a9c"; sha256 = "1ms0dmz74yf6kwgjfs4d2fhj8y6mcp2n184r3jk44wx2xc24vgb2"; }];
|
||||
|
||||
javaEcj = fetchurl {
|
||||
# The `$(top_srcdir)/ecj.jar' file is automatically picked up at
|
||||
@@ -90,22 +104,6 @@ let version = "4.9.4";
|
||||
|
||||
javaAwtGtk = langJava && x11Support;
|
||||
|
||||
/* Platform flags */
|
||||
platformFlags = let
|
||||
gccArch = targetPlatform.platform.gcc.arch or null;
|
||||
gccCpu = targetPlatform.platform.gcc.cpu or null;
|
||||
gccAbi = targetPlatform.platform.gcc.abi or null;
|
||||
gccFpu = targetPlatform.platform.gcc.fpu or null;
|
||||
gccFloat = targetPlatform.platform.gcc.float or null;
|
||||
gccMode = targetPlatform.platform.gcc.mode or null;
|
||||
in
|
||||
optional (gccArch != null) "--with-arch=${gccArch}" ++
|
||||
optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
|
||||
optional (gccAbi != null) "--with-abi=${gccAbi}" ++
|
||||
optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
|
||||
optional (gccFloat != null) "--with-float=${gccFloat}" ++
|
||||
optional (gccMode != null) "--with-mode=${gccMode}";
|
||||
|
||||
/* Cross-gcc settings (build == host != target) */
|
||||
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
||||
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
||||
@@ -195,11 +193,7 @@ stdenv.mkDerivation ({
|
||||
libc_dev = stdenv.cc.libc_dev;
|
||||
|
||||
postPatch =
|
||||
if (hostPlatform.isHurd
|
||||
|| (libcCross != null # e.g., building `gcc.crossDrv'
|
||||
&& libcCross ? crossConfig
|
||||
&& libcCross.crossConfig == "i586-pc-gnu")
|
||||
|| (crossGNU && libcCross != null))
|
||||
if targetPlatform.isHurd
|
||||
then
|
||||
# On GNU/Hurd glibc refers to Hurd & Mach headers and libpthread is not
|
||||
# in glibc, so add the right `-I' flags to the default spec string.
|
||||
@@ -364,7 +358,7 @@ stdenv.mkDerivation ({
|
||||
optional javaAwtGtk "--enable-java-awt=gtk" ++
|
||||
optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
|
||||
|
||||
platformFlags ++
|
||||
(import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
|
||||
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
|
||||
optional (!bootstrap) "--disable-bootstrap" ++
|
||||
|
||||
@@ -482,8 +476,7 @@ stdenv.mkDerivation ({
|
||||
platforms =
|
||||
stdenv.lib.platforms.linux ++
|
||||
stdenv.lib.platforms.freebsd ++
|
||||
stdenv.lib.platforms.illumos ++
|
||||
stdenv.lib.platforms.darwin;
|
||||
stdenv.lib.platforms.illumos;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -62,10 +62,6 @@ let version = "5.5.0";
|
||||
++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
|
||||
++ optional noSysDirs ../no-sys-dirs.patch
|
||||
++ optional langFortran ../gfortran-driving.patch
|
||||
|
||||
# This could be applied unconditionally but I don't want to cause a full
|
||||
# Linux rebuild.
|
||||
++ optional stdenv.cc.isClang ./libcxx38-and-above.patch
|
||||
++ optional stdenv.hostPlatform.isMusl (fetchpatch {
|
||||
url = https://raw.githubusercontent.com/richfelker/musl-cross-make/e84b1bd1fc12a3def33111ca6df522cd6e5ec361/patches/gcc-5.3.0/0001-musl.diff;
|
||||
sha256 = "0pppbf8myi2kjhm3z3479ihn1cm60kycfv60gj8yy1bs0pl1qcfm";
|
||||
@@ -94,22 +90,6 @@ let version = "5.5.0";
|
||||
|
||||
javaAwtGtk = langJava && x11Support;
|
||||
|
||||
/* Platform flags */
|
||||
platformFlags = let
|
||||
gccArch = targetPlatform.platform.gcc.arch or null;
|
||||
gccCpu = targetPlatform.platform.gcc.cpu or null;
|
||||
gccAbi = targetPlatform.platform.gcc.abi or null;
|
||||
gccFpu = targetPlatform.platform.gcc.fpu or null;
|
||||
gccFloat = targetPlatform.platform.gcc.float or null;
|
||||
gccMode = targetPlatform.platform.gcc.mode or null;
|
||||
in
|
||||
optional (gccArch != null) "--with-arch=${gccArch}" ++
|
||||
optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
|
||||
optional (gccAbi != null) "--with-abi=${gccAbi}" ++
|
||||
optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
|
||||
optional (gccFloat != null) "--with-float=${gccFloat}" ++
|
||||
optional (gccMode != null) "--with-mode=${gccMode}";
|
||||
|
||||
/* Cross-gcc settings (build == host != target) */
|
||||
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
||||
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
||||
@@ -211,11 +191,7 @@ stdenv.mkDerivation ({
|
||||
'';
|
||||
|
||||
postPatch =
|
||||
if (hostPlatform.isHurd
|
||||
|| (libcCross != null # e.g., building `gcc.crossDrv'
|
||||
&& libcCross ? crossConfig
|
||||
&& libcCross.crossConfig == "i586-pc-gnu")
|
||||
|| (crossGNU && libcCross != null))
|
||||
if targetPlatform.isHurd
|
||||
then
|
||||
# On GNU/Hurd glibc refers to Hurd & Mach headers and libpthread is not
|
||||
# in glibc, so add the right `-I' flags to the default spec string.
|
||||
@@ -380,7 +356,7 @@ stdenv.mkDerivation ({
|
||||
optional javaAwtGtk "--enable-java-awt=gtk" ++
|
||||
optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
|
||||
|
||||
platformFlags ++
|
||||
(import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
|
||||
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
|
||||
optional (!bootstrap) "--disable-bootstrap" ++
|
||||
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
This is a slightly modified version of https://svnweb.freebsd.org/ports/head/lang/gcc5/files/patch-libc%2B%2B?revision=432958&view=co&pathrev=432958,
|
||||
which doesn't apply cleanly due to them using a slightly different format of patch from us. I just replaced the .orig file references with a/b paths.
|
||||
|
||||
--- a/gcc/auto-profile.c 2015-01-18 02:25:42 UTC
|
||||
+++ b/gcc/auto-profile.c
|
||||
@@ -19,11 +19,9 @@ along with GCC; see the file COPYING3.
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "config.h"
|
||||
-#include "system.h"
|
||||
-
|
||||
-#include <string.h>
|
||||
#include <map>
|
||||
#include <set>
|
||||
+#include "system.h"
|
||||
|
||||
#include "coretypes.h"
|
||||
#include "hash-set.h"
|
||||
--- a/gcc/graphite-isl-ast-to-gimple.c 2017-01-19 21:02:12 UTC
|
||||
+++ b/gcc/graphite-isl-ast-to-gimple.c
|
||||
@@ -38,6 +38,7 @@ extern "C" {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+#include <map>
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "hash-set.h"
|
||||
@@ -75,7 +76,6 @@ extern "C" {
|
||||
#include "tree-scalar-evolution.h"
|
||||
#include "gimple-ssa.h"
|
||||
#include "tree-into-ssa.h"
|
||||
-#include <map>
|
||||
|
||||
#ifdef HAVE_isl
|
||||
#include "graphite-poly.h"
|
||||
--- a/gcc/system.h 2015-01-05 12:33:28 UTC
|
||||
+++ b/gcc/system.h
|
||||
@@ -217,6 +217,7 @@ extern int errno;
|
||||
#ifdef __cplusplus
|
||||
# include <algorithm>
|
||||
# include <cstring>
|
||||
+# include <new>
|
||||
# include <utility>
|
||||
#endif
|
||||
|
||||
@@ -88,22 +88,6 @@ let version = "6.4.0";
|
||||
|
||||
javaAwtGtk = langJava && x11Support;
|
||||
|
||||
/* Platform flags */
|
||||
platformFlags = let
|
||||
gccArch = targetPlatform.platform.gcc.arch or null;
|
||||
gccCpu = targetPlatform.platform.gcc.cpu or null;
|
||||
gccAbi = targetPlatform.platform.gcc.abi or null;
|
||||
gccFpu = targetPlatform.platform.gcc.fpu or null;
|
||||
gccFloat = targetPlatform.platform.gcc.float or null;
|
||||
gccMode = targetPlatform.platform.gcc.mode or null;
|
||||
in
|
||||
optional (gccArch != null) "--with-arch=${gccArch}" ++
|
||||
optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
|
||||
optional (gccAbi != null) "--with-abi=${gccAbi}" ++
|
||||
optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
|
||||
optional (gccFloat != null) "--with-float=${gccFloat}" ++
|
||||
optional (gccMode != null) "--with-mode=${gccMode}";
|
||||
|
||||
/* Cross-gcc settings (build == host != target) */
|
||||
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
||||
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
||||
@@ -211,11 +195,7 @@ stdenv.mkDerivation ({
|
||||
'';
|
||||
|
||||
postPatch =
|
||||
if (hostPlatform.isHurd
|
||||
|| (libcCross != null # e.g., building `gcc.crossDrv'
|
||||
&& libcCross ? crossConfig
|
||||
&& libcCross.crossConfig == "i586-pc-gnu")
|
||||
|| (crossGNU && libcCross != null))
|
||||
if targetPlatform.isHurd
|
||||
then
|
||||
# On GNU/Hurd glibc refers to Hurd & Mach headers and libpthread is not
|
||||
# in glibc, so add the right `-I' flags to the default spec string.
|
||||
@@ -384,7 +364,7 @@ stdenv.mkDerivation ({
|
||||
optional javaAwtGtk "--enable-java-awt=gtk" ++
|
||||
optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
|
||||
|
||||
platformFlags ++
|
||||
(import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
|
||||
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
|
||||
optional (!bootstrap) "--disable-bootstrap" ++
|
||||
|
||||
|
||||
@@ -93,22 +93,6 @@ let version = "7.3.0";
|
||||
|
||||
javaAwtGtk = langJava && x11Support;
|
||||
|
||||
/* Platform flags */
|
||||
platformFlags = let
|
||||
gccArch = targetPlatform.platform.gcc.arch or null;
|
||||
gccCpu = targetPlatform.platform.gcc.cpu or null;
|
||||
gccAbi = targetPlatform.platform.gcc.abi or null;
|
||||
gccFpu = targetPlatform.platform.gcc.fpu or null;
|
||||
gccFloat = targetPlatform.platform.gcc.float or null;
|
||||
gccMode = targetPlatform.platform.gcc.mode or null;
|
||||
in
|
||||
optional (gccArch != null) "--with-arch=${gccArch}" ++
|
||||
optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
|
||||
optional (gccAbi != null) "--with-abi=${gccAbi}" ++
|
||||
optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
|
||||
optional (gccFloat != null) "--with-float=${gccFloat}" ++
|
||||
optional (gccMode != null) "--with-mode=${gccMode}";
|
||||
|
||||
/* Cross-gcc settings (build == host != target) */
|
||||
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
||||
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
||||
@@ -220,11 +204,7 @@ stdenv.mkDerivation ({
|
||||
patchShebangs $configureScript
|
||||
done
|
||||
'' + (
|
||||
if (hostPlatform.isHurd
|
||||
|| (libcCross != null # e.g., building `gcc.crossDrv'
|
||||
&& libcCross ? crossConfig
|
||||
&& libcCross.crossConfig == "i586-pc-gnu")
|
||||
|| (crossGNU && libcCross != null))
|
||||
if targetPlatform.isHurd
|
||||
then
|
||||
# On GNU/Hurd glibc refers to Hurd & Mach headers and libpthread is not
|
||||
# in glibc, so add the right `-I' flags to the default spec string.
|
||||
@@ -389,8 +369,7 @@ stdenv.mkDerivation ({
|
||||
optional javaAwtGtk "--enable-java-awt=gtk" ++
|
||||
optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
|
||||
|
||||
|
||||
platformFlags ++
|
||||
(import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
|
||||
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
|
||||
optional (!bootstrap) "--disable-bootstrap" ++
|
||||
|
||||
@@ -402,6 +381,7 @@ stdenv.mkDerivation ({
|
||||
"--with-gnu-as" "--without-gnu-ld"
|
||||
]
|
||||
++ optional (targetPlatform == hostPlatform && targetPlatform.libc == "musl") "--disable-libsanitizer"
|
||||
++ optional (targetPlatform.isAarch64) "--enable-fix-cortex-a53-843419"
|
||||
;
|
||||
|
||||
targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
|
||||
|
||||
434
pkgs/development/compilers/gcc/8/default.nix
Normal file
434
pkgs/development/compilers/gcc/8/default.nix
Normal file
@@ -0,0 +1,434 @@
|
||||
{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
|
||||
, langC ? true, langCC ? true, langFortran ? false
|
||||
, langObjC ? targetPlatform.isDarwin
|
||||
, langObjCpp ? targetPlatform.isDarwin
|
||||
, langGo ? false
|
||||
, profiledCompiler ? false
|
||||
, staticCompiler ? false
|
||||
, enableShared ? true
|
||||
, texinfo ? null
|
||||
, perl ? null # optional, for texi2pod (then pod2man)
|
||||
, gmp, mpfr, libmpc, gettext, which
|
||||
, libelf # optional, for link-time optimizations (LTO)
|
||||
, isl ? null # optional, for the Graphite optimization framework.
|
||||
, zlib ? null
|
||||
, enableMultilib ? false
|
||||
, enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins
|
||||
, name ? "gcc"
|
||||
, libcCross ? null
|
||||
, crossStageStatic ? false
|
||||
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
|
||||
, stripped ? true
|
||||
, gnused ? null
|
||||
, cloog # unused; just for compat with gcc4, as we override the parameter on some places
|
||||
, darwin ? null
|
||||
, buildPlatform, hostPlatform, targetPlatform
|
||||
, buildPackages
|
||||
}:
|
||||
|
||||
# LTO needs libelf and zlib.
|
||||
assert libelf != null -> zlib != null;
|
||||
|
||||
# Make sure we get GNU sed.
|
||||
assert hostPlatform.isDarwin -> gnused != null;
|
||||
|
||||
# The go frontend is written in c++
|
||||
assert langGo -> langCC;
|
||||
|
||||
with stdenv.lib;
|
||||
with builtins;
|
||||
|
||||
let version = "8.1.0";
|
||||
|
||||
# Whether building a cross-compiler for GNU/Hurd.
|
||||
crossGNU = targetPlatform != hostPlatform && targetPlatform.config == "i586-pc-gnu";
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
patches =
|
||||
optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
|
||||
++ optional noSysDirs ../no-sys-dirs.patch
|
||||
/* ++ optional (hostPlatform != buildPlatform) (fetchpatch { # XXX: Refine when this should be applied
|
||||
url = "https://git.busybox.net/buildroot/plain/package/gcc/${version}/0900-remove-selftests.patch?id=11271540bfe6adafbc133caf6b5b902a816f5f02";
|
||||
sha256 = ""; # TODO: uncomment and check hash when available.
|
||||
}) */
|
||||
++ optional langFortran ../gfortran-driving.patch;
|
||||
|
||||
/* Cross-gcc settings (build == host != target) */
|
||||
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
||||
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
||||
crossConfigureFlags =
|
||||
# Ensure that -print-prog-name is able to find the correct programs.
|
||||
[ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as"
|
||||
"--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++
|
||||
(if crossMingw && crossStageStatic then [
|
||||
"--with-headers=${libcCross}/include"
|
||||
"--with-gcc"
|
||||
"--with-gnu-as"
|
||||
"--with-gnu-ld"
|
||||
"--with-gnu-ld"
|
||||
"--disable-shared"
|
||||
"--disable-nls"
|
||||
"--disable-debug"
|
||||
"--enable-sjlj-exceptions"
|
||||
"--enable-threads=win32"
|
||||
"--disable-win32-registry"
|
||||
] else if crossStageStatic then [
|
||||
"--disable-libssp"
|
||||
"--disable-nls"
|
||||
"--without-headers"
|
||||
"--disable-threads"
|
||||
"--disable-libgomp"
|
||||
"--disable-libquadmath"
|
||||
"--disable-shared"
|
||||
"--disable-libatomic" # libatomic requires libc
|
||||
"--disable-decimal-float" # libdecnumber requires libc
|
||||
# maybe only needed on musl, PATH_MAX
|
||||
# https://github.com/richfelker/musl-cross-make/blob/0867cdf300618d1e3e87a0a939fa4427207ad9d7/litecross/Makefile#L62
|
||||
"--disable-libmpx"
|
||||
] else [
|
||||
(if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
|
||||
else "--with-headers=${getDev libcCross}/include")
|
||||
"--enable-__cxa_atexit"
|
||||
"--enable-long-long"
|
||||
] ++
|
||||
(if crossMingw then [
|
||||
"--enable-threads=win32"
|
||||
"--enable-sjlj-exceptions"
|
||||
"--enable-hash-synchronization"
|
||||
"--enable-libssp"
|
||||
"--disable-nls"
|
||||
"--with-dwarf2"
|
||||
# To keep ABI compatibility with upstream mingw-w64
|
||||
"--enable-fully-dynamic-string"
|
||||
] else
|
||||
optionals (targetPlatform.libc == "uclibc" || targetPlatform.libc == "musl") [
|
||||
# libsanitizer requires netrom/netrom.h which is not
|
||||
# available in uclibc.
|
||||
"--disable-libsanitizer"
|
||||
# In uclibc cases, libgomp needs an additional '-ldl'
|
||||
# and as I don't know how to pass it, I disable libgomp.
|
||||
"--disable-libgomp"
|
||||
# musl at least, disable: https://git.buildroot.net/buildroot/commit/?id=873d4019f7fb00f6a80592224236b3ba7d657865
|
||||
"--disable-libmpx"
|
||||
] ++ [
|
||||
"--enable-threads=posix"
|
||||
"--enable-nls"
|
||||
"--disable-decimal-float" # No final libdecnumber (it may work only in 386)
|
||||
]));
|
||||
stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
|
||||
crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else "";
|
||||
|
||||
bootstrap = targetPlatform == hostPlatform;
|
||||
|
||||
in
|
||||
|
||||
stdenv.mkDerivation ({
|
||||
name = "${name}${if stripped then "" else "-debug"}-${version}" + crossNameAddon;
|
||||
|
||||
builder = ../builder.sh;
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://gcc/releases/gcc-${version}/gcc-${version}.tar.xz";
|
||||
sha256 = "0lxil8x0jjx7zbf90cy1rli650akaa6hpk8wk8s62vk2jbwnc60x";
|
||||
};
|
||||
|
||||
inherit patches;
|
||||
|
||||
outputs = [ "out" "lib" "man" "info" ];
|
||||
setOutputFlags = false;
|
||||
NIX_NO_SELF_RPATH = true;
|
||||
|
||||
libc_dev = stdenv.cc.libc_dev;
|
||||
|
||||
hardeningDisable = [ "format" ];
|
||||
|
||||
# This should kill all the stdinc frameworks that gcc and friends like to
|
||||
# insert into default search paths.
|
||||
prePatch = stdenv.lib.optionalString hostPlatform.isDarwin ''
|
||||
substituteInPlace gcc/config/darwin-c.c \
|
||||
--replace 'if (stdinc)' 'if (0)'
|
||||
|
||||
substituteInPlace libgcc/config/t-slibgcc-darwin \
|
||||
--replace "-install_name @shlib_slibdir@/\$(SHLIB_INSTALL_NAME)" "-install_name $lib/lib/\$(SHLIB_INSTALL_NAME)"
|
||||
|
||||
substituteInPlace libgfortran/configure \
|
||||
--replace "-install_name \\\$rpath/\\\$soname" "-install_name $lib/lib/\\\$soname"
|
||||
'';
|
||||
|
||||
postPatch = ''
|
||||
configureScripts=$(find . -name configure)
|
||||
for configureScript in $configureScripts; do
|
||||
patchShebangs $configureScript
|
||||
done
|
||||
'' + (
|
||||
if targetPlatform.isHurd
|
||||
then
|
||||
# On GNU/Hurd glibc refers to Hurd & Mach headers and libpthread is not
|
||||
# in glibc, so add the right `-I' flags to the default spec string.
|
||||
assert libcCross != null -> libpthreadCross != null;
|
||||
let
|
||||
libc = if libcCross != null then libcCross else stdenv.glibc;
|
||||
gnu_h = "gcc/config/gnu.h";
|
||||
extraCPPDeps =
|
||||
libc.propagatedBuildInputs
|
||||
++ stdenv.lib.optional (libpthreadCross != null) libpthreadCross
|
||||
++ stdenv.lib.optional (libpthread != null) libpthread;
|
||||
extraCPPSpec =
|
||||
concatStrings (intersperse " "
|
||||
(map (x: "-I${x.dev or x}/include") extraCPPDeps));
|
||||
extraLibSpec =
|
||||
if libpthreadCross != null
|
||||
then "-L${libpthreadCross}/lib ${libpthreadCross.TARGET_LDFLAGS}"
|
||||
else "-L${libpthread}/lib";
|
||||
in
|
||||
'' echo "augmenting \`CPP_SPEC' in \`${gnu_h}' with \`${extraCPPSpec}'..."
|
||||
sed -i "${gnu_h}" \
|
||||
-es'|CPP_SPEC *"\(.*\)$|CPP_SPEC "${extraCPPSpec} \1|g'
|
||||
|
||||
echo "augmenting \`LIB_SPEC' in \`${gnu_h}' with \`${extraLibSpec}'..."
|
||||
sed -i "${gnu_h}" \
|
||||
-es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
|
||||
|
||||
echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc.dev}/include'..."
|
||||
sed -i "${gnu_h}" \
|
||||
-es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc.dev}/include"|g'
|
||||
''
|
||||
else if targetPlatform != hostPlatform || stdenv.cc.libc != null then
|
||||
# On NixOS, use the right path to the dynamic linker instead of
|
||||
# `/lib/ld*.so'.
|
||||
let
|
||||
libc = if libcCross != null then libcCross else stdenv.cc.libc;
|
||||
in
|
||||
(
|
||||
'' echo "fixing the \`GLIBC_DYNAMIC_LINKER', \`UCLIBC_DYNAMIC_LINKER', and \`MUSL_DYNAMIC_LINKER' macros..."
|
||||
for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h
|
||||
do
|
||||
grep -q _DYNAMIC_LINKER "$header" || continue
|
||||
echo " fixing \`$header'..."
|
||||
sed -i "$header" \
|
||||
-e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g' \
|
||||
-e 's|define[[:blank:]]*MUSL_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define MUSL_DYNAMIC_LINKER\1 "${libc.out}\2"|g'
|
||||
done
|
||||
''
|
||||
+ stdenv.lib.optionalString (targetPlatform.libc == "musl")
|
||||
''
|
||||
sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR'
|
||||
''
|
||||
)
|
||||
else "");
|
||||
|
||||
# TODO(@Ericson2314): Make passthru instead. Weird to avoid mass rebuild,
|
||||
crossStageStatic = targetPlatform == hostPlatform || crossStageStatic;
|
||||
inherit noSysDirs staticCompiler
|
||||
libcCross crossMingw;
|
||||
|
||||
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
||||
nativeBuildInputs = [ texinfo which gettext ]
|
||||
++ (optional (perl != null) perl);
|
||||
|
||||
# For building runtime libs
|
||||
depsBuildTarget =
|
||||
if hostPlatform == buildPlatform then [
|
||||
targetPackages.stdenv.cc.bintools # newly-built gcc will be used
|
||||
] else assert targetPlatform == hostPlatform; [ # build != host == target
|
||||
stdenv.cc
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
gmp mpfr libmpc libelf
|
||||
targetPackages.stdenv.cc.bintools # For linking code at run-time
|
||||
] ++ (optional (isl != null) isl)
|
||||
++ (optional (zlib != null) zlib)
|
||||
++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools])
|
||||
|
||||
# The builder relies on GNU sed (for instance, Darwin's `sed' fails with
|
||||
# "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
|
||||
++ (optional hostPlatform.isDarwin gnused)
|
||||
++ (optional hostPlatform.isDarwin targetPackages.stdenv.cc.bintools)
|
||||
;
|
||||
|
||||
NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";
|
||||
|
||||
preConfigure = stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
|
||||
export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g`
|
||||
export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
|
||||
export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
|
||||
export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
|
||||
'';
|
||||
|
||||
dontDisableStatic = true;
|
||||
|
||||
# TODO(@Ericson2314): Always pass "--target" and always prefix.
|
||||
configurePlatforms =
|
||||
# TODO(@Ericson2314): Figure out what's going wrong with Arm
|
||||
if buildPlatform == hostPlatform && hostPlatform == targetPlatform && targetPlatform.isAarch32
|
||||
then []
|
||||
else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
|
||||
|
||||
configureFlags =
|
||||
# Basic dependencies
|
||||
[
|
||||
"--with-gmp-include=${gmp.dev}/include"
|
||||
"--with-gmp-lib=${gmp.out}/lib"
|
||||
"--with-mpfr-include=${mpfr.dev}/include"
|
||||
"--with-mpfr-lib=${mpfr.out}/lib"
|
||||
"--with-mpc=${libmpc}"
|
||||
] ++
|
||||
optional (libelf != null) "--with-libelf=${libelf}" ++
|
||||
optional (!(crossMingw && crossStageStatic))
|
||||
"--with-native-system-header-dir=${getDev stdenv.cc.libc}/include" ++
|
||||
|
||||
# Basic configuration
|
||||
[
|
||||
"--enable-lto"
|
||||
"--disable-libstdcxx-pch"
|
||||
"--without-included-gettext"
|
||||
"--with-system-zlib"
|
||||
"--enable-static"
|
||||
"--enable-languages=${
|
||||
concatStrings (intersperse ","
|
||||
( optional langC "c"
|
||||
++ optional langCC "c++"
|
||||
++ optional langFortran "fortran"
|
||||
++ optional langGo "go"
|
||||
++ optional langObjC "objc"
|
||||
++ optional langObjCpp "obj-c++"
|
||||
++ optionals crossDarwin [ "objc" "obj-c++" ]
|
||||
)
|
||||
)
|
||||
}"
|
||||
] ++
|
||||
|
||||
(if enableMultilib
|
||||
then ["--enable-multilib" "--disable-libquadmath"]
|
||||
else ["--disable-multilib"]) ++
|
||||
optional (!enableShared) "--disable-shared" ++
|
||||
(if enablePlugin
|
||||
then ["--enable-plugin"]
|
||||
else ["--disable-plugin"]) ++
|
||||
|
||||
# Optional features
|
||||
optional (isl != null) "--with-isl=${isl}" ++
|
||||
|
||||
(import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
|
||||
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
|
||||
optional (!bootstrap) "--disable-bootstrap" ++
|
||||
|
||||
# Platform-specific flags
|
||||
optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++
|
||||
optionals hostPlatform.isSunOS [
|
||||
"--enable-long-long" "--enable-libssp" "--enable-threads=posix" "--disable-nls" "--enable-__cxa_atexit"
|
||||
# On Illumos/Solaris GNU as is preferred
|
||||
"--with-gnu-as" "--without-gnu-ld"
|
||||
]
|
||||
++ optional (targetPlatform == hostPlatform && targetPlatform.libc == "musl") "--disable-libsanitizer"
|
||||
;
|
||||
|
||||
targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
|
||||
|
||||
buildFlags =
|
||||
optional bootstrap (if profiledCompiler then "profiledbootstrap" else "bootstrap");
|
||||
|
||||
installTargets =
|
||||
if stripped
|
||||
then "install-strip"
|
||||
else "install";
|
||||
|
||||
/* For cross-built gcc (build != host == target) */
|
||||
crossAttrs = {
|
||||
dontStrip = true;
|
||||
buildFlags = "";
|
||||
};
|
||||
|
||||
# http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210
|
||||
${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64";
|
||||
|
||||
# Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the
|
||||
# library headers and binaries, regarless of the language being compiled.
|
||||
#
|
||||
# Likewise, the LTO code doesn't find zlib.
|
||||
#
|
||||
# Cross-compiling, we need gcc not to read ./specs in order to build the g++
|
||||
# compiler (after the specs for the cross-gcc are created). Having
|
||||
# LIBRARY_PATH= makes gcc read the specs from ., and the build breaks.
|
||||
|
||||
CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([]
|
||||
++ optional (zlib != null) zlib
|
||||
++ optional (libpthread != null) libpthread
|
||||
++ optional (libpthreadCross != null) libpthreadCross
|
||||
|
||||
# On GNU/Hurd glibc refers to Mach & Hurd
|
||||
# headers.
|
||||
++ optionals (libcCross != null && libcCross ? propagatedBuildInputs)
|
||||
libcCross.propagatedBuildInputs
|
||||
));
|
||||
|
||||
LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([]
|
||||
++ optional (zlib != null) zlib
|
||||
++ optional (libpthread != null) libpthread)
|
||||
);
|
||||
|
||||
EXTRA_TARGET_FLAGS = optionals
|
||||
(targetPlatform != hostPlatform && libcCross != null)
|
||||
([
|
||||
"-idirafter ${getDev libcCross}/include"
|
||||
] ++ optionals (! crossStageStatic) [
|
||||
"-B${libcCross.out}/lib"
|
||||
]);
|
||||
|
||||
EXTRA_TARGET_LDFLAGS = optionals
|
||||
(targetPlatform != hostPlatform && libcCross != null)
|
||||
([
|
||||
"-Wl,-L${libcCross.out}/lib"
|
||||
] ++ (if crossStageStatic then [
|
||||
"-B${libcCross.out}/lib"
|
||||
] else [
|
||||
"-Wl,-rpath,${libcCross.out}/lib"
|
||||
"-Wl,-rpath-link,${libcCross.out}/lib"
|
||||
]) ++ optionals (libpthreadCross != null) [
|
||||
"-L${libpthreadCross}/lib"
|
||||
"-Wl,${libpthreadCross.TARGET_LDFLAGS}"
|
||||
]);
|
||||
|
||||
passthru =
|
||||
{ inherit langC langCC langObjC langObjCpp langFortran langGo version; isGNU = true; };
|
||||
|
||||
inherit enableParallelBuilding enableMultilib;
|
||||
|
||||
inherit (stdenv) is64bit;
|
||||
|
||||
meta = {
|
||||
homepage = http://gcc.gnu.org/;
|
||||
license = stdenv.lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
|
||||
description = "GNU Compiler Collection, version ${version}"
|
||||
+ (if stripped then "" else " (with debugging info)");
|
||||
|
||||
longDescription = ''
|
||||
The GNU Compiler Collection includes compiler front ends for C, C++,
|
||||
Objective-C, Fortran, OpenMP for C/C++/Fortran, and Ada, as well as
|
||||
libraries for these languages (libstdc++, libgomp,...).
|
||||
|
||||
GCC development is a part of the GNU Project, aiming to improve the
|
||||
compiler used in the GNU system including the GNU/Linux variant.
|
||||
'';
|
||||
|
||||
maintainers = with stdenv.lib.maintainers; [ synthetica ];
|
||||
|
||||
platforms =
|
||||
stdenv.lib.platforms.linux ++
|
||||
stdenv.lib.platforms.freebsd ++
|
||||
stdenv.lib.platforms.darwin;
|
||||
};
|
||||
}
|
||||
|
||||
// optionalAttrs (targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt" && crossStageStatic) {
|
||||
makeFlags = [ "all-gcc" "all-target-libgcc" ];
|
||||
installTargets = "install-gcc install-target-libgcc";
|
||||
}
|
||||
|
||||
# Strip kills static libs of other archs (hence targetPlatform != hostPlatform)
|
||||
// optionalAttrs (!stripped || targetPlatform != hostPlatform) { dontStrip = true; }
|
||||
|
||||
// optionalAttrs (enableMultilib) { dontMoveLib64 = true; }
|
||||
)
|
||||
13
pkgs/development/compilers/gcc/common/platform-flags.nix
Normal file
13
pkgs/development/compilers/gcc/common/platform-flags.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{ lib, targetPlatform }:
|
||||
|
||||
let
|
||||
p = targetPlatform.platform.gcc or {}
|
||||
// targetPlatform.parsed.abi;
|
||||
in lib.concatLists [
|
||||
(lib.optional (p ? arch) "--with-arch=${p.arch}")
|
||||
(lib.optional (p ? cpu) "--with-cpu=${p.cpu}")
|
||||
(lib.optional (p ? abi) "--with-abi=${p.abi}")
|
||||
(lib.optional (p ? fpu) "--with-fpu=${p.fpu}")
|
||||
(lib.optional (p ? float) "--with-float=${p.float}")
|
||||
(lib.optional (p ? mode) "--with-mode=${p.mode}")
|
||||
]
|
||||
@@ -86,22 +86,6 @@ let version = "7-20170409";
|
||||
|
||||
javaAwtGtk = langJava && x11Support;
|
||||
|
||||
/* Platform flags */
|
||||
platformFlags = let
|
||||
gccArch = targetPlatform.platform.gcc.arch or null;
|
||||
gccCpu = targetPlatform.platform.gcc.cpu or null;
|
||||
gccAbi = targetPlatform.platform.gcc.abi or null;
|
||||
gccFpu = targetPlatform.platform.gcc.fpu or null;
|
||||
gccFloat = targetPlatform.platform.gcc.float or null;
|
||||
gccMode = targetPlatform.platform.gcc.mode or null;
|
||||
in
|
||||
optional (gccArch != null) "--with-arch=${gccArch}" ++
|
||||
optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
|
||||
optional (gccAbi != null) "--with-abi=${gccAbi}" ++
|
||||
optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
|
||||
optional (gccFloat != null) "--with-float=${gccFloat}" ++
|
||||
optional (gccMode != null) "--with-mode=${gccMode}";
|
||||
|
||||
/* Cross-gcc settings (build == host != target) */
|
||||
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
|
||||
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
|
||||
@@ -190,11 +174,7 @@ stdenv.mkDerivation ({
|
||||
hardeningDisable = [ "format" ];
|
||||
|
||||
postPatch =
|
||||
if (hostPlatform.isHurd
|
||||
|| (libcCross != null # e.g., building `gcc.crossDrv'
|
||||
&& libcCross ? crossConfig
|
||||
&& libcCross.crossConfig == "i586-pc-gnu")
|
||||
|| (crossGNU && libcCross != null))
|
||||
if targetPlatform.isHurd
|
||||
then
|
||||
# On GNU/Hurd glibc refers to Hurd & Mach headers and libpthread is not
|
||||
# in glibc, so add the right `-I' flags to the default spec string.
|
||||
@@ -352,7 +332,7 @@ stdenv.mkDerivation ({
|
||||
optional javaAwtGtk "--enable-java-awt=gtk" ++
|
||||
optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
|
||||
|
||||
platformFlags ++
|
||||
(import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
|
||||
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
|
||||
optional (!bootstrap) "--disable-bootstrap" ++
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@ stdenv.mkDerivation rec {
|
||||
# Some scripts used during the build need to have their shebangs patched
|
||||
''
|
||||
patchShebangs ghc-${version}/utils/
|
||||
patchShebangs ghc-${version}/configure
|
||||
'' +
|
||||
|
||||
# Strip is harmful, see also below. It's important that this happens
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
# build-tools
|
||||
, bootPkgs, alex, happy
|
||||
, autoconf, automake, coreutils, fetchurl, perl, python3
|
||||
, autoconf, automake, coreutils, fetchurl, fetchpatch, perl, python3
|
||||
|
||||
, libffi, libiconv ? null, ncurses
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
, # Whether to build dynamic libs for the standard library (on the target
|
||||
# platform). Static libs are always built.
|
||||
enableShared ? true
|
||||
enableShared ? !targetPlatform.useAndroidPrebuilt
|
||||
|
||||
, version ? "8.4.2"
|
||||
}:
|
||||
@@ -50,6 +50,8 @@ let
|
||||
'' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
|
||||
GhcLibHcOpts += -fPIC
|
||||
GhcRtsHcOpts += -fPIC
|
||||
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
|
||||
EXTRA_CC_OPTS += -std=gnu99
|
||||
'';
|
||||
|
||||
# Splicer will pull out correct variations
|
||||
@@ -79,6 +81,13 @@ stdenv.mkDerivation rec {
|
||||
|
||||
outputs = [ "out" "doc" ];
|
||||
|
||||
patches = [(fetchpatch {
|
||||
url = "https://git.haskell.org/hsc2hs.git/patch/738f3666c878ee9e79c3d5e819ef8b3460288edf";
|
||||
sha256 = "0plzsbfaq6vb1023lsarrjglwgr9chld4q3m99rcfzx0yx5mibp3";
|
||||
extraPrefix = "utils/hsc2hs/";
|
||||
stripLen = 1;
|
||||
})];
|
||||
|
||||
postPatch = "patchShebangs .";
|
||||
|
||||
# GHC is a bit confused on its cross terminology.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
, # Whether to build dynamic libs for the standard library (on the target
|
||||
# platform). Static libs are always built.
|
||||
enableShared ? true
|
||||
enableShared ? !targetPlatform.useAndroidPrebuilt
|
||||
|
||||
, version ? "8.5.20180118"
|
||||
}:
|
||||
@@ -50,6 +50,8 @@ let
|
||||
'' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
|
||||
GhcLibHcOpts += -fPIC
|
||||
GhcRtsHcOpts += -fPIC
|
||||
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
|
||||
EXTRA_CC_OPTS += -std=gnu99
|
||||
'';
|
||||
|
||||
# Splicer will pull out correct variations
|
||||
|
||||
6
pkgs/development/compilers/ghcjs-ng/8.2/git.json
Normal file
6
pkgs/development/compilers/ghcjs-ng/8.2/git.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"url": "https://github.com/ghcjs/ghcjs",
|
||||
"rev": "0cff73c3ee13b464adba90f308b77751c75b9f26",
|
||||
"sha256": "1shg34zi6ryaihar62qdkkalv8dsrsqbv58jzkhk9in38sdfkjxv",
|
||||
"fetchSubmodules": true
|
||||
}
|
||||
168
pkgs/development/compilers/ghcjs-ng/8.2/stage0.nix
Normal file
168
pkgs/development/compilers/ghcjs-ng/8.2/stage0.nix
Normal file
@@ -0,0 +1,168 @@
|
||||
{ callPackage, configuredSrc }:
|
||||
|
||||
{
|
||||
|
||||
ghcjs = callPackage
|
||||
({ mkDerivation, aeson, array, attoparsec, base, base16-bytestring
|
||||
, base64-bytestring, binary, bytestring, Cabal, containers
|
||||
, cryptohash, data-default, deepseq, directory, executable-path
|
||||
, filepath, ghc-api-ghcjs, ghc-boot, ghc-paths, ghci-ghcjs
|
||||
, ghcjs-th, haddock-api-ghcjs, hashable, haskell-src-exts
|
||||
, haskell-src-meta, http-types, HUnit, lens, lifted-base, mtl
|
||||
, network, optparse-applicative, parallel, parsec, process, random
|
||||
, regex-posix, safe, shelly, split, stdenv, stringsearch, syb
|
||||
, system-fileio, system-filepath, tar, template-haskell
|
||||
, template-haskell-ghcjs, terminfo, test-framework
|
||||
, test-framework-hunit, text, time, transformers
|
||||
, transformers-compat, unix, unix-compat, unordered-containers
|
||||
, vector, wai, wai-app-static, wai-extra, wai-websockets, warp
|
||||
, webdriver, websockets, wl-pprint-text, yaml
|
||||
}:
|
||||
mkDerivation {
|
||||
pname = "ghcjs";
|
||||
version = "8.2.0.1";
|
||||
src = configuredSrc + /.;
|
||||
isLibrary = true;
|
||||
isExecutable = true;
|
||||
enableSeparateDataOutput = true;
|
||||
setupHaskellDepends = [
|
||||
base Cabal containers directory filepath process template-haskell
|
||||
transformers
|
||||
];
|
||||
libraryHaskellDepends = [
|
||||
aeson array attoparsec base base16-bytestring base64-bytestring
|
||||
binary bytestring Cabal containers cryptohash data-default deepseq
|
||||
directory filepath ghc-api-ghcjs ghc-boot ghc-paths ghci-ghcjs
|
||||
ghcjs-th hashable haskell-src-exts haskell-src-meta lens mtl
|
||||
optparse-applicative parallel parsec process regex-posix safe split
|
||||
stringsearch syb template-haskell template-haskell-ghcjs text time
|
||||
transformers unordered-containers vector wl-pprint-text yaml
|
||||
];
|
||||
executableHaskellDepends = [
|
||||
aeson base binary bytestring Cabal containers directory
|
||||
executable-path filepath ghc-api-ghcjs ghc-boot haddock-api-ghcjs
|
||||
lens mtl optparse-applicative process shelly system-fileio
|
||||
system-filepath tar terminfo text time transformers
|
||||
transformers-compat unix unix-compat unordered-containers vector
|
||||
yaml
|
||||
];
|
||||
testHaskellDepends = [
|
||||
aeson base bytestring data-default deepseq directory http-types
|
||||
HUnit lens lifted-base network optparse-applicative process random
|
||||
shelly system-fileio system-filepath test-framework
|
||||
test-framework-hunit text time transformers unordered-containers
|
||||
wai wai-app-static wai-extra wai-websockets warp webdriver
|
||||
websockets yaml
|
||||
];
|
||||
description = "Haskell to JavaScript compiler";
|
||||
license = stdenv.lib.licenses.mit;
|
||||
}) {};
|
||||
|
||||
ghc-api-ghcjs = callPackage
|
||||
({ mkDerivation, array, base, binary, bytestring, containers
|
||||
, deepseq, directory, filepath, ghc-boot, ghc-boot-th, ghci-ghcjs
|
||||
, hoopl, hpc, process, stdenv, template-haskell-ghcjs, terminfo
|
||||
, time, transformers, unix
|
||||
}:
|
||||
mkDerivation {
|
||||
pname = "ghc-api-ghcjs";
|
||||
version = "8.2.2";
|
||||
src = configuredSrc + /lib/ghc-api-ghcjs;
|
||||
libraryHaskellDepends = [
|
||||
array base binary bytestring containers deepseq directory filepath
|
||||
ghc-boot ghc-boot-th ghci-ghcjs hoopl hpc process
|
||||
template-haskell-ghcjs terminfo time transformers unix
|
||||
];
|
||||
homepage = "http://www.haskell.org/ghc/";
|
||||
description = "The GHC API (customized for GHCJS)";
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
}) {};
|
||||
|
||||
ghci-ghcjs = callPackage
|
||||
({ mkDerivation, array, base, binary, bytestring, containers
|
||||
, deepseq, filepath, ghc-boot, ghc-boot-th, stdenv
|
||||
, template-haskell-ghcjs, transformers, unix
|
||||
}:
|
||||
mkDerivation {
|
||||
pname = "ghci-ghcjs";
|
||||
version = "8.2.2";
|
||||
src = configuredSrc + /lib/ghci-ghcjs;
|
||||
libraryHaskellDepends = [
|
||||
array base binary bytestring containers deepseq filepath ghc-boot
|
||||
ghc-boot-th template-haskell-ghcjs transformers unix
|
||||
];
|
||||
description = "The library supporting GHC's interactive interpreter (customized for GHCJS)";
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
}) {};
|
||||
|
||||
ghcjs-th = callPackage
|
||||
({ mkDerivation, base, binary, bytestring, containers, ghc-prim
|
||||
, ghci-ghcjs, stdenv, template-haskell-ghcjs
|
||||
}:
|
||||
mkDerivation {
|
||||
pname = "ghcjs-th";
|
||||
version = "0.1.0.0";
|
||||
src = configuredSrc + /lib/ghcjs-th;
|
||||
libraryHaskellDepends = [
|
||||
base binary bytestring containers ghc-prim ghci-ghcjs
|
||||
template-haskell-ghcjs
|
||||
];
|
||||
homepage = "http://github.com/ghcjs";
|
||||
license = stdenv.lib.licenses.mit;
|
||||
}) {};
|
||||
|
||||
haddock-api-ghcjs = callPackage
|
||||
({ mkDerivation, array, base, bytestring, Cabal, containers, deepseq
|
||||
, directory, filepath, ghc-api-ghcjs, ghc-boot, ghc-paths
|
||||
, haddock-library-ghcjs, hspec, hspec-discover, QuickCheck, stdenv
|
||||
, transformers, xhtml
|
||||
}:
|
||||
mkDerivation {
|
||||
pname = "haddock-api-ghcjs";
|
||||
version = "2.18.1";
|
||||
src = configuredSrc + /lib/haddock-api-ghcjs;
|
||||
enableSeparateDataOutput = true;
|
||||
libraryHaskellDepends = [
|
||||
array base bytestring Cabal containers deepseq directory filepath
|
||||
ghc-api-ghcjs ghc-boot ghc-paths haddock-library-ghcjs transformers
|
||||
xhtml
|
||||
];
|
||||
testHaskellDepends = [
|
||||
base containers ghc-api-ghcjs hspec QuickCheck
|
||||
];
|
||||
testToolDepends = [ hspec-discover ];
|
||||
homepage = "http://www.haskell.org/haddock/";
|
||||
description = "A documentation-generation tool for Haskell libraries (customized for GHCJS)";
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
}) {};
|
||||
|
||||
haddock-library-ghcjs = callPackage
|
||||
({ mkDerivation, base, base-compat, bytestring, deepseq, hspec
|
||||
, hspec-discover, QuickCheck, stdenv, transformers
|
||||
}:
|
||||
mkDerivation {
|
||||
pname = "haddock-library-ghcjs";
|
||||
version = "1.4.4";
|
||||
src = configuredSrc + /lib/haddock-library-ghcjs;
|
||||
libraryHaskellDepends = [ base bytestring deepseq transformers ];
|
||||
testHaskellDepends = [
|
||||
base base-compat bytestring deepseq hspec QuickCheck transformers
|
||||
];
|
||||
testToolDepends = [ hspec-discover ];
|
||||
homepage = "http://www.haskell.org/haddock/";
|
||||
description = "Library exposing some functionality of Haddock";
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
}) {};
|
||||
|
||||
template-haskell-ghcjs = callPackage
|
||||
({ mkDerivation, base, ghc-boot-th, pretty, stdenv }:
|
||||
mkDerivation {
|
||||
pname = "template-haskell-ghcjs";
|
||||
version = "2.12.0.0";
|
||||
src = configuredSrc + /lib/template-haskell-ghcjs;
|
||||
libraryHaskellDepends = [ base ghc-boot-th pretty ];
|
||||
description = "Support library for Template Haskell (customized for GHCJS)";
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
}) {};
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{ haskellLib }:
|
||||
|
||||
let inherit (haskellLib) dontCheck doJailbreak;
|
||||
in self: super: {
|
||||
haddock-library-ghcjs = dontCheck super.haddock-library-ghcjs;
|
||||
haddock-api-ghcjs = doJailbreak super.haddock-api-ghcjs;
|
||||
}
|
||||
6
pkgs/development/compilers/ghcjs-ng/8.4/git.json
Normal file
6
pkgs/development/compilers/ghcjs-ng/8.4/git.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"url": "https://github.com/ghcjs/ghcjs",
|
||||
"rev": "d20da90a4819faad1c6309a06363b34edac0374c",
|
||||
"sha256": "0jmxgfm1zwg6xscjcaycfam7zss8ik4ql4ii5lpryh4h6cdhvkbr",
|
||||
"fetchSubmodules": true
|
||||
}
|
||||
175
pkgs/development/compilers/ghcjs-ng/8.4/stage0.nix
Normal file
175
pkgs/development/compilers/ghcjs-ng/8.4/stage0.nix
Normal file
@@ -0,0 +1,175 @@
|
||||
{ callPackage, configuredSrc }:
|
||||
|
||||
{
|
||||
|
||||
ghcjs = callPackage
|
||||
({ mkDerivation, aeson, array, attoparsec, base, base16-bytestring
|
||||
, base64-bytestring, binary, bytestring, Cabal, containers
|
||||
, cryptohash, data-default, deepseq, directory, executable-path
|
||||
, filepath, ghc-api-ghcjs, ghc-boot, ghc-paths, ghci-ghcjs
|
||||
, ghcjs-th, haddock-api-ghcjs, hashable, haskell-src-exts
|
||||
, haskell-src-meta, http-types, HUnit, lens, lifted-base, mtl
|
||||
, network, optparse-applicative, parallel, parsec, process, random
|
||||
, regex-posix, safe, shelly, split, stdenv, stringsearch, syb
|
||||
, system-fileio, system-filepath, tar, template-haskell
|
||||
, template-haskell-ghcjs, terminfo, test-framework
|
||||
, test-framework-hunit, text, time, transformers
|
||||
, transformers-compat, unix, unix-compat, unordered-containers
|
||||
, vector, wai, wai-app-static, wai-extra, wai-websockets, warp
|
||||
, webdriver, websockets, wl-pprint-text, yaml
|
||||
}:
|
||||
mkDerivation {
|
||||
pname = "ghcjs";
|
||||
version = "8.4.0.1";
|
||||
src = configuredSrc + /.;
|
||||
isLibrary = true;
|
||||
isExecutable = true;
|
||||
enableSeparateDataOutput = true;
|
||||
setupHaskellDepends = [
|
||||
base Cabal containers directory filepath process template-haskell
|
||||
transformers
|
||||
];
|
||||
libraryHaskellDepends = [
|
||||
aeson array attoparsec base base16-bytestring base64-bytestring
|
||||
binary bytestring Cabal containers cryptohash data-default deepseq
|
||||
directory filepath ghc-api-ghcjs ghc-boot ghc-paths ghci-ghcjs
|
||||
ghcjs-th hashable haskell-src-exts haskell-src-meta lens mtl
|
||||
optparse-applicative parallel parsec process regex-posix safe split
|
||||
stringsearch syb template-haskell template-haskell-ghcjs text time
|
||||
transformers unordered-containers vector wl-pprint-text yaml
|
||||
];
|
||||
executableHaskellDepends = [
|
||||
aeson base binary bytestring Cabal containers directory
|
||||
executable-path filepath ghc-api-ghcjs ghc-boot haddock-api-ghcjs
|
||||
lens mtl optparse-applicative process shelly system-fileio
|
||||
system-filepath tar terminfo text time transformers
|
||||
transformers-compat unix unix-compat unordered-containers vector
|
||||
yaml
|
||||
];
|
||||
testHaskellDepends = [
|
||||
aeson base bytestring data-default deepseq directory http-types
|
||||
HUnit lens lifted-base network optparse-applicative process random
|
||||
shelly system-fileio system-filepath test-framework
|
||||
test-framework-hunit text time transformers unordered-containers
|
||||
wai wai-app-static wai-extra wai-websockets warp webdriver
|
||||
websockets yaml
|
||||
];
|
||||
description = "Haskell to JavaScript compiler";
|
||||
license = stdenv.lib.licenses.mit;
|
||||
}) {};
|
||||
|
||||
ghc-api-ghcjs = callPackage
|
||||
({ mkDerivation, array, base, binary, bytestring, containers
|
||||
, deepseq, directory, filepath, ghc-boot, ghc-boot-th, ghci-ghcjs
|
||||
, hpc, process, stdenv, template-haskell-ghcjs, terminfo, time
|
||||
, transformers, unix
|
||||
}:
|
||||
mkDerivation {
|
||||
pname = "ghc-api-ghcjs";
|
||||
version = "8.4.0";
|
||||
src = configuredSrc + /lib/ghc-api-ghcjs;
|
||||
libraryHaskellDepends = [
|
||||
array base binary bytestring containers deepseq directory filepath
|
||||
ghc-boot ghc-boot-th ghci-ghcjs hpc process template-haskell-ghcjs
|
||||
terminfo time transformers unix
|
||||
];
|
||||
homepage = "http://www.haskell.org/ghc/";
|
||||
description = "The GHC API (customized for GHCJS)";
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
}) {};
|
||||
|
||||
ghci-ghcjs = callPackage
|
||||
({ mkDerivation, array, base, binary, bytestring, containers
|
||||
, deepseq, filepath, ghc-boot, ghc-boot-th, stdenv
|
||||
, template-haskell-ghcjs, transformers, unix
|
||||
}:
|
||||
mkDerivation {
|
||||
pname = "ghci-ghcjs";
|
||||
version = "8.4.0";
|
||||
src = configuredSrc + /lib/ghci-ghcjs;
|
||||
libraryHaskellDepends = [
|
||||
array base binary bytestring containers deepseq filepath ghc-boot
|
||||
ghc-boot-th template-haskell-ghcjs transformers unix
|
||||
];
|
||||
description = "The library supporting GHC's interactive interpreter (customized for GHCJS)";
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
}) {};
|
||||
|
||||
ghcjs-th = callPackage
|
||||
({ mkDerivation, base, binary, bytestring, containers, ghc-prim
|
||||
, ghci-ghcjs, stdenv, template-haskell-ghcjs
|
||||
}:
|
||||
mkDerivation {
|
||||
pname = "ghcjs-th";
|
||||
version = "0.1.0.0";
|
||||
src = configuredSrc + /lib/ghcjs-th;
|
||||
libraryHaskellDepends = [
|
||||
base binary bytestring containers ghc-prim ghci-ghcjs
|
||||
template-haskell-ghcjs
|
||||
];
|
||||
homepage = "http://github.com/ghcjs";
|
||||
license = stdenv.lib.licenses.mit;
|
||||
}) {};
|
||||
|
||||
haddock-api-ghcjs = callPackage
|
||||
({ mkDerivation, array, base, bytestring, Cabal, containers, deepseq
|
||||
, directory, filepath, ghc-api-ghcjs, ghc-boot, ghc-paths
|
||||
, haddock-library-ghcjs, hspec, hspec-discover, QuickCheck, stdenv
|
||||
, transformers, xhtml
|
||||
}:
|
||||
mkDerivation {
|
||||
pname = "haddock-api-ghcjs";
|
||||
version = "2.20.0";
|
||||
src = configuredSrc + /lib/haddock-api-ghcjs;
|
||||
enableSeparateDataOutput = true;
|
||||
libraryHaskellDepends = [
|
||||
array base bytestring Cabal containers deepseq directory filepath
|
||||
ghc-api-ghcjs ghc-boot ghc-paths haddock-library-ghcjs transformers
|
||||
xhtml
|
||||
];
|
||||
testHaskellDepends = [
|
||||
array base bytestring Cabal containers deepseq directory filepath
|
||||
ghc-api-ghcjs ghc-boot ghc-paths haddock-library-ghcjs hspec
|
||||
QuickCheck transformers xhtml
|
||||
];
|
||||
testToolDepends = [ hspec-discover ];
|
||||
homepage = "http://www.haskell.org/haddock/";
|
||||
description = "A documentation-generation tool for Haskell libraries";
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
}) {};
|
||||
|
||||
haddock-library-ghcjs = callPackage
|
||||
({ mkDerivation, base, base-compat, bytestring, containers, deepseq
|
||||
, directory, filepath, haddock-library, hspec, hspec-discover
|
||||
, optparse-applicative, QuickCheck, stdenv, transformers, tree-diff
|
||||
}:
|
||||
mkDerivation {
|
||||
pname = "haddock-library-ghcjs";
|
||||
version = "1.6.0";
|
||||
src = configuredSrc + /lib/haddock-library-ghcjs;
|
||||
libraryHaskellDepends = [
|
||||
base bytestring containers deepseq transformers
|
||||
];
|
||||
testHaskellDepends = [
|
||||
base base-compat bytestring containers deepseq directory filepath
|
||||
haddock-library hspec optparse-applicative QuickCheck transformers
|
||||
tree-diff
|
||||
];
|
||||
testToolDepends = [ hspec-discover ];
|
||||
homepage = "http://www.haskell.org/haddock/";
|
||||
description = "Library exposing some functionality of Haddock";
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
}) {};
|
||||
|
||||
template-haskell-ghcjs = callPackage
|
||||
({ mkDerivation, base, ghc-boot-th, pretty, stdenv }:
|
||||
mkDerivation {
|
||||
pname = "template-haskell-ghcjs";
|
||||
version = "2.13.0.0";
|
||||
src = configuredSrc + /lib/template-haskell-ghcjs;
|
||||
libraryHaskellDepends = [ base ghc-boot-th pretty ];
|
||||
description = "Support library for Template Haskell (customized for GHCJS)";
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
}) {};
|
||||
|
||||
}
|
||||
20
pkgs/development/compilers/ghcjs-ng/README.md
Normal file
20
pkgs/development/compilers/ghcjs-ng/README.md
Normal file
@@ -0,0 +1,20 @@
|
||||
New build system for GHCJS 8.2
|
||||
---
|
||||
|
||||
`ghcjs-8.2` reworked the build system, and now comes with its own
|
||||
small package set of dependencies. This involves autogenerating
|
||||
several sources and cabal files, based on a GHC
|
||||
checkout. `callCabal2nix` is off limits, since we don't like "import
|
||||
from derivation" in nixpkgs. So there is a derivation that builds the
|
||||
nix expression that should be checked in whenever GHCJS is updated.
|
||||
|
||||
Updating
|
||||
---
|
||||
|
||||
```
|
||||
$ nix-prefetch-git https://github.com/ghcjs/ghcjs --rev refs/heads/ghc-8.2 \
|
||||
| jq '{ url, rev, fetchSubmodules, sha256 }' \
|
||||
> 8.2/git.json
|
||||
$ cat $(nix-build ../../../.. -A haskell.compiler.ghcjs82.genStage0 --no-out-link) > 8.2/stage0.nix
|
||||
```
|
||||
|
||||
8
pkgs/development/compilers/ghcjs-ng/common-overrides.nix
Normal file
8
pkgs/development/compilers/ghcjs-ng/common-overrides.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{ haskellLib, alex, happy }:
|
||||
|
||||
let inherit (haskellLib) addBuildTools appendConfigureFlag dontHaddock doJailbreak;
|
||||
in self: super: {
|
||||
ghc-api-ghcjs = addBuildTools super.ghc-api-ghcjs [alex happy];
|
||||
ghcjs = dontHaddock (appendConfigureFlag (doJailbreak super.ghcjs) "-fno-wrapper-install");
|
||||
haddock-library-ghcjs = dontHaddock super.haddock-library-ghcjs;
|
||||
}
|
||||
45
pkgs/development/compilers/ghcjs-ng/configured-ghcjs-src.nix
Normal file
45
pkgs/development/compilers/ghcjs-ng/configured-ghcjs-src.nix
Normal file
@@ -0,0 +1,45 @@
|
||||
{ perl
|
||||
, autoconf
|
||||
, automake
|
||||
, python3
|
||||
, gcc
|
||||
, cabal-install
|
||||
, gmp
|
||||
, runCommand
|
||||
|
||||
, ghc
|
||||
, happy
|
||||
, alex
|
||||
|
||||
, ghcjsSrc
|
||||
}:
|
||||
|
||||
runCommand "configured-ghcjs-src" {
|
||||
buildInputs = [
|
||||
perl
|
||||
autoconf
|
||||
automake
|
||||
python3
|
||||
gcc
|
||||
ghc
|
||||
happy
|
||||
alex
|
||||
cabal-install
|
||||
];
|
||||
inherit ghcjsSrc;
|
||||
} ''
|
||||
export HOME=$(pwd)
|
||||
cp -r "$ghcjsSrc" "$out"
|
||||
chmod -R +w "$out"
|
||||
cd "$out"
|
||||
|
||||
# TODO: Find a better way to avoid impure version numbers
|
||||
sed -i 's/RELEASE=NO/RELEASE=YES/' ghc/configure.ac
|
||||
|
||||
# TODO: How to actually fix this?
|
||||
# Seems to work fine and produce the right files.
|
||||
touch ghc/includes/ghcautoconf.h
|
||||
|
||||
patchShebangs .
|
||||
./utils/makePackages.sh copy
|
||||
''
|
||||
91
pkgs/development/compilers/ghcjs-ng/default.nix
Normal file
91
pkgs/development/compilers/ghcjs-ng/default.nix
Normal file
@@ -0,0 +1,91 @@
|
||||
{ stdenv
|
||||
, callPackage
|
||||
, fetchgit
|
||||
, ghcjsSrcJson ? null
|
||||
, ghcjsSrc ? fetchgit (builtins.fromJSON (builtins.readFile ghcjsSrcJson))
|
||||
, bootPkgs
|
||||
, alex
|
||||
, happy
|
||||
, stage0
|
||||
, haskellLib
|
||||
, cabal-install
|
||||
, nodejs
|
||||
, makeWrapper
|
||||
, xorg
|
||||
, gmp
|
||||
, pkgconfig
|
||||
, lib
|
||||
, ghcjsDepOverrides ? (_:_:{})
|
||||
}:
|
||||
|
||||
let
|
||||
passthru = {
|
||||
configuredSrc = callPackage ./configured-ghcjs-src.nix {
|
||||
inherit ghcjsSrc alex happy;
|
||||
inherit (bootPkgs) ghc;
|
||||
};
|
||||
genStage0 = callPackage ./mk-stage0.nix { inherit (passthru) configuredSrc; };
|
||||
bootPkgs = bootPkgs.extend (lib.foldr lib.composeExtensions (_:_:{}) [
|
||||
(self: _: import stage0 {
|
||||
inherit (passthru) configuredSrc;
|
||||
inherit (self) callPackage;
|
||||
})
|
||||
|
||||
(callPackage ./common-overrides.nix { inherit haskellLib alex happy; })
|
||||
ghcjsDepOverrides
|
||||
]);
|
||||
|
||||
targetPrefix = "";
|
||||
inherit bootGhcjs;
|
||||
inherit (bootGhcjs) version;
|
||||
isGhcjs = true;
|
||||
|
||||
# Relics of the old GHCJS build system
|
||||
stage1Packages = [];
|
||||
mkStage2 = _: {};
|
||||
};
|
||||
|
||||
bootGhcjs = haskellLib.justStaticExecutables passthru.bootPkgs.ghcjs;
|
||||
libexec =
|
||||
if builtins.compareVersions bootGhcjs.version "8.3" <= 0
|
||||
then "${bootGhcjs}/bin"
|
||||
else "${bootGhcjs}/libexec/${stdenv.system}-${passthru.bootPkgs.ghc.name}/${bootGhcjs.name}";
|
||||
|
||||
in stdenv.mkDerivation {
|
||||
name = "ghcjs";
|
||||
src = passthru.configuredSrc;
|
||||
nativeBuildInputs = [
|
||||
bootGhcjs
|
||||
passthru.bootPkgs.ghc
|
||||
cabal-install
|
||||
nodejs
|
||||
makeWrapper
|
||||
xorg.lndir
|
||||
gmp
|
||||
pkgconfig
|
||||
];
|
||||
phases = ["unpackPhase" "buildPhase"];
|
||||
buildPhase = ''
|
||||
export HOME=$TMP
|
||||
cd lib/boot
|
||||
|
||||
mkdir -p $out/bin
|
||||
mkdir -p $out/libexec
|
||||
lndir ${libexec} $out/bin
|
||||
|
||||
wrapProgram $out/bin/ghcjs --add-flags "-B$out/libexec"
|
||||
wrapProgram $out/bin/haddock-ghcjs --add-flags "-B$out/libexec"
|
||||
wrapProgram $out/bin/ghcjs-pkg --add-flags "--global-package-db=$out/libexec/package.conf.d"
|
||||
|
||||
env PATH=$out/bin:$PATH $out/bin/ghcjs-boot -j1 --with-ghcjs-bin $out/bin
|
||||
'';
|
||||
|
||||
# We hard code -j1 as a temporary workaround for
|
||||
# https://github.com/ghcjs/ghcjs/issues/654
|
||||
# enableParallelBuilding = true;
|
||||
|
||||
inherit passthru;
|
||||
|
||||
meta.platforms = passthru.bootPkgs.ghc.meta.platforms;
|
||||
}
|
||||
|
||||
25
pkgs/development/compilers/ghcjs-ng/mk-stage0.nix
Normal file
25
pkgs/development/compilers/ghcjs-ng/mk-stage0.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
{ configuredSrc
|
||||
, runCommand
|
||||
, cabal2nix
|
||||
, yq
|
||||
}:
|
||||
|
||||
runCommand "stage0.nix" {
|
||||
buildInputs = [cabal2nix yq];
|
||||
} ''
|
||||
(
|
||||
printf '{ callPackage, configuredSrc }:\n\n{\n\n'
|
||||
yq '.packages | .[]' ${configuredSrc}/stack.yaml -r | sed 's|^\.$|./.|' | sed 's|^\.||' | while read f; do
|
||||
printf ' %s = callPackage\n' \
|
||||
"$(find ${configuredSrc}/$f -name "*.cabal" -maxdepth 1 \
|
||||
| xargs basename \
|
||||
| sed 's/.cabal$//')"
|
||||
printf '(%s) {};' \
|
||||
"$(cabal2nix ${configuredSrc}/$f \
|
||||
| sed 's|${configuredSrc}/|configuredSrc + |g')" \
|
||||
| sed 's/^/ /'
|
||||
printf '\n\n'
|
||||
done
|
||||
printf '}\n'
|
||||
) > $out
|
||||
''
|
||||
@@ -76,6 +76,10 @@ stdenv.mkDerivation rec {
|
||||
sed -i '/TestRespectSetgidDir/areturn' src/cmd/go/internal/work/build_test.go
|
||||
# Remove cert tests that conflict with NixOS's cert resolution
|
||||
sed -i '/TestEnvVars/areturn' src/crypto/x509/root_unix_test.go
|
||||
# TestWritevError hangs sometimes
|
||||
sed -i '/TestWritevError/areturn' src/net/writev_test.go
|
||||
# TestVariousDeadlines fails sometimes
|
||||
sed -i '/TestVariousDeadlines/areturn' src/net/timeout_test.go
|
||||
|
||||
sed -i 's,/etc/protocols,${iana-etc}/etc/protocols,' src/net/lookup_unix.go
|
||||
sed -i 's,/etc/services,${iana-etc}/etc/services,' src/net/port_unix.go
|
||||
|
||||
@@ -76,6 +76,10 @@ stdenv.mkDerivation rec {
|
||||
sed -i '/TestRespectSetgidDir/areturn' src/cmd/go/internal/work/build_test.go
|
||||
# Remove cert tests that conflict with NixOS's cert resolution
|
||||
sed -i '/TestEnvVars/areturn' src/crypto/x509/root_unix_test.go
|
||||
# TestWritevError hangs sometimes
|
||||
sed -i '/TestWritevError/areturn' src/net/writev_test.go
|
||||
# TestVariousDeadlines fails sometimes
|
||||
sed -i '/TestVariousDeadlines/areturn' src/net/timeout_test.go
|
||||
|
||||
sed -i 's,/etc/protocols,${iana-etc}/etc/protocols,' src/net/lookup_unix.go
|
||||
sed -i 's,/etc/services,${iana-etc}/etc/services,' src/net/port_unix.go
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{ stdenv, fetchurl, makeWrapper, jre, unzip }:
|
||||
|
||||
let
|
||||
version = "1.2.40";
|
||||
version = "1.2.41";
|
||||
in stdenv.mkDerivation rec {
|
||||
inherit version;
|
||||
name = "kotlin-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/JetBrains/kotlin/releases/download/v${version}/kotlin-compiler-${version}.zip";
|
||||
sha256 = "0n4na0ddnjgc573szk5bpd34v5gib71pah62xq7vwdf34q8mg61l";
|
||||
sha256 = "0p16xl2qhm7913abd06vvmsx956ny51jjfr6knkmrnk8y9r2g1xg";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ jre ] ;
|
||||
@@ -22,6 +22,11 @@ in stdenv.mkDerivation rec {
|
||||
for p in $(ls $out/bin/) ; do
|
||||
wrapProgram $out/bin/$p --prefix PATH ":" ${jre}/bin ;
|
||||
done
|
||||
|
||||
if [ -f $out/LICENSE ]; then
|
||||
install -D $out/LICENSE $out/share/kotlin/LICENSE
|
||||
rm $out/LICENSE
|
||||
fi
|
||||
'';
|
||||
|
||||
meta = {
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
{ stdenv, lib, fetchurl, makeWrapper, nodejs, openssl, pcre, readline, sqlite }:
|
||||
# based on https://github.com/nim-lang/Nim/blob/v0.18.0/.travis.yml
|
||||
|
||||
{ stdenv, lib, fetchurl, makeWrapper, nodejs-slim-8_x, openssl, pcre, readline, sqlite, boehmgc, sfml, tzdata, coreutils }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "nim-${version}";
|
||||
version = "0.17.2";
|
||||
version = "0.18.0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://nim-lang.org/download/${name}.tar.xz";
|
||||
sha256 = "1gc2xk3ygmz9y4pm75pligssgw995a7gvnfpy445fjpw4d81pzxa";
|
||||
sha256 = "45c74adb35f08dfa9add1112ae17330e5d902ebb4a36e7046caee8b79e6f3bd0";
|
||||
};
|
||||
|
||||
doCheck = true;
|
||||
@@ -18,6 +20,7 @@ stdenv.mkDerivation rec {
|
||||
"-lpcre"
|
||||
"-lreadline"
|
||||
"-lsqlite3"
|
||||
"-lgc"
|
||||
];
|
||||
|
||||
# 1. nodejs is only needed for tests
|
||||
@@ -25,12 +28,12 @@ stdenv.mkDerivation rec {
|
||||
# used for bootstrapping, but koch insists on moving the nim compiler around
|
||||
# as part of building it, so it cannot be read-only
|
||||
|
||||
buildInputs = [
|
||||
makeWrapper nodejs
|
||||
openssl pcre readline sqlite
|
||||
buildInputs = [
|
||||
makeWrapper nodejs-slim-8_x tzdata coreutils
|
||||
openssl pcre readline sqlite boehmgc sfml
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
buildPhase = ''
|
||||
sh build.sh
|
||||
./bin/nim c koch
|
||||
./koch boot -d:release \
|
||||
@@ -48,7 +51,35 @@ stdenv.mkDerivation rec {
|
||||
--suffix PATH : ${lib.makeBinPath [ stdenv.cc ]}
|
||||
'';
|
||||
|
||||
checkPhase = "./koch tests";
|
||||
postPatch =
|
||||
let disableTest = ''sed -i '1i discard \"\"\"\n disabled: true\n\"\"\"\n\n' '';
|
||||
disableCompile = ''sed -i -e 's/^/#/' '';
|
||||
in ''
|
||||
substituteInPlace ./tests/async/tioselectors.nim --replace "/bin/sleep" "sleep"
|
||||
substituteInPlace ./tests/osproc/tworkingdir.nim --replace "/usr/bin" "${coreutils}/bin"
|
||||
substituteInPlace ./tests/stdlib/ttimes.nim --replace "/usr/share/zoneinfo" "${tzdata}/share/zoneinfo"
|
||||
|
||||
# disable supposedly broken tests
|
||||
${disableTest} ./tests/errmsgs/tproper_stacktrace2.nim
|
||||
${disableTest} ./tests/vm/trgba.nim
|
||||
|
||||
# disable tests requiring network access (not available in the build container)
|
||||
${disableTest} ./tests/stdlib/thttpclient.nim
|
||||
${disableTest} ./tests/cpp/tasync_cpp.nim
|
||||
${disableTest} ./tests/niminaction/Chapter7/Tweeter/src/tweeter.nim
|
||||
|
||||
# disable tests requiring un-downloadable dependencies (using nimble, which isn't available in the fetch phase)
|
||||
${disableCompile} ./tests/manyloc/keineschweine/keineschweine.nim
|
||||
${disableTest} ./tests/manyloc/keineschweine/keineschweine.nim
|
||||
${disableCompile} ./tests/manyloc/nake/nakefile.nim
|
||||
${disableTest} ./tests/manyloc/nake/nakefile.nim
|
||||
${disableCompile} ./tests/manyloc/named_argument_bug/main.nim
|
||||
${disableTest} ./tests/manyloc/named_argument_bug/main.nim
|
||||
'';
|
||||
|
||||
checkPhase = ''
|
||||
./koch tests
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Statically typed, imperative programming language";
|
||||
|
||||
@@ -26,6 +26,11 @@ let
|
||||
|
||||
# jni.h expects jni_md.h to be in the header search path.
|
||||
ln -s $out/include/darwin/*_md.h $out/include/
|
||||
|
||||
if [ -f $out/LICENSE ]; then
|
||||
install -D $out/LICENSE $out/share/zulu/LICENSE
|
||||
rm $out/LICENSE
|
||||
fi
|
||||
'';
|
||||
|
||||
preFixup = ''
|
||||
|
||||
@@ -16,6 +16,11 @@ let
|
||||
|
||||
# jni.h expects jni_md.h to be in the header search path.
|
||||
ln -s $out/include/darwin/*_md.h $out/include/
|
||||
|
||||
if [ -f $out/LICENSE ]; then
|
||||
install -D $out/LICENSE $out/share/zulu/LICENSE
|
||||
rm $out/LICENSE
|
||||
fi
|
||||
'';
|
||||
|
||||
preFixup = ''
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
{ stdenv, fetchFromGitHub, coreutils }:
|
||||
{ stdenv, fetchFromGitHub, coreutils, which }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "owl-lisp-${version}";
|
||||
version = "0.1.14";
|
||||
version = "0.1.15";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "aoh";
|
||||
repo = "owl-lisp";
|
||||
rev = "v${version}";
|
||||
sha256 = "1rr0icprna3zs834q1pj4xy21cql3pcfknfkqipq01rhnl2893sz";
|
||||
sha256 = "0pczmra2x6icyz6b6g66pp5ij83cq4wszg0ssw8qm7a5314kxkq4";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ which ];
|
||||
|
||||
prePatch = ''
|
||||
substituteInPlace Makefile --replace /usr $out
|
||||
|
||||
@@ -19,7 +21,7 @@ stdenv.mkDerivation rec {
|
||||
done
|
||||
'';
|
||||
|
||||
# tests are already run as part of the compilation process
|
||||
# tests are run as part of the compilation process
|
||||
doCheck = false;
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
{ stdenv, fetchFromGitHub, autoconf, automake, boost, bison, flex, openjdk, doxygen, perl, graphviz, libtool, lsb-release, ncurses, zlib, sqlite }:
|
||||
{ stdenv, fetchFromGitHub
|
||||
, boost, bison, flex, openjdk, doxygen
|
||||
, perl, graphviz, libtool, ncurses, zlib, sqlite
|
||||
, autoreconfHook }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "1.2.0";
|
||||
@@ -11,12 +14,10 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "1g8yvm40h102mab8lacpl1cwgqsw1js0s1yn4l84l9fjdvlh2ygd";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ autoreconfHook bison flex ];
|
||||
|
||||
buildInputs = [
|
||||
autoconf automake boost bison flex openjdk
|
||||
# Used for 1.2.0
|
||||
libtool lsb-release ncurses zlib sqlite
|
||||
# Used for docs
|
||||
doxygen perl graphviz
|
||||
boost openjdk ncurses zlib sqlite doxygen perl graphviz
|
||||
];
|
||||
|
||||
patchPhase = ''
|
||||
@@ -29,8 +30,6 @@ stdenv.mkDerivation rec {
|
||||
# for boost and failing there, so we tell it what's what here.
|
||||
configureFlags = [ "--with-boost-libdir=${boost}/lib" ];
|
||||
|
||||
preConfigure = "./bootstrap";
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "A translator of declarative Datalog programs into the C++ language";
|
||||
homepage = "http://souffle-lang.github.io/";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ stdenv, fetchFromGitHub, fetchFromBitbucket
|
||||
{ stdenv, fetchFromGitHub
|
||||
, pkgconfig, tcl, readline, libffi, python3, bison, flex
|
||||
}:
|
||||
|
||||
@@ -6,25 +6,25 @@ with builtins;
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "yosys-${version}";
|
||||
version = "2018.03.21";
|
||||
version = "2018.05.03";
|
||||
|
||||
srcs = [
|
||||
(fetchFromGitHub {
|
||||
owner = "yosyshq";
|
||||
repo = "yosys";
|
||||
rev = "3f0070247590458c5ed28c5a7abfc3b9d1ec138b";
|
||||
sha256 = "0rsnjk25asg7dkxcmim464rmxgvm7x7njmcp5nyl8y4iwn8i9p8v";
|
||||
rev = "a572b495387743a58111e7264917a497faa17ebf";
|
||||
sha256 = "0q4xh4sy3n83c8il8lygzv0i6ca4qw36i2k6qz6giw0wd2pkibkb";
|
||||
name = "yosys";
|
||||
})
|
||||
|
||||
# NOTE: the version of abc used here is synchronized with
|
||||
# the one in the yosys Makefile of the version above;
|
||||
# keep them the same for quality purposes.
|
||||
(fetchFromBitbucket {
|
||||
owner = "alanmi";
|
||||
(fetchFromGitHub {
|
||||
owner = "berkeley-abc";
|
||||
repo = "abc";
|
||||
rev = "6e3c24b3308a";
|
||||
sha256 = "1i4wv0si4fb6dpv2yrpkp588mdlfrnx2s02q2fgra5apdm54c53w";
|
||||
rev = "f23ea8e33f6d5cc54f58bec6d9200483e5d8c704";
|
||||
sha256 = "1xwmq3k5hfavdrs7zbqjxh35kr2pis4i6hhzrq7qzyzs0az0hls9";
|
||||
name = "yosys-abc";
|
||||
})
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user