GNU bug report logs - #39155
[PATCH] gnu: tuxguitar: Build and install alsa plugin.

Previous Next

Package: guix-patches;

Reported by: Mike Rosset <mike.rosset <at> gmail.com>

Date: Thu, 16 Jan 2020 19:49:02 UTC

Severity: normal

Tags: patch

Done: Kei Kebreau <kkebreau <at> posteo.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 39155 in the body.
You can then email your comments to 39155 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#39155; Package guix-patches. (Thu, 16 Jan 2020 19:49:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mike Rosset <mike.rosset <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 16 Jan 2020 19:49:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mike Rosset <mike.rosset <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Mike Rosset <mike.rosset <at> gmail.com>
Subject: [PATCH] gnu: tuxguitar: Build and install alsa plugin.
Date: Thu, 16 Jan 2020 11:48:26 -0800
* gnu/packages/music.scm (tuxguitar): Allows midi sound output when using
  a synthesizer like timidity.

  [inputs]: Adds alsa-lib as an input.
  [phases]: No longer change build directory context between phases.
  [install]: Now install desktop, mime and manual files.
---
 gnu/packages/music.scm | 90 +++++++++++++++++++++++++++---------------
 1 file changed, 59 insertions(+), 31 deletions(-)

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index ad369bd3a8..15594ab0ba 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -1746,60 +1746,86 @@ is subjective.")
     (arguments
      `(#:build-target "build"
        #:jdk ,icedtea-8
-       #:tests? #f                      ; no tests
+       #:tests? #f
        #:phases
        (modify-phases %standard-phases
-         (add-after 'unpack 'enter-dir
-           (lambda _ (chdir "TuxGuitar-lib") #t))
-         (add-after 'build 'build-libraries
+         (replace 'build
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((initial-classpath (getenv "CLASSPATH"))
                     (build-dir (lambda (dir)
-                                 (chdir "..")
-                                 (setenv "CLASSPATH"
-                                         (string-join (cons initial-classpath
-                                                            (find-files (getcwd) "\\.jar$"))
-                                                      ":"))
-                                 (chdir dir)
-                                 (if (file-exists? "build.xml")
-                                     ((assoc-ref %standard-phases 'build)
-                                      #:build-target "build")
-                                     (begin
-                                       ;; Generate default build.xml.
-                                       ((@@ (guix build ant-build-system) default-build.xml)
-                                        (string-append (string-downcase dir) ".jar")
-                                        (string-append (assoc-ref outputs "out")
-                                                       "/share/java"))
-                                       ((assoc-ref %standard-phases 'build)))))))
-               (map build-dir '("TuxGuitar-editor-utils"
+                                 (setenv
+                                  "CLASSPATH"
+                                  (string-join (cons initial-classpath
+                                                     (find-files (getcwd) "\\.jar$"))
+                                               ":"))
+                                 (with-directory-excursion dir
+                                   (if (file-exists? "build.xml")
+                                       ((assoc-ref %standard-phases 'build)
+                                        #:build-target "build")
+                                       (begin
+                                         ;; Generate default build.xml.
+                                         ((@@ (guix build ant-build-system)
+                                              default-build.xml)
+                                          (string-append (string-downcase dir) ".jar")
+                                          (string-append (assoc-ref outputs "out")
+                                                         "/share/java"))
+                                         ((assoc-ref %standard-phases 'build))))))))
+               (map build-dir '("TuxGuitar-lib"
+                                "TuxGuitar-editor-utils"
                                 "TuxGuitar-ui-toolkit"
                                 "TuxGuitar-ui-toolkit-swt"
-                                "TuxGuitar-awt-graphics")))))
-         (add-after 'build-libraries 'build-application
+                                "TuxGuitar-viewer"
+                                "TuxGuitar"
+                                "TuxGuitar-gm-utils"
+                                "TuxGuitar-alsa"
+                                "TuxGuitar-midi"
+                                "TuxGuitar-midi-ui"))
+               #t)))
+         (add-after 'build 'build-jni
            (lambda _
-             (chdir "../TuxGuitar")
-             ((assoc-ref %standard-phases 'build)
-              #:build-target "build")))
+               (setenv "CC" "gcc")
+               (setenv "CFLAGS" (string-append
+                                 "-fpic -I"
+                                 (getcwd)
+                                 "/build-scripts/native-modules/common-include"))
+               (invoke "make" "-C" "./TuxGuitar-alsa/jni" "-f" "GNUmakefile")))
          (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"))
+                    (jni-lib (string-append out "/lib"))
                     (lib   (string-append share "/java"))
-                    (swt   (assoc-ref inputs "java-swt")))
+                    (swt   (assoc-ref inputs "java-swt"))
+                    (mime  (string-append share "/mime/packages"))
+                    (app   (string-append share "/applications"))
+                    (man   (string-append share "/man/man1")))
+
                (mkdir-p bin)
                ;; Install all jars.
                (for-each (lambda (file)
                            (install-file file lib))
-                         (find-files ".." "\\.jar$"))
+                         (find-files "." "\\.jar$"))
+
+               ;; Install jni libraries
+               (for-each (lambda (file)
+                           (install-file file jni-lib))
+                         (find-files "." "\\-jni.so$"))
 
                ;; Install all resources.
-               (copy-recursively "share" share)
+               (copy-recursively "./TuxGuitar/share" share)
+
+               ;; Install desktop and mime files
+               (install-file "./misc/tuxguitar.xml" mime)
+               (install-file "./misc/tuxguitar.desktop" app)
+
+               ;; Install manaual
+               (install-file "./misc/tuxguitar.1" man)
 
                ;; Create wrapper.
                (call-with-output-file (string-append bin "/tuxguitar")
                  (lambda (port)
-                   (let ((classpath (string-join (append (find-files lib "\\.jar$")
+                   (let ((classpath (string-join (append  (find-files lib "\\.jar$")
                                                          (find-files swt "\\.jar$"))
                                                  ":")))
                      (format
@@ -1810,12 +1836,14 @@ is subjective.")
                                      " -Dtuxguitar.home.path=" out
                                      " -Dtuxguitar.share.path=" out "/share"
                                      " -Dswt.library.path=" swt "/lib"
+                                     " -Djava.library.path=" out "/lib"
                                      " org.herac.tuxguitar.app.TGMainSingleton"
                                      " \"$1\" \"$2\"")))))
                (chmod (string-append bin "/tuxguitar") #o555)
                #t))))))
     (inputs
-     `(("java-swt" ,java-swt)))
+     `(("alsa-lib" ,alsa-lib)
+       ("java-swt" ,java-swt)))
     (home-page "http://tuxguitar.com.ar/")
     (synopsis "Multitrack tablature editor and player")
     (description
-- 
2.24.1





Reply sent to Kei Kebreau <kkebreau <at> posteo.net>:
You have taken responsibility. (Fri, 24 Jan 2020 02:03:01 GMT) Full text and rfc822 format available.

Notification sent to Mike Rosset <mike.rosset <at> gmail.com>:
bug acknowledged by developer. (Fri, 24 Jan 2020 02:03:01 GMT) Full text and rfc822 format available.

Message #10 received at 39155-done <at> debbugs.gnu.org (full text, mbox):

From: Kei Kebreau <kkebreau <at> posteo.net>
To: Mike Rosset <mike.rosset <at> gmail.com>
Cc: 39155-done <at> debbugs.gnu.org
Subject: Re: [bug#39155] [PATCH] gnu: tuxguitar: Build and install alsa plugin.
Date: Thu, 23 Jan 2020 21:02:25 -0500
Hello Mike!

Mike Rosset <mike.rosset <at> gmail.com> writes:

> * gnu/packages/music.scm (tuxguitar): Allows midi sound output when using
>   a synthesizer like timidity.
>
>   [inputs]: Adds alsa-lib as an input.
>   [phases]: No longer change build directory context between phases.
>   [install]: Now install desktop, mime and manual files.

I've changed the format of this log message a bit so it's less
repetitive.

> ---
>  gnu/packages/music.scm | 90 +++++++++++++++++++++++++++---------------
>  1 file changed, 59 insertions(+), 31 deletions(-)
>
> diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
> index ad369bd3a8..15594ab0ba 100644
> --- a/gnu/packages/music.scm
> +++ b/gnu/packages/music.scm
> @@ -1746,60 +1746,86 @@ is subjective.")
>      (arguments
>       `(#:build-target "build"
>         #:jdk ,icedtea-8
> -       #:tests? #f                      ; no tests
> +       #:tests? #f

I left this comment in since it notes that TuxGuitar actually doesn't
have a test suite, and that we haven't just disabled it for another reason.

>         #:phases
>         (modify-phases %standard-phases
> -         (add-after 'unpack 'enter-dir
> -           (lambda _ (chdir "TuxGuitar-lib") #t))
> -         (add-after 'build 'build-libraries
> +         (replace 'build
>             (lambda* (#:key inputs outputs #:allow-other-keys)
>               (let* ((initial-classpath (getenv "CLASSPATH"))
>                      (build-dir (lambda (dir)
> -                                 (chdir "..")
> -                                 (setenv "CLASSPATH"
> -                                         (string-join (cons initial-classpath
> -                                                            (find-files (getcwd) "\\.jar$"))
> -                                                      ":"))
> -                                 (chdir dir)
> -                                 (if (file-exists? "build.xml")
> -                                     ((assoc-ref %standard-phases 'build)
> -                                      #:build-target "build")
> -                                     (begin
> -                                       ;; Generate default build.xml.
> -                                       ((@@ (guix build ant-build-system) default-build.xml)
> -                                        (string-append (string-downcase dir) ".jar")
> -                                        (string-append (assoc-ref outputs "out")
> -                                                       "/share/java"))
> -                                       ((assoc-ref %standard-phases 'build)))))))
> -               (map build-dir '("TuxGuitar-editor-utils"
> +                                 (setenv
> +                                  "CLASSPATH"
> +                                  (string-join (cons initial-classpath
> +                                                     (find-files (getcwd) "\\.jar$"))
> +                                               ":"))
> +                                 (with-directory-excursion dir
> +                                   (if (file-exists? "build.xml")
> +                                       ((assoc-ref %standard-phases 'build)
> +                                        #:build-target "build")
> +                                       (begin
> +                                         ;; Generate default build.xml.
> +                                         ((@@ (guix build ant-build-system)
> +                                              default-build.xml)
> +                                          (string-append (string-downcase dir) ".jar")
> +                                          (string-append (assoc-ref outputs "out")
> +                                                         "/share/java"))
> +                                         ((assoc-ref %standard-phases 'build))))))))
> +               (map build-dir '("TuxGuitar-lib"
> +                                "TuxGuitar-editor-utils"
>                                  "TuxGuitar-ui-toolkit"
>                                  "TuxGuitar-ui-toolkit-swt"
> -                                "TuxGuitar-awt-graphics")))))
> -         (add-after 'build-libraries 'build-application
> +                                "TuxGuitar-viewer"
> +                                "TuxGuitar"
> +                                "TuxGuitar-gm-utils"
> +                                "TuxGuitar-alsa"
> +                                "TuxGuitar-midi"
> +                                "TuxGuitar-midi-ui"))
> +               #t)))
> +         (add-after 'build 'build-jni
>             (lambda _
> -             (chdir "../TuxGuitar")
> -             ((assoc-ref %standard-phases 'build)
> -              #:build-target "build")))
> +               (setenv "CC" "gcc")
> +               (setenv "CFLAGS" (string-append
> +                                 "-fpic -I"
> +                                 (getcwd)
> +                                 "/build-scripts/native-modules/common-include"))
> +               (invoke "make" "-C" "./TuxGuitar-alsa/jni" "-f" "GNUmakefile")))
>           (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"))
> +                    (jni-lib (string-append out "/lib"))
>                      (lib   (string-append share "/java"))
> -                    (swt   (assoc-ref inputs "java-swt")))
> +                    (swt   (assoc-ref inputs "java-swt"))
> +                    (mime  (string-append share "/mime/packages"))
> +                    (app   (string-append share "/applications"))
> +                    (man   (string-append share "/man/man1")))
> +
>                 (mkdir-p bin)
>                 ;; Install all jars.
>                 (for-each (lambda (file)
>                             (install-file file lib))
> -                         (find-files ".." "\\.jar$"))
> +                         (find-files "." "\\.jar$"))
> +
> +               ;; Install jni libraries
> +               (for-each (lambda (file)
> +                           (install-file file jni-lib))
> +                         (find-files "." "\\-jni.so$"))
>  
>                 ;; Install all resources.
> -               (copy-recursively "share" share)
> +               (copy-recursively "./TuxGuitar/share" share)
> +
> +               ;; Install desktop and mime files
> +               (install-file "./misc/tuxguitar.xml" mime)
> +               (install-file "./misc/tuxguitar.desktop" app)
> +
> +               ;; Install manaual
> +               (install-file "./misc/tuxguitar.1" man)
>  
>                 ;; Create wrapper.
>                 (call-with-output-file (string-append bin "/tuxguitar")
>                   (lambda (port)
> -                   (let ((classpath (string-join (append (find-files lib "\\.jar$")
> +                   (let ((classpath (string-join (append  (find-files lib "\\.jar$")
>                                                           (find-files swt "\\.jar$"))
>                                                   ":")))
>                       (format
> @@ -1810,12 +1836,14 @@ is subjective.")
>                                       " -Dtuxguitar.home.path=" out
>                                       " -Dtuxguitar.share.path=" out "/share"
>                                       " -Dswt.library.path=" swt "/lib"
> +                                     " -Djava.library.path=" out "/lib"
>                                       " org.herac.tuxguitar.app.TGMainSingleton"
>                                       " \"$1\" \"$2\"")))))
>                 (chmod (string-append bin "/tuxguitar") #o555)
>                 #t))))))
>      (inputs
> -     `(("java-swt" ,java-swt)))
> +     `(("alsa-lib" ,alsa-lib)
> +       ("java-swt" ,java-swt)))
>      (home-page "http://tuxguitar.com.ar/")
>      (synopsis "Multitrack tablature editor and player")
>      (description

The rest of this LGTM!  This has been pushed to master as commit
44e70dee184c4e4190349def71dc07f05822f591.  Thanks for contributing!  Now
we guitarists can hear our beautiful
tablature! :-)

Kei




Information forwarded to guix-patches <at> gnu.org:
bug#39155; Package guix-patches. (Fri, 24 Jan 2020 02:17:01 GMT) Full text and rfc822 format available.

Message #13 received at 39155-done <at> debbugs.gnu.org (full text, mbox):

From: Mike Rosset <mike.rosset <at> gmail.com>
To: Kei Kebreau <kkebreau <at> posteo.net>
Cc: 39155-done <at> debbugs.gnu.org
Subject: Re: [bug#39155] [PATCH] gnu: tuxguitar: Build and install alsa plugin.
Date: Thu, 23 Jan 2020 18:16:06 -0800
>> ---
>>  gnu/packages/music.scm | 90 +++++++++++++++++++++++++++---------------
>>  1 file changed, 59 insertions(+), 31 deletions(-)
>>
>> diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
>> index ad369bd3a8..15594ab0ba 100644
>> --- a/gnu/packages/music.scm
>> +++ b/gnu/packages/music.scm
>> @@ -1746,60 +1746,86 @@ is subjective.")
>>      (arguments
>>       `(#:build-target "build"
>>         #:jdk ,icedtea-8
>> -       #:tests? #f                      ; no tests
>> +       #:tests? #f
>
> I left this comment in since it notes that TuxGuitar actually doesn't
> have a test suite, and that we haven't just disabled it for another reason.

Hello Kei,

Apologies for removing this comment. I had not thought of this when I
removed it, thanks for reviewing this and merging.

Mike




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 21 Feb 2020 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 59 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.