Skip to content

Commit 080cd9b

Browse files
committed
libplanes: Upgrade to tip and use python3
Python2 is on its way out in Jan 2020 Signed-off-by: Khem Raj <[email protected]>
1 parent a7dac1b commit 080cd9b

File tree

2 files changed

+62
-6
lines changed

2 files changed

+62
-6
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
From ba4cc0d7b08efecd2b2bfb04c7a70187d7056304 Mon Sep 17 00:00:00 2001
2+
From: Khem Raj <[email protected]>
3+
Date: Tue, 26 Nov 2019 11:18:39 -0800
4+
Subject: [PATCH] Use python3 by default
5+
6+
python2 is on its way out
7+
8+
Upstream-Status: Submitted [https://github.com/linux4sam/libplanes/pull/3]
9+
Signed-off-by: Khem Raj <[email protected]>
10+
---
11+
configure.ac | 2 +-
12+
python/Makefile.am | 2 +-
13+
scripts/planes-loop.py | 2 +-
14+
3 files changed, 3 insertions(+), 3 deletions(-)
15+
16+
diff --git a/configure.ac b/configure.ac
17+
index 69e9478..ba0d2e7 100644
18+
--- a/configure.ac
19+
+++ b/configure.ac
20+
@@ -129,7 +129,7 @@ if test "x$PYTHON" = xyes; then
21+
22+
if test "x$have_python" = "xyes"; then
23+
AC_MSG_CHECKING([for Python site-packages path])
24+
- PYTHON_VERSION='2.7'
25+
+ PYTHON_VERSION=`$PKG_CONFIG --modversion python3`
26+
PYTHON_SITE_PKG=${prefix}/lib/python${PYTHON_VERSION}/site-packages
27+
AC_MSG_RESULT([$PYTHON_SITE_PKG])
28+
AC_SUBST([PYTHON_SITE_PKG])
29+
diff --git a/python/Makefile.am b/python/Makefile.am
30+
index 63c737f..015fc26 100644
31+
--- a/python/Makefile.am
32+
+++ b/python/Makefile.am
33+
@@ -4,7 +4,7 @@ if HAVE_PYTHON
34+
SWIG_SRC = planes.i
35+
36+
SWIG=swig
37+
-PYTHON=python
38+
+PYTHON=python3
39+
40+
SWIG_V_GEN = $(swig_v_GEN_$(V))
41+
swig_v_GEN_ = $(swig_v_GEN_$(AM_DEFAULT_VERBOSITY))
42+
diff --git a/scripts/planes-loop.py b/scripts/planes-loop.py
43+
index ded88d4..4c6904e 100755
44+
--- a/scripts/planes-loop.py
45+
+++ b/scripts/planes-loop.py
46+
@@ -1,4 +1,4 @@
47+
-#!/usr/bin/env python
48+
+#!/usr/bin/env python3
49+
50+
from mpio import *
51+
import glob
52+
--
53+
2.24.0
54+

recipes-graphics/libplanes/libplanes_0.0.3.bb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@ PACKAGES = "${PN}-dbg ${PN} ${PN}-python"
66

77
PR = "r1"
88

9-
DEPENDS = "libdrm cairo cjson lua swig-native python"
9+
DEPENDS = "libdrm cairo cjson lua swig-native python3"
1010

11-
RDEPENDS_${PN} = "python udev-rules-at91"
11+
RDEPENDS_${PN} = "python3 udev-rules-at91"
1212

13-
SRC_URI = "git://github.com/linux4sam/libplanes.git;protocol=https"
13+
SRC_URI = "git://github.com/linux4sam/libplanes.git;protocol=https \
14+
file://0001-Use-python3-by-default.patch \
15+
"
1416
PV = "0.0.3+git${SRCPV}"
1517

16-
SRCREV = "96a3e46c175a5dd02d3cb04a9ef9f5f201a684a6"
18+
SRCREV = "8e508289202dae0840d84ec486815b96bb5b3a8c"
1719

1820
S = "${WORKDIR}/git"
1921

20-
inherit pkgconfig autotools
22+
inherit pkgconfig autotools python3-dir
2123

2224
EXTRA_OECONF += "--enable-shared --disable-static"
2325

@@ -46,7 +48,7 @@ do_install_append() {
4648
install -Dm 0755 ${S}/scripts/planes-loop.sh ${D}/opt/planes/planes-loop.sh
4749
install -Dm 0755 ${S}/scripts/planes-loop.py ${D}/opt/planes/planes-loop.py
4850
install -Dm 0755 ${S}/python/examples/splash.py ${D}/usr/share/planes/splash.py
49-
rm -f ${D}/usr/lib/python2.7/site-packages/planes/_planes.a
51+
rm -f ${D}/usr/lib/python*/site-packages/planes/_planes.a
5052
rm -f ${D}/usr/lib/libplanes.a
5153
}
5254

0 commit comments

Comments
 (0)