Patchwork [meta-oe] libwmf: use pkgconfig for freetype

login
register
mail settings
Submitter Koen Kooi
Date Aug. 6, 2014, 12:55 p.m.
Message ID <1407329735-31105-1-git-send-email-koen@dominion.thruhere.net>
Download mbox | patch
Permalink /patch/77381/
State Accepted, archived
Headers show

Comments

Koen Kooi - Aug. 6, 2014, 12:55 p.m.
And while we're at it list freetype in DEPENDS as well.

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
 ...001-configure-use-pkg-config-for-freetype.patch | 67 ++++++++++++++++++++++
 meta-oe/recipes-extended/libwmf/libwmf_0.2.8.4.bb  | 11 ++--
 2 files changed, 73 insertions(+), 5 deletions(-)
 create mode 100644 meta-oe/recipes-extended/libwmf/libwmf/0001-configure-use-pkg-config-for-freetype.patch
Martin Jansa - Aug. 8, 2014, 9:20 a.m.
On Wed, Aug 06, 2014 at 02:55:35PM +0200, Koen Kooi wrote:
> And while we're at it list freetype in DEPENDS as well.
> 
> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
> ---
>  ...001-configure-use-pkg-config-for-freetype.patch | 67 ++++++++++++++++++++++
>  meta-oe/recipes-extended/libwmf/libwmf_0.2.8.4.bb  | 11 ++--
>  2 files changed, 73 insertions(+), 5 deletions(-)
>  create mode 100644 meta-oe/recipes-extended/libwmf/libwmf/0001-configure-use-pkg-config-for-freetype.patch
> 
> diff --git a/meta-oe/recipes-extended/libwmf/libwmf/0001-configure-use-pkg-config-for-freetype.patch b/meta-oe/recipes-extended/libwmf/libwmf/0001-configure-use-pkg-config-for-freetype.patch
> new file mode 100644
> index 0000000..0f133e2
> --- /dev/null
> +++ b/meta-oe/recipes-extended/libwmf/libwmf/0001-configure-use-pkg-config-for-freetype.patch
> @@ -0,0 +1,67 @@
> +From 61655f82224cadb261e81f8bae111eaaa7bdf531 Mon Sep 17 00:00:00 2001
> +From: Koen Kooi <koen@dominion.thruhere.net>
> +Date: Wed, 6 Aug 2014 14:53:03 +0200
> +Subject: [PATCH] configure: use pkg-config for freetype
> +
> +Upstream-status: Pending
> +Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
> +---
> + configure.ac | 37 ++++++++-----------------------------
> + 1 file changed, 8 insertions(+), 29 deletions(-)
> +
> +diff --git a/configure.ac b/configure.ac
> +index 3cfe974..0055a8c 100644
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -399,40 +399,19 @@ AC_ARG_WITH(freetype,[  --with-freetype=DIR     use freetype2 in DIR],[
> + 	fi
> + ])
> + 
> +-if [ test -n "$FREETYPE_DIR" ]; then
> +-	AC_PATH_PROG(FREETYPE_CONFIG,freetype-config, ,[$FREETYPE_DIR/bin:$PATH])
> +-else
> +-	AC_PATH_PROG(FREETYPE_CONFIG,freetype-config)
> +-fi
> +-
> +-if [ test -n "$FREETYPE_CONFIG" ]; then
> +-	if [ test -n "$FREETYPE_DIR" ]; then
> +-		freetype_cflags="`$FREETYPE_CONFIG --cflags` -I$FREETYPE_DIR/include"
> +-		freetype_libs=`$FREETYPE_CONFIG --libs`
> +-	else
> +-		freetype_cflags=`$FREETYPE_CONFIG --cflags`
> +-		freetype_libs=`$FREETYPE_CONFIG --libs`
> +-	fi
> +-else
> +-	if [ test -n "$FREETYPE_DIR" ]; then
> +-		freetype_cflags="-I$FREETYPE_DIR/include/freetype2 -I$FREETYPE_DIR/include"
> +-		freetype_libs="-L$FREETYPE_DIR/lib -lfreetype"
> +-	else
> +-		freetype_cflags=""
> +-		freetype_libs="-lfreetype"
> +-	fi
> +-fi
> +-
> +-CPPFLAGS="$freetype_cflags $CPPFLAGS"
> +-LDFLAGS="$LDFLAGS $freetype_libs"
> ++PKG_CHECK_MODULES(FREETYPE2, freetype2, 
> ++    CFLAGS="$CFLAGS $FREETYPE2_CFLAGS"
> ++    LDFLAGS="$LDFLAGS $FREETYPE2_LIBS",
> ++    AC_MSG_ERROR([*** Unable to find FreeType2 library (http://www.freetype.org/)])
> ++)
> + 
> + AC_CHECK_LIB(freetype,FT_Init_FreeType,[
> +-	WMF_FT_LDFLAGS="$freetype_libs"
> ++	WMF_FT_LDFLAGS="$FREETYPE2_LIBS"
> + ],[	AC_MSG_ERROR([* * * freetype(2) is required * * *])
> + ])
> + AC_CHECK_HEADER(ft2build.h,[
> +-	WMF_FT_CFLAGS="$freetype_cflags"
> +-	WMF_FT_CONFIG_CFLAGS="$freetype_cflags"
> ++	WMF_FT_CFLAGS="$FREETYPE2_CFLAGS"
> ++	WMF_FT_CONFIG_CFLAGS="$FREETYPE2_CFLAGS"
> + ],[	AC_MSG_ERROR([* * * freetype(2) is required * * *])
> + ])
> + 
> +-- 
> +1.9.0
> +
> diff --git a/meta-oe/recipes-extended/libwmf/libwmf_0.2.8.4.bb b/meta-oe/recipes-extended/libwmf/libwmf_0.2.8.4.bb
> index 9f88ded..746c4bd 100644
> --- a/meta-oe/recipes-extended/libwmf/libwmf_0.2.8.4.bb
> +++ b/meta-oe/recipes-extended/libwmf/libwmf_0.2.8.4.bb
> @@ -7,10 +7,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
>  
>  PR = "r3"
>  
> -PNBLACKLIST[libwmf] = "BROKEN: needs to be updated to use freetype2 pkg-config instead of freetype-config"
> -
> -DEPENDS_virtclass-native = "libpng-native jpeg-native"
> -DEPENDS = "libpng jpeg expat gtk+"
> +DEPENDS_virtclass-native = "freetype-native libpng-native jpeg-native"
> +DEPENDS = "freetype libpng jpeg expat gtk+"
>  
>  BBCLASSEXTEND = "native"
>  
> @@ -18,7 +16,10 @@ inherit autotools

Missing pkgconfig inherit, but I'll fix it before merging this one
(patched already in master-next).

>  
>  SRC_URI = "${SOURCEFORGE_MIRROR}/wvware/${BPN}/${PV}/${BPN}-${PV}.tar.gz;name=tarball \
>             file://libwmf-0.2.8.4-intoverflow.patch \
> -           file://libwmf-0.2.8.4-useafterfree.patch"
> +           file://libwmf-0.2.8.4-useafterfree.patch \
> +           file://0001-configure-use-pkg-config-for-freetype.patch \
> +          "
> +
>  SRC_URI[tarball.md5sum] = "d1177739bf1ceb07f57421f0cee191e0"
>  SRC_URI[tarball.sha256sum] = "5b345c69220545d003ad52bfd035d5d6f4f075e65204114a9e875e84895a7cf8"
>  
> -- 
> 1.9.0
> 
> -- 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel

Patch

diff --git a/meta-oe/recipes-extended/libwmf/libwmf/0001-configure-use-pkg-config-for-freetype.patch b/meta-oe/recipes-extended/libwmf/libwmf/0001-configure-use-pkg-config-for-freetype.patch
new file mode 100644
index 0000000..0f133e2
--- /dev/null
+++ b/meta-oe/recipes-extended/libwmf/libwmf/0001-configure-use-pkg-config-for-freetype.patch
@@ -0,0 +1,67 @@ 
+From 61655f82224cadb261e81f8bae111eaaa7bdf531 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Wed, 6 Aug 2014 14:53:03 +0200
+Subject: [PATCH] configure: use pkg-config for freetype
+
+Upstream-status: Pending
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ configure.ac | 37 ++++++++-----------------------------
+ 1 file changed, 8 insertions(+), 29 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 3cfe974..0055a8c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -399,40 +399,19 @@ AC_ARG_WITH(freetype,[  --with-freetype=DIR     use freetype2 in DIR],[
+ 	fi
+ ])
+ 
+-if [ test -n "$FREETYPE_DIR" ]; then
+-	AC_PATH_PROG(FREETYPE_CONFIG,freetype-config, ,[$FREETYPE_DIR/bin:$PATH])
+-else
+-	AC_PATH_PROG(FREETYPE_CONFIG,freetype-config)
+-fi
+-
+-if [ test -n "$FREETYPE_CONFIG" ]; then
+-	if [ test -n "$FREETYPE_DIR" ]; then
+-		freetype_cflags="`$FREETYPE_CONFIG --cflags` -I$FREETYPE_DIR/include"
+-		freetype_libs=`$FREETYPE_CONFIG --libs`
+-	else
+-		freetype_cflags=`$FREETYPE_CONFIG --cflags`
+-		freetype_libs=`$FREETYPE_CONFIG --libs`
+-	fi
+-else
+-	if [ test -n "$FREETYPE_DIR" ]; then
+-		freetype_cflags="-I$FREETYPE_DIR/include/freetype2 -I$FREETYPE_DIR/include"
+-		freetype_libs="-L$FREETYPE_DIR/lib -lfreetype"
+-	else
+-		freetype_cflags=""
+-		freetype_libs="-lfreetype"
+-	fi
+-fi
+-
+-CPPFLAGS="$freetype_cflags $CPPFLAGS"
+-LDFLAGS="$LDFLAGS $freetype_libs"
++PKG_CHECK_MODULES(FREETYPE2, freetype2, 
++    CFLAGS="$CFLAGS $FREETYPE2_CFLAGS"
++    LDFLAGS="$LDFLAGS $FREETYPE2_LIBS",
++    AC_MSG_ERROR([*** Unable to find FreeType2 library (http://www.freetype.org/)])
++)
+ 
+ AC_CHECK_LIB(freetype,FT_Init_FreeType,[
+-	WMF_FT_LDFLAGS="$freetype_libs"
++	WMF_FT_LDFLAGS="$FREETYPE2_LIBS"
+ ],[	AC_MSG_ERROR([* * * freetype(2) is required * * *])
+ ])
+ AC_CHECK_HEADER(ft2build.h,[
+-	WMF_FT_CFLAGS="$freetype_cflags"
+-	WMF_FT_CONFIG_CFLAGS="$freetype_cflags"
++	WMF_FT_CFLAGS="$FREETYPE2_CFLAGS"
++	WMF_FT_CONFIG_CFLAGS="$FREETYPE2_CFLAGS"
+ ],[	AC_MSG_ERROR([* * * freetype(2) is required * * *])
+ ])
+ 
+-- 
+1.9.0
+
diff --git a/meta-oe/recipes-extended/libwmf/libwmf_0.2.8.4.bb b/meta-oe/recipes-extended/libwmf/libwmf_0.2.8.4.bb
index 9f88ded..746c4bd 100644
--- a/meta-oe/recipes-extended/libwmf/libwmf_0.2.8.4.bb
+++ b/meta-oe/recipes-extended/libwmf/libwmf_0.2.8.4.bb
@@ -7,10 +7,8 @@  LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
 
 PR = "r3"
 
-PNBLACKLIST[libwmf] = "BROKEN: needs to be updated to use freetype2 pkg-config instead of freetype-config"
-
-DEPENDS_virtclass-native = "libpng-native jpeg-native"
-DEPENDS = "libpng jpeg expat gtk+"
+DEPENDS_virtclass-native = "freetype-native libpng-native jpeg-native"
+DEPENDS = "freetype libpng jpeg expat gtk+"
 
 BBCLASSEXTEND = "native"
 
@@ -18,7 +16,10 @@  inherit autotools
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/wvware/${BPN}/${PV}/${BPN}-${PV}.tar.gz;name=tarball \
            file://libwmf-0.2.8.4-intoverflow.patch \
-           file://libwmf-0.2.8.4-useafterfree.patch"
+           file://libwmf-0.2.8.4-useafterfree.patch \
+           file://0001-configure-use-pkg-config-for-freetype.patch \
+          "
+
 SRC_URI[tarball.md5sum] = "d1177739bf1ceb07f57421f0cee191e0"
 SRC_URI[tarball.sha256sum] = "5b345c69220545d003ad52bfd035d5d6f4f075e65204114a9e875e84895a7cf8"