openrocket: init at 23.09

This commit is contained in:
TomaSajt 2024-01-25 21:43:42 +01:00
parent 771b079bb8
commit c26e72bbef
No known key found for this signature in database
GPG Key ID: F011163C050122A1

View File

@ -0,0 +1,71 @@
{ lib
, stdenvNoCC
, fetchFromGitHub
, ant
, jdk17
, makeWrapper
}:
let
jdk = jdk17; # Only java 17 is supported as of 23.09
in
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "openrocket";
version = "23.09";
src = fetchFromGitHub {
owner = "openrocket";
repo = "openrocket";
rev = "release-${finalAttrs.version}";
hash = "sha256-Dg/v72N9cDG9Ko5JIcZxGxh+ClRDgf5Jq5DvQyCiYOs=";
fetchSubmodules = true;
};
nativeBuildInputs = [
ant
jdk
makeWrapper
];
buildPhase = ''
runHook preBuild
ant
runHook postBuild
'';
doCheck = true;
checkPhase = ''
runHook preCheck
ant unittest
runHook postCheck
'';
installPhase = ''
runHook preInstall
sed -i "s|Icon=.*|Icon=openrocket|g" snap/gui/openrocket.desktop
install -Dm644 snap/gui/openrocket.desktop -t $out/share/applications
install -Dm644 snap/gui/openrocket.png -t $out/share/icons/hicolor/256x256/apps
install -Dm644 swing/build/jar/OpenRocket.jar -t $out/share/openrocket
makeWrapper ${jdk}/bin/java $out/bin/openrocket \
--add-flags "-jar $out/share/openrocket/OpenRocket.jar"
runHook postInstall
'';
meta = {
changelog = "https://github.com/openrocket/openrocket/releases/tag/${finalAttrs.src.rev}";
description = "Model-rocketry aerodynamics and trajectory simulation software";
homepage = "openrocket.info";
license = lib.licenses.gpl3Plus;
mainProgram = "openrocket";
maintainers = with lib.maintainers; [ tomasajt ];
platforms = jdk.meta.platforms;
sourceProvenance = with lib.sourceTypes; [
fromSource
binaryBytecode # source bundles dependencies as jars
];
};
})