* Sync with the trunk.

svn path=/nixpkgs/branches/modular-python/; revision=26678
This commit is contained in:
Eelco Dolstra
2011-04-04 13:36:05 +00:00
64 changed files with 2068 additions and 169 deletions

View File

@@ -21,28 +21,32 @@ options["g++"]="langCC"
options["fortran"]="langFortran"
options["java"]="langJava"
options["ada"]="langAda"
options["go"]="langGo"
cat > "$out"<<EOF
/* Automatically generated by \`$(basename $0)', do not edit.
For GCC ${version}. */
{ fetchurl, optional, version, langC, langCC, langFortran, langJava, langAda }:
{ fetchurl, optional, version, langC, langCC, langFortran, langJava, langAda,
langGo }:
assert version == "${version}";
EOF
for component in core g++ fortran java ada
for component in core g++ fortran java ada go
do
dir="ftp.gnu.org/gnu/gcc/gcc-${version}"
file="gcc-${component}-${version}.tar.bz2"
url="${dir}/${file}"
path_and_hash="$(nix-prefetch-url "$url" 2>&1 | grep -E '^(hash|path) is')"
path="$(echo $path_and_hash | sed -e's/^.*path is \([^ ]\+\).*$/\1/g')"
hash="$(echo $path_and_hash | sed -e's/^.*hash is \([^ ]\+\).*$/\1/g')"
rm -f "${file}"
rm -f "${url}.sig"
wget "$url"
hash="$(nix-hash --flat --type sha256 "$file")"
path="$(nix-store --add-fixed sha256 "$file")"
rm -f "${file}" "${file}.sig"
wget "${url}.sig"
gpg --verify "${file}.sig" "${path}"
gpg --verify "${file}.sig" "${path}" || gpg2 --verify "${file}.sig" "${path}"
rm "${file}.sig"
cat >> "$out" <<EOF

View File

