diff options
| author | Martin Jansa <Martin.Jansa@gmail.com> | 2020-05-21 14:23:42 +0200 | 
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2020-05-21 22:10:25 -0400 | 
| commit | ff8ab85493cebb6dc3d1e0139f0212284a76ff9a (patch) | |
| tree | 4c892ac9639150ca7992e10ee927898c11d09ebe | |
| parent | db5d7d295d5735a4ffbdb7c9e17c8387474ef7c3 (diff) | |
| download | meta-virtualization-ff8ab85493cebb6dc3d1e0139f0212284a76ff9a.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.patch | 148 | ||||
| -rw-r--r-- | recipes-containers/singularity/singularity_git.bb | 12 | 
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 @@ | |||
| 1 | From 758c1edc7bf3d2a023954f4fcc9ddf46fd370272 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Martin Jansa <Martin.Jansa@gmail.com> | ||
| 3 | Date: Thu, 21 May 2020 14:14:56 +0200 | ||
| 4 | Subject: [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 | |||
| 11 | Signed-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 | |||
| 26 | diff --git a/configure.ac b/configure.ac | ||
| 27 | index 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 | ||
| 49 | diff --git a/etc/configure_transform.py b/etc/configure_transform.py | ||
| 50 | index 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 | # | ||
| 59 | diff --git a/libexec/python/helpers/json/add.py b/libexec/python/helpers/json/add.py | ||
| 60 | index 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 | |||
| 69 | diff --git a/libexec/python/helpers/json/delete.py b/libexec/python/helpers/json/delete.py | ||
| 70 | index 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 | |||
| 79 | diff --git a/libexec/python/helpers/json/dump.py b/libexec/python/helpers/json/dump.py | ||
| 80 | index 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 | |||
| 89 | diff --git a/libexec/python/helpers/json/get.py b/libexec/python/helpers/json/get.py | ||
| 90 | index 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 | |||
| 99 | diff --git a/libexec/python/helpers/json/inspect.py b/libexec/python/helpers/json/inspect.py | ||
| 100 | index 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 | |||
| 109 | diff --git a/libexec/python/import.py b/libexec/python/import.py | ||
| 110 | index 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 | |||
| 119 | diff --git a/libexec/python/pull.py b/libexec/python/pull.py | ||
| 120 | index 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 | |||
| 129 | diff --git a/libexec/python/shub/api.py b/libexec/python/shub/api.py | ||
| 130 | index 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 | |||
| 139 | diff --git a/libexec/python/size.py b/libexec/python/size.py | ||
| 140 | index 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 @@ | |||
| 3 | INSANE_SKIP_${PN} += "dev-so" | 3 | INSANE_SKIP_${PN} += "dev-so" | 
| 4 | 4 | ||
| 5 | RDEPENDS_${PN} += "glibc python3 ca-certificates openssl bash e2fsprogs-mke2fs" | 5 | RDEPENDS_${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. | ||
| 8 | RCONFLICTS_${PN} = "python" | ||
| 9 | 6 | ||
| 10 | LICENSE = "BSD" | 7 | LICENSE = "BSD" | 
| 11 | LIC_FILES_CHKSUM = "file://COPYRIGHT.md;md5=be78c34e483dd7d8439358b1e024b294 \ | 8 | LIC_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 | ||
| 16 | SRC_URI = "git://github.com/singularityware/singularity.git;protocol=https" | 13 | SRC_URI = "git://github.com/singularityware/singularity.git;protocol=https \ | 
| 14 | file://0001-Use-python3.patch \ | ||
| 15 | " | ||
| 17 | PV = "2.3.1+git${SRCPV}" | 16 | PV = "2.3.1+git${SRCPV}" | 
| 18 | SRCREV = "e214d4ebf0a1274b1c63b095fd55ae61c7e92947" | 17 | SRCREV = "e214d4ebf0a1274b1c63b095fd55ae61c7e92947" | 
| 19 | 18 | ||
| @@ -23,11 +22,6 @@ inherit python3native autotools-brokensep | |||
| 23 | EXTRA_OECONF = "--prefix=/usr/local" | 22 | EXTRA_OECONF = "--prefix=/usr/local" | 
| 24 | 23 | ||
| 25 | pkg_postinst_${PN}() { | 24 | pkg_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 | 
