···10101111 buildInputs = [ cmake libpng libtiff libjpeg panotools libxml2 ];
12121313- # I added these flags to get all the rpaths right, which I guess they are
1414- # taken from the qt4 sources. Not very nice.
1515- cmakeFlags = "-DCMAKE_SHARED_LINKER_FLAGS=\"-Wl,-rpath,$out/lib\"" +
1616- " -DCMAKE_EXE_LINKER_FLAGS=\"-Wl,-rpath,$out/lib" +
1717- " -lpng12 -lpano13 -ljpeg -ltiff -lz -lxml2 \"" +
1818- " -DCMAKE_SKIP_BUILD_RPATH=ON" +
1919- " -DCMAKE_BUILD_TYPE=Release" +
2020- " -DCMAKE_INSTALL_PREFIX=$out";
2121-2222- dontUseCmakeConfigure = true;
2323-2424- # I rewrote the configure phase to get the $out references evaluated in
2525- # cmakeFlags
2626- configurePhase = ''
2727- set -x
2828- mkdir -p build;
2929- cd build
3030- eval -- "cmake .. $cmakeFlags"
3131- set +x
3232- '';
3333-3413 meta = {
3514 homepage = http://hugin.sourceforge.net/;
3615 description = "Implementation in C of the autopano-sift algorithm for automatically stitching panoramas";
-20
pkgs/applications/graphics/freepv/default.nix
···1717 sed -i -e '/mozilla/d' src/CMakeLists.txt
1818 '';
19192020- # I added these flags to get all the rpaths right, which I guess they are
2121- # taken from the qt4 sources. Not very nice.
2222- cmakeFlags = " -DCMAKE_EXE_LINKER_FLAGS=\"" +
2323- " -lpng12 -lXxf86vm -ljpeg -lz -lglut -lGLU -lxml2 -lX11\"" +
2424- " -DCMAKE_SKIP_BUILD_RPATH=ON" +
2525- " -DCMAKE_BUILD_TYPE=Release" +
2626- " -DCMAKE_INSTALL_PREFIX=$out";
2727-2828- dontUseCmakeConfigure = true;
2929-3030- # I rewrote the configure phase to get the $out references evaluated in
3131- # cmakeFlags
3232- configurePhase = ''
3333- set -x
3434- mkdir -p build;
3535- cd build
3636- eval -- "cmake .. $cmakeFlags"
3737- set +x
3838- '';
3939-4020 meta = {
4121 description = "Open source panorama viewer using GL";
4222 homepage = http://freepv.sourceforge.net/;
+2-22
pkgs/applications/graphics/hugin/default.nix
···15151616 NIX_LDFLAGS = "-lrt";
17171818- # I added these flags to get all the rpaths right, which I guess they are
1919- # taken from the qt4 sources. Not very nice.
2020- cmakeFlags = "-DCMAKE_SHARED_LINKER_FLAGS=\"-Wl,-rpath,$out/lib\"" +
2121- " -DCMAKE_EXE_LINKER_FLAGS=\"-Wl,-rpath,$out/lib" +
2222- " -lpng12 -lpano13 -lImath -lIlmImf -lIex -lHalf -lIlmThread" +
2323- " -ljpeg -ltiff -lz -lexiv2 -lboost_thread\"" +
2424- " -DCMAKE_SKIP_BUILD_RPATH=ON" +
2525- " -DCMAKE_BUILD_TYPE=Release" +
2626- " -DCMAKE_INSTALL_PREFIX=$out";
2727-2828- buildInputs = [ cmake panotools wxGTK libtiff libpng openexr boost pkgconfig exiv2 gettext ilmbase ];
2929-3030- dontUseCmakeConfigure = true;
1818+ buildInputs = [ cmake panotools wxGTK libtiff libpng openexr boost pkgconfig
1919+ exiv2 gettext ilmbase ];
31203232- # I rewrote the configure phase to get the $out references evaluated in
3333- # cmakeFlags
3434- configurePhase = ''
3535- set -x
3636- mkdir -p build;
3737- cd build
3838- eval -- "cmake .. $cmakeFlags"
3939- set +x
4040- '';
4121 postInstall = ''
4222 ensureDir "$out/nix-support"
4323 echo "${enblendenfuse} ${autopanosiftc}" > $out/nix-support/propagated-user-env-packages
+6-26
pkgs/applications/graphics/paraview/default.nix
···11{ fetchurl, stdenv, cmake, qt4 }:
2233stdenv.mkDerivation {
44- name = "paraview-3.4.0";
44+ name = "paraview-3.6.1";
55 src = fetchurl {
66- url = http://www.paraview.org/files/v3.4/paraview-3.4.0.tar.gz;
77- sha256 = "27544f442e957e9aa60b32c674f2dcd84fffeecc9a40071ef6e305333413187d";
66+ url = http://www.paraview.org/files/v3.6/paraview-3.6.1.tar.gz;
77+ sha256 = "1dh0dqbdvjagy122nbwr1gg03ck2if2aqqbvzcpkx38sz12cjh7h";
88 };
991010- patches = [ ./include-qobject.patch ];
1111-1212- # I added these flags to get all the rpaths right, which I guess they are
1313- # taken from the qt4 sources. Not very nice.
1414- cmakeFlags = "-DCMAKE_SHARED_LINKER_FLAGS=\"-Wl,-rpath,$out/lib/paraview-3.4\"" +
1515- " -DCMAKE_EXE_LINKER_FLAGS=\"-Wl,-rpath,$out/lib/paraview-3.4" +
1616- " -lpng12 -lSM -lICE -lXrender -lXrandr -lXcursor -lXinerama" +
1717- " -lXfixes -lfreetype -lfontconfig -lXext -lX11 -lssl -lXt -lz\"" +
1818- " -DCMAKE_SKIP_BUILD_RPATH=ON" +
1919- " -DCMAKE_BUILD_TYPE=Release" +
2020- " -DCMAKE_INSTALL_PREFIX=$out";
2121-2222- dontUseCmakeConfigure = true;
2323-2424- # I rewrote the configure phase to get the $out references evaluated in
2525- # cmakeFlags
2626- configurePhase = ''
2727- set -x
2828- mkdir -p build;
2929- cd build
3030- eval -- "cmake .. $cmakeFlags"
3131- set +x
3232- '';
1010+ preConfigure = ''
1111+ export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/paraview-3.6"
1212+ '';
33133414 buildInputs = [ cmake qt4 ];
3515
···11+To be removed after we merge stdenv-updates in.
22+stdenv-updates should have this gcc-wrapper2 as gcc-wrapper.
33+44+Changelog against gcc-wrapper:
55+- Support for linking shared objects with direct mention of the /path/libxxx.so object,
66+ thus, adding its path to the rpath.
+24
pkgs/build-support/gcc-wrapper2/add-flags
···11+# `-B@out@/bin' forces gcc to use ld-wrapper.sh when calling ld.
22+export NIX_CFLAGS_COMPILE="-B@out@/bin/ $NIX_CFLAGS_COMPILE"
33+44+if test -e @out@/nix-support/libc-cflags; then
55+ export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/libc-cflags) $NIX_CFLAGS_COMPILE"
66+fi
77+88+if test -e @out@/nix-support/gcc-cflags; then
99+ export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/gcc-cflags) $NIX_CFLAGS_COMPILE"
1010+fi
1111+1212+if test -e @out@/nix-support/libc-ldflags; then
1313+ export NIX_LDFLAGS="$NIX_LDFLAGS $(cat @out@/nix-support/libc-ldflags)"
1414+fi
1515+1616+if test -e @out@/nix-support/gcc-ldflags; then
1717+ export NIX_LDFLAGS="$NIX_LDFLAGS $(cat @out@/nix-support/gcc-ldflags)"
1818+fi
1919+2020+if test -e @out@/nix-support/libc-ldflags-before; then
2121+ export NIX_LDFLAGS_BEFORE="$(cat @out@/nix-support/libc-ldflags-before) $NIX_LDFLAGS_BEFORE"
2222+fi
2323+2424+export NIX_GCC_WRAPPER_FLAGS_SET=1
+135
pkgs/build-support/gcc-wrapper2/builder.sh
···11+source $stdenv/setup
22+33+44+ensureDir $out/bin
55+ensureDir $out/nix-support
66+77+88+if test -z "$nativeLibc"; then
99+ dynamicLinker="$libc/lib/$dynamicLinker"
1010+ echo $dynamicLinker > $out/nix-support/dynamic-linker
1111+1212+ if test -e $libc/lib/32/ld-linux.so.2; then
1313+ echo $libc/lib/32/ld-linux.so.2 > $out/nix-support/dynamic-linker-m32
1414+ fi
1515+1616+ # The "-B$libc/lib/" flag is a quick hack to force gcc to link
1717+ # against the crt1.o from our own glibc, rather than the one in
1818+ # /usr/lib. (This is only an issue when using an `impure'
1919+ # compiler/linker, i.e., one that searches /usr/lib and so on.)
2020+ #
2121+ # Unfortunately, setting -B appears to override the default search
2222+ # path. Thus, the gcc-specific "../includes-fixed" directory is
2323+ # now longer searched and glibc's <limits.h> header fails to
2424+ # compile, because it uses "#include_next <limits.h>" to find the
2525+ # limits.h file in ../includes-fixed. To remedy the problem,
2626+ # another -idirafter is necessary to add that directory again.
2727+ echo "-B$libc/lib/ -idirafter $libc/include -idirafter $gcc/lib/gcc/*/*/include-fixed" > $out/nix-support/libc-cflags
2828+2929+ echo "-L$libc/lib" > $out/nix-support/libc-ldflags
3030+3131+ # The dynamic linker is passed in `ldflagsBefore' to allow
3232+ # explicit overrides of the dynamic linker by callers to gcc/ld
3333+ # (the *last* value counts, so ours should come first).
3434+ echo "-dynamic-linker $dynamicLinker" > $out/nix-support/libc-ldflags-before
3535+fi
3636+3737+if test -n "$nativeTools"; then
3838+ gccPath="$nativePrefix/bin"
3939+ ldPath="$nativePrefix/bin"
4040+else
4141+ if test -e "$gcc/lib64"; then
4242+ gccLDFlags="$gccLDFlags -L$gcc/lib64"
4343+ fi
4444+ gccLDFlags="$gccLDFlags -L$gcc/lib"
4545+ echo "$gccLDFlags" > $out/nix-support/gcc-ldflags
4646+4747+ # GCC shows $gcc/lib in `gcc -print-search-dirs', but not
4848+ # $gcc/lib64 (even though it does actually search there...)..
4949+ # This confuses libtool. So add it to the compiler tool search
5050+ # path explicitly.
5151+ if test -e "$gcc/lib64"; then
5252+ gccCFlags="$gccCFlags -B$gcc/lib64"
5353+ fi
5454+ echo "$gccCFlags" > $out/nix-support/gcc-cflags
5555+5656+ gccPath="$gcc/bin"
5757+ ldPath="$binutils/bin"
5858+fi
5959+6060+6161+doSubstitute() {
6262+ local src=$1
6363+ local dst=$2
6464+ # Can't use substitute() here, because replace may not have been
6565+ # built yet (in the bootstrap).
6666+ sed \
6767+ -e "s^@out@^$out^g" \
6868+ -e "s^@shell@^$shell^g" \
6969+ -e "s^@gcc@^$gcc^g" \
7070+ -e "s^@gccProg@^$gccProg^g" \
7171+ -e "s^@binutils@^$binutils^g" \
7272+ -e "s^@libc@^$libc^g" \
7373+ -e "s^@ld@^$ldPath/ld^g" \
7474+ < "$src" > "$dst"
7575+}
7676+7777+7878+# Make wrapper scripts around gcc, g++, and gfortran. Also make symlinks
7979+# cc, c++, and f77.
8080+mkGccWrapper() {
8181+ local dst=$1
8282+ local src=$2
8383+8484+ if ! test -f "$src"; then
8585+ echo "$src does not exist (skipping)"
8686+ return
8787+ fi
8888+8989+ gccProg="$src"
9090+ doSubstitute "$gccWrapper" "$dst"
9191+ chmod +x "$dst"
9292+}
9393+9494+mkGccWrapper $out/bin/gcc $gccPath/gcc
9595+ln -s gcc $out/bin/cc
9696+9797+mkGccWrapper $out/bin/g++ $gccPath/g++
9898+ln -s g++ $out/bin/c++
9999+100100+if test -e $gccPath/gfortran; then
101101+ mkGccWrapper $out/bin/gfortran $gccPath/gfortran
102102+ ln -s gfortran $out/bin/g77
103103+ ln -s gfortran $out/bin/f77
104104+fi
105105+106106+107107+# Create a symlink to as (the assembler). This is useful when a
108108+# gcc-wrapper is installed in a user environment, as it ensures that
109109+# the right assembler is called.
110110+ln -s $ldPath/as $out/bin/as
111111+112112+113113+# Make a wrapper around the linker.
114114+doSubstitute "$ldWrapper" "$out/bin/ld"
115115+chmod +x "$out/bin/ld"
116116+117117+118118+# Emit a setup hook. Also store the path to the original GCC and
119119+# Glibc.
120120+test -n "$gcc" && echo $gcc > $out/nix-support/orig-gcc
121121+test -n "$libc" && echo $libc > $out/nix-support/orig-libc
122122+123123+doSubstitute "$addFlags" "$out/nix-support/add-flags.sh"
124124+125125+doSubstitute "$setupHook" "$out/nix-support/setup-hook"
126126+127127+cp -p $utils $out/nix-support/utils.sh
128128+129129+130130+# Propagate the wrapped gcc so that if you install the wrapper, you get
131131+# tools like gcov, the manpages, etc. as well (including for binutils
132132+# and Glibc).
133133+if test -z "$nativeTools"; then
134134+ echo $gcc $binutils $libc > $out/nix-support/propagated-user-env-packages
135135+fi
+60
pkgs/build-support/gcc-wrapper2/default.nix
···11+# The Nix `gcc' stdenv.mkDerivation is not directly usable, since it doesn't
22+# know where the C library and standard header files are. Therefore
33+# the compiler produced by that package cannot be installed directly
44+# in a user environment and used from the command line. This
55+# stdenv.mkDerivation provides a wrapper that sets up the right environment
66+# variables so that the compiler and the linker just "work".
77+88+{ name ? "", stdenv, nativeTools, nativeLibc, nativePrefix ? ""
99+, gcc ? null, libc ? null, binutils ? null, shell ? ""
1010+}:
1111+1212+assert nativeTools -> nativePrefix != "";
1313+assert !nativeTools -> gcc != null && binutils != null;
1414+assert !nativeLibc -> libc != null;
1515+1616+let
1717+1818+ gccVersion = (builtins.parseDrvName gcc.name).version;
1919+ gccName = (builtins.parseDrvName gcc.name).name;
2020+2121+in
2222+2323+stdenv.mkDerivation {
2424+ name =
2525+ (if name != "" then name else gccName + "-wrapper") +
2626+ (if gcc != null && gccVersion != "" then "-" + gccVersion else "");
2727+2828+ builder = ./builder.sh;
2929+ setupHook = ./setup-hook.sh;
3030+ gccWrapper = ./gcc-wrapper.sh;
3131+ ldWrapper = ./ld-wrapper.sh;
3232+ utils = ./utils.sh;
3333+ addFlags = ./add-flags;
3434+3535+ inherit nativeTools nativeLibc nativePrefix gcc;
3636+ libc = if nativeLibc then null else libc;
3737+ binutils = if nativeTools then null else binutils;
3838+3939+ langC = if nativeTools then true else gcc.langC;
4040+ langCC = if nativeTools then true else gcc.langCC;
4141+ langFortran = if nativeTools then false else gcc ? langFortran;
4242+ shell = if shell == "" then stdenv.shell else shell;
4343+4444+ meta =
4545+ let gcc_ = if gcc != null then gcc else {}; in
4646+ (if gcc_ ? meta then removeAttrs gcc.meta ["priority"] else {}) //
4747+ { description =
4848+ stdenv.lib.attrByPath ["meta" "description"] "System C compiler" gcc_
4949+ + " (wrapper script)";
5050+ };
5151+5252+ # The dynamic linker has different names on different Linux platforms.
5353+ dynamicLinker =
5454+ if !nativeLibc then
5555+ (if stdenv.system == "i686-linux" then "ld-linux.so.2" else
5656+ if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2" else
5757+ if stdenv.system == "powerpc-linux" then "ld.so.1" else
5858+ abort "don't know the name of the dynamic linker for this platform")
5959+ else "";
6060+}
+148
pkgs/build-support/gcc-wrapper2/gcc-wrapper.sh
···11+#! @shell@ -e
22+33+if test -n "$NIX_GCC_WRAPPER_START_HOOK"; then
44+ source "$NIX_GCC_WRAPPER_START_HOOK"
55+fi
66+77+if test -z "$NIX_GCC_WRAPPER_FLAGS_SET"; then
88+ source @out@/nix-support/add-flags.sh
99+fi
1010+1111+source @out@/nix-support/utils.sh
1212+1313+1414+# Figure out if linker flags should be passed. GCC prints annoying
1515+# warnings when they are not needed.
1616+dontLink=0
1717+getVersion=0
1818+nonFlagArgs=0
1919+2020+for i in "$@"; do
2121+ if test "$i" = "-c"; then
2222+ dontLink=1
2323+ elif test "$i" = "-S"; then
2424+ dontLink=1
2525+ elif test "$i" = "-E"; then
2626+ dontLink=1
2727+ elif test "$i" = "-E"; then
2828+ dontLink=1
2929+ elif test "$i" = "-M"; then
3030+ dontLink=1
3131+ elif test "$i" = "-MM"; then
3232+ dontLink=1
3333+ elif test "${i:0:1}" != "-"; then
3434+ nonFlagArgs=1
3535+ elif test "$i" = "-m32"; then
3636+ if test -e @out@/nix-support/dynamic-linker-m32; then
3737+ NIX_LDFLAGS="$NIX_LDFLAGS -dynamic-linker $(cat @out@/nix-support/dynamic-linker-m32)"
3838+ fi
3939+ fi
4040+done
4141+4242+# If we pass a flag like -Wl, then gcc will call the linker unless it
4343+# can figure out that it has to do something else (e.g., because of a
4444+# "-c" flag). So if no non-flag arguments are given, don't pass any
4545+# linker flags. This catches cases like "gcc" (should just print
4646+# "gcc: no input files") and "gcc -v" (should print the version).
4747+if test "$nonFlagArgs" = "0"; then
4848+ dontLink=1
4949+fi
5050+5151+5252+# Optionally filter out paths not refering to the store.
5353+params=("$@")
5454+if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE"; then
5555+ rest=()
5656+ n=0
5757+ while test $n -lt ${#params[*]}; do
5858+ p=${params[n]}
5959+ p2=${params[$((n+1))]}
6060+ if test "${p:0:3}" = "-L/" && badPath "${p:2}"; then
6161+ skip $p
6262+ elif test "$p" = "-L" && badPath "$p2"; then
6363+ n=$((n + 1)); skip $p2
6464+ elif test "${p:0:3}" = "-I/" && badPath "${p:2}"; then
6565+ skip $p
6666+ elif test "$p" = "-I" && badPath "$p2"; then
6767+ n=$((n + 1)); skip $p2
6868+ elif test "$p" = "-isystem" && badPath "$p2"; then
6969+ n=$((n + 1)); skip $p2
7070+ else
7171+ rest=("${rest[@]}" "$p")
7272+ fi
7373+ n=$((n + 1))
7474+ done
7575+ params=("${rest[@]}")
7676+fi
7777+7878+7979+# Add the flags for the C compiler proper.
8080+extraAfter=($NIX_CFLAGS_COMPILE)
8181+extraBefore=()
8282+8383+if test "$dontLink" != "1"; then
8484+8585+ # Add the flags that should only be passed to the compiler when
8686+ # linking.
8787+ extraAfter=(${extraAfter[@]} $NIX_CFLAGS_LINK)
8888+8989+ # Add the flags that should be passed to the linker (and prevent
9090+ # `ld-wrapper' from adding NIX_LDFLAGS again).
9191+ for i in $NIX_LDFLAGS_BEFORE; do
9292+ extraBefore=(${extraBefore[@]} "-Wl,$i")
9393+ done
9494+ for i in $NIX_LDFLAGS; do
9595+ if test "${i:0:3}" = "-L/"; then
9696+ extraAfter=(${extraAfter[@]} "$i")
9797+ else
9898+ extraAfter=(${extraAfter[@]} "-Wl,$i")
9999+ fi
100100+ done
101101+ export NIX_LDFLAGS_SET=1
102102+103103+ if test "$NIX_STRIP_DEBUG" = "1"; then
104104+ # Add executable-stripping flags.
105105+ extraAfter=(${extraAfter[@]} $NIX_CFLAGS_STRIP)
106106+ fi
107107+fi
108108+109109+# As a very special hack, if the arguments are just `-v', then don't
110110+# add anything. This is to prevent `gcc -v' (which normally prints
111111+# out the version number and returns exit code 0) from printing out
112112+# `No input files specified' and returning exit code 1.
113113+if test "$*" = "-v"; then
114114+ extraAfter=()
115115+ extraBefore=()
116116+fi
117117+118118+# Optionally print debug info.
119119+if test "$NIX_DEBUG" = "1"; then
120120+ echo "original flags to @gccProg@:" >&2
121121+ for i in "${params[@]}"; do
122122+ echo " $i" >&2
123123+ done
124124+ echo "extraBefore flags to @gccProg@:" >&2
125125+ for i in ${extraBefore[@]}; do
126126+ echo " $i" >&2
127127+ done
128128+ echo "extraAfter flags to @gccProg@:" >&2
129129+ for i in ${extraAfter[@]}; do
130130+ echo " $i" >&2
131131+ done
132132+fi
133133+134134+if test -n "$NIX_GCC_WRAPPER_EXEC_HOOK"; then
135135+ source "$NIX_GCC_WRAPPER_EXEC_HOOK"
136136+fi
137137+138138+139139+# Call the real `gcc'. Filter out warnings from stderr about unused
140140+# `-B' flags, since they confuse some programs. Deep bash magic to
141141+# apply grep to stderr (by swapping stdin/stderr twice).
142142+if test -z "$NIX_GCC_NEEDS_GREP"; then
143143+ @gccProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]}
144144+else
145145+ (@gccProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} 3>&2 2>&1 1>&3- \
146146+ | (grep -v 'file path prefix' || true); exit ${PIPESTATUS[0]}) 3>&2 2>&1 1>&3-
147147+ exit $?
148148+fi
+155
pkgs/build-support/gcc-wrapper2/ld-wrapper.sh
···11+#! @shell@ -e
22+33+if test -n "$NIX_LD_WRAPPER_START_HOOK"; then
44+ source "$NIX_LD_WRAPPER_START_HOOK"
55+fi
66+77+if test -z "$NIX_GCC_WRAPPER_FLAGS_SET"; then
88+ source @out@/nix-support/add-flags.sh
99+fi
1010+1111+source @out@/nix-support/utils.sh
1212+1313+1414+# Optionally filter out paths not refering to the store.
1515+params=("$@")
1616+if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE" \
1717+ -a \( -z "$NIX_IGNORE_LD_THROUGH_GCC" -o -z "$NIX_LDFLAGS_SET" \); then
1818+ rest=()
1919+ n=0
2020+ while test $n -lt ${#params[*]}; do
2121+ p=${params[n]}
2222+ p2=${params[$((n+1))]}
2323+ if test "${p:0:3}" = "-L/" && badPath "${p:2}"; then
2424+ skip $p
2525+ elif test "$p" = "-L" && badPath "$p2"; then
2626+ n=$((n + 1)); skip $p2
2727+ elif test "$p" = "-rpath" && badPath "$p2"; then
2828+ n=$((n + 1)); skip $p2
2929+ elif test "$p" = "-dynamic-linker" && badPath "$p2"; then
3030+ n=$((n + 1)); skip $p2
3131+ elif test "${p:0:1}" = "/" && badPath "$p"; then
3232+ # We cannot skip this; barf.
3333+ echo "impure path \`$p' used in link" >&2
3434+ exit 1
3535+ else
3636+ rest=("${rest[@]}" "$p")
3737+ fi
3838+ n=$((n + 1))
3939+ done
4040+ params=("${rest[@]}")
4141+fi
4242+4343+4444+extra=()
4545+extraBefore=()
4646+4747+if test -z "$NIX_LDFLAGS_SET"; then
4848+ extra=(${extra[@]} $NIX_LDFLAGS)
4949+ extraBefore=(${extraBefore[@]} $NIX_LDFLAGS_BEFORE)
5050+fi
5151+5252+5353+# Add all used dynamic libraries to the rpath.
5454+if test "$NIX_DONT_SET_RPATH" != "1"; then
5555+5656+ # First, find all -L... switches.
5757+ allParams=("${params[@]}" ${extra[@]})
5858+ libPath=""
5959+ addToLibPath() {
6060+ local path="$1"
6161+ if test "${path:0:1}" != "/"; then return 0; fi
6262+ case "$path" in
6363+ *..*|*./*|*/.*|*//*)
6464+ local path2
6565+ if path2=$(readlink -f "$path"); then
6666+ path="$path2"
6767+ fi
6868+ ;;
6969+ esac
7070+ case $libPath in
7171+ *\ $path\ *) return 0 ;;
7272+ esac
7373+ libPath="$libPath $path "
7474+ }
7575+ n=0
7676+ while test $n -lt ${#allParams[*]}; do
7777+ p=${allParams[n]}
7878+ p2=${allParams[$((n+1))]}
7979+ if test "${p:0:3}" = "-L/"; then
8080+ addToLibPath ${p:2}
8181+ elif test "$p" = "-L"; then
8282+ addToLibPath ${p2}
8383+ n=$((n + 1))
8484+ elif $(echo "$p" | grep -q '\.so\($\|\.\)'); then
8585+ path="$(dirname "$p")";
8686+ addToLibPath "${path}"
8787+ fi
8888+ n=$((n + 1))
8989+ done
9090+9191+ # Second, for each directory in the library search path (-L...),
9292+ # see if it contains a dynamic library used by a -l... flag. If
9393+ # so, add the directory to the rpath.
9494+ rpath=""
9595+9696+ addToRPath() {
9797+ # If the path is not in the store, don't add it to the rpath.
9898+ # This typically happens for libraries in /tmp that are later
9999+ # copied to $out/lib. If not, we're screwed.
100100+ if test "${1:0:${#NIX_STORE}}" != "$NIX_STORE"; then return 0; fi
101101+ case $rpath in
102102+ *\ $1\ *) return 0 ;;
103103+ esac
104104+ rpath="$rpath $1 "
105105+ }
106106+107107+ for i in $libPath; do
108108+ n=0
109109+ while test $n -lt ${#allParams[*]}; do
110110+ p=${allParams[n]}
111111+ p2=${allParams[$((n+1))]}
112112+ if test "${p:0:2}" = "-l" -a -f "$i/lib${p:2}.so"; then
113113+ addToRPath $i
114114+ break
115115+ elif test "$p" = "-l" -a -f "$i/lib${p2}"; then
116116+ # I haven't seen `-l foo', but you never know...
117117+ addToRPath $i
118118+ break
119119+ elif $(echo "$p" | grep -q '\.so\($\|\.\)'); then
120120+ path="$(dirname "$p")";
121121+ if test "$path" == "$i"; then
122122+ addToRPath $i
123123+ break;
124124+ fi
125125+ fi
126126+ n=$((n + 1))
127127+ done
128128+129129+ done
130130+131131+132132+ # Finally, add `-rpath' switches.
133133+ for i in $rpath; do
134134+ extra=(${extra[@]} -rpath $i)
135135+ done
136136+fi
137137+138138+139139+# Optionally print debug info.
140140+if test "$NIX_DEBUG" = "1"; then
141141+ echo "original flags to @ld@:" >&2
142142+ for i in "${params[@]}"; do
143143+ echo " $i" >&2
144144+ done
145145+ echo "extra flags to @ld@:" >&2
146146+ for i in ${extra[@]}; do
147147+ echo " $i" >&2
148148+ done
149149+fi
150150+151151+if test -n "$NIX_LD_WRAPPER_EXEC_HOOK"; then
152152+ source "$NIX_LD_WRAPPER_EXEC_HOOK"
153153+fi
154154+155155+exec @ld@ ${extraBefore[@]} "${params[@]}" ${extra[@]}
+29
pkgs/build-support/gcc-wrapper2/setup-hook.sh
···11+addCVars () {
22+ if test -d $1/include; then
33+ export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$1/include"
44+ fi
55+66+ if test -d $1/lib64; then
77+ export NIX_LDFLAGS="$NIX_LDFLAGS -L$1/lib64"
88+ fi
99+1010+ if test -d $1/lib; then
1111+ export NIX_LDFLAGS="$NIX_LDFLAGS -L$1/lib"
1212+ fi
1313+}
1414+1515+envHooks=(${envHooks[@]} addCVars)
1616+1717+# Note: these come *after* $out in the PATH (see setup.sh).
1818+1919+if test -n "@gcc@"; then
2020+ addToSearchPath PATH @gcc@/bin
2121+fi
2222+2323+if test -n "@binutils@"; then
2424+ addToSearchPath PATH @binutils@/bin
2525+fi
2626+2727+if test -n "@libc@"; then
2828+ addToSearchPath PATH @libc@/bin
2929+fi
+23
pkgs/build-support/gcc-wrapper2/utils.sh
···11+skip () {
22+ if test "$NIX_DEBUG" = "1"; then
33+ echo "skipping impure path $1" >&2
44+ fi
55+}
66+77+88+# Checks whether a path is impure. E.g., `/lib/foo.so' is impure, but
99+# `/nix/store/.../lib/foo.so' isn't.
1010+badPath() {
1111+ local p=$1
1212+1313+ # Relative paths are okay (since they're presumably relative to
1414+ # the temporary build directory).
1515+ if test "${p:0:1}" != "/"; then return 1; fi
1616+1717+ # Otherwise, the path should refer to the store or some temporary
1818+ # directory (including the build directory).
1919+ test \
2020+ "${p:0:${#NIX_STORE}}" != "$NIX_STORE" -a \
2121+ "${p:0:4}" != "/tmp" -a \
2222+ "${p:0:${#NIX_BUILD_TOP}}" != "$NIX_BUILD_TOP"
2323+}
+16
pkgs/build-support/source-from-head-fun.nix
···11+/*
22+ purpose: mantain bleeding edge head sources.
33+44+ you run
55+ app --update
66+ app --publish
77+ to create source snapshots
88+99+ The documentation is availible at http://github.com/MarcWeber/nix-repository-manager/raw/master/README
1010+1111+*/
1212+{ getConfig }:
1313+ localTarName: publishedSrcSnapshot:
1414+ if getConfig ["sourceFromHead" "useLocalRepos"] false then
1515+ "${getConfig ["sourceFromHead" "managedRepoDir"] "/set/sourceFromHead.managedRepoDir/please"}/dist/${localTarName}"
1616+ else publishedSrcSnapshot
···11args: with args;
2233+let
44+55+ src_haxe_swflib = {
66+ # REGION AUTO UPDATE: { name = "haxe_swflib"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "ocaml/swflib"; groups = "haxe_group"; }
77+ src= sourceFromHead "haxe_swflib-F_01-25-00.tar.gz"
88+ (fetchurl { url = "http://mawercer.de/~nix/repos/haxe_swflib-F_01-25-00.tar.gz"; sha256 = "ddea39427de23ff58d3b942bbcce2aac7a25dc11ae06ef983653c82614eba9cd"; });
99+ # END
1010+ }.src;
1111+1212+ src_haxe_extc = {
1313+ # REGION AUTO UPDATE: { name = "haxe_extc"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "ocaml/extc"; groups = "haxe_group"; }
1414+ src= sourceFromHead "haxe_extc-F_01-25-08.tar.gz"
1515+ (fetchurl { url = "http://mawercer.de/~nix/repos/haxe_extc-F_01-25-08.tar.gz"; sha256 = "ab2100391735d39c93c72b236ec6e9c5cf09461311a7e3a714d867861926ae37"; });
1616+ # END
1717+ }.src;
1818+1919+ src_haxe_extlib_dev = {
2020+ # REGION AUTO UPDATE: { name = "haxe_extlib_dev"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "ocaml/extlib-dev"; groups = "haxe_group"; }
2121+ src= sourceFromHead "haxe_extlib_dev-F_01-25-17.tar.gz"
2222+ (fetchurl { url = "http://mawercer.de/~nix/repos/haxe_extlib_dev-F_01-25-17.tar.gz"; sha256 = "01c3c8afdf47a98320e65c0652492508854ea28ead0437abd17a4228b33c8066"; });
2323+ # END
2424+ }.src;
2525+2626+ src_haxe_xml_light = {
2727+ # REGION AUTO UPDATE: { name = "haxe_xml_light"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "ocaml/xml-light"; groups = "haxe_group"; }
2828+ src= sourceFromHead "haxe_xml_light-F_01-25-24.tar.gz"
2929+ (fetchurl { url = "http://mawercer.de/~nix/repos/haxe_xml_light-F_01-25-24.tar.gz"; sha256 = "7fe244681698995af54085bb2ab873d3dd1ff2fac33aa8e7b00fcbbc50249334"; });
3030+ # END
3131+ }.src;
3232+3333+ src_haxe_neko_include = {
3434+ # 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"; }
3535+ src= sourceFromHead "haxe_neko_include-F_01-25-28.tar.gz"
3636+ (fetchurl { url = "http://mawercer.de/~nix/repos/haxe_neko_include-F_01-25-28.tar.gz"; sha256 = "8b642598889cf2fd1f99dfa037eef09b2511d30a8f5a6a75ee02b2e98fa4c6b7"; });
3737+ # END
3838+ }.src;
3939+4040+in
4141+342stdenv.mkDerivation {
443 name = "haxe-cvs";
54466- src = sourceByName "haxe";
4545+ # REGION AUTO UPDATE: { name="haxe"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "haxe"; groups = "haxe_group"; }
4646+ src= sourceFromHead "haxe-F_01-25-35.tar.gz"
4747+ (fetchurl { url = "http://mawercer.de/~nix/repos/haxe-F_01-25-35.tar.gz"; sha256 = "8e5e5330e2fd7ffbbfe48d40bda03256aefbe30cf1be1d9c9065117b2b179f24"; });
4848+ # END
749850 buildInputs = [ocaml zlib makeWrapper];
951···1658 tar xfz $src --strip-components=1 -C haxe
17591860 t(){ tar xfz $1 -C $2 --strip-components=2; }
1919- t ${sourceByName "haxe_swflib"} ocaml/swflib
2020- t ${sourceByName "haxe_extc"} ocaml/extc
2121- t ${sourceByName "haxe_extlib_dev"} ocaml/extlib-dev
2222- t ${sourceByName "haxe_xml_light"} ocaml/xml-light
2323- t ${sourceByName "haxe_neko_include"} neko/libs
6161+ t ${src_haxe_swflib} ocaml/swflib
6262+ t ${src_haxe_extc} ocaml/extc
6363+ t ${src_haxe_extlib_dev} ocaml/extlib-dev
6464+ t ${src_haxe_xml_light} ocaml/xml-light
6565+ t ${src_haxe_neko_include} neko/libs
24662567 sed -e '/download();/d' \
2668 -e "s@/usr/lib/@''${zlib}/lib/@g" \
+4-1
pkgs/development/compilers/neko/default.nix
···14141515 name = "neko-cvs";
16161717- src = sourceByName "neko";
1717+ # REGION AUTO UPDATE: { name="neko"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "neko"; }
1818+ src= sourceFromHead "neko-F_01-20-32.tar.gz"
1919+ (fetchurl { url = "http://mawercer.de/~nix/repos/neko-F_01-20-32.tar.gz"; sha256 = "785449f6df718fe26b6c87a2b7aa3cc587a72e7127582e6300ce966d97d6d16b"; });
2020+ # END
18211922 # optionally remove apache mysql like gentoo does?
2023 # they just remove libs/{apache,mod_neko}
+21-2
pkgs/development/compilers/ocaml/3.11.1.nix
···26262727 meta = {
2828 homepage = http://caml.inria.fr/ocaml;
2929- license = "QPL, LGPL2 (library part)";
3030- desctiption = "Most popular variant of the Caml language";
2929+ licenses = [ "QPL" /* compiler */ "LGPLv2" /* library */ ];
3030+ description = "Objective Caml, the most popular variant of the Caml language";
3131+3232+ longDescription =
3333+ '' Objective Caml is the most popular variant of the Caml language.
3434+ From a language standpoint, it extends the core Caml language with a
3535+ fully-fledged object-oriented layer, as well as a powerful module
3636+ system, all connected by a sound, polymorphic type system featuring
3737+ type inference.
3838+3939+ The Objective Caml system is an industrial-strength implementation
4040+ of this language, featuring a high-performance native-code compiler
4141+ (ocamlopt) for 9 processor architectures (IA32, PowerPC, AMD64,
4242+ Alpha, Sparc, Mips, IA64, HPPA, StrongArm), as well as a bytecode
4343+ compiler (ocamlc) and an interactive read-eval-print loop (ocaml)
4444+ for quick development and portability. The Objective Caml
4545+ distribution includes a comprehensive standard library, a replay
4646+ debugger (ocamldebug), lexer (ocamllex) and parser (ocamlyacc)
4747+ generators, a pre-processor pretty-printer (camlp4) and a
4848+ documentation generator (ocamldoc).
4949+ '';
3150 };
32513352})
+24
pkgs/development/compilers/polyml/default.nix
···11+{stdenv, fetchurl}:
22+33+let
44+ pname = "polyml";
55+ version = "5.3";
66+in
77+88+stdenv.mkDerivation {
99+ name = "${pname}-${version}";
1010+1111+ src = fetchurl {
1212+ url = "mirror://sourceforge/${pname}/${pname}.${version}.tar.gz";
1313+ sha256 = "154e836f4e65b5c72f8190d3c02e5ed237921cef716cb49add1e0e1e35fb2af4";
1414+ };
1515+1616+ meta = {
1717+ description = "Standard ML compiler and interpreter";
1818+ longDescription = ''
1919+ Poly/ML is a full implementation of Standard ML.
2020+ '';
2121+ homepage = http://www.polyml.org/;
2222+ license = "LGPL";
2323+ };
2424+}
···11+{ fetchurl, stdenv, ocaml, perl, python, ncurses, makeWrapper }:
22+33+stdenv.mkDerivation rec {
44+ name = "coccinelle-0.1.11rc1";
55+66+ src = fetchurl {
77+ url = "http://coccinelle.lip6.fr/distrib/${name}.tgz";
88+ sha256 = "1rdsv3qcl6zcx3d3zd4cl9d79hdgaw19llxbflkfxipvkg3vk59x";
99+ };
1010+1111+ buildInputs = [ ocaml perl python ncurses makeWrapper ];
1212+1313+ preConfigure =
1414+ '' sed -i "configure" -e's|/usr/bin/perl|${perl}/bin/perl|g'
1515+ sed -i "globals/config.ml.in" \
1616+ -e"s|/usr/local/share|$out/share|g"
1717+ '';
1818+1919+ buildPhase = "make depend && make all";
2020+2121+ # Most of the test suite seems to fail (?!).
2222+ doCheck = false;
2323+ checkPhase = "make test";
2424+2525+ postInstall =
2626+ '' wrapProgram "$out/bin/spatch" \
2727+ --prefix "LD_LIBRARY_PATH" ":" "$out/lib" \
2828+ --prefix "PYTHONPATH" ":" "$out/share/coccinelle/python"
2929+ '';
3030+3131+ meta = {
3232+ description = "Coccinelle, a program to apply C code semantic patches";
3333+3434+ longDescription =
3535+ '' Coccinelle is a program matching and transformation engine which
3636+ provides the language SmPL (Semantic Patch Language) for specifying
3737+ desired matches and transformations in C code. Coccinelle was
3838+ initially targeted towards performing collateral evolutions in
3939+ Linux. Such evolutions comprise the changes that are needed in
4040+ client code in response to evolutions in library APIs, and may
4141+ include modifications such as renaming a function, adding a function
4242+ argument whose value is somehow context-dependent, and reorganizing
4343+ a data structure. Beyond collateral evolutions, Coccinelle is
4444+ successfully used (by us and others) for finding and fixing bugs in
4545+ systems code.
4646+ '';
4747+4848+ homepage = http://coccinelle.lip6.fr/;
4949+ license = "GPLv2";
5050+5151+ maintainers = [ stdenv.lib.maintainers.ludo ];
5252+ platforms = stdenv.lib.platforms.gnu; # arbitrary choice
5353+ };
5454+}
···8899 # It's too tiresome to apply all patches which are availible (see previous rev).
1010 # Using git repo which seems to be the same anyway..
1111- src = bleedingEdgeRepos.sourceByName "autofs";
1111+ # REGION AUTO UPDATE: { name="autofs"; type="git"; url="http://ftp.riken.go.jp/Linux/kernel.org/scm/linux/storage/autofs/autofs.git"; }
1212+ src = sourceFromHead "autofs-9a77464b8a661d33a6205756955e0047727d5c1f.tar.gz"
1313+ (fetchurl { url = "http://mawercer.de/~nix/repos/autofs-9a77464b8a661d33a6205756955e0047727d5c1f.tar.gz"; sha256 = "405c769b87f8ec2116faaca021ae03bb69d0a996cd574493b4eede34cb587061"; });
1414+ # END
1215 /*fetchurl {
1316 url = "${baseURL}/autofs-5.0.4.tar.bz2";
1417 sha256 = "06ysv24jwhwvl8vbafy4jxcg9ps1iq5nrz2nyfm6c761rniy27v3";
+2
pkgs/tools/cd-dvd/cdrkit/default.nix
···10101111 buildInputs = [cmake libcap zlib bzip2];
12121313+ patches = [ ./include-path.patch ];
1414+1315 postInstall = ''
1416 # file name compatibility with the old cdrecord (growisofs wants this name)
1517 ln -s $out/bin/genisoimage $out/bin/mkisofs
···11-{lib, bleedingEdgeRepos, writeText, ghcReal, getConfig, stdenv, writeScriptBin }:
22-33-/* usage
44- see pkgs/development/misc/bleeding-edge-repos/default.nix [1]
55- and pkgs/misc/bleeding-edge-fetch-infos.nix
66-77- Either add repository definitions which can be used by sourceByName "foo"
88- to [1] or config.nix. Example:
99-1010- bleedingEdgeRepos = {
1111- useLocalRepos = true; # prefer local dist file if availible
1212-1313- repos = {
1414- # the attr names are equal to the repo IDs [2]
1515- getOptions = { type="darcs"; url="http://repetae.net/john/repos/GetOptions"; };
1616- nobug = { type = "git"; url="git://git.pipapo.org/nobug"; };
1717- anyterm = { type = "svn"; url="http://svn.anyterm.org/anyterm/tags/releases/1.1/1.1.25/"; };
1818- gnash = { type = "cvs"; cvsRoot=":pserver:anonymous@cvs.sv.gnu.org:/sources/gnash"; module="gnash"; };
1919- octave = { type = "hg"; url="http://www.octave.org/hg/octave"; groups="octave_group"; };
2020- };
2121- };
2222-2323-2424- to fetch / update the repository given by ID [2] use:
2525- $ run-nix-repository-manager-with-config [$PATH_TO_NIXPKGS] --update ID
2626- This will also calculate the current hash of the dist file which will be
2727- saved to $PATH_TO_NIXPKGS/pkgs/misc/bleeding-edge-fetch-infos.nix.
2828-2929- Distribute the dist file which is stored in ~/managed_repos/dist using
3030- $ run-nix-repository-manager-with-config --publish ID
3131- this will upload the file to my server. Contact MarcWeber to get login data.
3232- It should be easy to add multiple mirror locations instead (?)
3333-3434- You can add groups="xorg"; as seen above to update / distribute all
3535- packages belonging to that group.
3636-*/
3737-3838-let
3939- inherit (builtins) getAttr attrNames;
4040- inherit (lib) concatStringsSep mapAttrsFlatten;
4141- toConfigLine = name : set :
4242- "[(\"name\",\"${name}\")," + ( concatStringsSep "," (map (a: "(\"${a}\",\"${getAttr a set}\")" ) (attrNames set)))+"]";
4343- config = writeText "nix-repository-manager_config"
4444- (bleedingEdgeRepos.managedRepoDir+"\n" +
4545- concatStringsSep "\n" (mapAttrsFlatten toConfigLine (bleedingEdgeRepos.repos)));
4646-4747- cfg = getConfig ["nixRepositoryManager" ] {};
4848-4949- provideSource = if (builtins.hasAttr "sourcefile" cfg) then
5050- "cp ${cfg.sourcefile} source.hs "
5151- else ''
5252- src="${bleedingEdgeRepos.sourceByName "nix_repository_manager"}"
5353- unpackPhase
5454- mv nix_repsoitory_manager_tmp_dir/nix-repository-manager.hs source.hs
5555- '';
5656-5757- nixRepositoryManager = stdenv.mkDerivation {
5858- name = "nix-repository-manager";
5959-6060- phases="buildPhase";
6161- buildPhase = ''
6262- ${provideSource}
6363- ensureDir $out/bin
6464- ghc --make source.hs -o $out/bin/nix-repository-manager
6565- '';
6666-6767- buildInputs = [ ghcReal ];
6868-6969- meta = {
7070- description = "makes it easy to keep some packages up to date";
7171- license = "GPL";
7272- };
7373- };
7474-in writeScriptBin "run-nix-repository-manager-with-config"
7575-''
7676-#!/bin/sh
7777-exec ${nixRepositoryManager}/bin/nix-repository-manager ${config} $@
7878-''
+5
pkgs/tools/video/mjpegtools/default.nix
···77 sha256 = "1xvgqzdb2rw6j4ss65k4hrzrbsl74p7k5l4qgf5dbfcw522kw7lb";
88 };
99 buildInputs = [libjpeg libX11];
1010+ patches = [ ( fetchurl {
1111+ url = "http://bugs.gentoo.org/attachment.cgi?id=145622";
1212+ sha256 = "0c3bdrkr0qsrd3jybzz84z9gs4bq90rvxg87ffw08149v5qjz7a1";
1313+ name = "patch.patch";
1414+ } ) ]; # from gentoo. Don't know why it broke. Make it compile again.
1015}