@@ -0,0 +1,238 @@
source $stdenv/setup
export NIX_FIXINC_DUMMY=$NIX_BUILD_TOP/dummy
mkdir $NIX_FIXINC_DUMMY
# libstdc++ needs this; otherwise it will use /lib/cpp, which is a Bad
# Thing.
export CPP="gcc -E"
export CXXCPP="g++ -E"
if test "$staticCompiler" = "1"; then
EXTRA_LDFLAGS="-static"
else
EXTRA_LDFLAGS=""
fi
# GCC interprets empty paths as ".", which we don't want.
if test -z "$CPATH"; then unset CPATH; fi
if test -z "$LIBRARY_PATH"; then unset LIBRARY_PATH; fi
echo "\$CPATH is \`$CPATH'"
echo "\$LIBRARY_PATH is \`$LIBRARY_PATH'"
if test "$noSysDirs" = "1"; then
if test -e $NIX_GCC/nix-support/orig-libc; then
# Figure out what extra flags to pass to the gcc compilers
# being generated to make sure that they use our glibc.
extraFlags="$(cat $NIX_GCC/nix-support/libc-cflags)"
extraLDFlags="$(cat $NIX_GCC/nix-support/libc-ldflags) $(cat $NIX_GCC/nix-support/libc-ldflags-before)"
# Use *real* header files, otherwise a limits.h is generated
# that does not include Glibc's limits.h (notably missing
# SSIZE_MAX, which breaks the build).
export NIX_FIXINC_DUMMY=$(cat $NIX_GCC/nix-support/orig-libc)/include
# The path to the Glibc binaries such as `crti.o'.
glibc_libdir="$(cat $NIX_GCC/nix-support/orig-libc)/lib"
else
# Hack: support impure environments.
extraFlags="-isystem /usr/include"
extraLDFlags="-L/usr/lib64 -L/usr/lib"
glibc_libdir="/usr/lib"
export NIX_FIXINC_DUMMY=/usr/include
fi
extraFlags="-I$NIX_FIXINC_DUMMY $extraFlags"
extraLDFlags="-L$glibc_libdir -rpath $glibc_libdir $extraLDFlags"
EXTRA_FLAGS="$extraFlags"
for i in $extraLDFlags; do
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,$i"
done
if test -n "$targetConfig"; then
# Cross-compiling, we need gcc not to read ./specs in order to build
# the g++ compiler (after the specs for the cross-gcc are created).
# Having LIBRARY_PATH= makes gcc read the specs from ., and the build
# breaks. Having this variable comes from the default.nix code to bring
# gcj in.
unset LIBRARY_PATH
unset CPATH
if test -z "$crossStageStatic"; then
EXTRA_TARGET_CFLAGS="-B${libcCross}/lib -idirafter ${libcCross}/include"
EXTRA_TARGET_LDFLAGS="-Wl,-L${libcCross}/lib"
fi
else
if test -z "$NIX_GCC_CROSS"; then
EXTRA_TARGET_CFLAGS="$EXTRA_FLAGS"
EXTRA_TARGET_LDFLAGS="$EXTRA_LDFLAGS"
else
# This the case of cross-building the gcc.
# We need special flags for the target, different than those of the build
# Assertion:
test -e $NIX_GCC_CROSS/nix-support/orig-libc
# Figure out what extra flags to pass to the gcc compilers
# being generated to make sure that they use our glibc.
extraFlags="$(cat $NIX_GCC_CROSS/nix-support/libc-cflags)"
extraLDFlags="$(cat $NIX_GCC_CROSS/nix-support/libc-ldflags) $(cat $NIX_GCC_CROSS/nix-support/libc-ldflags-before)"
# Use *real* header files, otherwise a limits.h is generated
# that does not include Glibc's limits.h (notably missing
# SSIZE_MAX, which breaks the build).
NIX_FIXINC_DUMMY_CROSS=$(cat $NIX_GCC_CROSS/nix-support/orig-libc)/include
# The path to the Glibc binaries such as `crti.o'.
glibc_libdir="$(cat $NIX_GCC_CROSS/nix-support/orig-libc)/lib"
extraFlags="-I$NIX_FIXINC_DUMMY_CROSS $extraFlags"
extraLDFlags="-L$glibc_libdir -rpath $glibc_libdir $extraLDFlags"
EXTRA_TARGET_CFLAGS="$extraFlags"
for i in $extraLDFlags; do
EXTRA_TARGET_LDFLAGS="$EXTRA_TARGET_LDFLAGS -Wl,$i"
done
fi
fi
# CFLAGS_FOR_TARGET are needed for the libstdc++ configure script to find
# the startfiles.
# FLAGS_FOR_TARGET are needed for the target libraries to receive the -Bxxx
# for the startfiles.
makeFlagsArray=( \
"${makeFlagsArray[@]}" \
NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
CFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
CFLAGS_FOR_TARGET="$EXTRA_TARGET_CFLAGS $EXTRA_TARGET_LDFLAGS" \
FLAGS_FOR_TARGET="$EXTRA_TARGET_CFLAGS $EXTRA_TARGET_LDFLAGS" \
LDFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
LDFLAGS_FOR_TARGET="$EXTRA_TARGET_LDFLAGS $EXTRA_TARGET_LDFLAGS" \
)
if test -z "$targetConfig"; then
makeFlagsArray=( \
"${makeFlagsArray[@]}" \
BOOT_CFLAGS="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
BOOT_LDFLAGS="$EXTRA_TARGET_CFLAGS $EXTRA_TARGET_LDFLAGS" \
)
fi
if test -n "$targetConfig" -a "$crossStageStatic" == 1; then
# We don't want the gcc build to assume there will be a libc providing
# limits.h in this stagae
makeFlagsArray=( \
"${makeFlagsArray[@]}" \
LIMITS_H_TEST=false \
)
else
makeFlagsArray=( \
"${makeFlagsArray[@]}" \
LIMITS_H_TEST=true \
)
fi
fi
if test -n "$targetConfig"; then
# The host strip will destroy some important details of the objects
dontStrip=1
fi
preConfigure() {
if test -n "$newlibSrc"; then
tar xvf "$newlibSrc" -C ..
ln -s ../newlib-*/newlib newlib
# Patch to get armvt5el working:
sed -i -e 's/ arm)/ arm*)/' newlib/configure.host
fi
# Bug - they packaged zlib
if test -d "zlib"; then
# This breaks the build without-headers, which should build only
# the target libgcc as target libraries.
# See 'configure:5370'
rm -Rf zlib
fi
# Patch the configure script so it finds glibc headers
# It's important for example in order not to get libssp built, because it's
# functionality is in glibc already.
glibc_headers="$(cat $NIX_GCC/nix-support/orig-libc)/include"
sed -i \
-e s,glibc_header_dir=/usr/include,glibc_header_dir=$glibc_headers, \
gcc/configure
if test -n "$crossMingw" -a -n "$crossStageStatic"; then
mkdir -p ../mingw
# --with-build-sysroot expects that:
cp -R $libcCross/include ../mingw
configureFlags="$configureFlags --with-build-sysroot=`pwd`/.."
fi
# Perform the build in a different directory.
mkdir ../build
cd ../build
configureScript=../$sourceRoot/configure
}
postConfigure() {
# Don't store the configure flags in the resulting executables.
sed -e '/TOPLEVEL_CONFIGURE_ARGUMENTS=/d' -i Makefile
}
postInstall() {
# Remove precompiled headers for now. They are very big and
# probably not very useful yet.
find $out/include -name "*.gch" -exec rm -rf {} \; -prune
# Remove `fixincl' to prevent a retained dependency on the
# previous gcc.
rm -rf $out/libexec/gcc/*/*/install-tools
rm -rf $out/lib/gcc/*/*/install-tools
# More dependencies with the previous gcc or some libs (gccbug stores the build command line)
rm -rf $out/bin/gccbug
# Take out the bootstrap-tools from the rpath, as it's not needed at all having $out
for i in $out/libexec/gcc/*/*/*; do
if PREV_RPATH=`patchelf --print-rpath $i`; then
patchelf --set-rpath `echo $PREV_RPATH | sed 's,:[^:]*bootstrap-tools/lib,,'` $i
fi
done
# Get rid of some "fixed" header files
rm -rf $out/lib/gcc/*/*/include/root
# Replace hard links for i686-pc-linux-gnu-gcc etc. with symlinks.
for i in $out/bin/*-gcc*; do
if cmp -s $out/bin/gcc $i; then
ln -sfn gcc $i
fi
done
for i in $out/bin/c++ $out/bin/*-c++* $out/bin/*-g++*; do
if cmp -s $out/bin/g++ $i; then
ln -sfn g++ $i
fi
done
eval "$postInstallGhdl"
}
if test -z "$targetConfig" && test -z "$crossConfig"; then
if test -z "$profiledCompiler"; then
buildFlags="bootstrap $buildFlags"
else
buildFlags="profiledbootstrap $buildFlags"
fi
fi
genericBuild

View File

@@ -0,0 +1,450 @@
{ stdenv, fetchurl, noSysDirs
, langC ? true, langCC ? true, langFortran ? false, langTreelang ? false
, 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, mpc, gettext, which
, libelf # optional, for link-time optimizations (LTO)
, ppl ? null, cloogppl ? null, cloog ? null # optional, for the Graphite optimization framework. Cannot pass both cloog and cloogppl
, bison ? null, flex ? null
, zlib ? null, boehmgc ? null
, zip ? null, unzip ? null, pkgconfig ? null, gtk ? 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
, gnatboot ? null
, enableMultilib ? false
, name ? "gcc"
, cross ? null
, binutilsCross ? null
, libcCross ? null
, crossStageStatic ? true
, gnat ? null
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
, stripped ? true
}:
assert langTreelang -> bison != 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;
# Cannot use both cloog and cloog-ppl
assert cloog != null -> cloogppl == null;
with stdenv.lib;
with builtins;
let version = "4.6.0";
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-3.1.3.jar;
sha256 = "1f41j0y4kjydl71lqlvr73yagrs2jsg1fjymzjz66mjy7al5lh09";
};
xlibs = [
libX11 libXt libSM libICE libXtst libXrender libXrandr libXi
xproto renderproto xextproto inputproto randrproto
];
javaAwtGtk = langJava && gtk != null;
/* Cross-gcc settings */
gccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null cross;
gccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null cross;
gccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null cross;
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 "";
crossMingw = (cross != null && cross.libc == "msvcrt");
crossConfigureFlags =
"--target=${cross.config}" +
withArch +
withCpu +
withAbi +
(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-libmudflap " +
" --disable-libgomp " +
" --disable-libquadmath" +
" --disable-shared" +
" --disable-decimal-float" # libdecnumber requires libc
else
" --with-headers=${libcCross}/include" +
" --enable-__cxa_atexit" +
" --enable-long-long" +
(if crossMingw then
" --enable-threads=win32" +
" --enable-sjlj-exceptions" +
" --enable-hash-synchronization" +
" --enable-version-specific-runtime-libs" +
" --disable-libssp" +
" --disable-nls" +
" --with-dwarf2"
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 "";
in
# We need all these X libraries when building AWT with GTK+.
assert gtk != null -> (filter (x: x == null) xlibs) == [];
stdenv.mkDerivation ({
name = "${name}-${version}" + crossNameAddon;
builder = ./builder.sh;
src = (import ./sources.nix) {
inherit fetchurl optional version;
inherit langC langCC langFortran langJava langAda langGo;
};
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 langVhdl ./ghdl-ortho-cflags.patch
;
postPatch =
if (stdenv.system == "i586-pc-gnu"
|| (cross != null && cross.config == "i586-pc-gnu"
&& 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.
let
libc = if cross != null then libcCross else stdenv.glibc;
gnu_h = "gcc/config/gnu.h";
i386_gnu_h = "gcc/config/i386/gnu.h";
extraCPPDeps =
libc.propagatedBuildInputs
++ stdenv.lib.optional (libpthreadCross != null) libpthreadCross
++ stdenv.lib.optional (libpthread != null) libpthread;
extraCPPSpec =
concatStrings (intersperse " "
(map (x: "-I${x}/include") extraCPPDeps));
extraLibSpec =
if libpthreadCross != null
then "-L${libpthreadCross}/lib ${libpthreadCross.TARGET_LDFLAGS}"
else "-L${libpthread}/lib";
in
'' echo "augmenting \`CPP_SPEC' in \`${i386_gnu_h}' with \`${extraCPPSpec}'..."
sed -i "${i386_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'
''
else if cross != null || stdenv.gcc.libc != null then
# On NixOS, use the right path to the dynamic linker instead of
# `/lib/ld*.so'.
let
libc = if (cross != null && libcCross != null) then libcCross else stdenv.gcc.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}\3"|g'
done
''
else null;
inherit noSysDirs profiledCompiler staticCompiler langJava crossStageStatic
libcCross crossMingw;
buildNativeInputs = [ texinfo which ]
++ optional (perl != null) perl;
buildInputs = [ gmp mpfr mpc libelf gettext ]
++ (optional (ppl != null) ppl)
++ (optional (cloogppl != null) cloogppl)
++ (optional (cloog != null) cloog)
++ (optionals langTreelang [bison flex])
++ (optional (zlib != null) zlib)
++ (optional (boehmgc != null) boehmgc)
++ (optionals langJava [zip unzip])
++ (optionals javaAwtGtk [gtk pkgconfig libart_lgpl] ++ xlibs)
++ (optionals (cross != null) [binutilsCross])
++ (optionals langAda [gnatboot])
++ (optionals langVhdl [gnat])
;
configureFlagsArray = stdenv.lib.optionals
(ppl != null && ppl.dontDisableStatic == true)
[ "--with-host-libstdcxx=-lstdc++ -lgcc_s"
"--with-stage1-libs=-lstdc++ -lgcc_s" ];
configureFlags = "
${if enableMultilib then "" else "--disable-multilib"}
${if enableShared then "" else "--disable-shared"}
${if ppl != null then "--with-ppl=${ppl}" else ""}
${if cloogppl != null then "--with-cloog=${cloogppl}" else ""}
${if cloog != null then
"--with-cloog=${cloog} --enable-cloog-backend=isl"
else ""}
${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=${gmp}
--with-mpfr=${mpfr}
--with-mpc=${mpc}
${if (libelf != null) then "--with-libelf=${libelf}" else ""}
--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 langTreelang "treelang"
++ optional langAda "ada"
++ optional langVhdl "vhdl"
++ optional langGo "go"
)
)
}
${ # Trick that should be taken out once we have a mips64-linux not loongson2f
if cross == null && stdenv.system == "mips64-linux" then "--with-arch=loongson2f" else ""}
${if langAda then " --enable-libada" else ""}
${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""}
${if cross != null then crossConfigureFlags else ""}
";
targetConfig = if (cross != null) then cross.config else null;
installTargets =
if stripped
then "install-strip"
else "install";
crossAttrs = {
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_GCC_CROSS = if cross == null then "${stdenv.gccCross}" else "";
dontStrip = true;
configureFlags = ''
${if enableMultilib then "" else "--disable-multilib"}
${if enableShared then "" else "--disable-shared"}
${if ppl != null then "--with-ppl=${ppl.hostDrv}" else ""}
${if cloogppl != null then "--with-cloog=${cloogppl.hostDrv}" else ""}
${if cloog != null then "--with-cloog=${cloog.hostDrv} --enable-cloog-backend=isl" else ""}
${if langJava then "--with-ecj-jar=${javaEcj.hostDrv}" else ""}
${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.hostDrv}" else ""}
--with-gmp=${gmp.hostDrv}
--with-mpfr=${mpfr.hostDrv}
--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 langTreelang "treelang"
++ optional langAda "ada"
++ optional langVhdl "vhdl"
++ optional langGo "go"
)
)
}
${if langAda then " --enable-libada" else ""}
${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""}
${if cross != null then crossConfigureFlags else ""}
--target=${stdenv.cross.config}
'';
};
# Needed for the cross compilation to work
AR = "ar";
LD = "ld";
CC = "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 = concatStrings
(intersperse ":" (map (x: x + "/include")
(optionals (zlib != null) [ zlib ]
++ optionals 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 &&
hasAttr "propagatedBuildInputs" libcCross)
libcCross.propagatedBuildInputs)));
LIBRARY_PATH = concatStrings
(intersperse ":" (map (x: x + "/lib")
(optionals (zlib != null) [ zlib ]
++ optionals langJava [ boehmgc ]
++ optionals javaAwtGtk xlibs
++ optionals javaAwtGtk [ gmp mpfr ]
++ optional (libpthread != null) libpthread)));
EXTRA_TARGET_CFLAGS =
if cross != null && libcCross != null
then "-idirafter ${libcCross}/include"
else null;
EXTRA_TARGET_LDFLAGS =
if cross != null && libcCross != null
then "-B${libcCross}/lib -Wl,-L${libcCross}/lib" +
(optionalString (libpthreadCross != null)
" -L${libpthreadCross}/lib -Wl,${libpthreadCross.TARGET_LDFLAGS}")
else null;
passthru = { inherit langC langCC langAda langFortran langTreelang langVhdl
langGo enableMultilib version; };
enableParallelBuilding = true;
meta = {
homepage = http://gcc.gnu.org/;
license = "GPLv3+"; # 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 = [
stdenv.lib.maintainers.ludo
stdenv.lib.maintainers.viric
stdenv.lib.maintainers.shlevy
];
# Volunteers needed for the {Cyg,Dar}win ports of *PPL.
# gnatboot is not available out of linux platforms, so we disable the darwin build
# for the gnat (ada compiler).
platforms = stdenv.lib.platforms.linux ++ optionals (langAda == false) [ "i686-darwin" ];
};
}
// optionalAttrs (cross != null && cross.libc == "msvcrt" && crossStageStatic) {
makeFlags = [ "all-gcc" "all-target-libgcc" ];
installTargets = "install-gcc install-target-libgcc";
}
// optionalAttrs (!stripped) { dontStrip = true; NIX_STRIP_DEBUG = false; }
// optionalAttrs langVhdl rec {
name = "ghdl-0.29";
ghdlSrc = fetchurl {
url = "http://ghdl.free.fr/ghdl-0.29.tar.bz2";
sha256 = "15mlinr1lwljwll9ampzcfcrk9bk0qpdks1kxlvb70xf9zhh2jva";
};
# Ghdl has some timestamps checks, storing file timestamps in '.cf' files.
# As we will change the timestamps to 1970-01-01 00:00:01, we also set the
# content of that .cf to that value. This way ghdl does not complain on
# the installed object files from the basic libraries (ieee, ...)
postInstallGhdl = ''
pushd $out
find . -name "*.cf" -exec \
sed 's/[0-9]*\.000" /19700101000001.000" /g' -i {} \;
popd
'';
postUnpack = ''
tar xvf ${ghdlSrc}
mv ghdl-*/vhdl gcc*/gcc
rm -Rf ghdl-*
'';
meta = {
homepage = "http://ghdl.free.fr/";
license = "GPLv2+";
description = "Complete VHDL simulator, using the GCC technology (gcc ${version})";
maintainers = with stdenv.lib.maintainers; [viric];
platforms = with stdenv.lib.platforms; linux;
};
})

