ccache: 3.7.12 -> 4.0

Additional changes:
- Added myself as a maintainer
- Generalized ccacheStdenv to allow overriding stdenv
This commit is contained in:
Kira Bruneau
2020-11-21 22:21:43 -05:00
parent 5931f86233
commit 82ca111efb
3 changed files with 103 additions and 15 deletions
+51 -9
View File
@@ -1,23 +1,64 @@
{ stdenv, fetchFromGitHub, asciidoc-full, gperf, perl, autoreconfHook, zlib, makeWrapper }:
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, substituteAll
, binutils
, asciidoc
, cmake
, perl
, zstd
, xcodebuild
, makeWrapper
}:
let ccache = stdenv.mkDerivation rec {
pname = "ccache";
version = "3.7.12";
version = "4.0";
src = fetchFromGitHub {
owner = "ccache";
repo = "ccache";
owner = pname;
repo = pname;
rev = "v${version}";
sha256 = "1xnv4g4n1jk1i98sa53k8w6q7hbwbw62svs30lssppysbrv8x3gz";
sha256 = "1frcplrv61m2iwc6jwycpbcz1101xl6s4sh8p87prdj98l60lyrx";
};
nativeBuildInputs = [ asciidoc-full autoreconfHook gperf perl ];
# TODO: Remove patches from upstream in next release
patches = [
# Fix badly named man page filename
(fetchpatch {
url = "https://github.com/ccache/ccache/commit/223e706fb24ce86eb0ad86079a97e6f345b9ef40.patch";
sha256 = "1h7amp3ka45a79zwlxh8qnzx6n371gnfpfgijcqljps7skhl5gjg";
})
# Build and install man page by default
(fetchpatch {
url = "https://github.com/ccache/ccache/commit/294ff2face26448afa68e3ef7b68bf4898d6dc77.patch";
sha256 = "0rx69qn41bgksc4m3p59nk5d6rz72rwnfska9mh5j62pzfm8axja";
})
# Fixes use of undeclared identifier 'CLONE_NOOWNERCOPY' on darwin
(fetchpatch {
url = "https://github.com/ccache/ccache/commit/411c010c3a5ee690cd42b23ffcf026ae009e2897.patch";
sha256 = "062s424d0d0psp6wjhmfnfn1s5dsrz403hdid5drm6l2san0jhq0";
})
] ++ lib.optional stdenv.isDarwin (substituteAll {
src = ./force-objdump-on-darwin.patch;
objdump = "${binutils.bintools}/bin/objdump";
});
buildInputs = [ zlib ];
nativeBuildInputs = [ asciidoc cmake perl ];
buildInputs = [ zstd ];
outputs = [ "out" "man" ];
doCheck = !stdenv.isDarwin;
doCheck = true;
checkInputs = lib.optional stdenv.isDarwin xcodebuild;
checkPhase = ''
export HOME=$(mktemp -d)
ctest --output-on-failure ${lib.optionalString stdenv.isDarwin ''
-E '^(test.nocpp2|test.modules)$'
''}
'';
passthru = {
# A derivation that provides gcc and g++ commands, but that
@@ -63,9 +104,10 @@ let ccache = stdenv.mkDerivation rec {
meta = with stdenv.lib; {
description = "Compiler cache for fast recompilation of C/C++ code";
homepage = "https://ccache.dev/";
homepage = "https://ccache.dev";
downloadPage = "https://ccache.dev/download.html";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ metadark r-burns ];
platforms = platforms.unix;
};
};