Skip to contentSkip to conversation

python3-lxml: Consolidate in a single file

PATCH In review Leon Anavi 2 participants 16 messages Jun 8, 2020 – Jun 10, 2020

lore
Share & tools
lore

Leon Anavi

author
#0 lore raw

PATCH 1/7 python3-lxml: Consolidate in a single file

Consolidate inc and bb files into a single bb file.

---
 .../recipes-devtools/python/python-lxml.inc   | 50 -----------------
 .../python/python3-lxml_4.5.0.bb              | 53 ++++++++++++++++++-
 2 files changed, 51 insertions(+), 52 deletions(-)
 delete mode 100644 meta-python/recipes-devtools/python/python-lxml.inc
meta-python/recipes-devtools/python/python-lxml.inc deleted +0 -50
deleted file mode 100644
index 05b5eae46..000000000
@@ -1,50 +0,0 @@
-SUMMARY = "Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API."
-DESCRIPTION = "lxml is a Pythonic, mature binding for the libxml2 and \
-libxslt libraries. It provides safe and convenient access to these \
-libraries using the ElementTree API. It extends the ElementTree API \
-significantly to offer support for XPath, RelaxNG, XML Schema, XSLT, \
-C14N and much more."
-HOMEPAGE = "http://codespeak.net/lxml"
-SECTION = "devel/python"
-LICENSE = "BSD & GPLv2 & MIT & PSF"
-LIC_FILES_CHKSUM = "file://LICENSES.txt;md5=e4c045ebad958ead4b48008f70838403 \
-                    file://doc/licenses/elementtree.txt;md5=eb34d036a6e3d56314ee49a6852ac891 \
-                    file://doc/licenses/BSD.txt;md5=700a1fc17f4797d4f2d34970c8ee694b \
-                    file://doc/licenses/GPL.txt;md5=94d55d512a9ba36caa9b7df079bae19f \
-                    file://src/lxml/isoschematron/resources/rng/iso-schematron.rng;beginline=2;endline=7;md5=fc85684a8dd5fa272c086bceb0d99e10 \
-                    file://src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl;beginline=2;endline=24;md5=cc86b7b2bbc678e13f58ea403eb9929b \
-                    file://src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl;beginline=2;endline=7;md5=5b03236d293dc3784205542b409d2f53 \
-                    "
-
-DEPENDS += "libxml2 libxslt"
-
-SRC_URI[md5sum] = "f088e452ed45b030b6f84269f1e84d11"
-SRC_URI[sha256sum] = "8620ce80f50d023d414183bf90cc2576c2837b88e00bea3f33ad2630133bbb60"
-
-DISTUTILS_BUILD_ARGS += " \
-                     --with-xslt-config='pkg-config libxslt' \
-                     --with-xml2-config='pkg-config libxml-2.0' \
-"
-
-DISTUTILS_INSTALL_ARGS += " \
-                     --with-xslt-config='pkg-config libxslt' \
-                     --with-xml2-config='pkg-config libxml-2.0' \
-"
-
-inherit pypi
-
-# {standard input}: Assembler messages:
-# {standard input}:1488805: Error: branch out of range
-DEBUG_OPTIMIZATION_remove_mips = " -Og"
-DEBUG_OPTIMIZATION_append_mips = " -O"
-BUILD_OPTIMIZATION_remove_mips = " -Og"
-BUILD_OPTIMIZATION_append_mips = " -O"
-
-DEBUG_OPTIMIZATION_remove_mipsel = " -Og"
-DEBUG_OPTIMIZATION_append_mipsel = " -O"
-BUILD_OPTIMIZATION_remove_mipsel = " -Og"
-BUILD_OPTIMIZATION_append_mipsel = " -O"
-
-BBCLASSEXTEND = "native nativesdk"
-
-RDEPENDS_${PN} += "libxml2 libxslt ${PYTHON_PN}-compression"
meta-python/recipes-devtools/python/python3-lxml_4.5.0.bb +51 -2

54 lines not on this page · raw message

Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 2/7 python3-lxml: Upgrade 4.5.0 -> 4.5.1

Upgrade to release 4.5.1 but keep setupinfo.py from 4.5.0 because the new version doesn't support properly arguments --with-xslt-config and --with-xml2-config as well as retriving versions of dependencies.

