From patchwork Thu Nov 20 13:53:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Korsgaard X-Patchwork-Id: 412718 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id EB0CF14017B for ; Fri, 21 Nov 2014 00:53:53 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 1052EA3F37; Thu, 20 Nov 2014 13:53:51 +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 BBvNShkIJNcA; Thu, 20 Nov 2014 13:53:49 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5BCEAA3F93; Thu, 20 Nov 2014 13:53:48 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 4B8EA1C11D3 for ; Thu, 20 Nov 2014 13:53:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 79DA1331A5 for ; Thu, 20 Nov 2014 13:53:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id h+7qN8QD+ufM for ; Thu, 20 Nov 2014 13:53:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by silver.osuosl.org (Postfix) with ESMTPS id D8C5133A3A for ; Thu, 20 Nov 2014 13:53:38 +0000 (UTC) Received: by mail-wi0-f170.google.com with SMTP id bs8so12637766wib.1 for ; Thu, 20 Nov 2014 05:53:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=HVkQ4wsK4sIRfjSi6DN88zNcbmlFs8UcttMJ1iL/ETk=; b=gRl0TRzOWZFk4uoW5Wwub4MziT5ThxAYYrLZDosoQQXsr2spAvWgycJSEAqQKpGGN4 EYpZyzrzifN0o1TLqaabrrXLJ7st8vGTSUnFC3uUHHcQI8g7qPXHgCC32jrYR/SrdVu6 9Y8Xa+cgWbtpuTH1tTOsgkN4wMdMohFJqqD3zaQzjSsTDXHRNodLymohh/UhxBNaoGY2 9NmsAaCyhefOMjZfDZrvw8Sjicx+wrPH4Xoh7dEmOikUM2vjrJyIx2DcwIQoe6ypGZiY HcSk04bBlXKYp8vZF2edFRvM+LdNtZuJxZaZJ+5E7iPisLandBY174tWvm3UxwTGx9fn j5hQ== X-Received: by 10.194.90.244 with SMTP id bz20mr24669704wjb.125.1416491617523; Thu, 20 Nov 2014 05:53:37 -0800 (PST) Received: from dell.be.48ers.dk ([91.183.168.190]) by mx.google.com with ESMTPSA id nd20sm6718101wic.11.2014.11.20.05.53.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Nov 2014 05:53:36 -0800 (PST) Received: from peko by dell.be.48ers.dk with local (Exim 4.84) (envelope-from ) id 1XrSAx-0005C5-0w; Thu, 20 Nov 2014 14:53:35 +0100 From: Peter Korsgaard To: buildroot@uclibc.org Date: Thu, 20 Nov 2014 14:53:30 +0100 Message-Id: <1416491611-19815-3-git-send-email-peter@korsgaard.com> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1416491611-19815-1-git-send-email-peter@korsgaard.com> References: <1416491611-19815-1-git-send-email-peter@korsgaard.com> Subject: [Buildroot] [PATCH next 2/3] python3: add patch to fix --includes / --ldflags output of python3-config 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: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The build/real prefix handling using sed breaks if build != real and the standard include / lib directories are used ($prefix/include and $prefix/lib). E.G. prefix_build="/usr", libdir="$prefix/lib", includedir="$prefix/include". If this gets installed with make DESTDIR="/foo" install, then we end up with prefix_real = prefix = "/foo/usr" as expected, but includedir="/foo/foo/usr/include" and libdir="/foo/foo/usr/lib" because of the double sed invocation (prefix is already expanded). Work around it by ensuring we only match the beginning of the string. Submitted upstream: http://bugs.python.org/issue22907 Signed-off-by: Peter Korsgaard --- .../python3-017-python-config-include-libdir.patch | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/package/python3/python3-017-python-config-include-libdir.patch b/package/python3/python3-017-python-config-include-libdir.patch new file mode 100644 index 0000000..50a856d --- /dev/null +++ b/package/python3/python3-017-python-config-include-libdir.patch @@ -0,0 +1,60 @@ +From 50f34d2cac63b6bf0935294a7d63d9451714f4c4 Mon Sep 17 00:00:00 2001 +From: Peter Korsgaard +Date: Thu, 20 Nov 2014 13:24:59 +0100 +Subject: [PATCH] Misc/python-config.sh.in: ensure sed invocations only match + beginning of strings + +The build/real prefix handling using sed breaks if build != real and the +standard include / lib directories are used ($prefix/include and $prefix/lib). + +E.G. + +prefix_build="/usr", libdir="$prefix/lib", includedir="$prefix/include". + +If this gets installed with make DESTDIR="/foo" install, then we end up with +prefix_real = prefix = "/foo/usr" as expected, but +includedir="/foo/foo/usr/include" and libdir="/foo/foo/usr/lib" because of +the double sed invocation (prefix is already expanded). Work around it by +ensuring we only match the beginning of the string. + +Submitted upstream: http://bugs.python.org/issue22907 + +Signed-off-by: Peter Korsgaard +--- + Misc/python-config.sh.in | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/Misc/python-config.sh.in b/Misc/python-config.sh.in +index 64c81e5..f75eec5 100644 +--- a/Misc/python-config.sh.in ++++ b/Misc/python-config.sh.in +@@ -29,12 +29,12 @@ prefix_real=$(installed_prefix "$0") + + # Use sed to fix paths from their built-to locations to their installed-to + # locations. +-prefix=$(echo "$prefix_build" | sed "s#$prefix_build#$prefix_real#") ++prefix=$(echo "$prefix_build" | sed "s#^$prefix_build#$prefix_real#") + exec_prefix_build="@exec_prefix@" +-exec_prefix=$(echo "$exec_prefix_build" | sed "s#$exec_prefix_build#$prefix_real#") +-includedir=$(echo "@includedir@" | sed "s#$prefix_build#$prefix_real#") +-libdir=$(echo "@libdir@" | sed "s#$prefix_build#$prefix_real#") +-CFLAGS=$(echo "@CFLAGS@" | sed "s#$prefix_build#$prefix_real#") ++exec_prefix=$(echo "$exec_prefix_build" | sed "s#^$exec_prefix_build#$prefix_real#") ++includedir=$(echo "@includedir@" | sed "s#^$prefix_build#$prefix_real#") ++libdir=$(echo "@libdir@" | sed "s#^$prefix_build#$prefix_real#") ++CFLAGS=$(echo "@CFLAGS@" | sed "s#^$prefix_build#$prefix_real#") + VERSION="@VERSION@" + LIBM="@LIBM@" + LIBC="@LIBC@" +@@ -48,7 +48,7 @@ OPT="@OPT@" + PY_ENABLE_SHARED="@PY_ENABLE_SHARED@" + LDVERSION="@LDVERSION@" + LIBDEST=${prefix}/lib/python${VERSION} +-LIBPL=$(echo "@LIBPL@" | sed "s#$prefix_build#$prefix_real#") ++LIBPL=$(echo "@LIBPL@" | sed "s#^$prefix_build#$prefix_real#") + SO="@SO@" + PYTHONFRAMEWORK="@PYTHONFRAMEWORK@" + INCDIR="-I$includedir/python${VERSION}${ABIFLAGS}" +-- +2.1.3 +