From bf0ea0709a6a70d326a1d444140e315917937d6e Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 28 Nov 2024 09:01:43 +0200 Subject: [PATCH 1/9] taskwarrior3: don't add darwin.apple_sdk deps (SDK reform) --- pkgs/by-name/ta/taskwarrior3/package.nix | 27 +++++++++--------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/pkgs/by-name/ta/taskwarrior3/package.nix b/pkgs/by-name/ta/taskwarrior3/package.nix index 4be5fdd072c4..7b42ecfa2423 100644 --- a/pkgs/by-name/ta/taskwarrior3/package.nix +++ b/pkgs/by-name/ta/taskwarrior3/package.nix @@ -12,7 +12,6 @@ python3, xdg-utils, installShellFiles, - darwin, }: stdenv.mkDerivation rec { pname = "taskwarrior"; @@ -30,22 +29,16 @@ stdenv.mkDerivation rec { --replace "xdg-open" "${lib.getBin xdg-utils}/bin/xdg-open" ''; - nativeBuildInputs = - [ - cmake - libuuid - python3 - installShellFiles - corrosion - cargo - rustc - rustPlatform.cargoSetupHook - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # darwin dependencies - darwin.apple_sdk.frameworks.Security - darwin.apple_sdk.frameworks.SystemConfiguration - ]; + nativeBuildInputs = [ + cmake + libuuid + python3 + installShellFiles + corrosion + cargo + rustc + rustPlatform.cargoSetupHook + ]; doCheck = true; checkTarget = "build_tests"; From 7cf231bfc5ecd359b14146d66ce1edc9941747bd Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 28 Nov 2024 17:16:08 +0200 Subject: [PATCH 2/9] taskwarrior3: use finalAttrs: pattern --- pkgs/by-name/ta/taskwarrior3/package.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/ta/taskwarrior3/package.nix b/pkgs/by-name/ta/taskwarrior3/package.nix index 7b42ecfa2423..57b050c7fbee 100644 --- a/pkgs/by-name/ta/taskwarrior3/package.nix +++ b/pkgs/by-name/ta/taskwarrior3/package.nix @@ -13,13 +13,13 @@ xdg-utils, installShellFiles, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "taskwarrior"; version = "3.1.0"; src = fetchFromGitHub { owner = "GothenburgBitFactory"; repo = "taskwarrior"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; hash = "sha256-iKpOExj1xM9rU/rIcOLLKMrZrAfz7y9X2kt2CjfMOOQ="; fetchSubmodules = true; }; @@ -44,9 +44,9 @@ stdenv.mkDerivation rec { checkTarget = "build_tests"; cargoDeps = rustPlatform.fetchCargoTarball { - name = "${pname}-${version}-cargo-deps"; - inherit src; - sourceRoot = src.name; + name = "${finalAttrs.pname}-${finalAttrs.version}-cargo-deps"; + inherit (finalAttrs) src; + sourceRoot = finalAttrs.src.name; hash = "sha256-L+hYYKXSOG4XYdexLMG3wdA7st+A9Wk9muzipSNjxrA="; }; cargoRoot = "./"; @@ -72,7 +72,7 @@ stdenv.mkDerivation rec { passthru.tests.nixos = nixosTests.taskchampion-sync-server; meta = { - changelog = "https://github.com/GothenburgBitFactory/taskwarrior/blob/${src.rev}/ChangeLog"; + changelog = "https://github.com/GothenburgBitFactory/taskwarrior/blob/${finalAttrs.src.rev}/ChangeLog"; description = "Highly flexible command-line tool to manage TODO lists"; homepage = "https://taskwarrior.org"; license = lib.licenses.mit; @@ -85,4 +85,4 @@ stdenv.mkDerivation rec { mainProgram = "task"; platforms = lib.platforms.unix; }; -} +}) From ee188a0e1c2f4ceda63f436cf269f227758b432d Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 28 Nov 2024 17:35:36 +0200 Subject: [PATCH 3/9] taskwarrior3: put cargoDeps attribute including hash close to src --- pkgs/by-name/ta/taskwarrior3/package.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/ta/taskwarrior3/package.nix b/pkgs/by-name/ta/taskwarrior3/package.nix index 57b050c7fbee..0c55add7c27a 100644 --- a/pkgs/by-name/ta/taskwarrior3/package.nix +++ b/pkgs/by-name/ta/taskwarrior3/package.nix @@ -23,6 +23,13 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-iKpOExj1xM9rU/rIcOLLKMrZrAfz7y9X2kt2CjfMOOQ="; fetchSubmodules = true; }; + cargoDeps = rustPlatform.fetchCargoTarball { + name = "${finalAttrs.pname}-${finalAttrs.version}-cargo-deps"; + inherit (finalAttrs) src; + sourceRoot = finalAttrs.src.name; + hash = "sha256-L+hYYKXSOG4XYdexLMG3wdA7st+A9Wk9muzipSNjxrA="; + }; + cargoRoot = "./"; postPatch = '' substituteInPlace src/commands/CmdNews.cpp \ @@ -43,13 +50,6 @@ stdenv.mkDerivation (finalAttrs: { doCheck = true; checkTarget = "build_tests"; - cargoDeps = rustPlatform.fetchCargoTarball { - name = "${finalAttrs.pname}-${finalAttrs.version}-cargo-deps"; - inherit (finalAttrs) src; - sourceRoot = finalAttrs.src.name; - hash = "sha256-L+hYYKXSOG4XYdexLMG3wdA7st+A9Wk9muzipSNjxrA="; - }; - cargoRoot = "./"; preConfigure = '' export CMAKE_PREFIX_PATH="${corrosion}:$CMAKE_PREFIX_PATH" ''; From 55ccaea3ee9ef1048343245a4d1832ed95c601d0 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 28 Nov 2024 17:36:13 +0200 Subject: [PATCH 4/9] taskwarrior3: use substituteInPlace --replace-fail --- pkgs/by-name/ta/taskwarrior3/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/ta/taskwarrior3/package.nix b/pkgs/by-name/ta/taskwarrior3/package.nix index 0c55add7c27a..b55d78619339 100644 --- a/pkgs/by-name/ta/taskwarrior3/package.nix +++ b/pkgs/by-name/ta/taskwarrior3/package.nix @@ -33,7 +33,7 @@ stdenv.mkDerivation (finalAttrs: { postPatch = '' substituteInPlace src/commands/CmdNews.cpp \ - --replace "xdg-open" "${lib.getBin xdg-utils}/bin/xdg-open" + --replace-fail "xdg-open" "${lib.getBin xdg-utils}/bin/xdg-open" ''; nativeBuildInputs = [ From 82785b7c6001e34a60356015b488bf633c4d1150 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 28 Nov 2024 17:37:35 +0200 Subject: [PATCH 5/9] taskwarrior3: put preConfigure near postPatch As the former runs right after the later, and they are related to `src`. --- pkgs/by-name/ta/taskwarrior3/package.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/ta/taskwarrior3/package.nix b/pkgs/by-name/ta/taskwarrior3/package.nix index b55d78619339..ca64d91c0260 100644 --- a/pkgs/by-name/ta/taskwarrior3/package.nix +++ b/pkgs/by-name/ta/taskwarrior3/package.nix @@ -36,6 +36,10 @@ stdenv.mkDerivation (finalAttrs: { --replace-fail "xdg-open" "${lib.getBin xdg-utils}/bin/xdg-open" ''; + preConfigure = '' + export CMAKE_PREFIX_PATH="${corrosion}:$CMAKE_PREFIX_PATH" + ''; + nativeBuildInputs = [ cmake libuuid @@ -50,10 +54,6 @@ stdenv.mkDerivation (finalAttrs: { doCheck = true; checkTarget = "build_tests"; - preConfigure = '' - export CMAKE_PREFIX_PATH="${corrosion}:$CMAKE_PREFIX_PATH" - ''; - postInstall = '' # ZSH is installed automatically from some reason, only bash and fish need # manual installation From 8ef11d09edb82498eb535e59f1ed88ec96d36049 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 28 Nov 2024 17:38:50 +0200 Subject: [PATCH 6/9] taskwarrior3: put libuuid in buildInputs And use strictDeps = true; to avoid such mistakes in the future. --- pkgs/by-name/ta/taskwarrior3/package.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/ta/taskwarrior3/package.nix b/pkgs/by-name/ta/taskwarrior3/package.nix index ca64d91c0260..8fae12fa1644 100644 --- a/pkgs/by-name/ta/taskwarrior3/package.nix +++ b/pkgs/by-name/ta/taskwarrior3/package.nix @@ -40,9 +40,9 @@ stdenv.mkDerivation (finalAttrs: { export CMAKE_PREFIX_PATH="${corrosion}:$CMAKE_PREFIX_PATH" ''; + strictDeps = true; nativeBuildInputs = [ cmake - libuuid python3 installShellFiles corrosion @@ -51,6 +51,10 @@ stdenv.mkDerivation (finalAttrs: { rustPlatform.cargoSetupHook ]; + buildInputs = [ + libuuid + ]; + doCheck = true; checkTarget = "build_tests"; From 96f64d381dff9fb2ddb212766760a805c5d3ef1e Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 28 Nov 2024 17:51:35 +0200 Subject: [PATCH 7/9] taskwarrior3: remove unneeded nativeBuildInputs --- pkgs/by-name/ta/taskwarrior3/package.nix | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/pkgs/by-name/ta/taskwarrior3/package.nix b/pkgs/by-name/ta/taskwarrior3/package.nix index 8fae12fa1644..9619026b6c61 100644 --- a/pkgs/by-name/ta/taskwarrior3/package.nix +++ b/pkgs/by-name/ta/taskwarrior3/package.nix @@ -1,15 +1,11 @@ { rustPlatform, - rustc, - cargo, - corrosion, lib, stdenv, fetchFromGitHub, cmake, libuuid, nixosTests, - python3, xdg-utils, installShellFiles, }: @@ -36,18 +32,10 @@ stdenv.mkDerivation (finalAttrs: { --replace-fail "xdg-open" "${lib.getBin xdg-utils}/bin/xdg-open" ''; - preConfigure = '' - export CMAKE_PREFIX_PATH="${corrosion}:$CMAKE_PREFIX_PATH" - ''; - strictDeps = true; nativeBuildInputs = [ cmake - python3 installShellFiles - corrosion - cargo - rustc rustPlatform.cargoSetupHook ]; From 64be18585641e43b4140681b7467813773d0c48d Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 28 Nov 2024 17:54:16 +0200 Subject: [PATCH 8/9] taskwarrior3: reorder inputs --- pkgs/by-name/ta/taskwarrior3/package.nix | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/ta/taskwarrior3/package.nix b/pkgs/by-name/ta/taskwarrior3/package.nix index 9619026b6c61..77eb93f6731e 100644 --- a/pkgs/by-name/ta/taskwarrior3/package.nix +++ b/pkgs/by-name/ta/taskwarrior3/package.nix @@ -1,13 +1,19 @@ { - rustPlatform, lib, stdenv, fetchFromGitHub, + + # nativeBuildInputs cmake, - libuuid, - nixosTests, - xdg-utils, + rustPlatform, installShellFiles, + + # buildInputs + libuuid, + xdg-utils, + + # passthru.tests + nixosTests, }: stdenv.mkDerivation (finalAttrs: { pname = "taskwarrior"; @@ -35,8 +41,8 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; nativeBuildInputs = [ cmake - installShellFiles rustPlatform.cargoSetupHook + installShellFiles ]; buildInputs = [ From a0076d98cfaabe9f9ca806e7e7b5f8eb827a54da Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 28 Nov 2024 17:55:26 +0200 Subject: [PATCH 9/9] taskwarrior3: 3.1.0 -> 3.2.0-unstable-2024-12-17 Updated to this unstable version due to: https://github.com/GothenburgBitFactory/taskwarrior/issues/3705 Diff: https://github.com/GothenburgBitFactory/taskwarrior/compare/v3.1.0...cc505e488184e958bcaedad6fed86f91d128e6bd Changelog: https://github.com/GothenburgBitFactory/taskwarrior/blob//cc505e488184e958bcaedad6fed86f91d128e6bdChangeLog --- pkgs/by-name/ta/taskwarrior3/package.nix | 52 ++++++++++++++++++++---- 1 file changed, 45 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/ta/taskwarrior3/package.nix b/pkgs/by-name/ta/taskwarrior3/package.nix index 77eb93f6731e..078c4542052d 100644 --- a/pkgs/by-name/ta/taskwarrior3/package.nix +++ b/pkgs/by-name/ta/taskwarrior3/package.nix @@ -6,6 +6,8 @@ # nativeBuildInputs cmake, rustPlatform, + rustc, + cargo, installShellFiles, # buildInputs @@ -14,34 +16,61 @@ # passthru.tests nixosTests, + + # nativeCheckInputs + python3, }: stdenv.mkDerivation (finalAttrs: { pname = "taskwarrior"; - version = "3.1.0"; + version = "3.2.0-unstable-2024-12-17"; src = fetchFromGitHub { owner = "GothenburgBitFactory"; repo = "taskwarrior"; - rev = "v${finalAttrs.version}"; - hash = "sha256-iKpOExj1xM9rU/rIcOLLKMrZrAfz7y9X2kt2CjfMOOQ="; + rev = "cc505e488184e958bcaedad6fed86f91d128e6bd"; + hash = "sha256-M9pRoilxTHppX/efvppBI+QiPYXBEkvWxiEnodjqryk="; fetchSubmodules = true; }; cargoDeps = rustPlatform.fetchCargoTarball { name = "${finalAttrs.pname}-${finalAttrs.version}-cargo-deps"; inherit (finalAttrs) src; - sourceRoot = finalAttrs.src.name; - hash = "sha256-L+hYYKXSOG4XYdexLMG3wdA7st+A9Wk9muzipSNjxrA="; + hash = "sha256-QPnW+FWbsjvjQr5CRuOGLIaUWSGItlFDwLEtZfRbihA="; # For fetchCargoTarball with name arguments }; - cargoRoot = "./"; postPatch = '' substituteInPlace src/commands/CmdNews.cpp \ --replace-fail "xdg-open" "${lib.getBin xdg-utils}/bin/xdg-open" ''; + # The CMakeLists files used by upstream issue a `cargo install` command to + # install a rust tool (cxxbridge-cmd) that is supposed to be included in the Cargo.toml's and + # `Cargo.lock` files of upstream. Setting CARGO_HOME like that helps `cargo + # install` find the dependencies we prefetched. See also: + # https://github.com/GothenburgBitFactory/taskwarrior/issues/3705 + postUnpack = '' + export CARGO_HOME=$PWD/.cargo + ''; + # Test failures, see: + # https://github.com/GothenburgBitFactory/taskwarrior/issues/3727 + failingTests = [ + "bash_completion.test.py" + "hooks.env.test.py" + "hooks.on-add.test.py" + "hooks.on-launch.test.py" + "hooks.on-modify.test.py" + "hooks.on-exit.test.py" + ]; + preConfigure = '' + substituteInPlace test/CMakeLists.txt \ + ${lib.concatMapStringsSep "\\\n " (t: "--replace-fail ${t} '' ") finalAttrs.failingTests} + ''; strictDeps = true; nativeBuildInputs = [ cmake rustPlatform.cargoSetupHook + # To install cxxbridge-cmd before configurePhase, see above linked upstream + # issue. + rustc + cargo installShellFiles ]; @@ -50,7 +79,16 @@ stdenv.mkDerivation (finalAttrs: { ]; doCheck = true; - checkTarget = "build_tests"; + preCheck = '' + # See: + # https://github.com/GothenburgBitFactory/taskwarrior/blob/v3.2.0/doc/devel/contrib/development.md#run-the-test-suite + make test_runner + # Otherwise all '/usr/bin/env python' shebangs are not found by ctest + patchShebangs test/*.py test/*/*.py + ''; + nativeCheckInputs = [ + python3 + ]; postInstall = '' # ZSH is installed automatically from some reason, only bash and fish need