depot/third_party/nixpkgs/pkgs/tools/misc/nurl/default.nix
Default email 94427deb9d Project import generated by Copybara.
GitOrigin-RevId: f91ee3065de91a3531329a674a45ddcb3467a650
2023-05-24 16:37:59 +03:00

61 lines
1.4 KiB
Nix

{ lib
, rustPlatform
, fetchFromGitHub
, installShellFiles
, makeBinaryWrapper
, stdenv
, darwin
, gitMinimal
, mercurial
, nixVersions
}:
rustPlatform.buildRustPackage rec {
pname = "nurl";
version = "0.3.12";
src = fetchFromGitHub {
owner = "nix-community";
repo = "nurl";
rev = "v${version}";
hash = "sha256-L9lYFPUk8B34vEtHZZ/9v1cEzQXoNo3Rc0e9/lwMrU0=";
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"nix-compat-0.1.0" = "sha256-8QP9qEUtCvSvv1LcMPg04RrSagpINZeh4o2CBMzUjn4=";
};
};
nativeBuildInputs = [
installShellFiles
makeBinaryWrapper
];
buildInputs = lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
];
# tests require internet access
doCheck = false;
postInstall = ''
wrapProgram $out/bin/nurl \
--prefix PATH : ${lib.makeBinPath [ gitMinimal mercurial nixVersions.unstable ]}
installManPage artifacts/nurl.1
installShellCompletion artifacts/nurl.{bash,fish} --zsh artifacts/_nurl
'';
env = {
GEN_ARTIFACTS = "artifacts";
};
meta = with lib; {
description = "Command-line tool to generate Nix fetcher calls from repository URLs";
homepage = "https://github.com/nix-community/nurl";
changelog = "https://github.com/nix-community/nurl/blob/v${version}/CHANGELOG.md";
license = licenses.mpl20;
maintainers = with maintainers; [ figsoda ];
};
}