sys-boot/raspberrypi-mkimage: Add py3.5 and py3.6
authorDavid Seifert <soap@gentoo.org>
Fri, 10 Mar 2017 21:11:38 +0000 (22:11 +0100)
committerDavid Seifert <soap@gentoo.org>
Fri, 10 Mar 2017 21:12:07 +0000 (22:12 +0100)
* EAPI 6
* Call distutils-r1_python_prepare_all
* Call distutils-r1_python_install_all

Package-Manager: Portage-2.3.4, Repoman-2.3.2

sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed-python3.patch
sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed.patch
sys-boot/raspberrypi-mkimage/raspberrypi-mkimage-0_p20120201.ebuild

index f9d0c00602c8f8b4b88b04c370aae39544ca700c..28b8a6f3170fdcf79f4a681fb7afeccff7eb13bd 100644 (file)
@@ -1,5 +1,5 @@
---- mkimage/imagetool-uncompressed.py
-+++ mkimage/imagetool-uncompressed.py
+--- a/imagetool-uncompressed.py
++++ b/imagetool-uncompressed.py
 @@ -46,7 +47,7 @@
  f = open(args.bootimage, "wb")
  
index 6b12c95c0fbeed084da8464c9baee4e76a39993a..adba8bbcdbbf39f4d28182206f289c297cb17679 100644 (file)
@@ -1,6 +1,5 @@
-diff -ru raspberrypi-mkimage-0_p20120201.orig/imagetool-uncompressed.py raspberrypi-mkimage-0_p20120201/imagetool-uncompressed.py
---- raspberrypi-mkimage-0_p20120201.orig/imagetool-uncompressed.py     2013-07-19 15:11:23.373837900 +0200
-+++ raspberrypi-mkimage-0_p20120201/imagetool-uncompressed.py  2013-07-19 15:31:56.495421758 +0200
+--- a/imagetool-uncompressed.py
++++ b/imagetool-uncompressed.py
 @@ -3,15 +3,23 @@
  import os
  import re
index ecbea00e0dceb8d5491f3dcae9b6cdb72feed24f..202e65282d26d6658ed1eebf68ac50a6e81f954f 100644 (file)
@@ -1,10 +1,12 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
-PYTHON_COMPAT=( python{2_7,3_4} )
+EAPI=6
 
-inherit eutils distutils-r1
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+DISTUTILS_IN_SOURCE_BUILD=1
+
+inherit distutils-r1
 
 DESCRIPTION="Raspberry Pi kernel mangling tool mkimage/imagetool-uncompressed.py"
 HOMEPAGE="https://github.com/raspberrypi/tools/"
@@ -16,7 +18,9 @@ KEYWORDS="~amd64 ~arm ~x86"
 IUSE=""
 
 DEPEND=""
-RDEPEND="${PYTHON_DEPS}"
+RDEPEND=""
+
+PATCHES=( "${FILESDIR}"/${P}-imagetool-uncompressed.patch )
 
 src_unpack() {
        mkdir "${S}" || die
@@ -24,26 +28,22 @@ src_unpack() {
 }
 
 python_prepare_all() {
-       epatch "${FILESDIR}"/${P}-imagetool-uncompressed.patch
        sed -e '/^load_to_mem("/s:(":("'${EPREFIX}'/usr/share/'${PN}'/:' \
                -e '1s:python2:python:' \
                -i imagetool-uncompressed.py || die
-       python_copy_sources
+
+       distutils-r1_python_prepare_all
 }
 
 python_prepare() {
-       cd "${BUILD_DIR}" || die
-       case ${EPYTHON} in
-               python3.1|python3.2|python3.3)
-                       epatch "${FILESDIR}"/${P}-imagetool-uncompressed-python3.patch
-                       ;;
-       esac
+       if python_is_python3; then
+               eapply "${FILESDIR}"/${P}-imagetool-uncompressed-python3.patch
+       fi
 }
 
 python_compile() { :; }
 
 python_install() {
-       cd "${BUILD_DIR}" || die
        python_doscript imagetool-uncompressed.py
 }
 
@@ -51,4 +51,6 @@ python_install_all() {
        insinto /usr/share/${PN}
        newins {"${FILESDIR}"/${P}-,}args-uncompressed.txt
        newins {"${FILESDIR}"/${P}-,}boot-uncompressed.txt
+
+       distutils-r1_python_install_all
 }