Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

taskwarrior3: fix version and add versionCheckHook test #368520

Merged
merged 3 commits into from
Dec 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions pkgs/by-name/ta/taskwarrior3/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,18 @@

# nativeCheckInputs
python3,

# nativeInstallCheckInputs
versionCheckHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "taskwarrior";
version = "3.3.0";
src = fetchFromGitHub {
owner = "GothenburgBitFactory";
repo = "taskwarrior";
rev = "dcbe916286792e6f5d2d3af3baab79918ebc5f71";
hash = "sha256-jma1BYZugMH+JiX5Xu6VI8ZFn4FBr1NxbNrOHX0bFk0=";
rev = "v${finalAttrs.version}";
hash = "sha256-aKDwRCJ1yopRdsPxnHhgOpSho1i8/dcAurI+XhpSbn4=";
Comment on lines +32 to +33
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh thanks! I counted on nix-update to the job for me, even when the current version is "unstable".

fetchSubmodules = true;
};
cargoDeps = rustPlatform.fetchCargoTarball {
Expand Down Expand Up @@ -90,6 +93,14 @@ stdenv.mkDerivation (finalAttrs: {
python3
];

doInstallCheck = true;

nativeInstallCheckInputs = [
versionCheckHook
];

versionCheckProgram = "${placeholder "out"}/bin/${finalAttrs.meta.mainProgram}";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
versionCheckProgram = "${placeholder "out"}/bin/${finalAttrs.meta.mainProgram}";
versionCheckProgram = "${placeholder "out"}/bin/task";

I remember someone somewhere saying that finalAttrs.meta.* is a bad idea for some reason. I can't remember why, or if it's even a anti-pattern in the first place, but do let me know if this should be changed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember someone somewhere saying that finalAttrs.meta.* is a bad idea for some reason. I can't remember why, or if it's even a anti-pattern in the first place, but do let me know if this should be changed.

I too heard that said, and TBH I'm not very good at explaining why. I heard that though mostly about src and pname as the repo argument, and here I think it is a bit different. I won't make this a blocker, as the rest of the PR is perfect.


postInstall = ''
# ZSH is installed automatically from some reason, only bash and fish need
# manual installation
Expand All @@ -108,7 +119,7 @@ stdenv.mkDerivation (finalAttrs: {
passthru.tests.nixos = nixosTests.taskchampion-sync-server;

meta = {
changelog = "https://github.com/GothenburgBitFactory/taskwarrior/blob/${finalAttrs.src.rev}/ChangeLog";
changelog = "https://github.com/GothenburgBitFactory/taskwarrior/releases/tag/v${finalAttrs.src.rev}";
description = "Highly flexible command-line tool to manage TODO lists";
homepage = "https://taskwarrior.org";
license = lib.licenses.mit;
Expand Down
Loading