-
-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
- Loading branch information
1 parent
21f6185
commit 351a371
Showing
2 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ lib | ||
, buildGoModule | ||
, fetchFromGitHub | ||
, installShellFiles | ||
, testers | ||
, repro-get | ||
, cacert | ||
}: | ||
|
||
buildGoModule rec { | ||
pname = "repro-get"; | ||
version = "0.2.1"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "reproducible-containers"; | ||
repo = "repro-get"; | ||
rev = "v${version}"; | ||
sha256 = "sha256-3cvKHwAyPYwR5VlhpPJH+3BK9Kw7dTGOPN1q2RnwsG0="; | ||
}; | ||
|
||
vendorSha256 = "sha256-ebvtPc0QiP7fNiWYjd7iLG/4iH4DqWV/eaDHvmV/H3Y="; | ||
|
||
nativeBuildInputs = [ installShellFiles ]; | ||
|
||
# The pkg/version test requires internet access, so disable it here and run it | ||
# in passthru.pkg-version | ||
preCheck = '' | ||
rm -rf pkg/version | ||
''; | ||
|
||
ldflags = [ | ||
"-s" | ||
"-w" | ||
"-X github.com/reproducible-containers/${pname}/pkg/version.Version=v${version}" | ||
]; | ||
|
||
postInstall = '' | ||
installShellCompletion --cmd repro-get \ | ||
--bash <($out/bin/repro-get completion bash) \ | ||
--fish <($out/bin/repro-get completion fish) \ | ||
--zsh <($out/bin/repro-get completion zsh) | ||
''; | ||
|
||
passthru.tests = { | ||
"pkg/version" = repro-get.overrideAttrs (old: { | ||
subPackages = [ "pkg/version" ]; | ||
fixupPhase = "rm -rf $out && touch $out"; | ||
preCheck = ""; | ||
dontInstall = true; | ||
outputHash = "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU="; | ||
outputHashAlgo = "sha256"; | ||
outputHashMode = "flat"; | ||
nativeBuildInputs = old.nativeBuildInputs ++ [ cacert ]; | ||
}); | ||
version = testers.testVersion { | ||
package = repro-get; | ||
command = "HOME=$(mktemp -d) repro-get -v"; | ||
version = "${version}"; | ||
}; | ||
}; | ||
|
||
outputs = [ "out" ]; | ||
|
||
meta = with lib; { | ||
description = "Reproducible apt/dnf/apk/pacman, with content-addressing"; | ||
homepage = "https://github.com/reproducible-containers/repro-get"; | ||
license = licenses.asl20; | ||
maintainers = with maintainers; [ matthewcroughan ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters