Merge pull request #283850 from TomaSajt/openrocket

openrocket: init at 23.09
This commit is contained in:
Weijia Wang 2024-02-05 00:33:25 +01:00 committed by GitHub
commit e020450639
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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
];
};
})