From patchwork Thu Sep 15 06:40:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=C3=B6rg_Krause?= X-Patchwork-Id: 670226 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sZTLp6phzz9s8x for ; Thu, 15 Sep 2016 16:40:34 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=embedded.rocks header.i=@embedded.rocks header.b=0z9BtHiz; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 5C9368AA43; Thu, 15 Sep 2016 06:40:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id og1gyt39SHoa; Thu, 15 Sep 2016 06:40:30 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 9FC488A995; Thu, 15 Sep 2016 06:40:27 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 6C7291C11D2 for ; Thu, 15 Sep 2016 06:40:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6842C85B60 for ; Thu, 15 Sep 2016 06:40:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jiVNG5bkFuD7 for ; Thu, 15 Sep 2016 06:40:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.142]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 577E684BBD for ; Thu, 15 Sep 2016 06:40:11 +0000 (UTC) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 3sZTLJ1khPz105l for ; Thu, 15 Sep 2016 08:40:08 +0200 (CEST) Authentication-Results: mail.embedded.rocks (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=embedded.rocks DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embedded.rocks; h=content-transfer-encoding:content-type:content-type :mime-version:references:in-reply-to:x-mailer:message-id:date :date:subject:subject:from:from:received:received; s=default; t= 1473921607; x=1474526408; bh=LQ9ORdWTchZNjtpe1hgT//fmQJl76BDdwS1 VRpY+/gs=; b=0z9BtHiz1eIk7Ithx+a2TidSXD4jR3Kty+fWGP+6wTRiHjvjtCs Nb+WheEaoWmGeIeAi8rhFLTbepUy4fTFQVH9FH66EPhaGs5VTmihQDg4sudkfBjB /mj+H2jr5EJoCV/wshninbcIqbwwo6526PfhR1tpEoIWNPg+KSHcgxX5p87NTspx 9+JIUjp86e8j/FiWYXZulAk7SOTOQwu68jFL1WoDWwd5Dx42n5mVRxhRBhGvxAOE hCIFD8sEO1v3qd1dodU7GiFcs6Se2icpkMnB0u8CycwLQXtM6A6G1la8fhijT9aW Bc/Vm8jd2fS2ciwSzoamvQRd8Y7VHl5Wf1w== Received: from mail.embedded.rocks ([127.0.0.1]) by localhost (mail.embedded.rocks [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id 8sLKo_dadIhq; Thu, 15 Sep 2016 08:40:07 +0200 (CEST) Received: from nzxt.fritz.box (x4d02005d.dyn.telefonica.de [77.2.0.93]) (Authenticated sender: joerg.krause@embedded.rocks) by mail.embedded.rocks (Postfix) with ESMTPSA; Thu, 15 Sep 2016 08:40:07 +0200 (CEST) From: =?UTF-8?q?J=C3=B6rg=20Krause?= To: buildroot@buildroot.org Date: Thu, 15 Sep 2016 08:40:00 +0200 Message-Id: <20160915064001.8684-6-joerg.krause@embedded.rocks> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160915064001.8684-1-joerg.krause@embedded.rocks> References: <20160915064001.8684-1-joerg.krause@embedded.rocks> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 5/6] package/upmpdcli: add patch to use pkg-config for libupnpp X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Building upmpdcli aborts because of an unsafe header inclusion of `/usr/include/libupnpp`. Using `{prefix}` to get the header path is wrong for cross-compilation. Instead of hard-coding the flags for libupnpp use pkg-config to get the correct ones. Note that this patch adds the host-pkgconfig dependency unconditionally and removes the necessity to pass the libupnpp manually to LIBS for a static build. Upstream-status: https://github.com/medoc92/upmpdcli/pull/49 Signed-off-by: Jörg Krause --- .../0002-use-pkg-config-for-libupnpp.patch | 66 ++++++++++++++++++++++ package/upmpdcli/upmpdcli.mk | 17 +----- 2 files changed, 69 insertions(+), 14 deletions(-) create mode 100644 package/upmpdcli/0002-use-pkg-config-for-libupnpp.patch diff --git a/package/upmpdcli/0002-use-pkg-config-for-libupnpp.patch b/package/upmpdcli/0002-use-pkg-config-for-libupnpp.patch new file mode 100644 index 0000000..daef415 --- /dev/null +++ b/package/upmpdcli/0002-use-pkg-config-for-libupnpp.patch @@ -0,0 +1,66 @@ +From 16bcaaee1c28b972e0cc6a542f511af44306ce6c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=B6rg=20Krause?= +Date: Wed, 14 Sep 2016 11:43:21 +0200 +Subject: [PATCH] Use pkg-config for libupnpp +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Use pkg-config for libupnpp to fix build issues when cross-compiling and +building upmpdcli statically. + +Building upmpdcli aborts because of an unsafe header inclusion of +`/usr/include/libupnpp`. Using `{prefix}` to get the header path is wrong for +cross-compilation. Instead of hard-coding the flags for libupnpp use pkg-config +to get the correct ones. + +Upstream-status: https://github.com/medoc92/upmpdcli/pull/49 + +Signed-off-by: Jörg Krause +--- + Makefile.am | 2 +- + configure.ac | 8 ++++---- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index d0c10a4..5c83aa1 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,5 +1,5 @@ + AM_CPPFLAGS = -DDEBUG -g -Wall \ +- -I${prefix}/include/libupnpp \ ++ $(upnpp_CFLAGS) \ + -I$(top_srcdir)/src \ + -DDATADIR=\"${pkgdatadir}\" -DCONFIGDIR=\"${sysconfdir}\" + +diff --git a/configure.ac b/configure.ac +index 108dcce..a165b5d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -35,10 +35,10 @@ dnl AC_CHECK_LIB([upnp], [UpnpInit], [], AC_MSG_ERROR([libupnp not found])) + dnl AC_CHECK_LIB([curl], [curl_easy_init], [],AC_MSG_ERROR([libcurl not found])) + dnl AC_CHECK_LIB([expat], [XML_ParserCreate], [],AC_MSG_ERROR([libexpat not found])) + +-AC_CHECK_LIB([upnpp], [getsyshwaddr], [], [AC_MSG_ERROR([libupnpp])]) ++PKG_CHECK_MODULES([upnpp], [libupnpp], [], [AC_MSG_ERROR([libupnpp])]) + AC_CHECK_LIB([mpdclient], [mpd_connection_new], [], + AC_MSG_ERROR([libmpdclient not found])) +-SCCTL_LIBS=$LIBS ++SCCTL_LIBS="$LIBS $upnpp_LIBS" + + AC_CHECK_LIB([microhttpd], [MHD_queue_response], [], []) + +@@ -56,8 +56,8 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM( + [AC_MSG_ERROR([libjsoncpp not found.])]) + AC_LANG_POP + +-UPMPDCLI_LIBS=$LIBS +-echo "UPMPDCLI_LIBS=$LIBS" ++UPMPDCLI_LIBS="$LIBS $upnpp_LIBS" ++echo "UPMPDCLI_LIBS=$UPMPDCLI_LIBS" + + LIBS="" + +-- +2.9.3 + diff --git a/package/upmpdcli/upmpdcli.mk b/package/upmpdcli/upmpdcli.mk index b70f413..3beda1b 100644 --- a/package/upmpdcli/upmpdcli.mk +++ b/package/upmpdcli/upmpdcli.mk @@ -8,23 +8,12 @@ UPMPDCLI_VERSION = 1.2.2 UPMPDCLI_SITE = http://www.lesbonscomptes.com/upmpdcli/downloads UPMPDCLI_LICENSE = GPLv2+ UPMPDCLI_LICENSE_FILES = COPYING -UPMPDCLI_DEPENDENCIES = libmpdclient libupnpp libmicrohttpd jsoncpp -# touching configure.ac in +UPMPDCLI_DEPENDENCIES = host-pkgconf libmpdclient libupnpp libmicrohttpd jsoncpp +# touching configure.ac and Makefile.am in # 0001-fix-jsoncpp-detection.patch +# 0002-use-pkg-config-for-libupnpp.patch UPMPDCLI_AUTORECONF = YES -ifeq ($(BR2_STATIC_LIBS),y) -# Upmpdcli forgets to take the dependencies of libupnpp into -# consideration, breaking static linking, so help it. -# Libupnpp unfortunately doesn't provide a .pc file, so manually -# handle the dependencies here. -# The build system doesn't expand LIBS from the configure step, so -# manually pass it to make. -UPMPDCLI_DEPENDENCIES += host-pkgconf -UPMPDCLI_MAKE_OPTS = \ - LIBS="`$(PKG_CONFIG_HOST_BINARY) --libs expat libcurl libupnp`" -endif - # Upmpdcli only runs if user upmpdcli exists define UPMPDCLI_USERS upmpdcli -1 upmpdcli -1 * - - - Upmpdcli MPD UPnP Renderer Front-End