···11+source $stdenv/setup
22+33+44+export NIX_FIXINC_DUMMY=$NIX_BUILD_TOP/dummy
55+mkdir $NIX_FIXINC_DUMMY
66+77+88+# libstdc++ needs this; otherwise it will use /lib/cpp, which is a Bad
99+# Thing.
1010+export CPP="gcc -E"
1111+1212+1313+if test "$noSysDirs" = "1"; then
1414+1515+ # Figure out what extra flags to pass to the gcc compilers being
1616+ # generated to make sure that they use our glibc.
1717+ if test -e $NIX_GCC/nix-support/orig-glibc; then
1818+ glibc=$(cat $NIX_GCC/nix-support/orig-glibc)
1919+2020+ # Ugh. Copied from gcc-wrapper/builder.sh. We can't just
2121+ # source in $NIX_GCC/nix-support/add-flags, since that would
2222+ # cause *this* GCC to be linked against the *previous* GCC.
2323+ # Need some more modularity there.
2424+ extraCFlags="-B$glibc/lib -isystem $glibc/include"
2525+ extraLDFlags="-B$glibc/lib -L$glibc/lib -Wl,-s \
2626+ -Wl,-dynamic-linker,$glibc/lib/ld-linux.so.2"
2727+2828+ # Oh, what a hack. I should be shot for this. In stage 1, we
2929+ # should link against the previous GCC, but not afterwards.
3030+ # Otherwise we retain a dependency. However, ld-wrapper,
3131+ # which adds the linker flags for the previous GCC, is also
3232+ # used in stage 2/3. We can prevent it from adding them by
3333+ # NIX_GLIBC_FLAGS_SET, but then gcc-wrapper will also not add
3434+ # them, thereby causing stage 1 to fail. So we use a trick to
3535+ # only set the flags in gcc-wrapper.
3636+ hook=$(pwd)/ld-wrapper-hook
3737+ echo "NIX_GLIBC_FLAGS_SET=1" > $hook
3838+ export NIX_LD_WRAPPER_START_HOOK=$hook
3939+4040+ # Use *real* header files, otherwise a limits.h is generated
4141+ # that does not include Glibc's limits.h (notably missing
4242+ # SSIZE_MAX, which breaks the build).
4343+ export NIX_FIXINC_DUMMY=$glibc/include
4444+ fi
4545+4646+ export NIX_EXTRA_CFLAGS=$extraCFlags
4747+ export NIX_EXTRA_LDFLAGS=$extraLDFlags
4848+ export CFLAGS=$extraCFlags
4949+ export CXXFLAGS=$extraCFlags
5050+ export LDFLAGS=$extraLDFlags
5151+fi
5252+5353+5454+preConfigure() {
5555+5656+ # Determine the frontends to build.
5757+ langs="c"
5858+ if test -n "$langCC"; then
5959+ langs="$langs,c++"
6060+ fi
6161+ if test -n "$langF77"; then
6262+ langs="$langs,f95"
6363+ fi
6464+6565+ # Perform the build in a different directory.
6666+ mkdir ../build
6767+ cd ../build
6868+6969+ configureScript=../$sourceRoot/configure
7070+ configureFlags="--enable-languages=$langs --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-multilib --with-gxx-include-dir=${STDCXX_INCDIR} --host=x86_64-apple-darwin10 --build=x86_64-apple-darwin10 --target=x86_64-apple-darwin10"
7171+}
7272+7373+7474+postInstall() {
7575+ # Remove precompiled headers for now. They are very big and
7676+ # probably not very useful yet.
7777+ find $out/include -name "*.gch" -exec rm -rf {} \; -prune
7878+7979+ # Remove `fixincl' to prevent a retained dependency on the
8080+ # previous gcc.
8181+ rm -rf $out/libexec/gcc/*/*/install-tools
8282+}
8383+8484+postUnpack() {
8585+ mv $libstdcxx/libstdcxx $sourceRoot/
8686+}
8787+8888+STDCXX_INCDIR="$out/include/c++/4.2.1"
8989+9090+genericBuild
9191+9292+9393+echo '-------------------------------------------------------------------------------------------------------------------------'
9494+echo 'libstdcxx-16'
9595+echo '-------------------------------------------------------------------------------------------------------------------------'
9696+9797+cd ..
9898+pwd
9999+100100+preConfigure() {
101101+ # Perform the build in a different directory.
102102+ mkdir ../build_libstdcxx
103103+ cd ../build_libstdcxx
104104+105105+ ln -s ../build/gcc gcc
106106+107107+ configureScript=../$sourceRoot/libstdcxx/configure
108108+ configureFlags="--disable-libstdcxx-pch --disable-libstdcxx-debug --disable-multilib --with-gxx-include-dir=${STDCXX_INCDIR}"
109109+}
110110+111111+unpackPhase () {
112112+ echo '-'
113113+}
114114+115115+postInstall() {
116116+ echo '-'
117117+ echo "cp -v ${STDCXX_INCDIR}/*/bits/* ${STDCXX_INCDIR}/bits/"
118118+ cp -v ${STDCXX_INCDIR}/*/bits/* ${STDCXX_INCDIR}/bits/
119119+}
120120+121121+patchPhase() {
122122+ echo '-'
123123+}
124124+125125+genericBuild
126126+127127+ln -s $out/lib/x86_64 $out/lib64
···11-{stdenv, fetchurl, neon, zlib}:
22-33-stdenv.mkDerivation rec {
44- name = "davfs2-1.4.1";
55-66- src = fetchurl {
77- url = "http://www.very-clever.com/download/nongnu/davfs2/${name}.tar.gz";
88- sha256 = "0fqq331rd3ylzfhdsbbj0b2znn3d0js0kxcv3w54dl9g2cs8fqhn";
99- };
1010-1111- buildInputs = [ neon zlib ];
1212- patches = [ ./davfs2-install.patch ];
1313-1414- meta = {
1515- description = "Web Distributed Authoring and Versioning (WebDAV), an extension to the HTTP-protocol, allows authoring of resources on a remote web server. davfs2 provides the ability to access such resources like a typical filesystem, allowing for use by standard applications with no built-in support for WebDAV.";
1616-1717- license = "GPLv3+";
1818- homepage = http://savannah.nongnu.org/projects/davfs2;
1919- };
2020-}
···11export NIX_ENFORCE_PURITY=1
22export NIX_IGNORE_LD_THROUGH_GCC=1
3344-if test "$system" = "i686-darwin" -o "$system" = "powerpc-darwin"; then
44+if test "$system" = "i686-darwin" -o "$system" = "powerpc-darwin" -o "$system" = "x86_64-darwin"; then
55 export NIX_DONT_SET_RPATH=1
66 export NIX_NO_SELF_RPATH=1
77 dontFixLibtool=1
+21
pkgs/tools/filesystems/davfs2/default.nix
···11+{ stdenv, fetchurl, neon, zlib }:
22+33+stdenv.mkDerivation rec {
44+ name = "davfs2-1.4.5";
55+66+ src = fetchurl {
77+ url = "mirror://savannah/davfs2/${name}.tar.gz";
88+ sha256 = "1pkl2braggp2qg4c68dwfv399l9jz7cvi7gkm4xbj6mgvl0cxw18";
99+ };
1010+1111+ buildInputs = [ neon zlib ];
1212+1313+ patches = [ ./davfs2-install.patch ];
1414+1515+ meta = {
1616+ longDescription = "Web Distributed Authoring and Versioning (WebDAV), an extension to the HTTP-protocol, allows authoring of resources on a remote web server. davfs2 provides the ability to access such resources like a typical filesystem, allowing for use by standard applications with no built-in support for WebDAV.";
1717+1818+ license = "GPLv3+";
1919+ homepage = http://savannah.nongnu.org/projects/davfs2;
2020+ };
2121+}
···12121313 buildInputs = [pcre];
14141515- doCheck = if stdenv.system == "i686-darwin" then false else true;
1515+ doCheck = if stdenv.isDarwin then false else true;
16161717 # On Mac OS X, force use of mkdir -p, since Grep's fallback
1818 # (./install-sh) is broken.