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 git-download)
#:use-module ((guix licenses) #:prefix license:) #:use-module ((guix licenses) #:prefix license:)
#:use-module (guix build-system gnu) #:use-module (guix build-system gnu)
#:use-module (guix build-system ant)
#:use-module (guix build-system cmake) #:use-module (guix build-system cmake)
#:use-module (guix build-system python) #:use-module (guix build-system python)
#:use-module (guix build-system waf) #:use-module (guix build-system waf)
@ -904,45 +905,85 @@ is subjective.")
(define-public tuxguitar (define-public tuxguitar
(package (package
(name "tuxguitar") (name "tuxguitar")
(version "1.2") (version "1.3.2")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (string-append (uri (string-append
"mirror://sourceforge/tuxguitar/TuxGuitar/TuxGuitar-" "mirror://sourceforge/tuxguitar/TuxGuitar/TuxGuitar-"
version "/tuxguitar-src-" version ".tar.gz")) version "/tuxguitar-" version "-src.tar.gz"))
(sha256 (sha256
(base32 (base32
"1g1yf2gd06fzdhqb8kb8dmdcmr602s9y24f01kyl4940wimgr944")))) "0ldml31zvywid1w28mfd65ramyiics55fdl0ch846vm7j7nwv58j"))
(build-system gnu-build-system) (modules '((guix build utils)))
(snippet
;; Delete pre-built classes
'(delete-file-recursively "TuxGuitar-android/bin"))))
(build-system ant-build-system)
(arguments (arguments
`(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath=" `(#:build-target "build"
(assoc-ref %outputs "out") "/lib") #:tests? #f ; no tests
(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
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(delete 'configure) (add-after 'unpack 'enter-dir
(add-before 'build 'enter-dir-and-set-flags (lambda _ (chdir "TuxGuitar-lib") #t))
(lambda* (#:key inputs #:allow-other-keys) (add-after 'build 'build-editor-utils
(chdir "TuxGuitar") (lambda* (#:key inputs outputs #:allow-other-keys)
(substitute* "GNUmakefile" (chdir "..")
(("GCJFLAGS\\+=(.*)" _ rest) (let ((cwd (getcwd)))
(string-append "GCJFLAGS=-fsource=1.4 -fPIC " rest)) (setenv "CLASSPATH"
(("PROPERTIES\\?=") (string-append
(string-append "PROPERTIES?= -Dswt.library.path=" cwd "/TuxGuitar-lib/tuxguitar-lib.jar" ":"
(assoc-ref inputs "java-swt") "/lib")) cwd "/TuxGuitar-editor-utils/build/jar/tuxguitar-editor-utils.jar" ":"
(("\\$\\(GCJ\\) -o") "$(GCJ) $(LDFLAGS) -o")) (getenv "CLASSPATH"))))
#t))))) (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 (inputs
`(("java-swt" ,java-swt))) `(("java-swt" ,java-swt)))
(native-inputs
`(("gcj" ,gcj)
("pkg-config" ,pkg-config)))
(home-page "http://tuxguitar.com.ar") (home-page "http://tuxguitar.com.ar")
(synopsis "Multitrack tablature editor and player") (synopsis "Multitrack tablature editor and player")
(description (description