mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-02 21:10:08 +00:00
Moving the env variable for future-proofing for __structuredAttrs = true. When cross compiling, if doCheck = true; in mkDerivation's arguments, then finalAttrs.doCheck will also be true, but doCheck will be passed to the builder as false, and the actual, resultant attrset returned by mkDerivation will also have doCheck set to false.
72 lines
1.3 KiB
Nix
72 lines
1.3 KiB
Nix
{
|
|
buildGoModule,
|
|
fetchurl,
|
|
lib,
|
|
zstd,
|
|
sharness,
|
|
python3,
|
|
perl,
|
|
}:
|
|
|
|
buildGoModule (finalAttrs: {
|
|
pname = "goredo";
|
|
version = "2.6.0";
|
|
|
|
src = fetchurl {
|
|
url = "http://www.goredo.cypherpunks.ru/download/goredo-${finalAttrs.version}.tar.zst";
|
|
hash = "sha256-XTL/otfCKC55TsUBBVors2kgFpOFh+6oekOOafOhcUs=";
|
|
};
|
|
|
|
patches = [
|
|
# Adapt tests to Linux/nix-build requirements:
|
|
./fix-tests.diff
|
|
];
|
|
|
|
nativeBuildInputs = [ zstd ];
|
|
|
|
nativeCheckInputs = lib.optionals finalAttrs.finalPackage.doCheck [
|
|
python3
|
|
perl
|
|
];
|
|
|
|
env = {
|
|
inherit (sharness) SHARNESS_TEST_SRCDIR;
|
|
};
|
|
|
|
vendorHash = null;
|
|
|
|
modRoot = "./src";
|
|
subPackages = [ "." ];
|
|
|
|
postBuild = ''
|
|
( cd $GOPATH/bin; ./goredo -symlinks )
|
|
cd ..
|
|
'';
|
|
|
|
doCheck = true;
|
|
checkPhase = ''
|
|
runHook preCheck
|
|
export PATH=$GOPATH/bin:$PATH
|
|
(cd t; prove -f .)
|
|
runHook postCheck
|
|
'';
|
|
|
|
postInstall = ''
|
|
mkdir -p "$out/share/info"
|
|
cp goredo.info "$out/share/info"
|
|
'';
|
|
|
|
outputs = [
|
|
"out"
|
|
"info"
|
|
];
|
|
|
|
meta = {
|
|
outputsToInstall = [ "out" ];
|
|
description = "Makefile replacement that sucks less";
|
|
homepage = "https://www.goredo.cypherpunks.ru";
|
|
license = lib.licenses.gpl3;
|
|
maintainers = [ lib.maintainers.spacefrogg ];
|
|
};
|
|
})
|