From patchwork Thu Jan 16 19:48:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rosset X-Patchwork-Id: 19843 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E204917ADC; Thu, 16 Jan 2020 19:49:15 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 526D917ADA for ; Thu, 16 Jan 2020 19:49:15 +0000 (GMT) Received: from localhost ([::1]:47706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isB8k-0004IR-F7 for patchwork@mira.cbaines.net; Thu, 16 Jan 2020 14:49:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51171) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isB8a-0004Dm-9K for guix-patches@gnu.org; Thu, 16 Jan 2020 14:49:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1isB8Y-0003Da-Pq for guix-patches@gnu.org; Thu, 16 Jan 2020 14:49:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60632) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1isB8Y-0003DR-Mv for guix-patches@gnu.org; Thu, 16 Jan 2020 14:49:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1isB8Y-0006If-KU for guix-patches@gnu.org; Thu, 16 Jan 2020 14:49:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#39155] [PATCH] gnu: tuxguitar: Build and install alsa plugin. Resent-From: Mike Rosset Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Jan 2020 19:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 39155 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 39155@debbugs.gnu.org Cc: Mike Rosset X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.157920412924196 (code B ref -1); Thu, 16 Jan 2020 19:49:02 +0000 Received: (at submit) by debbugs.gnu.org; 16 Jan 2020 19:48:49 +0000 Received: from localhost ([127.0.0.1]:38372 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1isB8K-0006IC-TQ for submit@debbugs.gnu.org; Thu, 16 Jan 2020 14:48:49 -0500 Received: from lists.gnu.org ([209.51.188.17]:57332) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1isB8J-0006I4-1z for submit@debbugs.gnu.org; Thu, 16 Jan 2020 14:48:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51120) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isB8H-0003t7-1h for guix-patches@gnu.org; Thu, 16 Jan 2020 14:48:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1isB8F-0002ts-DF for guix-patches@gnu.org; Thu, 16 Jan 2020 14:48:44 -0500 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:40267) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1isB8E-0002qt-GA for guix-patches@gnu.org; Thu, 16 Jan 2020 14:48:43 -0500 Received: by mail-pf1-x444.google.com with SMTP id q8so10725004pfh.7 for ; Thu, 16 Jan 2020 11:48:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FmlrtFbOlOTOiqeJdisB/KNDZYNR6BjOWG5dFyIluKg=; b=sMS7n/PIB6sfNEN8pQBPKbAP9cCGmO58YizTSt6xHmYaGiRs9MBLsitPvfqOxmevNS 4b/7wiczKdGgnw4mPyfs63fJoKZu1Ms6DBcuXDbqfRzWyJOyA6B2mqbh0MK2RbJsyymY r3Fs9visWYUedk25D/Oiix9MkGWVgDHAUBghFj2YQCnQPsDKHNR6lBrW+zeD27lWdaXQ G6EAEr43r0rh4Pq4yY5fHIwuFQ3tvwQy+0fM5qBRXVnkS1jjQKy5hlJe5UhBmL1LBQtW lFb9EXVIK9QNeYUniYh4zGlzKddlqP9at5oC8a+bFz77TPMIxedtfIiGDrupl2PgNAxJ BTcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FmlrtFbOlOTOiqeJdisB/KNDZYNR6BjOWG5dFyIluKg=; b=eixfKKMnN3gSj2YHl2Ab4bZR0OkUT2Grq/P0D3XzPegl+j5kLzSXWprFaI1U8I7gIc jhBx6vEJIdowtV19GXdT1SkWB+fOvOnC9xtpNjn+6czRlmN5NMq2TCsOCOm7H6QUArcv OZgfj6tPq143S44nOxwEfazokkGx4fasRLaTct0TdZQdBBxfDaAlm7mkVh5CSd30CUZB 7zm4NLacx+eBPxYs/eFvhlPiJTEsI+Uib8iVt9oPQgnuO7C+0zyZaUv8bJqPoZQ6vJcx P7m4e1QC7ywNXqwvBT68NYuH2Oe6O0zlrIem0ogprqDTgBGk6anpWeJzfpkeRdjWBZxo CyKA== X-Gm-Message-State: APjAAAWJ1x4t061Vzbtf+iOoWQs/ZgKqO0NXmTddjZ8mmWPA1C9Vl9cH bj4B9LGsj7Yy7cxQfZEHgUVKhqci X-Google-Smtp-Source: APXvYqzlTAA0YFpsgs+eZFIfmosQxgyEwO8BcR/V5vMoDu/cPa5Pc1q3QuyKLyDgjTOL8lS9VYQKPw== X-Received: by 2002:a63:de4a:: with SMTP id y10mr41419624pgi.367.1579204119568; Thu, 16 Jan 2020 11:48:39 -0800 (PST) Received: from neutron.hitronhub.home (S010664777da04f43.vf.shawcable.net. [70.68.94.152]) by smtp.gmail.com with ESMTPSA id q199sm27453491pfq.163.2020.01.16.11.48.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jan 2020 11:48:38 -0800 (PST) From: Mike Rosset Date: Thu, 16 Jan 2020 11:48:26 -0800 Message-Id: <20200116194826.9330-1-mike.rosset@gmail.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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