comma: 1.1.0 -> 1.2.3
This commit is contained in:
parent
a7cf9372e9
commit
f0c565c127
|
@ -1,55 +1,43 @@
|
||||||
{ lib
|
{ lib
|
||||||
, stdenv
|
, rustPlatform
|
||||||
, fetchurl
|
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, linkFarm
|
, nix
|
||||||
, nix-index
|
|
||||||
, fzy
|
, fzy
|
||||||
|
, makeWrapper
|
||||||
|
, testVersion
|
||||||
|
, comma
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
rustPlatform.buildRustPackage rec {
|
||||||
|
|
||||||
# nix-index takes a little while to run and the contents don't change
|
|
||||||
# meaningfully very often.
|
|
||||||
indexCache = fetchurl {
|
|
||||||
url = "https://github.com/Mic92/nix-index-database/releases/download/2021-12-12/index-x86_64-linux";
|
|
||||||
sha256 = "sha256-+SoG5Qz2KWA/nIWXE6SLpdi8MDqTs8LY90fGZxGKOiA=";
|
|
||||||
};
|
|
||||||
|
|
||||||
# nix-locate needs the --db argument to be a directory containing a file
|
|
||||||
# named "files".
|
|
||||||
nixIndexDB = linkFarm "nix-index-cache" [
|
|
||||||
{ name = "files"; path = indexCache; }
|
|
||||||
];
|
|
||||||
|
|
||||||
in stdenv.mkDerivation rec {
|
|
||||||
pname = "comma";
|
pname = "comma";
|
||||||
version = "1.1.0";
|
version = "1.2.3";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "nix-community";
|
owner = "nix-community";
|
||||||
repo = pname;
|
repo = "comma";
|
||||||
rev = version;
|
rev = "v${version}";
|
||||||
sha256 = "sha256-WBIQmwlkb/GMoOq+Dnyrk8YmgiM/wJnc5HYZP8Uw72E=";
|
sha256 = "sha256-emhvBaicLAnu/Kn4oxHngGa5BSxOEwbkhTLO5XvauMw=";
|
||||||
};
|
};
|
||||||
|
|
||||||
postPatch = ''
|
cargoSha256 = "sha256-mQxNo4VjW2Q0MYfU+RCb4Ayl9ClpxrSV8X4EKZ7PewA=";
|
||||||
substituteInPlace , \
|
|
||||||
--replace '$PREBUILT_NIX_INDEX_DB' "${nixIndexDB}" \
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
--replace nix-locate "${nix-index}/bin/nix-locate" \
|
|
||||||
--replace fzy "${fzy}/bin/fzy"
|
postInstall = ''
|
||||||
|
wrapProgram $out/bin/comma \
|
||||||
|
--prefix PATH : ${lib.makeBinPath [ nix fzy ]}
|
||||||
|
ln -s $out/bin/comma $out/bin/,
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
passthru.tests = {
|
||||||
install -Dm755 , -t $out/bin
|
version = testVersion { package = comma; };
|
||||||
ln -s $out/bin/, $out/bin/comma
|
};
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://github.com/nix-community/comma";
|
homepage = "https://github.com/nix-community/comma";
|
||||||
description = "Run software without installing it";
|
description = "Runs programs without installing them";
|
||||||
license = licenses.mit;
|
license = licenses.mit;
|
||||||
maintainers = with maintainers; [ Enzime ];
|
maintainers = with maintainers; [ Enzime artturin ];
|
||||||
platforms = platforms.all;
|
platforms = platforms.all;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue