dev-lang/python: Fix cross-compiling for 3.5
authorMike Gilbert <floppym@gentoo.org>
Sun, 20 Sep 2015 02:07:40 +0000 (22:07 -0400)
committerMike Gilbert <floppym@gentoo.org>
Sun, 20 Sep 2015 02:07:53 +0000 (22:07 -0400)
Package-Manager: portage-2.2.20_p169_p6532

dev-lang/python/files/3.5-secondary-targets.patch [new file with mode: 0644]
dev-lang/python/python-3.5.0.ebuild

diff --git a/dev-lang/python/files/3.5-secondary-targets.patch b/dev-lang/python/files/3.5-secondary-targets.patch
new file mode 100644 (file)
index 0000000..eb3b0c7
--- /dev/null
@@ -0,0 +1,19 @@
+Mark all targets as "secondary"
+
+This allows make to avoid rebuilding unnecessary intermediate files, which
+is useful when cross-compiling.
+
+See Parser/pgen and Programs/_freeze_importlib in Makefile.pre.in.
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1672,6 +1672,8 @@
+ .PHONY: smelly funny patchcheck touch altmaninstall commoninstall
+ .PHONY: gdbhooks
++.SECONDARY:
++
+ # IF YOU PUT ANYTHING HERE IT WILL GO AWAY
+ # Local Variables:
+ # mode: makefile
index ca56f88c9fc793fe150768ad2ebdcb07d5b2a4a8..1dcd7691750498681ea6304d33adb9e01a59828f 100644 (file)
@@ -66,6 +66,7 @@ src_prepare() {
 
        EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
        epatch "${FILESDIR}/${PN}-3.4.3-ncurses-pkg-config.patch"
+       epatch "${FILESDIR}/3.5-secondary-targets.patch"
 
        sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
                configure.ac \
@@ -171,6 +172,9 @@ src_configure() {
 }
 
 src_compile() {
+       # Avoid regenerating these for cross-compiles
+       touch Include/graminit.h Python/graminit.c Python/importlib.h Python/importlib_external.h || die
+
        cd "${BUILD_DIR}" || die
 
        emake CPPFLAGS= CFLAGS= LDFLAGS=