gnu: tuxguitar: Update to 1.3.2.

* gnu/packages/music.scm (tuxguitar): Update to 1.3.2.
[arguments]: Use ant-build-system and rearrange build phases.
[native-inputs]: Remove field.
This commit is contained in:
Ricardo Wurmus 2016-05-16 10:16:28 +02:00
parent d77a0bd6f1
commit f467c35261
No known key found for this signature in database
GPG Key ID: 197A5888235FACAC
1 changed files with 69 additions and 28 deletions

View File

@ -31,6 +31,7 @@
#:use-module (guix git-download)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix build-system gnu)
#:use-module (guix build-system ant)
#:use-module (guix build-system cmake)
#:use-module (guix build-system python)
#:use-module (guix build-system waf)
@ -904,45 +905,85 @@ is subjective.")
(define-public tuxguitar
(package
(name "tuxguitar")
(version "1.2")
(version "1.3.2")
(source (origin
(method url-fetch)
(uri (string-append
"mirror://sourceforge/tuxguitar/TuxGuitar/TuxGuitar-"
version "/tuxguitar-src-" version ".tar.gz"))
version "/tuxguitar-" version "-src.tar.gz"))
(sha256
(base32
"1g1yf2gd06fzdhqb8kb8dmdcmr602s9y24f01kyl4940wimgr944"))))
(build-system gnu-build-system)
"0ldml31zvywid1w28mfd65ramyiics55fdl0ch846vm7j7nwv58j"))
(modules '((guix build utils)))
(snippet
;; Delete pre-built classes
'(delete-file-recursively "TuxGuitar-android/bin"))))
(build-system ant-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 "java-swt")
"/share/java/swt.jar"))
#:tests? #f ;no "check" target
#:parallel-build? #f ;not supported
`(#:build-target "build"
#:tests? #f ; no tests
#:phases
(modify-phases %standard-phases
(delete 'configure)
(add-before 'build 'enter-dir-and-set-flags
(lambda* (#:key inputs #:allow-other-keys)
(chdir "TuxGuitar")
(substitute* "GNUmakefile"
(("GCJFLAGS\\+=(.*)" _ rest)
(string-append "GCJFLAGS=-fsource=1.4 -fPIC " rest))
(("PROPERTIES\\?=")
(string-append "PROPERTIES?= -Dswt.library.path="
(assoc-ref inputs "java-swt") "/lib"))
(("\\$\\(GCJ\\) -o") "$(GCJ) $(LDFLAGS) -o"))
#t)))))
(add-after 'unpack 'enter-dir
(lambda _ (chdir "TuxGuitar-lib") #t))
(add-after 'build 'build-editor-utils
(lambda* (#:key inputs outputs #:allow-other-keys)
(chdir "..")
(let ((cwd (getcwd)))
(setenv "CLASSPATH"
(string-append
cwd "/TuxGuitar-lib/tuxguitar-lib.jar" ":"
cwd "/TuxGuitar-editor-utils/build/jar/tuxguitar-editor-utils.jar" ":"
(getenv "CLASSPATH"))))
(chdir "TuxGuitar-editor-utils")
;; Generate default build.xml
((@@ (guix build ant-build-system) default-build.xml)
"tuxguitar-editor-utils.jar"
(string-append (assoc-ref outputs "out")
"/share/java"))
((assoc-ref %standard-phases 'build))))
(add-after 'build-editor-utils 'build-application
(lambda _
(chdir "../TuxGuitar")
((assoc-ref %standard-phases 'build)
#:build-target "build")))
(replace 'install
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(bin (string-append out "/bin"))
(share (string-append out "/share"))
(lib (string-append share "/java"))
(swt (assoc-ref inputs "java-swt")))
(mkdir-p bin)
(mkdir-p lib)
;; install all jars
(for-each (lambda (file)
(install-file file lib))
(find-files ".." "\\.jar$"))
;; install all resources
(for-each (lambda (file)
(install-file file share))
(find-files "share" ".*"))
;; create wrapper
(call-with-output-file (string-append bin "/tuxguitar")
(lambda (port)
(let ((classpath (string-join (append (find-files lib "\\.jar$")
(find-files swt "\\.jar$"))
":")))
(format
port
(string-append "#!/bin/sh\n"
(which "java")
" -cp " classpath
" -Dtuxguitar.home.path=" out
" -Dtuxguitar.share.path=" out "/share"
" -Dswt.library.path=" swt "/lib"
" org.herac.tuxguitar.app.TGMainSingleton"
" \"$1\" \"$2\"")))))
(chmod (string-append bin "/tuxguitar") #o555)
#t))))))
(inputs
`(("java-swt" ,java-swt)))
(native-inputs
`(("gcj" ,gcj)
("pkg-config" ,pkg-config)))
(home-page "http://tuxguitar.com.ar")
(synopsis "Multitrack tablature editor and player")
(description