2024-01-13 08:15:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2021-12-06 16:07:01 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, ant
|
2024-01-13 08:15:51 +00:00
|
|
|
, jdk8 # the build script wants JAVA 8 for compilation
|
|
|
|
, jre # version can be >= 8 (latest version by default)
|
2021-12-06 16:07:01 +00:00
|
|
|
, makeWrapper
|
|
|
|
, makeDesktopItem
|
2024-01-13 08:15:51 +00:00
|
|
|
, copyDesktopItems
|
2024-04-21 15:54:59 +00:00
|
|
|
, stripJavaArchivesHook
|
2021-12-06 16:07:01 +00:00
|
|
|
}:
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
|
|
pname = "jpsxdec";
|
|
|
|
version = "2.0";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "m35";
|
2024-01-13 08:15:51 +00:00
|
|
|
repo = "jpsxdec";
|
|
|
|
rev = "v${finalAttrs.version}";
|
|
|
|
hash = "sha256-PZOc5mpnUiUyydWyfZjWuPG4w+tRd6WLJ6YQMqu/95I=";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
sourceRoot = "${finalAttrs.src.name}/jpsxdec";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
ant
|
|
|
|
jdk8
|
|
|
|
makeWrapper
|
|
|
|
copyDesktopItems
|
2024-04-21 15:54:59 +00:00
|
|
|
stripJavaArchivesHook
|
2021-12-06 16:07:01 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
ant release
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
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
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
makeWrapper ${jre}/bin/java $out/bin/jpsxdec \
|
2024-01-13 08:15:51 +00:00
|
|
|
--add-flags "-jar $out/share/jpsxdec/jpsxdec.jar"
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = "jpsxdec";
|
|
|
|
exec = "jpsxdec";
|
|
|
|
icon = "jpsxdec";
|
|
|
|
desktopName = "jPSXdec";
|
|
|
|
comment = finalAttrs.meta.description;
|
|
|
|
categories = [ "AudioVideo" "Utility" ];
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
meta = with lib; {
|
2024-01-13 08:15:51 +00:00
|
|
|
changelog = "https://github.com/m35/jpsxdec/blob/${finalAttrs.src.rev}/jpsxdec/doc/CHANGES.txt";
|
|
|
|
description = "Cross-platform PlayStation 1 audio and video converter";
|
2021-12-06 16:07:01 +00:00
|
|
|
homepage = "https://jpsxdec.blogspot.com/";
|
|
|
|
license = {
|
2024-01-13 08:15:51 +00:00
|
|
|
url = "https://raw.githubusercontent.com/m35/jpsxdec/${finalAttrs.src.rev}/.github/LICENSE.md";
|
2021-12-06 16:07:01 +00:00
|
|
|
free = true;
|
|
|
|
};
|
2024-01-13 08:15:51 +00:00
|
|
|
mainProgram = "jpsxdec";
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ zane ];
|
2024-01-13 08:15:51 +00:00
|
|
|
platforms = platforms.all;
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
2024-01-13 08:15:51 +00:00
|
|
|
})
|