* [gentoo-commits] repo/proj/guru:dev commit in: dev-util/tinyxxd/files/, dev-util/tinyxxd/
@ 2025-07-28 10:51 Lucio Sauer
2025-07-28 11:50 ` [gentoo-commits] repo/proj/guru:master commit in: dev-util/tinyxxd/, dev-util/tinyxxd/files/ Lucio Sauer
0 siblings, 1 reply; 2+ messages in thread
From: Lucio Sauer @ 2025-07-28 10:51 UTC (permalink / raw
To: gentoo-commits
commit: 00aef8922896da2c6c9feb411167afb7316fbaa8
Author: Lucio Sauer <watermanpaint <AT> posteo <DOT> net>
AuthorDate: Mon Jul 28 10:26:55 2025 +0000
Commit: Lucio Sauer <watermanpaint <AT> posteo <DOT> net>
CommitDate: Mon Jul 28 10:51:05 2025 +0000
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=00aef892
dev-util/tinyxxd: respect user variables and add tests
The ebuild now properly honors CC, CFLAGS, LDFLAGS, EPREFIX.
Signed-off-by: Lucio Sauer <watermanpaint <AT> posteo.net>
.../tinyxxd/files/tinyxxd-1.3.7-fix-flags.patch | 30 ++++++++++++++++++++++
dev-util/tinyxxd/tinyxxd-1.3.7-r2.ebuild | 17 +++++++++++-
dev-util/tinyxxd/tinyxxd-9999.ebuild | 17 +++++++++++-
3 files changed, 62 insertions(+), 2 deletions(-)
diff --git a/dev-util/tinyxxd/files/tinyxxd-1.3.7-fix-flags.patch b/dev-util/tinyxxd/files/tinyxxd-1.3.7-fix-flags.patch
new file mode 100644
index 0000000000..6bcbb12381
--- /dev/null
+++ b/dev-util/tinyxxd/files/tinyxxd-1.3.7-fix-flags.patch
@@ -0,0 +1,30 @@
+Keep upstream's important CFLAGS and macros and respect LDFLAGS. Omit those
+which the toolchain sets for us:
+https://wiki.gentoo.org/wiki/Hardened/Toolchain#Changes
+
+From: Lucio Sauer <watermanpaint@posteo.net>
+--- a/Makefile
++++ b/Makefile
+@@ -2,13 +2,6 @@
+
+ CFLAGS ?= -std=c11 -O2 -pipe -finline-functions -fPIC -Wall -Wextra -Wpedantic -Wfatal-errors
+ UNAME_S := $(shell uname -s)
+-ifeq ($(UNAME_S),Darwin)
+- CFLAGS += -fstack-protector-strong -D_GNU_SOURCE -fno-plt
+-else ifeq ($(OS),Windows_NT)
+- CFLAGS += -D_WIN32
+-else
+- CFLAGS += -fstack-protector-strong -D_GNU_SOURCE -fno-plt -Wl,-z,now
+-endif
+
+ PREFIX ?= /usr
+ BINDIR ?= $(PREFIX)/bin
+@@ -20,7 +13,7 @@
+ RELEASE_FILES := main.c Makefile COPYING README.md
+
+ tinyxxd: main.c
+- $(CC) $(CFLAGS) -o $@ $<
++ $(CC) $(CFLAGS) -std=c11 -D_GNU_SOURCE $(LDFLAGS) -o $@ $<
+
+ tinyxxd_debug: main.c
+ $(CC) $(CFLAGS) -g -o $@ $<
diff --git a/dev-util/tinyxxd/tinyxxd-1.3.7-r2.ebuild b/dev-util/tinyxxd/tinyxxd-1.3.7-r2.ebuild
index 6161c99c59..24c7d2ab5e 100644
--- a/dev-util/tinyxxd/tinyxxd-1.3.7-r2.ebuild
+++ b/dev-util/tinyxxd/tinyxxd-1.3.7-r2.ebuild
@@ -3,6 +3,8 @@
EAPI=8
+inherit edo toolchain-funcs
+
DESCRIPTION="Drop-in replacement and standalone version of xxd"
HOMEPAGE="https://github.com/xyproto/tinyxxd"
if [[ ${PV} == *9999* ]]; then
@@ -21,8 +23,21 @@ IUSE="xxd"
RDEPEND="xxd? ( !dev-util/xxd !app-editors/vim-core )"
+PATCHES=( "${FILESDIR}"/${P}-fix-flags.patch )
+
+src_compile() {
+ export CFLAGS LDFLAGS
+ tc-export CC
+ emake
+}
+
+src_test() {
+ edo ./testfiles/test13.sh
+ edo ./testfiles/test14.sh
+}
+
src_install(){
- default
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}"/usr install
if use xxd; then
dosym -r /usr/bin/tinyxxd /usr/bin/xxd
fi
diff --git a/dev-util/tinyxxd/tinyxxd-9999.ebuild b/dev-util/tinyxxd/tinyxxd-9999.ebuild
index 6161c99c59..15a85adb05 100644
--- a/dev-util/tinyxxd/tinyxxd-9999.ebuild
+++ b/dev-util/tinyxxd/tinyxxd-9999.ebuild
@@ -3,6 +3,8 @@
EAPI=8
+inherit edo toolchain-funcs
+
DESCRIPTION="Drop-in replacement and standalone version of xxd"
HOMEPAGE="https://github.com/xyproto/tinyxxd"
if [[ ${PV} == *9999* ]]; then
@@ -21,8 +23,21 @@ IUSE="xxd"
RDEPEND="xxd? ( !dev-util/xxd !app-editors/vim-core )"
+PATCHES=( "${FILESDIR}"/${PN}-1.3.7-fix-flags.patch )
+
+src_compile() {
+ export CFLAGS LDFLAGS
+ tc-export CC
+ emake
+}
+
+src_test() {
+ edo ./testfiles/test13.sh
+ edo ./testfiles/test14.sh
+}
+
src_install(){
- default
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}"/usr install
if use xxd; then
dosym -r /usr/bin/tinyxxd /usr/bin/xxd
fi
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/proj/guru:master commit in: dev-util/tinyxxd/, dev-util/tinyxxd/files/
2025-07-28 10:51 [gentoo-commits] repo/proj/guru:dev commit in: dev-util/tinyxxd/files/, dev-util/tinyxxd/ Lucio Sauer
@ 2025-07-28 11:50 ` Lucio Sauer
0 siblings, 0 replies; 2+ messages in thread
From: Lucio Sauer @ 2025-07-28 11:50 UTC (permalink / raw
To: gentoo-commits
commit: 00aef8922896da2c6c9feb411167afb7316fbaa8
Author: Lucio Sauer <watermanpaint <AT> posteo <DOT> net>
AuthorDate: Mon Jul 28 10:26:55 2025 +0000
Commit: Lucio Sauer <watermanpaint <AT> posteo <DOT> net>
CommitDate: Mon Jul 28 10:51:05 2025 +0000
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=00aef892
dev-util/tinyxxd: respect user variables and add tests
The ebuild now properly honors CC, CFLAGS, LDFLAGS, EPREFIX.
Signed-off-by: Lucio Sauer <watermanpaint <AT> posteo.net>
.../tinyxxd/files/tinyxxd-1.3.7-fix-flags.patch | 30 ++++++++++++++++++++++
dev-util/tinyxxd/tinyxxd-1.3.7-r2.ebuild | 17 +++++++++++-
dev-util/tinyxxd/tinyxxd-9999.ebuild | 17 +++++++++++-
3 files changed, 62 insertions(+), 2 deletions(-)
diff --git a/dev-util/tinyxxd/files/tinyxxd-1.3.7-fix-flags.patch b/dev-util/tinyxxd/files/tinyxxd-1.3.7-fix-flags.patch
new file mode 100644
index 0000000000..6bcbb12381
--- /dev/null
+++ b/dev-util/tinyxxd/files/tinyxxd-1.3.7-fix-flags.patch
@@ -0,0 +1,30 @@
+Keep upstream's important CFLAGS and macros and respect LDFLAGS. Omit those
+which the toolchain sets for us:
+https://wiki.gentoo.org/wiki/Hardened/Toolchain#Changes
+
+From: Lucio Sauer <watermanpaint@posteo.net>
+--- a/Makefile
++++ b/Makefile
+@@ -2,13 +2,6 @@
+
+ CFLAGS ?= -std=c11 -O2 -pipe -finline-functions -fPIC -Wall -Wextra -Wpedantic -Wfatal-errors
+ UNAME_S := $(shell uname -s)
+-ifeq ($(UNAME_S),Darwin)
+- CFLAGS += -fstack-protector-strong -D_GNU_SOURCE -fno-plt
+-else ifeq ($(OS),Windows_NT)
+- CFLAGS += -D_WIN32
+-else
+- CFLAGS += -fstack-protector-strong -D_GNU_SOURCE -fno-plt -Wl,-z,now
+-endif
+
+ PREFIX ?= /usr
+ BINDIR ?= $(PREFIX)/bin
+@@ -20,7 +13,7 @@
+ RELEASE_FILES := main.c Makefile COPYING README.md
+
+ tinyxxd: main.c
+- $(CC) $(CFLAGS) -o $@ $<
++ $(CC) $(CFLAGS) -std=c11 -D_GNU_SOURCE $(LDFLAGS) -o $@ $<
+
+ tinyxxd_debug: main.c
+ $(CC) $(CFLAGS) -g -o $@ $<
diff --git a/dev-util/tinyxxd/tinyxxd-1.3.7-r2.ebuild b/dev-util/tinyxxd/tinyxxd-1.3.7-r2.ebuild
index 6161c99c59..24c7d2ab5e 100644
--- a/dev-util/tinyxxd/tinyxxd-1.3.7-r2.ebuild
+++ b/dev-util/tinyxxd/tinyxxd-1.3.7-r2.ebuild
@@ -3,6 +3,8 @@
EAPI=8
+inherit edo toolchain-funcs
+
DESCRIPTION="Drop-in replacement and standalone version of xxd"
HOMEPAGE="https://github.com/xyproto/tinyxxd"
if [[ ${PV} == *9999* ]]; then
@@ -21,8 +23,21 @@ IUSE="xxd"
RDEPEND="xxd? ( !dev-util/xxd !app-editors/vim-core )"
+PATCHES=( "${FILESDIR}"/${P}-fix-flags.patch )
+
+src_compile() {
+ export CFLAGS LDFLAGS
+ tc-export CC
+ emake
+}
+
+src_test() {
+ edo ./testfiles/test13.sh
+ edo ./testfiles/test14.sh
+}
+
src_install(){
- default
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}"/usr install
if use xxd; then
dosym -r /usr/bin/tinyxxd /usr/bin/xxd
fi
diff --git a/dev-util/tinyxxd/tinyxxd-9999.ebuild b/dev-util/tinyxxd/tinyxxd-9999.ebuild
index 6161c99c59..15a85adb05 100644
--- a/dev-util/tinyxxd/tinyxxd-9999.ebuild
+++ b/dev-util/tinyxxd/tinyxxd-9999.ebuild
@@ -3,6 +3,8 @@
EAPI=8
+inherit edo toolchain-funcs
+
DESCRIPTION="Drop-in replacement and standalone version of xxd"
HOMEPAGE="https://github.com/xyproto/tinyxxd"
if [[ ${PV} == *9999* ]]; then
@@ -21,8 +23,21 @@ IUSE="xxd"
RDEPEND="xxd? ( !dev-util/xxd !app-editors/vim-core )"
+PATCHES=( "${FILESDIR}"/${PN}-1.3.7-fix-flags.patch )
+
+src_compile() {
+ export CFLAGS LDFLAGS
+ tc-export CC
+ emake
+}
+
+src_test() {
+ edo ./testfiles/test13.sh
+ edo ./testfiles/test14.sh
+}
+
src_install(){
- default
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}"/usr install
if use xxd; then
dosym -r /usr/bin/tinyxxd /usr/bin/xxd
fi
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-07-28 11:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-28 10:51 [gentoo-commits] repo/proj/guru:dev commit in: dev-util/tinyxxd/files/, dev-util/tinyxxd/ Lucio Sauer
2025-07-28 11:50 ` [gentoo-commits] repo/proj/guru:master commit in: dev-util/tinyxxd/, dev-util/tinyxxd/files/ Lucio Sauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox