From 281cc60b6ef9be6cb3bcd889e422b5bc64ab8eba Mon Sep 17 00:00:00 2001 From: Sam James Date: Tue, 5 Apr 2022 04:31:29 +0100 Subject: dev-python/leechcorepyc: respect CC; use PEP517 Signed-off-by: Sam James --- .../files/leechcorepyc-2.10.2-respect-CC.patch | 49 ++++++++++++++++++++++ dev-python/leechcorepyc/leechcorepyc-2.10.2.ebuild | 21 +++++++--- 2 files changed, 64 insertions(+), 6 deletions(-) create mode 100644 dev-python/leechcorepyc/files/leechcorepyc-2.10.2-respect-CC.patch (limited to 'dev-python/leechcorepyc') diff --git a/dev-python/leechcorepyc/files/leechcorepyc-2.10.2-respect-CC.patch b/dev-python/leechcorepyc/files/leechcorepyc-2.10.2-respect-CC.patch new file mode 100644 index 000000000000..62c5669ae6c1 --- /dev/null +++ b/dev-python/leechcorepyc/files/leechcorepyc-2.10.2-respect-CC.patch @@ -0,0 +1,49 @@ +diff --git a/leechcore/Makefile b/leechcore/Makefile +index 4f4ff0f..bb04781 100755 +--- a/leechcore/Makefile ++++ b/leechcore/Makefile +@@ -1,7 +1,8 @@ +-CC=gcc +-CFLAGS += -I. -D LINUX -D _GNU_SOURCE -shared -fPIC -fvisibility=hidden -pthread `pkg-config libusb-1.0 --libs --cflags` ++CC?=gcc ++PKG_CONFIG ?= pkg-config ++CFLAGS += -I. -D LINUX -D _GNU_SOURCE -shared -fPIC -fvisibility=hidden -pthread `$(PKG_CONFIG) libusb-1.0 --libs --cflags` + #CFLAGS += -g -O0 +-CFLAGS += -fPIE -fPIC -pie -fstack-protector -D_FORTIFY_SOURCE=2 -O1 -Wl,-z,noexecstack ++CFLAGS += -fPIE -fPIC -pie -D_FORTIFY_SOURCE=2 -Wl,-z,noexecstack + CFLAGS += -Wall -Wno-unused-result -Wno-unused-variable -Wno-unused-value -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast + LDFLAGS += -g -ldl -shared + DEPS = leechcore.h +diff --git a/leechcore_device_rawtcp/Makefile b/leechcore_device_rawtcp/Makefile +index 6ce9a8b..b3e7990 100755 +--- a/leechcore_device_rawtcp/Makefile ++++ b/leechcore_device_rawtcp/Makefile +@@ -1,4 +1,4 @@ +-CC=gcc ++CC?=gcc + CFLAGS += -I. -I../includes -D LINUX -shared -fPIC -fvisibility=hidden + LDFLAGS += -g -shared + DEPS = +diff --git a/leechcore_device_sp605tcp/Makefile b/leechcore_device_sp605tcp/Makefile +index b3e4db4..f727c04 100755 +--- a/leechcore_device_sp605tcp/Makefile ++++ b/leechcore_device_sp605tcp/Makefile +@@ -1,4 +1,4 @@ +-CC=gcc ++CC?=gcc + CFLAGS += -I. -I../includes -D LINUX -shared -fPIC -fvisibility=hidden + LDFLAGS += -g -shared + DEPS = +diff --git a/leechcore_ft601_driver_linux/Makefile b/leechcore_ft601_driver_linux/Makefile +index 7afbf33..6b62aa8 100755 +--- a/leechcore_ft601_driver_linux/Makefile ++++ b/leechcore_ft601_driver_linux/Makefile +@@ -1,5 +1,6 @@ +-CC=gcc +-CFLAGS += -I. -D LINUX -shared -fPIC -fvisibility=hidden `pkg-config libusb-1.0 --libs --cflags` ++CC?=gcc ++PKG_CONFIG ?= pkg-config ++CFLAGS += -I. -D LINUX -shared -fPIC -fvisibility=hidden `$(PKG_CONFIG) libusb-1.0 --libs --cflags` + LDFLAGS += -g -shared + DEPS = leechcore_ft601_driver_linux.h + OBJ = fpga_libusb.o leechcore_ft601_driver_linux.o diff --git a/dev-python/leechcorepyc/leechcorepyc-2.10.2.ebuild b/dev-python/leechcorepyc/leechcorepyc-2.10.2.ebuild index 3dcfe7dbd0a1..fc294ddf5e5b 100644 --- a/dev-python/leechcorepyc/leechcorepyc-2.10.2.ebuild +++ b/dev-python/leechcorepyc/leechcorepyc-2.10.2.ebuild @@ -3,9 +3,10 @@ EAPI=8 +DISTUTILS_USE_PEP517=setuptools PYTHON_COMPAT=( python3_{8..10} ) -inherit distutils-r1 +inherit distutils-r1 toolchain-funcs DESCRIPTION="Python binding for LeechCore Physical Memory Acquisition Library" HOMEPAGE="https://github.com/ufrisk/LeechCore" @@ -18,9 +19,17 @@ SLOT="0" # leechcorepyc ships with a bundled version of the LeechCore library. So we # dont't depend on the library here. But we must be aware this module doesn't # use the system library. - DEPEND="virtual/libusb:=" -RDEPEND=" - ${DEPEND} - ${PYTHON_DEPS} -" +RDEPEND="${DEPEND} + ${PYTHON_DEPS}" +BDEPEND="virtual/pkgconfig" + +PATCHES=( + "${FILESDIR}"/${PN}-2.10.2-respect-CC.patch +) + +src_configure() { + tc-export CC + + distutils-r1_src_configure +} -- cgit v1.2.3-65-gdbad