ccache: 3.7.12 -> 4.0

Additional changes:
- Added myself as a maintainer
- Generalized ccacheStdenv to allow overriding stdenv

+103 -15
+51 -9
pkgs/development/tools/misc/ccache/default.nix
··· 1 - { stdenv, fetchFromGitHub, asciidoc-full, gperf, perl, autoreconfHook, zlib, makeWrapper }: 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , fetchpatch 5 + , substituteAll 6 + , binutils 7 + , asciidoc 8 + , cmake 9 + , perl 10 + , zstd 11 + , xcodebuild 12 + , makeWrapper 13 + }: 2 14 3 15 let ccache = stdenv.mkDerivation rec { 4 16 pname = "ccache"; 5 - version = "3.7.12"; 17 + version = "4.0"; 6 18 7 19 src = fetchFromGitHub { 8 - owner = "ccache"; 9 - repo = "ccache"; 20 + owner = pname; 21 + repo = pname; 10 22 rev = "v${version}"; 11 - sha256 = "1xnv4g4n1jk1i98sa53k8w6q7hbwbw62svs30lssppysbrv8x3gz"; 23 + sha256 = "1frcplrv61m2iwc6jwycpbcz1101xl6s4sh8p87prdj98l60lyrx"; 12 24 }; 13 25 14 - nativeBuildInputs = [ asciidoc-full autoreconfHook gperf perl ]; 26 + # TODO: Remove patches from upstream in next release 27 + patches = [ 28 + # Fix badly named man page filename 29 + (fetchpatch { 30 + url = "https://github.com/ccache/ccache/commit/223e706fb24ce86eb0ad86079a97e6f345b9ef40.patch"; 31 + sha256 = "1h7amp3ka45a79zwlxh8qnzx6n371gnfpfgijcqljps7skhl5gjg"; 32 + }) 33 + # Build and install man page by default 34 + (fetchpatch { 35 + url = "https://github.com/ccache/ccache/commit/294ff2face26448afa68e3ef7b68bf4898d6dc77.patch"; 36 + sha256 = "0rx69qn41bgksc4m3p59nk5d6rz72rwnfska9mh5j62pzfm8axja"; 37 + }) 38 + # Fixes use of undeclared identifier 'CLONE_NOOWNERCOPY' on darwin 39 + (fetchpatch { 40 + url = "https://github.com/ccache/ccache/commit/411c010c3a5ee690cd42b23ffcf026ae009e2897.patch"; 41 + sha256 = "062s424d0d0psp6wjhmfnfn1s5dsrz403hdid5drm6l2san0jhq0"; 42 + }) 43 + ] ++ lib.optional stdenv.isDarwin (substituteAll { 44 + src = ./force-objdump-on-darwin.patch; 45 + objdump = "${binutils.bintools}/bin/objdump"; 46 + }); 15 47 16 - buildInputs = [ zlib ]; 48 + nativeBuildInputs = [ asciidoc cmake perl ]; 49 + 50 + buildInputs = [ zstd ]; 17 51 18 52 outputs = [ "out" "man" ]; 19 53 20 - doCheck = !stdenv.isDarwin; 54 + doCheck = true; 55 + checkInputs = lib.optional stdenv.isDarwin xcodebuild; 56 + checkPhase = '' 57 + export HOME=$(mktemp -d) 58 + ctest --output-on-failure ${lib.optionalString stdenv.isDarwin '' 59 + -E '^(test.nocpp2|test.modules)$' 60 + ''} 61 + ''; 21 62 22 63 passthru = { 23 64 # A derivation that provides gcc and g++ commands, but that ··· 63 104 64 105 meta = with stdenv.lib; { 65 106 description = "Compiler cache for fast recompilation of C/C++ code"; 66 - homepage = "https://ccache.dev/"; 107 + homepage = "https://ccache.dev"; 67 108 downloadPage = "https://ccache.dev/download.html"; 68 109 license = licenses.gpl3Plus; 110 + maintainers = with maintainers; [ metadark r-burns ]; 69 111 platforms = platforms.unix; 70 112 }; 71 113 };
+31
pkgs/development/tools/misc/ccache/force-objdump-on-darwin.patch
··· 1 + diff --git a/test/run b/test/run 2 + index 9623e49d..3df1c5a8 100755 3 + --- a/test/run 4 + +++ b/test/run 5 + @@ -126,23 +126,17 @@ file_size() { 6 + objdump_cmd() { 7 + local file="$1" 8 + 9 + - if $HOST_OS_APPLE; then 10 + - xcrun dwarfdump -r 0 "$file" 11 + - elif $HOST_OS_WINDOWS || $HOST_OS_CYGWIN; then 12 + + if $HOST_OS_WINDOWS || $HOST_OS_CYGWIN; then 13 + # For some reason objdump only shows the basename of the file, so fall 14 + # back to brute force and ignorance. 15 + strings "$1" 16 + else 17 + - objdump -W "$file" 18 + + @objdump@ -W "$file" 19 + fi 20 + } 21 + 22 + objdump_grep_cmd() { 23 + - if $HOST_OS_APPLE; then 24 + - fgrep -q "\"$1\"" 25 + - else 26 + - fgrep -q ": $1" 27 + - fi 28 + + fgrep -q ": $1" 29 + } 30 + 31 + expect_stat() {
+21 -6
pkgs/top-level/all-packages.nix
··· 10972 10972 10973 10973 cc-tool = callPackage ../development/tools/misc/cc-tool { }; 10974 10974 10975 - ccache = callPackage ../development/tools/misc/ccache { }; 10975 + ccache = callPackage ../development/tools/misc/ccache { 10976 + asciidoc = asciidoc-full; 10977 + }; 10976 10978 10977 10979 # Wrapper that works as gcc or g++ 10978 10980 # It can be used by setting in nixpkgs config like this, for example: ··· 10994 10996 # }; 10995 10997 # You can use a different directory, but whichever directory you choose 10996 10998 # should be owned by user root, group nixbld with permissions 0770. 10997 - ccacheWrapper = makeOverridable ({ extraConfig ? "", cc ? stdenv.cc }: 10998 - cc.override { cc = ccache.links { 10999 + ccacheWrapper = makeOverridable ({ extraConfig, cc }: 11000 + cc.override { 11001 + cc = ccache.links { 11002 + inherit extraConfig; 11003 + unwrappedCC = cc.cc; 11004 + }; 11005 + }) { 11006 + extraConfig = ""; 11007 + inherit (stdenv) cc; 11008 + }; 11009 + 11010 + ccacheStdenv = lowPrio (makeOverridable ({ extraConfig, stdenv }: 11011 + overrideCC stdenv (buildPackages.ccacheWrapper.override { 10999 11012 inherit extraConfig; 11000 - unwrappedCC = cc.cc; 11001 - }; }) {}; 11002 - ccacheStdenv = lowPrio (overrideCC stdenv buildPackages.ccacheWrapper); 11013 + inherit (stdenv) cc; 11014 + })) { 11015 + extraConfig = ""; 11016 + inherit stdenv; 11017 + }); 11003 11018 11004 11019 cccc = callPackage ../development/tools/analysis/cccc { }; 11005 11020