Skip to content

Commit

Permalink
app-misc/g15daemon: Revbumps / ebuild overhauls
Browse files Browse the repository at this point in the history
- EAPI-7 bump
- Added workaround for successful build with gcc-10 (#706712)
- Fixed default config (#481454)
- Fixed docdir
- Attempt to fix direct call of CC (#729294)
- Removed bashisms from configure

Bug: https://bugs.gentoo.org/729294
Bug: https://bugs.gentoo.org/741382
Closes: https://bugs.gentoo.org/481454
Closes: https://bugs.gentoo.org/706712
Package-Manager: Portage-3.0.6, Repoman-3.0.1
Signed-off-by: Lars Wendler <[email protected]>
  • Loading branch information
Lars Wendler committed Sep 9, 2020
1 parent fbfcdcc commit 32f13dc
Show file tree
Hide file tree
Showing 9 changed files with 119 additions and 76 deletions.
2 changes: 1 addition & 1 deletion app-misc/g15daemon/files/g15daemon-1.2.7.confd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Key to switch the client-screens. Default is the MR key,
# Set to "yes" to use L1 key instead (black round key below the LCD, above the multimedia keys).
CLIENT_SWITCH_L1="no"
CLIENT_SWITCH_L1="yes"

# Set to "yes" to switch off the lcd backlight when stopping g15daemon.
BACKLIGHT_OFF="no"
Expand Down
20 changes: 20 additions & 0 deletions app-misc/g15daemon/files/g15daemon-1.9.5.3-avoid_bashisms.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- g15daemon-1.9.5.3/configure.in
+++ g15daemon-1.9.5.3/configure.in
@@ -53,7 +53,7 @@
AC_ARG_ENABLE([--disable-uinput],[ --disable-uinput do not build linux uinput plugin (default: autodetect)])

if test "x$enable_uinput" != "xno"; then
- if test "x$have_linux_uinput_h" == "xyes"; then
+ if test "x$have_linux_uinput_h" = "xyes"; then
#if HAVE_LINUX_UINPUT_H
dnl check for uinput.h version 2.4 or 2.6 ?
AC_CHECK_MEMBER([struct uinput_user_dev.id],
@@ -110,7 +110,7 @@
AM_CONDITIONAL(UINPUT_INTERFACE_PLUGIN, [test x$uinput = xtrue])

dnl Some versions of libusb do not honour timeout and block. Suns' version is one of them.
-if test "x$libusb_blocks" == "xtrue"; then
+if test "x$libusb_blocks" = "xtrue"; then
AC_DEFINE([LIBUSB_BLOCKS], [1],[Define if libusb implementation blocks on read or write])
fi

11 changes: 11 additions & 0 deletions app-misc/g15daemon/files/g15daemon-1.9.5.3-docdir.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- g15daemon-1.9.5.3/Makefile.am
+++ g15daemon-1.9.5.3/Makefile.am
@@ -5,7 +5,7 @@

EXTRA_DIST = debian contrib Documentation lang-bindings patches rpm README.usage FAQ LICENSE images README.Linux README.FreeBSD README.Solaris

-docdir = $(prefix)/share/doc/$(PACKAGE)-$(VERSION)
+docdir = @docdir@
doc_DATA = FAQ README.usage README ChangeLog TODO AUTHORS NEWS LICENSE README.Linux README.FreeBSD README.Solaris

man1_MANS = $(top_srcdir)/Documentation/g15daemon.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- ./g15daemon-1.9.5.3/g15daemon/utility_funcs.c 2008-01-26 06:02:07.000000000 +0100
+++ ./g15daemon-1.9.5.3/g15daemon/utility_funcs.c 2009-02-01 17:00:55.203009264 +0100
--- g15daemon-1.9.5.3/g15daemon/utility_funcs.c
+++ g15daemon-1.9.5.3/g15daemon/utility_funcs.c
@@ -356,7 +356,7 @@
config_items_t * item=NULL;
char line[1024];
Expand Down
5 changes: 2 additions & 3 deletions app-misc/g15daemon/files/g15daemon-1.9.5.3-g510-keys.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
From https://sourceforge.net/tracker/?func=detail&aid=3152167&group_id=167869&atid=844658

diff -aNru trunk/g15daemon-wip/plugins/g15_plugin_uinput.c mod/g15daemon-wip/plugins/g15_plugin_uinput.c
--- trunk/g15daemon-wip/plugins/g15_plugin_uinput.c 2011-06-26 06:50:50.000000000 +0000
+++ mod/g15daemon-wip/plugins/g15_plugin_uinput.c 2011-06-26 06:51:42.000000000 +0000
--- g15daemon-wip/plugins/g15_plugin_uinput.c
+++ g15daemon-wip/plugins/g15_plugin_uinput.c
@@ -164,146 +164,195 @@

static void g15_process_keys(g15daemon_t *masterlist, unsigned int currentkeys, unsigned int lastkeys)
Expand Down
4 changes: 2 additions & 2 deletions app-misc/g15daemon/files/g15daemon-1.9.5.3-overflow-fix.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- ./g15daemon-1.9.5.3/libg15daemon_client/g15daemon_net.c 2008-01-25 05:45:05.000000000 +0100
+++ ./g15daemon-1.9.5.3/libg15daemon_client/g15daemon_net.c 2011-02-14 22:51:55.203009264 +0100
--- g15daemon-1.9.5.3/libg15daemon_client/g15daemon_net.c
+++ g15daemon-1.9.5.3/libg15daemon_client/g15daemon_net.c
@@ -217,7 +217,7 @@
if(poll(pfd,1,100)>0){
if(pfd[0].revents & POLLPRI && !(pfd[0].revents & POLLERR || pfd[0].revents & POLLHUP || pfd[0].revents & POLLNVAL)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=5
EAPI=7

GENTOO_DEPEND_ON_PERL="no"

inherit eutils linux-info perl-module base
inherit autotools flag-o-matic linux-info perl-module toolchain-funcs udev

DESCRIPTION="Takes control of the G15 keyboard, through the linux kernel uinput device driver"
HOMEPAGE="https://sourceforge.net/projects/g15daemon/"
Expand All @@ -29,14 +29,17 @@ RDEPEND="${DEPEND}"
PATCHES=(
"${FILESDIR}/${P}-forgotten-open-mode.patch"
"${FILESDIR}/${P}-overflow-fix.patch"
"${FILESDIR}/${P}-docdir.patch"
"${FILESDIR}/${P}-avoid_bashisms.patch"
)

uinput_check() {
ebegin "Checking for uinput support"
local rc=1
linux_config_exists && linux_chkconfig_present INPUT_UINPUT
rc=$?

if [[ $rc -ne 0 ]] ; then
if [[ ${rc} -ne 0 ]] ; then
eerror "To use g15daemon, you need to compile your kernel with uinput support."
eerror "Please enable uinput support in your kernel config, found at:"
eerror
Expand All @@ -48,69 +51,72 @@ uinput_check() {
}

pkg_setup() {
export CC="$(tc-getCC)" #729294

linux-info_pkg_setup
uinput_check
}

src_unpack() {
unpack ${A}
if use perl; then
if use perl ; then
unpack "./${P}/lang-bindings/perl-G15Daemon-0.2.tar.gz"
fi
}

src_prepare() {
if use perl; then
if use perl ; then
perl-module_src_prepare
sed -i \
-e '1i#!/usr/bin/perl' \
"${S}"/contrib/testbindings.pl
"${S}"/contrib/testbindings.pl || die
else
# perl-module_src_prepare always calls base_src_prepare
base_src_prepare
default
fi
mv configure.{in,ac} || die
eautoreconf
}

src_configure() {
econf \
--docdir="${EPREFIX}/usr/share/doc/${PF}" \
$(use_enable static-libs static)
append-cflags -fcommon #706712

econf $(use_enable static-libs static)

if use perl; then
cd "${WORKDIR}/G15Daemon-0.2"
if use perl ; then
cd "${WORKDIR}/G15Daemon-0.2" || die
perl-module_src_configure
fi
}

src_compile() {
default

if use perl; then
cd "${WORKDIR}/G15Daemon-0.2"
if use perl ; then
cd "${WORKDIR}/G15Daemon-0.2" || die
perl-module_src_compile
fi
}

src_install() {
default

find "${ED}" -name '*.la' -exec rm -f {} +
find "${ED}" -type f -name '*.la' -delete || die

# remove odd docs installed my make
rm "${ED}/usr/share/doc/${PF}/"{LICENSE,README.usage}
rm "${ED}"/usr/share/doc/${PF}/README.usage || die

insinto /usr/share/${PN}/contrib
doins contrib/xmodmaprc
doins contrib/xmodmap.sh
if use perl; then
if use perl ; then
doins contrib/testbindings.pl
fi

newconfd "${FILESDIR}/${PN}-1.2.7.confd" ${PN}
newinitd "${FILESDIR}/${PN}-1.9.5.3.initd" ${PN}
dobin "${FILESDIR}/g15daemon-hotplug"
insinto /lib/udev/rules.d
doins "${FILESDIR}/99-g15daemon.rules"
udev_dorules "${FILESDIR}/99-g15daemon.rules"

insinto /etc
doins "${FILESDIR}"/g15daemon.conf
Expand All @@ -119,9 +125,9 @@ src_install() {
exeinto /usr/lib/pm-utils/sleep.d
doexe "${FILESDIR}"/20g15daemon

if use perl; then
if use perl ; then
ebegin "Installing Perl Bindings (G15Daemon.pm)"
cd "${WORKDIR}/G15Daemon-0.2"
cd "${WORKDIR}/G15Daemon-0.2" || die
docinto perl
perl-module_src_install
fi
Expand Down
47 changes: 26 additions & 21 deletions app-misc/g15daemon/g15daemon-1.9.5.3-r21.ebuild
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=5
EAPI=7

GENTOO_DEPEND_ON_PERL="no"

inherit eutils linux-info perl-module base
inherit autotools flag-o-matic linux-info perl-module toolchain-funcs udev

DESCRIPTION="Takes control of the G15 keyboard, through the linux kernel uinput device driver"
HOMEPAGE="https://sourceforge.net/projects/g15daemon/"
Expand All @@ -30,6 +30,8 @@ PATCHES=(
"${FILESDIR}/${P}-forgotten-open-mode.patch"
"${FILESDIR}/${P}-overflow-fix.patch"
"${FILESDIR}/${P}-g510-keys.patch"
"${FILESDIR}/${P}-docdir.patch"
"${FILESDIR}/${P}-avoid_bashisms.patch"
)

uinput_check() {
Expand All @@ -38,7 +40,7 @@ uinput_check() {
linux_config_exists && linux_chkconfig_present INPUT_UINPUT
rc=$?

if [[ $rc -ne 0 ]] ; then
if [[ ${rc} -ne 0 ]] ; then
eerror "To use g15daemon, you need to compile your kernel with uinput support."
eerror "Please enable uinput support in your kernel config, found at:"
eerror
Expand All @@ -50,69 +52,72 @@ uinput_check() {
}

pkg_setup() {
export CC="$(tc-getCC)" #729294

linux-info_pkg_setup
uinput_check
}

src_unpack() {
unpack ${A}
if use perl; then
if use perl ; then
unpack "./${P}/lang-bindings/perl-G15Daemon-0.2.tar.gz"
fi
}

src_prepare() {
if use perl; then
if use perl ; then
perl-module_src_prepare
sed -i \
-e '1i#!/usr/bin/perl' \
"${S}"/contrib/testbindings.pl
"${S}"/contrib/testbindings.pl || die
else
# perl-module_src_prepare always calls base_src_prepare
base_src_prepare
default
fi
mv configure.{in,ac} || die
eautoreconf
}

src_configure() {
econf \
--docdir="${EPREFIX}/usr/share/doc/${PF}" \
$(use_enable static-libs static)
append-cflags -fcommon #706712

econf $(use_enable static-libs static)

if use perl; then
cd "${WORKDIR}/G15Daemon-0.2"
if use perl ; then
cd "${WORKDIR}/G15Daemon-0.2" || die
perl-module_src_configure
fi
}

src_compile() {
default

if use perl; then
cd "${WORKDIR}/G15Daemon-0.2"
if use perl ; then
cd "${WORKDIR}/G15Daemon-0.2" || die
perl-module_src_compile
fi
}

src_install() {
default

find "${ED}" -name '*.la' -exec rm -f {} +
find "${ED}" -type f -name '*.la' -delete || die

# remove odd docs installed my make
rm "${ED}/usr/share/doc/${PF}/"{LICENSE,README.usage}
rm "${ED}"/usr/share/doc/${PF}/README.usage || die

insinto /usr/share/${PN}/contrib
doins contrib/xmodmaprc
doins contrib/xmodmap.sh
if use perl; then
if use perl ; then
doins contrib/testbindings.pl
fi

newconfd "${FILESDIR}/${PN}-1.2.7.confd" ${PN}
newinitd "${FILESDIR}/${PN}-1.9.5.3.initd" ${PN}
dobin "${FILESDIR}/g15daemon-hotplug"
insinto /lib/udev/rules.d
doins "${FILESDIR}/99-g15daemon.rules"
udev_dorules "${FILESDIR}/99-g15daemon.rules"

insinto /etc
doins "${FILESDIR}"/g15daemon.conf
Expand All @@ -121,9 +126,9 @@ src_install() {
exeinto /usr/lib/pm-utils/sleep.d
doexe "${FILESDIR}"/20g15daemon

if use perl; then
if use perl ; then
ebegin "Installing Perl Bindings (G15Daemon.pm)"
cd "${WORKDIR}/G15Daemon-0.2"
cd "${WORKDIR}/G15Daemon-0.2" || die
docinto perl
perl-module_src_install
fi
Expand Down
Loading

0 comments on commit 32f13dc

Please sign in to comment.