From patchwork Wed Oct 9 07:45:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cayetano Santos X-Patchwork-Id: 31946 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 6222327BBEA; Wed, 9 Oct 2024 08:46:13 +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 2A96B27BBE2 for ; Wed, 9 Oct 2024 08:46:12 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syROO-0002zC-CK; Wed, 09 Oct 2024 03:45:56 -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 1syROM-0002z3-TU for guix-patches@gnu.org; Wed, 09 Oct 2024 03:45:54 -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 1syROL-0002T7-44 for guix-patches@gnu.org; Wed, 09 Oct 2024 03:45:53 -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:Date:From:To:Subject; bh=fwmB5f73dHJ5F/+clnjJtIEPwCx3noIDPkZ+zmOU05Y=; b=LGGPXRiA6LL0XWZKzBKwd6IpPnPqdrObA+4KvXZtCzorjuwAQGN8xgQzukYijhDPsG67Lt2kaoYu+4Ns1WuADxEC02jj5kppqXA8+hVrU0ca+Qg6VgATmCMfrcNVBZXY78zdJe5ROYlL0o3pdI4sbOm7K4g7t/Mhk7sv5tSJB0KUUYnK9/MGCh3Vz1Kg1mtepXQANUnaAgm9g97iOMckfO/acAirKvULmc6rdaDX4NDIzqUeRYyeBsSh2uwPwbWWZjWGwXQPCTxazNgVOAxp2H0MKM3KJ4atTdzuHIIARrKWeWtToLbTUlM1RUIOXBfwoIisFpNjUtemCk6QZPHD6g==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1syROU-0006fR-NQ for guix-patches@gnu.org; Wed, 09 Oct 2024 03:46:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73717] [PATCH] gnu: Add yosys-clang. Resent-From: Cayetano Santos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 09 Oct 2024 07:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 73717 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73717@debbugs.gnu.org Cc: Cayetano Santos X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.172845994825605 (code B ref -1); Wed, 09 Oct 2024 07:46:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 Oct 2024 07:45:48 +0000 Received: from localhost ([127.0.0.1]:55523 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1syROF-0006eu-OG for submit@debbugs.gnu.org; Wed, 09 Oct 2024 03:45:48 -0400 Received: from lists.gnu.org ([209.51.188.17]:45622) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1syROC-0006ej-4g for submit@debbugs.gnu.org; Wed, 09 Oct 2024 03:45:45 -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 1syRO2-0002yU-5Z for guix-patches@gnu.org; Wed, 09 Oct 2024 03:45:34 -0400 Received: from confino.investici.org ([2a11:7980:1::2:0]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1syRNz-0002Pt-48 for guix-patches@gnu.org; Wed, 09 Oct 2024 03:45:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inventati.org; s=stigmate; t=1728459924; bh=fwmB5f73dHJ5F/+clnjJtIEPwCx3noIDPkZ+zmOU05Y=; h=From:To:Cc:Subject:Date:From; b=aG9SX9WumTW6esOxhVCufoReJeDZ4BySP35tInxN8fVD79JhcVnPm2veA4LXJxoLc zIPDkwQjf2uDr8J8mnoR8NSWzD2jf43fKrsGXYEsj9Q8VgPmPv/eJZC/6pQ/DoNZG9 wwVaJhz11GOG7wEQ5n885HzV3aji1YFvi2eXX2LU= Received: from mx1.investici.org (unknown [127.0.0.1]) by confino.investici.org (Postfix) with ESMTP id 4XNlKw6ZrLz119r; Wed, 9 Oct 2024 07:45:24 +0000 (UTC) Received: from [93.190.126.19] (mx1.investici.org [93.190.126.19]) (Authenticated sender: cayetano.santos@inventati.org) by localhost (Postfix) with ESMTPSA id 4XNlKw5Pccz117F; Wed, 9 Oct 2024 07:45:24 +0000 (UTC) Date: Wed, 9 Oct 2024 09:45:02 +0200 Message-ID: <8b52ca0f1d61c5ff14501fb72658b0bee716af13.1728459902.git.csantosb@inventati.org> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a11:7980:1::2:0; envelope-from=csantosb@inventati.org; helo=confino.investici.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Cayetano Santos X-ACL-Warn: , Cayetano Santos via Guix-patches X-Patchwork-Original-From: Cayetano Santos via Guix-patches via From: Cayetano Santos 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/fpga.scm (yosys-clang): New variable. Change-Id: Iedbd418adc152c325d106830d9d33b73f01e65da --- gnu/packages/fpga.scm | 54 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) base-commit: d44beb9b4ad836781928a0c5667e94c0d6df13f0 diff --git a/gnu/packages/fpga.scm b/gnu/packages/fpga.scm index 68f36d501f..5204e041f9 100644 --- a/gnu/packages/fpga.scm +++ b/gnu/packages/fpga.scm @@ -224,6 +224,60 @@ (define-public yosys (description "Yosys synthesizes Verilog-2005.") (license license:isc))) +(define-public yosys-clang + (package + (inherit yosys) + (name "yosys-clang") + (arguments + (list + #:test-target "test" + #:make-flags #~(list "CC=clang" + "CXX=clang++" + (string-append "PREFIX=" #$output)) + #:phases + #~(modify-phases %standard-phases + (add-before 'configure 'fix-paths + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "./backends/smt2/smtio.py" + (("\\['z3") + (string-append "['" (search-input-file inputs "/bin/z3")))) + (substitute* "./kernel/fstdata.cc" + (("vcd2fst") + (search-input-file inputs "/bin/vcd2fst"))) + (substitute* '("./passes/cmds/show.cc" + "./passes/cmds/viz.cc") + (("exec xdot") + (string-append "exec " (search-input-file inputs + "/bin/xdot"))) + (("dot -") + (string-append (search-input-file inputs "/bin/dot") " -")) + (("fuser") + (search-input-file inputs "/bin/fuser"))))) + (replace 'configure + (lambda* (#:key make-flags #:allow-other-keys) + (apply invoke "make" "config-clang" make-flags))) + (add-after 'configure 'use-external-abc + (lambda* (#:key inputs #:allow-other-keys) + (substitute* '("./Makefile") + (("ABCEXTERNAL \\?=") + (string-append "ABCEXTERNAL = " + (search-input-file inputs "/bin/abc")))))) + (add-after 'install 'add-symbolic-link + (lambda* (#:key inputs #:allow-other-keys) + ;; Previously this package provided a copy of the "abc" + ;; executable in its output, named "yosys-abc". Create a + ;; symbolic link so any external uses of that name continue to + ;; work. + (symlink (search-input-file inputs "/bin/abc") + (string-append #$output "/bin/yosys-abc")))) + (add-after 'install 'wrap + (lambda* (#:key inputs #:allow-other-keys) + (wrap-program (string-append #$output "/bin/yosys-witness") + `("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH"))))))))) + (inputs + (modify-inputs (package-inputs yosys) + (append clang))))) + (define-public icestorm (let ((commit "2bc541743ada3542c6da36a50e66303b9cbd2059") (revision "4"))