unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add TuxGuitar.
@ 2015-04-20  4:34 Ricardo Wurmus
  2015-04-21 16:02 ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Ricardo Wurmus @ 2015-04-20  4:34 UTC (permalink / raw)
  To: Guix-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-gnu-Add-SWT.patch --]
[-- Type: text/x-patch, Size: 4168 bytes --]

From 717af487b3f0924b39c8a19e25453f20859b62bf Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <rekado@elephly.net>
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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-gnu-Add-TuxGuitar.patch --]
[-- Type: text/x-patch, Size: 3533 bytes --]

From 8893511249d828d443d1b215dbcd6669da216e63 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <rekado@elephly.net>
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-module (gnu packages image)
   #:use-module (gnu packages imagemagick)
+  #:use-module (gnu packages java)
   #:use-module (gnu packages linux) ; for alsa-utils
   #:use-module (gnu packages man)
   #:use-module (gnu packages mp3)
@@ -221,3 +223,54 @@ features a statistics overview so you can monitor your progress across several
 sessions.  Solfege is also designed to be extensible so you can easily write
 your own lessons.")
     (license license:gpl3+)))
+
+(define-public tuxguitar
+  (package
+    (name "tuxguitar")
+    (version "1.2")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "mirror://sourceforge/tuxguitar/TuxGuitar/TuxGuitar-"
+                    version "/tuxguitar-src-" version ".tar.gz"))
+              (sha256
+               (base32
+                "1g1yf2gd06fzdhqb8kb8dmdcmr602s9y24f01kyl4940wimgr944"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
+                                         (assoc-ref %outputs "out") "/lib")
+                          (string-append "PREFIX="
+                                         (assoc-ref %outputs "out"))
+                          (string-append "SWT_PATH="
+                                         (assoc-ref %build-inputs "swt")
+                                         "/share/java/swt.jar"))
+       #:tests? #f ;no "check" target
+       #:parallel-build? #f ;not supported
+       #:phases
+       (alist-cons-before
+        'build 'enter-dir-set-path-and-pass-ldflags
+        (lambda* (#:key inputs #:allow-other-keys)
+          (chdir "TuxGuitar")
+          (substitute* "GNUmakefile"
+            (("PROPERTIES\\?=")
+             (string-append "PROPERTIES?= -Dswt.library.path="
+                            (assoc-ref inputs "swt") "/lib"))
+            (("\\$\\(GCJ\\) -o") "$(GCJ) $(LDFLAGS) -o"))
+          #t)
+        (alist-delete 'configure %standard-phases))))
+    (inputs
+     `(("swt" ,swt)))
+    (native-inputs
+     `(("gcj" ,gcj-4.8)
+       ("pkg-config" ,pkg-config)))
+    (home-page "http://tuxguitar.com.ar")
+    (synopsis "Multitrack tablature editor and player")
+    (description
+     "TuxGuitar is a guitar tablature editor with player support through midi.
+It can display scores and multitrack tabs.  TuxGuitar provides various
+additional features, including autoscrolling while playing, note duration
+management, bend/slide/vibrato/hammer-on/pull-off effects, support for
+tuplets, time signature management, tempo management, gp3/gp4/gp5 import and
+export.")
+    (license license:lgpl2.1+)))
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] gnu: Add TuxGuitar.
  2015-04-20  4:34 [PATCH] gnu: Add TuxGuitar Ricardo Wurmus
@ 2015-04-21 16:02 ` Ludovic Courtès
  2015-04-21 19:49   ` Ricardo Wurmus
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2015-04-21 16:02 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: Guix-devel

Ricardo Wurmus <rekado@elephly.net> skribis:

> From 717af487b3f0924b39c8a19e25453f20859b62bf Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus <rekado@elephly.net>
> 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 <rekado@elephly.net>
> 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’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] gnu: Add TuxGuitar.
  2015-04-21 16:02 ` Ludovic Courtès
@ 2015-04-21 19:49   ` Ricardo Wurmus
  2015-04-22 20:49     ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Ricardo Wurmus @ 2015-04-21 19:49 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel


Ludovic Courtès writes:

> Ricardo Wurmus <rekado@elephly.net> skribis:
>
>> From 717af487b3f0924b39c8a19e25453f20859b62bf Mon Sep 17 00:00:00 2001
>> From: Ricardo Wurmus <rekado@elephly.net>
>> 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 <rekado@elephly.net>
>> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] gnu: Add TuxGuitar.
  2015-04-21 19:49   ` Ricardo Wurmus
@ 2015-04-22 20:49     ` Ludovic Courtès
  2015-04-23  7:06       ` Ricardo Wurmus
  2015-09-20 15:39       ` Ricardo Wurmus
  0 siblings, 2 replies; 6+ messages in thread
From: Ludovic Courtès @ 2015-04-22 20:49 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: Guix-devel

Ricardo Wurmus <rekado@elephly.net> 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’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] gnu: Add TuxGuitar.
  2015-04-22 20:49     ` Ludovic Courtès
@ 2015-04-23  7:06       ` Ricardo Wurmus
  2015-09-20 15:39       ` Ricardo Wurmus
  1 sibling, 0 replies; 6+ messages in thread
From: Ricardo Wurmus @ 2015-04-23  7:06 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel


>> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] gnu: Add TuxGuitar.
  2015-04-22 20:49     ` Ludovic Courtès
  2015-04-23  7:06       ` Ricardo Wurmus
@ 2015-09-20 15:39       ` Ricardo Wurmus
  1 sibling, 0 replies; 6+ messages in thread
From: Ricardo Wurmus @ 2015-09-20 15:39 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel


Ludovic Courtès <ludo@gnu.org> writes:

> Ricardo Wurmus <rekado@elephly.net> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-09-20 15:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-20  4:34 [PATCH] gnu: Add TuxGuitar Ricardo Wurmus
2015-04-21 16:02 ` Ludovic Courtès
2015-04-21 19:49   ` Ricardo Wurmus
2015-04-22 20:49     ` Ludovic Courtès
2015-04-23  7:06       ` Ricardo Wurmus
2015-09-20 15:39       ` Ricardo Wurmus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).