···1011 buildInputs = [ cmake libpng libtiff libjpeg panotools libxml2 ];
1213- # I added these flags to get all the rpaths right, which I guess they are
14- # taken from the qt4 sources. Not very nice.
15- cmakeFlags = "-DCMAKE_SHARED_LINKER_FLAGS=\"-Wl,-rpath,$out/lib\"" +
16- " -DCMAKE_EXE_LINKER_FLAGS=\"-Wl,-rpath,$out/lib" +
17- " -lpng12 -lpano13 -ljpeg -ltiff -lz -lxml2 \"" +
18- " -DCMAKE_SKIP_BUILD_RPATH=ON" +
19- " -DCMAKE_BUILD_TYPE=Release" +
20- " -DCMAKE_INSTALL_PREFIX=$out";
21-22- dontUseCmakeConfigure = true;
23-24- # I rewrote the configure phase to get the $out references evaluated in
25- # cmakeFlags
26- configurePhase = ''
27- set -x
28- mkdir -p build;
29- cd build
30- eval -- "cmake .. $cmakeFlags"
31- set +x
32- '';
33-34 meta = {
35 homepage = http://hugin.sourceforge.net/;
36 description = "Implementation in C of the autopano-sift algorithm for automatically stitching panoramas";
···1011 buildInputs = [ cmake libpng libtiff libjpeg panotools libxml2 ];
1200000000000000000000013 meta = {
14 homepage = http://hugin.sourceforge.net/;
15 description = "Implementation in C of the autopano-sift algorithm for automatically stitching panoramas";
-20
pkgs/applications/graphics/freepv/default.nix
···17 sed -i -e '/mozilla/d' src/CMakeLists.txt
18 '';
1920- # I added these flags to get all the rpaths right, which I guess they are
21- # taken from the qt4 sources. Not very nice.
22- cmakeFlags = " -DCMAKE_EXE_LINKER_FLAGS=\"" +
23- " -lpng12 -lXxf86vm -ljpeg -lz -lglut -lGLU -lxml2 -lX11\"" +
24- " -DCMAKE_SKIP_BUILD_RPATH=ON" +
25- " -DCMAKE_BUILD_TYPE=Release" +
26- " -DCMAKE_INSTALL_PREFIX=$out";
27-28- dontUseCmakeConfigure = true;
29-30- # I rewrote the configure phase to get the $out references evaluated in
31- # cmakeFlags
32- configurePhase = ''
33- set -x
34- mkdir -p build;
35- cd build
36- eval -- "cmake .. $cmakeFlags"
37- set +x
38- '';
39-40 meta = {
41 description = "Open source panorama viewer using GL";
42 homepage = http://freepv.sourceforge.net/;
···17 sed -i -e '/mozilla/d' src/CMakeLists.txt
18 '';
190000000000000000000020 meta = {
21 description = "Open source panorama viewer using GL";
22 homepage = http://freepv.sourceforge.net/;
+2-22
pkgs/applications/graphics/hugin/default.nix
···1516 NIX_LDFLAGS = "-lrt";
1718- # I added these flags to get all the rpaths right, which I guess they are
19- # taken from the qt4 sources. Not very nice.
20- cmakeFlags = "-DCMAKE_SHARED_LINKER_FLAGS=\"-Wl,-rpath,$out/lib\"" +
21- " -DCMAKE_EXE_LINKER_FLAGS=\"-Wl,-rpath,$out/lib" +
22- " -lpng12 -lpano13 -lImath -lIlmImf -lIex -lHalf -lIlmThread" +
23- " -ljpeg -ltiff -lz -lexiv2 -lboost_thread\"" +
24- " -DCMAKE_SKIP_BUILD_RPATH=ON" +
25- " -DCMAKE_BUILD_TYPE=Release" +
26- " -DCMAKE_INSTALL_PREFIX=$out";
27-28- buildInputs = [ cmake panotools wxGTK libtiff libpng openexr boost pkgconfig exiv2 gettext ilmbase ];
29-30- dontUseCmakeConfigure = true;
3132- # I rewrote the configure phase to get the $out references evaluated in
33- # cmakeFlags
34- configurePhase = ''
35- set -x
36- mkdir -p build;
37- cd build
38- eval -- "cmake .. $cmakeFlags"
39- set +x
40- '';
41 postInstall = ''
42 ensureDir "$out/nix-support"
43 echo "${enblendenfuse} ${autopanosiftc}" > $out/nix-support/propagated-user-env-packages
···1+To be removed after we merge stdenv-updates in.
2+stdenv-updates should have this gcc-wrapper2 as gcc-wrapper.
3+4+Changelog against gcc-wrapper:
5+- Support for linking shared objects with direct mention of the /path/libxxx.so object,
6+ thus, adding its path to the rpath.
+24
pkgs/build-support/gcc-wrapper2/add-flags
···000000000000000000000000
···1+# `-B@out@/bin' forces gcc to use ld-wrapper.sh when calling ld.
2+export NIX_CFLAGS_COMPILE="-B@out@/bin/ $NIX_CFLAGS_COMPILE"
3+4+if test -e @out@/nix-support/libc-cflags; then
5+ export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/libc-cflags) $NIX_CFLAGS_COMPILE"
6+fi
7+8+if test -e @out@/nix-support/gcc-cflags; then
9+ export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/gcc-cflags) $NIX_CFLAGS_COMPILE"
10+fi
11+12+if test -e @out@/nix-support/libc-ldflags; then
13+ export NIX_LDFLAGS="$NIX_LDFLAGS $(cat @out@/nix-support/libc-ldflags)"
14+fi
15+16+if test -e @out@/nix-support/gcc-ldflags; then
17+ export NIX_LDFLAGS="$NIX_LDFLAGS $(cat @out@/nix-support/gcc-ldflags)"
18+fi
19+20+if test -e @out@/nix-support/libc-ldflags-before; then
21+ export NIX_LDFLAGS_BEFORE="$(cat @out@/nix-support/libc-ldflags-before) $NIX_LDFLAGS_BEFORE"
22+fi
23+24+export NIX_GCC_WRAPPER_FLAGS_SET=1
···1+source $stdenv/setup
2+3+4+ensureDir $out/bin
5+ensureDir $out/nix-support
6+7+8+if test -z "$nativeLibc"; then
9+ dynamicLinker="$libc/lib/$dynamicLinker"
10+ echo $dynamicLinker > $out/nix-support/dynamic-linker
11+12+ if test -e $libc/lib/32/ld-linux.so.2; then
13+ echo $libc/lib/32/ld-linux.so.2 > $out/nix-support/dynamic-linker-m32
14+ fi
15+16+ # The "-B$libc/lib/" flag is a quick hack to force gcc to link
17+ # against the crt1.o from our own glibc, rather than the one in
18+ # /usr/lib. (This is only an issue when using an `impure'
19+ # compiler/linker, i.e., one that searches /usr/lib and so on.)
20+ #
21+ # Unfortunately, setting -B appears to override the default search
22+ # path. Thus, the gcc-specific "../includes-fixed" directory is
23+ # now longer searched and glibc's <limits.h> header fails to
24+ # compile, because it uses "#include_next <limits.h>" to find the
25+ # limits.h file in ../includes-fixed. To remedy the problem,
26+ # another -idirafter is necessary to add that directory again.
27+ echo "-B$libc/lib/ -idirafter $libc/include -idirafter $gcc/lib/gcc/*/*/include-fixed" > $out/nix-support/libc-cflags
28+29+ echo "-L$libc/lib" > $out/nix-support/libc-ldflags
30+31+ # The dynamic linker is passed in `ldflagsBefore' to allow
32+ # explicit overrides of the dynamic linker by callers to gcc/ld
33+ # (the *last* value counts, so ours should come first).
34+ echo "-dynamic-linker $dynamicLinker" > $out/nix-support/libc-ldflags-before
35+fi
36+37+if test -n "$nativeTools"; then
38+ gccPath="$nativePrefix/bin"
39+ ldPath="$nativePrefix/bin"
40+else
41+ if test -e "$gcc/lib64"; then
42+ gccLDFlags="$gccLDFlags -L$gcc/lib64"
43+ fi
44+ gccLDFlags="$gccLDFlags -L$gcc/lib"
45+ echo "$gccLDFlags" > $out/nix-support/gcc-ldflags
46+47+ # GCC shows $gcc/lib in `gcc -print-search-dirs', but not
48+ # $gcc/lib64 (even though it does actually search there...)..
49+ # This confuses libtool. So add it to the compiler tool search
50+ # path explicitly.
51+ if test -e "$gcc/lib64"; then
52+ gccCFlags="$gccCFlags -B$gcc/lib64"
53+ fi
54+ echo "$gccCFlags" > $out/nix-support/gcc-cflags
55+56+ gccPath="$gcc/bin"
57+ ldPath="$binutils/bin"
58+fi
59+60+61+doSubstitute() {
62+ local src=$1
63+ local dst=$2
64+ # Can't use substitute() here, because replace may not have been
65+ # built yet (in the bootstrap).
66+ sed \
67+ -e "s^@out@^$out^g" \
68+ -e "s^@shell@^$shell^g" \
69+ -e "s^@gcc@^$gcc^g" \
70+ -e "s^@gccProg@^$gccProg^g" \
71+ -e "s^@binutils@^$binutils^g" \
72+ -e "s^@libc@^$libc^g" \
73+ -e "s^@ld@^$ldPath/ld^g" \
74+ < "$src" > "$dst"
75+}
76+77+78+# Make wrapper scripts around gcc, g++, and gfortran. Also make symlinks
79+# cc, c++, and f77.
80+mkGccWrapper() {
81+ local dst=$1
82+ local src=$2
83+84+ if ! test -f "$src"; then
85+ echo "$src does not exist (skipping)"
86+ return
87+ fi
88+89+ gccProg="$src"
90+ doSubstitute "$gccWrapper" "$dst"
91+ chmod +x "$dst"
92+}
93+94+mkGccWrapper $out/bin/gcc $gccPath/gcc
95+ln -s gcc $out/bin/cc
96+97+mkGccWrapper $out/bin/g++ $gccPath/g++
98+ln -s g++ $out/bin/c++
99+100+if test -e $gccPath/gfortran; then
101+ mkGccWrapper $out/bin/gfortran $gccPath/gfortran
102+ ln -s gfortran $out/bin/g77
103+ ln -s gfortran $out/bin/f77
104+fi
105+106+107+# Create a symlink to as (the assembler). This is useful when a
108+# gcc-wrapper is installed in a user environment, as it ensures that
109+# the right assembler is called.
110+ln -s $ldPath/as $out/bin/as
111+112+113+# Make a wrapper around the linker.
114+doSubstitute "$ldWrapper" "$out/bin/ld"
115+chmod +x "$out/bin/ld"
116+117+118+# Emit a setup hook. Also store the path to the original GCC and
119+# Glibc.
120+test -n "$gcc" && echo $gcc > $out/nix-support/orig-gcc
121+test -n "$libc" && echo $libc > $out/nix-support/orig-libc
122+123+doSubstitute "$addFlags" "$out/nix-support/add-flags.sh"
124+125+doSubstitute "$setupHook" "$out/nix-support/setup-hook"
126+127+cp -p $utils $out/nix-support/utils.sh
128+129+130+# Propagate the wrapped gcc so that if you install the wrapper, you get
131+# tools like gcov, the manpages, etc. as well (including for binutils
132+# and Glibc).
133+if test -z "$nativeTools"; then
134+ echo $gcc $binutils $libc > $out/nix-support/propagated-user-env-packages
135+fi
···1+# The Nix `gcc' stdenv.mkDerivation is not directly usable, since it doesn't
2+# know where the C library and standard header files are. Therefore
3+# the compiler produced by that package cannot be installed directly
4+# in a user environment and used from the command line. This
5+# stdenv.mkDerivation provides a wrapper that sets up the right environment
6+# variables so that the compiler and the linker just "work".
7+8+{ name ? "", stdenv, nativeTools, nativeLibc, nativePrefix ? ""
9+, gcc ? null, libc ? null, binutils ? null, shell ? ""
10+}:
11+12+assert nativeTools -> nativePrefix != "";
13+assert !nativeTools -> gcc != null && binutils != null;
14+assert !nativeLibc -> libc != null;
15+16+let
17+18+ gccVersion = (builtins.parseDrvName gcc.name).version;
19+ gccName = (builtins.parseDrvName gcc.name).name;
20+21+in
22+23+stdenv.mkDerivation {
24+ name =
25+ (if name != "" then name else gccName + "-wrapper") +
26+ (if gcc != null && gccVersion != "" then "-" + gccVersion else "");
27+28+ builder = ./builder.sh;
29+ setupHook = ./setup-hook.sh;
30+ gccWrapper = ./gcc-wrapper.sh;
31+ ldWrapper = ./ld-wrapper.sh;
32+ utils = ./utils.sh;
33+ addFlags = ./add-flags;
34+35+ inherit nativeTools nativeLibc nativePrefix gcc;
36+ libc = if nativeLibc then null else libc;
37+ binutils = if nativeTools then null else binutils;
38+39+ langC = if nativeTools then true else gcc.langC;
40+ langCC = if nativeTools then true else gcc.langCC;
41+ langFortran = if nativeTools then false else gcc ? langFortran;
42+ shell = if shell == "" then stdenv.shell else shell;
43+44+ meta =
45+ let gcc_ = if gcc != null then gcc else {}; in
46+ (if gcc_ ? meta then removeAttrs gcc.meta ["priority"] else {}) //
47+ { description =
48+ stdenv.lib.attrByPath ["meta" "description"] "System C compiler" gcc_
49+ + " (wrapper script)";
50+ };
51+52+ # The dynamic linker has different names on different Linux platforms.
53+ dynamicLinker =
54+ if !nativeLibc then
55+ (if stdenv.system == "i686-linux" then "ld-linux.so.2" else
56+ if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2" else
57+ if stdenv.system == "powerpc-linux" then "ld.so.1" else
58+ abort "don't know the name of the dynamic linker for this platform")
59+ else "";
60+}
···1+#! @shell@ -e
2+3+if test -n "$NIX_GCC_WRAPPER_START_HOOK"; then
4+ source "$NIX_GCC_WRAPPER_START_HOOK"
5+fi
6+7+if test -z "$NIX_GCC_WRAPPER_FLAGS_SET"; then
8+ source @out@/nix-support/add-flags.sh
9+fi
10+11+source @out@/nix-support/utils.sh
12+13+14+# Figure out if linker flags should be passed. GCC prints annoying
15+# warnings when they are not needed.
16+dontLink=0
17+getVersion=0
18+nonFlagArgs=0
19+20+for i in "$@"; do
21+ if test "$i" = "-c"; then
22+ dontLink=1
23+ elif test "$i" = "-S"; then
24+ dontLink=1
25+ elif test "$i" = "-E"; then
26+ dontLink=1
27+ elif test "$i" = "-E"; then
28+ dontLink=1
29+ elif test "$i" = "-M"; then
30+ dontLink=1
31+ elif test "$i" = "-MM"; then
32+ dontLink=1
33+ elif test "${i:0:1}" != "-"; then
34+ nonFlagArgs=1
35+ elif test "$i" = "-m32"; then
36+ if test -e @out@/nix-support/dynamic-linker-m32; then
37+ NIX_LDFLAGS="$NIX_LDFLAGS -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)"
38+ fi
39+ fi
40+done
41+42+# If we pass a flag like -Wl, then gcc will call the linker unless it
43+# can figure out that it has to do something else (e.g., because of a
44+# "-c" flag). So if no non-flag arguments are given, don't pass any
45+# linker flags. This catches cases like "gcc" (should just print
46+# "gcc: no input files") and "gcc -v" (should print the version).
47+if test "$nonFlagArgs" = "0"; then
48+ dontLink=1
49+fi
50+51+52+# Optionally filter out paths not refering to the store.
53+params=("$@")
54+if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE"; then
55+ rest=()
56+ n=0
57+ while test $n -lt ${#params[*]}; do
58+ p=${params[n]}
59+ p2=${params[$((n+1))]}
60+ if test "${p:0:3}" = "-L/" && badPath "${p:2}"; then
61+ skip $p
62+ elif test "$p" = "-L" && badPath "$p2"; then
63+ n=$((n + 1)); skip $p2
64+ elif test "${p:0:3}" = "-I/" && badPath "${p:2}"; then
65+ skip $p
66+ elif test "$p" = "-I" && badPath "$p2"; then
67+ n=$((n + 1)); skip $p2
68+ elif test "$p" = "-isystem" && badPath "$p2"; then
69+ n=$((n + 1)); skip $p2
70+ else
71+ rest=("${rest[@]}" "$p")
72+ fi
73+ n=$((n + 1))
74+ done
75+ params=("${rest[@]}")
76+fi
77+78+79+# Add the flags for the C compiler proper.
80+extraAfter=($NIX_CFLAGS_COMPILE)
81+extraBefore=()
82+83+if test "$dontLink" != "1"; then
84+85+ # Add the flags that should only be passed to the compiler when
86+ # linking.
87+ extraAfter=(${extraAfter[@]} $NIX_CFLAGS_LINK)
88+89+ # Add the flags that should be passed to the linker (and prevent
90+ # `ld-wrapper' from adding NIX_LDFLAGS again).
91+ for i in $NIX_LDFLAGS_BEFORE; do
92+ extraBefore=(${extraBefore[@]} "-Wl,$i")
93+ done
94+ for i in $NIX_LDFLAGS; do
95+ if test "${i:0:3}" = "-L/"; then
96+ extraAfter=(${extraAfter[@]} "$i")
97+ else
98+ extraAfter=(${extraAfter[@]} "-Wl,$i")
99+ fi
100+ done
101+ export NIX_LDFLAGS_SET=1
102+103+ if test "$NIX_STRIP_DEBUG" = "1"; then
104+ # Add executable-stripping flags.
105+ extraAfter=(${extraAfter[@]} $NIX_CFLAGS_STRIP)
106+ fi
107+fi
108+109+# As a very special hack, if the arguments are just `-v', then don't
110+# add anything. This is to prevent `gcc -v' (which normally prints
111+# out the version number and returns exit code 0) from printing out
112+# `No input files specified' and returning exit code 1.
113+if test "$*" = "-v"; then
114+ extraAfter=()
115+ extraBefore=()
116+fi
117+118+# Optionally print debug info.
119+if test "$NIX_DEBUG" = "1"; then
120+ echo "original flags to @gccProg@:" >&2
121+ for i in "${params[@]}"; do
122+ echo " $i" >&2
123+ done
124+ echo "extraBefore flags to @gccProg@:" >&2
125+ for i in ${extraBefore[@]}; do
126+ echo " $i" >&2
127+ done
128+ echo "extraAfter flags to @gccProg@:" >&2
129+ for i in ${extraAfter[@]}; do
130+ echo " $i" >&2
131+ done
132+fi
133+134+if test -n "$NIX_GCC_WRAPPER_EXEC_HOOK"; then
135+ source "$NIX_GCC_WRAPPER_EXEC_HOOK"
136+fi
137+138+139+# Call the real `gcc'. Filter out warnings from stderr about unused
140+# `-B' flags, since they confuse some programs. Deep bash magic to
141+# apply grep to stderr (by swapping stdin/stderr twice).
142+if test -z "$NIX_GCC_NEEDS_GREP"; then
143+ @gccProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]}
144+else
145+ (@gccProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} 3>&2 2>&1 1>&3- \
146+ | (grep -v 'file path prefix' || true); exit ${PIPESTATUS[0]}) 3>&2 2>&1 1>&3-
147+ exit $?
148+fi
···1+#! @shell@ -e
2+3+if test -n "$NIX_LD_WRAPPER_START_HOOK"; then
4+ source "$NIX_LD_WRAPPER_START_HOOK"
5+fi
6+7+if test -z "$NIX_GCC_WRAPPER_FLAGS_SET"; then
8+ source @out@/nix-support/add-flags.sh
9+fi
10+11+source @out@/nix-support/utils.sh
12+13+14+# Optionally filter out paths not refering to the store.
15+params=("$@")
16+if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE" \
17+ -a \( -z "$NIX_IGNORE_LD_THROUGH_GCC" -o -z "$NIX_LDFLAGS_SET" \); then
18+ rest=()
19+ n=0
20+ while test $n -lt ${#params[*]}; do
21+ p=${params[n]}
22+ p2=${params[$((n+1))]}
23+ if test "${p:0:3}" = "-L/" && badPath "${p:2}"; then
24+ skip $p
25+ elif test "$p" = "-L" && badPath "$p2"; then
26+ n=$((n + 1)); skip $p2
27+ elif test "$p" = "-rpath" && badPath "$p2"; then
28+ n=$((n + 1)); skip $p2
29+ elif test "$p" = "-dynamic-linker" && badPath "$p2"; then
30+ n=$((n + 1)); skip $p2
31+ elif test "${p:0:1}" = "/" && badPath "$p"; then
32+ # We cannot skip this; barf.
33+ echo "impure path \`$p' used in link" >&2
34+ exit 1
35+ else
36+ rest=("${rest[@]}" "$p")
37+ fi
38+ n=$((n + 1))
39+ done
40+ params=("${rest[@]}")
41+fi
42+43+44+extra=()
45+extraBefore=()
46+47+if test -z "$NIX_LDFLAGS_SET"; then
48+ extra=(${extra[@]} $NIX_LDFLAGS)
49+ extraBefore=(${extraBefore[@]} $NIX_LDFLAGS_BEFORE)
50+fi
51+52+53+# Add all used dynamic libraries to the rpath.
54+if test "$NIX_DONT_SET_RPATH" != "1"; then
55+56+ # First, find all -L... switches.
57+ allParams=("${params[@]}" ${extra[@]})
58+ libPath=""
59+ addToLibPath() {
60+ local path="$1"
61+ if test "${path:0:1}" != "/"; then return 0; fi
62+ case "$path" in
63+ *..*|*./*|*/.*|*//*)
64+ local path2
65+ if path2=$(readlink -f "$path"); then
66+ path="$path2"
67+ fi
68+ ;;
69+ esac
70+ case $libPath in
71+ *\ $path\ *) return 0 ;;
72+ esac
73+ libPath="$libPath $path "
74+ }
75+ n=0
76+ while test $n -lt ${#allParams[*]}; do
77+ p=${allParams[n]}
78+ p2=${allParams[$((n+1))]}
79+ if test "${p:0:3}" = "-L/"; then
80+ addToLibPath ${p:2}
81+ elif test "$p" = "-L"; then
82+ addToLibPath ${p2}
83+ n=$((n + 1))
84+ elif $(echo "$p" | grep -q '\.so\($\|\.\)'); then
85+ path="$(dirname "$p")";
86+ addToLibPath "${path}"
87+ fi
88+ n=$((n + 1))
89+ done
90+91+ # Second, for each directory in the library search path (-L...),
92+ # see if it contains a dynamic library used by a -l... flag. If
93+ # so, add the directory to the rpath.
94+ rpath=""
95+96+ addToRPath() {
97+ # If the path is not in the store, don't add it to the rpath.
98+ # This typically happens for libraries in /tmp that are later
99+ # copied to $out/lib. If not, we're screwed.
100+ if test "${1:0:${#NIX_STORE}}" != "$NIX_STORE"; then return 0; fi
101+ case $rpath in
102+ *\ $1\ *) return 0 ;;
103+ esac
104+ rpath="$rpath $1 "
105+ }
106+107+ for i in $libPath; do
108+ n=0
109+ while test $n -lt ${#allParams[*]}; do
110+ p=${allParams[n]}
111+ p2=${allParams[$((n+1))]}
112+ if test "${p:0:2}" = "-l" -a -f "$i/lib${p:2}.so"; then
113+ addToRPath $i
114+ break
115+ elif test "$p" = "-l" -a -f "$i/lib${p2}"; then
116+ # I haven't seen `-l foo', but you never know...
117+ addToRPath $i
118+ break
119+ elif $(echo "$p" | grep -q '\.so\($\|\.\)'); then
120+ path="$(dirname "$p")";
121+ if test "$path" == "$i"; then
122+ addToRPath $i
123+ break;
124+ fi
125+ fi
126+ n=$((n + 1))
127+ done
128+129+ done
130+131+132+ # Finally, add `-rpath' switches.
133+ for i in $rpath; do
134+ extra=(${extra[@]} -rpath $i)
135+ done
136+fi
137+138+139+# Optionally print debug info.
140+if test "$NIX_DEBUG" = "1"; then
141+ echo "original flags to @ld@:" >&2
142+ for i in "${params[@]}"; do
143+ echo " $i" >&2
144+ done
145+ echo "extra flags to @ld@:" >&2
146+ for i in ${extra[@]}; do
147+ echo " $i" >&2
148+ done
149+fi
150+151+if test -n "$NIX_LD_WRAPPER_EXEC_HOOK"; then
152+ source "$NIX_LD_WRAPPER_EXEC_HOOK"
153+fi
154+155+exec @ld@ ${extraBefore[@]} "${params[@]}" ${extra[@]}
+29
pkgs/build-support/gcc-wrapper2/setup-hook.sh
···00000000000000000000000000000
···1+addCVars () {
2+ if test -d $1/include; then
3+ export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$1/include"
4+ fi
5+6+ if test -d $1/lib64; then
7+ export NIX_LDFLAGS="$NIX_LDFLAGS -L$1/lib64"
8+ fi
9+10+ if test -d $1/lib; then
11+ export NIX_LDFLAGS="$NIX_LDFLAGS -L$1/lib"
12+ fi
13+}
14+15+envHooks=(${envHooks[@]} addCVars)
16+17+# Note: these come *after* $out in the PATH (see setup.sh).
18+19+if test -n "@gcc@"; then
20+ addToSearchPath PATH @gcc@/bin
21+fi
22+23+if test -n "@binutils@"; then
24+ addToSearchPath PATH @binutils@/bin
25+fi
26+27+if test -n "@libc@"; then
28+ addToSearchPath PATH @libc@/bin
29+fi
+23
pkgs/build-support/gcc-wrapper2/utils.sh
···00000000000000000000000
···1+skip () {
2+ if test "$NIX_DEBUG" = "1"; then
3+ echo "skipping impure path $1" >&2
4+ fi
5+}
6+7+8+# Checks whether a path is impure. E.g., `/lib/foo.so' is impure, but
9+# `/nix/store/.../lib/foo.so' isn't.
10+badPath() {
11+ local p=$1
12+13+ # Relative paths are okay (since they're presumably relative to
14+ # the temporary build directory).
15+ if test "${p:0:1}" != "/"; then return 1; fi
16+17+ # Otherwise, the path should refer to the store or some temporary
18+ # directory (including the build directory).
19+ test \
20+ "${p:0:${#NIX_STORE}}" != "$NIX_STORE" -a \
21+ "${p:0:4}" != "/tmp" -a \
22+ "${p:0:${#NIX_BUILD_TOP}}" != "$NIX_BUILD_TOP"
23+}
+16
pkgs/build-support/source-from-head-fun.nix
···0000000000000000
···1+/*
2+ purpose: mantain bleeding edge head sources.
3+4+ you run
5+ app --update
6+ app --publish
7+ to create source snapshots
8+9+ The documentation is availible at http://github.com/MarcWeber/nix-repository-manager/raw/master/README
10+11+*/
12+{ getConfig }:
13+ localTarName: publishedSrcSnapshot:
14+ if getConfig ["sourceFromHead" "useLocalRepos"] false then
15+ "${getConfig ["sourceFromHead" "managedRepoDir"] "/set/sourceFromHead.managedRepoDir/please"}/dist/${localTarName}"
16+ else publishedSrcSnapshot
···1args: with args;
20000000000000000000000000000000000000003stdenv.mkDerivation {
4 name = "haxe-cvs";
56- src = sourceByName "haxe";
00078 buildInputs = [ocaml zlib makeWrapper];
9···16 tar xfz $src --strip-components=1 -C haxe
1718 t(){ tar xfz $1 -C $2 --strip-components=2; }
19- t ${sourceByName "haxe_swflib"} ocaml/swflib
20- t ${sourceByName "haxe_extc"} ocaml/extc
21- t ${sourceByName "haxe_extlib_dev"} ocaml/extlib-dev
22- t ${sourceByName "haxe_xml_light"} ocaml/xml-light
23- t ${sourceByName "haxe_neko_include"} neko/libs
2425 sed -e '/download();/d' \
26 -e "s@/usr/lib/@''${zlib}/lib/@g" \
···1args: with args;
23+let
4+5+ src_haxe_swflib = {
6+ # REGION AUTO UPDATE: { name = "haxe_swflib"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "ocaml/swflib"; groups = "haxe_group"; }
7+ src= sourceFromHead "haxe_swflib-F_01-25-00.tar.gz"
8+ (fetchurl { url = "http://mawercer.de/~nix/repos/haxe_swflib-F_01-25-00.tar.gz"; sha256 = "ddea39427de23ff58d3b942bbcce2aac7a25dc11ae06ef983653c82614eba9cd"; });
9+ # END
10+ }.src;
11+12+ src_haxe_extc = {
13+ # REGION AUTO UPDATE: { name = "haxe_extc"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "ocaml/extc"; groups = "haxe_group"; }
14+ src= sourceFromHead "haxe_extc-F_01-25-08.tar.gz"
15+ (fetchurl { url = "http://mawercer.de/~nix/repos/haxe_extc-F_01-25-08.tar.gz"; sha256 = "ab2100391735d39c93c72b236ec6e9c5cf09461311a7e3a714d867861926ae37"; });
16+ # END
17+ }.src;
18+19+ src_haxe_extlib_dev = {
20+ # REGION AUTO UPDATE: { name = "haxe_extlib_dev"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "ocaml/extlib-dev"; groups = "haxe_group"; }
21+ src= sourceFromHead "haxe_extlib_dev-F_01-25-17.tar.gz"
22+ (fetchurl { url = "http://mawercer.de/~nix/repos/haxe_extlib_dev-F_01-25-17.tar.gz"; sha256 = "01c3c8afdf47a98320e65c0652492508854ea28ead0437abd17a4228b33c8066"; });
23+ # END
24+ }.src;
25+26+ src_haxe_xml_light = {
27+ # REGION AUTO UPDATE: { name = "haxe_xml_light"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "ocaml/xml-light"; groups = "haxe_group"; }
28+ src= sourceFromHead "haxe_xml_light-F_01-25-24.tar.gz"
29+ (fetchurl { url = "http://mawercer.de/~nix/repos/haxe_xml_light-F_01-25-24.tar.gz"; sha256 = "7fe244681698995af54085bb2ab873d3dd1ff2fac33aa8e7b00fcbbc50249334"; });
30+ # END
31+ }.src;
32+33+ src_haxe_neko_include = {
34+ # REGION AUTO UPDATE: { name = "haxe_neko_include"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "neko/libs/include/ocaml"; groups = "haxe_group"; }
35+ src= sourceFromHead "haxe_neko_include-F_01-25-28.tar.gz"
36+ (fetchurl { url = "http://mawercer.de/~nix/repos/haxe_neko_include-F_01-25-28.tar.gz"; sha256 = "8b642598889cf2fd1f99dfa037eef09b2511d30a8f5a6a75ee02b2e98fa4c6b7"; });
37+ # END
38+ }.src;
39+40+in
41+42stdenv.mkDerivation {
43 name = "haxe-cvs";
4445+ # REGION AUTO UPDATE: { name="haxe"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "haxe"; groups = "haxe_group"; }
46+ src= sourceFromHead "haxe-F_01-25-35.tar.gz"
47+ (fetchurl { url = "http://mawercer.de/~nix/repos/haxe-F_01-25-35.tar.gz"; sha256 = "8e5e5330e2fd7ffbbfe48d40bda03256aefbe30cf1be1d9c9065117b2b179f24"; });
48+ # END
4950 buildInputs = [ocaml zlib makeWrapper];
51···58 tar xfz $src --strip-components=1 -C haxe
5960 t(){ tar xfz $1 -C $2 --strip-components=2; }
61+ t ${src_haxe_swflib} ocaml/swflib
62+ t ${src_haxe_extc} ocaml/extc
63+ t ${src_haxe_extlib_dev} ocaml/extlib-dev
64+ t ${src_haxe_xml_light} ocaml/xml-light
65+ t ${src_haxe_neko_include} neko/libs
6667 sed -e '/download();/d' \
68 -e "s@/usr/lib/@''${zlib}/lib/@g" \
+4-1
pkgs/development/compilers/neko/default.nix
···1415 name = "neko-cvs";
1617- src = sourceByName "neko";
0001819 # optionally remove apache mysql like gentoo does?
20 # they just remove libs/{apache,mod_neko}
···1415 name = "neko-cvs";
1617+ # REGION AUTO UPDATE: { name="neko"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "neko"; }
18+ src= sourceFromHead "neko-F_01-20-32.tar.gz"
19+ (fetchurl { url = "http://mawercer.de/~nix/repos/neko-F_01-20-32.tar.gz"; sha256 = "785449f6df718fe26b6c87a2b7aa3cc587a72e7127582e6300ce966d97d6d16b"; });
20+ # END
2122 # optionally remove apache mysql like gentoo does?
23 # they just remove libs/{apache,mod_neko}
+21-2
pkgs/development/compilers/ocaml/3.11.1.nix
···2627 meta = {
28 homepage = http://caml.inria.fr/ocaml;
29- license = "QPL, LGPL2 (library part)";
30- desctiption = "Most popular variant of the Caml language";
000000000000000000031 };
3233})
···2627 meta = {
28 homepage = http://caml.inria.fr/ocaml;
29+ licenses = [ "QPL" /* compiler */ "LGPLv2" /* library */ ];
30+ description = "Objective Caml, the most popular variant of the Caml language";
31+32+ longDescription =
33+ '' Objective Caml is the most popular variant of the Caml language.
34+ From a language standpoint, it extends the core Caml language with a
35+ fully-fledged object-oriented layer, as well as a powerful module
36+ system, all connected by a sound, polymorphic type system featuring
37+ type inference.
38+39+ The Objective Caml system is an industrial-strength implementation
40+ of this language, featuring a high-performance native-code compiler
41+ (ocamlopt) for 9 processor architectures (IA32, PowerPC, AMD64,
42+ Alpha, Sparc, Mips, IA64, HPPA, StrongArm), as well as a bytecode
43+ compiler (ocamlc) and an interactive read-eval-print loop (ocaml)
44+ for quick development and portability. The Objective Caml
45+ distribution includes a comprehensive standard library, a replay
46+ debugger (ocamldebug), lexer (ocamllex) and parser (ocamlyacc)
47+ generators, a pre-processor pretty-printer (camlp4) and a
48+ documentation generator (ocamldoc).
49+ '';
50 };
5152})
+24
pkgs/development/compilers/polyml/default.nix
···000000000000000000000000
···1+{stdenv, fetchurl}:
2+3+let
4+ pname = "polyml";
5+ version = "5.3";
6+in
7+8+stdenv.mkDerivation {
9+ name = "${pname}-${version}";
10+11+ src = fetchurl {
12+ url = "mirror://sourceforge/${pname}/${pname}.${version}.tar.gz";
13+ sha256 = "154e836f4e65b5c72f8190d3c02e5ed237921cef716cb49add1e0e1e35fb2af4";
14+ };
15+16+ meta = {
17+ description = "Standard ML compiler and interpreter";
18+ longDescription = ''
19+ Poly/ML is a full implementation of Standard ML.
20+ '';
21+ homepage = http://www.polyml.org/;
22+ license = "LGPL";
23+ };
24+}
···3be many false references held on the stack, leading to the failure of
4such tests.
5000000000006--- a/test-suite/tests/threads.test
7+++ b/test-suite/tests/threads.test
8@@ -366,6 +366,7 @@
···3be many false references held on the stack, leading to the failure of
4such tests.
56+--- a/test-suite/tests/gc.test
7++++ b/test-suite/tests/gc.test
8+@@ -59,6 +59,7 @@
9+10+ (with-test-prefix "gc"
11+ (pass-if "Unused modules are removed"
12++ (throw 'unresolved)
13+ (let* ((guard (make-guardian))
14+ (total 1000))
15+16+17--- a/test-suite/tests/threads.test
18+++ b/test-suite/tests/threads.test
19@@ -366,6 +366,7 @@
+5-2
pkgs/development/interpreters/octave/hg.nix
···1{stdenv, fetchurl, gfortran, readline, ncurses, perl, flex,
2- bison, autoconf, automake, sourceByName, getConfig, lib, atlas, gperf, python, glibc, gnuplot, texinfo, texLive, qhull, libX11}:
34let commonBuildInputs = [gfortran readline ncurses perl glibc qhull libX11 texinfo]; in
5···14} // (
15 if (getConfig ["octave" "devVersion"] false) then {
16 name = "octave-hg"; # developement version mercurial repo
17- src = sourceByName "octave";
00018 # HOME is set to $TMP because octave needs to access ${HOME}/.octave_hist while running targets
19 # in doc/interpreter.. Maybe this can be done better. This hack is fastest :)
20 preConfigure = ''
···1{stdenv, fetchurl, gfortran, readline, ncurses, perl, flex,
2+ bison, autoconf, automake, sourceFromHead, getConfig, lib, atlas, gperf, python, glibc, gnuplot, texinfo, texLive, qhull, libX11}:
34let commonBuildInputs = [gfortran readline ncurses perl glibc qhull libX11 texinfo]; in
5···14} // (
15 if (getConfig ["octave" "devVersion"] false) then {
16 name = "octave-hg"; # developement version mercurial repo
17+ # REGION AUTO UPDATE: { name="octave"; type = "hg"; url = "http://www.octave.org/hg/octave"; }
18+ src = sourceFromHead "octave-03b414516dd8.tar.gz"
19+ (fetchurl { url = "http://mawercer.de/~nix/repos/octave-03b414516dd8.tar.gz"; sha256 = "30877f1e2ff1a456e7a76153aabf7c59ce7c7a8b63eda0515b1eead6a4351ce7"; });
20+ # END
21 # HOME is set to $TMP because octave needs to access ${HOME}/.octave_hist while running targets
22 # in doc/interpreter.. Maybe this can be done better. This hack is fastest :)
23 preConfigure = ''
···1+{ fetchurl, stdenv, ocaml, perl, python, ncurses, makeWrapper }:
2+3+stdenv.mkDerivation rec {
4+ name = "coccinelle-0.1.11rc1";
5+6+ src = fetchurl {
7+ url = "http://coccinelle.lip6.fr/distrib/${name}.tgz";
8+ sha256 = "1rdsv3qcl6zcx3d3zd4cl9d79hdgaw19llxbflkfxipvkg3vk59x";
9+ };
10+11+ buildInputs = [ ocaml perl python ncurses makeWrapper ];
12+13+ preConfigure =
14+ '' sed -i "configure" -e's|/usr/bin/perl|${perl}/bin/perl|g'
15+ sed -i "globals/config.ml.in" \
16+ -e"s|/usr/local/share|$out/share|g"
17+ '';
18+19+ buildPhase = "make depend && make all";
20+21+ # Most of the test suite seems to fail (?!).
22+ doCheck = false;
23+ checkPhase = "make test";
24+25+ postInstall =
26+ '' wrapProgram "$out/bin/spatch" \
27+ --prefix "LD_LIBRARY_PATH" ":" "$out/lib" \
28+ --prefix "PYTHONPATH" ":" "$out/share/coccinelle/python"
29+ '';
30+31+ meta = {
32+ description = "Coccinelle, a program to apply C code semantic patches";
33+34+ longDescription =
35+ '' Coccinelle is a program matching and transformation engine which
36+ provides the language SmPL (Semantic Patch Language) for specifying
37+ desired matches and transformations in C code. Coccinelle was
38+ initially targeted towards performing collateral evolutions in
39+ Linux. Such evolutions comprise the changes that are needed in
40+ client code in response to evolutions in library APIs, and may
41+ include modifications such as renaming a function, adding a function
42+ argument whose value is somehow context-dependent, and reorganizing
43+ a data structure. Beyond collateral evolutions, Coccinelle is
44+ successfully used (by us and others) for finding and fixing bugs in
45+ systems code.
46+ '';
47+48+ homepage = http://coccinelle.lip6.fr/;
49+ license = "GPLv2";
50+51+ maintainers = [ stdenv.lib.maintainers.ludo ];
52+ platforms = stdenv.lib.platforms.gnu; # arbitrary choice
53+ };
54+}
···89 # It's too tiresome to apply all patches which are availible (see previous rev).
10 # Using git repo which seems to be the same anyway..
11- src = bleedingEdgeRepos.sourceByName "autofs";
00012 /*fetchurl {
13 url = "${baseURL}/autofs-5.0.4.tar.bz2";
14 sha256 = "06ysv24jwhwvl8vbafy4jxcg9ps1iq5nrz2nyfm6c761rniy27v3";
···89 # It's too tiresome to apply all patches which are availible (see previous rev).
10 # Using git repo which seems to be the same anyway..
11+ # REGION AUTO UPDATE: { name="autofs"; type="git"; url="http://ftp.riken.go.jp/Linux/kernel.org/scm/linux/storage/autofs/autofs.git"; }
12+ src = sourceFromHead "autofs-9a77464b8a661d33a6205756955e0047727d5c1f.tar.gz"
13+ (fetchurl { url = "http://mawercer.de/~nix/repos/autofs-9a77464b8a661d33a6205756955e0047727d5c1f.tar.gz"; sha256 = "405c769b87f8ec2116faaca021ae03bb69d0a996cd574493b4eede34cb587061"; });
14+ # END
15 /*fetchurl {
16 url = "${baseURL}/autofs-5.0.4.tar.bz2";
17 sha256 = "06ysv24jwhwvl8vbafy4jxcg9ps1iq5nrz2nyfm6c761rniy27v3";
+2
pkgs/tools/cd-dvd/cdrkit/default.nix
···1011 buildInputs = [cmake libcap zlib bzip2];
120013 postInstall = ''
14 # file name compatibility with the old cdrecord (growisofs wants this name)
15 ln -s $out/bin/genisoimage $out/bin/mkisofs
···1011 buildInputs = [cmake libcap zlib bzip2];
1213+ patches = [ ./include-path.patch ];
14+15 postInstall = ''
16 # file name compatibility with the old cdrecord (growisofs wants this name)
17 ln -s $out/bin/genisoimage $out/bin/mkisofs
···1-{lib, bleedingEdgeRepos, writeText, ghcReal, getConfig, stdenv, writeScriptBin }:
2-3-/* usage
4- see pkgs/development/misc/bleeding-edge-repos/default.nix [1]
5- and pkgs/misc/bleeding-edge-fetch-infos.nix
6-7- Either add repository definitions which can be used by sourceByName "foo"
8- to [1] or config.nix. Example:
9-10- bleedingEdgeRepos = {
11- useLocalRepos = true; # prefer local dist file if availible
12-13- repos = {
14- # the attr names are equal to the repo IDs [2]
15- getOptions = { type="darcs"; url="http://repetae.net/john/repos/GetOptions"; };
16- nobug = { type = "git"; url="git://git.pipapo.org/nobug"; };
17- anyterm = { type = "svn"; url="http://svn.anyterm.org/anyterm/tags/releases/1.1/1.1.25/"; };
18- gnash = { type = "cvs"; cvsRoot=":pserver:anonymous@cvs.sv.gnu.org:/sources/gnash"; module="gnash"; };
19- octave = { type = "hg"; url="http://www.octave.org/hg/octave"; groups="octave_group"; };
20- };
21- };
22-23-24- to fetch / update the repository given by ID [2] use:
25- $ run-nix-repository-manager-with-config [$PATH_TO_NIXPKGS] --update ID
26- This will also calculate the current hash of the dist file which will be
27- saved to $PATH_TO_NIXPKGS/pkgs/misc/bleeding-edge-fetch-infos.nix.
28-29- Distribute the dist file which is stored in ~/managed_repos/dist using
30- $ run-nix-repository-manager-with-config --publish ID
31- this will upload the file to my server. Contact MarcWeber to get login data.
32- It should be easy to add multiple mirror locations instead (?)
33-34- You can add groups="xorg"; as seen above to update / distribute all
35- packages belonging to that group.
36-*/
37-38-let
39- inherit (builtins) getAttr attrNames;
40- inherit (lib) concatStringsSep mapAttrsFlatten;
41- toConfigLine = name : set :
42- "[(\"name\",\"${name}\")," + ( concatStringsSep "," (map (a: "(\"${a}\",\"${getAttr a set}\")" ) (attrNames set)))+"]";
43- config = writeText "nix-repository-manager_config"
44- (bleedingEdgeRepos.managedRepoDir+"\n" +
45- concatStringsSep "\n" (mapAttrsFlatten toConfigLine (bleedingEdgeRepos.repos)));
46-47- cfg = getConfig ["nixRepositoryManager" ] {};
48-49- provideSource = if (builtins.hasAttr "sourcefile" cfg) then
50- "cp ${cfg.sourcefile} source.hs "
51- else ''
52- src="${bleedingEdgeRepos.sourceByName "nix_repository_manager"}"
53- unpackPhase
54- mv nix_repsoitory_manager_tmp_dir/nix-repository-manager.hs source.hs
55- '';
56-57- nixRepositoryManager = stdenv.mkDerivation {
58- name = "nix-repository-manager";
59-60- phases="buildPhase";
61- buildPhase = ''
62- ${provideSource}
63- ensureDir $out/bin
64- ghc --make source.hs -o $out/bin/nix-repository-manager
65- '';
66-67- buildInputs = [ ghcReal ];
68-69- meta = {
70- description = "makes it easy to keep some packages up to date";
71- license = "GPL";
72- };
73- };
74-in writeScriptBin "run-nix-repository-manager-with-config"
75-''
76-#!/bin/sh
77-exec ${nixRepositoryManager}/bin/nix-repository-manager ${config} $@
78-''