From 1c2d9d6f451d1fa892878e868032bdfe6e5e781b Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Mon, 11 Mar 2024 13:21:00 +0100 Subject: [PATCH 1/2] projectlibre: clean up --- .../misc/projectlibre/default.nix | 70 ++++++++++++------- 1 file changed, 45 insertions(+), 25 deletions(-) diff --git a/pkgs/applications/misc/projectlibre/default.nix b/pkgs/applications/misc/projectlibre/default.nix index 52e56ed0623c..63d863968557 100644 --- a/pkgs/applications/misc/projectlibre/default.nix +++ b/pkgs/applications/misc/projectlibre/default.nix @@ -1,46 +1,66 @@ -{ lib, stdenv, fetchgit, ant, jdk, makeWrapper, jre, coreutils, which }: +{ lib +, stdenv +, fetchgit +, ant +, jdk +, makeWrapper +, jre +, coreutils +, which +}: -stdenv.mkDerivation rec { +stdenv.mkDerivation { pname = "projectlibre"; version = "1.7.0"; src = fetchgit { url = "https://git.code.sf.net/p/projectlibre/code"; rev = "0c939507cc63e9eaeb855437189cdec79e9386c2"; # version 1.7.0 was not tagged - sha256 = "0vy5vgbp45ai957gaby2dj1hvmbxfdlfnwcanwqm9f8q16qipdbq"; + hash = "sha256-eLUbsQkYuVQxt4px62hzfdUNg2zCL/VOSVEVctfbxW8="; }; - nativeBuildInputs = [ makeWrapper ]; - buildInputs = [ ant jdk ]; - buildPhase = '' - export ANT_OPTS=-Dbuild.sysclasspath=ignore - ${ant}/bin/ant -f openproj_build/build.xml - ''; + nativeBuildInputs = [ + ant + jdk + makeWrapper + ]; - resourcesPath = "openproj_build/resources"; - desktopItem = "${resourcesPath}/projectlibre.desktop"; + buildPhase = '' + runHook preBuild + ant -f openproj_build/build.xml + runHook postBuild + ''; installPhase = '' - mkdir -p $out/share/{applications,projectlibre/samples,pixmaps,doc/projectlibre} $out/bin + runHook preInstall + + mkdir -p $out/share/{projectlibre/samples,doc/projectlibre} + + pushd openproj_build + cp -R dist/* $out/share/projectlibre + cp -R license $out/share/doc/projectlibre + cp -R resources/samples/* $out/share/projectlibre/samples + install -Dm644 resources/projectlibre.desktop -t $out/share/applications + install -Dm644 resources/projectlibre.png -t $out/share/pixmaps + install -Dm755 resources/projectlibre -t $out/bin + popd + + substituteInPlace $out/bin/projectlibre \ + --replace-fail "/usr/share/projectlibre" "$out/share/projectlibre" - substitute $resourcesPath/projectlibre $out/bin/projectlibre \ - --replace "\"/usr/share/projectlibre\"" "\"$out/share/projectlibre\"" - chmod +x $out/bin/projectlibre wrapProgram $out/bin/projectlibre \ - --prefix PATH : "${jre}/bin:${coreutils}/bin:${which}/bin" + --prefix PATH : ${lib.makeBinPath [ jre coreutils which ]} - cp -R openproj_build/dist/* $out/share/projectlibre - cp -R openproj_build/license $out/share/doc/projectlibre - cp $desktopItem $out/share/applications - cp $resourcesPath/projectlibre.png $out/share/pixmaps - cp -R $resourcesPath/samples/* $out/share/projectlibre/samples + runHook postInstall ''; - meta = with lib; { - homepage = "https://www.projectlibre.com/"; + meta = { description = "Project-Management Software similar to MS-Project"; + homepage = "https://www.projectlibre.com/"; + license = lib.licenses.cpal10; mainProgram = "projectlibre"; - maintainers = [ maintainers.Mogria ]; - license = licenses.cpal10; + maintainers = with lib.maintainers; [ Mogria tomasajt ]; + platforms = jre.meta.platforms; }; } + From 287d631ab316c0c3d4152fd5cc6e15dee06987ac Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Mon, 11 Mar 2024 22:09:33 +0100 Subject: [PATCH 2/2] projectlibre: make deterministic --- pkgs/applications/misc/projectlibre/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/applications/misc/projectlibre/default.nix b/pkgs/applications/misc/projectlibre/default.nix index 63d863968557..b0591cc0c12a 100644 --- a/pkgs/applications/misc/projectlibre/default.nix +++ b/pkgs/applications/misc/projectlibre/default.nix @@ -3,6 +3,7 @@ , fetchgit , ant , jdk +, stripJavaArchivesHook , makeWrapper , jre , coreutils @@ -22,6 +23,7 @@ stdenv.mkDerivation { nativeBuildInputs = [ ant jdk + stripJavaArchivesHook makeWrapper ];