Re: [PATCH] gnu: Add TuxGuitar.

2015-09-20 Thread Ricardo Wurmus

Ludovic Courtès  writes:

> Ricardo Wurmus  skribis:
>
>> The
>> SWT tarball does include jars but these are binaries of the library.
>> The package recipe ignores them and only works on the sources in src.zip
>
> OK.  What about adding a snippet that removes all these jars anyway,
> mostly “to be safe” and to not convey the impression that we’re bundling
> pre-built binaries?

I just tried to do this, but I get stuck as Guix seems to think that the
sources are located in the “about_files” directory:

~~
...
Archive:  
/gnu/store/lkk22318a7mrj5m7mx0s574raa4kj7h0-swt-4.4.2-gtk-linux-x86.zip
   creating: about_files/
  inflating: .classpath  
  inflating: .project
  inflating: about.html  
  inflating: about_files/IJG_README  
  inflating: about_files/lgpl-v21.txt  
  inflating: about_files/mpl-v11.txt  
  inflating: about_files/mpl-v20.txt  
  inflating: about_files/webkit-bsd.txt  
  inflating: src.zip 
  inflating: swt-debug.jar   
  inflating: swt.jar 
source is under 'about_files'
...
~~

In fact, the sources are in the “src.zip” archive.  Currently, I just
replace the “unpack” phase to take care of this, but I don’t know how to
fix this in a snippet.  I’d like to repackage just the contents of
“src.zip” as the source tarball, but ‘patch-and-repack’ doesn’t make it
easy.

~~ Ricardo




Re: [PATCH] gnu: Add TuxGuitar.

2015-04-23 Thread Ricardo Wurmus

>> The
>> SWT tarball does include jars but these are binaries of the library.
>> The package recipe ignores them and only works on the sources in src.zip
>
> OK.  What about adding a snippet that removes all these jars anyway,
> mostly “to be safe” and to not convey the impression that we’re bundling
> pre-built binaries?

Sounds good to me.  I'll prepare a patch shortly.

~~ Ricardo




Re: [PATCH] gnu: Add TuxGuitar.

2015-04-22 Thread Ludovic Courtès
Ricardo Wurmus  skribis:

> The
> SWT tarball does include jars but these are binaries of the library.
> The package recipe ignores them and only works on the sources in src.zip

OK.  What about adding a snippet that removes all these jars anyway,
mostly “to be safe” and to not convey the impression that we’re bundling
pre-built binaries?

Thanks,
Ludo’.



Re: [PATCH] gnu: Add TuxGuitar.

2015-04-21 Thread Ricardo Wurmus

Ludovic Courtès writes:

> Ricardo Wurmus  skribis:
>
>> From 717af487b3f0924b39c8a19e25453f20859b62bf Mon Sep 17 00:00:00 2001
>> From: Ricardo Wurmus 
>> Date: Sun, 19 Apr 2015 18:42:16 +0200
>> Subject: [PATCH 1/2] gnu: Add SWT.
>>
>> * gnu/packages/java.scm (swt): New variable.
>
> LGTM.  A common issue with Java packages is that they tend to bundle
> pre-built jars, possibly coming from elsewhere.  Please make sure this
> is not the case.

Yes, this is rather annoying and is true for many Java applications I
encountered (or maybe it's just common in bioinformatics circles?).  The
SWT tarball does include jars but these are binaries of the library.
The package recipe ignores them and only works on the sources in src.zip
(a zip inside a zip).  There are no binaries in the src.zip archive.

>> From 8893511249d828d443d1b215dbcd6669da216e63 Mon Sep 17 00:00:00 2001
>> From: Ricardo Wurmus 
>> Date: Sun, 19 Apr 2015 18:39:25 +0200
>> Subject: [PATCH 2/2] gnu: Add TuxGuitar.
>>
>> * gnu/packages/music.scm (tuxguitar): New variable.
>
> OK.
>
> Thanks!

Thanks for the review!

~~ Ricardo




Re: [PATCH] gnu: Add TuxGuitar.

2015-04-21 Thread Ludovic Courtès
Ricardo Wurmus  skribis:

> From 717af487b3f0924b39c8a19e25453f20859b62bf Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus 
> Date: Sun, 19 Apr 2015 18:42:16 +0200
> Subject: [PATCH 1/2] gnu: Add SWT.
>
> * gnu/packages/java.scm (swt): New variable.

LGTM.  A common issue with Java packages is that they tend to bundle
pre-built jars, possibly coming from elsewhere.  Please make sure this
is not the case.

> From 8893511249d828d443d1b215dbcd6669da216e63 Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus 
> Date: Sun, 19 Apr 2015 18:39:25 +0200
> Subject: [PATCH 2/2] gnu: Add TuxGuitar.
>
> * gnu/packages/music.scm (tuxguitar): New variable.

OK.

Thanks!

Ludo’.



[PATCH] gnu: Add TuxGuitar.

2015-04-19 Thread Ricardo Wurmus
>From 717af487b3f0924b39c8a19e25453f20859b62bf Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus 
Date: Sun, 19 Apr 2015 18:42:16 +0200
Subject: [PATCH 1/2] gnu: Add SWT.

* gnu/packages/java.scm (swt): New variable.
---
 gnu/packages/java.scm | 83 +++
 1 file changed, 83 insertions(+)

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 2a8cd99..a77d171 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -32,6 +32,7 @@
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gawk)
   #:use-module (gnu packages gcc)
