diff options
author | Masum Reza | 2024-07-28 12:15:11 +0530 |
---|---|---|
committer | GitHub | 2024-07-28 12:15:11 +0530 |
commit | 8c4fe10ef07f2e723d7d29c8cd1604f96e97c16c (patch) | |
tree | 041020f8dd6cc224de906de9f7469e5f297536d9 /pkgs/by-name/va | |
parent | 6c1b9132659c57453ea0076e5353c6ebd77358a7 (diff) | |
parent | 532a0e5a1b6502c08727c1f29cb2e523772e867e (diff) |
Merge pull request #329794 from ThePuzzlemaker/add-vatprism
vatprism: init at 0.3.5
Diffstat (limited to 'pkgs/by-name/va')
-rw-r--r-- | pkgs/by-name/va/vatprism/0001-Fix-build-on-JDK-21.patch | 25 | ||||
-rw-r--r-- | pkgs/by-name/va/vatprism/package.nix | 102 |
2 files changed, 127 insertions, 0 deletions
diff --git a/pkgs/by-name/va/vatprism/0001-Fix-build-on-JDK-21.patch b/pkgs/by-name/va/vatprism/0001-Fix-build-on-JDK-21.patch new file mode 100644 index 000000000000..6e6302662cfe --- /dev/null +++ b/pkgs/by-name/va/vatprism/0001-Fix-build-on-JDK-21.patch @@ -0,0 +1,25 @@ +From 78e78dc10e2a4fd84ef0041d346d8f6d162f22c6 Mon Sep 17 00:00:00 2001 +From: ThePuzzlemaker <tpzker@thepuzzlemaker.info> +Date: Wed, 24 Jul 2024 21:18:04 -0500 +Subject: [PATCH] Fix build on JDK 21+ + +--- + pom.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pom.xml b/pom.xml +index 5a3254b..42b1405 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -59,7 +59,7 @@ + <maven.compiler.target>${java.version}</maven.compiler.target> + + <java.version>15</java.version> +- <lombok.version>1.18.22</lombok.version> ++ <lombok.version>1.18.30</lombok.version> + <javafx.version>17.0.1</javafx.version> + <slf4j.version>1.7.32</slf4j.version> + <mvvmfx.version>1.9.0-SNAPSHOT</mvvmfx.version> +-- +2.44.1 + diff --git a/pkgs/by-name/va/vatprism/package.nix b/pkgs/by-name/va/vatprism/package.nix new file mode 100644 index 000000000000..5995e26fefd2 --- /dev/null +++ b/pkgs/by-name/va/vatprism/package.nix @@ -0,0 +1,102 @@ +{ + lib, + stdenv, + jdk, + maven, + makeWrapper, + fetchFromGitHub, + libGL, + libxkbcommon, + wayland, + fontconfig, + libX11, + libXcursor, + libXi, + libXrandr, + libXxf86vm, + libXtst, + copyDesktopItems, + makeDesktopItem, +}: +let + libPath = lib.makeLibraryPath [ + libGL + libxkbcommon + wayland + libX11 + libXcursor + libXi + libXrandr + libXxf86vm + libXtst + fontconfig + ]; +in +maven.buildMavenPackage rec { + pname = "vatprism"; + version = "0.3.5"; + src = fetchFromGitHub { + owner = "marvk"; + repo = "vatprism"; + rev = "refs/tags/v${version}"; + hash = "sha256-ofEwHUCm79roHe2bawmKFw2QHhIonnlkFG5nhE6uN+g="; + }; + + nativeBuildInputs = [ + makeWrapper + copyDesktopItems + ]; + # https://github.com/marvk/vatprism/pull/141 + patches = [ ./0001-Fix-build-on-JDK-21.patch ]; + + desktopItems = [ + (makeDesktopItem { + name = "vatprism"; + desktopName = "VATprism"; + exec = "vatprism"; + terminal = false; + icon = "vatprism"; + }) + ]; + + mvnHash = + if (stdenv.isLinux && stdenv.isAarch64) then + "sha256-x0nFt2C7dZqMdllI1+Io9SPBY2J/dVgBTVb9T24vFFI=" + else + "sha256-9uyNCUqnMgpiwm2kz544pWNB/SkRpASm2Dln0e4yZos="; + + installPhase = '' + runHook preInstall + # create the bin directory + mkdir -p $out/bin $out/share/icons/hicolor/256x256/apps + + # copy out the JAR + # Maven already setup the classpath to use m2 repository layout + # with the prefix of lib/ + cp target-fat-jar/vatsim-map-${version}-fat.jar $out/ + cp src/main/resources/net/marvk/fs/vatsim/map/icon-256.png $out/share/icons/hicolor/256x256/apps/vatprism.png + + # create a wrapper that will automatically set the classpath + # this should be the paths from the dependency derivation + makeWrapper ${jdk}/bin/java $out/bin/${pname} \ + --add-flags "-jar $out/vatsim-map-${version}-fat.jar" \ + --set JAVA_HOME ${jdk.home} \ + --suffix LD_LIBRARY_PATH : ${libPath} + runHook postInstall + ''; + + meta = { + description = "VATSIM map and data explorer"; + longDescription = '' + VATprism is a VATSIM Map and VATSIM Data Explorer, VATSIM being the + Virtual Air Traffic Simulation Network. VATprism allows users to explore + available ATC services, connected pilots, Airports, Flight and Upper + Information Regions and more! + ''; + homepage = "https://vatprism.org/"; + mainProgram = "vatprism"; + license = lib.licenses.agpl3Plus; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ thepuzzlemaker ]; + }; +} |