git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #104425 from MetaDark/ccache

ccache: 3.7.12 -> 4.0

commit5edcf11a0c0c7d6cdf259f89c8f9b3af69a99def authorMichael Raskin <7c6f434c@mail.ru> dateSun 22 Nov 2020, 16:30 (6 years ago) parent97c0e076495c43
5 files changed+109−21
pkgs/applications/networking/browsers/webbrowser/default.nix+4−4 pkgs/applications/networking/instant-messengers/baresip/default.nix+2−2 pkgs/development/tools/misc/ccache/default.nix+51−9 pkgs/development/tools/misc/ccache/force-objdump-on-darwin.patch+31 pkgs/top-level/all-packages.nix+21−6
pkgs/applications/networking/browsers/webbrowser/default.nix+4−4
@@ -1,6 +1,6 @@
11{ stdenv, lib, fetchgit, makeDesktopItem, pkgconfig, makeWrapper
22# Build
3−, python2, autoconf213, yasm, perl, ccache
3+, python2, autoconf213, yasm, perl
44, unzip, gnome2, gnum4
55
66# Runtime
@@ -41,7 +41,7 @@ in stdenv.mkDerivation rec {
4141 };
4242
4343 nativeBuildInputs = [
44− gnum4 makeWrapper perl pkgconfig python2 ccache
44+ gnum4 makeWrapper perl pkgconfig python2
4545 ];
4646
4747 buildInputs = [
@@ -54,7 +54,6 @@ in stdenv.mkDerivation rec {
5454 configurePhase = ''
5555 export MOZCONFIG=$PWD/.mozconfig
5656 export MOZ_NOSPAM=1
57− export HOME=$PWD # Needed by ccache
5857
5958 cp $src/doc/mozconfig.example $MOZCONFIG
6059 # Need to modify it
@@ -65,7 +64,8 @@ in stdenv.mkDerivation rec {
6564 --replace "mk_add_options AUTOCONF=/usr/bin/autoconf-2.13" "mk_add_options AUTOCONF=${autoconf213}/bin/autoconf" \
6665 --replace 'mk_add_options MOZ_OBJDIR=$HOME/build/wbobjects/' "" \
6766 --replace "ac_add_options --x-libraries=/usr/lib64" "ac_add_options --x-libraries=${lib.makeLibraryPath [ xorg.libX11 ]}" \
68− --replace "_BUILD_64=1" "_BUILD_64=${lib.optionalString stdenv.hostPlatform.is64bit "1"}"
67+ --replace "_BUILD_64=1" "_BUILD_64=${lib.optionalString stdenv.hostPlatform.is64bit "1"}" \
68+ --replace "--enable-ccache" "--disable-ccache"
6969
7070 echo >> $MOZCONFIG '
7171 #
pkgs/applications/networking/instant-messengers/baresip/default.nix+2−2
@@ -1,6 +1,6 @@
11{stdenv, fetchurl, zlib, openssl, libre, librem, pkgconfig, gst_all_1
22, cairo, mpg123, alsaLib, SDL, libv4l, celt, libsndfile, srtp, ffmpeg_3
3−, gsm, speex, portaudio, spandsp, libuuid, ccache, libvpx
3+, gsm, speex, portaudio, spandsp, libuuid, libvpx
44}:
55stdenv.mkDerivation rec {
66 version = "0.6.5";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
1212 nativeBuildInputs = [ pkgconfig ];
1313 buildInputs = [zlib openssl libre librem cairo mpg123
1414 alsaLib SDL libv4l celt libsndfile srtp ffmpeg_3 gsm speex portaudio spandsp libuuid
15− ccache libvpx
15+ libvpx
1616 ] ++ (with gst_all_1; [ gstreamer gst-libav gst-plugins-base gst-plugins-bad gst-plugins-good ]);
1717 makeFlags = [
1818 "LIBRE_MK=${libre}/share/re/re.mk"
pkgs/development/tools/misc/ccache/default.nix+51−9
@@ -1,23 +1,64 @@
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+}:
214
315let ccache = stdenv.mkDerivation rec {
416 pname = "ccache";
5− version = "3.7.12";
17+ version = "4.0";
618
719 src = fetchFromGitHub {
8− owner = "ccache";
9− repo = "ccache";
20+ owner = pname;
21+ repo = pname;
1022 rev = "v${version}";
11− sha256 = "1xnv4g4n1jk1i98sa53k8w6q7hbwbw62svs30lssppysbrv8x3gz";
23+ sha256 = "1frcplrv61m2iwc6jwycpbcz1101xl6s4sh8p87prdj98l60lyrx";
1224 };
1325
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+ });
1547
16− buildInputs = [ zlib ];
48+ nativeBuildInputs = [ asciidoc cmake perl ];
49+
50+ buildInputs = [ zstd ];
1751
1852 outputs = [ "out" "man" ];
1953
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+ '';
2162
2263 passthru = {
2364 # A derivation that provides gcc and g++ commands, but that
@@ -63,9 +104,10 @@ let ccache = stdenv.mkDerivation rec {
63104
64105 meta = with stdenv.lib; {
65106 description = "Compiler cache for fast recompilation of C/C++ code";
66− homepage = "https://ccache.dev/";
107+ homepage = "https://ccache.dev";
67108 downloadPage = "https://ccache.dev/download.html";
68109 license = licenses.gpl3Plus;
110+ maintainers = with maintainers; [ metadark r-burns ];
69111 platforms = platforms.unix;
70112 };
71113};
pkgs/development/tools/misc/ccache/force-objdump-on-darwin.patchnew file+31
@@ -0,0 +1,31 @@
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() {
pkgs/top-level/all-packages.nix+21−6
@@ -10986,7 +10986,9 @@ in
1098610986
1098710987 cc-tool = callPackage ../development/tools/misc/cc-tool { };
1098810988
10989− ccache = callPackage ../development/tools/misc/ccache { };
10989+ ccache = callPackage ../development/tools/misc/ccache {
10990+ asciidoc = asciidoc-full;
10991+ };
1099010992
1099110993 # Wrapper that works as gcc or g++
1099210994 # It can be used by setting in nixpkgs config like this, for example:
@@ -11008,12 +11010,25 @@ in
1100811010 # };
1100911011 # You can use a different directory, but whichever directory you choose
1101011012 # should be owned by user root, group nixbld with permissions 0770.
11011− ccacheWrapper = makeOverridable ({ extraConfig ? "", cc ? stdenv.cc }:
11012− cc.override { cc = ccache.links {
11013+ ccacheWrapper = makeOverridable ({ extraConfig, cc }:
11014+ cc.override {
11015+ cc = ccache.links {
11016+ inherit extraConfig;
11017+ unwrappedCC = cc.cc;
11018+ };
11019+ }) {
11020+ extraConfig = "";
11021+ inherit (stdenv) cc;
11022+ };
11023+
11024+ ccacheStdenv = lowPrio (makeOverridable ({ extraConfig, stdenv }:
11025+ overrideCC stdenv (buildPackages.ccacheWrapper.override {
1101311026 inherit extraConfig;
11014− unwrappedCC = cc.cc;
11015− }; }) {};
11016− ccacheStdenv = lowPrio (overrideCC stdenv buildPackages.ccacheWrapper);
11027+ inherit (stdenv) cc;
11028+ })) {
11029+ extraConfig = "";
11030+ inherit stdenv;
11031+ });
1101711032
1101811033 cccc = callPackage ../development/tools/analysis/cccc { };
1101911034