View File

@@ -0,0 +1,111 @@
diff --git a/gcc/vhdl/Make-lang.in b/gcc/vhdl/Make-lang.in
index 8f481df..681ac59 100644
--- a/gcc/vhdl/Make-lang.in
+++ b/gcc/vhdl/Make-lang.in
@@ -96,7 +96,7 @@ AGCC_GCCOBJ_DIR=../
AGCC_INC_FLAGS=-I$(AGCC_GCCOBJ_DIR)/gcc -I$(AGCC_GCCSRC_DIR)/include \
-I$(AGCC_GCCSRC_DIR)/gcc -I$(AGCC_GCCSRC_DIR)/gcc/config \
-I$(AGCC_GCCSRC_DIR)/libcpp/include
-AGCC_CFLAGS=-g -Wall -DIN_GCC $(AGCC_INC_FLAGS)
+AGCC_CFLAGS=-g -Wall -DIN_GCC $(AGCC_INC_FLAGS) $(CFLAGS) $(INCLUDES)
AGCC_LOCAL_OBJS=ortho-lang.o
@@ -140,7 +140,7 @@ ghdl$(exeext): force
# Ghdl libraries.
ghdllib: ghdl$(exeext) $(GCC_PASSES) force
- $(MAKE_IN_VHDL) GRT_FLAGS="-O -g" ghdllib
+ $(MAKE_IN_VHDL) GRT_FLAGS="-O -g $(CFLAGS)" ghdllib
# Build hooks:
diff --git a/gcc/vhdl/Makefile.in b/gcc/vhdl/Makefile.in
index d754c6c..07abc4a 100644
--- a/gcc/vhdl/Makefile.in
+++ b/gcc/vhdl/Makefile.in
@@ -80,7 +80,8 @@ T_CPPFLAGS =
X_ADAFLAGS =
T_ADAFLAGS =
-ADAC = $(CC)
+# Never use the bootstrapped compiler, as it may not be built for ada
+ADAC = gcc
ECHO = echo
CHMOD = chmod
diff --git a/gcc/vhdl/ortho-lang.c b/gcc/vhdl/ortho-lang.c
index 84aeb92..8eddd42 100644
--- a/gcc/vhdl/ortho-lang.c
+++ b/gcc/vhdl/ortho-lang.c
@@ -16,6 +16,7 @@
#include "options.h"
#include "real.h"
-#include "tree-gimple.h"
+#include "gimple.h"
+#include "tree.h"
#include "function.h"
#include "cgraph.h"
#include "target.h"
@@ -680,38 +681,10 @@ type_for_mode (enum machine_mode mode, int unsignedp)
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
-/* Tree code classes. */
-
-#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
-
-const enum tree_code_class tree_code_type[] = {
-#include "tree.def"
- 'x'
-};
-#undef DEFTREECODE
-
-/* Table indexed by tree code giving number of expression
- operands beyond the fixed part of the node structure.
- Not used for types or decls. */
-
-#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
-
-const unsigned char tree_code_length[] = {
-#include "tree.def"
- 0
-};
-#undef DEFTREECODE
-
-#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) NAME,
-const char * const tree_code_name[] = {
-#include "tree.def"
- "@@dummy"
-};
-#undef DEFTREECODE
union lang_tree_node
GTY((desc ("0"),
- chain_next ("(union lang_tree_node *) GENERIC_NEXT (&%h.generic)")))
+ chain_next ("(union lang_tree_node *) TREE_CHAIN (&%h.generic)")))
{
union tree_node GTY ((tag ("0"))) generic;
};
@@ -1162,7 +1135,7 @@ new_access_type (tree dtype)
res = make_node (POINTER_TYPE);
TREE_TYPE (res) = NULL_TREE;
/* Seems necessary. */
- TYPE_MODE (res) = Pmode;
+ SET_TYPE_MODE (res, Pmode);
layout_type (res);
return res;
}
diff --git a/gcc/vhdl/Make-lang.in b/gcc/vhdl/Make-lang.in
index e201f64..f36fb97 100644
--- a/gcc/vhdl/Make-lang.in
+++ b/gcc/vhdl/Make-lang.in
@@ -132,7 +132,7 @@ ghdl1$(exeext): $(AGCC_OBJS) $(AGCC_DEPS) force
-cargs $(CFLAGS) $(GHDL_ADAFLAGS)
$(GNATMAKE) -o $@ -aI$(srcdir)/vhdl -aOvhdl ortho_gcc-main \
-bargs -E -cargs $(CFLAGS) $(GHDL_ADAFLAGS) \
- -largs $(AGCC_OBJS) $(LIBS) $(GMPLIBS)
+ -largs $(AGCC_OBJS) $(LIBS) $(GMPLIBS) $(CLOOGLIBS) $(PPLLIBS)
# The driver for ghdl.
ghdl$(exeext): force

