Merge recent master into x-updates

Hydra eval: 1131611
This commit is contained in:
Vladimír Čunát
2014-06-26 22:05:12 +02:00
245 changed files with 3417 additions and 3876 deletions

View File

@@ -63,8 +63,13 @@ stdenv.mkDerivation {
builder = ./builder.sh;
meta = {
description = "Functional programming language based on Standard ML";
longDescription = ''
Alice ML is a functional programming language based on Standard ML,
extended with rich support for concurrent, distributed, and constraint
programming.
'';
homepage = http://www.ps.uni-saarland.de/alice/;
description = "Alice ML is a functional programming language based on Standard ML, extended with rich support for concurrent, distributed, and constraint programming.";
license = "BSD";
};
}

View File

@@ -12,7 +12,7 @@ let
revision = "5666.3"; # Apple's fork revision number.
in
stdenv.mkDerivation {
stdenv.mkDerivation rec {
name = "gcc-apple-${version}.${revision}";
builder = ./builder.sh;
@@ -33,8 +33,10 @@ stdenv.mkDerivation {
sourceRoot = "gcc-${revision}/";
# The floor_log2_patch is from a Gentoo fix for the same issue:
# https://bugs.gentoo.org/attachment.cgi?id=363174&action=diff
patches =
[ ./pass-cxxcpp.patch ]
[ ./pass-cxxcpp.patch ./floor_log2_patch.diff ]
++ stdenv.lib.optional noSysDirs ./no-sys-dirs.patch
++ stdenv.lib.optional langCC ./fix-libstdc++-link.patch;

View File

@@ -3,6 +3,9 @@ Prevent our libstdc++.dylib from having a runtime dependency on
passed by g++ when it links libstdc++.dylib. Adding "-nostdlib" to
the g++ invocation prevents this.
jww (2014-06-21): I've added several more patches to this, for building on
Mavericks.
diff -ru -x '*~' libstdcxx-39-orig/libstdcxx/libstdc++-v3/src/Makefile.in libstdcxx-39/libstdcxx/libstdc++-v3/src/Makefile.in
--- x/libstdcxx/libstdc++-v3/src/Makefile.in 2006-10-16 21:08:22.000000000 +0200
+++ y/libstdcxx/libstdc++-v3/src/Makefile.in 2012-02-17 18:44:05.210570590 +0100
@@ -15,3 +18,54 @@ diff -ru -x '*~' libstdcxx-39-orig/libstdcxx/libstdc++-v3/src/Makefile.in libstd
# Use special rules for the deprecated source files so that they find
--- x/libstdcxx/libstdc++-v3/libsupc++/unwind-cxx.h
+++ y/libstdcxx/libstdc++-v3/libsupc++/unwind-cxx.h
@@ -38,7 +38,7 @@
#include <typeinfo>
#include <exception>
#include <cstddef>
-#include "unwind.h"
+#include "unwind-generic.h"
#pragma GCC visibility push(default)
@@ -133,7 +133,7 @@ extern "C" void __cxa_bad_typeid ();
// throws, and if bad_exception needs to be thrown. Called from the
// compiler.
extern "C" void __cxa_call_unexpected (void *) __attribute__((noreturn));
-extern "C" void __cxa_call_terminate (void*) __attribute__((noreturn));
+extern "C" void __cxa_call_terminate(_Unwind_Exception* ue_header);
#ifdef __ARM_EABI_UNWINDER__
// Arm EABI specified routines.
--- x/libstdcxx/libstdc++-v3/include/ext/bitmap_allocator.h
+++ y/libstdcxx/libstdc++-v3/include/ext/bitmap_allocator.h
@@ -549,6 +549,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
*/
class free_list
{
+ public:
typedef size_t* value_type;
typedef __detail::__mini_vector<value_type> vector_type;
typedef vector_type::iterator iterator;
--- x/libstdcxx/libstdc++-v3/include/ext/ropeimpl.h
+++ y/libstdcxx/libstdc++-v3/include/ext/ropeimpl.h
@@ -433,7 +433,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
{
size_t __old_len = __r->_M_size;
_CharT* __new_data = (_CharT*)
- _Data_allocate(_S_rounded_up_size(__old_len + __len));
+ _Base::_Data_allocate(_S_rounded_up_size(__old_len + __len));
_RopeLeaf* __result;
uninitialized_copy_n(__r->_M_data, __old_len, __new_data);
@@ -817,7 +817,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
if (__result_len > __lazy_threshold)
goto lazy;
__section = (_CharT*)
- _Data_allocate(_S_rounded_up_size(__result_len));
+ _Base::_Data_allocate(_S_rounded_up_size(__result_len));
try
{ (*(__f->_M_fn))(__start, __result_len, __section); }
catch(...)

View File

@@ -0,0 +1,62 @@
--- gcc-5666.3/gcc/toplev.h
+++ gcc-5666.3/gcc/toplev.h
@@ -151,6 +151,8 @@
/* Return true iff flags are set as if -ffast-math. */
extern bool fast_math_flags_set_p (void);
+#if GCC_VERSION < 3004
+
/* Return log2, or -1 if not exact. */
extern int exact_log2 (unsigned HOST_WIDE_INT);
@@ -158,7 +160,7 @@
extern int floor_log2 (unsigned HOST_WIDE_INT);
/* Inline versions of the above for speed. */
-#if GCC_VERSION >= 3004
+#else /* GCC_VERSION < 3004 */
# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
# define CLZ_HWI __builtin_clzl
# define CTZ_HWI __builtin_ctzl
@@ -172,18 +172,18 @@
# define CTZ_HWI __builtin_ctz
# endif
-extern inline int
+static inline int
floor_log2 (unsigned HOST_WIDE_INT x)
{
return x ? HOST_BITS_PER_WIDE_INT - 1 - (int) CLZ_HWI (x) : -1;
}
-extern inline int
+static inline int
exact_log2 (unsigned HOST_WIDE_INT x)
{
return x == (x & -x) && x ? (int) CTZ_HWI (x) : -1;
}
-#endif /* GCC_VERSION >= 3004 */
+#endif /* GCC_VERSION < 3004 */
/* Functions used to get and set GCC's notion of in what directory
compilation was started. */
--- gcc-5666.3/gcc/toplev.c
+++ gcc-5666.3/gcc/toplev.c
@@ -555,7 +555,7 @@
for floor_log2 and exact_log2; see toplev.h. That construct, however,
conflicts with the ISO C++ One Definition Rule. */
-#if GCC_VERSION < 3004 || !defined (__cplusplus)
+#if GCC_VERSION < 3004
/* Given X, an unsigned number, return the largest int Y such that 2**Y <= X.
If X is 0, return -1. */
@@ -607,7 +607,7 @@
#endif
}
-#endif /* GCC_VERSION < 3004 || !defined (__cplusplus) */
+#endif /* GCC_VERSION < 3004 */
/* Handler for fatal signals, such as SIGSEGV. These are transformed
into ICE messages, which is much more user friendly. In case the

View File

@@ -0,0 +1,94 @@
{ stdenv, lib, fetchurl, bison, glibc, bash, coreutils, makeWrapper, tzdata, iana_etc }:
let
loader386 = "${glibc}/lib/ld-linux.so.2";
loaderAmd64 = "${glibc}/lib/ld-linux-x86-64.so.2";
loaderArm = "${glibc}/lib/ld-linux.so.3";
in
stdenv.mkDerivation {
name = "go-1.3";
src = fetchurl {
url = https://storage.googleapis.com/golang/go1.3.src.tar.gz;
sha256 = "10jkqgzlinzynciw3wr15c7n2vw5q4d2ni65hbs3i61bbdn3x67b";
};
buildInputs = [ bison bash makeWrapper ] ++ lib.optionals stdenv.isLinux [ glibc ] ;
# I'm not sure what go wants from its 'src', but the go installation manual
# describes an installation keeping the src.
preUnpack = ''
mkdir -p $out/share
cd $out/share
'';
prePatch = ''
# Ensure that the source directory is named go
cd ..
if [ ! -d go ]; then
mv * go
fi
cd go
patchShebangs ./ # replace /bin/bash
# Disabling the 'os/http/net' tests (they want files not available in
# chroot builds)
rm src/pkg/net/{multicast_test.go,parse_test.go,port_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/pkg/os/os_test.go
sed -i 's,/bin/pwd,'"`type -P pwd`", src/pkg/os/os_test.go
# Disable the unix socket test
sed -i '/TestShutdownUnix/areturn' src/pkg/net/net_test.go
# Disable the hostname test
sed -i '/TestHostname/areturn' src/pkg/os/os_test.go
sed -i 's,/etc/protocols,${iana_etc}/etc/protocols,' src/pkg/net/lookup_unix.go
'' + lib.optionalString stdenv.isLinux ''
sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/pkg/time/zoneinfo_unix.go
sed -i 's,/lib/ld-linux.so.3,${loaderArm},' src/cmd/5l/asm.c
sed -i 's,/lib64/ld-linux-x86-64.so.2,${loaderAmd64},' src/cmd/6l/asm.c
sed -i 's,/lib/ld-linux.so.2,${loader386},' src/cmd/8l/asm.c
'';
patches = [ ./cacert-1.2.patch ];
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.system == "armv5tel-linux" then "arm"
else throw "Unsupported system";
GOARM = stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") "5";
GO386 = 387; # from Arch: don't assume sse2 on i686
CGO_ENABLED = 1;
installPhase = ''
export CC=cc
# http://lists.science.uu.nl/pipermail/nix-dev/2013-October/011891.html
# Fix for "libgcc_s.so.1 must be installed for pthread_cancel to work"
# during tests:
export LD_LIBRARY_PATH="$(dirname $(echo ${stdenv.gcc.gcc}/lib*/libgcc_s.so))"
mkdir -p "$out/bin"
export GOROOT="$(pwd)/"
export GOBIN="$out/bin"
export PATH="$GOBIN:$PATH"
cd ./src
./all.bash
cd -
# Copy the emacs configuration for Go files.
mkdir -p "$out/share/emacs/site-lisp"
cp ./misc/emacs/* $out/share/emacs/site-lisp/
'';
meta = {
homepage = http://golang.org/;
description = "The Go Programming language";
license = "BSD";
maintainers = with stdenv.lib.maintainers; [ cstrahan ];
platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
};
}

View File

@@ -0,0 +1,54 @@
{ stdenv, lib, go, fetchFromGitHub }:
let
goDeps = [
{
root = "github.com/mitchellh/gox";
src = fetchFromGitHub {
owner = "mitchellh";
repo = "gox";
rev = "c7329055e2aeb253a947e5cc876586ff4ca19199";
sha256 = "0zhb88jjxqn3sdc4bpzvajqvgi9igp5gk03q12gaksaxhy2wl4jy";
};
}
{
root = "github.com/mitchellh/iochan";
src = fetchFromGitHub {
owner = "mitchellh";
repo = "iochan";
rev = "b584a329b193e206025682ae6c10cdbe03b0cd77";
sha256 = "1fcwdhfci41ibpng2j4c1bqfng578cwzb3c00yw1lnbwwhaq9r6b";
};
}
];
sources = stdenv.mkDerivation rec {
name = "go-deps";
buildCommand =
lib.concatStrings
(map (dep: ''
mkdir -p $out/src/`dirname ${dep.root}`
ln -s ${dep.src} $out/src/${dep.root}
'') goDeps);
};
in
stdenv.mkDerivation rec {
name = "gox";
src = sources;
propagatedBuildInputs = [ go ];
installPhase = ''
ensureDir $out/bin
export GOPATH=$src
go build -v -o $out/bin/gox github.com/mitchellh/gox
'';
meta = with lib; {
description = "A simple, no-frills tool for Go cross compilation that behaves a lot like standard go build";
homepage = https://github.com/mitchellh/gox;
maintainers = with maintainers; [ cstrahan ];
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,31 @@
{ stdenv, fetchurl }:
stdenv.mkDerivation rec {
name = "sbcl-bootstrap-${version}";
version = "1.1.8";
src = if stdenv.isDarwin
then fetchurl {
url = mirror://sourceforge/project/sbcl/sbcl/1.1.8/sbcl-1.1.8-x86-64-darwin-binary.tar.bz2;
sha256 = "006pr88053wclvbjfjdypnbiw8wymbzdzi7a6kbkpdfn4zf5943j";
}
else fetchurl {
url = mirror://sourceforge/project/sbcl/sbcl/1.1.8/sbcl-1.1.8-x86-64-linux-binary.tar.bz2;
sha256 = "0lh1jglxlfwk4cm6sgwk1jnb6ikhbrkx7p5aha2nbmkd6zl96prx";
};
installPhase = ''
ensureDir $out/bin
cp -p src/runtime/sbcl $out/bin
ensureDir $out/share/sbcl
cp -p output/sbcl.core $out/share/sbcl
'';
meta = {
description = "Lisp compiler";
homepage = "http://www.sbcl.org";
license = "bsd";
maintainers = [stdenv.lib.maintainers.raskin];
platforms = stdenv.lib.platforms.unix;
};
}

View File

@@ -1,36 +1,18 @@
a :
let
fetchurl = a.fetchurl;
s= # Generated upstream information
rec {
baseName="sbcl";
version="1.2.0";
name="${baseName}-${version}";
hash="13k20sys1v4lvgis8cnbczww6zs93rw176vz07g4jx06418k53x2";
url="mirror://sourceforge/project/sbcl/sbcl/1.2.0/sbcl-1.2.0-source.tar.bz2";
sha256="13k20sys1v4lvgis8cnbczww6zs93rw176vz07g4jx06418k53x2";
{ stdenv, fetchurl, sbclBootstrap, clisp}:
stdenv.mkDerivation rec {
name = "sbcl-${version}";
version = "1.2.0";
src = fetchurl {
url = mirror://sourceforge/project/sbcl/sbcl/1.2.0/sbcl-1.2.0-source.tar.bz2;
sha256 = "13k20sys1v4lvgis8cnbczww6zs93rw176vz07g4jx06418k53x2";
};
buildInputs = with a; [
clisp makeWrapper
];
in
rec {
src = a.fetchUrlFromSrcInfo s;
inherit buildInputs;
configureFlags = [];
buildInputs = [ sbclBootstrap ] ++ stdenv.lib.optional stdenv.isLinux clisp;
/* doConfigure should be removed if not needed */
phaseNames = ["setVars" "doFixNewer" "doFixTests" "setVersion" "doPatch" "doBuild" "doInstall" "doWrap"];
setVars = a.fullDepEntry (''
export INSTALL_ROOT=$out
mkdir test-home
export HOME=$PWD/test-home
'') ["minInit"];
setVersion = a.fullDepEntry (''
echo '"${s.version}.nixos"' > version.lisp-expr
patchPhase = ''
echo '"${version}.nixos"' > version.lisp-expr
echo "
(lambda (features)
(flet ((enable (x)
@@ -38,14 +20,11 @@ rec {
(disable (x)
(setf features (remove x features))))
(enable :sb-thread))) " > customize-target-features.lisp
'') ["minInit" "doUnpack"];
/* SBCL checks whether files are up-to-date in many places.. Unfortunately, same timestamp
is not good enought
*/
doFixNewer = a.fullDepEntry(''
pwd
# SBCL checks whether files are up-to-date in many places..
# Unfortunately, same timestamp is not good enough
sed -e 's@> x y@>= x y@' -i contrib/sb-aclrepl/repl.lisp
sed -e '/(date)/i((= date 2208988801) 2208988800)' -i contrib/asdf/asdf.lisp
sed -i src/cold/slam.lisp -e \
@@ -56,13 +35,8 @@ rec {
'/date defaulted-fasl/a)'
sed -i src/code/target-load.lisp -e \
'/date defaulted-source/i(or (and (= 2208988801 (file-write-date defaulted-source-truename)) (= 2208988801 (file-write-date defaulted-fasl-truename)))'
'') ["minInit" "doUnpack"];
doWrap = a.fullDepEntry (''
wrapProgram "$out/bin/sbcl" --set "SBCL_HOME" "$out/lib/sbcl"
'') ["minInit" "addInputs"];
doFixTests = a.fullDepEntry (''
# Fix the tests
sed -e '/deftest pwent/inil' -i contrib/sb-posix/posix-tests.lisp
sed -e '/deftest grent/inil' -i contrib/sb-posix/posix-tests.lisp
sed -e '/deftest .*ent.non-existing/,+5d' -i contrib/sb-posix/posix-tests.lisp
@@ -70,24 +44,31 @@ rec {
sed -e '5,$d' -i contrib/sb-bsd-sockets/tests.lisp
sed -e '5,$d' -i contrib/sb-simple-streams/*test*.lisp
'') ["minInit" "doUnpack"];
'';
doBuild = a.fullDepEntry (''
sh make.sh clisp
'') ["minInit" "doUnpack" "addInputs"];
preBuild = ''
export INSTALL_ROOT=$out
ensureDir test-home
export HOME=$PWD/test-home
'';
doInstall = a.fullDepEntry (''
sh install.sh
'') ["doBuild" "minInit" "addInputs"];
buildPhase = if stdenv.isLinux
then ''
sh make.sh clisp --prefix=$out
''
else ''
sh make.sh --prefix=$out --xc-host='${sbclBootstrap}/bin/sbcl --core ${sbclBootstrap}/share/sbcl/sbcl.core --disable-debugger --no-userinit --no-sysinit'
'';
installPhase = ''
INSTALL_ROOT=$out sh install.sh
'';
inherit(s) name;
inherit(s) version;
meta = {
description = "Lisp compiler";
homepage = "http://www.sbcl.org";
license = "bsd";
maintainers = [a.lib.maintainers.raskin];
platforms = with a.lib.platforms; all;
inherit(s) version;
homepage = http://www.sbcl.org;
license = stdenv.lib.licenses.bsd3;
maintainers = [stdenv.lib.maintainers.raskin];
platforms = stdenv.lib.platforms.all;
};
}