From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id KGb9DwQffl9uUAAA0tVLHw (envelope-from ) for ; Wed, 07 Oct 2020 20:03:16 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id UA7rCwQffl9iTQAAB5/wlQ (envelope-from ) for ; Wed, 07 Oct 2020 20:03:16 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B1FB6940548 for ; Wed, 7 Oct 2020 20:03:15 +0000 (UTC) Received: from localhost ([::1]:43318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQFec-0001W3-Hj for larch@yhetil.org; Wed, 07 Oct 2020 16:03:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33064) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQFeQ-0001VB-Ed for guix-patches@gnu.org; Wed, 07 Oct 2020 16:03:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46614) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kQFeQ-0004Jz-47 for guix-patches@gnu.org; Wed, 07 Oct 2020 16:03:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kQFeQ-0002eR-0k for guix-patches@gnu.org; Wed, 07 Oct 2020 16:03:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43852] [PATCH] gnu: Add riscv-openocd. Resent-From: Malte Frank Gerdes Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 07 Oct 2020 20:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 43852 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43852@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.160210096710155 (code B ref -1); Wed, 07 Oct 2020 20:03:01 +0000 Received: (at submit) by debbugs.gnu.org; 7 Oct 2020 20:02:47 +0000 Received: from localhost ([127.0.0.1]:58156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQFe3-0002db-I5 for submit@debbugs.gnu.org; Wed, 07 Oct 2020 16:02:47 -0400 Received: from lists.gnu.org ([209.51.188.17]:60284) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQFdv-0002dN-ON for submit@debbugs.gnu.org; Wed, 07 Oct 2020 16:02:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33026) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQFdq-0001Qk-9I for guix-patches@gnu.org; Wed, 07 Oct 2020 16:02:29 -0400 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:45413) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kQFdg-0004Fh-P1 for guix-patches@gnu.org; Wed, 07 Oct 2020 16:02:25 -0400 Received: by mail-ed1-x52f.google.com with SMTP id dg9so1134204edb.12 for ; Wed, 07 Oct 2020 13:02:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:user-agent:mime-version; bh=2EgM3OUiRZCgQcMICHhjGuD1EAGu0t1/z2lJYdN8FTE=; b=NVj3VkqJ6vCAxtvLr6pb7/l8Am7lA7/4zcSbe4HxsWWERmcobq6+9mQPhvI8yR0iuM 4i44wFaAaid27qJ0aIzktG0raaiFLcA7a3JNkO6QVVp7wXv/T7FXs8HN10RT/zWu986J ryiGAdThR5QRU9sHyZ0bhuAgEg/G83FqMbRvt+/Hk+xIGRQQPZEmGBFYA4CBPaoJrw1M emjFU2tLdmn/pLsCv89F+KC9pc0+j6fqnGYvbeVJikl91CdrtaEAErtRKAWHungs5zrX wDtJ9Yp7QNGFEhcqYFHS47hdTfwnsUVLNRuHOWH9tNMVdedalC1KCU/Pjyka5Rt7ZQHJ f1ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version; bh=2EgM3OUiRZCgQcMICHhjGuD1EAGu0t1/z2lJYdN8FTE=; b=FfTxp3u60JyuAD87BaSKnmJ8YDNS0lqhAa80aD3BNKFLNxGufsaS6ZMJ3HJKznjiYu 6xmNU8R+ejXO81Ehrld3Qzxvsd8sb/TYzchMxt9F42sVtXZSmQ8oMSo0ucxRMp8haJcW 6uqLwCe19PIUDA480+EcmRvy3MkN5Rhy2a4Y3jbwq7gJs4341RCOLRx0tIpxHgDJ/nzm 92ZyKkH0GjyffPMxBoD2P509b7+64wFExL0JBeFySkpr0pVZH8F6MYrtnauTOvmBoosP py5CTWY3DwtfT1qPq6p9ybAwwD5z4nXMt6KCd2ygiWdsIp3TWg9PTLdvMLNydVuDDxfQ bqbg== X-Gm-Message-State: AOAM5331cMvhN7jRcSX0VIepnOFPglvo80Jn47vKCKFVUvsjFa2TOUOE GgXeVrNnhTPzUyfMsWRm11WWFAV1C+o= X-Google-Smtp-Source: ABdhPJzTBp062KzVYZ5wMWbqwM5WEc7EQLZW3YPE1MOGERulNMI9yLbzRqw0VcHBIWWIlZ1JOemZxQ== X-Received: by 2002:a05:6402:84f:: with SMTP id b15mr5430353edz.149.1602100931071; Wed, 07 Oct 2020 13:02:11 -0700 (PDT) Received: from Morphium (ip-84-118-73-55.unity-media.net. [84.118.73.55]) by smtp.gmail.com with ESMTPSA id ds8sm2031786ejc.86.2020.10.07.13.02.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Oct 2020 13:02:10 -0700 (PDT) From: Malte Frank Gerdes Date: Wed, 07 Oct 2020 22:02:09 +0200 Message-ID: <86lfgh6bzy.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=malte.f.gerdes@gmail.com; helo=mail-ed1-x52f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_SBL_A=0.1 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 3.5 (+++) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -0.0 (/) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=NVj3VkqJ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 0.09 X-TUID: tlpDiVOhbjrX --=-=-= Content-Type: text/plain Hi, this adds OpenOCD with RISC-V support to Guix. There is a problem though: riscv-openocd bundles libjaylink, which is also available as a package. The available package cannot be used because it is too old and riscv-openocd has riscv-specific additions made to it. So the question is: does this justify using the bundled library or should I do something? (if yes, what?) I have successfully used the package to communicate via JTAG with a Sipeed Nano and a JLink V8. I built this package successfully on: x86_64-linux, aarch64-linux Malte --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-Add-riscv-openocd.patch Content-Transfer-Encoding: quoted-printable >From ccbb612dcf87e2e628febfee74f893726b6ca309 Mon Sep 17 00:00:00 2001 From: Malte Frank Gerdes Date: Wed, 7 Oct 2020 20:27:51 +0200 Subject: [PATCH] gnu: Add riscv-openocd. * gnu/packages/embedded.scm (riscv-openocd): New variable. * gnu/packages/patches/riscv-openocd-reproducibility.patch: New file. * gnu/local.mk (dist_patch_DATA): Register patch. --- gnu/local.mk | 2 + gnu/packages/embedded.scm | 80 +++++++++++++++++++ .../riscv-openocd-reproducibility.patch | 57 +++++++++++++ 3 files changed, 139 insertions(+) create mode 100644 gnu/packages/patches/riscv-openocd-reproducibility.patch diff --git a/gnu/local.mk b/gnu/local.mk index f3b5b17e84..4fa460d4a1 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -37,6 +37,7 @@ # Copyright =C2=A9 2020 Brice Waegeneire # Copyright =C2=A9 2020 Tanguy Le Carrour # Copyright =C2=A9 2020 Martin Becze +# Copyright =C2=A9 2020 Malte Frank Gerdes # # This file is part of GNU Guix. # @@ -1407,6 +1408,7 @@ dist_patch_DATA =3D \ %D%/packages/patches/pango-skip-libthai-test.patch \ %D%/packages/patches/pciutils-hurd-configure.patch \ %D%/packages/patches/ppsspp-disable-upgrade-and-gold.patch \ + %D%/packages/patches/riscv-openocd-reproducibility.patch \ %D%/packages/patches/samba-fix-fcntl-hint-detection.patch \ %D%/packages/patches/sdl-pango-api_additions.patch \ %D%/packages/patches/sdl-pango-blit_overflow.patch \ diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm index f9f0e04238..89fdf81349 100644 --- a/gnu/packages/embedded.scm +++ b/gnu/packages/embedded.scm @@ -7,6 +7,7 @@ ;;; Copyright =C2=A9 2018, 2019 Cl=C3=A9ment Lassieur ;;; Copyright =C2=A9 2020 Marius Bakke ;;; Copyright =C2=A9 2020 Bj=C3=B6rn H=C3=B6fling +;;; Copyright =C2=A9 2020 Malte Frank Gerdes ;;; ;;; This file is part of GNU Guix. ;;; @@ -38,6 +39,7 @@ #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module ((gnu packages base) #:prefix base:) + #:use-module (gnu packages bash) #:use-module (gnu packages bison) #:use-module (gnu packages cross-base) #:use-module (gnu packages dejagnu) @@ -54,6 +56,7 @@ #:use-module (gnu packages python-xyz) #:use-module (gnu packages swig) #:use-module (gnu packages texinfo) + #:use-module (gnu packages version-control) #:use-module (gnu packages xorg) #:use-module (srfi srfi-1)) =20 @@ -580,6 +583,83 @@ language.") with a layered architecture of JTAG interface and TAP support.") (license license:gpl2+))) =20 +(define-public riscv-openocd + (let ((commit "675259382bacade0d4cc44d1944be2aa6a893adc") + (revision "0")) + (package + (name "riscv-openocd") + (version (string-append "0.10.0-" revision "." + (string-take commit 7))) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/riscv/riscv-openocd") + (commit commit))) + (sha256 + (base32 + "083xyx2dq2f9yfkjpl8gm0icn96im1kip479y85nxl0z9ih7fxbf")) + (patches + (search-patches "riscv-openocd-reproducibility.patch")))) + (build-system gnu-build-system) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("which" ,base:which) + ("libtool" ,libtool) + ("pkg-config" ,pkg-config) + ("bash-minimal" ,bash-minimal) + ("texinfo" ,texinfo))) + (inputs + `(("hidapi" ,hidapi) + ("jimtcl" ,jimtcl) + ("libftdi" ,libftdi) + ("libusb-compat" ,libusb-compat))) + (arguments + '(#:configure-flags + (append (list "--disable-werror" + "--enable-sysfsgpio" + "--disable-internal-jimtcl") + (map (lambda (programmer) + (string-append "--enable-" programmer)) + '("amtjtagaccel" "armjtagew" "buspirate" "ftdi" + "gw16012" "jlink" "opendous" "osbdm" + "parport" "aice" "cmsis-dap" "dummy" "jtag_vpi" + "remote-bitbang" "rlink" "stlink" "ti-icdi" "ulink" + "usbprog" "vsllink" "usb-blaster-2" "usb_blaster" + "presto" "openjtag"))) + #:phases + (modify-phases %standard-phases + (replace 'bootstrap + (lambda _ + (chmod "src/jtag/drivers/libjaylink/autogen.sh" #o644) + (invoke "sh" "bootstrap" "nosubmodule"))) + (add-after 'bootstrap 'bootstrap-jaylink + ;; we are using the bundled libjaylink here, because the orig= inal + ;; repo (https://git.zapb.de/libjaylink.git) is now behind a = login + ;; and cannot be cloned anymore. This package has custom addi= tions + ;; to libjaylink. + (lambda _ + (with-directory-excursion "src/jtag/drivers/libjaylink" + (patch-shebang "autogen.sh") + (invoke "sh" "autogen.sh")))) + (add-before 'configure 'change-udev-group + (lambda _ + (substitute* "contrib/60-openocd.rules" + (("plugdev") "dialout")) + #t)) + (add-after 'install 'install-udev-rules + (lambda* (#:key outputs #:allow-other-keys) + (install-file "contrib/60-openocd.rules" + (string-append + (assoc-ref outputs "out") + "/lib/udev/rules.d/")) + #t))))) + (home-page "http://openocd.org") + (synopsis "On-Chip Debugger with RISC-V Support.") + (description "OpenOCD provides on-chip programming and debugging sup= port +with a layered architecture of JTAG interface and TAP support.") + (license license:gpl2+)))) + ;; The commits for all propeller tools are the stable versions published at ;; https://github.com/propellerinc/propgcc in the release_1_0. According = to ;; personal correspondence with the developers in July 2017, more recent diff --git a/gnu/packages/patches/riscv-openocd-reproducibility.patch b/gnu= /packages/patches/riscv-openocd-reproducibility.patch new file mode 100644 index 0000000000..3f7227e7a3 --- /dev/null +++ b/gnu/packages/patches/riscv-openocd-reproducibility.patch @@ -0,0 +1,57 @@ +diff --git a/Makefile.am b/Makefile.am +index fcfd554c2..55088fef8 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -94,9 +94,7 @@ TCL_FILES =3D find $(srcdir)/$(TCL_PATH) -name '*.cfg' -= o -name '*.tcl' -o -name ' + sed -e 's,^$(srcdir)/$(TCL_PATH),,' + + dist-hook: +- if test -d $(srcdir)/.git -a \( ! -e $(distdir)/ChangeLog -o -w $(distdi= r)/ChangeLog \) ; then \ +- git --git-dir $(srcdir)/.git log | $(srcdir)/tools/git2cl/git2cl > $(di= stdir)/ChangeLog ; \ +- fi ++ + for i in $$($(TCL_FILES)); do \ + j=3D"$(distdir)/$(TCL_PATH)/$$i" && \ + mkdir -p "$$(dirname $$j)" && \ +@@ -122,7 +120,7 @@ distclean-local: + # instead we have a hook that enforces this in each workspace. To make su= re + # that users actually use those hooks, we point git at them here. + all-local: +- cd $(srcdir) && git config core.hooksPath ./git-hooks ++ echo "no git" + + DISTCLEANFILES =3D doxygen.log + +diff --git a/doc/Makefile.am b/doc/Makefile.am +index 67592038d..3a2e86049 100644 +--- a/doc/Makefile.am ++++ b/doc/Makefile.am +@@ -4,8 +4,3 @@ info_TEXINFOS +=3D %D%/openocd.texi + dist_man_MANS +=3D %D%/openocd.1 + + EXTRA_DIST +=3D %D%/manual +- +-MAINTAINERCLEANFILES +=3D \ +- %D%/mdate-sh \ +- %D%/stamp-vti \ +- %D%/version.texi +diff --git a/src/Makefile.am b/src/Makefile.am +index 07981aa67..98e0c98c1 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -22,14 +22,9 @@ endif + + # banner output includes RELSTR appended to $VERSION from the configure s= cript + # guess-rev.sh returns either a repository version ID or "-snapshot" +-if RELEASE + %C%_libopenocd_la_CPPFLAGS +=3D -DRELSTR=3D\"\" + %C%_libopenocd_la_CPPFLAGS +=3D -DGITVERSION=3D\"\" +-else +-%C%_libopenocd_la_CPPFLAGS +=3D -DRELSTR=3D\"`$(top_srcdir)/guess-rev.sh = $(top_srcdir)`\" +-%C%_libopenocd_la_CPPFLAGS +=3D -DGITVERSION=3D\"`cd $(top_srcdir) && git= describe`\" +-%C%_libopenocd_la_CPPFLAGS +=3D -DPKGBLDDATE=3D\"`date +%F-%R`\" +-endif ++ + + # add default CPPFLAGS + %C%_libopenocd_la_CPPFLAGS +=3D $(AM_CPPFLAGS) $(CPPFLAGS) --=20 2.28.0 --=-=-=--