Merge branch 'master' into lprndn_Nixpkgs

This commit is contained in:
lprndn
2017-04-03 21:37:11 +02:00
committed by GitHub
3611 changed files with 106147 additions and 65003 deletions

View File

@@ -26,6 +26,10 @@ let
buildInputs = [ drv ];
};
customPhases = filterAttrs
(_: v: v != null)
{ inherit setupHook configurePhase buildPhase installPhase; };
pkg = self: stdenv.mkDerivation (attrs // {
name = "${name}-${version}";
@@ -41,37 +45,30 @@ let
inherit src;
setupHook = if setupHook == null
then writeText "setupHook.sh" ''
setupHook = writeText "setupHook.sh" ''
addToSearchPath ERL_LIBS "$1/lib/erlang/lib/"
''
else setupHook;
'';
postPatch = ''
rm -f rebar rebar3
'' + postPatch;
configurePhase = if configurePhase == null
then ''
configurePhase = ''
runHook preConfigure
${erlang}/bin/escript ${rebar3.bootstrapper} ${debugInfoFlag}
runHook postConfigure
''
else configurePhase;
'';
buildPhase = if buildPhase == null
then ''
buildPhase = ''
runHook preBuild
HOME=. rebar3 compile
${if compilePorts then ''
HOME=. rebar3 pc compile
'' else ''''}
runHook postBuild
''
else installPhase;
'';
installPhase = if installPhase == null
then ''
installPhase = ''
runHook preInstall
mkdir -p "$out/lib/erlang/lib/${name}-${version}"
for reldir in src ebin priv include; do
@@ -81,8 +78,7 @@ let
success=1
done
runHook postInstall
''
else installPhase;
'';
meta = {
inherit (erlang.meta) platforms;
@@ -93,6 +89,6 @@ let
env = shell self;
inherit beamDeps;
};
});
} // customPhases);
in
fix pkg

View File

@@ -52,5 +52,6 @@ stdenv.mkDerivation {
homepage = http://www.ps.uni-saarland.de/alice/;
license = stdenv.lib.licenses.mit;
maintainers = [ stdenv.lib.maintainers.doublec ];
broken = true;
};
}

View File

@@ -2,11 +2,11 @@
stdenv.mkDerivation rec {
name = "closure-compiler-${version}";
version = "20160208";
version = "20170218";
src = fetchurl {
url = "http://dl.google.com/closure-compiler/compiler-${version}.tar.gz";
sha256 = "19v9z8lfxfmhc4cl9fys7vnaslqiznjy1jpk5mcv468p7vysg46p";
sha256 = "06snabmpy07x4xm8d1xgq5dfzbjli10xkxk3nx9jms39zkj493cd";
};
phases = [ "installPhase" ];
@@ -16,9 +16,9 @@ stdenv.mkDerivation rec {
installPhase = ''
mkdir -p $out/share/java $out/bin
tar -xzf $src
cp -r compiler.jar $out/share/java/
cp -r closure-compiler-v${version}.jar $out/share/java/
echo "#!${bash}/bin/bash" > $out/bin/closure-compiler
echo "${jre}/bin/java -jar $out/share/java/compiler.jar \"\$@\"" >> $out/bin/closure-compiler
echo "${jre}/bin/java -jar $out/share/java/closure-compiler-v${version}.jar \"\$@\"" >> $out/bin/closure-compiler
chmod +x $out/bin/closure-compiler
'';

View File

@@ -1,25 +1,25 @@
{ stdenv, lib, fetchurl
, coq, ocaml, findlib, menhir
, coq, ocamlPackages
, tools ? stdenv.cc
}:
assert lib.versionAtLeast ocaml.version "4.02";
assert lib.versionAtLeast ocamlPackages.ocaml.version "4.02";
stdenv.mkDerivation rec {
name = "compcert-${version}";
version = "2.7.1";
version = "3.0.1";
src = fetchurl {
url = "http://compcert.inria.fr/release/${name}.tgz";
sha256 = "1vhbs1fmr9x2imqyd6yfvkbz763jhjfm9wk4nizf9rn1cvxrjqa4";
sha256 = "0dgrj26dzdy4n3s9b5hwc6lm54vans1v4qx9hdp1q8w1qqcdriq9";
};
buildInputs = [ coq ocaml findlib menhir ];
buildInputs = [ coq ]
++ (with ocamlPackages; [ ocaml findlib menhir ]);
enableParallelBuilding = true;
configurePhase = ''
substituteInPlace ./configure --replace pl2 pl3
substituteInPlace ./configure --replace '{toolprefix}gcc' '{toolprefix}cc'
./configure -clightgen -prefix $out -toolprefix ${tools}/bin/ '' +
(if stdenv.isDarwin then "ia32-macosx" else "ia32-linux");
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
mkdir -p $lib/share/doc/compcert
mv doc/html $lib/share/doc/compcert/
mkdir -p $lib/lib/coq/${coq.coq-version}/user-contrib/compcert/
mv backend cfrontend common cparser driver flocq ia32 lib \
mv backend cfrontend common cparser driver flocq x86 x86_32 lib \
$lib/lib/coq/${coq.coq-version}/user-contrib/compcert/
'';

View File

@@ -102,5 +102,6 @@ stdenv.mkDerivation rec {
platforms = [ "x86_64-linux" ];
maintainers = with stdenv.lib.maintainers; [ obadz ];
license = stdenv.lib.licenses.mit;
broken = true; # CoreCLR has proven to be very difficult to package. PRs welcome if someone wants to shave that yak.
};
}

View File

@@ -1,7 +1,7 @@
{ stdenv, fetchurl, boehmgc, libatomic_ops, pcre, libevent, libiconv, llvm_39, makeWrapper }:
stdenv.mkDerivation rec {
version = "0.20.5";
version = "0.21.0";
name = "crystal-${version}-1";
arch =
{
@@ -14,15 +14,15 @@ stdenv.mkDerivation rec {
url = "https://github.com/crystal-lang/crystal/releases/download/${version}/crystal-${version}-1-${arch}.tar.gz";
sha256 =
{
"x86_64-linux" = "fd077c0a727419e131b1be6198a5aa5820ecbdaafd2d2bb38be5716ba75b5100";
"i686-linux" = "e3a890f11833c57c9004655d108f981c7c630cd7a939f828d9a6c571705bc3e7";
"x86_64-darwin" = "79462c8ff994b36cff219c356967844a17e8cb2817bb24a196a960a08b8c9e47";
"x86_64-linux" = "0a44539df3813baea4381c314ad5f782b13cf1596e478851c52cd84193cc7a1f";
"i686-linux" = "9a45287f94d329f5ebe77f5a0d71cd0e09c3db79b0b56f6fe4a5166beed707ef";
"x86_64-darwin" = "e92abb33a9a592febb4e629ad68375b2577acd791a71220b8dc407904be469ee";
}."${stdenv.system}" or (throw "system ${stdenv.system} not supported");
};
src = fetchurl {
url = "https://github.com/crystal-lang/crystal/archive/${version}.tar.gz";
sha256 = "ee1e5948c6e662ccb1e62671cf2c91458775b559b23d74ab226dc2a2d23f7707";
sha256 = "4dd01703f5304a0eda7f02fc362fba27ba069666097c0f921f8a3ee58808779c";
};
# crystal on Darwin needs libiconv to build

View File

@@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, patchelf, perl, ncurses, expat, python26, python27, zlib
{ lib, stdenv, fetchurl, patchelf, perl, ncurses, expat, python27, zlib
, xorg, gtk2, glib, fontconfig, freetype, unixODBC, alsaLib, glibc
}:
@@ -22,7 +22,7 @@ let
}
else throw "cudatoolkit does not support platform ${stdenv.system}";
outputs = [ "out" "sdk" ];
outputs = [ "out" "doc" ];
buildInputs = [ perl ];
@@ -43,24 +43,31 @@ let
'';
buildPhase = ''
find . -type f -executable -exec patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
'{}' \; || true
find . -type f -exec patchelf \
--set-rpath $rpath:$out/jre/lib/amd64/jli:$out/lib:$out/lib64:$out/nvvm/lib:$out/nvvm/lib64:$(cat $NIX_CC/nix-support/orig-cc)/lib \
--force-rpath \
'{}' \; || true
chmod -R u+w .
while IFS= read -r -d ''$'\0' i; do
if ! isELF "$i"; then continue; fi
echo "patching $i..."
if [[ ! $i =~ \.so ]]; then
patchelf \
--set-interpreter "''$(cat $NIX_CC/nix-support/dynamic-linker)" $i
fi
rpath2=$rpath:$lib/lib:$out/jre/lib/amd64/jli:$out/lib:$out/lib64:$out/nvvm/lib:$out/nvvm/lib64
patchelf --set-rpath $rpath2 --force-rpath $i
done < <(find . -type f -print0)
'';
installPhase = ''
mkdir $out $sdk
mkdir $out
perl ./install-linux.pl --prefix="$out"
rm $out/tools/CUDA_Occupancy_Calculator.xls
perl ./install-sdk-linux.pl --prefix="$sdk" --cudaprefix="$out"
rm $out/tools/CUDA_Occupancy_Calculator.xls # FIXME: why?
# let's remove the 32-bit libraries, they confuse the lib64->lib mover
rm -rf $out/lib
# Remove some cruft.
rm $out/bin/uninstall*
# Fixup path to samples (needed for cuda 6.5 or else nsight will not find them)
if [ -d "$out"/cuda-samples ]; then
mv "$out"/cuda-samples "$out"/samples
@@ -73,25 +80,24 @@ let
mkdir -p $out/nix-support
echo "cmakeFlags+=' -DCUDA_TOOLKIT_ROOT_DIR=$out'" >> $out/nix-support/setup-hook
# Remove OpenCL libraries as they are provided by ocl-icd and driver.
rm -f $out/lib64/libOpenCL*
'' + lib.optionalString (lib.versionOlder version "8.0") ''
# Hack to fix building against recent Glibc/GCC.
echo "NIX_CFLAGS_COMPILE+=' -D_FORCE_INLINES'" >> $out/nix-support/setup-hook
'';
meta = {
license = lib.licenses.unfree;
meta = with stdenv.lib; {
description = "A compiler for NVIDIA GPUs, math libraries, and tools";
homepage = "https://developer.nvidia.com/cuda-toolkit";
platforms = platforms.linux;
license = licenses.unfree;
};
};
in {
cudatoolkit5 = common {
version = "5.5.22";
url = http://developer.download.nvidia.com/compute/cuda/5_5/rel/installers/cuda_5.5.22_linux_64.run;
sha256 = "b997e1dbe95704e0e806e0cedc5fd370a385351fef565c7bae0917baf3a29aa4";
python = python26;
};
cudatoolkit6 = common {
version = "6.0.37";
url = http://developer.download.nvidia.com/compute/cuda/6_0/rel/installers/cuda_6.0.37_linux_64.run;
@@ -117,9 +123,9 @@ in {
};
cudatoolkit8 = common {
version = "8.0.44";
url = https://developer.nvidia.com/compute/cuda/8.0/prod/local_installers/cuda_8.0.44_linux-run;
sha256 = "1w5xmjf40kkis42dqs8dva4xjq7wr5y6vi1m0xlhs6i6cyw4mp34";
version = "8.0.61";
url = https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda_8.0.61_375.26_linux-run;
sha256 = "1i4xrsqbad283qffvysn88w2pmxzxbbby41lw0j1113z771akv4w";
};
}

View File

@@ -19,7 +19,11 @@ stdenv.mkDerivation {
# Was not able to compile on darwin due to "__inline_isnanl"
# being undefined.
substituteInPlace src/dmd/root/port.c --replace __inline_isnanl __inline_isnan
'';
''
+ stdenv.lib.optionalString stdenv.isLinux ''
substituteInPlace src/dmd/root/port.c \
--replace "#include <bits/mathdef.h>" "#include <complex.h>"
'';
# Buid and install are based on http://wiki.dlang.org/Building_DMD
buildPhase = ''

View File

@@ -40,7 +40,7 @@ let
EOF
'' + lib.concatStrings cmds;
hsPkgs = haskell.packages.ghc801.override {
hsPkgs = haskell.packages.ghc802.override {
overrides = self: super:
let hlib = haskell.lib;
elmRelease = import ./packages/release.nix { inherit (self) callPackage; };
@@ -77,6 +77,21 @@ let
in elmPkgs // {
inherit elmPkgs;
elmVersion = elmRelease.version;
# needed for elm-package
http-client = hlib.overrideCabal super.http-client (drv: {
version = "0.4.31.2";
sha256 = "12yq2l6bvmxg5w6cw5ravdh39g8smwn1j44mv36pfmkhm5402h8n";
});
http-client-tls = hlib.overrideCabal super.http-client-tls (drv: {
version = "0.2.4.1";
sha256 = "18wbca7jg15p0ds3339f435nqv2ng0fqc4bylicjzlsww625ij4d";
});
# https://github.com/elm-lang/elm-compiler/issues/1566
indents = hlib.overrideCabal super.indents (drv: {
version = "0.3.3";
sha256 = "16lz21bp9j14xilnq8yym22p3saxvc9fsgfcf5awn2a6i6n527xn";
libraryHaskellDepends = drv.libraryHaskellDepends ++ [super.concatenative];
});
};
};
in hsPkgs.elmPkgs // {

View File

@@ -1,7 +1,7 @@
{ stdenv, fetchFromGitHub, cmake, python, ... }:
let
rev = "1.37.1";
rev = "1.37.3";
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
in
stdenv.mkDerivation rec {
@@ -10,14 +10,14 @@ stdenv.mkDerivation rec {
src = fetchFromGitHub {
owner = "kripken";
repo = "emscripten-fastcomp";
sha256 = "08jci6h73j4pcd6iq5r4zn8c6qpd6qxc7xivxh3iama9hghmxyk9";
sha256 = "0s5156g6576hm31628c2wbqwl9r6vn10z5ry59psl565zz3lpg8x";
inherit rev;
};
srcFL = fetchFromGitHub {
owner = "kripken";
repo = "emscripten-fastcomp-clang";
sha256 = "053svm8vnsma61jzzr8n1224brmjw4pzvklh572bm1p7yg32chaw";
sha256 = "0jhk20wb7275n5m9niqkzmvrr8hh5v26glkmsfmng4p66cs7jkil";
inherit rev;
};

View File

@@ -1,7 +1,7 @@
{ stdenv, fetchFromGitHub, emscriptenfastcomp, python, nodejs, closurecompiler, jre }:
let
rev = "1.37.1";
rev = "1.37.3";
appdir = "share/emscripten";
in
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
src = fetchFromGitHub {
owner = "kripken";
repo = "emscripten";
sha256 = "0xl8lv0ihxsnwnhma3i34pkbz0v1yyc93ac6mdqmzv6fx2wczm04";
sha256 = "0pkxm8nd2zv57f2xm0c3n4xsdh2scliyy3zx04xk2bpkvskyzl7x";
inherit rev;
};

View File

@@ -42,6 +42,6 @@ stdenv.mkDerivation rec {
homepage = "http://fsharp.org/";
license = stdenv.lib.licenses.asl20;
maintainers = with stdenv.lib.maintainers; [ thoughtpolice raskin ];
platforms = with stdenv.lib.platforms; linux;
platforms = with stdenv.lib.platforms; unix;
};
}

View File

@@ -544,7 +544,7 @@ stdenv.mkDerivation ({
}
# Strip kills static libs of other archs (hence cross != null)
// optionalAttrs (!stripped || cross != null) { dontStrip = true; NIX_STRIP_DEBUG = 0; }
// optionalAttrs (!stripped || cross != null) { dontStrip = true; }
// optionalAttrs (enableMultilib) { dontMoveLib64 = true; }
)

View File

@@ -551,7 +551,7 @@ stdenv.mkDerivation ({
}
# Strip kills static libs of other archs (hence cross != null)
// optionalAttrs (!stripped || cross != null) { dontStrip = true; NIX_STRIP_DEBUG = 0; }
// optionalAttrs (!stripped || cross != null) { dontStrip = true; }
// optionalAttrs (enableMultilib) { dontMoveLib64 = true; }

View File

@@ -74,7 +74,11 @@ let version = "5.4.0";
# The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
# target libraries and tools.
++ optional langAda ../gnat-cflags.patch
++ optional langFortran ../gfortran-driving.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;
javaEcj = fetchurl {
# The `$(top_srcdir)/ecj.jar' file is automatically picked up at
@@ -231,6 +235,13 @@ stdenv.mkDerivation ({
libc_dev = stdenv.cc.libc_dev;
# This should kill all the stdinc frameworks that gcc and friends like to
# insert into default search paths.
prePatch = if stdenv.isDarwin then ''
substituteInPlace gcc/config/darwin-c.c \
--replace 'if (stdinc)' 'if (0)'
'' else null;
postPatch =
if (stdenv.isGNU
|| (libcCross != null # e.g., building `gcc.crossDrv'
@@ -547,7 +558,7 @@ stdenv.mkDerivation ({
}
# Strip kills static libs of other archs (hence cross != null)
// optionalAttrs (!stripped || cross != null) { dontStrip = true; NIX_STRIP_DEBUG = 0; }
// optionalAttrs (!stripped || cross != null) { dontStrip = true; }
// optionalAttrs (enableMultilib) { dontMoveLib64 = true; }
)

View File

@@ -0,0 +1,46 @@
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

View File

@@ -545,7 +545,7 @@ stdenv.mkDerivation ({
}
# Strip kills static libs of other archs (hence cross != null)
// optionalAttrs (!stripped || cross != null) { dontStrip = true; NIX_STRIP_DEBUG = 0; }
// optionalAttrs (!stripped || cross != null) { dontStrip = true; }
// optionalAttrs (enableMultilib) { dontMoveLib64 = true; }
)

View File

@@ -1,52 +0,0 @@
# This is a derivation specific to OS X (Darwin)
{gmp, mpfr, libmpc, isl_0_14, cloog, zlib, fetchurl, stdenv
, Libsystem
}:
stdenv.mkDerivation rec {
name = "gfortran-${version}";
version = "5.1.0";
buildInputs = [ gmp mpfr libmpc isl_0_14 cloog zlib ];
src = fetchurl {
url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.bz2";
sha256 = "1bd5vj4px3s8nlakbgrh38ynxq4s654m6nxz7lrj03mvkkwgvnmp";
};
patches = ./gfortran-darwin.patch;
hardeningDisable = [ "format" ];
configureFlags = ''
--disable-bootstrap
--disable-cloog-version-check
--disable-isl-version-check
--disable-multilib
--enable-checking=release
--enable-languages=fortran
--with-cloog=${cloog}
--with-gmp=${gmp.dev}
--with-isl=${isl_0_14}
--with-mpc=${libmpc}
--with-mpfr=${mpfr.dev}
--with-native-system-header-dir=${Libsystem}/include
--with-system-zlib
'';
postConfigure = ''
export DYLD_LIBRARY_PATH=`pwd`/`uname -m`-apple-darwin`uname -r`/libgcc
'';
makeFlags = [ "CC=clang" ];
passthru.cc = stdenv.cc.cc;
meta = with stdenv.lib; {
description = "GNU Fortran compiler, part of the GNU Compiler Collection";
homepage = "https://gcc.gnu.org/fortran/";
license = licenses.gpl3Plus;
platforms = platforms.darwin;
};
}

View File

@@ -1,26 +0,0 @@
--- a/gcc/config/darwin-c.c 2015-01-09 22:18:42.000000000 +0200
+++ b/gcc/config/darwin-c.c 2015-06-27 04:17:58.000000000 +0300
@@ -490,8 +490,7 @@
static const char *framework_defaults [] =
{
- "/System/Library/Frameworks",
- "/Library/Frameworks",
+// stdenvDarwinPure
};
/* Register the GNU objective-C runtime include path if STDINC. */
/* Register the GNU objective-C runtime include path if STDINC. */
--- a/gcc/cppdefault.c 2015-01-05 14:33:28.000000000 +0200
+++ b/gcc/cppdefault.c 2015-06-27 04:16:15.000000000 +0300
@@ -35,6 +35,9 @@
# undef CROSS_INCLUDE_DIR
#endif
+// stdenvDarwinPure
+# undef LOCAL_INCLUDE_DIR
+
const struct default_include cpp_include_defaults[]
#ifdef INCLUDE_DEFAULTS
= INCLUDE_DEFAULTS;

View File

@@ -0,0 +1,552 @@
{ stdenv, fetchurl, noSysDirs
, langC ? true, langCC ? true, langFortran ? false
, langObjC ? stdenv.isDarwin
, langObjCpp ? stdenv.isDarwin
, langJava ? false
, langAda ? false
, langVhdl ? false
, langGo ? false
, profiledCompiler ? false
, staticCompiler ? false
, enableShared ? true
, texinfo ? null
, perl ? null # optional, for texi2pod (then pod2man); required for Java
, gmp, mpfr, libmpc, gettext, which
, libelf # optional, for link-time optimizations (LTO)
, isl ? null # optional, for the Graphite optimization framework.
, zlib ? null, boehmgc ? null
, zip ? null, unzip ? null, pkgconfig ? null
, gtk2 ? null, libart_lgpl ? null
, libX11 ? null, libXt ? null, libSM ? null, libICE ? null, libXtst ? null
, libXrender ? null, xproto ? null, renderproto ? null, xextproto ? null
, libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null
, x11Support ? langJava
, gnatboot ? null
, enableMultilib ? false
, enablePlugin ? true # whether to support user-supplied plug-ins
, name ? "gcc"
, cross ? null
, binutilsCross ? null
, libcCross ? null
, crossStageStatic ? true
, gnat ? null
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
, stripped ? true
, gnused ? null
, binutils ? null
, cloog # unused; just for compat with gcc4, as we override the parameter on some places
, darwin ? null
, flex ? null
}:
assert langJava -> zip != null && unzip != null
&& zlib != null && boehmgc != null
&& perl != null; # for `--enable-java-home'
assert langAda -> gnatboot != null;
assert langVhdl -> gnat != null;
# LTO needs libelf and zlib.
assert libelf != null -> zlib != null;
# Make sure we get GNU sed.
assert stdenv.isDarwin -> gnused != null;
# Need c++filt on darwin
assert stdenv.isDarwin -> binutils != null;
# The go frontend is written in c++
assert langGo -> langCC;
with stdenv.lib;
with builtins;
let version = "7-20161211";
# Whether building a cross-compiler for GNU/Hurd.
crossGNU = cross != null && cross.config == "i586-pc-gnu";
enableParallelBuilding = true;
patches =
[ ]
++ optional (cross != null) ../libstdc++-target.patch
++ optional noSysDirs ../no-sys-dirs.patch
# The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
# target libraries and tools.
++ optional langAda ../gnat-cflags.patch
++ optional langFortran ../gfortran-driving.patch;
javaEcj = fetchurl {
# The `$(top_srcdir)/ecj.jar' file is automatically picked up at
# `configure' time.
# XXX: Eventually we might want to take it from upstream.
url = "ftp://sourceware.org/pub/java/ecj-4.3.jar";
sha256 = "0jz7hvc0s6iydmhgh5h2m15yza7p2rlss2vkif30vm9y77m97qcx";
};
# Antlr (optional) allows the Java `gjdoc' tool to be built. We want a
# binary distribution here to allow the whole chain to be bootstrapped.
javaAntlr = fetchurl {
url = http://www.antlr.org/download/antlr-4.4-complete.jar;
sha256 = "02lda2imivsvsis8rnzmbrbp8rh1kb8vmq4i67pqhkwz7lf8y6dz";
};
xlibs = [
libX11 libXt libSM libICE libXtst libXrender libXrandr libXi
xproto renderproto xextproto inputproto randrproto
];
javaAwtGtk = langJava && x11Support;
/* Platform flags */
platformFlags = let
gccArch = stdenv.platform.gcc.arch or null;
gccCpu = stdenv.platform.gcc.cpu or null;
gccAbi = stdenv.platform.gcc.abi or null;
gccFpu = stdenv.platform.gcc.fpu or null;
gccFloat = stdenv.platform.gcc.float or null;
gccMode = stdenv.platform.gcc.mode or null;
withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
in
withArch +
withCpu +
withAbi +
withFpu +
withFloat +
withMode;
/* Cross-gcc settings */
crossMingw = cross != null && cross.libc == "msvcrt";
crossDarwin = cross != null && cross.libc == "libSystem";
crossConfigureFlags = let
gccArch = stdenv.cross.gcc.arch or null;
gccCpu = stdenv.cross.gcc.cpu or null;
gccAbi = stdenv.cross.gcc.abi or null;
gccFpu = stdenv.cross.gcc.fpu or null;
gccFloat = stdenv.cross.gcc.float or null;
gccMode = stdenv.cross.gcc.mode or null;
withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
in
"--target=${cross.config}" +
withArch +
withCpu +
withAbi +
withFpu +
withFloat +
withMode +
(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
else
(if crossDarwin then " --with-sysroot=${getLib libcCross}/share/sysroot"
else " --with-headers=${getDev libcCross}/include") +
# Ensure that -print-prog-name is able to find the correct programs.
(stdenv.lib.optionalString (crossMingw || crossDarwin) (
" --with-as=${binutilsCross}/bin/${cross.config}-as" +
" --with-ld=${binutilsCross}/bin/${cross.config}-ld"
)) +
" --enable-__cxa_atexit" +
" --enable-long-long" +
(if crossMingw then
" --enable-threads=win32" +
" --enable-sjlj-exceptions" +
" --enable-hash-synchronization" +
" --disable-libssp" +
" --disable-nls" +
" --with-dwarf2" +
# I think noone uses shared gcc libs in mingw, so we better do the same.
# In any case, mingw32 g++ linking is broken by default with shared libs,
# unless adding "-lsupc++" to any linking command. I don't know why.
" --disable-shared" +
# To keep ABI compatibility with upstream mingw-w64
" --enable-fully-dynamic-string"
else (if cross.libc == "uclibc" then
# 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" else "") +
" --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 cross != null then "-${cross.config}" + stageNameAddon else "";
bootstrap = cross == null;
in
# We need all these X libraries when building AWT with GTK+.
assert x11Support -> (filter (x: x == null) ([ gtk2 libart_lgpl ] ++ xlibs)) == [];
stdenv.mkDerivation ({
name = "${name}${if stripped then "" else "-debug"}-${version}" + crossNameAddon;
builder = ../builder.sh;
src = fetchurl {
url = "mirror://gcc/snapshots/${version}/gcc-${version}.tar.bz2";
sha256 = "114rrrm5d5cawmr3161d2wgjlzkb9l1imj1p7fnypwz7y85l1661";
};
inherit patches;
outputs = [ "out" "lib" "man" "info" ];
setOutputFlags = false;
NIX_NO_SELF_RPATH = true;
libc_dev = stdenv.cc.libc_dev;
hardeningDisable = [ "format" ];
postPatch =
if (stdenv.isGNU
|| (libcCross != null # e.g., building `gcc.crossDrv'
&& libcCross ? crossConfig
&& libcCross.crossConfig == "i586-pc-gnu")
|| (crossGNU && libcCross != null))
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 cross != null || 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' and \`UCLIBC_DYNAMIC_LINKER' macros..."
for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h
do
grep -q LIBC_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'
done
''
else null;
inherit noSysDirs staticCompiler langJava crossStageStatic
libcCross crossMingw;
nativeBuildInputs = [ texinfo which gettext ]
++ (optional (perl != null) perl)
++ (optional javaAwtGtk pkgconfig);
buildInputs = [ gmp mpfr libmpc libelf flex ]
++ (optional (isl != null) isl)
++ (optional (zlib != null) zlib)
++ (optionals langJava [ boehmgc zip unzip ])
++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
++ (optionals (cross != null) [binutilsCross])
++ (optionals langAda [gnatboot])
++ (optionals langVhdl [gnat])
# 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 stdenv.isDarwin gnused)
++ (optional stdenv.isDarwin binutils)
;
NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isSunOS "-lm -ldl";
preConfigure = stdenv.lib.optionalString (stdenv.isSunOS && stdenv.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;
configureFlags = "
${if stdenv.isSunOS then
" --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 "
else ""}
--enable-lto
${if enableMultilib then "--enable-multilib --disable-libquadmath" else "--disable-multilib"}
${if enableShared then "" else "--disable-shared"}
${if enablePlugin then "--enable-plugin" else "--disable-plugin"}
${optionalString (isl != null) "--with-isl=${isl}"}
${if langJava then
"--with-ecj-jar=${javaEcj} " +
# Follow Sun's layout for the convenience of IcedTea/OpenJDK. See
# <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>.
"--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre "
else ""}
${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""}
--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}
${if libelf != null then "--with-libelf=${libelf}" else ""}
--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 langJava "java"
++ optional langAda "ada"
++ optional langVhdl "vhdl"
++ optional langGo "go"
++ optional langObjC "objc"
++ optional langObjCpp "obj-c++"
++ optionals crossDarwin [ "objc" "obj-c++" ]
)
)
}
${if cross == null
then if stdenv.isDarwin
then " --with-native-system-header-dir=${darwin.usr-include}"
else " --with-native-system-header-dir=${getDev stdenv.cc.libc}/include"
else ""}
${if langAda then " --enable-libada" else ""}
${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
${if cross != null then crossConfigureFlags else ""}
${if !bootstrap then "--disable-bootstrap" else ""}
${if cross == null then platformFlags else ""}
";
targetConfig = if cross != null then cross.config else null;
buildFlags = if bootstrap then
(if profiledCompiler then "profiledbootstrap" else "bootstrap")
else "";
installTargets =
if stripped
then "install-strip"
else "install";
crossAttrs = let
xgccArch = stdenv.cross.gcc.arch or null;
xgccCpu = stdenv.cross.gcc.cpu or null;
xgccAbi = stdenv.cross.gcc.abi or null;
xgccFpu = stdenv.cross.gcc.fpu or null;
xgccFloat = stdenv.cross.gcc.float or null;
xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else "";
xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else "";
xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else "";
xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else "";
xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else "";
in {
AR = "${stdenv.cross.config}-ar";
LD = "${stdenv.cross.config}-ld";
CC = "${stdenv.cross.config}-gcc";
CXX = "${stdenv.cross.config}-gcc";
AR_FOR_TARGET = "${stdenv.cross.config}-ar";
LD_FOR_TARGET = "${stdenv.cross.config}-ld";
CC_FOR_TARGET = "${stdenv.cross.config}-gcc";
NM_FOR_TARGET = "${stdenv.cross.config}-nm";
CXX_FOR_TARGET = "${stdenv.cross.config}-g++";
# If we are making a cross compiler, cross != null
NIX_CC_CROSS = if cross == null then "${stdenv.ccCross}" else "";
dontStrip = true;
configureFlags = ''
${if enableMultilib then "" else "--disable-multilib"}
${if enableShared then "" else "--disable-shared"}
${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""}
${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
--with-gmp=${gmp.crossDrv}
--with-mpfr=${mpfr.crossDrv}
--with-mpc=${libmpc.crossDrv}
--disable-libstdcxx-pch
--without-included-gettext
--with-system-zlib
--enable-languages=${
concatStrings (intersperse ","
( optional langC "c"
++ optional langCC "c++"
++ optional langFortran "fortran"
++ optional langJava "java"
++ optional langAda "ada"
++ optional langVhdl "vhdl"
++ optional langGo "go"
)
)
}
${if langAda then " --enable-libada" else ""}
--target=${stdenv.cross.config}
${xwithArch}
${xwithCpu}
${xwithAbi}
${xwithFpu}
${xwithFloat}
'';
buildFlags = "";
};
# Needed for the cross compilation to work
AR = "ar";
LD = "ld";
# http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210
CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc";
# Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find
# the library headers and binaries, regarless of the language being
# compiled.
# Note: When building the Java AWT GTK+ peer, the build system doesn't
# honor `--with-gmp' et al., e.g., when building
# `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just
# add them to $CPATH and $LIBRARY_PATH in this case.
#
# Likewise, the LTO code doesn't find zlib.
CPATH = makeSearchPathOutput "dev" "include" ([]
++ optional (zlib != null) zlib
++ optional langJava boehmgc
++ optionals javaAwtGtk xlibs
++ optionals javaAwtGtk [ gmp mpfr ]
++ 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 = makeLibraryPath ([]
++ optional (zlib != null) zlib
++ optional langJava boehmgc
++ optionals javaAwtGtk xlibs
++ optionals javaAwtGtk [ gmp mpfr ]
++ optional (libpthread != null) libpthread);
EXTRA_TARGET_CFLAGS =
if cross != null && libcCross != null then [
"-idirafter ${getDev libcCross}/include"
]
++ optionals (! crossStageStatic) [
"-B${libcCross.out}/lib"
]
else null;
EXTRA_TARGET_LDFLAGS =
if cross != null && libcCross != null then [
"-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}"
]
else null;
passthru =
{ inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl 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, Java, and Ada, as well
as libraries for these languages (libstdc++, libgcj, 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; [ ];
# gnatboot is not available out of linux platforms, so we disable the darwin build
# for the gnat (ada compiler).
platforms =
stdenv.lib.platforms.linux ++
stdenv.lib.platforms.freebsd ++
optionals (langAda == false) stdenv.lib.platforms.darwin;
};
}
// optionalAttrs (cross != null && cross.libc == "msvcrt" && crossStageStatic) {
makeFlags = [ "all-gcc" "all-target-libgcc" ];
installTargets = "install-gcc install-target-libgcc";
}
# Strip kills static libs of other archs (hence cross != null)
// optionalAttrs (!stripped || cross != null) { dontStrip = true; NIX_STRIP_DEBUG = 0; }
// optionalAttrs (enableMultilib) { dontMoveLib64 = true; }
)

View File

@@ -1,20 +1,27 @@
{ stdenv, fetchurl, fetchpatch, bootPkgs, perl, gmp, ncurses, libiconv, binutils, coreutils
{ stdenv, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
, libxml2, libxslt, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, hscolour
# If enabled GHC will be build with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library.
, enableIntegerSimple ? false, gmp
}:
let
inherit (bootPkgs) ghc;
buildMK = ''
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib"
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include"
libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes="${ncurses.dev}/include"
libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-libraries="${ncurses.out}/lib"
${stdenv.lib.optionalString stdenv.isDarwin ''
libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-includes="${libiconv}/include"
libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-libraries="${libiconv}/lib"
''}
'';
'' + (if enableIntegerSimple then ''
INTEGER_LIBRARY=integer-simple
'' else ''
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib"
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include"
'');
in
@@ -46,8 +53,9 @@ stdenv.mkDerivation rec {
configureFlags = [
"--with-gcc=${stdenv.cc}/bin/cc"
"--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
"--datadir=$doc/share/doc/ghc"
] ++ stdenv.lib.optional (! enableIntegerSimple) [
"--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
];
# required, because otherwise all symbols from HSffi.o are stripped, and

View File

@@ -1,5 +1,9 @@
{ stdenv, fetchurl, fetchpatch, bootPkgs, perl, gmp, ncurses, libiconv, binutils, coreutils
{ stdenv, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
, libxml2, libxslt, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, hscolour
# If enabled GHC will be build with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library.
, enableIntegerSimple ? false, gmp
}:
let
@@ -38,13 +42,16 @@ stdenv.mkDerivation rec {
export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}"
'' + stdenv.lib.optionalString stdenv.isDarwin ''
export NIX_LDFLAGS+=" -no_dtrace_dof"
'' + stdenv.lib.optionalString enableIntegerSimple ''
echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk
'';
configureFlags = [
"--with-gcc=${stdenv.cc}/bin/cc"
"--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
"--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
"--datadir=$doc/share/doc/ghc"
] ++ stdenv.lib.optional (! enableIntegerSimple) [
"--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
] ++ stdenv.lib.optional stdenv.isDarwin [
"--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
];
@@ -75,5 +82,4 @@ stdenv.mkDerivation rec {
maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ];
inherit (ghc.meta) license platforms;
};
}

View File

@@ -1,4 +1,9 @@
{ stdenv, fetchurl, ghc, perl, gmp, ncurses, libiconv }:
{ stdenv, fetchurl, ghc, perl, ncurses, libiconv
# If enabled GHC will be build with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library.
, enableIntegerSimple ? false, gmp
}:
stdenv.mkDerivation rec {
version = "7.2.2";
@@ -11,18 +16,22 @@ stdenv.mkDerivation rec {
patches = [ ./fix-7.2.2-clang.patch ./relocation.patch ];
buildInputs = [ ghc perl gmp ncurses ];
buildInputs = [ ghc perl ncurses ]
++ stdenv.lib.optional (!enableIntegerSimple) gmp;
buildMK = ''
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib"
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include"
libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes="${ncurses.dev}/include"
libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-libraries="${ncurses.out}/lib"
${stdenv.lib.optionalString stdenv.isDarwin ''
libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-includes="${libiconv}/include"
libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-libraries="${libiconv}/lib"
''}
'';
'' + (if enableIntegerSimple then ''
INTEGER_LIBRARY=integer-simple
'' else ''
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib"
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include"
'');
preConfigure = ''
echo "${buildMK}" > mk/build.mk

View File

@@ -1,4 +1,9 @@
{ stdenv, fetchurl, ghc, perl, gmp, ncurses, libiconv }:
{ stdenv, fetchurl, ghc, perl, ncurses, libiconv
# If enabled GHC will be build with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library.
, enableIntegerSimple ? false, gmp
}:
stdenv.mkDerivation rec {
version = "7.4.2";
@@ -12,18 +17,22 @@ stdenv.mkDerivation rec {
patches = [ ./fix-7.4.2-clang.patch ./relocation.patch ];
buildInputs = [ ghc perl gmp ncurses ];
buildInputs = [ ghc perl ncurses ]
++ stdenv.lib.optional (!enableIntegerSimple) gmp;
buildMK = ''
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib"
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include"
libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes="${ncurses.dev}/include"
libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-libraries="${ncurses.out}/lib"
${stdenv.lib.optionalString stdenv.isDarwin ''
libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-includes="${libiconv}/include"
libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-libraries="${libiconv}/lib"
''}
'';
'' + (if enableIntegerSimple then ''
INTEGER_LIBRARY=integer-simple
'' else ''
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib"
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include"
'');
preConfigure = ''
echo "${buildMK}" > mk/build.mk

View File

@@ -1,4 +1,9 @@
{ stdenv, fetchurl, ghc, perl, gmp, ncurses, binutils, libiconv }:
{ stdenv, fetchurl, ghc, perl, ncurses, binutils, libiconv
# If enabled GHC will be build with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library.
, enableIntegerSimple ? false, gmp
}:
let
# The "-Wa,--noexecstack" options might be needed only with GNU ld (as opposed
@@ -19,11 +24,10 @@ in stdenv.mkDerivation rec {
patches = [ ./fix-7.6.3-clang.patch ./relocation.patch ];
buildInputs = [ ghc perl gmp ncurses ];
buildInputs = [ ghc perl ncurses ]
++ stdenv.lib.optional (!enableIntegerSimple) gmp;
buildMK = ''
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib"
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include"
libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes="${ncurses.dev}/include"
libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-libraries="${ncurses.out}/lib"
${stdenv.lib.optionalString stdenv.isDarwin ''
@@ -34,7 +38,12 @@ in stdenv.mkDerivation rec {
# Set ghcFlags for building ghc itself
SRC_HC_OPTS += ${ghcFlags}
SRC_CC_OPTS += ${cFlags}
'';
'' + (if enableIntegerSimple then ''
INTEGER_LIBRARY=integer-simple
'' else ''
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib"
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include"
'');
preConfigure = ''
echo "${buildMK}" > mk/build.mk

View File

@@ -1,4 +1,9 @@
{ stdenv, fetchurl, ghc, perl, gmp, ncurses, libiconv }:
{ stdenv, fetchurl, ghc, perl, ncurses, libiconv
# If enabled GHC will be build with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library.
, enableIntegerSimple ? false, gmp
}:
stdenv.mkDerivation rec {
version = "7.8.3";
@@ -11,13 +16,12 @@ stdenv.mkDerivation rec {
patches = [ ./relocation.patch ];
buildInputs = [ ghc perl gmp ncurses ];
buildInputs = [ ghc perl ncurses ]
++ stdenv.lib.optional (!enableIntegerSimple) gmp;
enableParallelBuilding = true;
buildMK = ''
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib"
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include"
libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes="${ncurses.dev}/include"
libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-libraries="${ncurses.out}/lib"
DYNAMIC_BY_DEFAULT = NO
@@ -25,7 +29,12 @@ stdenv.mkDerivation rec {
libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-includes="${libiconv}/include"
libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-libraries="${libiconv}/lib"
''}
'';
'' + (if enableIntegerSimple then ''
INTEGER_LIBRARY=integer-simple
'' else ''
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib"
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include"
'');
preConfigure = ''
echo "${buildMK}" > mk/build.mk

View File

@@ -1,4 +1,9 @@
{ stdenv, fetchurl, ghc, perl, gmp, ncurses, libiconv }:
{ stdenv, fetchurl, ghc, perl, ncurses, libiconv
# If enabled GHC will be build with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library.
, enableIntegerSimple ? false, gmp
}:
stdenv.mkDerivation (rec {
version = "7.8.4";
@@ -11,13 +16,12 @@ stdenv.mkDerivation (rec {
patches = [ ./relocation.patch ];
buildInputs = [ ghc perl gmp ncurses ];
buildInputs = [ ghc perl ncurses ]
++ stdenv.lib.optional (!enableIntegerSimple) gmp;
enableParallelBuilding = true;
buildMK = ''
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib"
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include"
libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes="${ncurses.dev}/include"
libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-libraries="${ncurses.out}/lib"
DYNAMIC_BY_DEFAULT = NO
@@ -25,7 +29,12 @@ stdenv.mkDerivation (rec {
libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-includes="${libiconv}/include"
libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-libraries="${libiconv}/lib"
''}
'';
'' + (if enableIntegerSimple then ''
INTEGER_LIBRARY=integer-simple
'' else ''
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib"
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include"
'');
preConfigure = ''
echo "${buildMK}" > mk/build.mk

View File

@@ -1,5 +1,9 @@
{ stdenv, fetchurl, fetchpatch, bootPkgs, perl, gmp, ncurses, libiconv, binutils, coreutils
{ stdenv, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
, hscolour, patchutils, sphinx
# If enabled GHC will be build with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library.
, enableIntegerSimple ? false, gmp
}:
let
@@ -41,13 +45,16 @@ stdenv.mkDerivation rec {
export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}"
'' + stdenv.lib.optionalString stdenv.isDarwin ''
export NIX_LDFLAGS+=" -no_dtrace_dof"
'' + stdenv.lib.optionalString enableIntegerSimple ''
echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk
'';
configureFlags = [
"--with-gcc=${stdenv.cc}/bin/cc"
"--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
"--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
"--datadir=$doc/share/doc/ghc"
] ++ stdenv.lib.optional (! enableIntegerSimple) [
"--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
] ++ stdenv.lib.optional stdenv.isDarwin [
"--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
];

View File

@@ -1,5 +1,10 @@
{ stdenv, fetchurl, fetchpatch, bootPkgs, perl, gmp, ncurses, libiconv, binutils, coreutils
{ stdenv, lib, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
, hscolour, patchutils, sphinx
# If enabled GHC will be build with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library.
, enableIntegerSimple ? false, gmp
, cross ? null
}:
let
@@ -28,16 +33,21 @@ stdenv.mkDerivation rec {
export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}"
'' + stdenv.lib.optionalString stdenv.isDarwin ''
export NIX_LDFLAGS+=" -no_dtrace_dof"
'' + stdenv.lib.optionalString enableIntegerSimple ''
echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk
'';
configureFlags = [
"--with-gcc=${stdenv.cc}/bin/cc"
"--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
"--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
"--datadir=$doc/share/doc/ghc"
] ++ stdenv.lib.optional (! enableIntegerSimple) [
"--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
] ++ stdenv.lib.optional stdenv.isDarwin [
"--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
];
] ++
# fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
# required, because otherwise all symbols from HSffi.o are stripped, and
# that in turn causes GHCi to abort

View File

@@ -1,6 +1,10 @@
{ stdenv, fetchgit, bootPkgs, perl, gmp, ncurses, libiconv, binutils, coreutils
{ stdenv, lib, fetchgit, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
, autoconf, automake, happy, alex, python3, buildPlatform, targetPlatform
, selfPkgs, cross ? null
# If enabled GHC will be build with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library.
, enableIntegerSimple ? false, gmp
}:
let
@@ -20,6 +24,8 @@ let
export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}"
'' + stdenv.lib.optionalString stdenv.isDarwin ''
export NIX_LDFLAGS+=" -no_dtrace_dof"
'' + stdenv.lib.optionalString enableIntegerSimple ''
echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk
'';
in stdenv.mkDerivation (rec {
inherit version rev;
@@ -41,8 +47,9 @@ in stdenv.mkDerivation (rec {
configureFlags = [
"CC=${stdenv.cc}/bin/cc"
"--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
"--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
] ++ stdenv.lib.optional (! enableIntegerSimple) [
"--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
] ++ stdenv.lib.optional stdenv.isDarwin [
"--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
];
@@ -98,7 +105,9 @@ in stdenv.mkDerivation (rec {
"RANLIB=${stdenv.binutilsCross}/bin/${cross.config}-ranlib"
"--target=${cross.config}"
"--enable-bootstrap-with-devel-snapshot"
];
] ++
# fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
buildInputs = commonBuildInputs ++ [ stdenv.ccCross stdenv.binutilsCross ];

View File

@@ -1,4 +1,6 @@
{ mkDerivation
, lib
, broken ? false
, test-framework
, test-framework-hunit
, test-framework-quickcheck2
@@ -39,6 +41,11 @@
, coreutils
, libiconv
, ghcjsNodePkgs ? callPackage ../../../top-level/node-packages.nix {
generated = ./node-packages-generated.nix;
self = ghcjsNodePkgs;
}
, version ? "0.2.0"
, ghcjsSrc ? fetchFromGitHub {
owner = "ghcjs";
@@ -88,6 +95,11 @@
]
, stage2 ? import ./stage2.nix
, patches ? [ ./ghcjs.patch ]
# used for resolving compiler plugins
, ghcLibdir ? null
}:
let
inherit (bootPkgs) ghc;
@@ -116,7 +128,7 @@ in mkDerivation (rec {
testDepends = [
HUnit test-framework test-framework-hunit
];
patches = [ ./ghcjs.patch ];
inherit patches;
postPatch = ''
substituteInPlace Setup.hs \
--replace "/usr/bin/env" "${coreutils}/bin/env"
@@ -159,13 +171,10 @@ in mkDerivation (rec {
--with-cabal ${cabal-install}/bin/cabal \
--with-gmp-includes ${gmp.dev}/include \
--with-gmp-libraries ${gmp.out}/lib
'' + lib.optionalString (ghcLibdir != null) ''
printf '%s' '${ghcLibdir}' > "$out/lib/ghcjs-${version}/ghc_libdir"
'';
passthru = let
ghcjsNodePkgs = callPackage ../../../top-level/node-packages.nix {
generated = ./node-packages-generated.nix;
self = ghcjsNodePkgs;
};
in {
passthru = {
inherit bootPkgs;
isCross = true;
isGhcjs = true;
@@ -183,5 +192,5 @@ in mkDerivation (rec {
license = stdenv.lib.licenses.bsd3;
platforms = ghc.meta.platforms;
maintainers = with stdenv.lib.maintainers; [ jwiegley cstrahan ];
broken = true; # http://hydra.nixos.org/build/45110274
inherit broken;
})

View File

@@ -1,3 +1,6 @@
{ bootPkgs }:
bootPkgs.callPackage ./base.nix { inherit bootPkgs; }
bootPkgs.callPackage ./base.nix {
inherit bootPkgs;
broken = true; # http://hydra.nixos.org/build/45110274
}

View File

@@ -1,22 +1,26 @@
{ fetchgit, fetchFromGitHub, bootPkgs }:
bootPkgs.callPackage ./base.nix {
version = "0.2.020161101";
version = "0.2.020170323";
# deprecated on HEAD, directly included in the distribution
ghcjs-prim = null;
inherit bootPkgs;
ghcjsSrc = fetchFromGitHub {
owner = "ghcjs";
# TODO: switch back to the regular ghcjs repo
# when https://github.com/ghcjs/ghcjs/pull/573 is merged.
owner = "basvandijk";
repo = "ghcjs";
rev = "2dc14802e78d7d9dfa35395d5dbfc9c708fb83e6";
sha256 = "0cvmapbrwg0h1pbz648isc2l84z694ylnfm8ncd1g4as28lmj0pz";
rev = "e6cdc71964a1c2e4184416a493e9d384c408914c";
sha256 = "00fk9qwyx4vpvr0h9jbqxwlrvl6w63l5sq8r357prsp6xyv5zniz";
};
ghcjsBootSrc = fetchgit {
url = git://github.com/ghcjs/ghcjs-boot.git;
rev = "b000a4f4619b850bf3f9a45c9058f7a51e7709c8";
sha256 = "164v0xf33r6mnympp6s70v8j6g7ccyg7z95gjp43bq150ppvisbq";
# TODO: switch back to git://github.com/ghcjs/ghcjs-boot.git
# when https://github.com/ghcjs/ghcjs-boot/pull/41 is merged.
url = git://github.com/basvandijk/ghcjs-boot.git;
rev = "19a3b157ecb807c2224daffda5baecc92b76af35";
sha256 = "16sgr8vfr1nx5ljnk8gckgjk70zpa67ix4dbr9aizkwyz41ilfrb";
fetchSubmodules = true;
};

View File

@@ -2,107 +2,117 @@
{
async = callPackage
({ mkDerivation, base, HUnit, stdenv, stm, test-framework
, test-framework-hunit
}:
mkDerivation {
pname = "async";
version = "2.1.0";
src = "${ghcjsBoot}/boot/async";
doCheck = false;
libraryHaskellDepends = [ base stm ];
testHaskellDepends = [
base HUnit test-framework test-framework-hunit
];
jailbreak = true;
homepage = "https://github.com/simonmar/async";
description = "Run IO operations asynchronously and wait for their results";
license = stdenv.lib.licenses.bsd3;
}) {};
({ mkDerivation, base, HUnit, stm, test-framework
, test-framework-hunit, stdenv
}:
mkDerivation {
pname = "async";
version = "2.1.1";
src = "${ghcjsBoot}/boot/async";
doCheck = false;
libraryHaskellDepends = [ base stm ];
testHaskellDepends = [
base HUnit test-framework test-framework-hunit
];
jailbreak = true;
homepage = "https://github.com/simonmar/async";
description = "Run IO operations asynchronously and wait for their results";
license = stdenv.lib.licenses.bsd3;
}) {};
aeson = callPackage
({ mkDerivation, attoparsec, base, bytestring, containers, deepseq
, dlist, fail, ghc-prim, hashable, HUnit, mtl, QuickCheck, scientific
, stdenv, syb, tagged, template-haskell, test-framework
, test-framework-hunit, test-framework-quickcheck2, text, time
, transformers, unordered-containers, vector
}:
mkDerivation {
pname = "aeson";
version = "0.11.2.0";
src = "${ghcjsBoot}/boot/aeson";
doCheck = false;
libraryHaskellDepends = [
attoparsec base bytestring containers deepseq dlist fail ghc-prim
hashable mtl scientific syb tagged template-haskell text time transformers
unordered-containers vector
];
testHaskellDepends = [
attoparsec base bytestring containers ghc-prim HUnit QuickCheck
template-haskell test-framework test-framework-hunit
test-framework-quickcheck2 text time unordered-containers vector
];
jailbreak = true;
homepage = "https://github.com/bos/aeson";
description = "Fast JSON parsing and encoding";
license = stdenv.lib.licenses.bsd3;
}) {};
({ mkDerivation, attoparsec, base, base-compat, base-orphans
, base16-bytestring, bytestring, containers, deepseq, directory
, dlist, fetchgit, filepath, generic-deriving, ghc-prim, hashable
, hashable-time, HUnit, integer-logarithms, QuickCheck
, quickcheck-instances, scientific, stdenv, tagged
, template-haskell, test-framework, test-framework-hunit
, test-framework-quickcheck2, text, time, time-locale-compat
, unordered-containers, uuid-types, vector
}:
mkDerivation {
pname = "aeson";
version = "1.1.1.0";
src = "${ghcjsBoot}/boot/aeson";
libraryHaskellDepends = [
attoparsec base base-compat bytestring containers deepseq dlist
ghc-prim hashable scientific tagged template-haskell text time
time-locale-compat unordered-containers uuid-types vector
];
testHaskellDepends = [
attoparsec base base-compat base-orphans base16-bytestring
bytestring containers directory dlist filepath generic-deriving
ghc-prim hashable hashable-time HUnit integer-logarithms QuickCheck
quickcheck-instances scientific tagged template-haskell
test-framework test-framework-hunit test-framework-quickcheck2 text
time time-locale-compat unordered-containers uuid-types vector
];
jailbreak = true;
homepage = "https://github.com/bos/aeson";
description = "Fast JSON parsing and encoding";
license = stdenv.lib.licenses.bsd3;
}) {};
attoparsec = callPackage
({ mkDerivation, array, base, bytestring, containers, deepseq
, QuickCheck, quickcheck-unicode, scientific, stdenv
, test-framework, test-framework-quickcheck2, text, transformers
, vector
}:
mkDerivation {
pname = "attoparsec";
version = "0.13.0.2";
src = "${ghcjsBoot}/boot/attoparsec";
doCheck = false;
libraryHaskellDepends = [
array base bytestring containers deepseq scientific text
transformers
];
testHaskellDepends = [
array base bytestring containers deepseq QuickCheck
quickcheck-unicode scientific test-framework
test-framework-quickcheck2 text transformers vector
];
jailbreak = true;
homepage = "https://github.com/bos/attoparsec";
description = "Fast combinator parsing for bytestrings and text";
license = stdenv.lib.licenses.bsd3;
}) {};
({ mkDerivation, array, base, bytestring, case-insensitive
, containers, criterion, deepseq, directory, filepath, ghc-prim
, http-types, parsec, QuickCheck, quickcheck-unicode, scientific
, tasty, tasty-quickcheck, text, transformers, unordered-containers
, vector, stdenv
}:
mkDerivation {
pname = "attoparsec";
version = "0.13.1.0";
src = "${ghcjsBoot}/boot/attoparsec";
libraryHaskellDepends = [
array base bytestring containers deepseq scientific text
transformers
];
testHaskellDepends = [
array base bytestring deepseq QuickCheck quickcheck-unicode
scientific tasty tasty-quickcheck text transformers vector
];
benchmarkHaskellDepends = [
array base bytestring case-insensitive containers criterion deepseq
directory filepath ghc-prim http-types parsec scientific text
transformers unordered-containers vector
];
jailbreak = true;
homepage = "https://github.com/bos/attoparsec";
description = "Fast combinator parsing for bytestrings and text";
license = stdenv.lib.licenses.bsd3;
}) {};
case-insensitive = callPackage
({ mkDerivation, base, bytestring, deepseq, hashable, HUnit, stdenv
, test-framework, test-framework-hunit, text
}:
mkDerivation {
pname = "case-insensitive";
version = "1.2.0.6";
src = "${ghcjsBoot}/boot/case-insensitive";
doCheck = false;
libraryHaskellDepends = [ base bytestring deepseq hashable text ];
testHaskellDepends = [
base bytestring HUnit test-framework test-framework-hunit text
];
jailbreak = true;
homepage = "https://github.com/basvandijk/case-insensitive";
description = "Case insensitive string comparison";
license = stdenv.lib.licenses.bsd3;
}) {};
({ mkDerivation, base, bytestring, criterion, deepseq, hashable
, HUnit, test-framework, test-framework-hunit, text, stdenv
}:
mkDerivation {
pname = "case-insensitive";
version = "1.2.0.8";
src = "${ghcjsBoot}/boot/case-insensitive";
doCheck = false;
libraryHaskellDepends = [ base bytestring deepseq hashable text ];
testHaskellDepends = [
base bytestring HUnit test-framework test-framework-hunit text
];
benchmarkHaskellDepends = [ base bytestring criterion deepseq ];
jailbreak = true;
homepage = "https://github.com/basvandijk/case-insensitive";
description = "Case insensitive string comparison";
license = stdenv.lib.licenses.bsd3;
}) {};
dlist = callPackage
({ mkDerivation, base, Cabal, deepseq, QuickCheck, stdenv }:
mkDerivation {
pname = "dlist";
version = "0.7.1.2";
src = "${ghcjsBoot}/boot/dlist";
doCheck = false;
libraryHaskellDepends = [ base deepseq ];
testHaskellDepends = [ base Cabal QuickCheck ];
jailbreak = true;
homepage = "https://github.com/spl/dlist";
description = "Difference lists";
license = stdenv.lib.licenses.bsd3;
}) {};
mkDerivation {
pname = "dlist";
version = "0.8.0.2";
src = "${ghcjsBoot}/boot/dlist";
doCheck = false;
libraryHaskellDepends = [ base deepseq ];
testHaskellDepends = [ base Cabal QuickCheck ];
jailbreak = true;
homepage = "https://github.com/spl/dlist";
description = "Difference lists";
license = stdenv.lib.licenses.bsd3;
}) {};
extensible-exceptions = callPackage
({ mkDerivation, base, stdenv }:
mkDerivation {
@@ -175,29 +185,29 @@
license = stdenv.lib.licenses.bsd3;
}) {};
scientific = callPackage
({ mkDerivation, base, binary, bytestring, containers, deepseq, ghc-prim
, hashable, integer-gmp, QuickCheck, smallcheck, stdenv, tasty
, tasty-ant-xml, tasty-hunit, tasty-quickcheck, tasty-smallcheck
, text, vector
}:
mkDerivation {
pname = "scientific";
version = "0.3.4.7";
src = "${ghcjsBoot}/boot/scientific";
doCheck = false;
libraryHaskellDepends = [
base binary bytestring containers deepseq ghc-prim hashable
integer-gmp text vector
];
testHaskellDepends = [
base bytestring QuickCheck smallcheck tasty tasty-ant-xml
tasty-hunit tasty-quickcheck tasty-smallcheck text
];
jailbreak = true;
homepage = "https://github.com/basvandijk/scientific";
description = "Numbers represented using scientific notation";
license = stdenv.lib.licenses.bsd3;
}) {};
({ mkDerivation, base, binary, bytestring, containers, criterion
, deepseq, ghc-prim, hashable, integer-gmp, integer-logarithms
, QuickCheck, smallcheck, tasty, tasty-ant-xml, tasty-hunit
, tasty-quickcheck, tasty-smallcheck, text, vector, stdenv
}:
mkDerivation {
pname = "scientific";
version = "0.3.4.10";
src = "${ghcjsBoot}/boot/scientific";
libraryHaskellDepends = [
base binary bytestring containers deepseq ghc-prim hashable
integer-gmp integer-logarithms text vector
];
testHaskellDepends = [
base binary bytestring QuickCheck smallcheck tasty tasty-ant-xml
tasty-hunit tasty-quickcheck tasty-smallcheck text
];
benchmarkHaskellDepends = [ base criterion ];
jailbreak = true;
homepage = "https://github.com/basvandijk/scientific";
description = "Numbers represented using scientific notation";
license = stdenv.lib.licenses.bsd3;
}) {};
stm = callPackage
({ mkDerivation, array, base, stdenv }:
mkDerivation {
@@ -224,6 +234,23 @@
description = "Scrap Your Boilerplate";
license = stdenv.lib.licenses.bsd3;
}) {};
tagged = callPackage
({ mkDerivation, base, deepseq, template-haskell, transformers
, transformers-compat, stdenv
}:
mkDerivation {
pname = "tagged";
version = "0.8.5";
src = "${ghcjsBoot}/boot/tagged";
doCheck = false;
libraryHaskellDepends = [
base deepseq template-haskell transformers transformers-compat
];
jailbreak = true;
homepage = "http://github.com/ekmett/tagged";
description = "Haskell 98 phantom types to avoid unsafely passing dummy arguments";
license = stdenv.lib.licenses.bsd3;
}) {};
text = callPackage
({ mkDerivation, array, base, binary, bytestring, deepseq, directory
, ghc-prim, HUnit, integer-gmp, QuickCheck, quickcheck-unicode
@@ -249,25 +276,52 @@
license = stdenv.lib.licenses.bsd3;
}) {};
unordered-containers = callPackage
({ mkDerivation, base, ChasingBottoms, containers, deepseq, hashable
, HUnit, QuickCheck, stdenv, test-framework, test-framework-hunit
, test-framework-quickcheck2
}:
mkDerivation {
pname = "unordered-containers";
version = "0.2.7.0";
src = "${ghcjsBoot}/boot/unordered-containers";
doCheck = false;
libraryHaskellDepends = [ base deepseq hashable ];
testHaskellDepends = [
base ChasingBottoms containers hashable HUnit QuickCheck
test-framework test-framework-hunit test-framework-quickcheck2
];
jailbreak = true;
homepage = "https://github.com/tibbe/unordered-containers";
description = "Efficient hashing-based container types";
license = stdenv.lib.licenses.bsd3;
}) {};
({ mkDerivation, base, bytestring, ChasingBottoms, containers
, criterion, deepseq, deepseq-generics, hashable, hashmap, HUnit
, mtl, QuickCheck, random, test-framework, test-framework-hunit
, test-framework-quickcheck2, stdenv
}:
mkDerivation {
pname = "unordered-containers";
version = "0.2.7.2";
src = "${ghcjsBoot}/boot/unordered-containers";
libraryHaskellDepends = [ base deepseq hashable ];
testHaskellDepends = [
base ChasingBottoms containers hashable HUnit QuickCheck
test-framework test-framework-hunit test-framework-quickcheck2
];
benchmarkHaskellDepends = [
base bytestring containers criterion deepseq deepseq-generics
hashable hashmap mtl random
];
jailbreak = true;
homepage = "https://github.com/tibbe/unordered-containers";
description = "Efficient hashing-based container types";
license = stdenv.lib.licenses.bsd3;
}) {};
uuid-types = callPackage
({ mkDerivation, base, binary, bytestring, containers, criterion
, deepseq, hashable, HUnit, QuickCheck, random, stdenv, tasty
, tasty-hunit, tasty-quickcheck, text
}:
mkDerivation {
pname = "uuid-types";
version = "1.0.3";
src = "${ghcjsBoot}/boot/uuid/uuid-types";
libraryHaskellDepends = [
base binary bytestring deepseq hashable random text
];
testHaskellDepends = [
base bytestring HUnit QuickCheck tasty tasty-hunit tasty-quickcheck
];
benchmarkHaskellDepends = [
base bytestring containers criterion deepseq random
];
jailbreak = true;
homepage = "https://github.com/aslatter/uuid";
description = "Type definitions for Universally Unique Identifiers";
license = stdenv.lib.licenses.bsd3;
}) {};
vector = callPackage
({ mkDerivation, base, deepseq, ghc-prim, primitive, QuickCheck
, random, stdenv, template-haskell, test-framework

View File

@@ -2,6 +2,6 @@
fetchFromGitHub {
owner = "ghcjs";
repo = "shims";
rev = "dc034a035aa73db2c5be34145732090bd74c1b57";
sha256 = "18r8kf7g7d2n0rhwcgiz9gsgdmgln1nmwwyj347bpn4zh17qlkqa";
rev = "b97015229c58eeab7c1d0bb575794b14a9f6efca";
sha256 = "1p5adkqvmb1gsv9hnn3if0rdpnaq3v9a1zkfdy282yw05jaaaggz";
}

View File

@@ -327,6 +327,7 @@
version = "1.22.8.0";
src = "${ghcjsBoot}/boot/cabal/Cabal";
doCheck = false;
hyperlinkSource = false;
libraryHaskellDepends = [
array base binary bytestring containers deepseq directory filepath
pretty process time unix

View File

@@ -1,4 +1,4 @@
{ stdenv, lib, fetchurl, tzdata, iana_etc, libcCross
{ stdenv, lib, fetchurl, fetchpatch, tzdata, iana-etc, libcCross
, pkgconfig
, pcre
, Security }:
@@ -56,7 +56,7 @@ stdenv.mkDerivation rec {
# ParseInLocation fails the test
sed -i '/TestParseInSydney/areturn' src/time/format_test.go
sed -i 's,/etc/protocols,${iana_etc}/etc/protocols,' src/net/lookup_unix.go
sed -i 's,/etc/protocols,${iana-etc}/etc/protocols,' src/net/lookup_unix.go
'' + lib.optionalString stdenv.isLinux ''
sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/time/zoneinfo_unix.go
@@ -114,6 +114,13 @@ stdenv.mkDerivation rec {
patches = [
./remove-tools-1.4.patch
./creds-test-1.4.patch
# This test checks for the wrong thing with recent tzdata. It's been fixed in master but the patch
# actually works on old versions too.
(fetchpatch {
url = "https://github.com/golang/go/commit/91563ced5897faf729a34be7081568efcfedda31.patch";
sha256 = "1ny5l3f8a9dpjjrnjnsplb66308a0x13sa0wwr4j6yrkc8j4qxqi";
})
];
GOOS = if stdenv.isDarwin then "darwin" else "linux";

View File

@@ -1,4 +1,4 @@
{ stdenv, lib, fetchurl, tzdata, iana_etc, go_bootstrap, runCommand
{ stdenv, lib, fetchurl, tzdata, iana-etc, go_bootstrap, runCommand
, perl, which, pkgconfig, patch, fetchpatch
, pcre
, Security, Foundation, bash }:
@@ -75,8 +75,8 @@ stdenv.mkDerivation rec {
# Remove the timezone naming test
sed -i '/TestLoadFixed/areturn' src/time/time_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
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
'' + lib.optionalString stdenv.isLinux ''
sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/time/zoneinfo_unix.go
'' + lib.optionalString stdenv.isDarwin ''
@@ -113,6 +113,13 @@ stdenv.mkDerivation rec {
patches = [
./remove-tools-1.5.patch
./creds-test.patch
# This test checks for the wrong thing with recent tzdata. It's been fixed in master but the patch
# actually works on old versions too.
(fetchpatch {
url = "https://github.com/golang/go/commit/91563ced5897faf729a34be7081568efcfedda31.patch";
sha256 = "1ny5l3f8a9dpjjrnjnsplb66308a0x13sa0wwr4j6yrkc8j4qxqi";
})
];
GOOS = if stdenv.isDarwin then "darwin" else "linux";

View File

@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, tzdata, iana_etc, go_bootstrap, runCommand, writeScriptBin
{ stdenv, fetchFromGitHub, tzdata, iana-etc, go_bootstrap, runCommand, writeScriptBin
, perl, which, pkgconfig, patch, fetchpatch
, pcre, cacert
, Security, Foundation, bash }:
@@ -69,8 +69,8 @@ stdenv.mkDerivation rec {
# Remove the timezone naming test
sed -i '/TestLoadFixed/areturn' src/time/time_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
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
# Disable cgo lookup tests not works, they depend on resolver
rm src/net/cgo_unix_test.go
@@ -105,11 +105,18 @@ stdenv.mkDerivation rec {
patches =
[ ./remove-tools-1.7.patch
./cacert-1.7.patch
./ssl-cert-file-1.7.patch
./creds-test.patch
# This test checks for the wrong thing with recent tzdata. It's been fixed in master but the patch
# actually works on old versions too.
(fetchpatch {
url = "https://github.com/golang/go/commit/91563ced5897faf729a34be7081568efcfedda31.patch";
sha256 = "1ny5l3f8a9dpjjrnjnsplb66308a0x13sa0wwr4j6yrkc8j4qxqi";
})
];
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
NIX_SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
GOOS = if stdenv.isDarwin then "darwin" else "linux";
GOARCH = if stdenv.isDarwin then "amd64"

View File

@@ -0,0 +1,172 @@
{ stdenv, fetchFromGitHub, tzdata, iana-etc, go_bootstrap, runCommand, writeScriptBin
, perl, which, pkgconfig, patch, fetchpatch
, pcre, cacert
, Security, Foundation, bash }:
let
inherit (stdenv.lib) optional optionals optionalString;
clangHack = writeScriptBin "clang" ''
#!${stdenv.shell}
exec ${stdenv.cc}/bin/clang "$@" 2> >(sed '/ld: warning:.*ignoring unexpected dylib file/ d' 1>&2)
'';
goBootstrap = runCommand "go-bootstrap" {} ''
mkdir $out
cp -rf ${go_bootstrap}/* $out/
chmod -R u+w $out
find $out -name "*.c" -delete
cp -rf $out/bin/* $out/share/go/bin/
'';
in
stdenv.mkDerivation rec {
name = "go-${version}";
version = "1.8";
src = fetchFromGitHub {
owner = "golang";
repo = "go";
rev = "go${version}";
sha256 = "0plm11rqrqz7frwz0jjcm13x939yhny755ks1adxjzmsngln9prl";
};
# perl is used for testing go vet
nativeBuildInputs = [ perl which pkgconfig patch ];
buildInputs = [ pcre ]
++ optionals stdenv.isLinux [ stdenv.glibc.out stdenv.glibc.static ];
propagatedBuildInputs = optionals stdenv.isDarwin [ Security Foundation ];
hardeningDisable = [ "all" ];
prePatch = ''
patchShebangs ./ # replace /bin/bash
# This source produces shell script at run time,
# and thus it is not corrected by patchShebangs.
substituteInPlace misc/cgo/testcarchive/carchive_test.go \
--replace '#!/usr/bin/env bash' '#!${stdenv.shell}'
# Disabling the 'os/http/net' tests (they want files not available in
# chroot builds)
rm src/net/{listen,parse}_test.go
rm src/syscall/exec_linux_test.go
# !!! substituteInPlace does not seems to be effective.
# The os test wants to read files in an existing path. Just don't let it be /usr/bin.
sed -i 's,/usr/bin,'"`pwd`", src/os/os_test.go
sed -i 's,/bin/pwd,'"`type -P pwd`", src/os/os_test.go
# Disable the unix socket test
sed -i '/TestShutdownUnix/areturn' src/net/net_test.go
# Disable the hostname test
sed -i '/TestHostname/areturn' src/os/os_test.go
# ParseInLocation fails the test
sed -i '/TestParseInSydney/areturn' src/time/format_test.go
# Remove the api check as it never worked
sed -i '/src\/cmd\/api\/run.go/ireturn nil' src/cmd/dist/test.go
# Remove the coverage test as we have removed this utility
sed -i '/TestCoverageWithCgo/areturn' src/cmd/go/go_test.go
# Remove the timezone naming test
sed -i '/TestLoadFixed/areturn' src/time/time_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
# Disable cgo lookup tests not works, they depend on resolver
rm src/net/cgo_unix_test.go
'' + optionalString stdenv.isLinux ''
sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/time/zoneinfo_unix.go
'' + optionalString stdenv.isDarwin ''
substituteInPlace src/race.bash --replace \
"sysctl machdep.cpu.extfeatures | grep -qv EM64T" true
sed -i 's,strings.Contains(.*sysctl.*,true {,' src/cmd/dist/util.go
sed -i 's,"/etc","'"$TMPDIR"'",' src/os/os_test.go
sed -i 's,/_go_os_test,'"$TMPDIR"'/_go_os_test,' src/os/path_test.go
sed -i '/TestChdirAndGetwd/areturn' src/os/os_test.go
sed -i '/TestRead0/areturn' src/os/os_test.go
sed -i '/TestNohup/areturn' src/os/signal/signal_test.go
sed -i '/TestCurrent/areturn' src/os/user/user_test.go
sed -i '/TestSystemRoots/areturn' src/crypto/x509/root_darwin_test.go
sed -i '/TestGoInstallRebuildsStalePackagesInOtherGOPATH/areturn' src/cmd/go/go_test.go
sed -i '/TestBuildDashIInstallsDependencies/areturn' src/cmd/go/go_test.go
sed -i '/TestDisasmExtld/areturn' src/cmd/objdump/objdump_test.go
sed -i 's/unrecognized/unknown/' src/cmd/link/internal/ld/lib.go
sed -i 's/unrecognized/unknown/' src/cmd/go/build.go
touch $TMPDIR/group $TMPDIR/hosts $TMPDIR/passwd
sed -i '1 a\exit 0' misc/cgo/errors/test.bash
'';
patches =
[ ./remove-tools-1.8.patch
./ssl-cert-file-1.8.patch
./creds-test.patch
./remove-test-pie-1.8.patch
# This test checks for the wrong thing with recent tzdata. It's been fixed in master but the patch
# works fine here for now.
(fetchpatch {
url = "https://github.com/golang/go/commit/91563ced5897faf729a34be7081568efcfedda31.patch";
sha256 = "1ny5l3f8a9dpjjrnjnsplb66308a0x13sa0wwr4j6yrkc8j4qxqi";
})
];
NIX_SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
GOOS = if stdenv.isDarwin then "darwin" else "linux";
GOARCH = if stdenv.isDarwin then "amd64"
else if stdenv.system == "i686-linux" then "386"
else if stdenv.system == "x86_64-linux" then "amd64"
else if stdenv.isArm then "arm"
else throw "Unsupported system";
GOARM = optionalString (stdenv.system == "armv5tel-linux") "5";
GO386 = 387; # from Arch: don't assume sse2 on i686
CGO_ENABLED = 1;
GOROOT_BOOTSTRAP = "${goBootstrap}/share/go";
# The go build actually checks for CC=*/clang and does something different, so we don't
# just want the generic `cc` here.
CC = if stdenv.isDarwin then "clang" else "cc";
configurePhase = ''
mkdir -p $out/share/go/bin
export GOROOT=$out/share/go
export GOBIN=$GOROOT/bin
export PATH=$GOBIN:$PATH
'';
postConfigure = optionalString stdenv.isDarwin ''
export PATH=${clangHack}/bin:$PATH
'';
installPhase = ''
cp -r . $GOROOT
( cd $GOROOT/src && ./all.bash )
'';
preFixup = ''
rm -r $out/share/go/pkg/bootstrap
ln -s $out/share/go/bin $out/bin
'';
setupHook = ./setup-hook.sh;
disallowedReferences = [ go_bootstrap ];
meta = with stdenv.lib; {
branch = "1.8";
homepage = http://golang.org/;
description = "The Go Programming language";
license = licenses.bsd3;
maintainers = with maintainers; [ cstrahan wkennington ];
platforms = platforms.linux ++ platforms.darwin;
};
}

View File

@@ -0,0 +1,23 @@
diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go
index c51dcea..8fbec5e 100644
--- a/src/cmd/dist/test.go
+++ b/src/cmd/dist/test.go
@@ -461,17 +461,5 @@ func (t *tester) registerTests() {
})
}
- // Test internal linking of PIE binaries where it is supported.
- if t.goos == "linux" && t.goarch == "amd64" {
- t.tests = append(t.tests, distTest{
- name: "pie_internal",
- heading: "internal linking of -buildmode=pie",
- fn: func(dt *distTest) error {
- t.addCmd(dt, "src", "go", "test", "reflect", "-short", "-buildmode=pie", "-ldflags=-linkmode=internal", t.timeout(60), t.tags(), t.runFlag(""))
- return nil
- },
- })
- }
-
// sync tests
t.tests = append(t.tests, distTest{
name: "sync_cpu",

View File

@@ -0,0 +1,35 @@
diff --git a/src/go/build/build.go b/src/go/build/build.go
index 9706b8b..f250751 100644
--- a/src/go/build/build.go
+++ b/src/go/build/build.go
@@ -1513,7 +1513,7 @@ func init() {
}
// ToolDir is the directory containing build tools.
-var ToolDir = filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
+var ToolDir = runtime.GOTOOLDIR()
// IsLocalImport reports whether the import path is
// a local import path, like ".", "..", "./foo", or "../foo".
diff --git a/src/runtime/extern.go b/src/runtime/extern.go
index 441dcd9..a50277e 100644
--- a/src/runtime/extern.go
+++ b/src/runtime/extern.go
@@ -230,6 +230,17 @@ func GOROOT() string {
return sys.DefaultGoroot
}
+// GOTOOLDIR returns the root of the Go tree.
+// It uses the GOTOOLDIR environment variable, if set,
+// or else the root used during the Go build.
+func GOTOOLDIR() string {
+ s := gogetenv("GOTOOLDIR")
+ if s != "" {
+ return s
+ }
+ return GOROOT() + "/pkg/tool/" + GOOS + "_" + GOARCH
+}
+
// Version returns the Go tree's version string.
// It is either the commit hash and date at the time of the build or,
// when possible, a release tag like "go1.3".

View File

@@ -13,7 +13,7 @@ index a4b33c7..9700b75 100644
func loadSystemRoots() (*CertPool, error) {
roots := NewCertPool()
+ if file := os.Getenv("SSL_CERT_FILE"); file != "" {
+ if file := os.Getenv("NIX_SSL_CERT_FILE"); file != "" {
+ data, err := ioutil.ReadFile(file)
+ if err == nil {
+ roots.AppendCertsFromPEM(data)
@@ -36,7 +36,7 @@ index 59b303d..d4a34ac 100644
+ roots = NewCertPool()
+ )
+
+ if file := os.Getenv("SSL_CERT_FILE"); file != "" {
+ if file := os.Getenv("NIX_SSL_CERT_FILE"); file != "" {
+ data, err := ioutil.ReadFile(file)
+ if err == nil {
+ roots.AppendCertsFromPEM(data)
@@ -65,7 +65,7 @@ index 7bcb3d6..3986e1a 100644
func loadSystemRoots() (*CertPool, error) {
roots := NewCertPool()
+ if file := os.Getenv("SSL_CERT_FILE"); file != "" {
+ if file := os.Getenv("NIX_SSL_CERT_FILE"); file != "" {
+ data, err := ioutil.ReadFile(file)
+ if err == nil {
+ roots.AppendCertsFromPEM(data)

View File

@@ -0,0 +1,80 @@
diff --git a/src/crypto/x509/root_cgo_darwin.go b/src/crypto/x509/root_cgo_darwin.go
index a4b33c7..9700b75 100644
--- a/src/crypto/x509/root_cgo_darwin.go
+++ b/src/crypto/x509/root_cgo_darwin.go
@@ -151,11 +151,20 @@ int FetchPEMRoots(CFDataRef *pemRoots) {
import "C"
import (
"errors"
+ "io/ioutil"
+ "os"
"unsafe"
)
func loadSystemRoots() (*CertPool, error) {
roots := NewCertPool()
+ if file := os.Getenv("NIX_SSL_CERT_FILE"); file != "" {
+ data, err := ioutil.ReadFile(file)
+ if err == nil {
+ roots.AppendCertsFromPEM(data)
+ return roots, nil
+ }
+ }
var data C.CFDataRef = nil
err := C.FetchPEMRoots(&data)
diff --git a/src/crypto/x509/root_darwin.go b/src/crypto/x509/root_darwin.go
index 66cdb5e..bb28036 100644
--- a/src/crypto/x509/root_darwin.go
+++ b/src/crypto/x509/root_darwin.go
@@ -61,17 +61,25 @@ func execSecurityRoots() (*CertPool, error) {
println(fmt.Sprintf("crypto/x509: %d certs have a trust policy", len(hasPolicy)))
}
- cmd := exec.Command("/usr/bin/security", "find-certificate", "-a", "-p", "/System/Library/Keychains/SystemRootCertificates.keychain")
- data, err := cmd.Output()
- if err != nil {
- return nil, err
- }
-
var (
mu sync.Mutex
roots = NewCertPool()
numVerified int // number of execs of 'security verify-cert', for debug stats
)
+ if file := os.Getenv("NIX_SSL_CERT_FILE"); file != "" {
+ data, err := ioutil.ReadFile(file)
+ if err == nil {
+ roots.AppendCertsFromPEM(data)
+ return roots, nil
+ }
+ }
+
+ cmd := exec.Command("/usr/bin/security", "find-certificate", "-a", "-p", "/System/Library/Keychains/SystemRootCertificates.keychain")
+ data, err := cmd.Output()
+ if err != nil {
+ return nil, err
+ }
+
blockCh := make(chan *pem.Block)
var wg sync.WaitGroup
diff --git a/src/crypto/x509/root_unix.go b/src/crypto/x509/root_unix.go
index 7bcb3d6..3986e1a 100644
--- a/src/crypto/x509/root_unix.go
+++ b/src/crypto/x509/root_unix.go
@@ -24,6 +24,14 @@ func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate
func loadSystemRoots() (*CertPool, error) {
roots := NewCertPool()
+ if file := os.Getenv("NIX_SSL_CERT_FILE"); file != "" {
+ data, err := ioutil.ReadFile(file)
+ if err == nil {
+ roots.AppendCertsFromPEM(data)
+ return roots, nil
+ }
+ }
+
var firstErr error
for _, file := range certFiles {
data, err := ioutil.ReadFile(file)

View File

@@ -0,0 +1,48 @@
{ stdenv, fetchgit, bootPkgs, perl, gmp, ncurses, binutils, autoconf, alex, happy, makeStaticLibraries
, hscolour, xen, automake, gcc, git, zlib, libtool, enableIntegerSimple ? false
}:
stdenv.mkDerivation rec {
version = "2.4.0";
name = "HaLVM-${version}";
isHaLVM = true;
isGhcjs = false;
src = fetchgit {
rev = "6aa72c9b047fd8ddff857c994a5a895461fc3925";
url = "https://github.com/GaloisInc/HaLVM";
sha256 = "05cg4w6fw5ajmpmh8g2msprnygmr4isb3pphqhlddfqwyvqhl167";
};
prePatch = ''
sed -i '312 d' Makefile
sed -i '316,446 d' Makefile # Removes RPM packaging
sed -i '20 d' src/scripts/halvm-cabal.in
sed -ie 's|ld |${binutils}/bin/ld |g' src/scripts/ldkernel.in
'';
configureFlags = stdenv.lib.optional (!enableIntegerSimple) [ "--enable-gmp" ];
propagatedNativeBuildInputs = [ alex happy ];
buildInputs =
let haskellPkgs = [ alex happy bootPkgs.hscolour bootPkgs.cabal-install bootPkgs.haddock bootPkgs.hpc
]; in [ bootPkgs.ghc
automake perl git binutils
autoconf xen zlib ncurses.dev
libtool gmp ] ++ haskellPkgs;
preConfigure = ''
autoconf
patchShebangs .
'';
hardeningDisable = ["all"];
postInstall = "$out/bin/halvm-ghc-pkg recache";
passthru = {
inherit bootPkgs;
cross.config = "halvm";
cc = "${gcc}/bin/gcc";
ld = "${binutils}/bin/ld";
};
meta = {
homepage = "http://github.com/GaloisInc/HaLVM";
description = "The Haskell Lightweight Virtual Machine (HaLVM): GHC running on Xen";
maintainers = with stdenv.lib.maintainers; [ dmjio ];
inherit (bootPkgs.ghc.meta) license platforms;
};
}

View File

@@ -33,6 +33,11 @@ stdenv.mkDerivation rec {
# work around broken build system
NIX_CFLAGS_COMPILE = "-I${freetype.dev}/include/freetype2";
# the cmake package does not handle absolute CMAKE_INSTALL_INCLUDEDIR correctly
# (setting it to an absolute path causes include files to go to $out/$out/include,
# because the absolute path is interpreted with root at $out).
cmakeFlags = "-DCMAKE_INSTALL_INCLUDEDIR=include";
prePatch = ''
substituteInPlace hphp/util/generate-buildinfo.sh \
--replace /bin/bash ${stdenv.shell}

View File

@@ -1,19 +0,0 @@
{ stdenv, fetchurl, gmp }:
stdenv.mkDerivation rec {
version = "0.0.3";
name = "ikarus-${version}";
src = fetchurl {
url = "http://launchpad.net/ikarus/0.0/${version}/+download/${name}.tar.gz";
sha256 = "0d4vqwqfnj39l0gar2di021kcf6bfpkc6g40yapkmxm6sxpdcvjv";
};
buildInputs = [ gmp ];
meta = {
description = "Scheme compiler, aiming at R6RS";
homepage = http://ikarus-scheme.org/;
license = stdenv.lib.licenses.gpl3;
};
}

View File

@@ -1,4 +1,4 @@
{stdenv, fetchFromGitHub, bash, which, m4, python, bison, flex, llvmPackages, clangWrapSelf,
{stdenv, fetchFromGitHub, bash, which, m4, python, bison, flex_2_6_1, llvmPackages, clangWrapSelf,
testedTargets ? ["sse2" "host"] # the default test target is sse4, but that is not supported by all Hydra agents
}:
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
m4
python
bison
flex
flex_2_6_1
llvm
llvmPackages.clang-unwrapped # we need to link against libclang, so we need the unwrapped
];

View File

@@ -2,6 +2,7 @@
# build tools
, gfortran, m4, makeWrapper, patchelf, perl, which, python2
, runCommand
, paxctl
# libjulia dependencies
, libunwind, readline, utf8proc, zlib
, llvm, libffi, ncurses
@@ -71,7 +72,7 @@ stdenv.mkDerivation rec {
patches = [
./0001.1-use-system-utf8proc.patch
./0002-use-system-suitesparse.patch
];
] ++ stdenv.lib.optional stdenv.needsPax ./0004-hardened.patch;
postPatch = ''
patchShebangs . contrib
@@ -89,7 +90,8 @@ stdenv.mkDerivation rec {
++ stdenv.lib.optionals stdenv.isDarwin [CoreServices ApplicationServices]
;
nativeBuildInputs = [ curl gfortran m4 makeWrapper patchelf perl python2 which ];
nativeBuildInputs = [ curl gfortran m4 makeWrapper patchelf perl python2 which ]
++ stdenv.lib.optional stdenv.needsPax paxctl;
makeFlags =
let

View File

@@ -0,0 +1,25 @@
From 0bdbe60325a22202f8e250a9578407648a0d29b9 Mon Sep 17 00:00:00 2001
From: Will Dietz <w@wdtz.org>
Date: Wed, 1 Feb 2017 06:09:49 -0600
Subject: [PATCH] Set pax flags on julia binaries to disable memory protection.
---
Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Makefile b/Makefile
index 8d45a1baa..91ea33b21 100644
--- a/Makefile
+++ b/Makefile
@@ -61,6 +61,8 @@ julia-src-release julia-src-debug : julia-src-% : julia-deps
julia-ui-release julia-ui-debug : julia-ui-% : julia-src-%
@$(MAKE) $(QUIET_MAKE) -C ui julia-$*
+ @echo "setting PaX flags on $(JULIA_EXECUTABLE_$*)"
+ @paxctl -czexm $(JULIA_EXECUTABLE_$*)
julia-inference : julia-base julia-ui-$(JULIA_BUILD_MODE) $(build_prefix)/.examples
@$(MAKE) $(QUIET_MAKE) $(build_private_libdir)/inference.ji JULIA_BUILD_MODE=$(JULIA_BUILD_MODE)
--
2.11.0

View File

@@ -0,0 +1,25 @@
From eddb251a00ace6e63e32e7dcb9e1ec632cac14e0 Mon Sep 17 00:00:00 2001
From: Will Dietz <w@wdtz.org>
Date: Wed, 1 Feb 2017 06:09:49 -0600
Subject: [PATCH] Set pax flags on julia binaries to disable memory protection.
---
Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Makefile b/Makefile
index 0e28cc87b..aab8cfa8d 100644
--- a/Makefile
+++ b/Makefile
@@ -91,6 +91,8 @@ julia-src-release julia-src-debug : julia-src-% : julia-deps julia_flisp.boot.in
julia-ui-release julia-ui-debug : julia-ui-% : julia-src-%
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/ui julia-$*
+ @echo "setting PaX flags on $(JULIA_EXECUTABLE_$*)"
+ @paxctl -czexm $(JULIA_EXECUTABLE_$*)
julia-inference : julia-base julia-ui-$(JULIA_BUILD_MODE) $(build_prefix)/.examples
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) $(build_private_libdir)/inference.ji JULIA_BUILD_MODE=$(JULIA_BUILD_MODE)
--
2.11.0

View File

@@ -1,6 +1,6 @@
{ stdenv, fetchgit, fetchurl
# build tools
, gfortran, m4, makeWrapper, patchelf, perl, which, python2
, gfortran, m4, makeWrapper, patchelf, perl, which, python2, paxctl
# libjulia dependencies
, libunwind, llvm, readline, utf8proc, zlib
# standard library dependencies
@@ -66,7 +66,7 @@ stdenv.mkDerivation rec {
./0001-use-system-utf8proc.patch
./0002-use-system-suitesparse.patch
./0003-no-ldconfig.patch
];
] ++ stdenv.lib.optional stdenv.needsPax ./0004-hardened-0.4.7.patch;
postPatch = ''
patchShebangs . contrib
@@ -79,7 +79,8 @@ stdenv.mkDerivation rec {
] ++
stdenv.lib.optionals stdenv.isDarwin [CoreServices ApplicationServices] ;
nativeBuildInputs = [ curl gfortran m4 makeWrapper patchelf perl python2 which ];
nativeBuildInputs = [ curl gfortran m4 makeWrapper patchelf perl python2 which ]
++ stdenv.lib.optional stdenv.needsPax paxctl;
makeFlags =
let

View File

@@ -1,6 +1,6 @@
{ stdenv, fetchgit, fetchurl
# build tools
, gfortran, m4, makeWrapper, patchelf, perl, which, python2
, gfortran, m4, makeWrapper, patchelf, perl, which, python2, paxctl
# libjulia dependencies
, libunwind, readline, utf8proc, zlib
, llvm
@@ -72,7 +72,7 @@ stdenv.mkDerivation rec {
patches = [
./0001.1-use-system-utf8proc.patch
./0002-use-system-suitesparse.patch
];
] ++ stdenv.lib.optional stdenv.needsPax ./0004-hardened.patch;
postPatch = ''
patchShebangs . contrib
@@ -86,7 +86,8 @@ stdenv.mkDerivation rec {
++ stdenv.lib.optionals stdenv.isDarwin [CoreServices ApplicationServices]
;
nativeBuildInputs = [ curl gfortran m4 makeWrapper patchelf perl python2 which ];
nativeBuildInputs = [ curl gfortran m4 makeWrapper patchelf perl python2 which ]
++ stdenv.lib.optional stdenv.needsPax paxctl;
makeFlags =
let

View File

@@ -1,12 +1,12 @@
{ stdenv, fetchurl, makeWrapper, jre, unzip }:
stdenv.mkDerivation rec {
version = "1.0.5-2";
version = "1.1.1";
name = "kotlin-${version}";
src = fetchurl {
url = "https://github.com/JetBrains/kotlin/releases/download/v${version}/kotlin-compiler-${version}.zip";
sha512 = "0z8phc51y8dfjnm95fs2dnmvhp7xm2am5xm71byh598flkpjmagnwah4j8z9fpg4qy94dwmqxf5zs3q8nfra89kmwskzpvp7bbibi0h";
sha256 = "1c96l1bkll0l8c82cfzmph0z38f96r3x68zmggq4s8hhdqgwk8mc";
};
propagatedBuildInputs = [ jre ] ;

View File

@@ -46,7 +46,7 @@ stdenv.mkDerivation {
meta = {
description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler";
homepage = http://llvm.org/;
license = stdenv.lib.licenses.bsd3;
license = stdenv.lib.licenses.ncsa;
platforms = stdenv.lib.platforms.all;
};
}

View File

@@ -23,7 +23,7 @@ stdenv.mkDerivation {
meta = {
description = "A set of modular code for creating linker tools";
homepage = http://llvm.org/;
license = stdenv.lib.licenses.bsd3;
license = stdenv.lib.licenses.ncsa;
platforms = stdenv.lib.platforms.all;
};
}

View File

@@ -37,7 +37,7 @@ stdenv.mkDerivation {
meta = {
description = "A next-generation high-performance debugger";
homepage = http://llvm.org/;
license = stdenv.lib.licenses.bsd3;
license = stdenv.lib.licenses.ncsa;
platforms = stdenv.lib.platforms.all;
};
}

View File

@@ -67,7 +67,7 @@ in stdenv.mkDerivation rec {
meta = {
description = "Collection of modular and reusable compiler and toolchain technologies";
homepage = http://llvm.org/;
license = stdenv.lib.licenses.bsd3;
license = stdenv.lib.licenses.ncsa;
maintainers = with stdenv.lib.maintainers; [ lovek323 raskin viric ];
platforms = stdenv.lib.platforms.all;
};

View File

@@ -19,7 +19,7 @@ stdenv.mkDerivation {
meta = {
description = "A polyhedral optimizer for llvm";
homepage = http://llvm.org/;
license = stdenv.lib.licenses.bsd3;
license = stdenv.lib.licenses.ncsa;
platforms = stdenv.lib.platforms.all;
};
}

View File

@@ -47,7 +47,7 @@ in stdenv.mkDerivation {
meta = {
description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler";
homepage = http://llvm.org/;
license = stdenv.lib.licenses.bsd3;
license = stdenv.lib.licenses.ncsa;
platforms = stdenv.lib.platforms.all;
};
}

View File

@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
meta = {
homepage = http://libcxx.llvm.org/;
description = "A new implementation of the C++ standard library, targeting C++11";
license = "BSD";
license = with stdenv.lib.licenses; [ ncsa mit ];
platforms = stdenv.lib.platforms.unix;
};
}

View File

@@ -52,7 +52,7 @@ in stdenv.mkDerivation {
meta = {
homepage = http://libcxxabi.llvm.org/;
description = "A new implementation of low level support for a standard C++ library";
license = "BSD";
license = with stdenv.lib.licenses; [ ncsa mit ];
maintainers = with stdenv.lib.maintainers; [ vlstill ];
platforms = stdenv.lib.platforms.unix;
};

View File

@@ -23,7 +23,7 @@ stdenv.mkDerivation {
meta = {
description = "A set of modular code for creating linker tools";
homepage = http://llvm.org/;
license = stdenv.lib.licenses.bsd3;
license = stdenv.lib.licenses.ncsa;
platforms = stdenv.lib.platforms.all;
};
}

View File

@@ -37,7 +37,7 @@ stdenv.mkDerivation {
meta = {
description = "A next-generation high-performance debugger";
homepage = http://llvm.org/;
license = stdenv.lib.licenses.bsd3;
license = stdenv.lib.licenses.ncsa;
platforms = stdenv.lib.platforms.all;
broken = true;
};

View File

@@ -72,7 +72,7 @@ in stdenv.mkDerivation rec {
meta = {
description = "Collection of modular and reusable compiler and toolchain technologies";
homepage = http://llvm.org/;
license = stdenv.lib.licenses.bsd3;
license = stdenv.lib.licenses.ncsa;
maintainers = with stdenv.lib.maintainers; [ lovek323 raskin viric ];
platforms = stdenv.lib.platforms.all;
};

View File

@@ -19,7 +19,7 @@ stdenv.mkDerivation {
meta = {
description = "A polyhedral optimizer for llvm";
homepage = http://llvm.org/;
license = stdenv.lib.licenses.bsd3;
license = stdenv.lib.licenses.ncsa;
platforms = stdenv.lib.platforms.all;
};
}

View File

@@ -42,6 +42,7 @@ let
passthru = {
lib = self; # compatibility with gcc, so that `stdenv.cc.cc.lib` works on both
isClang = true;
inherit llvm;
} // stdenv.lib.optionalAttrs stdenv.isLinux {
inherit gcc;
};
@@ -49,7 +50,7 @@ let
meta = {
description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler";
homepage = http://llvm.org/;
license = stdenv.lib.licenses.bsd3;
license = stdenv.lib.licenses.ncsa;
platforms = stdenv.lib.platforms.all;
};
};

View File

@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
meta = {
homepage = http://libcxx.llvm.org/;
description = "A new implementation of the C++ standard library, targeting C++11";
license = "BSD";
license = with stdenv.lib.licenses; [ ncsa mit ];
platforms = stdenv.lib.platforms.unix;
};
}

View File

@@ -1,6 +1,12 @@
{ stdenv, cmake, fetch, libcxx, libunwind, llvm, version }:
{ stdenv, cmake, fetch, fetchpatch, libcxx, libunwind, llvm, version }:
stdenv.mkDerivation {
let
# Newer LLVMs (3.8 onwards) have changed how some basic C++ stuff works, which breaks builds of this older version
llvm38-and-above = fetchpatch {
url = "https://trac.macports.org/raw-attachment/ticket/50304/0005-string-Fix-exception-declaration.patch";
sha256 = "1lm38n7s0l5dbl7kp4i49pvzxz1mcvlr2vgsnj47agnwhhm63jvr";
};
in stdenv.mkDerivation {
name = "libc++abi-${version}";
src = fetch "libcxxabi" "0ambfcmr2nh88hx000xb7yjm9lsqjjz49w5mlf6dlxzmj3nslzx4";
@@ -16,6 +22,13 @@ stdenv.mkDerivation {
export TRIPLE=x86_64-apple-darwin
'';
# I can't use patches directly because this is actually a patch for libc++'s source, which we manually extract
# into the libc++abi build environment above.
prePatch = ''(
cd ../libcxx-*
patch -p1 < ${llvm38-and-above}
)'';
installPhase = if stdenv.isDarwin
then ''
for file in lib/*.dylib; do
@@ -40,7 +53,7 @@ stdenv.mkDerivation {
meta = {
homepage = http://libcxxabi.llvm.org/;
description = "A new implementation of low level support for a standard C++ library";
license = "BSD";
license = with stdenv.lib.licenses; [ ncsa mit ];
maintainers = with stdenv.lib.maintainers; [ vlstill ];
platforms = stdenv.lib.platforms.unix;
};

View File

@@ -43,7 +43,7 @@ stdenv.mkDerivation {
meta = {
description = "A next-generation high-performance debugger";
homepage = http://llvm.org/;
license = stdenv.lib.licenses.bsd3;
license = stdenv.lib.licenses.ncsa;
platforms = stdenv.lib.platforms.all;
};
}

View File

@@ -83,7 +83,7 @@ in stdenv.mkDerivation rec {
meta = {
description = "Collection of modular and reusable compiler and toolchain technologies";
homepage = http://llvm.org/;
license = stdenv.lib.licenses.bsd3;
license = stdenv.lib.licenses.ncsa;
maintainers = with stdenv.lib.maintainers; [ lovek323 raskin viric ];
platforms = stdenv.lib.platforms.all;
};

View File

@@ -53,6 +53,7 @@ let
passthru = {
lib = self; # compatibility with gcc, so that `stdenv.cc.cc.lib` works on both
isClang = true;
inherit llvm;
} // stdenv.lib.optionalAttrs stdenv.isLinux {
inherit gcc;
};
@@ -60,7 +61,7 @@ let
meta = {
description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler";
homepage = http://llvm.org/;
license = stdenv.lib.licenses.bsd3;
license = stdenv.lib.licenses.ncsa;
platforms = stdenv.lib.platforms.all;
};
};

View File

@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
meta = {
homepage = http://libcxx.llvm.org/;
description = "A new implementation of the C++ standard library, targeting C++11";
license = "BSD";
license = with stdenv.lib.licenses; [ ncsa mit ];
platforms = stdenv.lib.platforms.unix;
};
}

View File

@@ -40,7 +40,7 @@ stdenv.mkDerivation {
meta = {
homepage = http://libcxxabi.llvm.org/;
description = "A new implementation of low level support for a standard C++ library";
license = "BSD";
license = with stdenv.lib.licenses; [ ncsa mit ];
maintainers = with stdenv.lib.maintainers; [ vlstill ];
platforms = stdenv.lib.platforms.unix;
};

View File

@@ -44,7 +44,7 @@ stdenv.mkDerivation {
meta = {
description = "A next-generation high-performance debugger";
homepage = http://llvm.org/;
license = stdenv.lib.licenses.bsd3;
license = stdenv.lib.licenses.ncsa;
platforms = stdenv.lib.platforms.all;
};
}

View File

@@ -85,7 +85,7 @@ in stdenv.mkDerivation rec {
meta = {
description = "Collection of modular and reusable compiler and toolchain technologies";
homepage = http://llvm.org/;
license = stdenv.lib.licenses.bsd3;
license = stdenv.lib.licenses.ncsa;
maintainers = with stdenv.lib.maintainers; [ lovek323 raskin viric ];
platforms = stdenv.lib.platforms.all;
};

View File

@@ -29,12 +29,23 @@ let
sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' lib/Driver/ToolChains.cpp
'';
outputs = [ "out" "python" ];
# Clang expects to find LLVMgold in its own prefix
# Clang expects to find sanitizer libraries in its own prefix
postInstall = ''
ln -sv ${llvm}/lib/LLVMgold.so $out/lib
ln -sv ${llvm}/lib/clang/${version}/lib $out/lib/clang/${version}/
ln -sv $out/bin/clang $out/bin/cpp
mkdir -p $python/bin $python/share/clang/
mv $out/bin/{git-clang-format,scan-view} $python/bin
if [ -e $out/bin/set-xcode-analyzer ]; then
mv $out/bin/set-xcode-analyzer $python/bin
fi
mv $out/share/clang/*.py $python/share/clang
rm $out/bin/c-index-test
'';
enableParallelBuilding = true;
@@ -42,6 +53,7 @@ let
passthru = {
lib = self; # compatibility with gcc, so that `stdenv.cc.cc.lib` works on both
isClang = true;
inherit llvm;
} // stdenv.lib.optionalAttrs stdenv.isLinux {
inherit gcc;
};
@@ -49,7 +61,7 @@ let
meta = {
description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler";
homepage = http://llvm.org/;
license = stdenv.lib.licenses.bsd3;
license = stdenv.lib.licenses.ncsa;
platforms = stdenv.lib.platforms.all;
};
};

View File

@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
meta = {
homepage = http://libcxx.llvm.org/;
description = "A new implementation of the C++ standard library, targeting C++11";
license = "BSD";
license = with stdenv.lib.licenses; [ ncsa mit ];
platforms = stdenv.lib.platforms.unix;
};
}

View File

@@ -40,7 +40,7 @@ stdenv.mkDerivation {
meta = {
homepage = http://libcxxabi.llvm.org/;
description = "A new implementation of low level support for a standard C++ library";
license = "BSD";
license = with stdenv.lib.licenses; [ ncsa mit ];
maintainers = with stdenv.lib.maintainers; [ vlstill ];
platforms = stdenv.lib.platforms.unix;
};

View File

@@ -50,7 +50,7 @@ stdenv.mkDerivation {
meta = {
description = "A next-generation high-performance debugger";
homepage = http://llvm.org/;
license = stdenv.lib.licenses.bsd3;
license = stdenv.lib.licenses.ncsa;
platforms = stdenv.lib.platforms.all;
};
}

View File

@@ -1,5 +1,6 @@
{ stdenv
, fetch
, fetchpatch
, perl
, groff
, cmake
@@ -39,17 +40,27 @@ in stdenv.mkDerivation rec {
outputs = [ "out" ] ++ stdenv.lib.optional enableSharedLibraries "lib";
buildInputs = [ perl groff cmake libxml2 python libffi ]
++ stdenv.lib.optionals stdenv.isDarwin
[ libcxxabi darwin.cctools darwin.apple_sdk.libs.xpc ];
++ stdenv.lib.optionals stdenv.isDarwin [ libcxxabi ];
propagatedBuildInputs = [ ncurses zlib ];
postPatch = ""
# hacky fix: New LLVM releases require a newer OS X SDK than
# 10.9. This is a temporary measure until nixpkgs darwin support is
# updated.
+ ''
patch -p1 --reverse < ${fetchpatch {
name = "fix-red-icons.diff"; # https://bugs.freedesktop.org/show_bug.cgi?id=99078
url = https://github.com/llvm-mirror/llvm/commit/c280d74837d8.diff;
sha256 = "11sq86spw41v72f676igksapdlsgh7fiqp5qkkmgfj0ndqcn9skf";
}}
''
# TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
# to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra
# can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd
# get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by
# a flag and turn the flag off during the stdenv build. I realize that this LLVM isn't used in the stdenv but I want to
# keep it consistent with 4.0. We really shouldn't be copying and pasting all this code around...
+ stdenv.lib.optionalString stdenv.isDarwin ''
sed -i 's/os_trace(\(.*\)");$/printf(\1\\n");/g' ./projects/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc
substituteInPlace ./projects/compiler-rt/cmake/config-ix.cmake \
--replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)'
''
# Patch llvm-config to return correct library path based on --link-{shared,static}.
+ stdenv.lib.optionalString (enableSharedLibraries) ''
@@ -77,7 +88,6 @@ in stdenv.mkDerivation rec {
++ stdenv.lib.optionals (isDarwin) [
"-DLLVM_ENABLE_LIBCXX=ON"
"-DCAN_TARGET_i386=false"
"-DCMAKE_LIBTOOL=${darwin.cctools}/bin/libtool"
];
postBuild = ''
@@ -109,7 +119,7 @@ in stdenv.mkDerivation rec {
meta = {
description = "Collection of modular and reusable compiler and toolchain technologies";
homepage = http://llvm.org/;
license = stdenv.lib.licenses.bsd3;
license = stdenv.lib.licenses.ncsa;
maintainers = with stdenv.lib.maintainers; [ lovek323 raskin viric ];
platforms = stdenv.lib.platforms.all;
};

View File

@@ -0,0 +1,68 @@
{ stdenv, fetch, cmake, libxml2, libedit, llvm, version, release_version, clang-tools-extra_src, python }:
let
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
self = stdenv.mkDerivation {
name = "clang-${version}";
unpackPhase = ''
unpackFile ${fetch "cfe" "12n99m60aa680cir3ql56s1jsv6lp61hq4w9rabf4c6vpn7gi9ff"}
mv cfe-${version}* clang
sourceRoot=$PWD/clang
unpackFile ${clang-tools-extra_src}
mv clang-tools-extra-* $sourceRoot/tools/extra
'';
buildInputs = [ cmake libedit libxml2 llvm python ];
cmakeFlags = [
"-DCMAKE_CXX_FLAGS=-std=c++11"
] ++
# Maybe with compiler-rt this won't be needed?
(stdenv.lib.optional stdenv.isLinux "-DGCC_INSTALL_PREFIX=${gcc}") ++
(stdenv.lib.optional (stdenv.cc.libc != null) "-DC_INCLUDE_DIRS=${stdenv.cc.libc}/include");
patches = [ ./purity.patch ];
postPatch = ''
sed -i -e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' lib/Driver/Tools.cpp
sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' lib/Driver/ToolChains.cpp
'';
outputs = [ "out" "python" ];
# Clang expects to find LLVMgold in its own prefix
# Clang expects to find sanitizer libraries in its own prefix
postInstall = ''
ln -sv ${llvm}/lib/LLVMgold.so $out/lib
ln -sv ${llvm}/lib/clang/${release_version}/lib $out/lib/clang/${release_version}/
ln -sv $out/bin/clang $out/bin/cpp
mkdir -p $python/bin $python/share/clang/
mv $out/bin/{git-clang-format,scan-view} $python/bin
if [ -e $out/bin/set-xcode-analyzer ]; then
mv $out/bin/set-xcode-analyzer $python/bin
fi
mv $out/share/clang/*.py $python/share/clang
rm $out/bin/c-index-test
'';
enableParallelBuilding = true;
passthru = {
lib = self; # compatibility with gcc, so that `stdenv.cc.cc.lib` works on both
isClang = true;
inherit llvm;
} // stdenv.lib.optionalAttrs stdenv.isLinux {
inherit gcc;
};
meta = {
description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler";
homepage = http://llvm.org/;
license = stdenv.lib.licenses.ncsa;
platforms = stdenv.lib.platforms.all;
};
};
in self

View File

@@ -0,0 +1,16 @@
--- a/lib/Driver/Tools.cpp 2016-08-25 15:48:05.187553443 +0200
+++ b/lib/Driver/Tools.cpp 2016-08-25 15:48:47.534468882 +0200
@@ -9420,13 +9420,6 @@
if (!Args.hasArg(options::OPT_static)) {
if (Args.hasArg(options::OPT_rdynamic))
CmdArgs.push_back("-export-dynamic");
-
- if (!Args.hasArg(options::OPT_shared)) {
- const std::string Loader =
- D.DyldPrefix + ToolChain.getDynamicLinker(Args);
- CmdArgs.push_back("-dynamic-linker");
- CmdArgs.push_back(Args.MakeArgString(Loader));
- }
}
CmdArgs.push_back("-o");

View File

@@ -0,0 +1,48 @@
{ newScope, stdenv, isl, fetchurl, overrideCC, wrapCC, darwin, ccWrapperFun }:
let
callPackage = newScope (self // { inherit stdenv isl release_version version fetch; });
release_version = "4.0.0";
version = release_version; # differentiating these is important for rc's
fetch = name: sha256: fetchurl {
url = "http://llvm.org/releases/${release_version}/${name}-${version}.src.tar.xz";
inherit sha256;
};
compiler-rt_src = fetch "compiler-rt" "059ipqq27gd928ay06f1ck3vw6y5h5z4zd766x8k0k7jpqimpwnk";
clang-tools-extra_src = fetch "clang-tools-extra" "16bwckgcxfn56mbqjlxi7fxja0zm9hjfa6s3ncm3dz98n5zd7ds1";
self = {
llvm = callPackage ./llvm.nix {
inherit compiler-rt_src stdenv;
};
clang-unwrapped = callPackage ./clang {
inherit clang-tools-extra_src stdenv;
};
clang = wrapCC self.clang-unwrapped;
libcxxClang = ccWrapperFun {
cc = self.clang-unwrapped;
isClang = true;
inherit (self) stdenv;
/* FIXME is this right? */
inherit (stdenv.cc) libc nativeTools nativeLibc;
extraPackages = [ self.libcxx self.libcxxabi ];
};
stdenv = overrideCC stdenv self.clang;
libcxxStdenv = overrideCC stdenv self.libcxxClang;
lld = callPackage ./lld.nix {};
lldb = callPackage ./lldb.nix {};
libcxx = callPackage ./libc++ {};
libcxxabi = callPackage ./libc++abi.nix {};
};
in self

View File

@@ -0,0 +1,47 @@
{ lib, stdenv, fetch, cmake, llvm, libcxxabi, fixDarwinDylibNames, version }:
stdenv.mkDerivation rec {
name = "libc++-${version}";
src = fetch "libcxx" "15ngfcjc3pjakpwfq7d4n546jj0rgfdv5rpb1qv9xgv9mp236kag";
postUnpack = ''
unpackFile ${libcxxabi.src}
export LIBCXXABI_INCLUDE_DIR="$PWD/$(ls -d libcxxabi-${version}*)/include"
'';
# https://github.com/llvm-mirror/libcxx/commit/bcc92d75df0274b9593ebd097fcae60494e3bffc
patches = [ ./pthread_mach_thread_np.patch ];
prePatch = ''
substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++"
'';
preConfigure = ''
# Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package
cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$LIBCXXABI_INCLUDE_DIR")
'';
nativeBuildInputs = [ cmake ];
buildInputs = [ libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
cmakeFlags = [
"-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"
"-DLIBCXX_LIBCPPABI_VERSION=2"
"-DLIBCXX_CXX_ABI=libcxxabi"
];
enableParallelBuilding = true;
linkCxxAbi = stdenv.isLinux;
setupHook = ./setup-hook.sh;
meta = {
homepage = http://libcxx.llvm.org/;
description = "A new implementation of the C++ standard library, targeting C++11";
license = with stdenv.lib.licenses; [ ncsa mit ];
platforms = stdenv.lib.platforms.unix;
};
}

View File

@@ -0,0 +1,41 @@
From bcc92d75df0274b9593ebd097fcae60494e3bffc Mon Sep 17 00:00:00 2001
From: Asiri Rathnayake <asiri.rathnayake@arm.com>
Date: Thu, 26 Jan 2017 10:40:17 +0000
Subject: [PATCH] Fix chromium build (libcxx)
Remove the reference to pthread_mach_thread_np() in libcxx headers.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@293167 91177308-0d34-0410-b5e6-96231b3b80d8
---
include/__threading_support | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/include/__threading_support b/include/__threading_support
index 13ab769..dfe7fe1 100644
--- a/include/__threading_support
+++ b/include/__threading_support
@@ -149,11 +149,6 @@ int __libcpp_execute_once(__libcpp_exec_once_flag *flag,
void (*init_routine)(void));
// Thread id
-#if defined(__APPLE__) && !defined(__arm__)
-_LIBCPP_THREAD_ABI_VISIBILITY
-mach_port_t __libcpp_thread_get_port();
-#endif
-
_LIBCPP_THREAD_ABI_VISIBILITY
bool __libcpp_thread_id_equal(__libcpp_thread_id t1, __libcpp_thread_id t2);
@@ -297,12 +292,6 @@ int __libcpp_execute_once(__libcpp_exec_once_flag *flag,
}
// Thread id
-#if defined(__APPLE__) && !defined(__arm__)
-mach_port_t __libcpp_thread_get_port() {
- return pthread_mach_thread_np(pthread_self());
-}
-#endif
-
// Returns non-zero if the thread ids are equal, otherwise 0
bool __libcpp_thread_id_equal(__libcpp_thread_id t1, __libcpp_thread_id t2)
{

View File

@@ -0,0 +1,3 @@
linkCxxAbi="@linkCxxAbi@"
export NIX_CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1"
export NIX_CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}"

View File

@@ -0,0 +1,46 @@
{ stdenv, cmake, fetch, libcxx, libunwind, llvm, version }:
stdenv.mkDerivation {
name = "libc++abi-${version}";
src = fetch "libcxxabi" "1n416kv27anabg9jsw6331r28ic30xk46p381lx2vbb2jrhwpafw";
buildInputs = [ cmake ] ++ stdenv.lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD) libunwind;
postUnpack = ''
unpackFile ${libcxx.src}
unpackFile ${llvm.src}
export cmakeFlags="-DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*)"
'' + stdenv.lib.optionalString stdenv.isDarwin ''
export TRIPLE=x86_64-apple-darwin
'';
installPhase = if stdenv.isDarwin
then ''
for file in lib/*.dylib; do
# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
# if you fancy a try, take a look at
# http://www.cmake.org/Wiki/CMake_RPATH_handling
install_name_tool -id $out/$file $file
done
make install
install -d 755 $out/include
install -m 644 ../include/*.h $out/include
''
else ''
install -d -m 755 $out/include $out/lib
install -m 644 lib/libc++abi.so.1.0 $out/lib
install -m 644 ../include/cxxabi.h $out/include
ln -s libc++abi.so.1.0 $out/lib/libc++abi.so
ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1
'';
meta = {
homepage = http://libcxxabi.llvm.org/;
description = "A new implementation of low level support for a standard C++ library";
license = with stdenv.lib.licenses; [ ncsa mit ];
maintainers = with stdenv.lib.maintainers; [ vlstill ];
platforms = stdenv.lib.platforms.unix;
};
}

View File

@@ -0,0 +1,32 @@
{ stdenv
, fetch
, cmake
, zlib
, llvm
, python
, version
}:
stdenv.mkDerivation {
name = "lld-${version}";
src = fetch "lld" "00km1qawk146pyjqa6aphcdzgkzrmg6cgk0ikg4661ffp5bn9q1k";
buildInputs = [ cmake llvm ];
outputs = [ "out" "dev" ];
enableParallelBuilding = true;
postInstall = ''
moveToOutput include "$dev"
moveToOutput lib "$dev"
'';
meta = {
description = "The LLVM Linker";
homepage = http://lld.llvm.org/;
license = stdenv.lib.licenses.ncsa;
platforms = stdenv.lib.platforms.all;
};
}

View File

@@ -0,0 +1,50 @@
{ stdenv
, fetch
, cmake
, zlib
, ncurses
, swig
, which
, libedit
, libxml2
, llvm
, clang-unwrapped
, python
, version
, darwin
}:
stdenv.mkDerivation {
name = "lldb-${version}";
src = fetch "lldb" "0g83hbw1r4gd0z8hlph9i34xs6dlcc69vz3h2bqwkhb2qq2qzg9d";
patchPhase = ''
# Fix up various paths that assume llvm and clang are installed in the same place
sed -i 's,".*ClangConfig.cmake","${clang-unwrapped}/lib/cmake/clang/ClangConfig.cmake",' \
cmake/modules/LLDBStandalone.cmake
sed -i 's,".*tools/clang/include","${clang-unwrapped}/include",' \
cmake/modules/LLDBStandalone.cmake
sed -i 's,"$.LLVM_LIBRARY_DIR.",${llvm}/lib ${clang-unwrapped}/lib,' \
cmake/modules/LLDBStandalone.cmake
'';
buildInputs = [ cmake python which swig ncurses zlib libedit libxml2 llvm ]
++ stdenv.lib.optionals stdenv.isDarwin [ darwin.libobjc darwin.apple_sdk.libs.xpc ];
CXXFLAGS = "-fno-rtti";
hardeningDisable = [ "format" ];
cmakeFlags = [
"-DLLDB_DISABLE_LIBEDIT=ON"
];
enableParallelBuilding = true;
meta = with stdenv.lib; {
description = "A next-generation high-performance debugger";
homepage = http://llvm.org/;
license = licenses.ncsa;
platforms = platforms.allBut platforms.darwin;
};
}

View File

@@ -0,0 +1,26 @@
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
index 94d426b..37f7794 100644
--- a/tools/llvm-config/llvm-config.cpp
+++ b/tools/llvm-config/llvm-config.cpp
@@ -333,6 +333,21 @@ int main(int argc, char **argv) {
ActiveIncludeOption = "-I" + ActiveIncludeDir;
}
+ /// Nix-specific multiple-output handling: override ActiveLibDir if --link-shared
+ if (!IsInDevelopmentTree) {
+ bool WantShared = true;
+ for (int i = 1; i < argc; ++i) {
+ StringRef Arg = argv[i];
+ if (Arg == "--link-shared")
+ WantShared = true;
+ else if (Arg == "--link-static")
+ WantShared = false; // the last one wins
+ }
+
+ if (WantShared)
+ ActiveLibDir = std::string("@lib@") + "/lib" + LLVM_LIBDIR_SUFFIX;
+ }
+
/// We only use `shared library` mode in cases where the static library form
/// of the components provided are not available; note however that this is
/// skipped if we're run from within the build dir. However, once installed,

View File

@@ -0,0 +1,137 @@
{ stdenv
, fetch
, fetchpatch
, perl
, groff
, cmake
, python
, libffi
, binutils
, libxml2
, valgrind
, ncurses
, version
, release_version
, zlib
, compiler-rt_src
, libcxxabi
, debugVersion ? false
, enableSharedLibraries ? true
, darwin
}:
let
src = fetch "llvm" "1giklnw71wzsgbqg9wb5x7dxnbj39m6zpfvskvzvhwvfz4fm244d";
shlib = if stdenv.isDarwin then "dylib" else "so";
# Used when creating a version-suffixed symlink of libLLVM.dylib
shortVersion = with stdenv.lib;
concatStringsSep "." (take 2 (splitString "." release_version));
in stdenv.mkDerivation rec {
name = "llvm-${version}";
unpackPhase = ''
unpackFile ${src}
mv llvm-${version}* llvm
sourceRoot=$PWD/llvm
unpackFile ${compiler-rt_src}
mv compiler-rt-* $sourceRoot/projects/compiler-rt
'';
outputs = [ "out" ] ++ stdenv.lib.optional enableSharedLibraries "lib";
buildInputs = [ perl groff cmake libxml2 python libffi ]
++ stdenv.lib.optionals stdenv.isDarwin [ libcxxabi ];
propagatedBuildInputs = [ ncurses zlib ];
# TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
# to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra
# can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd
# get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by
# a flag and turn the flag off during the stdenv build.
postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
substituteInPlace ./projects/compiler-rt/cmake/config-ix.cmake \
--replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)'
''
# Patch llvm-config to return correct library path based on --link-{shared,static}.
+ stdenv.lib.optionalString (enableSharedLibraries) ''
substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib
patch -p1 < ./llvm-outputs.patch
''
# Remove broken tests: (https://bugs.llvm.org//show_bug.cgi?id=31610)
+ ''
rm test/CodeGen/AMDGPU/invalid-opencl-version-metadata1.ll
rm test/CodeGen/AMDGPU/invalid-opencl-version-metadata2.ll
rm test/CodeGen/AMDGPU/invalid-opencl-version-metadata3.ll
rm test/CodeGen/AMDGPU/runtime-metadata.ll
'';
# hacky fix: created binaries need to be run before installation
preBuild = ''
mkdir -p $out/
ln -sv $PWD/lib $out
'';
cmakeFlags = with stdenv; [
"-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}"
"-DLLVM_INSTALL_UTILS=ON" # Needed by rustc
"-DLLVM_BUILD_TESTS=ON"
"-DLLVM_ENABLE_FFI=ON"
"-DLLVM_ENABLE_RTTI=ON"
"-DCOMPILER_RT_INCLUDE_TESTS=OFF" # FIXME: requires clang source code
] ++ stdenv.lib.optional enableSharedLibraries [
"-DLLVM_LINK_LLVM_DYLIB=ON"
] ++ stdenv.lib.optional (!isDarwin)
"-DLLVM_BINUTILS_INCDIR=${binutils.dev}/include"
++ stdenv.lib.optionals (isDarwin) [
"-DLLVM_ENABLE_LIBCXX=ON"
"-DCAN_TARGET_i386=false"
];
postBuild = ''
rm -fR $out
paxmark m bin/{lli,llvm-rtdyld}
paxmark m unittests/ExecutionEngine/MCJIT/MCJITTests
paxmark m unittests/ExecutionEngine/Orc/OrcJITTests
paxmark m unittests/Support/SupportTests
paxmark m bin/lli-child-target
'';
preCheck = ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib
'';
postInstall = ""
+ stdenv.lib.optionalString (enableSharedLibraries) ''
moveToOutput "lib/libLLVM-*" "$lib"
moveToOutput "lib/libLLVM.${shlib}" "$lib"
substituteInPlace "$out/lib/cmake/llvm/LLVMExports-release.cmake" \
--replace "\''${_IMPORT_PREFIX}/lib/libLLVM-" "$lib/lib/libLLVM-"
''
+ stdenv.lib.optionalString (stdenv.isDarwin && enableSharedLibraries) ''
substituteInPlace "$out/lib/cmake/llvm/LLVMExports-release.cmake" \
--replace "\''${_IMPORT_PREFIX}/lib/libLLVM.dylib" "$lib/lib/libLLVM.dylib"
install_name_tool -id $lib/lib/libLLVM.dylib $lib/lib/libLLVM.dylib
install_name_tool -change @rpath/libLLVM.dylib $lib/lib/libLLVM.dylib $out/bin/llvm-config
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib
'';
doCheck = stdenv.isLinux;
checkTarget = "check-all";
enableParallelBuilding = true;
passthru.src = src;
meta = {
description = "Collection of modular and reusable compiler and toolchain technologies";
homepage = http://llvm.org/;
license = stdenv.lib.licenses.ncsa;
maintainers = with stdenv.lib.maintainers; [ lovek323 raskin viric dtzWill ];
platforms = stdenv.lib.platforms.all;
};
}

View File

@@ -1,24 +0,0 @@
#!@shell@
source $stdenv/setup
echo "Building Manticore research compiler."
set -xe
PATH=$smlnj/bin:$PATH
mkdir -p $out/bin
# Manticore seems to use the MLB files from the build tree,
# so for now we copy the whole build tree into the store:
cd $out/
tar xf $src
mv manticore* repo_checkout
cd repo_checkout/
# TODO: At the very least, this could probably be cut down to a subset
# of the repo.
${autoconf}/bin/autoheader -Iconfig
${autoconf}/bin/autoconf -Iconfig
./configure --prefix=$out
make build -j
make install

View File

@@ -1,14 +1,41 @@
{ stdenv, fetchurl, coreutils, autoconf, automake, smlnj }:
{ stdenv, fetchFromGitHub, coreutils, autoreconfHook, smlnj }:
stdenv.mkDerivation rec {
let
rev = "592a5714595b4448b646a7d49df04c285668c2f8";
in stdenv.mkDerivation rec {
name = "manticore-${version}";
version = "2014.08.18";
builder = ./builder.sh;
src = fetchurl {
url = https://github.com/rrnewton/manticore_temp_mirror/archive/snapshot-20140818.tar.gz;
sha256 = "1x52xpj5gbcpqjqm6aw6ssn901f353zypj3d5scm8i3ad777y29d";
src = fetchFromGitHub {
owner = "rrnewton";
repo = "manticore_temp_mirror";
sha256 = "1snwlm9a31wfgvzb80y7r7yvc6n0k0bi675lqwzll95as7cdswwi";
inherit rev;
};
inherit stdenv coreutils autoconf automake smlnj;
enableParallelBuilding = false;
nativeBuildInputs = [ autoreconfHook ];
buildInputs = [ coreutils smlnj ];
autoreconfFlags = "-Iconfig -vfi";
unpackPhase = ''
mkdir -p $out
cd $out
unpackFile $src
mv manticore_temp_mirror-${rev}-src repo_checkout
cd repo_checkout
chmod u+w . -R
'';
postPatch = ''
patchShebangs .
substituteInPlace configure.ac --replace 'MANTICORE_ROOT=`pwd`' 'MANTICORE_ROOT=$out/repo_checkout'
'';
preInstall = "mkdir -p $out/bin";
meta = {
description = "A parallel, pure variant of Standard ML";

View File

@@ -1,23 +1,30 @@
{ stdenv, fetchurl, boost, emacs, gmp, makeWrapper
{ stdenv, fetchurl, makeWrapper
, boost, gmp
, tcl-8_5, tk-8_5
, emacs
}:
let
version = "2.0.0";
in stdenv.mkDerivation {
binaries = {
"x86_64-linux" = fetchurl {
url = "mirror://sourceforge/project/mozart-oz/v${version}-alpha.0/mozart2-${version}-alpha.0+build.4105.5c06ced-x86_64-linux.tar.gz";
sha256 = "0rsfrjimjxqbwprpzzlmydl3z3aiwg5qkb052jixdxjyad7gyh5z";
};
};
in
stdenv.mkDerivation {
name = "mozart-binary-${version}";
src = fetchurl {
url = "mirror://sourceforge/project/mozart-oz/v${version}-alpha.0/mozart2-${version}-alpha.0+build.4105.5c06ced-x86_64-linux.tar.gz";
sha256 = "0rsfrjimjxqbwprpzzlmydl3z3aiwg5qkb052jixdxjyad7gyh5z";
};
preferLocalBuild = true;
src = binaries."${stdenv.system}" or (throw "unsupported system: ${stdenv.system}");
libPath = stdenv.lib.makeLibraryPath
[ stdenv.cc.cc
boost
emacs
gmp
tcl-8_5
tk-8_5
@@ -25,10 +32,36 @@ in stdenv.mkDerivation {
TK_LIBRARY = "${tk-8_5}/lib/tk8.5";
builder = ./builder.sh;
buildInputs = [ makeWrapper ];
buildCommand = ''
mkdir $out
tar xvf $src -C $out --strip-components=1
for exe in $out/bin/{ozemulator,ozwish} ; do
patchelf --set-interpreter $(< $NIX_CC/nix-support/dynamic-linker) \
--set-rpath $libPath \
$exe
done
wrapProgram $out/bin/ozwish \
--set OZHOME $out \
--set TK_LIBRARY $TK_LIBRARY
wrapProgram $out/bin/ozemulator --set OZHOME $out
${stdenv.lib.optionalString (emacs != null) ''
wrapProgram $out/bin/oz --suffix PATH ":" ${stdenv.lib.makeBinPath [ emacs ]}
''}
sed -i $out/share/applications/oz.desktop \
-e "s,Exec=oz %u,Exec=$out/bin/oz %u,"
gzip -9n $out/share/mozart/elisp"/"*.elc
patchShebangs $out
'';
meta = with stdenv.lib; {
homepage = "http://www.mozart-oz.org/";
description = "Multiplatform implementation of the Oz programming language";
@@ -40,6 +73,7 @@ in stdenv.mkDerivation {
expressive power and advanced functionality.
'';
license = licenses.mit;
platforms = [ "x86_64-linux" ];
platforms = attrNames binaries;
hydraPlatforms = [];
};
}

View File

@@ -1,26 +0,0 @@
source $stdenv/setup
echo "unpacking $src..."
tar xvfz $src
mkdir -p $out/bin
mkdir -p $out/share
mv mozart*linux/bin/* $out/bin
mv mozart*linux/share/* $out/share
patchShebangs $out
for f in $out/bin/*; do
b=$(basename $f)
if [ $b == "ozemulator" ] || [ $b == "ozwish" ]; then
patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath $libPath \
$f
continue;
fi
wrapProgram $f --set OZHOME $out \
--set TK_LIBRARY $TK_LIBRARY
done

View File

@@ -2,11 +2,11 @@
stdenv.mkDerivation rec {
name = "nasm-${version}";
version = "2.11.08";
version = "2.12.02";
src = fetchurl {
url = "http://www.nasm.us/pub/nasm/releasebuilds/${version}/${name}.tar.bz2";
sha256 = "0ialkla6i63j8fpv840jy7k5mdf2wbqr98bvbcq0dp0b38ls18wx";
sha256 = "097318bjxvmffbjfd1k89parc04xf5jfxg2rr93581lccwf8kc00";
};
meta = with stdenv.lib; {

View File

@@ -3,4 +3,7 @@ import ./generic.nix {
minor_version = "04";
patch_version = "0";
sha256 = "1d2nk3kq4dyzz8dls45r13jprq5by3q8kshc8kvxzm8n4fnnvvb4";
# If the executable is stipped it does not work
dontStrip = true;
}

View File

@@ -1,11 +1,17 @@
{ stdenv, fetchurl, unzip, setJavaClassPath, freetype }:
let
jce-policies = fetchurl {
# Ugh, unversioned URLs... I hope this doesn't change often enough to cause pain before we move to a Darwin source build of OpenJDK!
url = "http://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip";
sha256 = "0nk7m0lgcbsvldq2wbfni2pzq8h818523z912i7v8hdcij5s48c0";
};
jdk = stdenv.mkDerivation {
name = "zulu1.8.0_66-8.11.0.1";
name = "zulu1.8.0_121-8.20.0.5";
src = fetchurl {
url = http://cdn.azulsystems.com/zulu/bin/zulu1.8.0_66-8.11.0.1-macosx.zip;
sha256 = "0pvbpb3vf0509xm2x1rh0p0w4wmx50zf15604p28z1k8ai1a23sz";
url = "http://cdn.azul.com/zulu/bin/zulu8.20.0.5-jdk8.0.121-macosx_x64.zip";
sha256 = "2a58bd1d9b0cbf0b3d8d1bcdd117c407e3d5a0ec01e2f53565c9bec5cf9ea78b";
curlOpts = "-H Referer:https://www.azul.com/downloads/zulu/zulu-linux/";
};
@@ -15,6 +21,9 @@ let
mkdir -p $out
mv * $out
unzip ${jce-policies}
mv -f ZuluJCEPolicies/*.jar $out/jre/lib/security/
# jni.h expects jni_md.h to be in the header search path.
ln -s $out/include/darwin/*_md.h $out/include/
'';

View File

@@ -3,13 +3,13 @@
stdenv.mkDerivation ( rec {
name = "ponyc-${version}";
version = "0.10.0";
version = "0.12.2";
src = fetchFromGitHub {
owner = "ponylang";
repo = "ponyc";
rev = version;
sha256 = "1v314abmhlqsj8iyab61cf8nb4kbddv1ycnw29z53mpbmivk4gn0";
sha256 = "1gp92fwfq9ic43c525p0idap99jq5fkjbijf0s8bxif3kng7rxbp";
};
buildInputs = [ llvm makeWrapper which ];
@@ -79,11 +79,11 @@ stdenv.mkDerivation ( rec {
# Stripping breaks linking for ponyc
dontStrip = true;
meta = {
meta = with stdenv.lib; {
description = "Pony is an Object-oriented, actor-model, capabilities-secure, high performance programming language";
homepage = http://www.ponylang.org;
license = stdenv.lib.licenses.bsd2;
maintainers = with stdenv.lib.maintainers; [ doublec kamilchm ];
platforms = stdenv.lib.platforms.unix;
license = licenses.bsd2;
maintainers = with maintainers; [ doublec kamilchm ];
platforms = subtractLists platforms.i686 platforms.unix;
};
})

Some files were not shown because too many files have changed in this diff Show More