depot/third_party/nixpkgs/pkgs/tools/misc/nurl/default.nix
Default email 4bac34ead1 Project import generated by Copybara.
GitOrigin-RevId: 724bfc0892363087709bd3a5a1666296759154b1
2023-02-09 12:40:11 +01:00

54 lines
1.2 KiB
Nix

{ lib
, rustPlatform
, fetchFromGitHub
, installShellFiles
, makeWrapper
, stdenv
, darwin
, gitMinimal
, mercurial
, nix
}:
rustPlatform.buildRustPackage rec {
pname = "nurl";
version = "0.3.7";
src = fetchFromGitHub {
owner = "nix-community";
repo = "nurl";
rev = "v${version}";
hash = "sha256-TtH0sfWFWe3oYK/8jJslqjrEY5rR7HGAVDD5iQ2+spY=";
};
cargoSha256 = "sha256-vwLlqRjiJU3ecLURAZabmIBivYW1zAfMLUhaJzh57ig=";
nativeBuildInputs = [
installShellFiles
makeWrapper
];
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 nix ]}
installManPage artifacts/nurl.1
installShellCompletion artifacts/nurl.{bash,fish} --zsh artifacts/_nurl
'';
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 ];
};
}