From patchwork Wed Apr 23 23:08:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Graves X-Patchwork-Id: 41967 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 9CA3827BC4B; Thu, 24 Apr 2025 00:09:58 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 113AA27BC49 for ; Thu, 24 Apr 2025 00:09:58 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u7jDI-0004wF-7g; Wed, 23 Apr 2025 19:09:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u7jDF-0004vX-C6 for guix-patches@gnu.org; Wed, 23 Apr 2025 19:09:05 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u7jDF-00038L-2u for guix-patches@gnu.org; Wed, 23 Apr 2025 19:09:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=2+1GNGgsWs25ZsvTuGpB0FhqLAqo/dHgIF4zIfVd2zw=; b=CVCXX3JxP4FgSfpv0f8TXJ/xHcXNuntNBs0l4Cmj1RRIAr841fqLd7Xy0z8zXoPqov0VMn1vQaKn94BbZmXg97tVMOFX28rxdsTJgBbj8xt/SfoE0tcJT5EtlPbOG0WGLN4HeR4PjGwx1U9ZfZK9RUlrdkW+Aq8UxYO+5wfSoTLT6xqDYTQhdQjTi8RVYKjHLeGPvz+5eL80nvrraSDCPGZiQd8KUlFtjVzmY0Cc6HpeRVqsMN69kugc4OHztHzF/8mW7vCfUOp6BQv223nDm4r41bi7jbmIbo39pKp7EVoFDvdf4L6YxHqQmBzJA9OZdJzN3dn2vn1t/cj4oUPFFQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u7jDE-0005XB-Uh for guix-patches@gnu.org; Wed, 23 Apr 2025 19:09:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78022] [PATCH 6/8] gnu: kaldi: Improve style. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 23 Apr 2025 23:09:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78022 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78022@debbugs.gnu.org Cc: Nicolas Graves Received: via spool by 78022-submit@debbugs.gnu.org id=B78022.174544972121172 (code B ref 78022); Wed, 23 Apr 2025 23:09:04 +0000 Received: (at 78022) by debbugs.gnu.org; 23 Apr 2025 23:08:41 +0000 Received: from localhost ([127.0.0.1]:59534 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u7jCq-0005VM-VQ for submit@debbugs.gnu.org; Wed, 23 Apr 2025 19:08:41 -0400 Received: from 7.mo562.mail-out.ovh.net ([46.105.55.234]:53303) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u7jCj-0005UK-QM for 78022@debbugs.gnu.org; Wed, 23 Apr 2025 19:08:34 -0400 Received: from director3.derp.mail-out.ovh.net (director3.derp.mail-out.ovh.net [152.228.215.222]) by mo562.mail-out.ovh.net (Postfix) with ESMTPS id 4ZjZXc2WX5z1QRM; Wed, 23 Apr 2025 23:08:32 +0000 (UTC) Received: from director3.derp.mail-out.ovh.net (director3.derp.mail-out.ovh.net. [127.0.0.1]) by director3.derp.mail-out.ovh.net (inspect_sender_mail_agent) with SMTP for <78022@debbugs.gnu.org>; Wed, 23 Apr 2025 23:08:32 +0000 (UTC) Received: from mta2.priv.ovhmail-u1.ea.mail.ovh.net (unknown [10.110.188.111]) by director3.derp.mail-out.ovh.net (Postfix) with ESMTPS id 4ZjZXc1HfKz7wVr; Wed, 23 Apr 2025 23:08:32 +0000 (UTC) Received: from ngraves.fr (unknown [10.1.6.3]) by mta2.priv.ovhmail-u1.ea.mail.ovh.net (Postfix) with ESMTPSA id BD981BA3F67; Wed, 23 Apr 2025 23:08:31 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-112S00613a36380-0010-4d3b-8554-eac064d54f77, 299BDCF71F74AF9523BA0ED19DF3CA9E8A5786D9) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 90.92.117.144 Date: Thu, 24 Apr 2025 01:08:10 +0200 Message-ID: <20250423230821.1141-6-ngraves@ngraves.fr> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250423230821.1141-1-ngraves@ngraves.fr> References: <20250423230821.1141-1-ngraves@ngraves.fr> MIME-Version: 1.0 X-Ovh-Tracer-Id: 8282119717046641378 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvgeejkeekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepleffjeetueethfefkeffffefvddukeejkefgleduiedthfekvefhiedvhfffgeegnecukfhppeduvdejrddtrddtrddupdeltddrledvrdduudejrddugeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepvddprhgtphhtthhopeejkedtvddvseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdfovfetjfhoshhtpehmohehiedvmgdpmhhouggvpehsmhhtphhouhht DKIM-Signature: a=rsa-sha256; bh=2+1GNGgsWs25ZsvTuGpB0FhqLAqo/dHgIF4zIfVd2zw=; c=relaxed/relaxed; d=ngraves.fr; h=From; s=ovhmo4487190-selector1; t=1745449712; v=1; b=yRRVZFllAI9DShD86Orbh6cwdE8C8WQM55QgYxVnCaqKnwFrLpHE4zd2nR8s5v5Z+rLLwlQS tFCIYU3Q1YrDhjElpW4DLWlKaJZCtA0CiTfL7Sh+t1AclTmRx1nzO222oKRpihGmLoXaHQPltYb sfhfVzA57PGbIxsEbOSSma62iAnL7k1Df2oPlvWxtGfZoFn22H1Sedbd3YNxmPZYI+MbjkTNScz D4KZCn6mq95zooMEfU/0nD+dT8KlURg5XG8nAfEuuzZgVae431B6MYE34g8vTa+Fx8QjV063+g2 Eu+TuLDWWOLuqmt4DVV6flBarLI1SSDvNF2Ye/UMvdNWg== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches X-Patchwork-Original-From: Nicolas Graves via Guix-patches via From: Nicolas Graves Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/machine-learning.scm (kaldi): [arguments]: Use it. Add --fst-version flag. : Use gexps. Use configure-flags in the 'configure-phase. --- gnu/packages/machine-learning.scm | 143 +++++++++++++++--------------- 1 file changed, 72 insertions(+), 71 deletions(-) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index e94b782d2cf..a4eff194eaf 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -2936,78 +2936,79 @@ (define-public kaldi "kaldi-ignore-failing-test.patch")))) (build-system gnu-build-system) (arguments - `(#:test-target "test" - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'chdir - (lambda _ (chdir "src"))) - (replace 'configure - (lambda* (#:key build system inputs outputs #:allow-other-keys) - (when (not (or (string-prefix? "x86_64" system) - (string-prefix? "i686" system))) - (substitute* "makefiles/linux_openblas.mk" - (("-msse -msse2") ""))) - (substitute* "makefiles/default_rules.mk" - (("/bin/bash") (which "bash"))) - (substitute* "Makefile" - (("ext_depend: check_portaudio") - "ext_depend:")) - (substitute* '("online/Makefile" - "onlinebin/Makefile" - "gst-plugin/Makefile") - (("../../tools/portaudio/install") - (assoc-ref inputs "portaudio"))) - (substitute* "matrix/Makefile" ;temporary test bypass - (("matrix-lib-test sparse-matrix-test") "")) + (list + #:test-target "test" + #:configure-flags + (let ((fst (this-package-input "openfst"))) + #~(list "--use-cuda=no" + "--shared" + (string-append "--openblas-root=" + #$(this-package-input "openblas")) + (string-append "--fst-root=" #$fst) + (string-append "--fst-version=" #$(package-version fst)))) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'chdir + (lambda _ (chdir "src"))) + (replace 'configure + (lambda* (#:key build system inputs configure-flags + #:allow-other-keys) + (when (not (or (string-prefix? "x86_64" system) + (string-prefix? "i686" system))) + (substitute* "makefiles/linux_openblas.mk" + (("-msse -msse2") ""))) + (substitute* "makefiles/default_rules.mk" + (("/bin/bash") (which "bash"))) + (substitute* "Makefile" + (("ext_depend: check_portaudio") + "ext_depend:")) + (substitute* '("online/Makefile" + "onlinebin/Makefile" + "gst-plugin/Makefile") + (("../../tools/portaudio/install") + (assoc-ref inputs "portaudio"))) + (substitute* "matrix/Makefile" ;temporary test bypass + (("matrix-lib-test sparse-matrix-test") "")) - ;; This `configure' script doesn't support variables passed as - ;; arguments, nor does it support "prefix". - (let ((out (assoc-ref outputs "out")) - (openblas (assoc-ref inputs "openblas")) - (openfst (assoc-ref inputs "openfst"))) - (substitute* "configure" - (("check_for_slow_expf;") "") - ;; This affects the RPATH and also serves as the installation - ;; directory. - (("KALDILIBDIR=`pwd`/lib") - (string-append "KALDILIBDIR=" out "/lib"))) - (mkdir-p out) ; must exist - (setenv "CONFIG_SHELL" (which "bash")) - (setenv "OPENFST_VER" ,(package-version openfst)) - (invoke "./configure" - "--use-cuda=no" - "--shared" - (string-append "--openblas-root=" openblas) - (string-append "--fst-root=" openfst))))) - (add-after 'build 'build-ext-and-gstreamer-plugin - (lambda _ - (invoke "make" "-C" "online" "depend") - (invoke "make" "-C" "online") - (invoke "make" "-C" "onlinebin" "depend") - (invoke "make" "-C" "onlinebin") - (invoke "make" "-C" "gst-plugin" "depend") - (invoke "make" "-C" "gst-plugin"))) - ;; TODO: also install the executables. - (replace 'install - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (inc (string-append out "/include")) - (lib (string-append out "/lib"))) - (mkdir-p lib) - ;; The build phase installed symlinks to the actual - ;; libraries. Install the actual targets. - (for-each (lambda (file) - (let ((target (readlink file))) - (delete-file file) - (install-file target lib))) - (find-files lib "\\.so")) - ;; Install headers - (for-each (lambda (file) - (let ((target-dir (string-append inc "/" (dirname file)))) - (install-file file target-dir))) - (find-files "." "\\.h")) - (install-file "gst-plugin/libgstonlinegmmdecodefaster.so" - (string-append lib "/gstreamer-1.0")))))))) + ;; This `configure' script doesn't support variables passed as + ;; arguments, nor does it support "prefix". + (substitute* "configure" + (("check_for_slow_expf;") "") + ;; This affects the RPATH and also serves as the installation + ;; directory. + (("KALDILIBDIR=`pwd`/lib") + (string-append "KALDILIBDIR=" #$output "/lib"))) + (mkdir-p #$output) ; must exist + (setenv "CONFIG_SHELL" (which "bash")) + (apply invoke "./configure" configure-flags))) + (add-after 'build 'build-ext-and-gstreamer-plugin + (lambda _ + (invoke "make" "-C" "online" "depend") + (invoke "make" "-C" "online") + (invoke "make" "-C" "onlinebin" "depend") + (invoke "make" "-C" "onlinebin") + (invoke "make" "-C" "gst-plugin" "depend") + (invoke "make" "-C" "gst-plugin"))) + ;; TODO: also install the executables. + (replace 'install + (lambda _ + (let* ((inc (string-append #$output "/include")) + (lib (string-append #$output "/lib"))) + (mkdir-p lib) + ;; The build phase installed symlinks to the actual + ;; libraries. Install the actual targets. + (for-each (lambda (file) + (let ((target (readlink file))) + (delete-file file) + (install-file target lib))) + (find-files lib "\\.so")) + ;; Install headers + (for-each (lambda (file) + (let ((target-dir (string-append inc "/" (dirname file)))) + (install-file file target-dir))) + (find-files "." "\\.h")) + (install-file "gst-plugin/libgstonlinegmmdecodefaster.so" + (string-append lib "/gstreamer-1.0")))))))) (inputs (list alsa-lib `(,gfortran "lib")