summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2020-05-21 14:23:42 +0200
committerBruce Ashfield <bruce.ashfield@gmail.com>2020-05-21 22:10:19 -0400
commitaa558c78241cedf46118c02127a115443db98f15 (patch)
treef7e373afb0fa0086f331ce2d53944f5a28266dfa
parent7b002ac180bf0faf80206d5fe267a74c83a71f5f (diff)
downloadmeta-virtualization-aa558c78241cedf46118c02127a115443db98f15.tar.gz
singularity: fix build with python3
* Fix python3native inherit added in: https://git.yoctoproject.org/cgit/cgit.cgi/meta-virtualization/commit/?id=a1e3f5c92cdee7c4259b7be643bd829ce7c1efa3 to actually work * also remove the work arounds for /usr/bin/python being python3 on the target device * I haven't tested this in runtime - I don't use it, it was just showing that do_configure error in "bitbake world" builds, the scripts might need some changes to be really compatible with python3, but it was broken already, now it at least builds * upgrade to new version with https://github.com/hpcng/singularity/pull/1762/commits/3c05f06e6a1c490a4b4714bcdf5a0ce2b2498bb5 would be nice by someone who actually uses this Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-containers/singularity/singularity/0001-Use-python3.patch148
-rw-r--r--recipes-containers/singularity/singularity_git.bb12
2 files changed, 151 insertions, 9 deletions
diff --git a/recipes-containers/singularity/singularity/0001-Use-python3.patch b/recipes-containers/singularity/singularity/0001-Use-python3.patch
new file mode 100644
index 00000000..dbfe06e4
--- /dev/null
+++ b/recipes-containers/singularity/singularity/0001-Use-python3.patch
@@ -0,0 +1,148 @@
1From 758c1edc7bf3d2a023954f4fcc9ddf46fd370272 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Thu, 21 May 2020 14:14:56 +0200
4Subject: [PATCH] Use python3
5
6* without /usr/bin/python this just fails to configure with:
7 | checking for python... no
8 | configure: error: Please install python before installing.
9 | WARNING: exit code 1 from a shell command.
10
11Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
12---
13 configure.ac | 6 +++---
14 etc/configure_transform.py | 2 +-
15 libexec/python/helpers/json/add.py | 2 +-
16 libexec/python/helpers/json/delete.py | 2 +-
17 libexec/python/helpers/json/dump.py | 2 +-
18 libexec/python/helpers/json/get.py | 2 +-
19 libexec/python/helpers/json/inspect.py | 2 +-
20 libexec/python/import.py | 2 +-
21 libexec/python/pull.py | 2 +-
22 libexec/python/shub/api.py | 2 +-
23 libexec/python/size.py | 2 +-
24 11 files changed, 13 insertions(+), 13 deletions(-)
25
26diff --git a/configure.ac b/configure.ac
27index 8ffa5ab32..71a1605b2 100644
28--- a/configure.ac
29+++ b/configure.ac
30@@ -251,15 +251,15 @@ fi
31 # PYTHON
32 # ---------------------------------------------------------------------
33
34-AC_CHECK_PROG(PYTHON_CHECK,python,yes)
35+AC_CHECK_PROG(PYTHON_CHECK,python3,yes)
36 if test x"$PYTHON_CHECK" != x"yes" ; then
37- AC_MSG_ERROR([Please install python before installing.])
38+ AC_MSG_ERROR([Please install python3 before installing.])
39 else
40
41 PYTHON_MODULES="base64 datetime glob hashlib io itertools json math multiprocessing pickle pwd re shutil signal subprocess stat sys tarfile tempfile time"
42 for PYTHON_MODULE in $PYTHON_MODULES; do
43 AC_MSG_CHECKING([for the $PYTHON_MODULE python module])
44- python_module_result=`python -c "import $PYTHON_MODULE" 2>&1`
45+ python_module_result=`python3 -c "import $PYTHON_MODULE" 2>&1`
46 if test -z "$python_module_result"; then
47 AC_MSG_RESULT([yes])
48 else
49diff --git a/etc/configure_transform.py b/etc/configure_transform.py
50index a1ff5c427..9ec445d21 100755
51--- a/etc/configure_transform.py
52+++ b/etc/configure_transform.py
53@@ -1,4 +1,4 @@
54-#!/usr/bin/env python
55+#!/usr/bin/env python3
56 #
57 # Copyright (c) 2017, SingularityWare, LLC. All rights reserved.
58 #
59diff --git a/libexec/python/helpers/json/add.py b/libexec/python/helpers/json/add.py
60index b24aec75a..22abbbeb9 100644
61--- a/libexec/python/helpers/json/add.py
62+++ b/libexec/python/helpers/json/add.py
63@@ -1,4 +1,4 @@
64-#!/usr/bin/env python
65+#!/usr/bin/env python3
66
67 '''
68
69diff --git a/libexec/python/helpers/json/delete.py b/libexec/python/helpers/json/delete.py
70index 0975e4e60..07e255228 100644
71--- a/libexec/python/helpers/json/delete.py
72+++ b/libexec/python/helpers/json/delete.py
73@@ -1,4 +1,4 @@
74-#!/usr/bin/env python
75+#!/usr/bin/env python3
76
77 '''
78
79diff --git a/libexec/python/helpers/json/dump.py b/libexec/python/helpers/json/dump.py
80index ddba06e4a..37a8edf70 100644
81--- a/libexec/python/helpers/json/dump.py
82+++ b/libexec/python/helpers/json/dump.py
83@@ -1,4 +1,4 @@
84-#!/usr/bin/env python
85+#!/usr/bin/env python3
86
87 '''
88
89diff --git a/libexec/python/helpers/json/get.py b/libexec/python/helpers/json/get.py
90index 355be9040..d1d822aea 100644
91--- a/libexec/python/helpers/json/get.py
92+++ b/libexec/python/helpers/json/get.py
93@@ -1,4 +1,4 @@
94-#!/usr/bin/env python
95+#!/usr/bin/env python3
96
97 '''
98
99diff --git a/libexec/python/helpers/json/inspect.py b/libexec/python/helpers/json/inspect.py
100index 65772a4ef..61c723495 100644
101--- a/libexec/python/helpers/json/inspect.py
102+++ b/libexec/python/helpers/json/inspect.py
103@@ -1,4 +1,4 @@
104-#!/usr/bin/env python
105+#!/usr/bin/env python3
106
107 '''
108
109diff --git a/libexec/python/import.py b/libexec/python/import.py
110index 2ec208417..1c58eda5c 100644
111--- a/libexec/python/import.py
112+++ b/libexec/python/import.py
113@@ -1,4 +1,4 @@
114-#!/usr/bin/env python
115+#!/usr/bin/env python3
116
117 '''
118
119diff --git a/libexec/python/pull.py b/libexec/python/pull.py
120index 1cd705c90..4431023f3 100644
121--- a/libexec/python/pull.py
122+++ b/libexec/python/pull.py
123@@ -1,4 +1,4 @@
124-#!/usr/bin/env python
125+#!/usr/bin/env python3
126
127 '''
128
129diff --git a/libexec/python/shub/api.py b/libexec/python/shub/api.py
130index 850d167e7..3c8313ad5 100644
131--- a/libexec/python/shub/api.py
132+++ b/libexec/python/shub/api.py
133@@ -1,4 +1,4 @@
134-#!/usr/bin/env python
135+#!/usr/bin/env python3
136
137 '''
138
139diff --git a/libexec/python/size.py b/libexec/python/size.py
140index 34331fd27..99581ce52 100644
141--- a/libexec/python/size.py
142+++ b/libexec/python/size.py
143@@ -1,4 +1,4 @@
144-#!/usr/bin/env python
145+#!/usr/bin/env python3
146
147 '''
148
diff --git a/recipes-containers/singularity/singularity_git.bb b/recipes-containers/singularity/singularity_git.bb
index a2653529..103270dd 100644
--- a/recipes-containers/singularity/singularity_git.bb
+++ b/recipes-containers/singularity/singularity_git.bb
@@ -3,9 +3,6 @@
3INSANE_SKIP_${PN} += "dev-so" 3INSANE_SKIP_${PN} += "dev-so"
4 4
5RDEPENDS_${PN} += "glibc python3 ca-certificates openssl bash e2fsprogs-mke2fs" 5RDEPENDS_${PN} += "glibc python3 ca-certificates openssl bash e2fsprogs-mke2fs"
6# Singularity expects to find python3 under the name python, therefore both
7# cannot be installed at the same time.
8RCONFLICTS_${PN} = "python"
9 6
10LICENSE = "BSD" 7LICENSE = "BSD"
11LIC_FILES_CHKSUM = "file://COPYRIGHT.md;md5=be78c34e483dd7d8439358b1e024b294 \ 8LIC_FILES_CHKSUM = "file://COPYRIGHT.md;md5=be78c34e483dd7d8439358b1e024b294 \
@@ -13,7 +10,9 @@ LIC_FILES_CHKSUM = "file://COPYRIGHT.md;md5=be78c34e483dd7d8439358b1e024b294 \
13 file://LICENSE.md;md5=df4326b473db6424033f1d98a5645e30 \ 10 file://LICENSE.md;md5=df4326b473db6424033f1d98a5645e30 \
14 file://debian/copyright;md5=ed267cf386d9b75ab1f27f407e935b10" 11 file://debian/copyright;md5=ed267cf386d9b75ab1f27f407e935b10"
15 12
16SRC_URI = "git://github.com/singularityware/singularity.git;protocol=https" 13SRC_URI = "git://github.com/singularityware/singularity.git;protocol=https \
14 file://0001-Use-python3.patch \
15"
17PV = "2.3.1+git${SRCPV}" 16PV = "2.3.1+git${SRCPV}"
18SRCREV = "e214d4ebf0a1274b1c63b095fd55ae61c7e92947" 17SRCREV = "e214d4ebf0a1274b1c63b095fd55ae61c7e92947"
19 18
@@ -23,11 +22,6 @@ inherit python3native autotools-brokensep
23EXTRA_OECONF = "--prefix=/usr/local" 22EXTRA_OECONF = "--prefix=/usr/local"
24 23
25pkg_postinst_${PN}() { 24pkg_postinst_${PN}() {
26 # Singularity requires "python" to resolve to "python3" within the commandline.
27 # This creates a symbolic link from python3 to python. A side-effect of this is
28 # that scripts which expect Python 2 may fail to run correctly.
29 ln -sr $D${bindir}/python3 $D${bindir}/python
30
31 # python3 expects CA certificates to be installed in a different place to where 25 # python3 expects CA certificates to be installed in a different place to where
32 # they are actually installed. These lines link the two locations. 26 # they are actually installed. These lines link the two locations.
33 rm -r $D${libdir}/ssl/certs 27 rm -r $D${libdir}/ssl/certs