diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:36 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:47 +0000 |
commit | 36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch) | |
tree | b3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/tools/misc/distcc | |
parent | 4e31070265257dc67d120c27e0f75c2344fdfa9a (diff) | |
parent | abf060725d7614bd3b9f96764262dfbc2f9c2199 (diff) | |
download | nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2 nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip |
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/development/tools/misc/distcc')
-rw-r--r-- | nixpkgs/pkgs/development/tools/misc/distcc/default.nix | 83 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/tools/misc/distcc/masq.nix | 44 |
2 files changed, 127 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/tools/misc/distcc/default.nix b/nixpkgs/pkgs/development/tools/misc/distcc/default.nix new file mode 100644 index 000000000000..cef399eb5c12 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/misc/distcc/default.nix @@ -0,0 +1,83 @@ +{ stdenv, fetchFromGitHub, popt, avahi, pkgconfig, python, gtk2, runCommand +, gcc, autoconf, automake, which, procps, libiberty_static +, sysconfDir ? "" # set this parameter to override the default value $out/etc +, static ? false +}: + +let + name = "distcc"; + version = "2016-02-24"; + distcc = stdenv.mkDerivation { + name = "${name}-${version}"; + src = fetchFromGitHub { + owner = "distcc"; + repo = "distcc"; + rev = "b2fa4e21b4029e13e2c33f7b03ca43346f2cecb8"; + sha256 = "1vj31wcdas8wy52hy6749mlrca9v6ynycdiigx5ay8pnya9z73c6"; + }; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [popt avahi pkgconfig python gtk2 autoconf automake which procps libiberty_static]; + preConfigure = + '' + export CPATH=$(ls -d ${gcc.cc}/lib/gcc/*/${gcc.cc.version}/plugin/include) + + configureFlagsArray=( CFLAGS="-O2 -fno-strict-aliasing" + CXXFLAGS="-O2 -fno-strict-aliasing" + --mandir=$out/share/man + ${if sysconfDir == "" then "" else "--sysconfdir=${sysconfDir}"} + ${if static then "LDFLAGS=-static" else ""} + --with${if static == true || popt == null then "" else "out"}-included-popt + --with${if avahi != null then "" else "out"}-avahi + --with${if gtk2 != null then "" else "out"}-gtk + --without-gnome + --enable-rfc2553 + --disable-Werror # a must on gcc 4.6 + ) + installFlags="sysconfdir=$out/etc"; + + ./autogen.sh + ''; + + # The test suite fails because it uses hard-coded paths, i.e. /usr/bin/gcc. + doCheck = false; + + passthru = { + # A derivation that provides gcc and g++ commands, but that + # will end up calling distcc for the given cacheDir + # + # extraConfig is meant to be sh lines exporting environment + # variables like DISTCC_HOSTS, DISTCC_DIR, ... + links = extraConfig: (runCommand "distcc-links" { passthru.gcc = gcc.cc; } + '' + mkdir -p $out/bin + if [ -x "${gcc.cc}/bin/gcc" ]; then + cat > $out/bin/gcc << EOF + #!/bin/sh + ${extraConfig} + exec ${distcc}/bin/distcc gcc "\$@" + EOF + chmod +x $out/bin/gcc + fi + if [ -x "${gcc.cc}/bin/g++" ]; then + cat > $out/bin/g++ << EOF + #!/bin/sh + ${extraConfig} + exec ${distcc}/bin/distcc g++ "\$@" + EOF + chmod +x $out/bin/g++ + fi + ''); + }; + + meta = { + description = "A fast, free distributed C/C++ compiler"; + homepage = http://distcc.org; + license = "GPL"; + + platforms = stdenv.lib.platforms.linux; + maintainers = with stdenv.lib.maintainers; [ anderspapitto ]; + }; + }; +in + distcc diff --git a/nixpkgs/pkgs/development/tools/misc/distcc/masq.nix b/nixpkgs/pkgs/development/tools/misc/distcc/masq.nix new file mode 100644 index 000000000000..f3bccde81606 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/misc/distcc/masq.nix @@ -0,0 +1,44 @@ +{ stdenv, gccRaw, binutils }: + +stdenv.mkDerivation { + name = "distcc-masq-${gccRaw.name}"; + + phases = [ "installPhase" ]; + installPhase = '' + mkdir -p $out/bin + + bin=${gccRaw}/bin + + shopt -s nullglob + if [ -f $bin/gcc ]; then + ln -s $bin/gcc $out/bin + else + for a in $bin/*-gcc; do + ln -s $bin/*-gcc $out/bin/gcc + ln -s $bin/*-gcc $out/bin/cc + done + fi + + if [ -f $bin/g++ ]; then + ln -s $bin/g++ $out/bin + else + for a in $bin/*-g++; do + ln -sf $bin/*-g++ $out/bin/g++ + ln -sf $bin/*-g++ $out/bin/c++ + done + fi + + bbin=${binutils}/bin + if [ -f $bbin/as ]; then + ln -s $bbin/as $out/bin + else + for a in $bbin/*-as; do + ln -sf $bbin/*-as $out/bin/as + done + fi + ''; + + meta = { + platforms = stdenv.lib.platforms.linux; + }; +} |