Skip to content

Commit

Permalink
Merge pull request #9657 from HungerHa/le12-system-tools-gpiod
Browse files Browse the repository at this point in the history
[le12] system-tools: add gpiod support (take over from rpi-tools)
  • Loading branch information
HiassofT authored Jan 9, 2025
2 parents 8fa330d + 7df85cf commit 2354878
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 35 deletions.
16 changes: 14 additions & 2 deletions packages/addons/addon-depends/libgpiod/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,21 @@ PKG_SHA256="ae35329db7027c740e90c883baf27c26311f0614e6a7b115771b28188b992aec"
PKG_LICENSE="GPLv2+"
PKG_SITE="https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/about/"
PKG_URL="https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/snapshot/libgpiod-${PKG_VERSION}.tar.gz"
PKG_DEPENDS_TARGET="toolchain"
PKG_DEPENDS_TARGET="toolchain Python3 distutilscross:host"
PKG_LONGDESC="Tools for interacting with the linux GPIO character device."
PKG_TOOLCHAIN="autotools"
PKG_BUILD_FLAGS="+pic"
PKG_BUILD_FLAGS="+pic -sysroot"

PKG_CONFIGURE_OPTS_TARGET="--enable-tools --disable-shared"

post_make_target() {
(
export PYTHONXCPREFIX="${SYSROOT_PREFIX}/usr"
export LDFLAGS+=" -L${PKG_BUILD}/.${TARGET_NAME}/lib/.libs"
export LDSHARED="${CC} -shared"
export CFLAGS+=" -fcommon -I${PKG_BUILD}/include"
export CPPFLAGS="${TARGET_CPPFLAGS} -I${SYSROOT_PREFIX}/usr/include/${PKG_PYTHON_VERSION}"
cd ../bindings/python
python3 setup.py build
)
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
--- gpiod/setup.py.org 2024-11-12 14:29:25.000000000 +0100
+++ gpiod/setup.py 2024-12-09 20:44:57.736065397 +0100
--- a/bindings/python/setup.py 2024-11-12 14:29:25.000000000 +0100
+++ b/bindings/python/setup.py 2025-01-05 17:00:00.000000000 +0100
@@ -8,7 +8,7 @@
from setuptools.command.build_ext import build_ext as orig_build_ext
from setuptools.command.sdist import log
from setuptools.command.sdist import sdist as orig_sdist
-from setuptools.errors import BaseError
+#from setuptools.errors import BaseError
+from distutils.errors import DistutilsError as BaseError

LINK_SYSTEM_LIBGPIOD = getenv("LINK_SYSTEM_LIBGPIOD") == "1"
LIBGPIOD_MINIMUM_VERSION = "2.1"
24 changes: 0 additions & 24 deletions packages/addons/addon-depends/rpi-tools-depends/gpiod/package.mk

This file was deleted.

8 changes: 3 additions & 5 deletions packages/addons/tools/rpi-tools/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

PKG_NAME="rpi-tools"
PKG_VERSION="1.0"
PKG_REV="1"
PKG_REV="2"
PKG_ARCH="arm aarch64"
PKG_LICENSE="GPL"
PKG_SITE="https://libreelec.tv"
PKG_URL=""
PKG_DEPENDS_TARGET="toolchain lg-gpio gpiod gpiozero colorzero lan951x-led-ctl"
PKG_DEPENDS_TARGET="toolchain lg-gpio gpiozero colorzero lan951x-led-ctl"
PKG_SECTION="virtual"
PKG_SHORTDESC="A bundle of tools and programs for use on the Raspberry Pi"
PKG_LONGDESC="This bundle currently includes lg-gpio, gpiod, gpiozero and lan951x-led-ctl"
PKG_LONGDESC="This bundle currently includes lg-gpio, gpiozero and lan951x-led-ctl"
PKG_DISCAIMER="Raspberry Pi is a trademark of the Raspberry Pi Foundation http://www.raspberrypi.org"

PKG_IS_ADDON="yes"
Expand All @@ -25,8 +25,6 @@ addon() {
cp -PR $(get_build_dir lg-gpio)/liblgpio.so* ${ADDON_BUILD}/${PKG_ADDON_ID}/lib/
cp -PR $(get_build_dir lg-gpio)/PY_LGPIO/build/lib.linux*/* ${ADDON_BUILD}/${PKG_ADDON_ID}/lib/
patchelf --add-rpath '$ORIGIN' ${ADDON_BUILD}/${PKG_ADDON_ID}/lib/_lgpio*.so
cp -PR $(get_build_dir gpiod)/build/lib.linux*/* ${ADDON_BUILD}/${PKG_ADDON_ID}/lib/
patchelf --add-rpath '$ORIGIN' ${ADDON_BUILD}/${PKG_ADDON_ID}/lib/gpiod/_ext*.so
cp -PR $(get_build_dir gpiozero)/gpiozero ${ADDON_BUILD}/${PKG_ADDON_ID}/lib/
cp -PR $(get_build_dir colorzero)/colorzero ${ADDON_BUILD}/${PKG_ADDON_ID}/lib/

Expand Down
3 changes: 2 additions & 1 deletion packages/addons/tools/system-tools/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

PKG_NAME="system-tools"
PKG_VERSION="1.0"
PKG_REV="6"
PKG_REV="7"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="https://libreelec.tv"
Expand Down Expand Up @@ -137,6 +137,7 @@ addon() {

# libgpiod
cp -P $(get_install_dir libgpiod)/usr/bin/{gpiodetect,gpioget,gpioinfo,gpiomon,gpioset} ${ADDON_BUILD}/${PKG_ADDON_ID}/bin
cp -PR $(get_build_dir libgpiod)/bindings/python/build/lib.linux*/* ${ADDON_BUILD}/${PKG_ADDON_ID}/lib/

# lm_sensors
cp -P $(get_install_dir lm_sensors)/usr/bin/sensors ${ADDON_BUILD}/${PKG_ADDON_ID}/bin 2>/dev/null || :
Expand Down

0 comments on commit 2354878

Please sign in to comment.