diff options
author | Thiago Kenji Okada <thiagokokada@gmail.com> | 2024-01-09 13:14:38 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-09 13:14:38 +0000 |
commit | 4670348ee4ddc83b089b2bc55dce194368ca2601 (patch) | |
tree | a09e4a8ee3723e228398df355c0a002099b4f4b1 /pkgs/tools | |
parent | 20d546963ba4dc4e4c26dae6ff67134d126d5bc6 (diff) | |
parent | f514cff940fb77410589f2e37c1f765f6dd78764 (diff) |
Merge pull request #278739 from TomaSajt/jpsxdec
jpsxdec: 1.06 -> 2.0, make deterministic, clean up
Diffstat (limited to 'pkgs/tools')
-rw-r--r-- | pkgs/tools/games/jpsxdec/0001-jpsxdec-hackfix-build-with-newer-JDKs.patch | 43 | ||||
-rw-r--r-- | pkgs/tools/games/jpsxdec/default.nix | 88 |
2 files changed, 40 insertions, 91 deletions
diff --git a/pkgs/tools/games/jpsxdec/0001-jpsxdec-hackfix-build-with-newer-JDKs.patch b/pkgs/tools/games/jpsxdec/0001-jpsxdec-hackfix-build-with-newer-JDKs.patch deleted file mode 100644 index 17899ef328f14..0000000000000 --- a/pkgs/tools/games/jpsxdec/0001-jpsxdec-hackfix-build-with-newer-JDKs.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 52662c71f7b043f374d4062d07a28b59ef010cbe Mon Sep 17 00:00:00 2001 -From: Zane van Iperen <zane@zanevaniperen.com> -Date: Wed, 22 Sep 2021 18:41:36 +1000 -Subject: [PATCH] jpsxdec: hackfix build with newer JDKs - ---- - jpsxdec/build.xml | 6 ++---- - 1 file changed, 2 insertions(+), 4 deletions(-) - -diff --git a/jpsxdec/build.xml b/jpsxdec/build.xml -index 713941c..f5aa902 100644 ---- a/jpsxdec/build.xml -+++ b/jpsxdec/build.xml -@@ -43,8 +43,8 @@ - <property name="build-lgpl.dir" location="${working.dir}/build-lgpl"/> - <property name="testbuild.dir" location="${working.dir}/build-test"/> - -- <property name="javac.target.ver" value="1.6"/> -- <property name="javac.source.ver" value="1.6" /> -+ <property name="javac.target.ver" value="1.8"/> -+ <property name="javac.source.ver" value="1.8" /> - - <!-- output --> - <property name="release.dir" location="${working.dir}/release"/> -@@ -76,7 +76,6 @@ - <compilerarg value="-Xlint:static"/> - <compilerarg value="-Xlint:unchecked"/> - <compilerarg value="-Xlint:varargs"/> -- <compilerarg value="-Werror"/> - </javac> - - <!-- Copy over resources --> -@@ -109,7 +108,6 @@ - <compilerarg value="-Xlint:static"/> - <compilerarg value="-Xlint:unchecked"/> - <compilerarg value="-Xlint:varargs"/> -- <compilerarg value="-Werror"/> - </javac> - - <!-- Copy over resources --> --- -2.31.1 - diff --git a/pkgs/tools/games/jpsxdec/default.nix b/pkgs/tools/games/jpsxdec/default.nix index d749353abc511..85fd9d65ada1d 100644 --- a/pkgs/tools/games/jpsxdec/default.nix +++ b/pkgs/tools/games/jpsxdec/default.nix @@ -1,84 +1,76 @@ -{ stdenv -, lib +{ lib +, stdenv , fetchFromGitHub -, jdk -/* - * jPSXdec needs to be built with no later than JDK8, but - * should be run with the latest to get HiDPI fixes, etc. - */ -, jre ? jdk , ant -, unoconv +, jdk8 # the build script wants JAVA 8 for compilation +, jre # version can be >= 8 (latest version by default) , makeWrapper , makeDesktopItem +, copyDesktopItems +, canonicalize-jars-hook }: -let - pname = "jpsxdec"; - version = "1.06"; - - description = "Cross-platform PlayStation 1 audio and video converter"; - desktopItem = makeDesktopItem { - name = pname; - exec = pname; - icon = pname; - comment = description; - desktopName = "jPSXdec"; - categories = [ "AudioVideo" "Utility" ]; - }; -in -stdenv.mkDerivation rec { - inherit pname version; +stdenv.mkDerivation (finalAttrs: { + pname = "jpsxdec"; + version = "2.0"; src = fetchFromGitHub { owner = "m35"; - repo = pname; - rev = "v${version}"; - sha256 = "sha256-6PLEvK4NP0/ipdygyDFFcWTIfch5y0Hren40+8iqYJs="; + repo = "jpsxdec"; + rev = "v${finalAttrs.version}"; + hash = "sha256-PZOc5mpnUiUyydWyfZjWuPG4w+tRd6WLJ6YQMqu/95I="; }; - nativeBuildInputs = [ ant jdk unoconv makeWrapper ]; - buildInputs = [ jre ]; + sourceRoot = "${finalAttrs.src.name}/jpsxdec"; - patches = [ - ./0001-jpsxdec-hackfix-build-with-newer-JDKs.patch + nativeBuildInputs = [ + ant + jdk8 + makeWrapper + copyDesktopItems + canonicalize-jars-hook ]; buildPhase = '' runHook preBuild - - cd jpsxdec - mkdir -p _ant/release/doc/ - unoconv -d document -f pdf -o _ant/release/doc/jPSXdec-manual.pdf doc/jPSXdec-manual.odt - ant release - runHook postBuild ''; installPhase = '' runHook preInstall - mkdir -p $out/{bin,share/pixmaps} - mv _ant/release $out/jpsxdec + mkdir -p $out/share/jpsxdec + mv _ant/release/{doc,*.jar} $out/share/jpsxdec + install -Dm644 src/jpsxdec/gui/icon48.png $out/share/pixmaps/jpsxdec.png makeWrapper ${jre}/bin/java $out/bin/jpsxdec \ - --add-flags "-jar $out/jpsxdec/jpsxdec.jar" - - cp ${src}/jpsxdec/src/jpsxdec/gui/icon48.png $out/share/pixmaps/${pname}.png - ln -s ${desktopItem}/share/applications $out/share + --add-flags "-jar $out/share/jpsxdec/jpsxdec.jar" runHook postInstall ''; + desktopItems = [ + (makeDesktopItem { + name = "jpsxdec"; + exec = "jpsxdec"; + icon = "jpsxdec"; + desktopName = "jPSXdec"; + comment = finalAttrs.meta.description; + categories = [ "AudioVideo" "Utility" ]; + }) + ]; + meta = with lib; { - inherit description; + changelog = "https://github.com/m35/jpsxdec/blob/${finalAttrs.src.rev}/jpsxdec/doc/CHANGES.txt"; + description = "Cross-platform PlayStation 1 audio and video converter"; homepage = "https://jpsxdec.blogspot.com/"; - platforms = platforms.all; license = { - url = "https://raw.githubusercontent.com/m35/jpsxdec/readme/.github/LICENSE.md"; + url = "https://raw.githubusercontent.com/m35/jpsxdec/${finalAttrs.src.rev}/.github/LICENSE.md"; free = true; }; + mainProgram = "jpsxdec"; maintainers = with maintainers; [ zane ]; + platforms = platforms.all; }; -} +}) |