2024-01-13 08:15:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchurl
|
|
|
|
, unzip
|
|
|
|
, ant
|
2024-01-13 08:15:51 +00:00
|
|
|
, jdk8
|
2020-04-24 23:36:52 +00:00
|
|
|
, makeWrapper
|
2024-01-13 08:15:51 +00:00
|
|
|
, canonicalize-jars-hook
|
2020-04-24 23:36:52 +00:00
|
|
|
, callPackage
|
|
|
|
}:
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
let
|
|
|
|
jdk = jdk8;
|
|
|
|
jre = jdk8.jre;
|
|
|
|
|
|
|
|
in stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "jasmin";
|
|
|
|
version = "2.4";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2024-01-13 08:15:51 +00:00
|
|
|
url = "mirror://sourceforge/jasmin/jasmin-${finalAttrs.version}.zip";
|
|
|
|
hash = "sha256-6qEMaM7Gggb9EC6exxE3OezNeQEIoblabow+k/IORJ0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
unzip
|
|
|
|
ant
|
|
|
|
jdk
|
|
|
|
makeWrapper
|
|
|
|
canonicalize-jars-hook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
ant all
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
install -Dm644 jasmin.jar $out/share/java/jasmin.jar
|
|
|
|
makeWrapper ${jre}/bin/java $out/bin/jasmin \
|
|
|
|
--add-flags "-jar $out/share/java/jasmin.jar"
|
2024-01-13 08:15:51 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests = {
|
|
|
|
minimal-module = callPackage ./test-assemble-hello-world {};
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "An assembler for the Java Virtual Machine";
|
|
|
|
downloadPage = "https://sourceforge.net/projects/jasmin/files/latest/download";
|
2024-01-13 08:15:51 +00:00
|
|
|
homepage = "https://jasmin.sourceforge.net/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd3;
|
2024-01-13 08:15:51 +00:00
|
|
|
mainProgram = "jasmin";
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ fgaz ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
2024-01-13 08:15:51 +00:00
|
|
|
})
|