diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2016-09-24 18:54:31 +0200 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2016-09-24 18:54:31 +0200 |
commit | fffc7638cda106c4864e0b986ff498b4f939a847 (patch) | |
tree | 12b83c1bc7d39a65df8dbff46390c8465347f202 /pkgs/development/tools/misc | |
parent | d2965a7d85f7ce3f5ce265ca8dc3b73feaae226f (diff) | |
parent | e2a9617185321c38482cab343e5d4a6a182b7ce9 (diff) | |
download | nixlib-fffc7638cda106c4864e0b986ff498b4f939a847.tar nixlib-fffc7638cda106c4864e0b986ff498b4f939a847.tar.gz nixlib-fffc7638cda106c4864e0b986ff498b4f939a847.tar.bz2 nixlib-fffc7638cda106c4864e0b986ff498b4f939a847.tar.lz nixlib-fffc7638cda106c4864e0b986ff498b4f939a847.tar.xz nixlib-fffc7638cda106c4864e0b986ff498b4f939a847.tar.zst nixlib-fffc7638cda106c4864e0b986ff498b4f939a847.zip |
Merge branch 'master' into staging
Diffstat (limited to 'pkgs/development/tools/misc')
-rw-r--r-- | pkgs/development/tools/misc/ccache/default.nix | 52 | ||||
-rw-r--r-- | pkgs/development/tools/misc/cscope/default.nix | 25 | ||||
-rw-r--r-- | pkgs/development/tools/misc/patchelf/unstable.nix | 26 |
3 files changed, 65 insertions, 38 deletions
diff --git a/pkgs/development/tools/misc/ccache/default.nix b/pkgs/development/tools/misc/ccache/default.nix index c90e356e044f..99348e907a94 100644 --- a/pkgs/development/tools/misc/ccache/default.nix +++ b/pkgs/development/tools/misc/ccache/default.nix @@ -18,44 +18,46 @@ let ccache = stdenv.mkDerivation rec { doCheck = !stdenv.isDarwin; passthru = let - cc = stdenv.cc.cc; - ccname = if stdenv.cc.isClang then "clang" else "gcc"; - cxxname = if stdenv.cc.isClang then "clang++" else "g++"; + unwrappedCC = stdenv.cc.cc; in { # A derivation that provides gcc and g++ commands, but that # will end up calling ccache for the given cacheDir links = extraConfig: stdenv.mkDerivation rec { name = "ccache-links"; passthru = { - inherit (stdenv.cc) isClang; - inherit (cc) isGNU; + isClang = unwrappedCC.isClang or false; + isGNU = unwrappedCC.isGNU or false; }; - inherit (cc) lib; + inherit (unwrappedCC) lib; buildCommand = '' mkdir -p $out/bin - if [ -x "${cc}/bin/${ccname}" ]; then - cat > $out/bin/${ccname} << EOF - #!/bin/sh - ${extraConfig} - exec ${ccache}/bin/ccache ${cc}/bin/${ccname} "\$@" - EOF - chmod +x $out/bin/${ccname} - fi - if [ -x "${cc}/bin/${cxxname}" ]; then - cat > $out/bin/${cxxname} << EOF - #!/bin/sh - ${extraConfig} - exec ${ccache}/bin/ccache ${cc}/bin/${cxxname} "\$@" + + wrap() { + local cname="$1" + if [ -x "${unwrappedCC}/bin/$cname" ]; then + cat > $out/bin/$cname << EOF + #!/bin/sh + ${extraConfig} + exec ${ccache}/bin/ccache ${unwrappedCC}/bin/$cname "\$@" EOF - chmod +x $out/bin/${cxxname} - fi - for executable in $(ls ${cc}/bin); do + chmod +x $out/bin/$cname + fi + } + + wrap cc + wrap c++ + wrap gcc + wrap g++ + wrap clang + wrap clang++ + + for executable in $(ls ${unwrappedCC}/bin); do if [ ! -x "$out/bin/$executable" ]; then - ln -s ${cc}/bin/$executable $out/bin/$executable + ln -s ${unwrappedCC}/bin/$executable $out/bin/$executable fi done - for file in $(ls ${cc} | grep -vw bin); do - ln -s ${cc}/$file $out/$file + for file in $(ls ${unwrappedCC} | grep -vw bin); do + ln -s ${unwrappedCC}/$file $out/$file done ''; }; diff --git a/pkgs/development/tools/misc/cscope/default.nix b/pkgs/development/tools/misc/cscope/default.nix index 4685787af5f7..2dff98a212d6 100644 --- a/pkgs/development/tools/misc/cscope/default.nix +++ b/pkgs/development/tools/misc/cscope/default.nix @@ -1,29 +1,28 @@ -{ fetchurl, stdenv, ncurses, pkgconfig, emacs}: +{ fetchurl, stdenv, ncurses +, emacsSupport ? true, emacs +}: stdenv.mkDerivation rec { - name = "cscope-15.8a"; + name = "cscope-15.8b"; src = fetchurl { url = "mirror://sourceforge/cscope/${name}.tar.gz"; - sha256 = "07jdhxvp3dv7acvp0pwsdab1g2ncxjlcf838lj7vxgjs1p26lwzb"; + sha256 = "1byk29rcpyygrnr03h5j3y8j0aqxldd9dr5ihi9q982sy28x12a8"; }; - preConfigure = '' - sed -i "contrib/xcscope/cscope-indexer" \ - -"es|^PATH=.*$|PATH=\"$out/bin:\$PATH\"|g" - sed -i "contrib/xcscope/xcscope.el" \ - -"es|\"cscope-indexer\"|\"$out/libexec/cscope/cscope-indexer\"|g"; - ''; - configureFlags = "--with-ncurses=${ncurses.dev}"; buildInputs = [ ncurses ]; - nativeBuildInputs = [ pkgconfig emacs ]; + nativeBuildInputs = stdenv.lib.optional emacsSupport emacs; - postInstall = '' - # Install Emacs mode. + postInstall = stdenv.lib.optionalString emacsSupport '' cd "contrib/xcscope" + sed -i "cscope-indexer" \ + -"es|^PATH=.*$|PATH=\"$out/bin:\$PATH\"|g" + sed -i "xcscope.el" \ + -"es|\"cscope-indexer\"|\"$out/libexec/cscope/cscope-indexer\"|g"; + mkdir -p "$out/libexec/cscope" cp "cscope-indexer" "$out/libexec/cscope" diff --git a/pkgs/development/tools/misc/patchelf/unstable.nix b/pkgs/development/tools/misc/patchelf/unstable.nix new file mode 100644 index 000000000000..5f434c13abc6 --- /dev/null +++ b/pkgs/development/tools/misc/patchelf/unstable.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchFromGitHub, autoreconfHook }: + +stdenv.mkDerivation rec { + name = "patchelf-0.10-pre-20160920"; + + src = fetchFromGitHub { + owner = "NixOS"; + repo = "patchelf"; + rev = "327d80443672c397970738f9e216a7e86cbf3ad7"; + sha256 = "0nghzywda4jrj70gvn4dnrzasafgdp0basj04wfir1smvsi047zr"; + }; + + setupHook = [ ./setup-hook.sh ]; + + buildInputs = [ autoreconfHook ]; + + doCheck = true; + + meta = { + homepage = http://nixos.org/patchelf.html; + license = "GPL"; + description = "A small utility to modify the dynamic linker and RPATH of ELF executables"; + maintainers = [ stdenv.lib.maintainers.eelco ]; + platforms = stdenv.lib.platforms.all; + }; +} |