From ee20760e9522e473d37534087acdcdb0cfb468ab Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Sat, 13 Jul 2024 01:10:22 -0400 Subject: [PATCH 1/2] common/hooks/pre-configure/02-script-wrapper: genericise pkg-config wrapper motionplus hardcodes pkgconf in several places in the configure script, which breaks on cross. --- common/hooks/pre-configure/02-script-wrapper.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/common/hooks/pre-configure/02-script-wrapper.sh b/common/hooks/pre-configure/02-script-wrapper.sh index 004c68442c061c..64619179af69b3 100644 --- a/common/hooks/pre-configure/02-script-wrapper.sh +++ b/common/hooks/pre-configure/02-script-wrapper.sh @@ -80,21 +80,22 @@ _EOF } pkgconfig_wrapper() { - if [ ! -x /usr/bin/pkg-config ]; then + local pc_bin="$1" + if [ ! -x "/usr/bin/${pc_bin}" ]; then return 0 fi - [ -x ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-pkg-config ] && return 0 - cat >>${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-pkg-config<<_EOF + [ -x "${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-${pc_bin}" ] && return 0 + cat >>"${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-${pc_bin}"<<_EOF #!/bin/sh export PKG_CONFIG_SYSROOT_DIR="$XBPS_CROSS_BASE" export PKG_CONFIG_PATH="$XBPS_CROSS_BASE/usr/lib/pkgconfig:$XBPS_CROSS_BASE/usr/share/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}" export PKG_CONFIG_LIBDIR="$XBPS_CROSS_BASE/usr/lib/pkgconfig\${PKG_CONFIG_LIBDIR:+:\${PKG_CONFIG_LIBDIR}}" -exec /usr/bin/pkg-config "\$@" +exec /usr/bin/${pc_bin} "\$@" _EOF - chmod 755 ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-pkg-config + chmod 755 "${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-${pc_bin}" if [ -z "$no_generic_pkgconfig_link" ]; then - ln -sf ${XBPS_CROSS_TRIPLET}-pkg-config ${XBPS_WRAPPERDIR}/pkg-config + ln -sf "${XBPS_CROSS_TRIPLET}-${pc_bin}" "${XBPS_WRAPPERDIR}/${pc_bin}" fi } @@ -192,7 +193,8 @@ hook() { [ -z "$CROSS_BUILD" ] && return 0 install_cross_wrappers - pkgconfig_wrapper + pkgconfig_wrapper pkg-config + pkgconfig_wrapper pkgconf vapigen_wrapper valac_wrapper From eaa0aaf46f0694ac97bf7d4af1af158727d87304 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Fri, 12 Jul 2024 19:58:11 -0400 Subject: [PATCH 2/2] New package: motionplus-0.2.1 --- srcpkgs/motionplus/files/motionplus/run | 4 +++ srcpkgs/motionplus/template | 38 +++++++++++++++++++++++++ srcpkgs/motionplus/update | 1 + 3 files changed, 43 insertions(+) create mode 100644 srcpkgs/motionplus/files/motionplus/run create mode 100644 srcpkgs/motionplus/template create mode 100644 srcpkgs/motionplus/update diff --git a/srcpkgs/motionplus/files/motionplus/run b/srcpkgs/motionplus/files/motionplus/run new file mode 100644 index 00000000000000..b800c82be3fbdd --- /dev/null +++ b/srcpkgs/motionplus/files/motionplus/run @@ -0,0 +1,4 @@ +#!/bin/sh +exec 2>&1 +export HOME=/var/lib/motionplus +exec chpst -u _motionplus:_motionplus:audio:video motionplus -n diff --git a/srcpkgs/motionplus/template b/srcpkgs/motionplus/template new file mode 100644 index 00000000000000..00aa87fecbd278 --- /dev/null +++ b/srcpkgs/motionplus/template @@ -0,0 +1,38 @@ +# Template file for 'motionplus' +pkgname=motionplus +version=0.2.1 +revision=1 +build_style=gnu-configure +configure_args="--sysconfdir=/etc" +hostmakedepends="automake gettext-devel-tools pkgconf" +makedepends="gettext-devel libjpeg-turbo-devel libmicrohttpd-devel ffmpeg-devel + libcamera-devel libopencv-devel sqlite-devel alsa-lib-devel pulseaudio-devel + fftw-devel libwebp-devel" +short_desc="Monitor and record video signals from many types of cameras" +maintainer="classabbyamp " +license="GPL-3.0-or-later" +homepage="https://motion-project.github.io" +changelog="https://github.com/Motion-Project/motionplus/releases" +distfiles="https://github.com/Motion-Project/motionplus/archive/refs/tags/release-${version}.tar.gz" +checksum=5f1d8ba14e476e0c905dc989ad884640d1e154adcb8d7aec9e340f1c529c8bcb +conf_files="/etc/motionplus/motionplus.conf" +make_dirs="/var/lib/motionplus 755 _motionplus _motionplus" +system_accounts="_motionplus" +_motionplus_homedir="/var/lib/motionplus" +_motionplus_groups="audio,video" + +post_patch() { + vsed -i -e 's|@prefix@/etc|/etc|g' data/*.conf.in +} + +pre_configure() { + autoreconf -fi +} + +post_install() { + vmkdir usr/share/examples/motionplus + mv "${DESTDIR}"/etc/motionplus/*dist* "${DESTDIR}"/usr/share/examples/motionplus + cp "${DESTDIR}"/usr/share/examples/motionplus/motionplus-dist.conf \ + "${DESTDIR}"/etc/motionplus/motionplus.conf + vsv motionplus +} diff --git a/srcpkgs/motionplus/update b/srcpkgs/motionplus/update new file mode 100644 index 00000000000000..d309484699391d --- /dev/null +++ b/srcpkgs/motionplus/update @@ -0,0 +1 @@ +pkgname=release