mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-15 03:40:22 +00:00
I grepped for `fetchCargoVendor` and `inherit (finalAttrs) src;`, and wrote this patch by hand. I tested this with `nix-build --check` on the following attributes, derived from `.meta.position`s that match any of the touched files: * `amberol.cargoDeps.vendorStaging` * `atuin-desktop.cargoDeps.vendorStaging` * `chance.cargoDeps.vendorStaging` * `clapgrep.cargoDeps.vendorStaging` * `cutecosmic.cargoDeps.vendorStaging` * `delineate.cargoDeps.vendorStaging` * `drawpile.cargoDeps.vendorStaging` * `drawpile-server-headless.cargoDeps.vendorStaging` * `field-monitor.cargoDeps.vendorStaging` * `fractal.cargoDeps.vendorStaging` * `geopard.cargoDeps.vendorStaging` * `git-cinnabar.cargoDeps.vendorStaging` * `gnome-robots.cargoDeps.vendorStaging` * `insulator2.cargoDeps.vendorStaging` * `kana.cargoDeps.vendorStaging` * `key-rack.cargoDeps.vendorStaging` * `kime.cargoDeps.vendorStaging` * `krunkit.cargoDeps.vendorStaging` * `krunvm.cargoDeps.vendorStaging` * `ladybird.cargoDeps.vendorStaging` * `libchewing.cargoDeps.vendorStaging` * `loupe.cargoDeps.vendorStaging` * `metronome.cargoDeps.vendorStaging` * `pdns-recursor.cargoDeps.vendorStaging` * `python314Packages.copykitten.cargoDeps.vendorStaging` * `python314Packages.django-vcache.cargoDeps.vendorStaging` * `python314Packages.pdoc-pyo3-sample-library.cargoDeps.vendorStaging` * `python314Packages.pycambia.cargoDeps.vendorStaging` * `python314Packages.python-kadmin-rs.cargoDeps.vendorStaging` * `python314Packages.tlparse.cargoDeps.vendorStaging` * `python313Packages.copykitten.cargoDeps.vendorStaging` * `python313Packages.django-vcache.cargoDeps.vendorStaging` * `python313Packages.pdoc-pyo3-sample-library.cargoDeps.vendorStaging` * `python313Packages.pycambia.cargoDeps.vendorStaging` * `python313Packages.python-kadmin-rs.cargoDeps.vendorStaging` * `python313Packages.tlparse.cargoDeps.vendorStaging` * `share-preview.cargoDeps.vendorStaging` * `stratisd.cargoDeps.vendorStaging` * `taskwarrior3.cargoDeps.vendorStaging` * `tsukimi.cargoDeps.vendorStaging` * `wildcard.cargoDeps.vendorStaging`
134 lines
3.6 KiB
Nix
134 lines
3.6 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
|
|
# nativeBuildInputs
|
|
cmake,
|
|
rustPlatform,
|
|
rustc,
|
|
cargo,
|
|
installShellFiles,
|
|
|
|
# buildInputs
|
|
corrosion,
|
|
libuuid,
|
|
|
|
# passthru.tests
|
|
nixosTests,
|
|
|
|
# nativeCheckInputs
|
|
python3,
|
|
|
|
# nativeInstallCheckInputs
|
|
versionCheckHook,
|
|
}:
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "taskwarrior";
|
|
version = "3.4.2";
|
|
src = fetchFromGitHub {
|
|
owner = "GothenburgBitFactory";
|
|
repo = "taskwarrior";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-Y0jnAW4OtPI9GCOSFRPf8/wo4qBB6O1FASj40S601+E=";
|
|
fetchSubmodules = true;
|
|
};
|
|
cargoDeps = rustPlatform.fetchCargoVendor {
|
|
inherit (finalAttrs) pname version src;
|
|
hash = "sha256-03HG8AGe6PJ516zL23iNjGUYmGOZa8NuFljb1ll2pjs=";
|
|
};
|
|
|
|
# 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
|
|
'';
|
|
cmakeFlags = [
|
|
(lib.cmakeBool "SYSTEM_CORROSION" true)
|
|
];
|
|
failingTests = [
|
|
# It would be very hard to make this test succeed, as the bash completion
|
|
# needs to be installed and the builder's `bash` should be aware of it.
|
|
# Doesn't worth the effort. See also:
|
|
# https://github.com/GothenburgBitFactory/taskwarrior/issues/3727
|
|
"bash_completion.test.py"
|
|
];
|
|
# Contains Bash and Python scripts used while testing.
|
|
preConfigure = ''
|
|
patchShebangs test
|
|
''
|
|
+ lib.optionalString (builtins.length finalAttrs.failingTests > 0) ''
|
|
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
|
|
];
|
|
|
|
buildInputs = [
|
|
corrosion
|
|
libuuid
|
|
];
|
|
|
|
doCheck = true;
|
|
# See:
|
|
# https://github.com/GothenburgBitFactory/taskwarrior/blob/v3.4.1/doc/devel/contrib/development.md#run-the-test-suite
|
|
preCheck = ''
|
|
make test_runner
|
|
'';
|
|
nativeCheckInputs = [
|
|
python3
|
|
];
|
|
|
|
doInstallCheck = true;
|
|
|
|
nativeInstallCheckInputs = [
|
|
versionCheckHook
|
|
];
|
|
|
|
versionCheckProgram = "${placeholder "out"}/bin/${finalAttrs.meta.mainProgram}";
|
|
|
|
postInstall = ''
|
|
# ZSH is installed automatically from some reason, only bash and fish need
|
|
# manual installation
|
|
installShellCompletion --cmd task \
|
|
--bash $out/share/doc/task/scripts/bash/task.sh \
|
|
--fish $out/share/doc/task/scripts/fish/task.fish
|
|
rm -r $out/share/doc/task/scripts/bash
|
|
rm -r $out/share/doc/task/scripts/fish
|
|
# Install vim and neovim plugin
|
|
mkdir -p $out/share/vim-plugins
|
|
mv $out/share/doc/task/scripts/vim $out/share/vim-plugins/task
|
|
mkdir -p $out/share/nvim
|
|
ln -s $out/share/vim-plugins/task $out/share/nvim/site
|
|
'';
|
|
|
|
passthru.tests.nixos = nixosTests.taskchampion-sync-server;
|
|
|
|
meta = {
|
|
changelog = "https://github.com/GothenburgBitFactory/taskwarrior/releases/tag/${finalAttrs.src.tag}";
|
|
description = "Highly flexible command-line tool to manage TODO lists";
|
|
homepage = "https://taskwarrior.org";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [
|
|
oxalica
|
|
mlaradji
|
|
doronbehar
|
|
Necior
|
|
];
|
|
mainProgram = "task";
|
|
platforms = lib.platforms.unix;
|
|
};
|
|
})
|