From patchwork Wed Jan 3 21:08:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Folkesson X-Patchwork-Id: 855214 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="QQ3oQKuo"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zBk7k3CKgz9s7M for ; Thu, 4 Jan 2018 08:09:06 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id F3D3B830BC; Wed, 3 Jan 2018 21:09:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id haIkv5kcnhm4; Wed, 3 Jan 2018 21:09:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 6DC9089445; Wed, 3 Jan 2018 21:09:01 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 16DBC1C00CA for ; Wed, 3 Jan 2018 21:09:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 122F489B6B for ; Wed, 3 Jan 2018 21:09:00 +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 5Cr64GQen1Uq for ; Wed, 3 Jan 2018 21:08:59 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f177.google.com (mail-wr0-f177.google.com [209.85.128.177]) by hemlock.osuosl.org (Postfix) with ESMTPS id 3C52D89B27 for ; Wed, 3 Jan 2018 21:08:59 +0000 (UTC) Received: by mail-wr0-f177.google.com with SMTP id g17so3099322wrd.13 for ; Wed, 03 Jan 2018 13:08:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=9vz6bnLc+EyPE8fyUKcxve5qUk8nNCoQH4/LQEjK3wM=; b=QQ3oQKuokvTPrFXT+ct+x+DfV6AiIG9uL1FhZzxt3fjFvi+mrP/Fzobyv80gVamdW6 Tlh8J9vx4UzrQTMJNS/kYEr08vdZ//S5LIgYnGlRaS3DY7YX6GMLF8vsWinfFV4uWxad adHow+slg5kN2i5MaxWvshyT1n8zwq5eLqU+9ccJVKAsTYvQ3bVzNIrakQzDEv6e2Jxe Z2MQ/2nYtVZwxEnd6dI6VhBqtetoD+kfY4AskefFxArPvhNXZ/y898iv4EVEZ7RvQIHt A5L5AR3Ded2xCCv0PBY56ut30vk2BxJJVIsammKsvnPH6WJavmvXFNzwawPXX/csIAMd 4+Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=9vz6bnLc+EyPE8fyUKcxve5qUk8nNCoQH4/LQEjK3wM=; b=JDg3U2ku/h3jYIiMvNLr9RLEh97QP7m2emMHmzaNR9QJ2YniL8f5IIq5jWviYIDMTr fJxPzlXyNeMCdZ1gfCUhoTP/IZZtOoE5lJMGgIlCjhv2p1f/jB+LV/e5mocTCYUHTdhh 552NnSSW9CJdY1G8jVT9WOhgLZ0ZKTJc7x/FFD9zE2Ttk641RZJOfKUApGTvot0UGmAJ Aeun4cm18CguVQhopcQZaG9dtqwnKwZEe57aAVWM2G2itUPWLJvzPAkXeyMiL77NC6XW xsTzJi2f5LvvC8z94NXmkSw5uQ/4TQ2wEnqGwcGR4LheRw11KHCfFJs3EwmVmgMS2Ndy UBfQ== X-Gm-Message-State: AKGB3mJXRnALrAvdnPoMLTDinzd7+5GfMRlv+iCpztDSNTMdRee2EfOQ hxCpsDbyBnyF1BCDNQwfJegsjRiw X-Google-Smtp-Source: ACJfBos0SC+QZzAKSHsQi12N2xn/ZT+rTOUJiI5n4zZfUbSgWb5qYaDoHihJ+0oEyPyCdwBxR611Lg== X-Received: by 10.46.64.133 with SMTP id r5mr1669696lje.30.1515013737590; Wed, 03 Jan 2018 13:08:57 -0800 (PST) Received: from localhost.localdomain (c-2ec253b8-74736162.cust.telenor.se. [46.194.83.184]) by smtp.gmail.com with ESMTPSA id g12sm341842lfd.32.2018.01.03.13.08.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jan 2018 13:08:56 -0800 (PST) From: Marcus Folkesson To: buildroot@buildroot.org Date: Wed, 3 Jan 2018 22:08:51 +0100 Message-Id: <20180103210851.26851-1-marcus.folkesson@gmail.com> X-Mailer: git-send-email 2.15.1 Subject: [Buildroot] [PATCH] libselinux: add patch to create a proper pkg-config file X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marcus Folkesson , Adam Duskett MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" `includedir` in libselinux.pc is set to $(PREFIX)/include if not specified. This result in an incorrect include path when using pkg-config. Output from `pkg-config -cflags libselinux` without this patch: -I/home/marcus/git/buildroot-ostree/output/host/bin/../mips64el-buildroot-linux-gnu/sysroot/home/marcus/git/buildroot-ostree/output/host/mips64el-buildroot-linux-gnu/sysroot/usr/include -I/home/marcus/git/buildroot-ostree/output/host/bin/../mips64el-buildroot-linux-gnu/sysroot/usr/include Output from `pkg-config -cflags libselinux` with this patch: -I/home/marcus/git/buildroot-ostree/output/host/bin/../mips64el-buildroot-linux-gnu/sysroot/usr/include This is normally not an issue unless the depending package is compiled with `-Werror=missing-include-dirs` as it will be treated as an error. Fixes: http://autobuild.buildroot.net/results/680458dc049d2c286918aeed745515894f8fcefa/ Signed-off-by: Marcus Folkesson --- ...introduce-PCPREFIX-substitute-variables-f.patch | 38 ++++++++++++++++++++++ package/libselinux/libselinux.mk | 3 +- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 package/libselinux/0004-libselinux-introduce-PCPREFIX-substitute-variables-f.patch diff --git a/package/libselinux/0004-libselinux-introduce-PCPREFIX-substitute-variables-f.patch b/package/libselinux/0004-libselinux-introduce-PCPREFIX-substitute-variables-f.patch new file mode 100644 index 0000000000..978d0591f3 --- /dev/null +++ b/package/libselinux/0004-libselinux-introduce-PCPREFIX-substitute-variables-f.patch @@ -0,0 +1,38 @@ +libselinux: introduce PCPREFIX substitute variable for .pc files + +`prefix` in the .pc file may be messed up when using a buildsystem +that has specified a sysroot as DESTDIR. +We need to make it possible to override the default `libdir` +and `includedir`. + +`includedir` may be overridden by `INCLUDEDIR` but `libdir` is using +`PREFIX` to setup the path. + +Therefore, introduce PCPREFIX to make it possible to generate a more +customized .pc file. + +Signed-off-by: Marcus Folkesson + +--- libselinux.orig/src/Makefile 2018-01-03 21:44:49.548561421 +0100 ++++ libselinux/src/Makefile 2018-01-03 21:44:35.581894904 +0100 +@@ -9,9 +9,10 @@ + + # Installation directories. + PREFIX ?= $(DESTDIR)/usr ++PCPREFIX ?= $(DESTDIR)/usr + LIBDIR ?= $(PREFIX)/lib + SHLIBDIR ?= $(DESTDIR)/lib +-INCLUDEDIR ?= $(PREFIX)/include ++INCLUDEDIR ?= $(PCPREFIX)/include + PYINC ?= $(shell $(PKG_CONFIG) --cflags $(PYPREFIX)) + PYLIBS ?= $(shell $(PKG_CONFIG) --libs $(PYPREFIX)) + PYSITEDIR ?= $(DESTDIR)$(shell $(PYTHON) -c 'import site; print(site.getsitepackages()[0])') +@@ -148,7 +149,7 @@ + ln -sf $@ $(TARGET) + + $(LIBPC): $(LIBPC).in ../VERSION +- sed -e 's/@VERSION@/$(VERSION)/; s:@prefix@:$(PREFIX):; s:@libdir@:$(LIBBASE):; s:@includedir@:$(INCLUDEDIR):' < $< > $@ ++ sed -e 's/@VERSION@/$(VERSION)/; s:@prefix@:$(PCPREFIX):; s:@libdir@:$(LIBBASE):; s:@includedir@:$(INCLUDEDIR):' < $< > $@ + + selinuxswig_python_exception.i: ../include/selinux/selinux.h + bash -e exception.sh > $@ || (rm -f $@ ; false) diff --git a/package/libselinux/libselinux.mk b/package/libselinux/libselinux.mk index 8ac8000de5..4d4a9d99e6 100644 --- a/package/libselinux/libselinux.mk +++ b/package/libselinux/libselinux.mk @@ -36,7 +36,8 @@ endif LIBSELINUX_MAKE_OPTS += \ PYINC="$(LIBSELINUX_PYINC)" \ PYSITEDIR=$(TARGET_DIR)/usr/lib/$(LIBSELINUX_PYLIBVER)/site-packages \ - SWIG_LIB="$(HOST_DIR)/share/swig/$(SWIG_VERSION)/" + SWIG_LIB="$(HOST_DIR)/share/swig/$(SWIG_VERSION)/" \ + PCPREFIX=/usr LIBSELINUX_MAKE_INSTALL_TARGETS += install-pywrap