From e34ad7f6ac08429ccfb6a342363a5b2d13757f8c Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Mon, 13 Mar 2023 09:50:19 -0400 Subject: [PATCH] =?UTF-8?q?ccache:=204.7.4=20=E2=86=92=204.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../development/tools/misc/ccache/default.nix | 56 ++++++++++--------- .../misc/ccache/force-objdump-on-darwin.patch | 8 ++- 2 files changed, 35 insertions(+), 29 deletions(-) diff --git a/pkgs/development/tools/misc/ccache/default.nix b/pkgs/development/tools/misc/ccache/default.nix index cad25a942d69..df12d6c2c72c 100644 --- a/pkgs/development/tools/misc/ccache/default.nix +++ b/pkgs/development/tools/misc/ccache/default.nix @@ -13,15 +13,15 @@ , nix-update-script }: -let ccache = stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "ccache"; - version = "4.7.4"; + version = "4.8"; src = fetchFromGitHub { - owner = pname; - repo = pname; - rev = "v${version}"; - sha256 = "sha256-mt5udwSdzGaspfpAdUavQ55dBeJdhbZjcQpd9xNOQms="; + owner = "ccache"; + repo = "ccache"; + rev = "refs/tags/v${finalAttrs.version}"; + sha256 = "sha256-X7Pv+yEQaKPdWTiKq67kSAyimyKvLSCYr4EjLlw+J0U="; }; outputs = [ "out" "man" ]; @@ -53,25 +53,27 @@ let ccache = stdenv.mkDerivation rec { bashInteractive ] ++ lib.optional stdenv.isDarwin xcodebuild; - checkPhase = let - badTests = [ - "test.trim_dir" # flaky on hydra (possibly filesystem-specific?) - ] ++ lib.optionals stdenv.isDarwin [ - "test.basedir" - "test.multi_arch" - "test.nocpp2" - ]; - in '' - runHook preCheck - export HOME=$(mktemp -d) - ctest --output-on-failure -E '^(${lib.concatStringsSep "|" badTests})$' - runHook postCheck - ''; + checkPhase = + let + badTests = [ + "test.trim_dir" # flaky on hydra (possibly filesystem-specific?) + ] ++ lib.optionals stdenv.isDarwin [ + "test.basedir" + "test.multi_arch" + "test.nocpp2" + ]; + in + '' + runHook preCheck + export HOME=$(mktemp -d) + ctest --output-on-failure -E '^(${lib.concatStringsSep "|" badTests})$' + runHook postCheck + ''; passthru = { # A derivation that provides gcc and g++ commands, but that # will end up calling ccache for the given cacheDir - links = {unwrappedCC, extraConfig}: stdenv.mkDerivation { + links = { unwrappedCC, extraConfig }: stdenv.mkDerivation { name = "ccache-links"; passthru = { isClang = unwrappedCC.isClang or false; @@ -85,7 +87,7 @@ let ccache = stdenv.mkDerivation rec { wrap() { local cname="$1" if [ -x "${unwrappedCC}/bin/$cname" ]; then - makeWrapper ${ccache}/bin/ccache $out/bin/$cname \ + makeWrapper ${finalAttrs.finalPackage}/bin/ccache $out/bin/$cname \ --run ${lib.escapeShellArg extraConfig} \ --add-flags ${unwrappedCC}/bin/$cname fi @@ -108,17 +110,19 @@ let ccache = stdenv.mkDerivation rec { done ''; }; - }; - passthru.updateScript = nix-update-script { }; + updateScript = nix-update-script { }; + }; meta = with lib; { description = "Compiler cache for fast recompilation of C/C++ code"; homepage = "https://ccache.dev"; downloadPage = "https://ccache.dev/download.html"; + changelog = "https://ccache.dev/releasenotes.html#_ccache_${ + builtins.replaceStrings [ "." ] [ "_" ] finalAttrs.version + }"; license = licenses.gpl3Plus; maintainers = with maintainers; [ kira-bruneau r-burns ]; platforms = platforms.unix; }; -}; -in ccache +}) diff --git a/pkgs/development/tools/misc/ccache/force-objdump-on-darwin.patch b/pkgs/development/tools/misc/ccache/force-objdump-on-darwin.patch index 4b4d79867f39..04c431aafb74 100644 --- a/pkgs/development/tools/misc/ccache/force-objdump-on-darwin.patch +++ b/pkgs/development/tools/misc/ccache/force-objdump-on-darwin.patch @@ -1,3 +1,5 @@ +diff --git a/test/run b/test/run +index 43a57312..398be8d8 100755 --- a/test/run +++ b/test/run @@ -148,21 +148,17 @@ file_size() { @@ -19,9 +21,9 @@ objdump_grep_cmd() { - if $HOST_OS_APPLE; then -- fgrep -q "\"$1\"" +- grep -Fq "\"$1\"" - elif $HOST_OS_WINDOWS || $HOST_OS_CYGWIN; then + if $HOST_OS_WINDOWS || $HOST_OS_CYGWIN; then - fgrep -q "$1" + grep -Fq "$1" else - fgrep -q ": $1" + grep -Fq ": $1"