diff options
author | TomaSajt <62384384+TomaSajt@users.noreply.github.com> | 2024-03-10 02:15:25 +0100 |
---|---|---|
committer | TomaSajt <62384384+TomaSajt@users.noreply.github.com> | 2024-03-10 02:15:25 +0100 |
commit | 8d4e651526d5ff677eee3ccc31fe1cdf8f84567b (patch) | |
tree | ed8d9695cf922a3fcf81ecadacef0a354493cbdf /pkgs/applications/office/jameica/default.nix | |
parent | defacb7566d52555954cea1fdd6b11d0ed0658be (diff) |
jameica: make deterministic and clean up
Diffstat (limited to 'pkgs/applications/office/jameica/default.nix')
-rw-r--r-- | pkgs/applications/office/jameica/default.nix | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/pkgs/applications/office/jameica/default.nix b/pkgs/applications/office/jameica/default.nix index e6aa7cb21d14e..683d51bf43f2a 100644 --- a/pkgs/applications/office/jameica/default.nix +++ b/pkgs/applications/office/jameica/default.nix @@ -1,4 +1,17 @@ -{ lib, stdenv, fetchFromGitHub, makeDesktopItem, makeWrapper, wrapGAppsHook, ant, jdk, jre, gtk2, glib, xorg, Cocoa }: +{ lib +, stdenv +, fetchFromGitHub +, makeDesktopItem +, makeWrapper +, wrapGAppsHook +, ant +, jdk +, jre +, gtk2 +, glib +, libXtst +, Cocoa +}: let _version = "2.10.4"; @@ -26,10 +39,6 @@ stdenv.mkDerivation rec { pname = "jameica"; inherit version; - nativeBuildInputs = [ ant jdk wrapGAppsHook makeWrapper ]; - buildInputs = lib.optionals stdenv.isLinux [ gtk2 glib xorg.libXtst ] - ++ lib.optional stdenv.isDarwin Cocoa; - src = fetchFromGitHub { owner = "willuhn"; repo = "jameica"; @@ -37,15 +46,29 @@ stdenv.mkDerivation rec { hash = "sha256-MSVSd5DyVL+dcfTDv1M99hxickPwT2Pt6QGNsu6DGZI="; }; + postPatch = '' + # Fix jar timestamps for reproducibility + substituteInPlace build/build.xml \ + --replace-fail '<jar ' '<jar modificationtime="0" ' + ''; + + nativeBuildInputs = [ ant jdk wrapGAppsHook makeWrapper ]; + buildInputs = lib.optionals stdenv.isLinux [ gtk2 glib libXtst ] + ++ lib.optional stdenv.isDarwin Cocoa; + dontWrapGApps = true; # there is also a build.gradle, but it only seems to be used to vendor 3rd party libraries # and is not able to build the application itself buildPhase = '' - (cd build; ant -Dsystem.version=${version} init compile jar) + runHook preBuild + ant -f build -Dsystem.version=${version} init compile jar + runHook postBuild ''; installPhase = '' + runHook preInstall + mkdir -p $out/libexec $out/lib $out/bin $out/share/{applications,jameica-${version},java}/ # copy libraries except SWT @@ -57,6 +80,8 @@ stdenv.mkDerivation rec { install -Dm644 plugin.xml $out/share/java/ install -Dm644 build/jameica-icon.png $out/share/pixmaps/jameica.png cp ${desktopItem}/share/applications/* $out/share/applications/ + + runHook postInstall ''; postFixup = '' |