View File

@@ -0,0 +1,33 @@
diff --git a/libada/Makefile.in b/libada/Makefile.in
index f5057a0..337e0c6 100644
--- a/libada/Makefile.in
+++ b/libada/Makefile.in
@@ -55,7 +55,7 @@ GCC_WARN_CFLAGS = $(LOOSE_WARN)
WARN_CFLAGS = @warn_cflags@
TARGET_LIBGCC2_CFLAGS=
-GNATLIBCFLAGS= -g -O2
+GNATLIBCFLAGS= -g -O2 $(CFLAGS)
GNATLIBCFLAGS_FOR_C = $(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) -fexceptions \
-DIN_RTS @have_getipinfo@
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -105,7 +105,7 @@ ADAFLAGS = -W -Wall -gnatpg -gnata
SOME_ADAFLAGS =-gnata
FORCE_DEBUG_ADAFLAGS = -g
GNATLIBFLAGS = -gnatpg -nostdinc
-GNATLIBCFLAGS = -g -O2
+GNATLIBCFLAGS = -g -O2 $(CFLAGS_FOR_TARGET)
# Pretend that _Unwind_GetIPInfo is available for the target by default. This
# should be autodetected during the configuration of libada and passed down to
# here, but we need something for --disable-libada and hope for the best.
@@ -193,7 +193,7 @@ RTSDIR = rts$(subst /,_,$(MULTISUBDIR))
# Link flags used to build gnat tools. By default we prefer to statically
# link with libgcc to avoid a dependency on shared libgcc (which is tricky
# to deal with as it may conflict with the libgcc provided by the system).
-GCC_LINK_FLAGS=-static-libgcc
+GCC_LINK_FLAGS=-static-libgcc $(CFLAGS_FOR_TARGET)
# End of variables for you to override.

View File

@@ -0,0 +1,17 @@
The `jvgenmain' executable must be linked against `vec.o', among others,
since it uses its vector API.
--- gcc-4.3.3/gcc/java/Make-lang.in 2008-12-05 00:00:19.000000000 +0100
+++ gcc-4.3.3/gcc/java/Make-lang.in 2009-07-03 16:11:41.000000000 +0200
@@ -109,9 +109,9 @@ jcf-dump$(exeext): $(JCFDUMP_OBJS) $(LIB
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JCFDUMP_OBJS) \
$(CPPLIBS) $(ZLIB) $(LDEXP_LIB) $(LIBS)
-jvgenmain$(exeext): $(JVGENMAIN_OBJS) $(LIBDEPS)
+jvgenmain$(exeext): $(JVGENMAIN_OBJS) $(LIBDEPS) $(BUILD_RTL)
rm -f $@
- $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JVGENMAIN_OBJS) $(LIBS)
+ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JVGENMAIN_OBJS) $(BUILD_RTL) $(LIBS)
#
# Build hooks:

View File

