[Nix-dev] processing: new package

John Kennerson nobody at isis.cpunk.us
Sat Aug 30 04:47:49 CEST 2014


processing: new package
---

diff --git a/pkgs/applications/editors/processing/default.nix b/pkgs/applications/editors/processing/default.nix
new file mode 100644
index 0000000..021f863
--- /dev/null
+++ b/pkgs/applications/editors/processing/default.nix
@@ -0,0 +1,55 @@
+{ stdenv, fetchurl, lib, makeWrapper
+, ant, rsync, jdk, jre
+, which
+}:
+
+stdenv.mkDerivation rec {
+  name = let
+    a_tag = "0227";
+    the_version = "2.2.1";
+  in "processing-${a_tag}-${the_version}";
+
+  src = fetchurl {
+    url = "https://github.com/processing/processing/archive/${name}.tar.gz";
+    sha256 = "b38352f5a7bd22db3287274356fa87c614132960574f2ecb55f83e02812f18e5";
+  };
+
+  patches = [ ./use-local-jre.patch ];
+
+  buildInputs = [
+    ant
+    makeWrapper
+    rsync
+    jdk jre
+  ];
+
+  buildPhase = ''
+    cd build
+    ant build
+  '';
+
+  installPhase = let
+    pkg_path = "$out/${name}";
+    bin_path = "$out/bin";
+    runtime_paths = lib.makeSearchPath "bin" [
+      jre
+      which
+    ];
+  in ''
+    mkdir -pv ${pkg_path}
+    cp -a linux/work/* ${pkg_path}/
+    # XXX: not such a good idea?
+    ln -s ${jdk} ${pkg_path}/java
+    mkdir -pv ${bin_path}
+    makeWrapper ${pkg_path}/processing ${bin_path}/processing \
+      --prefix PATH : ${runtime_paths}
+    makeWrapper ${pkg_path}/processing-java ${bin_path}/processing-java \
+      --prefix PATH : ${runtime_paths}
+  '';
+
+  meta = {
+    description = "Development environment for Processing programming language.";
+    homepage = http://processing.org;
+    license = "LGPL/GPLv2";
+  };
+}
diff --git a/pkgs/applications/editors/processing/use-local-jre.patch b/pkgs/applications/editors/processing/use-local-jre.patch
new file mode 100644
index 0000000..33864a0
--- /dev/null
+++ b/pkgs/applications/editors/processing/use-local-jre.patch
@@ -0,0 +1,67 @@
+diff -Naur a/build/build.xml b/build/build.xml
+--- a/build/build.xml	2014-05-20 10:04:07.000000000 +0900
++++ b/build/build.xml	2014-08-30 11:23:09.632834129 +0900
+@@ -640,10 +640,11 @@
+ 	      value="jre-tools-6u37-linux${sun.arch.data.model}.tgz" />
+     -->
+ 
++    <!--
+     <get src="http://processing.googlecode.com/files/${jre.file}" 
+ 	 dest="linux/jre.tgz" 
+ 	 usetimestamp="true" />
+-
++    -->
+ <!--	   
+     Cannot use ant version of tar because it doesn't preserve properties.
+     <untar compression="gzip" 
+@@ -655,39 +656,48 @@
+ <!--
+     http://www.gnu.org/software/tar/manual/html_section/transform.html
+ -->
++    <!--
+     <exec executable="tar" dir="linux">
++    -->
+       <!-- Change directory -->
+       <!--
+       <arg value="-C" /> 
+       <arg value="linux/work" />
+       <arg value="-xzpf" />
+       -->
++    <!--
+       <arg value="xfz" />
+       <arg value="jre.tgz"/>
+     </exec>
++    -->
+ 
+     <!--
+     We only want to move when the folder didn't exist before
+     <move file="linux/jre1.7.0_40" tofile="linux/work/java" />
+     -->
++    <!--
+     <exec executable="rsync" dir="linux">
+       <arg value="-a" />
+-      <arg value="--delete" />
++      <arg value="- -delete" />
+       <arg value="jre1.7.0_40/" />
+       <arg value="work/java" />
+     </exec>
+     <delete dir="linux/jre1.7.0_40" />
++    -->
+ 
+     <!-- Remove unused JRE bloat. -->
++    <!--
+     <delete> 
+       <fileset refid="javafx-basics" />
+       <fileset refid="javafx-linux-${sun.arch.data.model}" />
+       <fileset refid="jre-optional-linux" />
+     </delete>
+-
++    -->
++    <!--
+     <copy todir="linux/work/java/lib/fonts">
+       <fileset dir="shared/lib/fonts" includes="*" />
+     </copy>
++    -->
+ 
+   </target>
+   
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 6f02f26..aaa50ce 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -1929,6 +1929,8 @@ let
 
   pastebinit = callPackage ../tools/misc/pastebinit { };
 
+  processing = callPackage ../applications/editors/processing { };
+
   psmisc = callPackage ../os-specific/linux/psmisc { };
 
   pstoedit = callPackage ../tools/graphics/pstoedit { };



More information about the nix-dev mailing list