dev-libs/libg15render: Don't use freetype-config
authorLars Wendler <polynomial-c@gentoo.org>
Fri, 4 May 2018 10:54:18 +0000 (12:54 +0200)
committerLars Wendler <polynomial-c@gentoo.org>
Fri, 4 May 2018 10:57:28 +0000 (12:57 +0200)
Package-Manager: Portage-2.3.35, Repoman-2.3.9

dev-libs/libg15render/files/libg15render-1.2-freetype_pkgconfig.patch [new file with mode: 0644]
dev-libs/libg15render/files/libg15render-1.2-pixel-c.patch
dev-libs/libg15render/libg15render-1.2-r2.ebuild

diff --git a/dev-libs/libg15render/files/libg15render-1.2-freetype_pkgconfig.patch b/dev-libs/libg15render/files/libg15render-1.2-freetype_pkgconfig.patch
new file mode 100644 (file)
index 0000000..83df9fa
--- /dev/null
@@ -0,0 +1,35 @@
+--- libg15render-1.2/configure.in
++++ libg15render-1.2/configure.in
+@@ -13,19 +13,20 @@
+ AC_PROG_LIBTOOL
+ # Checks for --enable args
+-AC_MSG_CHECKING(whether to enable FreeType2 support)
+-AC_ARG_ENABLE(ttf, [  --enable-ttf            enable FreeType2 support],
+-      if [[[ "$enableval" = "yes" ]]]; then
+-              AC_DEFINE(TTF_SUPPORT, [1], [Define to 1 to enable FreeType2 support])
+-              CFLAGS="$CFLAGS `freetype-config --cflags`"
+-              FTLIB="-lfreetype"
+-              ttf_support="yes"
+-      else
+-              ttf_support="no"
+-      fi,
+-      ttf_support="no"
++AC_ARG_ENABLE(ttf, [  --enable-ttf            enable FreeType2 support],,enable_ttf=no)
++AS_IF([test "x$enable_ttf" = "xyes"], [
++      PKG_PROG_PKG_CONFIG
++      PKG_CHECK_MODULES(FREETYPE, freetype2,
++              [
++                      AC_DEFINE(TTF_SUPPORT, [1], [Define to 1 to enable FreeType2 support])
++                      CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
++                      FTLIB="$FREETYPE_LIBS"
++              ],
++              AC_MSG_ERROR([Cannot find freetype2])
++      )
++],
++      AC_MSG_RESULT(No Freetype is being used)
+ )
+-AC_MSG_RESULT($ttf_support)
+ # Checks for libraries.
+ AC_CHECK_LIB([g15], [writePixmapToLCD], ,AC_MSG_ERROR(["libg15 not found. please install it"]))
index 3f7ecc2ff7b20e35b218e4813d85d08517161118..9b1ab60860b8311d6467574973c6190d5810e68a 100644 (file)
@@ -1,19 +1,23 @@
-dev-libs/libg15render-1.2:
  * QA Notice: Package has poor programming practices which may compile
  *            fine but exhibit random runtime failures.
  * pixel.c:356: warning: incompatible implicit declaration of built-in function 'ceil'
-Should be fixed by including math.h:
---- libg15render-1.2_old/pixel.c        2007-03-14 23:37:42.000000000 +0100
-+++ libg15render-1.2/pixel.c    2007-03-14 23:36:29.000000000 +0100
-@@ -17,6 +17,7 @@
+
+Should be fixed by including math.h
+
+ * QA Notice: Package triggers severe warnings which indicate that it
+ *            may exhibit random runtime failures.
+ * pixel.c:504:16: warning: incompatible implicit declaration of built-in function â€˜malloc’
+
+Should be fixed by including stdlib.h
+
+--- libg15render-1.2/pixel.c
++++ libg15render-1.2/pixel.c
+@@ -17,6 +17,8 @@
  */
  
  #include <fcntl.h>
++#include <stdlib.h>
 +#include <math.h>
  #include "libg15render.h"
  
- void
\ No newline at end of file
+ void
index 61782d60444ab9a60c67c3804f09748643f9a6f8..816da20255ea05573eac5048dcaa2155971ac8d6 100644 (file)
@@ -1,9 +1,9 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=4
+EAPI=6
 
-inherit eutils
+inherit autotools
 
 DESCRIPTION="Small library for display text and graphics on a Logitech G15 keyboard"
 HOMEPAGE="https://sourceforge.net/projects/g15tools/"
@@ -19,22 +19,32 @@ RDEPEND="
        dev-libs/libg15
        truetype? ( media-libs/freetype )
 "
-DEPEND=${RDEPEND}
+DEPEND="${RDEPEND}
+       truetype? ( virtual/pkgconfig )"
+
+PATCHES=(
+       "${FILESDIR}/${P}-pixel-c.patch"
+       "${FILESDIR}/${P}-freetype_pkgconfig.patch"
+)
 
 src_prepare() {
-       epatch "${FILESDIR}/${P}-pixel-c.patch"
+       default
+       mv configure.{in,ac} || die
+       eautoreconf
 }
 
 src_configure() {
-       econf \
-               --disable-static \
+       local myeconfargs=(
+               --disable-static
                $(use_enable truetype ttf )
+       )
+       econf "${myeconfargs[@]}"
 }
 
 src_install() {
        emake DESTDIR="${D}" \
-               docdir=/usr/share/doc/${PF} install || die "make install failed"
-       rm "${ED}/usr/share/doc/${PF}/COPYING"
+               docdir=/usr/share/doc/${PF} install
+       rm "${ED%/}/usr/share/doc/${PF}/COPYING"
 
-       find "${ED}" -name '*.la' -exec rm -f {} +
+       find "${ED}" -name '*.la' -delete || die
 }