@@ -0,0 +1,32 @@
Patch to make the target libraries 'configure' scripts find the proper CPP.
I noticed that building the mingw32 cross compiler.
Looking at the build script for mingw in archlinux, I think that only nixos
needs this patch. I don't know why.
diff --git a/Makefile.in b/Makefile.in
index 93f66b6..d691917 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -266,6 +266,7 @@ BASE_TARGET_EXPORTS = \
AR="$(AR_FOR_TARGET)"; export AR; \
AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \
CC="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \
+ CPP="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS -E"; export CC; \
CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \
@@ -291,11 +292,13 @@ BASE_TARGET_EXPORTS = \
RAW_CXX_TARGET_EXPORTS = \
$(BASE_TARGET_EXPORTS) \
CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
- CXX="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX;
+ CXX="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; \
+ CXXCPP="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS -E"; export CXX;
NORMAL_TARGET_EXPORTS = \
$(BASE_TARGET_EXPORTS) \
- CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX;
+ CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX; \
+ CXXCPP="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS -E"; export CXX;
# Where to find GMP
HOST_GMPLIBS = @gmplibs@

View File

@@ -0,0 +1,54 @@
diff -ru gcc-4.3.1-orig/gcc/cppdefault.c gcc-4.3.1/gcc/cppdefault.c
--- gcc-4.3.1-orig/gcc/cppdefault.c 2007-07-26 10:37:01.000000000 +0200
+++ gcc-4.3.1/gcc/cppdefault.c 2008-06-25 17:48:23.000000000 +0200
@@ -41,6 +41,10 @@
# undef CROSS_INCLUDE_DIR
#endif
+#undef LOCAL_INCLUDE_DIR
+#undef SYSTEM_INCLUDE_DIR
+#undef STANDARD_INCLUDE_DIR
+
const struct default_include cpp_include_defaults[]
#ifdef INCLUDE_DEFAULTS
= INCLUDE_DEFAULTS;
diff -ru gcc-4.3.1-orig/gcc/gcc.c gcc-4.3.1/gcc/gcc.c
--- gcc-4.3.1-orig/gcc/gcc.c 2008-03-02 23:55:19.000000000 +0100
+++ gcc-4.3.1/gcc/gcc.c 2008-06-25 17:52:53.000000000 +0200
@@ -1478,10 +1478,10 @@
/* Default prefixes to attach to command names. */
#ifndef STANDARD_STARTFILE_PREFIX_1
-#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
+#define STANDARD_STARTFILE_PREFIX_1 ""
#endif
#ifndef STANDARD_STARTFILE_PREFIX_2
-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
+#define STANDARD_STARTFILE_PREFIX_2 ""
#endif
#ifdef CROSS_DIRECTORY_STRUCTURE /* Don't use these prefixes for a cross compiler. */
--- gcc-4.3.1-orig/gcc/Makefile.in 2008-05-11 20:54:15.000000000 +0200
+++ gcc-4.3.1/gcc/Makefile.in 2008-06-25 17:48:23.000000000 +0200
@@ -378,7 +378,11 @@
MD5_H = $(srcdir)/../include/md5.h
# Default native SYSTEM_HEADER_DIR, to be overridden by targets.
-NATIVE_SYSTEM_HEADER_DIR = /usr/include
+# Nix: we override NATIVE_SYSTEM_HEADER_DIR in order to prevent
+# `fixinc' from fixing header files in /usr/include. However,
+# NATIVE_SYSTEM_HEADER_DIR must point to an existing directory, so set
+# it to some dummy directory.
+NATIVE_SYSTEM_HEADER_DIR = $(NIX_FIXINC_DUMMY)
# Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
@@ -3277,7 +3281,7 @@
-DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
-DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
-DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
- -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
+ -DLOCAL_INCLUDE_DIR=\"/no-such-dir\" \
-DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
-DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
-DPREFIX=\"$(prefix)/\" \

View File

@@ -0,0 +1,31 @@
/* Automatically generated by `update-gcc.sh', do not edit.
For GCC 4.6.0. */
{ fetchurl, optional, version, langC, langCC, langFortran, langJava, langAda,
langGo }:
assert version == "4.6.0";
optional /* langC */ true (fetchurl {
url = "mirror://gcc/releases/gcc-${version}/gcc-core-${version}.tar.bz2";
sha256 = "353191576de3720a643026262a5d198a7f2cf956b0e608a953571a0dcdb0cfc1";
}) ++
optional langCC (fetchurl {
url = "mirror://gcc/releases/gcc-${version}/gcc-g++-${version}.tar.bz2";
sha256 = "c2e92fedde203bfd5c7af3e0736a537d166011601f09781f300ed8c07cdb453d";
}) ++
optional langFortran (fetchurl {
url = "mirror://gcc/releases/gcc-${version}/gcc-fortran-${version}.tar.bz2";
sha256 = "5612bb192b9b28537e043749d4080d7f56b3d68355d36bf0059f7d25432009ac";
}) ++
optional langJava (fetchurl {
url = "mirror://gcc/releases/gcc-${version}/gcc-java-${version}.tar.bz2";
sha256 = "6dd153b17cb48d7f68cd91415d5df0ea59c091919e73c6639d63bcbe69e2c897";
}) ++
optional langAda (fetchurl {
url = "mirror://gcc/releases/gcc-${version}/gcc-ada-${version}.tar.bz2";
sha256 = "35a01ee245b06d2525205679be8187a154e546e85e166a0474edef6e8b3d40fc";
}) ++
optional langGo (fetchurl {
url = "mirror://gcc/releases/gcc-${version}/gcc-go-${version}.tar.bz2";
sha256 = "40fd5aef37a87ed1ebd1c4ae357bfae76c7351185be8dc79dbafe2b516ef9e35";
}) ++
[]

View File

@@ -0,0 +1 @@
../gcc-4.4/update-gcc.sh

View File

@@ -0,0 +1,43 @@
{stdenv, fetchurl, ghc, perl, gmp, ncurses, darwinInstallNameToolUtility}:
stdenv.mkDerivation rec {
version = "7.0.3";
name = "ghc-${version}";
src = fetchurl {
url = "http://haskell.org/ghc/dist/${version}/${name}-src.tar.bz2";
sha256 = "1nfc2c6bdcdfg3f3d9q5v109jrrwhz6by3qa4qi7k0xbip16jq8m";
};
buildInputs = [ghc perl gmp ncurses] ++
(if stdenv.isDarwin then [darwinInstallNameToolUtility] else []);
buildMK = ''
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp}/lib"
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp}/include"
'';
preConfigure = ''
echo "${buildMK}" > mk/build.mk
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
'';
configureFlags=[
"--with-gcc=${stdenv.gcc}/bin/gcc"
];
# required, because otherwise all symbols from HSffi.o are stripped, and
# that in turn causes GHCi to abort
stripDebugFlags=["-S" "--keep-file-symbols"];
meta = {
homepage = "http://haskell.org/ghc";
description = "The Glasgow Haskell Compiler";
maintainers = [
stdenv.lib.maintainers.marcweber
stdenv.lib.maintainers.andres
];
platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
};
}

View File

