From e9dd733770697e3416c7d46999beb30d3126271a Mon Sep 17 00:00:00 2001 From: Bertrand Jacquin Date: Tue, 5 Mar 2024 21:42:20 +0000 Subject: sys-firmware/gnuk: add 1.2.20, drop 1.2.19 --- ...-Always-get-version-from-the-VERSION-file.patch | 32 ------ ...2.19-build-discard-compiler-default-specs.patch | 26 ----- ...t-produce-a-dynamically-linked-position-i.patch | 24 ---- ...build-initilize-empty-MCFLAGS-and-LDFLAGS.patch | 37 ------ .../1.2.19-build-move-nostartfiles-earlier.patch | 26 ----- ...regnual-remove-duplicate-type-declaration.patch | 52 --------- ...-Always-get-version-from-the-VERSION-file.patch | 32 ++++++ ...2.20-build-discard-compiler-default-specs.patch | 26 +++++ ...t-produce-a-dynamically-linked-position-i.patch | 24 ++++ ...build-initilize-empty-MCFLAGS-and-LDFLAGS.patch | 37 ++++++ .../1.2.20-build-move-nostartfiles-earlier.patch | 26 +++++ sys-firmware/gnuk/gnuk-1.2.19.ebuild | 126 --------------------- sys-firmware/gnuk/gnuk-1.2.20.ebuild | 125 ++++++++++++++++++++ 13 files changed, 270 insertions(+), 323 deletions(-) delete mode 100644 sys-firmware/gnuk/files/1.2.19-MINOR-Always-get-version-from-the-VERSION-file.patch delete mode 100644 sys-firmware/gnuk/files/1.2.19-build-discard-compiler-default-specs.patch delete mode 100644 sys-firmware/gnuk/files/1.2.19-build-do-not-produce-a-dynamically-linked-position-i.patch delete mode 100644 sys-firmware/gnuk/files/1.2.19-build-initilize-empty-MCFLAGS-and-LDFLAGS.patch delete mode 100644 sys-firmware/gnuk/files/1.2.19-build-move-nostartfiles-earlier.patch delete mode 100644 sys-firmware/gnuk/files/1.2.19-regnual-remove-duplicate-type-declaration.patch create mode 100644 sys-firmware/gnuk/files/1.2.20-MINOR-Always-get-version-from-the-VERSION-file.patch create mode 100644 sys-firmware/gnuk/files/1.2.20-build-discard-compiler-default-specs.patch create mode 100644 sys-firmware/gnuk/files/1.2.20-build-do-not-produce-a-dynamically-linked-position-i.patch create mode 100644 sys-firmware/gnuk/files/1.2.20-build-initilize-empty-MCFLAGS-and-LDFLAGS.patch create mode 100644 sys-firmware/gnuk/files/1.2.20-build-move-nostartfiles-earlier.patch delete mode 100644 sys-firmware/gnuk/gnuk-1.2.19.ebuild create mode 100644 sys-firmware/gnuk/gnuk-1.2.20.ebuild (limited to 'sys-firmware') diff --git a/sys-firmware/gnuk/files/1.2.19-MINOR-Always-get-version-from-the-VERSION-file.patch b/sys-firmware/gnuk/files/1.2.19-MINOR-Always-get-version-from-the-VERSION-file.patch deleted file mode 100644 index 9db4e957..00000000 --- a/sys-firmware/gnuk/files/1.2.19-MINOR-Always-get-version-from-the-VERSION-file.patch +++ /dev/null @@ -1,32 +0,0 @@ -From e2ce363cd282781aab28cdb1c84c4493e57cba22 Mon Sep 17 00:00:00 2001 -From: Bertrand Jacquin -Date: Sun, 19 Feb 2017 02:18:13 +0000 -Subject: [PATCH] MINOR: Always get version from the VERSION file - ---- - src/configure | 12 +----------- - 1 file changed, 1 insertion(+), 11 deletions(-) - -diff --git a/src/configure b/src/configure -index d09cde68969b..54da932e1f27 100755 ---- a/src/configure -+++ b/src/configure -@@ -52,17 +52,7 @@ exec_prefix='${prefix}' - libexecdir='${exec_prefix}/libexec' - - # Revision number --if test -e ../.git; then -- if type git >/dev/null 2>&1; then -- REVISION=$(git describe --dirty="-modified") -- else -- # echo 'No git available, please install git' -- GIT_REVISION=$(sed -e 's/^\(.......\).*$/g\1/' "../.git/$(sed -e 's/^ref: //' ../.git/HEAD)") -- REVISION=$(cat ../VERSION)-$GIT_REVISION -- fi --else -- REVISION=$(cat ../VERSION) --fi -+REVISION=$(cat ../VERSION) - - # Process each option - for option; do diff --git a/sys-firmware/gnuk/files/1.2.19-build-discard-compiler-default-specs.patch b/sys-firmware/gnuk/files/1.2.19-build-discard-compiler-default-specs.patch deleted file mode 100644 index 972a09b2..00000000 --- a/sys-firmware/gnuk/files/1.2.19-build-discard-compiler-default-specs.patch +++ /dev/null @@ -1,26 +0,0 @@ -From b66bd970dbe4f3c9a0ccbe62debb1c8da287e13e Mon Sep 17 00:00:00 2001 -From: Bertrand Jacquin -Date: Sat, 25 Apr 2020 14:28:08 +0100 -Subject: [PATCH] build: discard compiler default specs - -This allow to overwrite any potential default specs defined in local gcc -build like stack-protector which is now enforced by more and more Linux -distributions while it should not apply in chopstx use case ---- - chopstx/rules.mk | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/chopstx/rules.mk b/chopstx/rules.mk -index 3915268418d4..c0f99a6c92e2 100644 ---- a/chopstx/rules.mk -+++ b/chopstx/rules.mk -@@ -57,6 +57,9 @@ LDFLAGS = - - ### - ifeq ($(EMULATION),) -+# Discard compiler default specs -+MCFLAGS += -specs=nosys.specs -+ - MCFLAGS += -mcpu=$(MCU) - LDFLAGS += $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) \ - -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--gc-sections diff --git a/sys-firmware/gnuk/files/1.2.19-build-do-not-produce-a-dynamically-linked-position-i.patch b/sys-firmware/gnuk/files/1.2.19-build-do-not-produce-a-dynamically-linked-position-i.patch deleted file mode 100644 index 34b5d354..00000000 --- a/sys-firmware/gnuk/files/1.2.19-build-do-not-produce-a-dynamically-linked-position-i.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 1a16da9e480c5eeb7a76d14dcbb5c92fa71febbb Mon Sep 17 00:00:00 2001 -From: Bertrand Jacquin -Date: Tue, 28 Aug 2018 21:51:26 +0100 -Subject: [PATCH] build: do not produce a dynamically linked position - independent executable - ---- - chopstx/rules.mk | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/chopstx/rules.mk b/chopstx/rules.mk -index 23d55f677f58..5ff80d86509b 100644 ---- a/chopstx/rules.mk -+++ b/chopstx/rules.mk -@@ -63,6 +63,9 @@ MCFLAGS += -specs=nosys.specs - # Do not use the standard system startup files when linking - MCFLAGS += -nostartfiles - -+# Don't produce a dynamically linked position independent executable -+MCFLAGS += -fno-pie -+ - MCFLAGS += -mcpu=$(MCU) - LDFLAGS += $(MCFLAGS) -T$(LDSCRIPT) \ - -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--gc-sections diff --git a/sys-firmware/gnuk/files/1.2.19-build-initilize-empty-MCFLAGS-and-LDFLAGS.patch b/sys-firmware/gnuk/files/1.2.19-build-initilize-empty-MCFLAGS-and-LDFLAGS.patch deleted file mode 100644 index 4669a194..00000000 --- a/sys-firmware/gnuk/files/1.2.19-build-initilize-empty-MCFLAGS-and-LDFLAGS.patch +++ /dev/null @@ -1,37 +0,0 @@ -From d9c65c613a6cccbcfd403ef00ffabccec25bf29f Mon Sep 17 00:00:00 2001 -From: Bertrand Jacquin -Date: Sat, 25 Apr 2020 14:26:46 +0100 -Subject: [PATCH] build: initilize empty MCFLAGS and LDFLAGS - -Such variables are modified later, it make it clearer to read when -variable are only appened ---- - chopstx/rules.mk | 11 +++++++---- - 1 file changed, 7 insertions(+), 4 deletions(-) - -diff --git a/chopstx/rules.mk b/chopstx/rules.mk -index 110079efdaaa..3915268418d4 100644 ---- a/chopstx/rules.mk -+++ b/chopstx/rules.mk -@@ -50,14 +50,17 @@ IINCDIR = $(patsubst %,-I%,$(INCDIR)) - LLIBDIR = $(patsubst %,-L%,$(LIBDIR)) - - VPATH = $(sort $(dir $(CSRC))) -+ -+# Initilize empty LDFLAGS and MCFLAGS -+MCFLAGS = -+LDFLAGS = -+ - ### - ifeq ($(EMULATION),) --MCFLAGS = -mcpu=$(MCU) --LDFLAGS = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) \ -+MCFLAGS += -mcpu=$(MCU) -+LDFLAGS += $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) \ - -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--gc-sections - else --MCFLAGS = --LDFLAGS = - DEFS += -D_GNU_SOURCE - endif - diff --git a/sys-firmware/gnuk/files/1.2.19-build-move-nostartfiles-earlier.patch b/sys-firmware/gnuk/files/1.2.19-build-move-nostartfiles-earlier.patch deleted file mode 100644 index fcee56ee..00000000 --- a/sys-firmware/gnuk/files/1.2.19-build-move-nostartfiles-earlier.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 81395c4dcecf24a273184862a95c422576228978 Mon Sep 17 00:00:00 2001 -From: Bertrand Jacquin -Date: Sat, 25 Apr 2020 14:40:36 +0100 -Subject: [PATCH] build: move -nostartfiles earlier - ---- - chopstx/rules.mk | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/chopstx/rules.mk b/chopstx/rules.mk -index c0f99a6c92e2..23d55f677f58 100644 ---- a/chopstx/rules.mk -+++ b/chopstx/rules.mk -@@ -60,8 +60,11 @@ ifeq ($(EMULATION),) - # Discard compiler default specs - MCFLAGS += -specs=nosys.specs - -+# Do not use the standard system startup files when linking -+MCFLAGS += -nostartfiles -+ - MCFLAGS += -mcpu=$(MCU) --LDFLAGS += $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) \ -+LDFLAGS += $(MCFLAGS) -T$(LDSCRIPT) \ - -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--gc-sections - else - DEFS += -D_GNU_SOURCE diff --git a/sys-firmware/gnuk/files/1.2.19-regnual-remove-duplicate-type-declaration.patch b/sys-firmware/gnuk/files/1.2.19-regnual-remove-duplicate-type-declaration.patch deleted file mode 100644 index 2a71c06f..00000000 --- a/sys-firmware/gnuk/files/1.2.19-regnual-remove-duplicate-type-declaration.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 23417e8a848344b2fc4865fa256db95684adbfe3 Mon Sep 17 00:00:00 2001 -From: Bertrand Jacquin -Date: Sun, 20 Mar 2022 13:51:32 +0000 -Subject: [PATCH] regnual: remove duplicate type declaration -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - - In file included from regnual.c:31: - types.h:1:23: error: conflicting types for ‘size_t’; have ‘long unsigned int’ - 1 | typedef unsigned long size_t; - | ^~~~~~ - In file included from /usr/arm-none-eabi/include/sys/reent.h:14, - from /usr/arm-none-eabi/include/string.h:11, - from regnual.c:29: - /usr/lib/gcc/arm-none-eabi/11.2.1/include/stddef.h:209:23: note: previous declaration of ‘size_t’ with type ‘size_t’ {aka ‘unsigned int’} - 209 | typedef __SIZE_TYPE__ size_t; - | ---- - regnual/regnual.c | 2 -- - regnual/types.h | 4 ---- - 2 files changed, 6 deletions(-) - -diff --git a/regnual/regnual.c b/regnual/regnual.c -index e296d51bc53e..fbc6064874ac 100644 ---- a/regnual/regnual.c -+++ b/regnual/regnual.c -@@ -32,8 +32,6 @@ - #include "usb_lld.h" - #include "sys.h" - --extern void *memset (void *s, int c, size_t n); -- - extern void set_led (int); - extern int flash_write (uint32_t dst_addr, const uint8_t *src, size_t len); - extern int flash_protect (void); -diff --git a/regnual/types.h b/regnual/types.h -index 6527e0ba206c..0f70f97d0556 100644 ---- a/regnual/types.h -+++ b/regnual/types.h -@@ -1,5 +1,3 @@ --typedef unsigned long size_t; -- - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned int uint32_t; -@@ -7,5 +5,3 @@ typedef unsigned int uintptr_t; - - #define TRUE 1 - #define FALSE 0 -- --#define NULL 0 diff --git a/sys-firmware/gnuk/files/1.2.20-MINOR-Always-get-version-from-the-VERSION-file.patch b/sys-firmware/gnuk/files/1.2.20-MINOR-Always-get-version-from-the-VERSION-file.patch new file mode 100644 index 00000000..9db4e957 --- /dev/null +++ b/sys-firmware/gnuk/files/1.2.20-MINOR-Always-get-version-from-the-VERSION-file.patch @@ -0,0 +1,32 @@ +From e2ce363cd282781aab28cdb1c84c4493e57cba22 Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Sun, 19 Feb 2017 02:18:13 +0000 +Subject: [PATCH] MINOR: Always get version from the VERSION file + +--- + src/configure | 12 +----------- + 1 file changed, 1 insertion(+), 11 deletions(-) + +diff --git a/src/configure b/src/configure +index d09cde68969b..54da932e1f27 100755 +--- a/src/configure ++++ b/src/configure +@@ -52,17 +52,7 @@ exec_prefix='${prefix}' + libexecdir='${exec_prefix}/libexec' + + # Revision number +-if test -e ../.git; then +- if type git >/dev/null 2>&1; then +- REVISION=$(git describe --dirty="-modified") +- else +- # echo 'No git available, please install git' +- GIT_REVISION=$(sed -e 's/^\(.......\).*$/g\1/' "../.git/$(sed -e 's/^ref: //' ../.git/HEAD)") +- REVISION=$(cat ../VERSION)-$GIT_REVISION +- fi +-else +- REVISION=$(cat ../VERSION) +-fi ++REVISION=$(cat ../VERSION) + + # Process each option + for option; do diff --git a/sys-firmware/gnuk/files/1.2.20-build-discard-compiler-default-specs.patch b/sys-firmware/gnuk/files/1.2.20-build-discard-compiler-default-specs.patch new file mode 100644 index 00000000..972a09b2 --- /dev/null +++ b/sys-firmware/gnuk/files/1.2.20-build-discard-compiler-default-specs.patch @@ -0,0 +1,26 @@ +From b66bd970dbe4f3c9a0ccbe62debb1c8da287e13e Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Sat, 25 Apr 2020 14:28:08 +0100 +Subject: [PATCH] build: discard compiler default specs + +This allow to overwrite any potential default specs defined in local gcc +build like stack-protector which is now enforced by more and more Linux +distributions while it should not apply in chopstx use case +--- + chopstx/rules.mk | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/chopstx/rules.mk b/chopstx/rules.mk +index 3915268418d4..c0f99a6c92e2 100644 +--- a/chopstx/rules.mk ++++ b/chopstx/rules.mk +@@ -57,6 +57,9 @@ LDFLAGS = + + ### + ifeq ($(EMULATION),) ++# Discard compiler default specs ++MCFLAGS += -specs=nosys.specs ++ + MCFLAGS += -mcpu=$(MCU) + LDFLAGS += $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) \ + -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--gc-sections diff --git a/sys-firmware/gnuk/files/1.2.20-build-do-not-produce-a-dynamically-linked-position-i.patch b/sys-firmware/gnuk/files/1.2.20-build-do-not-produce-a-dynamically-linked-position-i.patch new file mode 100644 index 00000000..34b5d354 --- /dev/null +++ b/sys-firmware/gnuk/files/1.2.20-build-do-not-produce-a-dynamically-linked-position-i.patch @@ -0,0 +1,24 @@ +From 1a16da9e480c5eeb7a76d14dcbb5c92fa71febbb Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Tue, 28 Aug 2018 21:51:26 +0100 +Subject: [PATCH] build: do not produce a dynamically linked position + independent executable + +--- + chopstx/rules.mk | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/chopstx/rules.mk b/chopstx/rules.mk +index 23d55f677f58..5ff80d86509b 100644 +--- a/chopstx/rules.mk ++++ b/chopstx/rules.mk +@@ -63,6 +63,9 @@ MCFLAGS += -specs=nosys.specs + # Do not use the standard system startup files when linking + MCFLAGS += -nostartfiles + ++# Don't produce a dynamically linked position independent executable ++MCFLAGS += -fno-pie ++ + MCFLAGS += -mcpu=$(MCU) + LDFLAGS += $(MCFLAGS) -T$(LDSCRIPT) \ + -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--gc-sections diff --git a/sys-firmware/gnuk/files/1.2.20-build-initilize-empty-MCFLAGS-and-LDFLAGS.patch b/sys-firmware/gnuk/files/1.2.20-build-initilize-empty-MCFLAGS-and-LDFLAGS.patch new file mode 100644 index 00000000..4669a194 --- /dev/null +++ b/sys-firmware/gnuk/files/1.2.20-build-initilize-empty-MCFLAGS-and-LDFLAGS.patch @@ -0,0 +1,37 @@ +From d9c65c613a6cccbcfd403ef00ffabccec25bf29f Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Sat, 25 Apr 2020 14:26:46 +0100 +Subject: [PATCH] build: initilize empty MCFLAGS and LDFLAGS + +Such variables are modified later, it make it clearer to read when +variable are only appened +--- + chopstx/rules.mk | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/chopstx/rules.mk b/chopstx/rules.mk +index 110079efdaaa..3915268418d4 100644 +--- a/chopstx/rules.mk ++++ b/chopstx/rules.mk +@@ -50,14 +50,17 @@ IINCDIR = $(patsubst %,-I%,$(INCDIR)) + LLIBDIR = $(patsubst %,-L%,$(LIBDIR)) + + VPATH = $(sort $(dir $(CSRC))) ++ ++# Initilize empty LDFLAGS and MCFLAGS ++MCFLAGS = ++LDFLAGS = ++ + ### + ifeq ($(EMULATION),) +-MCFLAGS = -mcpu=$(MCU) +-LDFLAGS = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) \ ++MCFLAGS += -mcpu=$(MCU) ++LDFLAGS += $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) \ + -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--gc-sections + else +-MCFLAGS = +-LDFLAGS = + DEFS += -D_GNU_SOURCE + endif + diff --git a/sys-firmware/gnuk/files/1.2.20-build-move-nostartfiles-earlier.patch b/sys-firmware/gnuk/files/1.2.20-build-move-nostartfiles-earlier.patch new file mode 100644 index 00000000..fcee56ee --- /dev/null +++ b/sys-firmware/gnuk/files/1.2.20-build-move-nostartfiles-earlier.patch @@ -0,0 +1,26 @@ +From 81395c4dcecf24a273184862a95c422576228978 Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Sat, 25 Apr 2020 14:40:36 +0100 +Subject: [PATCH] build: move -nostartfiles earlier + +--- + chopstx/rules.mk | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/chopstx/rules.mk b/chopstx/rules.mk +index c0f99a6c92e2..23d55f677f58 100644 +--- a/chopstx/rules.mk ++++ b/chopstx/rules.mk +@@ -60,8 +60,11 @@ ifeq ($(EMULATION),) + # Discard compiler default specs + MCFLAGS += -specs=nosys.specs + ++# Do not use the standard system startup files when linking ++MCFLAGS += -nostartfiles ++ + MCFLAGS += -mcpu=$(MCU) +-LDFLAGS += $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) \ ++LDFLAGS += $(MCFLAGS) -T$(LDSCRIPT) \ + -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--gc-sections + else + DEFS += -D_GNU_SOURCE diff --git a/sys-firmware/gnuk/gnuk-1.2.19.ebuild b/sys-firmware/gnuk/gnuk-1.2.19.ebuild deleted file mode 100644 index beaa9758..00000000 --- a/sys-firmware/gnuk/gnuk-1.2.19.ebuild +++ /dev/null @@ -1,126 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 -PYTHON_COMPAT=( python3_{9..11} ) -inherit git-r3 python-r1 udev - -DESCRIPTION="An Implementation of USB Cryptographic Token for GnuPG" -HOMEPAGE="https://www.fsij.org/category/gnuk.html" -EGIT_REPO_URI="https://salsa.debian.org/gnuk-team/${PN}/${PN}" -EGIT_COMMIT="release/${PV}" - -LICENSE="GPL-3" -SLOT="0" -KEYWORDS="~amd64" -IUSE="debug doc tools" - -DEPEND="doc? ( dev-python/sphinx )" -RDEPEND="virtual/udev - tools? ( - ${PYTHON_DEPS} - dev-python/pyusb[${PYTHON_USEDEP}] - dev-python/colorama[${PYTHON_USEDEP}] - )" -REQUIRED_USE="${PYTHON_REQUIRED_USE}" - -PATCHES=( - "${FILESDIR}/${PV}-MINOR-Always-get-version-from-the-VERSION-file.patch" - "${FILESDIR}/${PV}-build-initilize-empty-MCFLAGS-and-LDFLAGS.patch" - "${FILESDIR}/${PV}-build-discard-compiler-default-specs.patch" - "${FILESDIR}/${PV}-build-move-nostartfiles-earlier.patch" - "${FILESDIR}/${PV}-build-do-not-produce-a-dynamically-linked-position-i.patch" - "${FILESDIR}/${PV}-regnual-remove-duplicate-type-declaration.patch" -) - -pkg_pretend() { - if type -p arm-none-eabi-gcc > /dev/null 2>&1 ; then - return 0 - fi - - eerror "Before you could build the firmware, you need to install arm-none-eabi toolchain" - eerror "Run the following commands:" - eerror " emerge -vat crossdev" - eerror " crossdev --target arm-none-eabi" - die "arm-none-eabi toolchain is needed" -} - -src_prepare () { - default - - mv tool/get_raw_public_key.py "tool/${PN}-get_raw_public_key.py" || die - mv tool/gnuk_get_random.py "tool/${PN}-get_random.py" || die - mv tool/gnuk_put_binary_libusb.py "tool/${PN}-put_binary_libusb.py" || die - mv tool/gnuk_remove_keys_libusb.py "tool/${PN}-remove_keys_libusb.py" || die - mv tool/gnuk_upgrade.py "tool/${PN}-upgrade.py" || die - mv tool/stlinkv2.py "tool/${PN}-stlinkv2.py" || die - mv tool/upgrade_by_passwd.py "tool/${PN}-upgrade_by_passwd.py" || die - mv tool/usb_strings.py "tool/${PN}-usb_strings.py" || die -} - -src_configure() { - cd "${S}/src" - ./configure \ - --target=FST_01 \ - --vidpid=234b:0000 \ - --enable-certdo \ - --enable-factory-reset \ - --enable-hid-card-change \ - $(use_enable debug) \ - || die "configure failed" -} - -src_compile() { - cd "${S}/src" - emake CROSS="arm-none-eabi-" - - if use doc ; then - cd "${S}/doc" - emake html - emake man - fi - - cd "${S}/regnual" - emake TRGT="arm-none-eabi-" -} - -src_install() { - insinto "/usr/share/${PN}/firmware" - doins "src/build/${PN}.bin" - doins "regnual/regnual.bin" - - udev_dorules "${FILESDIR}/60-${PN}.rules" - - if use doc ; then - HTML_DOCS=( doc/_build/html/* ) - doman doc/_build/man/* - fi - - install_example() { - local d="$(python_get_scriptdir)" - insinto "${d#${EPREFIX}}" - doins "${1}" - } - - if use tools ; then - python_foreach_impl python_domodule tool/gnuk_token.py - python_foreach_impl python_domodule tool/gpg_agent.py - python_foreach_impl python_domodule tool/kdf_calc.py - python_foreach_impl python_domodule tool/rsa.py - - python_foreach_impl python_doscript "tool/${PN}-get_random.py" - python_foreach_impl python_doscript "tool/${PN}-get_raw_public_key.py" - python_foreach_impl python_doscript "tool/${PN}-put_binary_libusb.py" - python_foreach_impl python_doscript "tool/${PN}-remove_keys_libusb.py" - python_foreach_impl python_doscript "tool/${PN}-stlinkv2.py" - python_foreach_impl python_doscript "tool/${PN}-upgrade.py" - python_foreach_impl python_doscript "tool/${PN}-upgrade_by_passwd.py" - python_foreach_impl python_doscript "tool/${PN}-usb_strings.py" - python_foreach_impl install_example tool/rsa_example.key - - udev_dorules "${FILESDIR}/10-stlink.rules" - fi - - dodoc AUTHORS ChangeLog NEWS README THANKS - dodoc -r doc/note -} diff --git a/sys-firmware/gnuk/gnuk-1.2.20.ebuild b/sys-firmware/gnuk/gnuk-1.2.20.ebuild new file mode 100644 index 00000000..65cf5bd9 --- /dev/null +++ b/sys-firmware/gnuk/gnuk-1.2.20.ebuild @@ -0,0 +1,125 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +PYTHON_COMPAT=( python3_{10..11} ) +inherit git-r3 python-r1 udev + +DESCRIPTION="An Implementation of USB Cryptographic Token for GnuPG" +HOMEPAGE="https://www.fsij.org/category/gnuk.html" +EGIT_REPO_URI="https://salsa.debian.org/gnuk-team/${PN}/${PN}" +EGIT_COMMIT="release/${PV}" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64" +IUSE="debug doc tools" + +DEPEND="doc? ( dev-python/sphinx )" +RDEPEND="virtual/udev + tools? ( + ${PYTHON_DEPS} + dev-python/pyusb[${PYTHON_USEDEP}] + dev-python/colorama[${PYTHON_USEDEP}] + )" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +PATCHES=( + "${FILESDIR}/${PV}-MINOR-Always-get-version-from-the-VERSION-file.patch" + "${FILESDIR}/${PV}-build-initilize-empty-MCFLAGS-and-LDFLAGS.patch" + "${FILESDIR}/${PV}-build-discard-compiler-default-specs.patch" + "${FILESDIR}/${PV}-build-move-nostartfiles-earlier.patch" + "${FILESDIR}/${PV}-build-do-not-produce-a-dynamically-linked-position-i.patch" +) + +pkg_pretend() { + if type -p arm-none-eabi-gcc > /dev/null 2>&1 ; then + return 0 + fi + + eerror "Before you could build the firmware, you need to install arm-none-eabi toolchain" + eerror "Run the following commands:" + eerror " emerge -vat crossdev" + eerror " crossdev --target arm-none-eabi" + die "arm-none-eabi toolchain is needed" +} + +src_prepare () { + default + + mv tool/get_raw_public_key.py "tool/${PN}-get_raw_public_key.py" || die + mv tool/gnuk_get_random.py "tool/${PN}-get_random.py" || die + mv tool/gnuk_put_binary_libusb.py "tool/${PN}-put_binary_libusb.py" || die + mv tool/gnuk_remove_keys_libusb.py "tool/${PN}-remove_keys_libusb.py" || die + mv tool/gnuk_upgrade.py "tool/${PN}-upgrade.py" || die + mv tool/stlinkv2.py "tool/${PN}-stlinkv2.py" || die + mv tool/upgrade_by_passwd.py "tool/${PN}-upgrade_by_passwd.py" || die + mv tool/usb_strings.py "tool/${PN}-usb_strings.py" || die +} + +src_configure() { + cd "${S}/src" + ./configure \ + --target=FST_01 \ + --vidpid=234b:0000 \ + --enable-certdo \ + --enable-factory-reset \ + --enable-hid-card-change \ + $(use_enable debug) \ + || die "configure failed" +} + +src_compile() { + cd "${S}/src" + emake CROSS="arm-none-eabi-" + + if use doc ; then + cd "${S}/doc" + emake html + emake man + fi + + cd "${S}/regnual" + emake TRGT="arm-none-eabi-" +} + +src_install() { + insinto "/usr/share/${PN}/firmware" + doins "src/build/${PN}.bin" + doins "regnual/regnual.bin" + + udev_dorules "${FILESDIR}/60-${PN}.rules" + + if use doc ; then + HTML_DOCS=( doc/_build/html/* ) + doman doc/_build/man/* + fi + + install_example() { + local d="$(python_get_scriptdir)" + insinto "${d#${EPREFIX}}" + doins "${1}" + } + + if use tools ; then + python_foreach_impl python_domodule tool/gnuk_token.py + python_foreach_impl python_domodule tool/gpg_agent.py + python_foreach_impl python_domodule tool/kdf_calc.py + python_foreach_impl python_domodule tool/rsa.py + + python_foreach_impl python_doscript "tool/${PN}-get_random.py" + python_foreach_impl python_doscript "tool/${PN}-get_raw_public_key.py" + python_foreach_impl python_doscript "tool/${PN}-put_binary_libusb.py" + python_foreach_impl python_doscript "tool/${PN}-remove_keys_libusb.py" + python_foreach_impl python_doscript "tool/${PN}-stlinkv2.py" + python_foreach_impl python_doscript "tool/${PN}-upgrade.py" + python_foreach_impl python_doscript "tool/${PN}-upgrade_by_passwd.py" + python_foreach_impl python_doscript "tool/${PN}-usb_strings.py" + python_foreach_impl install_example tool/rsa_example.key + + udev_dorules "${FILESDIR}/10-stlink.rules" + fi + + dodoc AUTHORS ChangeLog NEWS README THANKS + dodoc -r doc/note +} -- cgit v1.2.3