parent
e3fd4499ef
commit
3e8344d334
@ -0,0 +1,93 @@ |
||||
{stdenv, fetchurl, perl, ncurses, gmp}: |
||||
|
||||
stdenv.mkDerivation rec { |
||||
version = "7.8.3"; |
||||
|
||||
name = "ghc-${version}-binary"; |
||||
|
||||
src = |
||||
if stdenv.system == "i686-linux" then |
||||
fetchurl { |
||||
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2"; |
||||
sha256 = "0gny7knhss0w0d9r6jm1gghrcb8kqjvj94bb7hxf9syrk4fxlcxi"; |
||||
} |
||||
else if stdenv.system == "x86_64-linux" then |
||||
fetchurl { |
||||
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2"; |
||||
sha256 = "043jabd0lh6n1zlqhysngbpvlsdznsa2mmsj08jyqgahw9sjb5ns"; |
||||
} |
||||
else if stdenv.system == "i686-darwin" then |
||||
fetchurl { |
||||
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2"; |
||||
sha256 = "1vrbs3pzki37hzym1f1nh07lrqh066z3ypvm81fwlikfsvk4djc0"; |
||||
} |
||||
else if stdenv.system == "x86_64-darwin" then |
||||
fetchurl { |
||||
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2"; |
||||
sha256 = "1ja0cq5xyjcvjpvjmm4nzhkpmwfs2kjlldbc48lxcs9rmqi7rnay"; |
||||
} |
||||
else throw "cannot bootstrap GHC on this platform"; |
||||
|
||||
buildInputs = [perl]; |
||||
|
||||
postUnpack = |
||||
# Strip is harmful, see also below. It's important that this happens |
||||
# first. The GHC Cabal build system makes use of strip by default and |
||||
# has hardcoded paths to /usr/bin/strip in many places. We replace |
||||
# those below, making them point to our dummy script. |
||||
'' |
||||
mkdir "$TMP/bin" |
||||
for i in strip; do |
||||
echo '#! ${stdenv.shell}' > "$TMP/bin/$i" |
||||
chmod +x "$TMP/bin/$i" |
||||
done |
||||
PATH="$TMP/bin:$PATH" |
||||
'' + |
||||
# We have to patch the GMP paths for the integer-gmp package. |
||||
'' |
||||
find . -name integer-gmp.buildinfo \ |
||||
-exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${gmp}/lib@" {} \; |
||||
'' + |
||||
# On Linux, use patchelf to modify the executables so that they can |
||||
# find editline/gmp. |
||||
(if stdenv.isLinux then '' |
||||
find . -type f -perm +100 \ |
||||
-exec patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \ |
||||
--set-rpath "${ncurses}/lib:${gmp}/lib" {} \; |
||||
sed -i "s|/usr/bin/perl|perl\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2 |
||||
sed -i "s|/usr/bin/gcc|gcc\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2 |
||||
for prog in ld ar gcc strip ranlib; do |
||||
find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \; |
||||
done |
||||
'' else ""); |
||||
|
||||
configurePhase = '' |
||||
./configure --prefix=$out --with-gmp-libraries=${gmp}/lib \ |
||||
--with-gmp-includes=${gmp}/include |
||||
''; |
||||
|
||||
# Stripping combined with patchelf breaks the executables (they die |
||||
# with a segfault or the kernel even refuses the execve). (NIXPKGS-85) |
||||
dontStrip = true; |
||||
|
||||
# No building is necessary, but calling make without flags ironically |
||||
# calls install-strip ... |
||||
buildPhase = "true"; |
||||
|
||||
postInstall = |
||||
'' |
||||
# Sanity check, can ghc create executables? |
||||
cd $TMP |
||||
mkdir test-ghc; cd test-ghc |
||||
cat > main.hs << EOF |
||||
module Main where |
||||
main = putStrLn "yes" |
||||
EOF |
||||
$out/bin/ghc --make main.hs |
||||
echo compilation ok |
||||
[ $(./main) == "yes" ] |
||||
''; |
||||
|
||||
meta.license = stdenv.lib.licenses.bsd3; |
||||
meta.platforms = ["x86_64-linux" "i686-linux" "i686-darwin" "x86_64-darwin"]; |
||||
} |
@ -0,0 +1,14 @@ |
||||
diff --git a/lib/stdint.in.h b/lib/stdint.in.h
|
||||
index 889bca7..15d39b0 100644
|
||||
--- a/lib/stdint.in.h
|
||||
+++ b/lib/stdint.in.h
|
||||
@@ -74,7 +74,8 @@
|
||||
in <inttypes.h> would reinclude us, skipping our contents because
|
||||
_@GUARD_PREFIX@_STDINT_H is defined.
|
||||
The include_next requires a split double-inclusion guard. */
|
||||
-# @INCLUDE_NEXT@ @NEXT_STDINT_H@
|
||||
+# include <inttypes.h>
|
||||
+// # @INCLUDE_NEXT@ @NEXT_STDINT_H@
|
||||
#endif
|
||||
|
||||
#if ! defined _@GUARD_PREFIX@_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
|
@ -0,0 +1,18 @@ |
||||
--- interfaces/cc/aspell.h 2013-10-13 20:29:33.000000000 +0200
|
||||
+++ interfaces/cc/aspell.h 2013-10-13 20:30:01.000000000 +0200
|
||||
@@ -237,6 +237,7 @@
|
||||
/******************************** errors ********************************/
|
||||
|
||||
|
||||
+#ifndef __cplusplus
|
||||
extern const struct AspellErrorInfo * const aerror_other;
|
||||
extern const struct AspellErrorInfo * const aerror_operation_not_supported;
|
||||
extern const struct AspellErrorInfo * const aerror_cant_copy;
|
||||
@@ -322,6 +323,7 @@
|
||||
extern const struct AspellErrorInfo * const aerror_bad_magic;
|
||||
extern const struct AspellErrorInfo * const aerror_expression;
|
||||
extern const struct AspellErrorInfo * const aerror_invalid_expression;
|
||||
+#endif
|
||||
|
||||
|
||||
/******************************* speller *******************************/
|
@ -0,0 +1,20 @@ |
||||
--- src/dbinc/atomic.h 2013-03-12 14:07:22.000000000 -0400
|
||||
+++ src/dbinc/atomic.h.change 2013-03-12 14:06:35.000000000 -0400
|
||||
@@ -144,7 +144,7 @@
|
||||
#define atomic_inc(env, p) __atomic_inc(p)
|
||||
#define atomic_dec(env, p) __atomic_dec(p)
|
||||
#define atomic_compare_exchange(env, p, o, n) \
|
||||
- __atomic_compare_exchange((p), (o), (n))
|
||||
+ __atomic_compare_exchange_db((p), (o), (n))
|
||||
static inline int __atomic_inc(db_atomic_t *p)
|
||||
{
|
||||
int temp;
|
||||
@@ -176,7 +176,7 @@
|
||||
* http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html
|
||||
* which configure could be changed to use.
|
||||
*/
|
||||
-static inline int __atomic_compare_exchange(
|
||||
+static inline int __atomic_compare_exchange_db(
|
||||
db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval)
|
||||
{
|
||||
atomic_value_t was;
|
@ -0,0 +1,14 @@ |
||||
diff --git a/lib/stdint.in.h b/lib/stdint.in.h
|
||||
index 997e406..e0827f5 100644
|
||||
--- a/lib/stdint.in.h
|
||||
+++ b/lib/stdint.in.h
|
||||
@@ -53,7 +53,8 @@
|
||||
in <inttypes.h> would reinclude us, skipping our contents because
|
||||
_GL_STDINT_H is defined.
|
||||
The include_next requires a split double-inclusion guard. */
|
||||
-# @INCLUDE_NEXT@ @NEXT_STDINT_H@
|
||||
+# include <inttypes.h>
|
||||
+// # @INCLUDE_NEXT@ @NEXT_STDINT_H@
|
||||
#endif
|
||||
|
||||
#if ! defined _GL_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
|
@ -0,0 +1,42 @@ |
||||
diff -ruNp ncurses-5.8.orig/c++/cursesf.h ncurses-5.8/c++/cursesf.h
|
||||
--- ncurses-5.8.orig/c++/cursesf.h 2005-08-13 21:08:24.000000000 +0300
|
||||
+++ ncurses-5.8/c++/cursesf.h 2011-04-03 18:29:29.000000000 +0300
|
||||
@@ -681,7 +681,7 @@ public:
|
||||
const T* p_UserData = STATIC_CAST(T*)(0),
|
||||
bool with_frame=FALSE,
|
||||
bool autoDelete_Fields=FALSE)
|
||||
- : NCursesForm (Fields, with_frame, autoDelete_Fields) {
|
||||
+ : NCursesForm (&Fields, with_frame, autoDelete_Fields) {
|
||||
if (form)
|
||||
set_user (const_cast<void *>(p_UserData));
|
||||
};
|
||||
@@ -694,7 +694,7 @@ public:
|
||||
const T* p_UserData = STATIC_CAST(T*)(0),
|
||||
bool with_frame=FALSE,
|
||||
bool autoDelete_Fields=FALSE)
|
||||
- : NCursesForm (Fields, nlines, ncols, begin_y, begin_x,
|
||||
+ : NCursesForm (&Fields, nlines, ncols, begin_y, begin_x,
|
||||
with_frame, autoDelete_Fields) {
|
||||
if (form)
|
||||
set_user (const_cast<void *>(p_UserData));
|
||||
diff -ruNp ncurses-5.8.orig/c++/cursesm.h ncurses-5.8/c++/cursesm.h
|
||||
--- ncurses-5.8.orig/c++/cursesm.h 2005-08-13 21:10:36.000000000 +0300
|
||||
+++ ncurses-5.8/c++/cursesm.h 2011-04-03 18:31:42.000000000 +0300
|
||||
@@ -639,7 +639,7 @@ public:
|
||||
const T* p_UserData = STATIC_CAST(T*)(0),
|
||||
bool with_frame=FALSE,
|
||||
bool autoDelete_Items=FALSE)
|
||||
- : NCursesMenu (Items, with_frame, autoDelete_Items) {
|
||||
+ : NCursesMenu (&Items, with_frame, autoDelete_Items) {
|
||||
if (menu)
|
||||
set_user (const_cast<void *>(p_UserData));
|
||||
};
|
||||
@@ -651,7 +651,7 @@ public:
|
||||
int begin_x = 0,
|
||||
const T* p_UserData = STATIC_CAST(T*)(0),
|
||||
bool with_frame=FALSE)
|
||||
- : NCursesMenu (Items, nlines, ncols, begin_y, begin_x, with_frame) {
|
||||
+ : NCursesMenu (&Items, nlines, ncols, begin_y, begin_x, with_frame) {
|
||||
if (menu)
|
||||
set_user (const_cast<void *>(p_UserData));
|
||||
};
|
@ -0,0 +1,13 @@ |
||||
diff --git a/support/shobj-conf b/support/shobj-conf
|
||||
index 5a63e80..4b2a741 100644
|
||||
--- support/shobj-conf
|
||||
+++ support/shobj-conf
|
||||
@@ -189,7 +189,7 @@ darwin*|macosx*)
|
||||
darwin[789]*|darwin10*) SHOBJ_LDFLAGS=''
|
||||
SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
|
||||
;;
|
||||
- *) SHOBJ_LDFLAGS='-dynamic'
|
||||
+ *) SHOBJ_LDFLAGS='-dynamiclib'
|
||||
SHLIB_XLDFLAGS='-arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
|
||||
;;
|
||||
esac
|
@ -0,0 +1,47 @@ |
||||
{ stdenv, pkgs, config }: |
||||
|
||||
import ../generic rec { |
||||
inherit config; |
||||
|
||||
preHook = |
||||
'' |
||||
export NIX_ENFORCE_PURITY= |
||||
export NIX_IGNORE_LD_THROUGH_GCC=1 |
||||
export NIX_DONT_SET_RPATH=1 |
||||
export NIX_NO_SELF_RPATH=1 |
||||
dontFixLibtool=1 |
||||
stripAllFlags=" " # the Darwin "strip" command doesn't know "-s" |
||||
xargsFlags=" " |
||||
export MACOSX_DEPLOYMENT_TARGET=10.6 |
||||
export SDKROOT=$(/usr/bin/xcrun --show-sdk-path 2> /dev/null || true) |
||||
export NIX_CFLAGS_COMPILE+=" --sysroot=/var/empty -idirafter $SDKROOT/usr/include -F$SDKROOT/System/Library/Frameworks -Wno-multichar -Wno-deprecated-declarations" |
||||
export NIX_LDFLAGS_AFTER+=" -L$SDKROOT/usr/lib" |
||||
''; |
||||
|
||||
initialPath = (import ../common-path.nix) {pkgs = pkgs;}; |
||||
|
||||
system = stdenv.system; |
||||
|
||||
gcc = import ../../build-support/clang-wrapper { |
||||
nativeTools = false; |
||||
nativePrefix = stdenv.lib.optionalString stdenv.isSunOS "/usr"; |
||||
nativeLibc = true; |
||||
inherit stdenv; |
||||
binutils = import ../../build-support/native-darwin-cctools-wrapper {inherit stdenv;}; |
||||
clang = pkgs.clang_34; |
||||
coreutils = pkgs.coreutils; |
||||
shell = pkgs.bash + "/bin/sh"; |
||||
}; |
||||
|
||||
shell = pkgs.bash + "/bin/sh"; |
||||
|
||||
fetchurlBoot = stdenv.fetchurlBoot; |
||||
|
||||
overrides = pkgs_: { |
||||
inherit gcc; |
||||
inherit (gcc) binutils; |
||||
inherit (pkgs) |
||||
gzip bzip2 xz bash coreutils diffutils findutils gawk |
||||
gnumake gnused gnutar gnugrep gnupatch perl; |
||||
}; |
||||
} |
@ -0,0 +1,13 @@ |
||||
diff --git a/gl/stdint_.h b/gl/stdint_.h
|
||||
index bc27595..303e81a 100644
|
||||
--- a/gl/stdint_.h
|
||||
+++ b/gl/stdint_.h
|
||||
@@ -62,7 +62,7 @@
|
||||
int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__.
|
||||
<inttypes.h> also defines intptr_t and uintptr_t. */
|
||||
# define _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H
|
||||
-# include <inttypes.h>
|
||||
+// # include <inttypes.h>
|
||||
# undef _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H
|
||||
#elif @HAVE_SYS_INTTYPES_H@
|
||||
/* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and
|
@ -0,0 +1,13 @@ |
||||
diff --git a/texk/ps2pkm/type1.c b/texk/ps2pkm/type1.c
|
||||
index 027bf1f..4dcbad0 100644
|
||||
--- a/texk/ps2pkm/type1.c
|
||||
+++ b/texk/ps2pkm/type1.c
|
||||
@@ -800,7 +800,7 @@ static void PSFakePush(Num)
|
||||
static DOUBLE PSFakePop ()
|
||||
{
|
||||
if (PSFakeTop >= 0) return(PSFakeStack[PSFakeTop--]);
|
||||
- else Error0("PSFakePop : Stack empty\n");
|
||||
+ else { CC; IfTrace0(TRUE, "PSFakePop : Stack empty\n"); errflag = TRUE; return 0; }
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
Loading…
Reference in new issue