biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / applications / graphics / processing / default.nix
bloba7a38e6f75ab68df4b3c312e385c897d6d99e1b2
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   fetchurl,
6   ant,
7   unzip,
8   makeWrapper,
9   jdk,
10   jogl,
11   rsync,
12   ffmpeg,
13   batik,
14   stripJavaArchivesHook,
15   wrapGAppsHook3,
16   libGL,
18 let
19   buildNumber = "1293";
20   vaqua = fetchurl {
21     name = "VAqua9.jar";
22     url = "https://violetlib.org/release/vaqua/9/VAqua9.jar";
23     sha256 = "cd0b82df8e7434c902ec873364bf3e9a3e6bef8b59cbf42433130d71bf1a779c";
24   };
26   jna = fetchurl {
27     name = "jna-5.10.0.zip";
28     url = "https://github.com/java-native-access/jna/archive/5.10.0.zip";
29     sha256 = "B5CakOQ8225xNsk2TMV8CbK3RcsLlb+pHzjaY5JNwg0=";
30   };
32   flatlaf = fetchurl {
33     name = "flatlaf-2.4.jar";
34     url = "mirror://maven/com/formdev/flatlaf/2.4/flatlaf-2.4.jar";
35     sha256 = "NVMYiCd+koNCJ6X3EiRx1Aj+T5uAMSJ9juMmB5Os+zc=";
36   };
38   lsp4j = fetchurl {
39     name = "org.eclipse.lsp4j-0.19.0.jar";
40     url = "mirror://maven/org/eclipse/lsp4j/org.eclipse.lsp4j/0.19.0/org.eclipse.lsp4j-0.19.0.jar";
41     sha256 = "sha256-1DI5D9KW+GL4gT1qjwVZveOl5KVOEjt6uXDwsFzi8Sg=";
42   };
44   lsp4j-jsonrpc = fetchurl {
45     name = "org.eclipse.lsp4j.jsonrpc-0.19.0.jar";
46     url = "mirror://maven/org/eclipse/lsp4j/org.eclipse.lsp4j.jsonrpc/0.19.0/org.eclipse.lsp4j.jsonrpc-0.19.0.jar";
47     sha256 = "sha256-ozYTkvv7k0psCeX/PbSM3/Bl17qT3upX3trt65lmM9I=";
48   };
50   gson = fetchurl {
51     name = "gson-2.9.1.jar";
52     url = "mirror://maven/com/google/code/gson/gson/2.9.1/gson-2.9.1.jar";
53     sha256 = "sha256-N4U04znm5tULFzb7Ort28cFdG+P0wTzsbVNkEuI9pgM=";
54   };
56   arch =
57     {
58       x86_64 = "amd64";
59     }
60     .${stdenv.hostPlatform.parsed.cpu.name} or stdenv.hostPlatform.parsed.cpu.name;
62 stdenv.mkDerivation rec {
63   pname = "processing";
64   version = "4.3";
66   src = fetchFromGitHub {
67     owner = "processing";
68     repo = "processing4";
69     rev = "processing-${buildNumber}-${version}";
70     sha256 = "sha256-SzQemZ6iZ9o89/doV8YMv7DmyPSDyckJl3oyxJyfrm0=";
71   };
73   nativeBuildInputs = [
74     ant
75     unzip
76     makeWrapper
77     stripJavaArchivesHook
78     wrapGAppsHook3
79   ];
80   buildInputs = [
81     jdk
82     jogl
83     ant
84     rsync
85     ffmpeg
86     batik
87   ];
89   dontWrapGApps = true;
91   buildPhase = ''
92     runHook preBuild
94     echo "tarring jdk"
95     tar --checkpoint=10000 -czf build/linux/jdk-17.0.8-${arch}.tgz ${jdk}
96     cp ${ant}/lib/ant/lib/{ant.jar,ant-launcher.jar} app/lib/
97     mkdir -p core/library
98     ln -s ${jogl}/share/java/* core/library/
99     ln -s ${vaqua} app/lib/VAqua9.jar
100     ln -s ${flatlaf} app/lib/flatlaf.jar
101     ln -s ${lsp4j} java/mode/org.eclipse.lsp4j.jar
102     ln -s ${lsp4j-jsonrpc} java/mode/org.eclipse.lsp4j.jsonrpc.jar
103     ln -s ${gson} java/mode/gson.jar
104     unzip -qo ${jna} -d app/lib/
105     mv app/lib/{jna-5.10.0/dist/jna.jar,}
106     mv app/lib/{jna-5.10.0/dist/jna-platform.jar,}
107     ln -sf ${batik}/* java/libraries/svg/library/
108     cp java/libraries/svg/library/share/java/batik-all-${batik.version}.jar java/libraries/svg/library/batik.jar
109     echo "tarring ffmpeg"
110     tar --checkpoint=10000 -czf build/shared/tools/MovieMaker/ffmpeg-5.0.1.gz ${ffmpeg}
111     cd build
112     ant build
113     cd ..
115     runHook postBuild
116   '';
118   installPhase = ''
119     runHook preInstall
121     mkdir -p $out/share/
122     mkdir -p $out/share/applications/
123     cp -dp build/linux/${pname}.desktop $out/share/applications/
124     cp -dpr build/linux/work $out/share/${pname}
125     rmdir $out/share/${pname}/java
126     ln -s ${jdk} $out/share/${pname}/java
127     makeWrapper $out/share/${pname}/processing $out/bin/processing \
128       ''${gappsWrapperArgs[@]} \
129       --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libGL ]}" \
130       --prefix _JAVA_OPTIONS " " -Dawt.useSystemAAFontSettings=lcd
131     makeWrapper $out/share/${pname}/processing-java $out/bin/processing-java \
132       ''${gappsWrapperArgs[@]} \
133       --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libGL ]}" \
134       --prefix _JAVA_OPTIONS " " -Dawt.useSystemAAFontSettings=lcd
136     runHook postInstall
137   '';
139   meta = with lib; {
140     description = "Language and IDE for electronic arts";
141     homepage = "https://processing.org";
142     license = with licenses; [
143       gpl2Only
144       lgpl21Only
145     ];
146     platforms = platforms.linux;
147     maintainers = with maintainers; [ evan-goode ];
148   };