Skip to content

Commit

Permalink
libplanes: Upgrade to tip and use python3
Browse files Browse the repository at this point in the history
Python2 is on its way out in Jan 2020

Signed-off-by: Khem Raj <[email protected]>
  • Loading branch information
kraj committed Nov 26, 2019
1 parent a7dac1b commit 080cd9b
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
From ba4cc0d7b08efecd2b2bfb04c7a70187d7056304 Mon Sep 17 00:00:00 2001
From: Khem Raj <[email protected]>
Date: Tue, 26 Nov 2019 11:18:39 -0800
Subject: [PATCH] Use python3 by default

python2 is on its way out

Upstream-Status: Submitted [https://github.com/linux4sam/libplanes/pull/3]
Signed-off-by: Khem Raj <[email protected]>
---
configure.ac | 2 +-
python/Makefile.am | 2 +-
scripts/planes-loop.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 69e9478..ba0d2e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -129,7 +129,7 @@ if test "x$PYTHON" = xyes; then

if test "x$have_python" = "xyes"; then
AC_MSG_CHECKING([for Python site-packages path])
- PYTHON_VERSION='2.7'
+ PYTHON_VERSION=`$PKG_CONFIG --modversion python3`
PYTHON_SITE_PKG=${prefix}/lib/python${PYTHON_VERSION}/site-packages
AC_MSG_RESULT([$PYTHON_SITE_PKG])
AC_SUBST([PYTHON_SITE_PKG])
diff --git a/python/Makefile.am b/python/Makefile.am
index 63c737f..015fc26 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -4,7 +4,7 @@ if HAVE_PYTHON
SWIG_SRC = planes.i

SWIG=swig
-PYTHON=python
+PYTHON=python3

SWIG_V_GEN = $(swig_v_GEN_$(V))
swig_v_GEN_ = $(swig_v_GEN_$(AM_DEFAULT_VERBOSITY))
diff --git a/scripts/planes-loop.py b/scripts/planes-loop.py
index ded88d4..4c6904e 100755
--- a/scripts/planes-loop.py
+++ b/scripts/planes-loop.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3

from mpio import *
import glob
--
2.24.0

14 changes: 8 additions & 6 deletions recipes-graphics/libplanes/libplanes_0.0.3.bb
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ PACKAGES = "${PN}-dbg ${PN} ${PN}-python"

PR = "r1"

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

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

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

SRCREV = "96a3e46c175a5dd02d3cb04a9ef9f5f201a684a6"
SRCREV = "8e508289202dae0840d84ec486815b96bb5b3a8c"

S = "${WORKDIR}/git"

inherit pkgconfig autotools
inherit pkgconfig autotools python3-dir

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

Expand Down Expand Up @@ -46,7 +48,7 @@ do_install_append() {
install -Dm 0755 ${S}/scripts/planes-loop.sh ${D}/opt/planes/planes-loop.sh
install -Dm 0755 ${S}/scripts/planes-loop.py ${D}/opt/planes/planes-loop.py
install -Dm 0755 ${S}/python/examples/splash.py ${D}/usr/share/planes/splash.py
rm -f ${D}/usr/lib/python2.7/site-packages/planes/_planes.a
rm -f ${D}/usr/lib/python*/site-packages/planes/_planes.a
rm -f ${D}/usr/lib/libplanes.a
}

0 comments on commit 080cd9b

Please sign in to comment.