nixpkgs/pkgs/tools/package-management/holo-build/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

61 lines
1.7 KiB
Nix
Raw Normal View History

2021-02-12 16:37:51 +01:00
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, perl, file }:
buildGoModule rec {
pname = "holo-build";
version = "1.6.1";
src = fetchFromGitHub {
owner = "holocm";
repo = pname;
rev = "v${version}";
sha256 = "0lypbgf96bcc4m3968xa4il1zwprsdyc0pw6pl9mqq7djxabikd0";
};
postPatch = ''
substituteInPlace Makefile \
--replace 'VERSION :=' 'VERSION ?='
substituteInPlace src/holo-build.sh \
--replace '/usr/lib/holo/holo-build' '${placeholder "out"}/lib/holo/holo-build'
'';
vendorHash = null;
2021-02-12 16:37:51 +01:00
nativeBuildInputs = [ installShellFiles perl ];
subPackages = [ "src/holo-build" ];
2021-08-26 08:45:51 +02:00
ldflags = [ "-s" "-w" "-X github.com/holocm/holo-build/src/holo-build/common.version=${version}" ];
2021-02-12 16:37:51 +01:00
postBuild = ''
make build/man/holo-build.8 VERSION=${version}
'';
nativeCheckInputs = [ file ];
2021-02-12 16:37:51 +01:00
checkPhase = ''
ln -s ../../go/bin/holo-build build/holo-build
go build -ldflags "-s -w -X github.com/holocm/holo-build/src/holo-build/common.version=${version}" -o build/dump-package ./src/dump-package
bash test/compiler/run_tests.sh
bash test/interface/run_tests.sh
'';
postInstall = ''
installManPage build/man/*
installShellCompletion --bash --name holo-build util/autocomplete.bash
installShellCompletion --zsh --name _holo-build util/autocomplete.zsh
# install wrapper script
mkdir -p $out/lib/holo
mv $out/bin/holo-build $out/lib/holo/holo-build
cp src/holo-build.sh $out/bin/holo-build
'';
meta = with lib; {
description = "Cross-distribution system package compiler";
homepage = "https://holocm.org/";
2021-02-12 16:37:51 +01:00
license = licenses.gpl3Plus;
2023-07-23 19:30:22 +02:00
maintainers = with maintainers; [ ];
2023-11-27 02:17:53 +01:00
mainProgram = "holo-build";
2021-02-12 16:37:51 +01:00
};
}