From 7d3106af4927f17d271dda5fc55dac0e364757e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 12 Feb 2021 16:37:51 +0100 Subject: [PATCH] holo-build: init at 1.6.1 --- .../package-management/holo-build/default.nix | 59 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 61 insertions(+) create mode 100644 pkgs/tools/package-management/holo-build/default.nix diff --git a/pkgs/tools/package-management/holo-build/default.nix b/pkgs/tools/package-management/holo-build/default.nix new file mode 100644 index 000000000000..8f88ae08762b --- /dev/null +++ b/pkgs/tools/package-management/holo-build/default.nix @@ -0,0 +1,59 @@ +{ 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' + ''; + + vendorSha256 = null; + + nativeBuildInputs = [ installShellFiles perl ]; + + subPackages = [ "src/holo-build" ]; + + buildFlagsArray = [ "-ldflags=-s -w -X github.com/holocm/holo-build/src/holo-build/common.version=${version}" ]; + + postBuild = '' + make build/man/holo-build.8 VERSION=${version} + ''; + + checkInputs = [ file ]; + + 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 = "http://holocm.org/"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ SuperSandro2000 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7c35b055ba02..2bf08bdd8bbb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10191,6 +10191,8 @@ in inherit (emacs.pkgs.melpaStablePackages) irony; }; + holo-build = callPackage ../tools/package-management/holo-build { }; + hugs = callPackage ../development/interpreters/hugs { }; openjfx11 = callPackage ../development/compilers/openjdk/openjfx/11.nix { };