@@ -0,0 +1,76 @@
{ fetchurl, stdenv, gmp, isl, static ? false }:
let
staticFlags =
assert static -> isl.dontDisableStatic == true;
if static then "--enable-static --disable-shared" else "";
in
stdenv.mkDerivation rec {
name = "cloog-0.16.2";
src = fetchurl {
url = "http://www.bastoul.net/cloog/pages/download/count.php3?url=./${name}.tar.gz";
sha256 = "1w9n9lsq18k65fywwbbvhkgl917053w1kvqw0xhlwcma0v59m6mx";
};
buildInputs = [ gmp ];
propagatedBuildInputs = [ isl ];
configureFlags = "--with-isl=system --with-isl-prefix=${isl}" + staticFlags;
dontDisableStatic = if static then true else false;
crossAttrs = {
configureFlags = "--with-isl=system --with-isl-prefix=${isl.hostDrv}" + staticFlags;
};
doCheck = true;
meta = {
description = "CLooG, the Chunky Loop Generator";
longDescription = ''
CLooG is a free software library to generate code for scanning
Z-polyhedra. That is, it finds a code (e.g., in C, FORTRAN...) that
reaches each integral point of one or more parameterized polyhedra.
CLooG has been originally written to solve the code generation problem
for optimizing compilers based on the polytope model. Nevertheless it
is used now in various area e.g., to build control automata for
high-level synthesis or to find the best polynomial approximation of a
function. CLooG may help in any situation where scanning polyhedra
matters. While the user has full control on generated code quality,
CLooG is designed to avoid control overhead and to produce a very
effective code.
'';
homepage = http://www.cloog.org/;
license = "GPLv2+";
maintainers = [ stdenv.lib.maintainers.shlevy ];
/* Leads to an ICE on Cygwin:
make[3]: Entering directory `/tmp/nix-build-9q5gw5m37q5l4f0kjfv9ar8fsc9plk27-ppl-0.10.2.drv-1/ppl-0.10.2/src'
/bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I.. -I../src -g -O2 -frounding-math -W -Wall -c -o Box.lo Box.cc
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I.. -I../src -g -O2 -frounding-math -W -Wall -c Box.cc -DDLL_EXPORT -DPIC -o .libs/Box.o
In file included from checked.defs.hh:595,
from Checked_Number.defs.hh:27,
from Coefficient.types.hh:15,
from Coefficient.defs.hh:26,
from Box.defs.hh:28,
from Box.cc:24:
checked.inlines.hh: In function `Parma_Polyhedra_Library::Result Parma_Polyhedra_Library::Checked::input_generic(Type&, std::istream&, Parma_Polyhedra_Library::Rounding_Dir)':
checked.inlines.hh:607: internal compiler error: in invert_truthvalue, at fold-const.c:2719
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://cygwin.com/problems.html> for instructions.
make[3]: *** [Box.lo] Error 1
*/
platforms = stdenv.lib.platforms.allBut "i686-cygwin";
};
}

View File

@@ -0,0 +1,13 @@
{cabal}:
cabal.mkDerivation (self : {
pname = "OneTuple";
version = "0.2.1";
sha256 = "1x52b68zh3k9lnps5s87kzan7dzvqp6mrwgayjq15w9dv6v78vsb";
meta = {
description = "Singleton Tuple";
license = "BSD";
maintainers = [self.stdenv.lib.maintainers.andres];
};
})

View File

@@ -0,0 +1,12 @@
{cabal}:
cabal.mkDerivation (self : {
pname = "PSQueue";
version = "1.1";
sha256 = "1k291bh8j5vpcrn6vycww2blwg7jxx9yrfmrqdanz48gs4d8gq58";
meta = {
description = "Priority Search Queue implementation for Haskell";
license = "BSD";
};
})

View File

@@ -0,0 +1,12 @@
{cabal}:
cabal.mkDerivation (self : {
pname = "attoparsec";
version = "0.8.5.0";
sha256 = "0rdhjqgbbasc1diqzjdb6a8s46kcpdw5yxq2vkg3y2z71zln0a31";
meta = {
description = "Fast combinator parsing for bytestrings";
license = "BSD3";
};
})

View File

@@ -0,0 +1,13 @@
{cabal, attoparsec, enumerator}:
cabal.mkDerivation (self : {
pname = "attoparsec-enumerator";
version = "0.2.0.3";
sha256 = "02v9cwq1jbn0179zd2cky4ix6ykrkd7cpw38c1x7zgy0pal42x4v";
propagatedBuildInputs = [attoparsec enumerator];
meta = {
description = "Converts an Attoparsec parser into an iteratee";
license = "BSD3";
};
})

View File

@@ -0,0 +1,12 @@
{cabal, blazeBuilder, enumerator, transformers}:
cabal.mkDerivation (self : {
pname = "blaze-builder-enumerator";
version = "0.2.0.2";
sha256 = "0as4mjh695jpxp9qfhpsxyr1448l0pk94sh5kk8sgxv5hfiy41k9";
propagatedBuildInputs = [blazeBuilder enumerator transformers];
meta = {
description = "Enumeratees for the incremental conversion of builders to bytestrings";
license = "BSD3";
};
})

View File

@@ -0,0 +1,12 @@
{cabal}:
cabal.mkDerivation (self : {
pname = "bytestring-nums";
version = "0.3.2";
sha256 = "16d99xm692x88vx27w4g6iqi4sbi9il8c10r1zaqq2hqviv0k1wg";
meta = {
description = "Parse numeric literals from ByteStrings";
license = "BSD3";
};
})

View File

@@ -1,12 +0,0 @@
{cabal}:
cabal.mkDerivation (self : {
pname = "bytestring";
version = "0.9.1.4";
name = self.fname;
sha256 = "00x620zkxhlmdxmb2icrq3a2wc6jichng6mn33xr2gsw102973xz";
extraBuildInputs = [];
meta = {
description = "A time and space-efficient implementation of byte vectors using packed Word8 arrays [..]";
};
})

View File

@@ -0,0 +1,12 @@
{cabal}:
cabal.mkDerivation (self : {
pname = "directory-tree";
version = "0.10.0";
sha256 = "08b0w9j55x6c06pri7yvv84n24inhpb4miybdnkyjkjy7r3yy7m4";
meta = {
description = "A simple directory-like tree datatype, with useful IO functions";
license = "BSD3";
};
})

View File

@@ -0,0 +1,13 @@
{cabal, text, transformers}:
cabal.mkDerivation (self : {
pname = "enumerator";
version = "0.4.9.1";
sha256 = "1rnhapj5am1rv3dff2bkhch7ikpyhs18nay39h0805xl50dcyw99";
propagatedBuildInputs = [text transformers];
meta = {
description = "Reliable, high-performance processing with left-fold enumerators";
license = "MIT";
};
})

View File

