Skip to content

Commit

Permalink
dev-python/leechcorepyc: add 2.14.0
Browse files Browse the repository at this point in the history
Closes: https://bugs.gentoo.org/893824
Signed-off-by: Mario Haustein <mario.haustein@hrz.tu-chemnitz.de>
  • Loading branch information
hamarituc committed Feb 25, 2023
1 parent 6148938 commit 913e6c2
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 0 deletions.
1 change: 1 addition & 0 deletions dev-python/leechcorepyc/Manifest
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
DIST leechcorepyc-2.13.0.tar.gz 123152 BLAKE2B 8a3ae5b0f0d52296ef71bbbea5140f9dec6abd379ae2a1b0e3a418090a11e5196731b1c4cba5320d4058c562911366cc9dd84f3a30f58ddc7c66362a9b39af8f SHA512 1420f635bebafe1e07cb5f0ade3e6b141433d4a72ec165713f959dc19e05f42a86440c5c99dd5d759aee221ee478e91e7161541cebe11be6dfa286fad79843ae
DIST leechcorepyc-2.14.0.tar.gz 124463 BLAKE2B 26b7581da76ab3f8981e956ab2f64de2094cc906788455e38784fb50dbad31b8b14de2f510cb49b9c1e842e2a66effd44a2db94cb6ef9e7ec9f11c3af0d9434c SHA512 c7d1d50727023f6b34bbc9682dba9bc70ae69962dcd5c326612a0dcd48a2a90ecfe674391559271d65d7720d755edde02342fb999e53ad54f8095c589060b901
13 changes: 13 additions & 0 deletions dev-python/leechcorepyc/files/leechcorepyc-2.14.0-cflags.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Bug: https://bugs.gentoo.org/893824
--- a/leechcore/Makefile
+++ b/leechcore/Makefile
@@ -6,7 +6,8 @@
# CFLAGS += -fsanitize=address -fsanitize=leak -fno-omit-frame-pointer -fsanitize=undefined -fsanitize=bounds-strict -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow
# CFLAGS += -fsanitize=pointer-compare -fsanitize=pointer-subtract -fanalyzer
# DEBUG FLAGS ABOVE
-CFLAGS += -fPIE -fPIC -pie -fstack-protector -D_FORTIFY_SOURCE=2 -O1 -Wl,-z,noexecstack
+CFLAGS := -D_FORTIFY_SOURCE=2 ${CFLAGS}
+CFLAGS += -fPIE -fPIC -pie -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
38 changes: 38 additions & 0 deletions dev-python/leechcorepyc/files/leechcorepyc-2.14.0-respect-CC.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
--- a/leechcore/Makefile
+++ b/leechcore/Makefile
@@ -1,5 +1,6 @@
-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`
# DEBUG FLAGS BELOW
# export ASAN_OPTIONS=strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:detect_invalid_pointer_pairs=2
# CFLAGS += -g -O0 -Wextra -Wno-unused-parameter -Wno-cast-function-type
--- 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 =
--- 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 =
--- 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
35 changes: 35 additions & 0 deletions dev-python/leechcorepyc/leechcorepyc-2.14.0.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{9..11} )

inherit distutils-r1 toolchain-funcs

DESCRIPTION="Python binding for LeechCore Physical Memory Acquisition Library"
HOMEPAGE="https://github.com/ufrisk/LeechCore"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"

# leechcorepyc ships with a bundled version of the LeechCore library. So we
# don't depend on the library here. But we must be aware this module doesn't
# use the system library.
DEPEND="virtual/libusb:="
RDEPEND="${DEPEND}"
BDEPEND="virtual/pkgconfig"

PATCHES=(
"${FILESDIR}/${PN}-2.14.0-respect-CC.patch"
"${FILESDIR}/${PN}-2.14.0-cflags.patch"
)

src_configure() {
tc-export CC

distutils-r1_src_configure
}

0 comments on commit 913e6c2

Please sign in to comment.