From da73faed3c16f963f2a6a1c1060c68447709793e Mon Sep 17 00:00:00 2001 From: Bernard Cafarelli Date: Fri, 15 Jul 2022 14:24:47 +0200 Subject: x11-plugins/wmhdplop: fix imlib2 support Adapt patch from wmforkplop, also backport an indent fix Closes: https://bugs.gentoo.org/828926 Signed-off-by: Bernard Cafarelli --- .../wmhdplop/files/wmhdplop-0.9.11-configure.patch | 112 +++++++++++++++++++++ .../wmhdplop/files/wmhdplop-0.9.11-indent.patch | 38 +++++++ x11-plugins/wmhdplop/wmhdplop-0.9.11-r1.ebuild | 37 +++++++ x11-plugins/wmhdplop/wmhdplop-0.9.11.ebuild | 36 ------- 4 files changed, 187 insertions(+), 36 deletions(-) create mode 100644 x11-plugins/wmhdplop/files/wmhdplop-0.9.11-configure.patch create mode 100644 x11-plugins/wmhdplop/files/wmhdplop-0.9.11-indent.patch create mode 100644 x11-plugins/wmhdplop/wmhdplop-0.9.11-r1.ebuild delete mode 100644 x11-plugins/wmhdplop/wmhdplop-0.9.11.ebuild (limited to 'x11-plugins/wmhdplop') diff --git a/x11-plugins/wmhdplop/files/wmhdplop-0.9.11-configure.patch b/x11-plugins/wmhdplop/files/wmhdplop-0.9.11-configure.patch new file mode 100644 index 000000000000..3eabe853f62a --- /dev/null +++ b/x11-plugins/wmhdplop/files/wmhdplop-0.9.11-configure.patch @@ -0,0 +1,112 @@ +diff -Naur wmhdplop-0.9.11.orig/configure.ac wmhdplop-0.9.11/configure.ac +--- wmhdplop-0.9.11.orig/configure.ac 2018-12-11 02:45:33.000000000 +0100 ++++ wmhdplop-0.9.11/configure.ac 2022-07-15 14:17:50.244012667 +0200 +@@ -1,12 +1,14 @@ +-AC_INIT(wmhdplop, 0.9.11) ++AC_INIT([wmhdplop], [0.9.11], [https://www.dockapps.net/wmhdplop]) + AC_CONFIG_SRCDIR(wmhdplop.c) + AM_INIT_AUTOMAKE ++LT_INIT ++AC_CONFIG_MACRO_DIRS([m4]) + AM_CONFIG_HEADER(config.h) + + AC_SUBST(VERSION) + + ISODATE=`date +%Y-%m-%d` +-AC_SUBST(ISODATE) ++AC_SUBST([ISODATE]) + + AC_CANONICAL_HOST + +@@ -19,39 +21,42 @@ + AC_DEFINE(_GNU_SOURCE,[],[uses GNU extensions]) + + +-if test x$GCC = xyes; then +- CFLAGS="-O3 -fomit-frame-pointer -ffast-math -Wall -W"; +-fi ++AS_IF( ++ [test "x${GCC}" = "xyes"], ++ [CFLAGS="-O3 -fomit-frame-pointer -ffast-math -Wall -W"] ++) + + dnl check for X + AC_PATH_X + AC_PATH_XTRA +-if test x$no_x = xyes; then +- echo "You need to supply the path to the X headers and libraries with --x-includes=dir and --x-libraries=dir"; +- exit 1; +-fi; ++AS_IF( ++ [test "x${no_x}" = "xyes"], ++ [AC_MSG_ERROR([You need to supply the path to the X headers and libraries with --x-includes=dir and --x-libraries=dir])] ++) + + LIBS="${X_PRE_LIBS} ${X_LIBS} -lX11 -lXext ${LIBS} ${X_EXTRA_LIBS}" + CFLAGS="$CFLAGS $X_CFLAGS" + + dnl Checks for library functions. +-AC_CHECK_HEADERS(linux/hdreg.h) ++AC_CHECK_HEADERS([linux/hdreg.h]) + +-AC_CHECK_PROG([IMLIB2_CONFIG_IN_PATH],[imlib2-config],[yes],[no]) +-if test "x$IMLIB2_CONFIG_IN_PATH" = "xno"; then +- AC_ERROR([imlib2-config not found in PATH.. You need to install Imlib2 (and its developpement package)]) +-fi +-IMLIB2_CFLAGS=$(imlib2-config --cflags) +-IMLIB2_LIBS=$(imlib2-config --libs) +-AC_SUBST(IMLIB2_CFLAGS) +-AC_SUBST(IMLIB2_LIBS) ++AC_CHECK_PROG([PKG_CONFIG_IN_PATH],[pkg-config],[yes],[no]) ++AS_IF( ++ [test "x$PKG_CONFIG_IN_PATH" = "xno"], ++ [AC_ERROR([pkg-config not found in PATH.. You need to install pkgconf])] ++) ++ ++IMLIB2_CFLAGS=$(pkg-config imlib2 --cflags) ++IMLIB2_LIBS=$(pkg-config imlib2 --libs) ++AC_SUBST([IMLIB2_CFLAGS]) ++AC_SUBST([IMLIB2_LIBS]) + + YELLOW="\\033\\1331;33m" + RESET="\\033\\1330m" + + dnl Checks for the gkrellm plugin + build_gkhdplop="yes" +-AC_ARG_ENABLE(gkrellm, ++AC_ARG_ENABLE([gkrellm], + [ --enable-gkrellm build the gkrellm plugin (requires gtk2 and gkrellm developpement files) (Default is yes) + --disable-gkrellm do not build the gkrellm plugin], + [ if test "x$enableval" = "xno" ; then +@@ -69,8 +74,8 @@ + PKG_CHECK_MODULES(PACKAGE, [$pkg_modules]) + GTK2_CFLAGS=$PACKAGE_CFLAGS; + GTK2_LIBS=$PACKAGE_LIBS; +- AC_SUBST(GTK2_CFLAGS) +- AC_SUBST(GTK2_LIBS) ++ AC_SUBST([GTK2_CFLAGS]) ++ AC_SUBST([GTK2_LIBS]) + SAVECPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CFLAGS $GTK2_CFLAGS" + AC_CHECK_HEADERS([gkrellm2/gkrellm.h], [ok=1], [ok=0]) +@@ -82,7 +87,7 @@ + fi + CPPFLAGS="$SAVECPPFLAGS" + fi +-AC_SUBST(GKHDPLOP) ++AC_SUBST([GKHDPLOP]) + + + AC_OUTPUT(Makefile) +diff -Naur wmhdplop-0.9.11.orig/Makefile.am wmhdplop-0.9.11/Makefile.am +--- wmhdplop-0.9.11.orig/Makefile.am 2018-12-08 22:48:27.000000000 +0100 ++++ wmhdplop-0.9.11/Makefile.am 2022-07-15 14:11:07.842722348 +0200 +@@ -8,6 +8,8 @@ + + EXTRA_DIST=autogen.sh gkrellm_hdplop.c + ++ACLOCAL_AMFLAGS = -I m4 ++ + IMLIB2_LIBS=@IMLIB2_LIBS@ + IMLIB2_CFLAGS=@IMLIB2_CFLAGS@ + diff --git a/x11-plugins/wmhdplop/files/wmhdplop-0.9.11-indent.patch b/x11-plugins/wmhdplop/files/wmhdplop-0.9.11-indent.patch new file mode 100644 index 000000000000..30e44715ea2a --- /dev/null +++ b/x11-plugins/wmhdplop/files/wmhdplop-0.9.11-indent.patch @@ -0,0 +1,38 @@ +From f597fc7288f57d1dfddd5bb559cc7b0f598d15e5 Mon Sep 17 00:00:00 2001 +From: "Torrance, Douglas" +Date: Sun, 10 Oct 2021 10:01:04 +0000 +Subject: [PATCH] wmhdplop: Fix "misleadingly indented" compiler warnings. + +--- + wmhdplop/wmhdplop.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/wmhdplop.c b/wmhdplop.c +index 16b9a4f..bbbe971 100644 +--- a/wmhdplop.c ++++ b/wmhdplop.c +@@ -421,7 +421,9 @@ static void draw_hdlist(App *app) { + //printf("update : first displayed(%d) = %p\n", cnt, dl); + + for (dl = first_dev_in_list(), dev_cnt=hd_cnt=-1; dl; dl = dl->next) { +- if (dl->part_id == 0) ++hd_cnt; if (!is_displayed(dl->hd_id, dl->part_id)) continue; ++dev_cnt; ++ if (dl->part_id == 0) ++hd_cnt; ++ if (!is_displayed(dl->hd_id, dl->part_id)) continue; ++ ++dev_cnt; + imlib_get_text_size(shorten_name(dl),&w,&h); + lw = MAX(w,lw); + lh += h; +@@ -440,7 +442,9 @@ static void draw_hdlist(App *app) { + imlib_image_draw_rectangle(lx-1,ly-1,lw+2,lh+2); + + for (dl = first_dev_in_list(), dev_cnt=hd_cnt=-1; dl; dl = dl->next) { +- if (dl->part_id==0) ++hd_cnt; if (!is_displayed(dl->hd_id, dl->part_id)) continue; ++dev_cnt; ++ if (dl->part_id==0) ++hd_cnt; ++ if (!is_displayed(dl->hd_id, dl->part_id)) continue; ++ ++dev_cnt; + int x = lx, y = ly + lh - dev_cnt * h; + if (!Prefs.disable_hd_leds) { + if (dl->touched_r) { +-- +2.11.4.GIT + diff --git a/x11-plugins/wmhdplop/wmhdplop-0.9.11-r1.ebuild b/x11-plugins/wmhdplop/wmhdplop-0.9.11-r1.ebuild new file mode 100644 index 000000000000..2f766c788980 --- /dev/null +++ b/x11-plugins/wmhdplop/wmhdplop-0.9.11-r1.ebuild @@ -0,0 +1,37 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 +inherit autotools + +DESCRIPTION="a dockapp for monitoring disk activities with fancy visuals" +HOMEPAGE="https://www.dockapps.net/wmhdplop" +SRC_URI="https://www.dockapps.net/download/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" +IUSE="" + +RDEPEND="media-libs/imlib2[X] + x11-libs/libX11 + x11-libs/libXext + media-fonts/corefonts + >=media-libs/freetype-2" +DEPEND="${RDEPEND}" + +PATCHES=( + "${FILESDIR}"/${P}-configure.patch + "${FILESDIR}"/${P}-indent.patch +) + +DOCS=( AUTHORS ChangeLog NEWS README ) + +src_prepare() { + default + eautoreconf +} + +src_configure() { + econf --disable-gkrellm +} diff --git a/x11-plugins/wmhdplop/wmhdplop-0.9.11.ebuild b/x11-plugins/wmhdplop/wmhdplop-0.9.11.ebuild deleted file mode 100644 index 2806056295d9..000000000000 --- a/x11-plugins/wmhdplop/wmhdplop-0.9.11.ebuild +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 1999-2018 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 -inherit autotools - -DESCRIPTION="a dockapp for monitoring disk activities with fancy visuals" -HOMEPAGE="https://www.dockapps.net/wmhdplop" -SRC_URI="https://www.dockapps.net/download/${P}.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~ppc ~x86" -IUSE="" - -RDEPEND="media-libs/imlib2[X] - x11-libs/libX11 - x11-libs/libXext - media-fonts/corefonts - >=media-libs/freetype-2" -DEPEND="${RDEPEND}" - -PATCHES=( - "${FILESDIR}"/${PN}-0.9.10-cflags.patch -) - -DOCS=( AUTHORS ChangeLog NEWS README ) - -src_prepare() { - eautoreconf - default -} - -src_configure() { - econf --disable-gkrellm -} -- cgit v1.2.3-65-gdbad