---
 .../0001-setupinfo.py-Revert-changes.patch    | 237 ++++++++++++++++++
 ...n3-lxml_4.5.0.bb => python3-lxml_4.5.1.bb} |   5 +-
 2 files changed, 240 insertions(+), 2 deletions(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-lxml/0001-setupinfo.py-Revert-changes.patch
 rename meta-python/recipes-devtools/python/{python3-lxml_4.5.0.bb => python3-lxml_4.5.1.bb} (91%)
meta-python/recipes-devtools/python/python3-lxml/0001-setupinfo.py-Revert-changes.patch new file +237 -0
new file mode 100644
index 000000000..d6e63712c
@@ -0,0 +1,237 @@
+From 24d0c9885b7a259b61a28eb440d0c0585016d73b Mon Sep 17 00:00:00 2001
+From: Leon Anavi <[email protected]>
+Date: Mon, 8 Jun 2020 13:05:23 +0300
+Subject: [PATCH] setupinfo.py: Revert changes
+
+Use setupinfo.py from release 4.5.0 to revert changes replacing
+--with-xslt-config and --with-xml2-config with --xslt-config and
+--xml2-config as well as to properly determine versions of
+dependencies.
+
+Signed-off-by: Leon Anavi <[email protected]>
+---
+ setupinfo.py | 155 +++++++++++++++++++++------------------------------
+ 1 file changed, 64 insertions(+), 91 deletions(-)
+
+diff --git a/setupinfo.py b/setupinfo.py
+index cf195245..5a833d45 100644
+--- a/setupinfo.py
++++ b/setupinfo.py
+@@ -2,7 +2,6 @@ import sys
+ import io
+ import os
+ import os.path
+-import subprocess
+ from distutils.core import Extension
+ from distutils.errors import CompileError, DistutilsOptionError
+ from distutils.command.build_ext import build_ext as _build_ext
+@@ -110,7 +109,17 @@ def ext_modules(static_include_dirs, static_library_dirs,
+         use_cython = False
+         print("Building without Cython.")
+ 
+-    if not check_build_dependencies():
++    lib_versions = get_library_versions()
++    versions_ok = True
++    if lib_versions[0]:
++        print("Using build configuration of libxml2 %s and libxslt %s" %
++              lib_versions)
++        versions_ok = check_min_version(lib_versions[0], (2, 7, 0), 'libxml2')
++    else:
++        print("Using build configuration of libxslt %s" %
++              lib_versions[1])
++    versions_ok |= check_min_version(lib_versions[1], (1, 1, 23), 'libxslt')
++    if not versions_ok:
+         raise RuntimeError("Dependency missing")
+ 
+     base_dir = get_base_dir()
+@@ -351,118 +360,53 @@ def define_macros():
+     macros.append(('CYTHON_CLINE_IN_TRACEBACK', '1' if OPTION_WITH_CLINES else '0'))
+     return macros
+ 
++_ERROR_PRINTED = False
+ 
+ def run_command(cmd, *args):
+     if not cmd:
+         return ''
+     if args:
+         cmd = ' '.join((cmd,) + args)
+-
++    import subprocess
+     p = subprocess.Popen(cmd, shell=True,
+                          stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+     stdout_data, errors = p.communicate()
+-
+-    if errors:
+-        return ''
++    global _ERROR_PRINTED
++    if errors and not _ERROR_PRINTED:
++        _ERROR_PRINTED = True
++        print("ERROR: %s" % errors)
++        print("** make sure the development packages of libxml2 and libxslt are installed **\n")
+     return decode_input(stdout_data).strip()
+ 
+ 
+-def check_min_version(version, min_version, libname):
++def check_min_version(version, min_version, error_name):
+     if not version:
+         # this is ok for targets like sdist etc.
+         return True
+-    lib_version = tuple(map(int, version.split('.')[:3]))
+-    req_version = tuple(map(int, min_version.split('.')[:3]))
+-    if lib_version < req_version:
+-        print("Minimum required version of %s is %s. Your system has version %s." % (
+-            libname, min_version, version))
++    version = tuple(map(int, version.split('.')[:3]))
++    min_version = tuple(min_version)
++    if version < min_version:
++        print("Minimum required version of %s is %s, found %s" % (
++            error_name, '.'.join(map(str, version)), '.'.join(map(str, min_version))))
+         return False
+     return True
+ 
+ 
+-def get_library_version(prog, libname=None):
+-    if libname:
+-        return run_command(prog, '--modversion %s' % libname)
+-    else:
+-        return run_command(prog, '--version')
+-
++def get_library_version(config_tool):
++    is_pkgconfig = "pkg-config" in config_tool
++    return run_command(config_tool,
++                       "--modversion" if is_pkgconfig else "--version")
+ 
+-PKG_CONFIG = None
+-XML2_CONFIG = None
+-XSLT_CONFIG = None
+ 
+ def get_library_versions():
+-    global XML2_CONFIG, XSLT_CONFIG
+-
+-    # Pre-built libraries
+-    if XML2_CONFIG and XSLT_CONFIG:
+-        xml2_version = get_library_version(XML2_CONFIG)
+-        xslt_version = get_library_version(XSLT_CONFIG)
+-        return xml2_version, xslt_version
+-
+-    # Path to xml2-config and xslt-config specified on the command line
+-    if OPTION_WITH_XML2_CONFIG:
+-        xml2_version = get_library_version(OPTION_WITH_XML2_CONFIG)
+-        if xml2_version and OPTION_WITH_XSLT_CONFIG:
+-            xslt_version = get_library_version(OPTION_WITH_XSLT_CONFIG)
+-            if xslt_version:
+-                XML2_CONFIG = OPTION_WITH_XML2_CONFIG
+-                XSLT_CONFIG = OPTION_WITH_XSLT_CONFIG
+-                return xml2_version, xslt_version
+-
+-    # Try pkg-config
+-    global PKG_CONFIG
+-    PKG_CONFIG = os.getenv('PKG_CONFIG', 'pkg-config')
+-    xml2_version = get_library_version(PKG_CONFIG, 'libxml-2.0')
+-    if xml2_version:
+-        xslt_version = get_library_version(PKG_CONFIG, 'libxslt')
+-        if xml2_version and xslt_version:
+-            return xml2_version, xslt_version
+-
+-    # Try xml2-config and xslt-config
+-    XML2_CONFIG = os.getenv('XML2_CONFIG', 'xml2-config')
+-    xml2_version = get_library_version(XML2_CONFIG)
+-    if xml2_version:
+-        XSLT_CONFIG = os.getenv('XSLT_CONFIG', 'xslt-config')
+-        xslt_version = get_library_version(XSLT_CONFIG)
+-        if xml2_version and xslt_version:
+-            return xml2_version, xslt_version
+-
+-    # One or both build dependencies not found. Fail on Linux platforms only.
+-    if sys.platform.startswith('win'):
+-        return '', ''
+-    print("Error: Please make sure the libxml2 and libxslt development packages are installed.")
+-    sys.exit(1)
+-
+-
+-def check_build_dependencies():
+-    xml2_version, xslt_version = get_library_versions()
+-
+-    xml2_ok = check_min_version(xml2_version, '2.7.0', 'libxml2')
+-    xslt_ok = check_min_version(xslt_version, '1.1.23', 'libxslt')
+-
+-    if xml2_version and xslt_version:
+-        print("Building against libxml2 %s and libxslt %s" % (xml2_version, xslt_version))
+-    else:
+-        print("Building against pre-built libxml2 andl libxslt libraries")
+-
+-    return (xml2_ok and xslt_ok)
+-
+-
+-def get_flags(prog, option, libname=None):
+-    if libname:
+-        return run_command(prog, '--%s %s' % (option, libname))
+-    else:
+-        return run_command(prog, '--%s' % option)
++    xml2_version = get_library_version(find_xml2_config())
++    xslt_version = get_library_version(find_xslt_config())
++    return xml2_version, xslt_version
+ 
+ 
+ def flags(option):
+-    if XML2_CONFIG:
+-        xml2_flags = get_flags(XML2_CONFIG, option)
+-        xslt_flags = get_flags(XSLT_CONFIG, option)
+-    else:
+-        xml2_flags = get_flags(PKG_CONFIG, option, 'libxml-2.0')
+-        xslt_flags = get_flags(PKG_CONFIG, option, 'libxslt')
++    xml2_flags = run_command(find_xml2_config(), "--%s" % option)
++    xslt_flags = run_command(find_xslt_config(), "--%s" % option)
+ 
+     flag_list = xml2_flags.split()
+     for flag in xslt_flags.split():
+@@ -474,6 +418,37 @@ def flags(option):
+ def get_xcode_isysroot():
+     return run_command('xcrun', '--show-sdk-path')
+ 
++XSLT_CONFIG = None
++XML2_CONFIG = None
++
++def find_xml2_config():
++    global XML2_CONFIG
++    if XML2_CONFIG:
++        return XML2_CONFIG
++    option = '--with-xml2-config='
++    for arg in sys.argv:
++        if arg.startswith(option):
++            sys.argv.remove(arg)
++            XML2_CONFIG = arg[len(option):]
++            return XML2_CONFIG
++    else:
++        # default: do nothing, rely only on xslt-config
++        XML2_CONFIG = os.getenv('XML2_CONFIG', '')
++    return XML2_CONFIG
++
++def find_xslt_config():
++    global XSLT_CONFIG
++    if XSLT_CONFIG:
++        return XSLT_CONFIG
++    option = '--with-xslt-config='
++    for arg in sys.argv:
++        if arg.startswith(option):
++            sys.argv.remove(arg)
++            XSLT_CONFIG = arg[len(option):]
++            return XSLT_CONFIG
++    else:
++        XSLT_CONFIG = os.getenv('XSLT_CONFIG', 'xslt-config')
++    return XSLT_CONFIG
+ 
+ ## Option handling:
+ 
+@@ -526,8 +501,6 @@ OPTION_AUTO_RPATH = has_option('auto-rpath')
+ OPTION_BUILD_LIBXML2XSLT = staticbuild or has_option('static-deps')
+ if OPTION_BUILD_LIBXML2XSLT:
+     OPTION_STATIC = True
+-OPTION_WITH_XML2_CONFIG = option_value('xml2-config')
+-OPTION_WITH_XSLT_CONFIG = option_value('xslt-config')
+ OPTION_LIBXML2_VERSION = option_value('libxml2-version')
+ OPTION_LIBXSLT_VERSION = option_value('libxslt-version')
+ OPTION_LIBICONV_VERSION = option_value('libiconv-version')
+-- 
+2.17.1
+
meta-python/recipes-devtools/python/python3-lxml_4.5.1.bb renamed from meta-python/recipes-devtools/python/python3-lxml_4.5.0.bb +3 -2
similarity index 91%
rename from meta-python/recipes-devtools/python/python3-lxml_4.5.0.bb
rename to meta-python/recipes-devtools/python/python3-lxml_4.5.1.bb
index e3cfa46d1..8ab657475 100644
@@ -18,8 +18,9 @@ LIC_FILES_CHKSUM = "file://LICENSES.txt;md5=e4c045ebad958ead4b48008f70838403 \
 
 DEPENDS += "libxml2 libxslt"
 
-SRC_URI[md5sum] = "f088e452ed45b030b6f84269f1e84d11"
-SRC_URI[sha256sum] = "8620ce80f50d023d414183bf90cc2576c2837b88e00bea3f33ad2630133bbb60"
+SRC_URI += "file://0001-setupinfo.py-Revert-changes.patch"
+SRC_URI[md5sum] = "4d3cca9c0018dd98f39e0ac54fcc3d14"
+SRC_URI[sha256sum] = "27ee0faf8077c7c1a589573b1450743011117f1aa1a91d5ae776bbc5ca6070f2"
 
 DISTUTILS_BUILD_ARGS += " \
                      --with-xslt-config='pkg-config libxslt' \
Signature · 1 line
2.17.1
Acked-by on v1 2/7
#2 lore raw

Re: [oe] [meta-python][PATCH 2/7] python3-lxml: Upgrade 4.5.0 -> 4.5.1

Quoted 6 lines · Leon Anavi

Upgrade to release 4.5.1 but keep setupinfo.py from 4.5.0 because the new version doesn't support properly arguments --with-xslt-config and --with-xml2-config as well as retriving versions of dependencies.

Quoted 271 lines
---
  .../0001-setupinfo.py-Revert-changes.patch    | 237 ++++++++++++++++++
  ...n3-lxml_4.5.0.bb => python3-lxml_4.5.1.bb} |   5 +-
  2 files changed, 240 insertions(+), 2 deletions(-)

create mode 100644 meta-python/recipes-devtools/python/python3-lxml/0001-setupinfo.py-Revert-changes.patch rename meta-python/recipes-devtools/python/{python3-lxml_4.5.0.bb => python3-lxml_4.5.1.bb} (91%)

meta-python/recipes-devtools/python/python3-lxml/0001-setupinfo.py-Revert-changes.patch new file +237 -0
new file mode 100644
index 000000000..d6e63712c
@@ -0,0 +1,237 @@
+From 24d0c9885b7a259b61a28eb440d0c0585016d73b Mon Sep 17 00:00:00 2001
+From: Leon Anavi <[email protected]>
+Date: Mon, 8 Jun 2020 13:05:23 +0300
+Subject: [PATCH] setupinfo.py: Revert changes
+
+Use setupinfo.py from release 4.5.0 to revert changes replacing
+--with-xslt-config and --with-xml2-config with --xslt-config and
+--xml2-config as well as to properly determine versions of
+dependencies.
+
+Signed-off-by: Leon Anavi <[email protected]>
+---
+ setupinfo.py | 155 +++++++++++++++++++++------------------------------
+ 1 file changed, 64 insertions(+), 91 deletions(-)
+
+diff --git a/setupinfo.py b/setupinfo.py
+index cf195245..5a833d45 100644
+--- a/setupinfo.py
++++ b/setupinfo.py
+@@ -2,7 +2,6 @@ import sys
+ import io
+ import os
+ import os.path
+-import subprocess
+ from distutils.core import Extension
+ from distutils.errors import CompileError, DistutilsOptionError
+ from distutils.command.build_ext import build_ext as _build_ext
+@@ -110,7 +109,17 @@ def ext_modules(static_include_dirs, static_library_dirs,
+         use_cython = False
+         print("Building without Cython.")
+
+-    if not check_build_dependencies():
++    lib_versions = get_library_versions()
++    versions_ok = True
++    if lib_versions[0]:
++        print("Using build configuration of libxml2 %s and libxslt %s" %
++              lib_versions)
++        versions_ok = check_min_version(lib_versions[0], (2, 7, 0), 'libxml2')
++    else:
++        print("Using build configuration of libxslt %s" %
++              lib_versions[1])
++    versions_ok |= check_min_version(lib_versions[1], (1, 1, 23), 'libxslt')
++    if not versions_ok:
+         raise RuntimeError("Dependency missing")
+
+     base_dir = get_base_dir()
+@@ -351,118 +360,53 @@ def define_macros():
+     macros.append(('CYTHON_CLINE_IN_TRACEBACK', '1' if OPTION_WITH_CLINES else '0'))
+     return macros
+
++_ERROR_PRINTED = False
+
+ def run_command(cmd, *args):
+     if not cmd:
+         return ''
+     if args:
+         cmd = ' '.join((cmd,) + args)
+-
++    import subprocess
+     p = subprocess.Popen(cmd, shell=True,
+                          stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+     stdout_data, errors = p.communicate()
+-
+-    if errors:
+-        return ''
++    global _ERROR_PRINTED
++    if errors and not _ERROR_PRINTED:
++        _ERROR_PRINTED = True
++        print("ERROR: %s" % errors)
++        print("** make sure the development packages of libxml2 and libxslt are installed **\n")
+     return decode_input(stdout_data).strip()
+
+
+-def check_min_version(version, min_version, libname):
++def check_min_version(version, min_version, error_name):
+     if not version:
+         # this is ok for targets like sdist etc.
+         return True
+-    lib_version = tuple(map(int, version.split('.')[:3]))
+-    req_version = tuple(map(int, min_version.split('.')[:3]))
+-    if lib_version < req_version:
+-        print("Minimum required version of %s is %s. Your system has version %s." % (
+-            libname, min_version, version))
++    version = tuple(map(int, version.split('.')[:3]))
++    min_version = tuple(min_version)
++    if version < min_version:
++        print("Minimum required version of %s is %s, found %s" % (
++            error_name, '.'.join(map(str, version)), '.'.join(map(str, min_version))))
+         return False
+     return True
+
+
+-def get_library_version(prog, libname=None):
+-    if libname:
+-        return run_command(prog, '--modversion %s' % libname)
+-    else:
+-        return run_command(prog, '--version')
+-
++def get_library_version(config_tool):
++    is_pkgconfig = "pkg-config" in config_tool
++    return run_command(config_tool,
++                       "--modversion" if is_pkgconfig else "--version")
+
+-PKG_CONFIG = None
+-XML2_CONFIG = None
+-XSLT_CONFIG = None
+
+ def get_library_versions():
+-    global XML2_CONFIG, XSLT_CONFIG
+-
+-    # Pre-built libraries
+-    if XML2_CONFIG and XSLT_CONFIG:
+-        xml2_version = get_library_version(XML2_CONFIG)
+-        xslt_version = get_library_version(XSLT_CONFIG)
+-        return xml2_version, xslt_version
+-
+-    # Path to xml2-config and xslt-config specified on the command line
+-    if OPTION_WITH_XML2_CONFIG:
+-        xml2_version = get_library_version(OPTION_WITH_XML2_CONFIG)
+-        if xml2_version and OPTION_WITH_XSLT_CONFIG:
+-            xslt_version = get_library_version(OPTION_WITH_XSLT_CONFIG)
+-            if xslt_version:
+-                XML2_CONFIG = OPTION_WITH_XML2_CONFIG
+-                XSLT_CONFIG = OPTION_WITH_XSLT_CONFIG
+-                return xml2_version, xslt_version
+-
+-    # Try pkg-config
+-    global PKG_CONFIG
+-    PKG_CONFIG = os.getenv('PKG_CONFIG', 'pkg-config')
+-    xml2_version = get_library_version(PKG_CONFIG, 'libxml-2.0')
+-    if xml2_version:
+-        xslt_version = get_library_version(PKG_CONFIG, 'libxslt')
+-        if xml2_version and xslt_version:
+-            return xml2_version, xslt_version
+-
+-    # Try xml2-config and xslt-config
+-    XML2_CONFIG = os.getenv('XML2_CONFIG', 'xml2-config')
+-    xml2_version = get_library_version(XML2_CONFIG)
+-    if xml2_version:
+-        XSLT_CONFIG = os.getenv('XSLT_CONFIG', 'xslt-config')
+-        xslt_version = get_library_version(XSLT_CONFIG)
+-        if xml2_version and xslt_version:
+-            return xml2_version, xslt_version
+-
+-    # One or both build dependencies not found. Fail on Linux platforms only.
+-    if sys.platform.startswith('win'):
+-        return '', ''
+-    print("Error: Please make sure the libxml2 and libxslt development packages are installed.")
+-    sys.exit(1)
+-
+-
+-def check_build_dependencies():
+-    xml2_version, xslt_version = get_library_versions()
+-
+-    xml2_ok = check_min_version(xml2_version, '2.7.0', 'libxml2')
+-    xslt_ok = check_min_version(xslt_version, '1.1.23', 'libxslt')
+-
+-    if xml2_version and xslt_version:
+-        print("Building against libxml2 %s and libxslt %s" % (xml2_version, xslt_version))
+-    else:
+-        print("Building against pre-built libxml2 andl libxslt libraries")
+-
+-    return (xml2_ok and xslt_ok)
+-
+-
+-def get_flags(prog, option, libname=None):
+-    if libname:
+-        return run_command(prog, '--%s %s' % (option, libname))
+-    else:
+-        return run_command(prog, '--%s' % option)
++    xml2_version = get_library_version(find_xml2_config())
++    xslt_version = get_library_version(find_xslt_config())
++    return xml2_version, xslt_version
+
+
+ def flags(option):
+-    if XML2_CONFIG:
+-        xml2_flags = get_flags(XML2_CONFIG, option)
+-        xslt_flags = get_flags(XSLT_CONFIG, option)
+-    else:
+-        xml2_flags = get_flags(PKG_CONFIG, option, 'libxml-2.0')
+-        xslt_flags = get_flags(PKG_CONFIG, option, 'libxslt')
++    xml2_flags = run_command(find_xml2_config(), "--%s" % option)
++    xslt_flags = run_command(find_xslt_config(), "--%s" % option)
+
+     flag_list = xml2_flags.split()
+     for flag in xslt_flags.split():
+@@ -474,6 +418,37 @@ def flags(option):
+ def get_xcode_isysroot():
+     return run_command('xcrun', '--show-sdk-path')
+
++XSLT_CONFIG = None
++XML2_CONFIG = None
++
++def find_xml2_config():
++    global XML2_CONFIG
++    if XML2_CONFIG:
++        return XML2_CONFIG
++    option = '--with-xml2-config='
++    for arg in sys.argv:
++        if arg.startswith(option):
++            sys.argv.remove(arg)
++            XML2_CONFIG = arg[len(option):]
++            return XML2_CONFIG
++    else:
++        # default: do nothing, rely only on xslt-config
++        XML2_CONFIG = os.getenv('XML2_CONFIG', '')
++    return XML2_CONFIG
++
++def find_xslt_config():
++    global XSLT_CONFIG
++    if XSLT_CONFIG:
++        return XSLT_CONFIG
++    option = '--with-xslt-config='
++    for arg in sys.argv:
++        if arg.startswith(option):
++            sys.argv.remove(arg)
++            XSLT_CONFIG = arg[len(option):]
++            return XSLT_CONFIG
++    else:
++        XSLT_CONFIG = os.getenv('XSLT_CONFIG', 'xslt-config')
++    return XSLT_CONFIG
+
+ ## Option handling:
+
+@@ -526,8 +501,6 @@ OPTION_AUTO_RPATH = has_option('auto-rpath')
+ OPTION_BUILD_LIBXML2XSLT = staticbuild or has_option('static-deps')
+ if OPTION_BUILD_LIBXML2XSLT:
+     OPTION_STATIC = True
+-OPTION_WITH_XML2_CONFIG = option_value('xml2-config')
+-OPTION_WITH_XSLT_CONFIG = option_value('xslt-config')
+ OPTION_LIBXML2_VERSION = option_value('libxml2-version')
+ OPTION_LIBXSLT_VERSION = option_value('libxslt-version')
+ OPTION_LIBICONV_VERSION = option_value('libiconv-version')
+--
+2.17.1
+
meta-python/recipes-devtools/python/python3-lxml_4.5.1.bb renamed from meta-python/recipes-devtools/python/python3-lxml_4.5.0.bb +3 -2
similarity index 91%
rename from meta-python/recipes-devtools/python/python3-lxml_4.5.0.bb
rename to meta-python/recipes-devtools/python/python3-lxml_4.5.1.bb
index e3cfa46d1..8ab657475 100644
@@ -18,8 +18,9 @@ LIC_FILES_CHKSUM = "file://LICENSES.txt;md5=e4c045ebad958ead4b48008f70838403 \
 
  DEPENDS += "libxml2 libxslt"
 
-SRC_URI[md5sum] = "f088e452ed45b030b6f84269f1e84d11"
-SRC_URI[sha256sum] = "8620ce80f50d023d414183bf90cc2576c2837b88e00bea3f33ad2630133bbb60"
+SRC_URI += "file://0001-setupinfo.py-Revert-changes.patch"
+SRC_URI[md5sum] = "4d3cca9c0018dd98f39e0ac54fcc3d14"
+SRC_URI[sha256sum] = "27ee0faf8077c7c1a589573b1450743011117f1aa1a91d5ae776bbc5ca6070f2"
 
  DISTUTILS_BUILD_ARGS += " \
                       --with-xslt-config='pkg-config libxslt' \
author
#3 lore raw

Re: [oe] [meta-python][PATCH 2/7] python3-lxml: Upgrade 4.5.0 -> 4.5.1

Hi Trevor,

Please note that earlier today I've submitted v2 of this patch:
https://lists.openembedded.org/g/openembedded-devel/topic/meta_python_patchv2/74793461?p=,,,20,0,0,0::recentpostdate%2Fsticky,,,20,2,0,74793461

Following a discussion with the maintainer and the contributors of lxml I've implemented a better way that they suggested without using the flags and without patching setupinfo.py:
https://github.com/lxml/lxml/pull/297#issuecomment-641220205

Best regards,
Leon

Quoted 279 lines · Trevor Gamblin
Quoted 6 lines · Leon Anavi

Upgrade to release 4.5.1 but keep setupinfo.py from 4.5.0 because the new version doesn't support properly arguments --with-xslt-config and --with-xml2-config as well as retriving versions of dependencies.

Quoted 269 lines
---
  .../0001-setupinfo.py-Revert-changes.patch    | 237 ++++++++++++++++++
  ...n3-lxml_4.5.0.bb => python3-lxml_4.5.1.bb} |   5 +-
  2 files changed, 240 insertions(+), 2 deletions(-)

create mode 100644 meta-python/recipes-devtools/python/python3-lxml/0001-setupinfo.py-Revert-changes.patch rename meta-python/recipes-devtools/python/{python3-lxml_4.5.0.bb => python3-lxml_4.5.1.bb} (91%)

meta-python/recipes-devtools/python/python3-lxml/0001-setupinfo.py-Revert-changes.patch new file +237 -0
new file mode 100644
index 000000000..d6e63712c
@@ -0,0 +1,237 @@
+From 24d0c9885b7a259b61a28eb440d0c0585016d73b Mon Sep 17 00:00:00 2001
+From: Leon Anavi<[email protected]>
+Date: Mon, 8 Jun 2020 13:05:23 +0300
+Subject: [PATCH] setupinfo.py: Revert changes
+
+Use setupinfo.py from release 4.5.0 to revert changes replacing
+--with-xslt-config and --with-xml2-config with --xslt-config and
+--xml2-config as well as to properly determine versions of
+dependencies.
+
+Signed-off-by: Leon Anavi<[email protected]>
+---
+ setupinfo.py | 155 +++++++++++++++++++++------------------------------
+ 1 file changed, 64 insertions(+), 91 deletions(-)
+
+diff --git a/setupinfo.py b/setupinfo.py
+index cf195245..5a833d45 100644
+--- a/setupinfo.py
++++ b/setupinfo.py
+@@ -2,7 +2,6 @@ import sys
+ import io
+ import os
+ import os.path
+-import subprocess
+ from distutils.core import Extension
+ from distutils.errors import CompileError, DistutilsOptionError
+ from distutils.command.build_ext import build_ext as _build_ext
+@@ -110,7 +109,17 @@ def ext_modules(static_include_dirs, static_library_dirs,
+         use_cython = False
+         print("Building without Cython.")
+
+-    if not check_build_dependencies():
++    lib_versions = get_library_versions()
++    versions_ok = True
++    if lib_versions[0]:
++        print("Using build configuration of libxml2 %s and libxslt %s" %
++              lib_versions)
++        versions_ok = check_min_version(lib_versions[0], (2, 7, 0), 'libxml2')
++    else:
++        print("Using build configuration of libxslt %s" %
++              lib_versions[1])
++    versions_ok |= check_min_version(lib_versions[1], (1, 1, 23), 'libxslt')
++    if not versions_ok:
+         raise RuntimeError("Dependency missing")
+
+     base_dir = get_base_dir()
+@@ -351,118 +360,53 @@ def define_macros():
+     macros.append(('CYTHON_CLINE_IN_TRACEBACK', '1' if OPTION_WITH_CLINES else '0'))
+     return macros
+
++_ERROR_PRINTED = False
+
+ def run_command(cmd, *args):
+     if not cmd:
+         return ''
+     if args:
+         cmd = ' '.join((cmd,) + args)
+-
++    import subprocess
+     p = subprocess.Popen(cmd, shell=True,
+                          stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+     stdout_data, errors = p.communicate()
+-
+-    if errors:
+-        return ''
++    global _ERROR_PRINTED
++    if errors and not _ERROR_PRINTED:
++        _ERROR_PRINTED = True
++        print("ERROR: %s" % errors)
++        print("** make sure the development packages of libxml2 and libxslt are installed **\n")
+     return decode_input(stdout_data).strip()
+
+
+-def check_min_version(version, min_version, libname):
++def check_min_version(version, min_version, error_name):
+     if not version:
+         # this is ok for targets like sdist etc.
+         return True
+-    lib_version = tuple(map(int, version.split('.')[:3]))
+-    req_version = tuple(map(int, min_version.split('.')[:3]))
+-    if lib_version < req_version:
+-        print("Minimum required version of %s is %s. Your system has version %s." % (
+-            libname, min_version, version))
++    version = tuple(map(int, version.split('.')[:3]))
++    min_version = tuple(min_version)
++    if version < min_version:
++        print("Minimum required version of %s is %s, found %s" % (
++            error_name, '.'.join(map(str, version)), '.'.join(map(str, min_version))))
+         return False
+     return True
+
+
+-def get_library_version(prog, libname=None):
+-    if libname:
+-        return run_command(prog, '--modversion %s' % libname)
+-    else:
+-        return run_command(prog, '--version')
+-
++def get_library_version(config_tool):
++    is_pkgconfig = "pkg-config" in config_tool
++    return run_command(config_tool,
++                       "--modversion" if is_pkgconfig else "--version")
+
+-PKG_CONFIG = None
+-XML2_CONFIG = None
+-XSLT_CONFIG = None
+
+ def get_library_versions():
+-    global XML2_CONFIG, XSLT_CONFIG
+-
+-    # Pre-built libraries
+-    if XML2_CONFIG and XSLT_CONFIG:
+-        xml2_version = get_library_version(XML2_CONFIG)
+-        xslt_version = get_library_version(XSLT_CONFIG)
+-        return xml2_version, xslt_version
+-
+-    # Path to xml2-config and xslt-config specified on the command line
+-    if OPTION_WITH_XML2_CONFIG:
+-        xml2_version = get_library_version(OPTION_WITH_XML2_CONFIG)
+-        if xml2_version and OPTION_WITH_XSLT_CONFIG:
+-            xslt_version = get_library_version(OPTION_WITH_XSLT_CONFIG)
+-            if xslt_version:
+-                XML2_CONFIG = OPTION_WITH_XML2_CONFIG
+-                XSLT_CONFIG = OPTION_WITH_XSLT_CONFIG
+-                return xml2_version, xslt_version
+-
+-    # Try pkg-config
+-    global PKG_CONFIG
+-    PKG_CONFIG = os.getenv('PKG_CONFIG', 'pkg-config')
+-    xml2_version = get_library_version(PKG_CONFIG, 'libxml-2.0')
+-    if xml2_version:
+-        xslt_version = get_library_version(PKG_CONFIG, 'libxslt')
+-        if xml2_version and xslt_version:
+-            return xml2_version, xslt_version
+-
+-    # Try xml2-config and xslt-config
+-    XML2_CONFIG = os.getenv('XML2_CONFIG', 'xml2-config')
+-    xml2_version = get_library_version(XML2_CONFIG)
+-    if xml2_version:
+-        XSLT_CONFIG = os.getenv('XSLT_CONFIG', 'xslt-config')
+-        xslt_version = get_library_version(XSLT_CONFIG)
+-        if xml2_version and xslt_version:
+-            return xml2_version, xslt_version
+-
+-    # One or both build dependencies not found. Fail on Linux platforms only.
+-    if sys.platform.startswith('win'):
+-        return '', ''
+-    print("Error: Please make sure the libxml2 and libxslt development packages are installed.")
+-    sys.exit(1)
+-
+-
+-def check_build_dependencies():
+-    xml2_version, xslt_version = get_library_versions()
+-
+-    xml2_ok = check_min_version(xml2_version, '2.7.0', 'libxml2')
+-    xslt_ok = check_min_version(xslt_version, '1.1.23', 'libxslt')
+-
+-    if xml2_version and xslt_version:
+-        print("Building against libxml2 %s and libxslt %s" % (xml2_version, xslt_version))
+-    else:
+-        print("Building against pre-built libxml2 andl libxslt libraries")
+-
+-    return (xml2_ok and xslt_ok)
+-
+-
+-def get_flags(prog, option, libname=None):
+-    if libname:
+-        return run_command(prog, '--%s %s' % (option, libname))
+-    else:
+-        return run_command(prog, '--%s' % option)
++    xml2_version = get_library_version(find_xml2_config())
++    xslt_version = get_library_version(find_xslt_config())
++    return xml2_version, xslt_version
+
+
+ def flags(option):
+-    if XML2_CONFIG:
+-        xml2_flags = get_flags(XML2_CONFIG, option)
+-        xslt_flags = get_flags(XSLT_CONFIG, option)
+-    else:
+-        xml2_flags = get_flags(PKG_CONFIG, option, 'libxml-2.0')
+-        xslt_flags = get_flags(PKG_CONFIG, option, 'libxslt')
++    xml2_flags = run_command(find_xml2_config(), "--%s" % option)
++    xslt_flags = run_command(find_xslt_config(), "--%s" % option)
+
+     flag_list = xml2_flags.split()
+     for flag in xslt_flags.split():
+@@ -474,6 +418,37 @@ def flags(option):
+ def get_xcode_isysroot():
+     return run_command('xcrun', '--show-sdk-path')
+
++XSLT_CONFIG = None
++XML2_CONFIG = None
++
++def find_xml2_config():
++    global XML2_CONFIG
++    if XML2_CONFIG:
++        return XML2_CONFIG
++    option = '--with-xml2-config='
++    for arg in sys.argv:
++        if arg.startswith(option):
++            sys.argv.remove(arg)
++            XML2_CONFIG = arg[len(option):]
++            return XML2_CONFIG
++    else:
++        # default: do nothing, rely only on xslt-config
++        XML2_CONFIG = os.getenv('XML2_CONFIG', '')
++    return XML2_CONFIG
++
++def find_xslt_config():
++    global XSLT_CONFIG
++    if XSLT_CONFIG:
++        return XSLT_CONFIG
++    option = '--with-xslt-config='
++    for arg in sys.argv:
++        if arg.startswith(option):
++            sys.argv.remove(arg)
++            XSLT_CONFIG = arg[len(option):]
++            return XSLT_CONFIG
++    else:
++        XSLT_CONFIG = os.getenv('XSLT_CONFIG', 'xslt-config')
++    return XSLT_CONFIG
+
+ ## Option handling:
+
+@@ -526,8 +501,6 @@ OPTION_AUTO_RPATH = has_option('auto-rpath')
+ OPTION_BUILD_LIBXML2XSLT = staticbuild or has_option('static-deps')
+ if OPTION_BUILD_LIBXML2XSLT:
+     OPTION_STATIC = True
+-OPTION_WITH_XML2_CONFIG = option_value('xml2-config')
+-OPTION_WITH_XSLT_CONFIG = option_value('xslt-config')
+ OPTION_LIBXML2_VERSION = option_value('libxml2-version')
+ OPTION_LIBXSLT_VERSION = option_value('libxslt-version')
+ OPTION_LIBICONV_VERSION = option_value('libiconv-version')
+--
+2.17.1
+
meta-python/recipes-devtools/python/python3-lxml_4.5.1.bb renamed from meta-python/recipes-devtools/python/python3-lxml_4.5.0.bb +3 -2
similarity index 91%
rename from meta-python/recipes-devtools/python/python3-lxml_4.5.0.bb
rename to meta-python/recipes-devtools/python/python3-lxml_4.5.1.bb
index e3cfa46d1..8ab657475 100644
@@ -18,8 +18,9 @@ LIC_FILES_CHKSUM ="file://LICENSES.txt;md5=e4c045ebad958ead4b48008f70838403 \ DEPENDS += "libxml2 libxslt"
 
-SRC_URI[md5sum] = "f088e452ed45b030b6f84269f1e84d11"
-SRC_URI[sha256sum] = "8620ce80f50d023d414183bf90cc2576c2837b88e00bea3f33ad2630133bbb60"
+SRC_URI +="file://0001-setupinfo.py-Revert-changes.patch"
+SRC_URI[md5sum] = "4d3cca9c0018dd98f39e0ac54fcc3d14"
+SRC_URI[sha256sum] = "27ee0faf8077c7c1a589573b1450743011117f1aa1a91d5ae776bbc5ca6070f2"
 
  DISTUTILS_BUILD_ARGS += " \
                       --with-xslt-config='pkg-config libxslt' \
 
 
Signature · 3 lines
Leon Anavi
Software Engineer
konsulko.com
#4 lore raw

Re: [oe] [meta-python][PATCH 2/7] python3-lxml: Upgrade 4.5.0 -> 4.5.1

Quoted 9 lines · Leon Anavi

Hi Trevor,

Please note that earlier today I've submitted v2 of this patch:
https://lists.openembedded.org/g/openembedded-devel/topic/meta_python_patchv2/74793461?p=,,,20,0,0,0::recentpostdate%2Fsticky,,,20,2,0,74793461

Following a discussion with the maintainer and the contributors of lxml I've implemented a better way that they suggested without using the flags and without patching setupinfo.py:
https://github.com/lxml/lxml/pull/297#issuecomment-641220205

Ah, I see it now. I'll throw that on the queue. Thanks!

Quoted 289 lines

Best regards,
Leon

Quoted 279 lines · Trevor Gamblin
Quoted 6 lines · Leon Anavi

Upgrade to release 4.5.1 but keep setupinfo.py from 4.5.0 because the new version doesn't support properly arguments --with-xslt-config and --with-xml2-config as well as retriving versions of dependencies.

Quoted 269 lines
---
  .../0001-setupinfo.py-Revert-changes.patch    | 237 ++++++++++++++++++
  ...n3-lxml_4.5.0.bb => python3-lxml_4.5.1.bb} |   5 +-
  2 files changed, 240 insertions(+), 2 deletions(-)

create mode 100644 meta-python/recipes-devtools/python/python3-lxml/0001-setupinfo.py-Revert-changes.patch rename meta-python/recipes-devtools/python/{python3-lxml_4.5.0.bb => python3-lxml_4.5.1.bb} (91%)

meta-python/recipes-devtools/python/python3-lxml/0001-setupinfo.py-Revert-changes.patch new file +237 -0
new file mode 100644
index 000000000..d6e63712c
@@ -0,0 +1,237 @@
+From 24d0c9885b7a259b61a28eb440d0c0585016d73b Mon Sep 17 00:00:00 2001
+From: Leon Anavi<[email protected]>
+Date: Mon, 8 Jun 2020 13:05:23 +0300
+Subject: [PATCH] setupinfo.py: Revert changes
+
+Use setupinfo.py from release 4.5.0 to revert changes replacing
+--with-xslt-config and --with-xml2-config with --xslt-config and
+--xml2-config as well as to properly determine versions of
+dependencies.
+
+Signed-off-by: Leon Anavi<[email protected]>
+---
+ setupinfo.py | 155 +++++++++++++++++++++------------------------------
+ 1 file changed, 64 insertions(+), 91 deletions(-)
+
+diff --git a/setupinfo.py b/setupinfo.py
+index cf195245..5a833d45 100644
+--- a/setupinfo.py
++++ b/setupinfo.py
+@@ -2,7 +2,6 @@ import sys
+ import io
+ import os
+ import os.path
+-import subprocess
+ from distutils.core import Extension
+ from distutils.errors import CompileError, DistutilsOptionError
+ from distutils.command.build_ext import build_ext as _build_ext
+@@ -110,7 +109,17 @@ def ext_modules(static_include_dirs, static_library_dirs,
+         use_cython = False
+         print("Building without Cython.")
+
+-    if not check_build_dependencies():
++    lib_versions = get_library_versions()
++    versions_ok = True
++    if lib_versions[0]:
++        print("Using build configuration of libxml2 %s and libxslt %s" %
++              lib_versions)
++        versions_ok = check_min_version(lib_versions[0], (2, 7, 0), 'libxml2')
++    else:
++        print("Using build configuration of libxslt %s" %
++              lib_versions[1])
++    versions_ok |= check_min_version(lib_versions[1], (1, 1, 23), 'libxslt')
++    if not versions_ok:
+         raise RuntimeError("Dependency missing")
+
+     base_dir = get_base_dir()
+@@ -351,118 +360,53 @@ def define_macros():
+     macros.append(('CYTHON_CLINE_IN_TRACEBACK', '1' if OPTION_WITH_CLINES else '0'))
+     return macros
+
++_ERROR_PRINTED = False
+
+ def run_command(cmd, *args):
+     if not cmd:
+         return ''
+     if args:
+         cmd = ' '.join((cmd,) + args)
+-
++    import subprocess
+     p = subprocess.Popen(cmd, shell=True,
+                          stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+     stdout_data, errors = p.communicate()
+-
+-    if errors:
+-        return ''
++    global _ERROR_PRINTED
++    if errors and not _ERROR_PRINTED:
++        _ERROR_PRINTED = True
++        print("ERROR: %s" % errors)
++        print("** make sure the development packages of libxml2 and libxslt are installed **\n")
+     return decode_input(stdout_data).strip()
+
+
+-def check_min_version(version, min_version, libname):
++def check_min_version(version, min_version, error_name):
+     if not version:
+         # this is ok for targets like sdist etc.
+         return True
+-    lib_version = tuple(map(int, version.split('.')[:3]))
+-    req_version = tuple(map(int, min_version.split('.')[:3]))
+-    if lib_version < req_version:
+-        print("Minimum required version of %s is %s. Your system has version %s." % (
+-            libname, min_version, version))
++    version = tuple(map(int, version.split('.')[:3]))
++    min_version = tuple(min_version)
++    if version < min_version:
++        print("Minimum required version of %s is %s, found %s" % (
++            error_name, '.'.join(map(str, version)), '.'.join(map(str, min_version))))
+         return False
+     return True
+
+
+-def get_library_version(prog, libname=None):
+-    if libname:
+-        return run_command(prog, '--modversion %s' % libname)
+-    else:
+-        return run_command(prog, '--version')
+-
++def get_library_version(config_tool):
++    is_pkgconfig = "pkg-config" in config_tool
++    return run_command(config_tool,
++                       "--modversion" if is_pkgconfig else "--version")
+
+-PKG_CONFIG = None
+-XML2_CONFIG = None
+-XSLT_CONFIG = None
+
+ def get_library_versions():
+-    global XML2_CONFIG, XSLT_CONFIG
+-
+-    # Pre-built libraries
+-    if XML2_CONFIG and XSLT_CONFIG:
+-        xml2_version = get_library_version(XML2_CONFIG)
+-        xslt_version = get_library_version(XSLT_CONFIG)
+-        return xml2_version, xslt_version
+-
+-    # Path to xml2-config and xslt-config specified on the command line
+-    if OPTION_WITH_XML2_CONFIG:
+-        xml2_version = get_library_version(OPTION_WITH_XML2_CONFIG)
+-        if xml2_version and OPTION_WITH_XSLT_CONFIG:
+-            xslt_version = get_library_version(OPTION_WITH_XSLT_CONFIG)
+-            if xslt_version:
+-                XML2_CONFIG = OPTION_WITH_XML2_CONFIG
+-                XSLT_CONFIG = OPTION_WITH_XSLT_CONFIG
+-                return xml2_version, xslt_version
+-
+-    # Try pkg-config
+-    global PKG_CONFIG
+-    PKG_CONFIG = os.getenv('PKG_CONFIG', 'pkg-config')
+-    xml2_version = get_library_version(PKG_CONFIG, 'libxml-2.0')
+-    if xml2_version:
+-        xslt_version = get_library_version(PKG_CONFIG, 'libxslt')
+-        if xml2_version and xslt_version:
+-            return xml2_version, xslt_version
+-
+-    # Try xml2-config and xslt-config
+-    XML2_CONFIG = os.getenv('XML2_CONFIG', 'xml2-config')
+-    xml2_version = get_library_version(XML2_CONFIG)
+-    if xml2_version:
+-        XSLT_CONFIG = os.getenv('XSLT_CONFIG', 'xslt-config')
+-        xslt_version = get_library_version(XSLT_CONFIG)
+-        if xml2_version and xslt_version:
+-            return xml2_version, xslt_version
+-
+-    # One or both build dependencies not found. Fail on Linux platforms only.
+-    if sys.platform.startswith('win'):
+-        return '', ''
+-    print("Error: Please make sure the libxml2 and libxslt development packages are installed.")
+-    sys.exit(1)
+-
+-
+-def check_build_dependencies():
+-    xml2_version, xslt_version = get_library_versions()
+-
+-    xml2_ok = check_min_version(xml2_version, '2.7.0', 'libxml2')
+-    xslt_ok = check_min_version(xslt_version, '1.1.23', 'libxslt')
+-
+-    if xml2_version and xslt_version:
+-        print("Building against libxml2 %s and libxslt %s" % (xml2_version, xslt_version))
+-    else:
+-        print("Building against pre-built libxml2 andl libxslt libraries")
+-
+-    return (xml2_ok and xslt_ok)
+-
+-
+-def get_flags(prog, option, libname=None):
+-    if libname:
+-        return run_command(prog, '--%s %s' % (option, libname))
+-    else:
+-        return run_command(prog, '--%s' % option)
++    xml2_version = get_library_version(find_xml2_config())
++    xslt_version = get_library_version(find_xslt_config())
++    return xml2_version, xslt_version
+
+
+ def flags(option):
+-    if XML2_CONFIG:
+-        xml2_flags = get_flags(XML2_CONFIG, option)
+-        xslt_flags = get_flags(XSLT_CONFIG, option)
+-    else:
+-        xml2_flags = get_flags(PKG_CONFIG, option, 'libxml-2.0')
+-        xslt_flags = get_flags(PKG_CONFIG, option, 'libxslt')
++    xml2_flags = run_command(find_xml2_config(), "--%s" % option)
++    xslt_flags = run_command(find_xslt_config(), "--%s" % option)
+
+     flag_list = xml2_flags.split()
+     for flag in xslt_flags.split():
+@@ -474,6 +418,37 @@ def flags(option):
+ def get_xcode_isysroot():
+     return run_command('xcrun', '--show-sdk-path')
+
++XSLT_CONFIG = None
++XML2_CONFIG = None
++
++def find_xml2_config():
++    global XML2_CONFIG
++    if XML2_CONFIG:
++        return XML2_CONFIG
++    option = '--with-xml2-config='
++    for arg in sys.argv:
++        if arg.startswith(option):
++            sys.argv.remove(arg)
++            XML2_CONFIG = arg[len(option):]
++            return XML2_CONFIG
++    else:
++        # default: do nothing, rely only on xslt-config
++        XML2_CONFIG = os.getenv('XML2_CONFIG', '')
++    return XML2_CONFIG
++
++def find_xslt_config():
++    global XSLT_CONFIG
++    if XSLT_CONFIG:
++        return XSLT_CONFIG
++    option = '--with-xslt-config='
++    for arg in sys.argv:
++        if arg.startswith(option):
++            sys.argv.remove(arg)
++            XSLT_CONFIG = arg[len(option):]
++            return XSLT_CONFIG
++    else:
++        XSLT_CONFIG = os.getenv('XSLT_CONFIG', 'xslt-config')
++    return XSLT_CONFIG
+
+ ## Option handling:
+
+@@ -526,8 +501,6 @@ OPTION_AUTO_RPATH = has_option('auto-rpath')
+ OPTION_BUILD_LIBXML2XSLT = staticbuild or has_option('static-deps')
+ if OPTION_BUILD_LIBXML2XSLT:
+     OPTION_STATIC = True
+-OPTION_WITH_XML2_CONFIG = option_value('xml2-config')
+-OPTION_WITH_XSLT_CONFIG = option_value('xslt-config')
+ OPTION_LIBXML2_VERSION = option_value('libxml2-version')
+ OPTION_LIBXSLT_VERSION = option_value('libxslt-version')
+ OPTION_LIBICONV_VERSION = option_value('libiconv-version')
+--
+2.17.1
+
meta-python/recipes-devtools/python/python3-lxml_4.5.1.bb renamed from meta-python/recipes-devtools/python/python3-lxml_4.5.0.bb +3 -2
similarity index 91%
rename from meta-python/recipes-devtools/python/python3-lxml_4.5.0.bb
rename to meta-python/recipes-devtools/python/python3-lxml_4.5.1.bb
index e3cfa46d1..8ab657475 100644
@@ -18,8 +18,9 @@ LIC_FILES_CHKSUM ="file://LICENSES.txt;md5=e4c045ebad958ead4b48008f70838403 \ DEPENDS += "libxml2 libxslt"
 
-SRC_URI[md5sum] = "f088e452ed45b030b6f84269f1e84d11"
-SRC_URI[sha256sum] = "8620ce80f50d023d414183bf90cc2576c2837b88e00bea3f33ad2630133bbb60"
+SRC_URI +="file://0001-setupinfo.py-Revert-changes.patch"
+SRC_URI[md5sum] = "4d3cca9c0018dd98f39e0ac54fcc3d14"
+SRC_URI[sha256sum] = "27ee0faf8077c7c1a589573b1450743011117f1aa1a91d5ae776bbc5ca6070f2"
 
  DISTUTILS_BUILD_ARGS += " \
                       --with-xslt-config='pkg-config libxslt' \
 
 
Signature · 3 lines
Leon Anavi
Software Engineer
konsulko.com
author
#5 lore raw

PATCH 3/7 python3-hyperlink: Consolidate in a single file

In reply to Leon Anavi

Consolidate inc and bb files into a single bb file.

---
 .../python/python-hyperlink.inc               | 17 -----------------
 .../python/python3-hyperlink_19.0.0.bb        | 19 +++++++++++++++++--
 2 files changed, 17 insertions(+), 19 deletions(-)
 delete mode 100644 meta-python/recipes-devtools/python/python-hyperlink.inc
meta-python/recipes-devtools/python/python-hyperlink.inc deleted +0 -17
deleted file mode 100644
index 653170ca6..000000000
@@ -1,17 +0,0 @@
-DESCRIPTION = "A featureful, correct URL for Python"
-HOMEPAGE = "https://github.com/python-hyper/hyperlink"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=3893d4ed05dcc823f8ed685a9ea19bcb"
-
-SRC_URI[sha256sum] = "4288e34705da077fada1111a24a0aa08bb1e76699c9ce49876af722441845654"
-SRC_URI[md5sum] = "4772fb4d87c26a1ab22a6161424e3cba"
-
-inherit pypi
-
-RDEPENDS_${PN} += "${PYTHON_PN}-stringold ${PYTHON_PN}-netclient ${PYTHON_PN}-idna"
-
-PACKAGES =. "${PN}-test "
-
-FILES_${PN}-test += " \
-        ${PYTHON_SITEPACKAGES_DIR}/hyperlinkt/test \
-"
meta-python/recipes-devtools/python/python3-hyperlink_19.0.0.bb +17 -2
index 70813bf34..3ee098ad6 100644
@@ -1,2 +1,17 @@
-inherit setuptools3
-require python-hyperlink.inc
+DESCRIPTION = "A featureful, correct URL for Python"
+HOMEPAGE = "https://github.com/python-hyper/hyperlink"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3893d4ed05dcc823f8ed685a9ea19bcb"
+
+SRC_URI[sha256sum] = "4288e34705da077fada1111a24a0aa08bb1e76699c9ce49876af722441845654"
+SRC_URI[md5sum] = "4772fb4d87c26a1ab22a6161424e3cba"
+
+inherit pypi setuptools3
+
+RDEPENDS_${PN} += "${PYTHON_PN}-stringold ${PYTHON_PN}-netclient ${PYTHON_PN}-idna"
+
+PACKAGES =. "${PN}-test "
+
+FILES_${PN}-test += " \
+        ${PYTHON_SITEPACKAGES_DIR}/hyperlinkt/test \
+"
Signature · 1 line
2.17.1
Acked-by on v1 3/7
#6 lore raw

Re: [oe] [meta-python][PATCH 3/7] python3-hyperlink: Consolidate in a single file

Quoted 3 lines · Leon Anavi

Consolidate inc and bb files into a single bb file.

Quoted 55 lines
---
  .../python/python-hyperlink.inc               | 17 -----------------
  .../python/python3-hyperlink_19.0.0.bb        | 19 +++++++++++++++++--
  2 files changed, 17 insertions(+), 19 deletions(-)

delete mode 100644 meta-python/recipes-devtools/python/python-hyperlink.inc

meta-python/recipes-devtools/python/python-hyperlink.inc deleted +0 -17
deleted file mode 100644
index 653170ca6..000000000
@@ -1,17 +0,0 @@
-DESCRIPTION = "A featureful, correct URL for Python"
-HOMEPAGE = "https://github.com/python-hyper/hyperlink"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=3893d4ed05dcc823f8ed685a9ea19bcb"
-
-SRC_URI[sha256sum] = "4288e34705da077fada1111a24a0aa08bb1e76699c9ce49876af722441845654"
-SRC_URI[md5sum] = "4772fb4d87c26a1ab22a6161424e3cba"
-
-inherit pypi
-
-RDEPENDS_${PN} += "${PYTHON_PN}-stringold ${PYTHON_PN}-netclient ${PYTHON_PN}-idna"
-
-PACKAGES =. "${PN}-test "
-
-FILES_${PN}-test += " \
-        ${PYTHON_SITEPACKAGES_DIR}/hyperlinkt/test \
-"
meta-python/recipes-devtools/python/python3-hyperlink_19.0.0.bb +17 -2
index 70813bf34..3ee098ad6 100644
@@ -1,2 +1,17 @@
-inherit setuptools3
-require python-hyperlink.inc
+DESCRIPTION = "A featureful, correct URL for Python"
+HOMEPAGE = "https://github.com/python-hyper/hyperlink"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3893d4ed05dcc823f8ed685a9ea19bcb"
+
+SRC_URI[sha256sum] = "4288e34705da077fada1111a24a0aa08bb1e76699c9ce49876af722441845654"
+SRC_URI[md5sum] = "4772fb4d87c26a1ab22a6161424e3cba"
+
+inherit pypi setuptools3
+
+RDEPENDS_${PN} += "${PYTHON_PN}-stringold ${PYTHON_PN}-netclient ${PYTHON_PN}-idna"
+
+PACKAGES =. "${PN}-test "
+
+FILES_${PN}-test += " \
+        ${PYTHON_SITEPACKAGES_DIR}/hyperlinkt/test \
+"
author
#7 lore raw

PATCH 4/7 python3-humanfriendly: Upgrade 4.18 -> 8.2

In reply to Leon Anavi

Upgrade to release 8.2. Consolidate inc and bb files into a single bb file. The year in file LICENCE has been recently updated therefore the checksum has been changed but it still remains a MIT License.

---
 .../recipes-devtools/python/python3-humanfriendly_4.18.bb | 2 --
 ...hon-humanfriendly.inc => python3-humanfriendly_8.2.bb} | 8 ++++----
 2 files changed, 4 insertions(+), 6 deletions(-)
 delete mode 100644 meta-python/recipes-devtools/python/python3-humanfriendly_4.18.bb
 rename meta-python/recipes-devtools/python/{python-humanfriendly.inc => python3-humanfriendly_8.2.bb} (65%)
meta-python/recipes-devtools/python/python3-humanfriendly_4.18.bb deleted +0 -2
deleted file mode 100644
index 2ca5fe36f..000000000
@@ -1,2 +0,0 @@
-inherit setuptools3
-require python-humanfriendly.inc
meta-python/recipes-devtools/python/python3-humanfriendly_8.2.bb renamed from meta-python/recipes-devtools/python/python-humanfriendly.inc +4 -4
similarity index 65%
rename from meta-python/recipes-devtools/python/python-humanfriendly.inc
rename to meta-python/recipes-devtools/python/python3-humanfriendly_8.2.bb
index 94f7f8b81..61c969d76 100644
@@ -2,14 +2,14 @@ DESCRIPTION = "Human friendly output for text interfaces using Python"
 HOMEPAGE = "https://humanfriendly.readthedocs.io/"
 SECTION = "devel/python"
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=690da298a43805797a4fa7bbe180b3c6"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=764e737b117a38d773609885e8d04f0b"
 
 PYPI_PACKAGE = "humanfriendly"
 
-SRC_URI[md5sum] = "9573f9f37a5454d8205cfd1b9b8db9d2"
-SRC_URI[sha256sum] = "33ee8ceb63f1db61cce8b5c800c531e1a61023ac5488ccde2ba574a85be00a85"
+SRC_URI[md5sum] = "e6064a6fe099c4231c3e969ca5fea335"
+SRC_URI[sha256sum] = "bf52ec91244819c780341a3438d5d7b09f431d3f113a475147ac9b7b167a3d12"
 
-inherit pypi
+inherit pypi setuptools3
 
 RDEPENDS_${PN}_class-target += " \
     ${PYTHON_PN}-datetime \
Signature · 1 line
2.17.1
Acked-by on v1 4/7
#8 lore raw

Re: [oe] [meta-python][PATCH 4/7] python3-humanfriendly: Upgrade 4.18 -> 8.2

Quoted 6 lines · Leon Anavi

Upgrade to release 8.2. Consolidate inc and bb files into a single bb file. The year in file LICENCE has been recently updated therefore the checksum has been changed but it still remains a MIT License.

Quoted 43 lines
---
  .../recipes-devtools/python/python3-humanfriendly_4.18.bb | 2 --
  ...hon-humanfriendly.inc => python3-humanfriendly_8.2.bb} | 8 ++++----
  2 files changed, 4 insertions(+), 6 deletions(-)

delete mode 100644 meta-python/recipes-devtools/python/python3-humanfriendly_4.18.bb rename meta-python/recipes-devtools/python/{python-humanfriendly.inc => python3-humanfriendly_8.2.bb} (65%)

meta-python/recipes-devtools/python/python3-humanfriendly_4.18.bb deleted +0 -2
deleted file mode 100644
index 2ca5fe36f..000000000
@@ -1,2 +0,0 @@
-inherit setuptools3
-require python-humanfriendly.inc
meta-python/recipes-devtools/python/python3-humanfriendly_8.2.bb renamed from meta-python/recipes-devtools/python/python-humanfriendly.inc +4 -4
similarity index 65%
rename from meta-python/recipes-devtools/python/python-humanfriendly.inc
rename to meta-python/recipes-devtools/python/python3-humanfriendly_8.2.bb
index 94f7f8b81..61c969d76 100644
@@ -2,14 +2,14 @@ DESCRIPTION = "Human friendly output for text interfaces using Python"
  HOMEPAGE = "https://humanfriendly.readthedocs.io/"
  SECTION = "devel/python"
  LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=690da298a43805797a4fa7bbe180b3c6"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=764e737b117a38d773609885e8d04f0b"
 
  PYPI_PACKAGE = "humanfriendly"
 
-SRC_URI[md5sum] = "9573f9f37a5454d8205cfd1b9b8db9d2"
-SRC_URI[sha256sum] = "33ee8ceb63f1db61cce8b5c800c531e1a61023ac5488ccde2ba574a85be00a85"
+SRC_URI[md5sum] = "e6064a6fe099c4231c3e969ca5fea335"
+SRC_URI[sha256sum] = "bf52ec91244819c780341a3438d5d7b09f431d3f113a475147ac9b7b167a3d12"
 
-inherit pypi
+inherit pypi setuptools3
 
  RDEPENDS_${PN}_class-target += " \
      ${PYTHON_PN}-datetime \
author
#9 lore raw

PATCH 5/7 python3-html5lib: Consolidate in a single file

In reply to Leon Anavi

Consolidate inc and bb files into a single bb file.

---
 .../python/python-html5lib.inc                | 17 -----------------
 .../python/python3-html5lib_1.0.1.bb          | 19 +++++++++++++++++--
 2 files changed, 17 insertions(+), 19 deletions(-)
 delete mode 100644 meta-python/recipes-devtools/python/python-html5lib.inc
meta-python/recipes-devtools/python/python-html5lib.inc deleted +0 -17
deleted file mode 100644
index a8e0fb408..000000000
@@ -1,17 +0,0 @@
-SUMMARY = "HTML parser based on the WHATWG HTML specifcation"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=1ba5ada9e6fead1fdc32f43c9f10ba7c"
-
-SRC_URI[md5sum] = "942a0688d6bdf20d087c9805c40182ad"
-SRC_URI[sha256sum] = "66cb0dcfdbbc4f9c3ba1a63fdb511ffdbd4f513b2b6d81b80cd26ce6b3fb3736"
-
-inherit pypi
-
-RDEPENDS_${PN} += "\
-    ${PYTHON_PN}-lxml \
-    ${PYTHON_PN}-six \
-    ${PYTHON_PN}-webencodings \
-    ${PYTHON_PN}-xml \
-"
-
-BBCLASSEXTEND = "native nativesdk"
meta-python/recipes-devtools/python/python3-html5lib_1.0.1.bb +17 -2
index 6bd8b49f5..98ee56b2e 100644
@@ -1,2 +1,17 @@
-inherit setuptools3
-require python-html5lib.inc
+SUMMARY = "HTML parser based on the WHATWG HTML specifcation"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=1ba5ada9e6fead1fdc32f43c9f10ba7c"
+
+SRC_URI[md5sum] = "942a0688d6bdf20d087c9805c40182ad"
+SRC_URI[sha256sum] = "66cb0dcfdbbc4f9c3ba1a63fdb511ffdbd4f513b2b6d81b80cd26ce6b3fb3736"
+
+inherit pypi setuptools3
+
+RDEPENDS_${PN} += "\
+    ${PYTHON_PN}-lxml \
+    ${PYTHON_PN}-six \
+    ${PYTHON_PN}-webencodings \
+    ${PYTHON_PN}-xml \
+"
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.17.1
Acked-by on v1 5/7
#10 lore raw

Re: [oe] [meta-python][PATCH 5/7] python3-html5lib: Consolidate in a single file

Quoted 3 lines · Leon Anavi

Consolidate inc and bb files into a single bb file.

Quoted 55 lines
---
  .../python/python-html5lib.inc                | 17 -----------------
  .../python/python3-html5lib_1.0.1.bb          | 19 +++++++++++++++++--
  2 files changed, 17 insertions(+), 19 deletions(-)

delete mode 100644 meta-python/recipes-devtools/python/python-html5lib.inc

meta-python/recipes-devtools/python/python-html5lib.inc deleted +0 -17
deleted file mode 100644
index a8e0fb408..000000000
@@ -1,17 +0,0 @@
-SUMMARY = "HTML parser based on the WHATWG HTML specifcation"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=1ba5ada9e6fead1fdc32f43c9f10ba7c"
-
-SRC_URI[md5sum] = "942a0688d6bdf20d087c9805c40182ad"
-SRC_URI[sha256sum] = "66cb0dcfdbbc4f9c3ba1a63fdb511ffdbd4f513b2b6d81b80cd26ce6b3fb3736"
-
-inherit pypi
-
-RDEPENDS_${PN} += "\
-    ${PYTHON_PN}-lxml \
-    ${PYTHON_PN}-six \
-    ${PYTHON_PN}-webencodings \
-    ${PYTHON_PN}-xml \
-"
-
-BBCLASSEXTEND = "native nativesdk"
meta-python/recipes-devtools/python/python3-html5lib_1.0.1.bb +17 -2
index 6bd8b49f5..98ee56b2e 100644
@@ -1,2 +1,17 @@
-inherit setuptools3
-require python-html5lib.inc
+SUMMARY = "HTML parser based on the WHATWG HTML specifcation"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=1ba5ada9e6fead1fdc32f43c9f10ba7c"
+
+SRC_URI[md5sum] = "942a0688d6bdf20d087c9805c40182ad"
+SRC_URI[sha256sum] = "66cb0dcfdbbc4f9c3ba1a63fdb511ffdbd4f513b2b6d81b80cd26ce6b3fb3736"
+
+inherit pypi setuptools3
+
+RDEPENDS_${PN} += "\
+    ${PYTHON_PN}-lxml \
+    ${PYTHON_PN}-six \
+    ${PYTHON_PN}-webencodings \
+    ${PYTHON_PN}-xml \
+"
+
+BBCLASSEXTEND = "native nativesdk"
author
#11 lore raw

PATCH 6/7 python3-progress: Consolidate in a single file

In reply to Leon Anavi

Consolidate inc and bb files into a single bb file.

---
 .../recipes-devtools/python/python-progress.inc  | 14 --------------
 .../python/python3-progress_1.5.bb               | 16 +++++++++++++++-
 2 files changed, 15 insertions(+), 15 deletions(-)
 delete mode 100644 meta-python/recipes-devtools/python/python-progress.inc
meta-python/recipes-devtools/python/python-progress.inc deleted +0 -14
deleted file mode 100644
index d59ba2cc5..000000000
@@ -1,14 +0,0 @@
-SUMMARY = "Easy progress reporting for Python"
-HOMEPAGE = "http://github.com/verigak/progress/"
-LICENSE = "ISC"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=aef5566ac4fede9815eccf124c281317"
-
-SRC_URI[md5sum] = "408df0e3db0ad4b74f19f6beec814ae4"
-SRC_URI[sha256sum] = "69ecedd1d1bbe71bf6313d88d1e6c4d2957b7f1d4f71312c211257f7dae64372"
-
-RDEPENDS_${PN}_class-target += " \
-    ${PYTHON_PN}-datetime \
-    ${PYTHON_PN}-math \
-"
-
-BBCLASSEXTEND = "native nativesdk"
meta-python/recipes-devtools/python/python3-progress_1.5.bb +15 -1
index 45e264213..1f299dbed 100644
@@ -1,2 +1,16 @@
+SUMMARY = "Easy progress reporting for Python"
+HOMEPAGE = "http://github.com/verigak/progress/"
+LICENSE = "ISC"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=aef5566ac4fede9815eccf124c281317"
+
+SRC_URI[md5sum] = "408df0e3db0ad4b74f19f6beec814ae4"
+SRC_URI[sha256sum] = "69ecedd1d1bbe71bf6313d88d1e6c4d2957b7f1d4f71312c211257f7dae64372"
+
 inherit pypi setuptools3
-require python-progress.inc
+
+RDEPENDS_${PN}_class-target += " \
+    ${PYTHON_PN}-datetime \
+    ${PYTHON_PN}-math \
+"
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.17.1
Acked-by on v1 6/7
#12 lore raw

Re: [oe] [meta-python][PATCH 6/7] python3-progress: Consolidate in a single file

Quoted 3 lines · Leon Anavi

Consolidate inc and bb files into a single bb file.

Quoted 50 lines
---
  .../recipes-devtools/python/python-progress.inc  | 14 --------------
  .../python/python3-progress_1.5.bb               | 16 +++++++++++++++-
  2 files changed, 15 insertions(+), 15 deletions(-)

delete mode 100644 meta-python/recipes-devtools/python/python-progress.inc

meta-python/recipes-devtools/python/python-progress.inc deleted +0 -14
deleted file mode 100644
index d59ba2cc5..000000000
@@ -1,14 +0,0 @@
-SUMMARY = "Easy progress reporting for Python"
-HOMEPAGE = "http://github.com/verigak/progress/"
-LICENSE = "ISC"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=aef5566ac4fede9815eccf124c281317"
-
-SRC_URI[md5sum] = "408df0e3db0ad4b74f19f6beec814ae4"
-SRC_URI[sha256sum] = "69ecedd1d1bbe71bf6313d88d1e6c4d2957b7f1d4f71312c211257f7dae64372"
-
-RDEPENDS_${PN}_class-target += " \
-    ${PYTHON_PN}-datetime \
-    ${PYTHON_PN}-math \
-"
-
-BBCLASSEXTEND = "native nativesdk"
meta-python/recipes-devtools/python/python3-progress_1.5.bb +15 -1
index 45e264213..1f299dbed 100644
@@ -1,2 +1,16 @@
+SUMMARY = "Easy progress reporting for Python"
+HOMEPAGE = "http://github.com/verigak/progress/"
+LICENSE = "ISC"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=aef5566ac4fede9815eccf124c281317"
+
+SRC_URI[md5sum] = "408df0e3db0ad4b74f19f6beec814ae4"
+SRC_URI[sha256sum] = "69ecedd1d1bbe71bf6313d88d1e6c4d2957b7f1d4f71312c211257f7dae64372"
+
  inherit pypi setuptools3
-require python-progress.inc
+
+RDEPENDS_${PN}_class-target += " \
+    ${PYTHON_PN}-datetime \
+    ${PYTHON_PN}-math \
+"
+
+BBCLASSEXTEND = "native nativesdk"
author
#13 lore raw

PATCH 7/7 python3-prettytable: Consolidate in a single file

In reply to Leon Anavi

Consolidate inc and bb files into a single bb file. Inherit pypi.

---
 .../python/python-prettytable.inc             | 43 -------------------
 .../python/python3-prettytable_0.7.2.bb       | 38 +++++++++++++++-
 2 files changed, 36 insertions(+), 45 deletions(-)
 delete mode 100644 meta-python/recipes-devtools/python/python-prettytable.inc
meta-python/recipes-devtools/python/python-prettytable.inc deleted +0 -43
deleted file mode 100644
index c77a49191..000000000
@@ -1,43 +0,0 @@
-SUMMARY = "Python library for displaying tabular data in a ASCII table format"
-HOMEPAGE = "http://code.google.com/p/prettytable"
-LICENSE = "BSD-3-Clause"
-LIC_FILES_CHKSUM = "file://COPYING;md5=3e73500ffa52de5071cff65990055282"
-
-SRC_URI[md5sum] = "0c1361104caff8b09f220748f9d69899"
-SRC_URI[sha256sum] = "a53da3b43d7a5c229b5e3ca2892ef982c46b7923b51e98f0db49956531211c4f"
-
-SRCNAME = "prettytable"
-
-SRC_URI = "https://pypi.python.org/packages/source/P/PrettyTable/${SRCNAME}-${PV}.zip"
-
-S = "${WORKDIR}/${SRCNAME}-${PV}"
-
-do_install_append() {
-    perm_files=`find "${D}${PYTHON_SITEPACKAGES_DIR}/" -name "*.txt" -o -name "PKG-INFO"`
-    for f in $perm_files; do
-        chmod 644 "${f}"
-    done
-}
-
-UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/PrettyTable/"
-UPSTREAM_CHECK_REGEX = "/PrettyTable/(?P<pver>(\d+[\.\-_]*)+)"
-
-BBCLASSEXTEND = "native nativesdk"
-inherit ptest
-
-SRC_URI += " \
-	file://run-ptest \
-"
-
-RDEPENDS_${PN} += " \
-	${PYTHON_PN}-math \
-	${PYTHON_PN}-html \
-"
-
-RDEPENDS_${PN}-ptest += " \
-	${PYTHON_PN}-pytest \
-"
-
-do_install_ptest() {
-	cp -f ${S}/prettytable_test.py ${D}${PTEST_PATH}/
-}
meta-python/recipes-devtools/python/python3-prettytable_0.7.2.bb +36 -2
index 5445f1019..18f339061 100644
@@ -1,3 +1,37 @@
-inherit setuptools3
-require python-prettytable.inc
+SUMMARY = "Python library for displaying tabular data in a ASCII table format"
+HOMEPAGE = "http://code.google.com/p/prettytable"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3e73500ffa52de5071cff65990055282"
 
+SRC_URI[md5sum] = "a6b80afeef286ce66733d54a0296b13b"
+SRC_URI[sha256sum] = "2d5460dc9db74a32bcc8f9f67de68b2c4f4d2f01fa3bd518764c69156d9cacd9"
+
+do_install_append() {
+    perm_files=`find "${D}${PYTHON_SITEPACKAGES_DIR}/" -name "*.txt" -o -name "PKG-INFO"`
+    for f in $perm_files; do
+        chmod 644 "${f}"
+    done
+}
+
+UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/PrettyTable/"
+UPSTREAM_CHECK_REGEX = "/PrettyTable/(?P<pver>(\d+[\.\-_]*)+)"
+
+BBCLASSEXTEND = "native nativesdk"
+inherit pypi ptest setuptools3
+
+SRC_URI += " \
+	file://run-ptest \
+"
+
+RDEPENDS_${PN} += " \
+	${PYTHON_PN}-math \
+	${PYTHON_PN}-html \
+"
+
+RDEPENDS_${PN}-ptest += " \
+	${PYTHON_PN}-pytest \
+"
+
+do_install_ptest() {
+	cp -f ${S}/prettytable_test.py ${D}${PTEST_PATH}/
+}
Signature · 1 line
2.17.1
Acked-by on v1 7/7
#14 lore raw

Re: [oe] [meta-python][PATCH 7/7] python3-prettytable: Consolidate in a single file

Quoted 3 lines · Leon Anavi

Consolidate inc and bb files into a single bb file. Inherit pypi.

Quoted 101 lines
---
  .../python/python-prettytable.inc             | 43 -------------------
  .../python/python3-prettytable_0.7.2.bb       | 38 +++++++++++++++-
  2 files changed, 36 insertions(+), 45 deletions(-)

delete mode 100644 meta-python/recipes-devtools/python/python-prettytable.inc

meta-python/recipes-devtools/python/python-prettytable.inc deleted +0 -43
deleted file mode 100644
index c77a49191..000000000
@@ -1,43 +0,0 @@
-SUMMARY = "Python library for displaying tabular data in a ASCII table format"
-HOMEPAGE = "http://code.google.com/p/prettytable"
-LICENSE = "BSD-3-Clause"
-LIC_FILES_CHKSUM = "file://COPYING;md5=3e73500ffa52de5071cff65990055282"
-
-SRC_URI[md5sum] = "0c1361104caff8b09f220748f9d69899"
-SRC_URI[sha256sum] = "a53da3b43d7a5c229b5e3ca2892ef982c46b7923b51e98f0db49956531211c4f"
-
-SRCNAME = "prettytable"
-
-SRC_URI = "https://pypi.python.org/packages/source/P/PrettyTable/${SRCNAME}-${PV}.zip"
-
-S = "${WORKDIR}/${SRCNAME}-${PV}"
-
-do_install_append() {
-    perm_files=`find "${D}${PYTHON_SITEPACKAGES_DIR}/" -name "*.txt" -o -name "PKG-INFO"`
-    for f in $perm_files; do
-        chmod 644 "${f}"
-    done
-}
-
-UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/PrettyTable/"
-UPSTREAM_CHECK_REGEX = "/PrettyTable/(?P<pver>(\d+[\.\-_]*)+)"
-
-BBCLASSEXTEND = "native nativesdk"
-inherit ptest
-
-SRC_URI += " \
-	file://run-ptest \
-"
-
-RDEPENDS_${PN} += " \
-	${PYTHON_PN}-math \
-	${PYTHON_PN}-html \
-"
-
-RDEPENDS_${PN}-ptest += " \
-	${PYTHON_PN}-pytest \
-"
-
-do_install_ptest() {
-	cp -f ${S}/prettytable_test.py ${D}${PTEST_PATH}/
-}
meta-python/recipes-devtools/python/python3-prettytable_0.7.2.bb +36 -2
index 5445f1019..18f339061 100644
@@ -1,3 +1,37 @@
-inherit setuptools3
-require python-prettytable.inc
+SUMMARY = "Python library for displaying tabular data in a ASCII table format"
+HOMEPAGE = "http://code.google.com/p/prettytable"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3e73500ffa52de5071cff65990055282"
 
+SRC_URI[md5sum] = "a6b80afeef286ce66733d54a0296b13b"
+SRC_URI[sha256sum] = "2d5460dc9db74a32bcc8f9f67de68b2c4f4d2f01fa3bd518764c69156d9cacd9"
+
+do_install_append() {
+    perm_files=`find "${D}${PYTHON_SITEPACKAGES_DIR}/" -name "*.txt" -o -name "PKG-INFO"`
+    for f in $perm_files; do
+        chmod 644 "${f}"
+    done
+}
+
+UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/PrettyTable/"
+UPSTREAM_CHECK_REGEX = "/PrettyTable/(?P<pver>(\d+[\.\-_]*)+)"
+
+BBCLASSEXTEND = "native nativesdk"
+inherit pypi ptest setuptools3
+
+SRC_URI += " \
+	file://run-ptest \
+"
+
+RDEPENDS_${PN} += " \
+	${PYTHON_PN}-math \
+	${PYTHON_PN}-html \
+"
+
+RDEPENDS_${PN}-ptest += " \
+	${PYTHON_PN}-pytest \
+"
+
+do_install_ptest() {
+	cp -f ${S}/prettytable_test.py ${D}${PTEST_PATH}/
+}
Acked-by on v1 1/7
#15 lore raw
In reply to Leon Anavi
Quoted 3 lines · Leon Anavi

Consolidate inc and bb files into a single bb file.

Quoted 123 lines
---
  .../recipes-devtools/python/python-lxml.inc   | 50 -----------------
  .../python/python3-lxml_4.5.0.bb              | 53 ++++++++++++++++++-
  2 files changed, 51 insertions(+), 52 deletions(-)

delete mode 100644 meta-python/recipes-devtools/python/python-lxml.inc

meta-python/recipes-devtools/python/python-lxml.inc deleted +0 -50
deleted file mode 100644
index 05b5eae46..000000000
@@ -1,50 +0,0 @@
-SUMMARY = "Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API."
-DESCRIPTION = "lxml is a Pythonic, mature binding for the libxml2 and \
-libxslt libraries. It provides safe and convenient access to these \
-libraries using the ElementTree API. It extends the ElementTree API \
-significantly to offer support for XPath, RelaxNG, XML Schema, XSLT, \
-C14N and much more."
-HOMEPAGE = "http://codespeak.net/lxml"
-SECTION = "devel/python"
-LICENSE = "BSD & GPLv2 & MIT & PSF"
-LIC_FILES_CHKSUM = "file://LICENSES.txt;md5=e4c045ebad958ead4b48008f70838403 \
-                    file://doc/licenses/elementtree.txt;md5=eb34d036a6e3d56314ee49a6852ac891 \
-                    file://doc/licenses/BSD.txt;md5=700a1fc17f4797d4f2d34970c8ee694b \
-                    file://doc/licenses/GPL.txt;md5=94d55d512a9ba36caa9b7df079bae19f \
-                    file://src/lxml/isoschematron/resources/rng/iso-schematron.rng;beginline=2;endline=7;md5=fc85684a8dd5fa272c086bceb0d99e10 \
-                    file://src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl;beginline=2;endline=24;md5=cc86b7b2bbc678e13f58ea403eb9929b \
-                    file://src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl;beginline=2;endline=7;md5=5b03236d293dc3784205542b409d2f53 \
-                    "
-
-DEPENDS += "libxml2 libxslt"
-
-SRC_URI[md5sum] = "f088e452ed45b030b6f84269f1e84d11"
-SRC_URI[sha256sum] = "8620ce80f50d023d414183bf90cc2576c2837b88e00bea3f33ad2630133bbb60"
-
-DISTUTILS_BUILD_ARGS += " \
-                     --with-xslt-config='pkg-config libxslt' \
-                     --with-xml2-config='pkg-config libxml-2.0' \
-"
-
-DISTUTILS_INSTALL_ARGS += " \
-                     --with-xslt-config='pkg-config libxslt' \
-                     --with-xml2-config='pkg-config libxml-2.0' \
-"
-
-inherit pypi
-
-# {standard input}: Assembler messages:
-# {standard input}:1488805: Error: branch out of range
-DEBUG_OPTIMIZATION_remove_mips = " -Og"
-DEBUG_OPTIMIZATION_append_mips = " -O"
-BUILD_OPTIMIZATION_remove_mips = " -Og"
-BUILD_OPTIMIZATION_append_mips = " -O"
-
-DEBUG_OPTIMIZATION_remove_mipsel = " -Og"
-DEBUG_OPTIMIZATION_append_mipsel = " -O"
-BUILD_OPTIMIZATION_remove_mipsel = " -Og"
-BUILD_OPTIMIZATION_append_mipsel = " -O"
-
-BBCLASSEXTEND = "native nativesdk"
-
-RDEPENDS_${PN} += "libxml2 libxslt ${PYTHON_PN}-compression"
meta-python/recipes-devtools/python/python3-lxml_4.5.0.bb +51 -2
index b95d7bae7..e3cfa46d1 100644
@@ -1,3 +1,52 @@
-inherit setuptools3
-require python-lxml.inc
+SUMMARY = "Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API."
+DESCRIPTION = "lxml is a Pythonic, mature binding for the libxml2 and \
+libxslt libraries. It provides safe and convenient access to these \
+libraries using the ElementTree API. It extends the ElementTree API \
+significantly to offer support for XPath, RelaxNG, XML Schema, XSLT, \
+C14N and much more."
+HOMEPAGE = "http://codespeak.net/lxml"
+SECTION = "devel/python"
+LICENSE = "BSD & GPLv2 & MIT & PSF"
+LIC_FILES_CHKSUM = "file://LICENSES.txt;md5=e4c045ebad958ead4b48008f70838403 \
+                    file://doc/licenses/elementtree.txt;md5=eb34d036a6e3d56314ee49a6852ac891 \
+                    file://doc/licenses/BSD.txt;md5=700a1fc17f4797d4f2d34970c8ee694b \
+                    file://doc/licenses/GPL.txt;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://src/lxml/isoschematron/resources/rng/iso-schematron.rng;beginline=2;endline=7;md5=fc85684a8dd5fa272c086bceb0d99e10 \
+                    file://src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl;beginline=2;endline=24;md5=cc86b7b2bbc678e13f58ea403eb9929b \
+                    file://src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl;beginline=2;endline=7;md5=5b03236d293dc3784205542b409d2f53 \
+                    "
+
+DEPENDS += "libxml2 libxslt"
+
+SRC_URI[md5sum] = "f088e452ed45b030b6f84269f1e84d11"
+SRC_URI[sha256sum] = "8620ce80f50d023d414183bf90cc2576c2837b88e00bea3f33ad2630133bbb60"
+
+DISTUTILS_BUILD_ARGS += " \
+                     --with-xslt-config='pkg-config libxslt' \
+                     --with-xml2-config='pkg-config libxml-2.0' \
+"
+
+DISTUTILS_INSTALL_ARGS += " \
+                     --with-xslt-config='pkg-config libxslt' \
+                     --with-xml2-config='pkg-config libxml-2.0' \
+"
+
+inherit pypi setuptools3
+
+# {standard input}: Assembler messages:
+# {standard input}:1488805: Error: branch out of range
+DEBUG_OPTIMIZATION_remove_mips = " -Og"
+DEBUG_OPTIMIZATION_append_mips = " -O"
+BUILD_OPTIMIZATION_remove_mips = " -Og"
+BUILD_OPTIMIZATION_append_mips = " -O"
+
+DEBUG_OPTIMIZATION_remove_mipsel = " -Og"
+DEBUG_OPTIMIZATION_append_mipsel = " -O"
+BUILD_OPTIMIZATION_remove_mipsel = " -Og"
+BUILD_OPTIMIZATION_append_mipsel = " -O"
+
+BBCLASSEXTEND = "native nativesdk"
+
+RDEPENDS_${PN} += "libxml2 libxslt ${PYTHON_PN}-compression"
+
  CLEANBROKEN = "1"