@@ -1,12 +1,14 @@
{cabal, binary, blazeHtml, hamlet, mtl, network, pandoc, regexBase,
regexTDFA}:
{cabal, binary, blazeHtml, hamlet, hopenssl, mtl, network, pandoc, regexBase
, regexPCRE, snapCore, snapServer, strictConcurrency}:
cabal.mkDerivation (self : {
pname = "hakyll";
version = "2.4.3";
sha256 = "1n1hibwhg22l9p126d10zwhvaab46svcri2rkvd78f4vhmwpvkbs";
version = "3.0.2.0";
sha256 = "0d1kmvkbwygr9mxz7m8jiasrbj470j4hwsj8mmkdgdm9clxbi74k";
propagatedBuildInputs =
[binary blazeHtml hamlet mtl network pandoc regexBase regexTDFA];
[ binary blazeHtml hamlet hopenssl mtl network pandoc regexBase
regexPCRE snapCore snapServer strictConcurrency
];
meta = {
description = "A simple static site generator library";
license = "BSD";

View File

@@ -1,11 +1,11 @@
{cabal, blazeBuilder, failure, parsec, text}:
{cabal, blazeBuilder, blazeHtml, failure, parsec, text, jsonEnumerator, jsonTypes}:
cabal.mkDerivation (self : {
pname = "hamlet";
version = "0.6.1.2";
sha256 = "0aqrjdbqb99nz3snnsrgkd6bnaj1m3bdm8kj9agd3qgv8lv90knn";
version = "0.7.3";
sha256 = "1knapi8506kqm6pbl1qdr3vm579z2dn6q3h3ahzwbxqjafy7pnj9";
propagatedBuildInputs =
[blazeBuilder failure parsec text];
[blazeBuilder blazeHtml failure parsec text jsonEnumerator jsonTypes];
meta = {
description = "Haml-like template files that are compile-time checked";
license = "BSD";

View File

@@ -0,0 +1,32 @@
{cabal, fetchurl, GLUT, HTTP, HUnit, OpenGL, QuickCheck, cgi, fgl,
haskellSrc, html, network, parallel, parsec, regexBase, regexCompat, regexPosix,
stm, syb, deepseq, text, transformers, mtl, xhtml, zlib,
cabalInstall, alex, happy, haddock, ghc}:
cabal.mkDerivation (self : {
pname = "haskell-platform";
version = "2011.2.0.1";
src = fetchurl {
url = "http://lambda.haskell.org/hp-tmp/2011.2.0.0/cabal/${self.pname}-2011.2.0.0.tar.gz";
sha256 = "01ppv8jdyvbngml9vgvrvnani6fj1nbk8mqmrkd8c508l7q9g6vb";
};
cabalFile = fetchurl {
url = http://code.galois.com/darcs/haskell-platform/haskell-platform.cabal;
sha256 = "158a1g4ak9mm2q5ri4zdpmbvjgfkz7svxnkxlz8117zpnbs12i3d";
};
propagatedBuildInputs = [
GLUT HTTP HUnit OpenGL QuickCheck cgi fgl
haskellSrc html network parallel parsec regexBase regexCompat regexPosix
stm syb deepseq text transformers mtl xhtml zlib
cabalInstall alex happy ghc haddock
];
preConfigure = ''
cp ${self.cabalFile} ${self.pname}.cabal
'';
noHaddock = true;
meta = {
description = "Haskell Platform meta package";
maintainers = [self.stdenv.lib.maintainers.andres];
};
})

View File

@@ -0,0 +1,14 @@
{cabal, mtl, openssl}:
cabal.mkDerivation (self : {
pname = "hopenssl";
version = "1.6.1";
sha256 = "12lmhpg7m2amqld95lpv6d2j3rfzgdbmz8jsgh2hjb5hx72l5fkm";
propagatedBuildInputs = [mtl];
extraBuildInputs = [openssl];
meta = {
description = "FFI bindings to OpenSSL's EVP digest interface";
license = "BSD3";
};
})

View File

@@ -0,0 +1,13 @@
{cabal, blazeBuilder, blazeBuilderEnumerator, enumerator, jsonTypes, text, transformers}:
cabal.mkDerivation (self : {
pname = "json-enumerator";
version = "0.0.1.1";
sha256 = "0k94x9vwwaprqbc8gay5l0vg6hjmjpjp852yncncb8kr0r344z7l";
propagatedBuildInputs =
[blazeBuilder blazeBuilderEnumerator enumerator jsonTypes text transformers];
meta = {
description = "Provides the ability to render JSON in a streaming manner using the enumerator package";
license = "BSD3";
};
})

View File

@@ -0,0 +1,12 @@
{cabal, text}:
cabal.mkDerivation (self : {
pname = "json-types";
version = "0.1";
sha256 = "088if9qv0didjyb6y1583viihjgc4nwr61qfjqdg9rzc2ya6vqdn";
propagatedBuildInputs = [text];
meta = {
description = "Basic types for representing JSON";
license = "MIT";
};
})

View File

@@ -0,0 +1,12 @@
{cabal}:
cabal.mkDerivation (self : {
pname = "murmur-hash";
version = "0.1.0.2";
sha256 = "14amqkcz2dbjyjrsjblsnka8qymllbzjx5x3za58kwlcifnsq9jr";
meta = {
description = "MurmurHash2 implementation for Haskell";
license = "BSD3";
};
})

View File

@@ -1,12 +0,0 @@
{cabal, bytestring, network}:
cabal.mkDerivation (self : {
pname = "network-bytestring";
version = "0.1.2.1";
name = self.fname;
sha256 = "0l5gxwc5pg49qyxb1jy3kn9j66a6pg9frw4c7dn1mrpqicm155am";
extraBuildInputs = [bytestring network];
meta = {
description = "Fast, memory-efficient, low-level socket functions that use Data.ByteStrings instead of Strings";
};
})

View File

@@ -0,0 +1,13 @@
{cabal, regexBase, pcre}:
cabal.mkDerivation (self : {
pname = "regex-pcre";
version = "0.94.2";
sha256 = "0p4az8z4jlrcmmyz9bjf7n90hpg6n242vq4255w2dz5v29l822wn";
propagatedBuildInputs = [regexBase];
extraBuildInputs = [pcre];
meta = {
description = "Replaces/Enhances Text.Regex";
license = "BSD3";
};
})

View File

@@ -0,0 +1,17 @@
{cabal, attoparsec, attoparsecEnumerator, MonadCatchIOTransformers, blazeBuilder
, bytestringNums, dlist, mtl, unixCompat, vector, zlib}:
cabal.mkDerivation (self : {
pname = "snap-core";
version = "0.4.1";
sha256 = "0cc6qh8rnfdhv6s4clnb4avbxkvvj4dibbdg0vjbf75iafxvsg9f";
propagatedBuildInputs =
[ attoparsec attoparsecEnumerator MonadCatchIOTransformers blazeBuilder
bytestringNums dlist mtl unixCompat vector zlib
];
meta = {
description = "Snap: A Haskell Web Framework (Core)";
license = "BSD3";
};
})

View File

@@ -0,0 +1,19 @@
{cabal, attoparsec, attoparsecEnumerator, binary, blazeBuilder, blazeBuilderEnumerator
, bytestringNums, directoryTree, enumerator, MonadCatchIOTransformers, mtl, murmurHash
, network, PSQueue, snapCore, unixCompat, utf8String, vector, vectorAlgorithms, zlib}:
cabal.mkDerivation (self : {
pname = "snap-server";
version = "0.4.1";
sha256 = "1xav58sk6f1capibkil9a834lxg7badcq3v8016azzzmvvhy9iq8";
propagatedBuildInputs =
[ attoparsec attoparsecEnumerator binary blazeBuilder blazeBuilderEnumerator
bytestringNums directoryTree enumerator MonadCatchIOTransformers mtl murmurHash
network PSQueue snapCore unixCompat utf8String vector vectorAlgorithms zlib
];
meta = {
description = "Snap: A Haskell Web Framework (Server)";
license = "BSD3";
};
})

View File

@@ -0,0 +1,14 @@
{cabal, deepseq}:
cabal.mkDerivation (self : {
pname = "text";
version = "0.11.0.6"; # Haskell Platform 2011.2.0.1
sha256 = "103l1c8jfwpddsqzwj9jqh89vay8ax1znxqgjqprv2fvr7s0zvkp";
propagatedBuildInputs = [deepseq];
meta = {
description = "An efficient package Unicode text type";
license = "BSD";
maintainers = [self.stdenv.lib.maintainers.andres];
};
})

View File

@@ -0,0 +1,14 @@
{cabal, OneTuple}:
cabal.mkDerivation (self : {
pname = "tuple";
version = "0.2.0.1";
sha256 = "1c4vf798rjwshnk04avyjp4rjzj8i9qx4yksv00m3rjy6psr57xg";
propagatedBuildInputs = [OneTuple];
meta = {
description = "Various functions on tuples";
license = "BSD";
maintainers = [self.stdenv.lib.maintainers.andres];
};
})

View File

@@ -2,12 +2,11 @@
cabal.mkDerivation (self : {
pname = "unix-compat";
version = "0.1.2.1";
sha256 = "553326e140f71f09cedeec5f74666171c2ad2b3d9ba4312da97da02cbf8a2e85";
version = "0.2.1.1";
sha256 = "11bh29rq3g4qqvxc72wbip85vc3m91lafa85086izpqkkpnl4pxh";
meta = {
description = "Portable POSIX-compatibility layer";
license = "BSD";
maintainers = [self.stdenv.lib.maintainers.andres];
};
})

View File

@@ -0,0 +1,28 @@
{stdenv, fetchurl, gmp, static ? false}:
let
version = "0.06";
staticFlags = if static then " --enable-static --disable-shared" else "";
in
stdenv.mkDerivation {
name = "isl-${version}";
src = fetchurl {
url = "http://www.kotnet.org/~skimo/isl/isl-${version}.tar.bz2";
sha256 = "0w1i1m94w0jkmm0bzlp08c4r97j7yp0d7crxf28524b9mgbg0mwk";
};
buildInputs = [ gmp ];
dontDisableStatic = if static then true else false;
configureFlags = "--with-gmp-prefix=${gmp}" + staticFlags;
meta = {
homepage = http://www.kotnet.org/~skimo/isl/;
license = "LGPLv2.1";
description = "A library for manipulating sets and relations of integer points bounded by linear constraints.";
maintainers = [ stdenv.lib.maintainers.shlevy ];
};
}

View File

@@ -0,0 +1,20 @@
{stdenv, fetchurl, unzip, ogre, cmake, ois, freetype, libuuid, boost}:
stdenv.mkDerivation rec {
name = "mygui-3.0.1";
src = fetchurl {
url = mirror://sourceforge/my-gui/MyGUI_3.0.1_source.zip;
sha256 = "1n56kl8ykzgv4k2nm9317jg9b9x2qa3l9hamz11hzn1qqjn2z4ig";
};
enableParallelBuilding = true;
buildInputs = [ unzip ogre cmake ois freetype libuuid boost ];
meta = {
homepage = http://mygui.info/;
description = "Library for creating GUIs for games and 3D applications";
license = "LGPLv3+";
};
}

View File

@@ -0,0 +1,27 @@
{stdenv, fetchsvn, unzip, ogre, cmake, ois, freetype, libuuid, boost}:
stdenv.mkDerivation rec {
name = "mygui-svn-4141";
src = fetchsvn {
url = https://my-gui.svn.sourceforge.net/svnroot/my-gui/trunk;
rev = 4141;
sha256 = "0xfm4b16ksqd1cwq45kl01wi4pmj244dpn11xln8ns7wz0sffjwn";
};
enableParallelBuilding = true;
cmakeFlags = [
"-DOGRE_LIB_DIR=${ogre}/lib"
"-DOGRE_INCLUDE_DIR=${ogre}/include/OGRE"
"-DOGRE_LIBRARIES=OgreMain"
];
buildInputs = [ unzip ogre cmake ois freetype libuuid boost ];
meta = {
homepage = http://mygui.info/;
description = "Library for creating GUIs for games and 3D applications";
license = "LGPLv3+";
};
}

View File

@@ -35,8 +35,10 @@ rec {
inherit (sourceInfo) name version;
inherit buildInputs;
doMyBuild = a.fullDepEntry ("make -j4") ["doCmake"];
/* doConfigure should be removed if not needed */
phaseNames = ["doCmake" "doMakeInstall"];
phaseNames = ["doCmake" "doMyBuild" "doMakeInstall"];
meta = {
description = "A 3D engine";

View File

@@ -0,0 +1,50 @@
{ fetchurl, stdenv, gmpxx, perl, gnum4, static ? false }:
let
version = "0.11";
staticFlags = if static then " --enable-static --disable-shared" else "";
in
stdenv.mkDerivation rec {
name = "ppl-${version}";
src = fetchurl {
url = "mirror://gcc/infrastructure/ppl-${version}.tar.gz";
sha256 = "0xqwyaj232gi0pgm6z2rihk6p8l1rngbbibnhmcrbq4jq550clrl";
};
buildNativeInputs = [ perl gnum4 ];
propagatedBuildInputs = [ gmpxx ];
dontDisableStatic = if static then true else false;
configureFlags = staticFlags;
# Beware! It took ~6 hours to compile PPL and run its tests on a 1.2 GHz
# x86_64 box. Nevertheless, being a dependency of GCC, it probably ought
# to be tested.
doCheck = false;
meta = {
description = "PPL: The Parma Polyhedra Library";
longDescription = ''
The Parma Polyhedra Library (PPL) provides numerical abstractions
especially targeted at applications in the field of analysis and
verification of complex systems. These abstractions include convex
polyhedra, defined as the intersection of a finite number of (open or
closed) halfspaces, each described by a linear inequality (strict or
non-strict) with rational coefficients; some special classes of
polyhedra shapes that offer interesting complexity/precision tradeoffs;
and grids which represent regularly spaced points that satisfy a set of
linear congruence relations. The library also supports finite
powersets and products of (any kind of) polyhedra and grids and a mixed
integer linear programming problem solver using an exact-arithmetic
version of the simplex algorithm.
'';
homepage = http://www.cs.unipr.it/ppl/;
license = "GPLv3+";
maintainers = [ stdenv.lib.maintainers.ludo ];
};
}

View File

@@ -0,0 +1,20 @@
{stdenv, fetchurl}:
stdenv.mkDerivation {
name = "jam-2.5";
src = fetchurl {
url = ftp://ftp.perforce.com/jam/jam-2.5.tar;
sha256 = "04c6khd7gdkqkvx4h3nbz99lyz7waid4fd221hq5chcygyx1sj3i";
};
installPhase = ''
ensureDir $out/bin
cp bin.linux/jam $out/bin
'';
meta = {
homepage = http://public.perforce.com/wiki/Jam;
license = "free";
description = "Just Another Make";
};
}