gnu: tuxguitar: Update to 1.4.

* gnu/packages/music.scm (tuxguitar): Update to 1.4.
[arguments]: Replace build phase "build-editor-utils" with "build-libraries";
install resources to the expected locations.
This commit is contained in:
Ricardo Wurmus 2017-04-02 17:23:16 +02:00
parent 8723fe23fa
commit 750e54ecbe
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -1268,7 +1268,7 @@ (define-public bristol
(define-public tuxguitar (define-public tuxguitar
(package (package
(name "tuxguitar") (name "tuxguitar")
(version "1.3.2") (version "1.4")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (string-append (uri (string-append
@ -1276,11 +1276,14 @@ (define-public tuxguitar
version "/tuxguitar-" version "-src.tar.gz")) version "/tuxguitar-" version "-src.tar.gz"))
(sha256 (sha256
(base32 (base32
"0ldml31zvywid1w28mfd65ramyiics55fdl0ch846vm7j7nwv58j")) "041275vwfr82kass7wiq9g2y82w9qrbzfinzcvfij2f2q45njwmc"))
(modules '((guix build utils))) (modules '((guix build utils)))
(snippet (snippet
'(begin
;; Delete pre-built classes ;; Delete pre-built classes
'(delete-file-recursively "TuxGuitar-android/bin")))) (delete-file-recursively "TuxGuitar-android-gdrive/bin")
(delete-file-recursively "TuxGuitar-android-gdrive-gdaa/bin")
#t))))
(build-system ant-build-system) (build-system ant-build-system)
(arguments (arguments
`(#:build-target "build" `(#:build-target "build"
@ -1289,23 +1292,31 @@ (define-public tuxguitar
(modify-phases %standard-phases (modify-phases %standard-phases
(add-after 'unpack 'enter-dir (add-after 'unpack 'enter-dir
(lambda _ (chdir "TuxGuitar-lib") #t)) (lambda _ (chdir "TuxGuitar-lib") #t))
(add-after 'build 'build-editor-utils (add-after 'build 'build-libraries
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((initial-classpath (getenv "CLASSPATH"))
(build-dir (lambda (dir)
(chdir "..") (chdir "..")
(let ((cwd (getcwd)))
(setenv "CLASSPATH" (setenv "CLASSPATH"
(string-append (string-join (cons initial-classpath
cwd "/TuxGuitar-lib/tuxguitar-lib.jar" ":" (find-files (getcwd) "\\.jar$"))
cwd "/TuxGuitar-editor-utils/build/jar/tuxguitar-editor-utils.jar" ":" ":"))
(getenv "CLASSPATH")))) (chdir dir)
(chdir "TuxGuitar-editor-utils") (if (file-exists? "build.xml")
((assoc-ref %standard-phases 'build)
#:build-target "build")
(begin
;; Generate default build.xml ;; Generate default build.xml
((@@ (guix build ant-build-system) default-build.xml) ((@@ (guix build ant-build-system) default-build.xml)
"tuxguitar-editor-utils.jar" (string-append (string-downcase dir) ".jar")
(string-append (assoc-ref outputs "out") (string-append (assoc-ref outputs "out")
"/share/java")) "/share/java"))
((assoc-ref %standard-phases 'build)))) ((assoc-ref %standard-phases 'build)))))))
(add-after 'build-editor-utils 'build-application (map build-dir '("TuxGuitar-editor-utils"
"TuxGuitar-ui-toolkit"
"TuxGuitar-ui-toolkit-swt"
"TuxGuitar-awt-graphics")))))
(add-after 'build-libraries 'build-application
(lambda _ (lambda _
(chdir "../TuxGuitar") (chdir "../TuxGuitar")
((assoc-ref %standard-phases 'build) ((assoc-ref %standard-phases 'build)
@ -1322,10 +1333,10 @@ (define-public tuxguitar
(for-each (lambda (file) (for-each (lambda (file)
(install-file file lib)) (install-file file lib))
(find-files ".." "\\.jar$")) (find-files ".." "\\.jar$"))
;; install all resources ;; install all resources
(for-each (lambda (file) (copy-recursively "share" share)
(install-file file share))
(find-files "share" ".*"))
;; create wrapper ;; create wrapper
(call-with-output-file (string-append bin "/tuxguitar") (call-with-output-file (string-append bin "/tuxguitar")
(lambda (port) (lambda (port)