diff options
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/development/tools/misc/ccache')
-rw-r--r-- | infra/libkookie/nixpkgs/pkgs/development/tools/misc/ccache/default.nix | 42 | ||||
-rw-r--r-- | infra/libkookie/nixpkgs/pkgs/development/tools/misc/ccache/force-objdump-on-darwin.patch | 31 |
2 files changed, 64 insertions, 9 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/misc/ccache/default.nix b/infra/libkookie/nixpkgs/pkgs/development/tools/misc/ccache/default.nix index e0a6a8065b5a..f9254b2cf15e 100644 --- a/infra/libkookie/nixpkgs/pkgs/development/tools/misc/ccache/default.nix +++ b/infra/libkookie/nixpkgs/pkgs/development/tools/misc/ccache/default.nix @@ -1,23 +1,46 @@ -{ stdenv, fetchFromGitHub, asciidoc-full, gperf, perl, autoreconfHook, zlib, makeWrapper }: +{ lib +, stdenv +, fetchFromGitHub +, substituteAll +, binutils +, asciidoc +, cmake +, perl +, zstd +, xcodebuild +, makeWrapper +}: let ccache = stdenv.mkDerivation rec { pname = "ccache"; - version = "3.7.11"; + version = "4.1"; src = fetchFromGitHub { - owner = "ccache"; - repo = "ccache"; + owner = pname; + repo = pname; rev = "v${version}"; - sha256 = "03c6riz4vb0jipplk69c1j8arjjrjn676kglsrzqf8cidrh8j91c"; + sha256 = "1az11q3wmr8wc7alx9l70wq9am41cm0y17g5gsaqmahws3dxfi8m"; }; - nativeBuildInputs = [ asciidoc-full autoreconfHook gperf perl ]; + patches = 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 +86,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; }; }; diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/misc/ccache/force-objdump-on-darwin.patch b/infra/libkookie/nixpkgs/pkgs/development/tools/misc/ccache/force-objdump-on-darwin.patch new file mode 100644 index 000000000000..81a4f27ab736 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/development/tools/misc/ccache/force-objdump-on-darwin.patch @@ -0,0 +1,31 @@ +diff --git a/test/run b/test/run +index 9623e49d..3df1c5a8 100755 +--- a/test/run ++++ b/test/run +@@ -126,23 +126,17 @@ file_size() { + objdump_cmd() { + local file="$1" + +- if $HOST_OS_APPLE; then +- xcrun dwarfdump -r 0 "$file" +- elif $HOST_OS_WINDOWS || $HOST_OS_CYGWIN; then ++ if $HOST_OS_WINDOWS || $HOST_OS_CYGWIN; then + # For some reason objdump only shows the basename of the file, so fall + # back to brute force and ignorance. + strings "$1" + else +- objdump -W "$file" ++ @objdump@ -W "$file" + fi + } + + objdump_grep_cmd() { +- if $HOST_OS_APPLE; then +- fgrep -q "\"$1\"" +- else +- fgrep -q ": $1" +- fi ++ fgrep -q ": $1" + } + + expect_stat() { |