+  #:use-module (gnu packages gl)
   #:use-module (gnu packages gnuzilla) ;nss
   #:use-module (gnu packages ghostscript) ;lcms
   #:use-module (gnu packages gnome)
@@ -47,6 +48,88 @@
   #:use-module (gnu packages zip)
   #:use-module (gnu packages texinfo))
 
+(define-public swt
+  (package
+(name "swt")
+(version "4.4.2")
+(source (origin
+  (method url-fetch)
+  (uri (string-append
+"http://ftp-stud.fht-esslingen.de/pub/Mirrors/";
+"eclipse/eclipse/downloads/drops4/R-" version
+"-201502041700/swt-" version "-gtk-linux-x86.zip"))
+  (sha256
+   (base32
+"0lzyqr8k2zm5s8fmnrx5kxpslxfs0i73y26fwfms483x45izzwj8"
+(build-system gnu-build-system)
+(arguments
+ `(#:make-flags '("-f" "make_linux.mak")
+   #:tests? #f ; no "check" target
+   #:phases
+   (alist-replace
+'unpack
+(lambda _
+  (and (mkdir "swt")
+   (zero? (system* "unzip" (assoc-ref %build-inputs "source") "-d" "swt"))
+   (chdir "swt")
+   (mkdir "src")
+   (zero? (system* "unzip" "src.zip" "-d" "src"))
+   (chdir "src")))
+(alist-replace
+ 'build
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+   (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
+ (setenv "JAVA_HOME" (assoc-ref inputs "icedtea6"))
+
+ ;; Build shared libraries.  Users of SWT have to set the system
+ ;; property swt.library.path to the "lib" directory of this
+ ;; package output.
+ (mkdir-p lib)
+ (setenv "OUTPUT_DIR" lib)
+ (zero? (system* "bash" "build.sh"))
+
+ ;; build jar
+ (mkdir "build")
+ (for-each (lambda (file)
+ (format #t "Compiling ~s\n" file)
+ (system* "javac" "-d" "build" file))
+   (find-files "." "\\.java"))
+ (zero? (system* "jar" "cvf" "swt.jar" "-C" "build" "."
+ (alist-cons-after
+  'install 'install-java-files
+  (lambda* (#:key outputs #:allow-other-keys)
+(let ((java (string-append (assoc-ref outputs "out")
+   "/share/java")))
+  (mkdir-p java)
+  (copy-file "swt.jar" (string-append java "/swt.jar"))) #t)
+  (alist-delete 'configure %standard-phases))
+(inputs
+ `(("xulrunner" ,icecat)
+   ("gtk" ,gtk+-2)
+   ("libxtst" ,libxtst)
+   ("libxt" ,libxt)
+   ("mesa" ,mesa)
+   ("glu" ,glu)))
+(native-inputs
+ `(("pkg-config" ,pkg-config)
+   ("unzip" ,unzip)
+   ("icedtea6" ,icedtea6 "jdk")))
+(home-page "https://www.eclipse.org/swt/";)
+(synopsis "Widget toolkit for Java")
+(description
+ "SWT is a widget toolkit for Java designed to provide efficient, portable
+access to the user-interface facilities of the operating systems on which it
+is implemented.")
+;; SWT code is licensed under EPL1.0
+;; Gnome and Gtk+ bindings contain code licensed under LGPLv2.1
+;; Cairo bindings contain code under MPL1.1
+;; XULRunner 1.9 bindings contain code under MPL2.0
+(license (list
+  license:epl1.0
+  license:mpl1.1
+  license:mpl2.0
+  license:lgpl2.1+
+
 (define-public ant
   (package
 (name "ant")
-- 
2.1.0

>From 8893511249d828d443d1b215dbcd6669da216e63 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus 
Date: Sun, 19 Apr 2015 18:39:25 +0200
Subject: [PATCH 2/2] gnu: Add TuxGuitar.

* gnu/packages/music.scm (tuxguitar): New variable.
---
 gnu/packages/music.scm | 53 ++
 1 file changed, 53 insertions(+)

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 0c83b0b..5795ecb 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -29,6 +29,7 @@
   #:use-module (gnu packages flex)
   #:use-module (gnu packages fonts)
   #:use-module (gnu packages fontutils)
+  #:use-module (gnu packages gcc)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages gnome)
@@ -36,6 +37,7 @@
   #:use-module (gnu packages guile)
   #:use-modu