at 22.05-pre 73 lines 3.0 kB view raw
1{ lib, stdenv, fetchFromGitHub, fetchpatch, fetchurl, xmlstarlet, makeWrapper, ant, jdk, rsync, javaPackages, libXxf86vm, gsettings-desktop-schemas }: 2 3stdenv.mkDerivation rec { 4 pname = "processing"; 5 version = "3.5.4"; 6 7 src = fetchFromGitHub { 8 owner = "processing"; 9 repo = "processing"; 10 rev = "processing-0270-${version}"; 11 sha256 = "0cvv8jda9y8qnfcsziasyv3w7h3w22q78ihr23cm4an63ghxci58"; 12 }; 13 14 patches = [ 15 (fetchpatch { 16 name = "oraclejdk-8u281-compat.patch"; 17 url = "https://github.com/processing/processing/commit/7e176876173c93e3a00a922e7ae37951366d1761.patch"; 18 sha256 = "g+zwpoIVgw7Sp6QWW3vyPZ/fKHk+o/YCY6xnrX8IGKo="; 19 }) 20 ]; 21 22 nativeBuildInputs = [ ant rsync makeWrapper ]; 23 buildInputs = [ jdk ]; 24 25 buildPhase = '' 26 # use compiled jogl to avoid patchelf'ing .so files inside jars 27 rm core/library/*.jar 28 cp ${javaPackages.jogl_2_3_2}/share/java/*.jar core/library/ 29 30 # do not download a file during build 31 ${xmlstarlet}/bin/xmlstarlet ed --inplace -P -d '//get[@src="http://download.processing.org/reference.zip"]' build/build.xml 32 install -D -m0444 ${fetchurl { 33 # Use archive.org link for reproducibility until the following issue is fixed: 34 # https://github.com/processing/processing/issues/5711 35 url = "https://web.archive.org/web/20200406132357/https://download.processing.org/reference.zip"; 36 sha256 = "093hc7kc9wfxqgf5dzfmfp68pbsy8x647cj0a25vgjm1swi61zbi"; 37 } 38 } ./java/reference.zip 39 40 # suppress "Not fond of this Java VM" message box 41 substituteInPlace app/src/processing/app/platform/LinuxPlatform.java \ 42 --replace 'Messages.showWarning' 'if (false) Messages.showWarning' 43 44 ( cd build 45 substituteInPlace build.xml --replace "jre-download," "" # do not download jre1.8.0_144 46 mkdir -p linux/jre1.8.0_144 # fake dir to avoid error 47 ant build ) 48 ''; 49 50 installPhase = '' 51 mkdir $out 52 cp -dpR build/linux/work $out/${pname} 53 54 rmdir $out/${pname}/java 55 ln -s ${jdk} $out/${pname}/java 56 57 makeWrapper $out/${pname}/processing $out/bin/processing \ 58 --prefix XDG_DATA_DIRS : ${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name} \ 59 --prefix _JAVA_OPTIONS " " -Dawt.useSystemAAFontSettings=lcd \ 60 --prefix LD_LIBRARY_PATH : ${libXxf86vm}/lib 61 makeWrapper $out/${pname}/processing-java $out/bin/processing-java \ 62 --prefix XDG_DATA_DIRS : ${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name} \ 63 --prefix _JAVA_OPTIONS " " -Dawt.useSystemAAFontSettings=lcd \ 64 --prefix LD_LIBRARY_PATH : ${libXxf86vm}/lib 65 ''; 66 67 meta = with lib; { 68 description = "A language and IDE for electronic arts"; 69 homepage = "https://processing.org"; 70 license = licenses.gpl2Plus; 71 platforms = platforms.linux; 72 }; 73}