commit:     8b7bc324cf4b17db075203d5b30692f911e4d4bc
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 17 17:47:05 2020 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Thu Dec 17 17:49:57 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8b7bc324

sys-apps/qcontrol: migrate to lua-single.eclass

Fails to build on lua5.2 and newer with "undefined reference to
lua_open", seems to be happy with LuaJIT though.

Closes: https://bugs.gentoo.org/752861
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 profiles/package.mask                        |  1 +
 sys-apps/qcontrol/qcontrol-0.4.2-r100.ebuild | 69 ++++++++++++++++++++++++++++
 2 files changed, 70 insertions(+)

diff --git a/profiles/package.mask b/profiles/package.mask
index 8625e2eefc6..fbc49e0acce 100644
--- a/profiles/package.mask
+++ b/profiles/package.mask
@@ -530,6 +530,7 @@ kde-apps/kdebase-meta:5
 =sci-visualization/gnuplot-5.4.1-r1
 >=sci-visualization/fityk-1.3.1-r100
 >=sys-apps/likwid-4.3.4
+>=sys-apps/qcontrol-0.4.2-r100
 >=sys-apps/roccat-tools-5.9.0-r100
 >=sys-cluster/slurm-20.11.0.1-r100
 >=www-apache/mod_security-2.9.3-r100

diff --git a/sys-apps/qcontrol/qcontrol-0.4.2-r100.ebuild 
b/sys-apps/qcontrol/qcontrol-0.4.2-r100.ebuild
new file mode 100644
index 00000000000..13c3d4b5faa
--- /dev/null
+++ b/sys-apps/qcontrol/qcontrol-0.4.2-r100.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+LUA_COMPAT=( lua5-1 luajit )
+
+inherit lua-single toolchain-funcs
+
+DESCRIPTION="Send commands to some microcontrollers, e.g., to change LEDs or 
sound a buzzer"
+HOMEPAGE="http://qnap.nas-central.org/index.php/PIC_Control_Software";
+SRC_URI="mirror://debian/pool/main/q/qcontrol/${P/-/_}.orig.tar.gz
+       mirror://debian/pool/main/q/qcontrol/${P/-/_}-6.diff.gz"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~arm"
+IUSE=""
+
+REQUIRED_USE="${LUA_REQUIRED_USE}"
+
+DEPEND="${LUA_DEPS}"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+       default
+
+       eapply "${WORKDIR}"/*.diff
+       eapply debian/patches/*.patch
+       eapply "${FILESDIR}"/${PV}-Makefile.patch
+
+       sed -i -e "s/LDFLAGS=/LDFLAGS ?=/" Makefile || die
+}
+
+src_compile() {
+       emake \
+               CC="$(tc-getCC)" \
+               CFLAGS="$(lua_get_CFLAGS) ${CFLAGS}" \
+               LDFLAGS="$(lua_get_LIBS) -lpthread ${LDFLAGS}" \
+               qcontrol
+}
+
+src_install() {
+       dosbin qcontrol
+       doman debian/qcontrol.1
+
+       insinto /etc/qcontrol
+       doins debian/configs/*.lua
+
+       newconfd "${FILESDIR}"/conf.d qcontrol
+       newinitd "${FILESDIR}"/init.d qcontrol
+}
+
+pkg_preinst() {
+       device=$(grep "Hardware[[:space:]]*:" /proc/cpuinfo 2>/dev/null | \
+               head -n1 | sed "s/^[^:]*: //")
+       case ${device} in
+               "QNAP TS-109/TS-209")
+               dosym qcontrol/ts209.lua /etc/qcontrol.conf ;;
+               "QNAP TS-119/TS-219")
+               dosym qcontrol/ts219.lua /etc/qcontrol.conf ;;
+               "QNAP TS-409")
+               dosym qcontrol/ts409.lua /etc/qcontrol.conf ;;
+               "QNAP TS-41x")
+               dosym qcontrol/ts41x.lua /etc/qcontrol.conf ;;
+               *)
+               ewarn "Your device is unsupported" ;;
+       esac
+}

Reply via email to