diff --git a/6642.patch b/6642.patch new file mode 100644 index 0000000..defcb3c --- /dev/null +++ b/6642.patch @@ -0,0 +1,23 @@ +From 2d9d7857b07002668600e2d076dc89685ea8da40 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20S=C3=BAkup?= + +Date: Tue, 18 Feb 2020 09:49:45 +0100 +Subject: [PATCH] Skip Py2 tests correctly also on other systems than Debian + +--- + run_unittests.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: meson-0.53.1/run_unittests.py +=================================================================== +--- meson-0.53.1.orig/run_unittests.py ++++ meson-0.53.1/run_unittests.py +@@ -6659,7 +6659,7 @@ class NativeFileTests(BasePlatformTests) + # python module breaks. This is fine on other OSes because they + # don't need the extra indirection. + raise unittest.SkipTest('bat indirection breaks internal sanity checks.') +- if os.path.exists('/etc/debian_version'): ++ if os.path.exists('/etc/os-release') or os.path.exists('/etc/debian_version'): + rc = subprocess.call(['pkg-config', '--cflags', 'python2'], + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL) diff --git a/meson-testsuite-boost2.patch b/meson-testsuite-boost2.patch new file mode 100644 index 0000000..966ed8c --- /dev/null +++ b/meson-testsuite-boost2.patch @@ -0,0 +1,59 @@ +Index: meson-0.53.1/test cases/frameworks/1 boost/meson.build +=================================================================== +--- meson.build ++++ meson.build +@@ -22,24 +22,14 @@ endif + # Use one without a library dependency and one with it. + + linkdep = dependency('boost', modules : ['thread', 'system', 'test']) +-staticdep = dependency('boost', modules : ['thread', 'system'], static : true) + testdep = dependency('boost', modules : ['unit_test_framework']) + nomoddep = dependency('boost') + extralibdep = dependency('boost', modules : ['thread', 'system', 'log_setup', 'log']) + + pymod = import('python') +-python2 = pymod.find_installation('python2', required: host_machine.system() == 'linux', disabler: true) + python3 = pymod.find_installation('python3', required: host_machine.system() == 'linux', disabler: true) +-python2dep = python2.dependency(required: host_machine.system() == 'linux', embed: true, disabler: true) + python3dep = python3.dependency(required: host_machine.system() == 'linux', embed: true, disabler: true) + +-# compile python 2/3 modules only if we found a corresponding python version +-if(python2dep.found() and host_machine.system() == 'linux') +- bpython2dep = dependency('boost', modules : ['python'], required: false, disabler: true) +-else +- python2dep = disabler() +- bpython2dep = disabler() +-endif + + if(python3dep.found() and host_machine.system() == 'linux') + bpython3dep = dependency('boost', modules : ['python3'], required: false, disabler: true) +@@ -49,24 +39,19 @@ else + endif + + linkexe = executable('linkedexe', 'linkexe.cc', dependencies : linkdep) +-staticexe = executable('staticlinkedexe', 'linkexe.cc', dependencies : staticdep) + unitexe = executable('utf', 'unit_test.cpp', dependencies: testdep) + nomodexe = executable('nomod', 'nomod.cpp', dependencies : nomoddep) + extralibexe = executable('extralibexe', 'extralib.cpp', dependencies : extralibdep) + + # python modules are shared libraries +-python2module = shared_library('python2_module', ['python_module.cpp'], dependencies: [python2dep, bpython2dep], name_prefix: '', cpp_args: ['-DMOD_NAME=python2_module']) + python3module = shared_library('python3_module', ['python_module.cpp'], dependencies: [python3dep, bpython3dep], name_prefix: '', cpp_args: ['-DMOD_NAME=python3_module']) + + test('Boost linktest', linkexe) +-test('Boost statictest', staticexe) + test('Boost UTF test', unitexe) + test('Boost nomod', nomodexe) + test('Boost extralib test', extralibexe) + + # explicitly use the correct python interpreter so that we don't have to provide two different python scripts that have different shebang lines +-python2interpreter = find_program(python2.path(), required: false, disabler: true) +-test('Boost Python2', python2interpreter, args: ['./test_python_module.py', meson.current_build_dir()], workdir: meson.current_source_dir(), depends: python2module) + python3interpreter = find_program(python3.path(), required: false, disabler: true) + test('Boost Python3', python3interpreter, args: ['./test_python_module.py', meson.current_build_dir()], workdir: meson.current_source_dir(), depends: python3module) + +@@ -74,3 +59,4 @@ subdir('partial_dep') + + # check we can apply a version constraint + dependency('boost', version: '>=@0@'.format(dep.version())) ++ diff --git a/meson.changes b/meson.changes index 5e600cb..46a9334 100644 --- a/meson.changes +++ b/meson.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Feb 18 14:07:46 UTC 2020 - Ondřej Súkup + +- Add 6642.patch - allow skip python2 unittests + meson-testsuite-boost2.patch skip libboost_python tests on TW + ------------------------------------------------------------------- Wed Feb 12 19:08:54 UTC 2020 - Dominique Leuenberger diff --git a/meson.spec b/meson.spec index 0a891cd..12a5589 100644 --- a/meson.spec +++ b/meson.spec @@ -49,10 +49,14 @@ Patch3: meson-suse-fix-llvm-3.8.patch Patch4: meson-fix-gcc48.patch # PATCH-FEATURE-OPENSUSE meson-distutils.patch tchvatal@suse.com -- build and install using distutils instead of full setuptools Patch5: meson-distutils.patch -# PATCH-FIX-UPSREAM meson-testsuite-boost.patch dimstar@opensuse.org -- https://github.com/mesonbuild/meson/issues/4788 +# PATCH-FIX-UPSTREAM meson-testsuite-boost.patch dimstar@opensuse.org -- https://github.com/mesonbuild/meson/issues/4788 Patch6: meson-testsuite-boost.patch # PATCH-FIX-UPSTREAM meson-6614.patch dimstar@opensuse.org -- cmake: Fix crash when no C++ compiler is not installed Patch7: meson-6614.patch +# PATCH-FIX-UPSTREAM 6642.patch mimi.vx@gmail.com -- Fix skip python2 unittests +Patch8: 6642.patch +# PATCH-FIX-OPENSUSE meson-testsuite-boost2.patch mimi.vx@gmail.com -- disable libboost_python tests +Patch9: meson-testsuite-boost2.patch BuildRequires: fdupes BuildRequires: python-rpm-macros BuildRequires: python3-base @@ -93,8 +97,12 @@ BuildRequires: pkgconfig %if 0%{?suse_version} <= 1500 BuildRequires: python2-PyYAML %endif +%if 0%{?suse_version} < 1550 BuildRequires: python2-devel +%endif +BuildRequires: distribution-release BuildRequires: python3-gobject +BuildRequires: python3-pytest-xdist BuildRequires: python3-setuptools BuildRequires: zlib-devel-static BuildRequires: cmake(Qt5Core) @@ -106,15 +114,17 @@ BuildRequires: pkgconfig(gobject-introspection-1.0) BuildRequires: pkgconfig(gtk+-3.0) BuildRequires: pkgconfig(gtk-doc) BuildRequires: pkgconfig(ncurses) -BuildRequires: pkgconfig(python3) >= 3.4 +BuildRequires: pkgconfig(python3) >= 3.5 BuildRequires: pkgconfig(sdl2) BuildRequires: pkgconfig(vapigen) BuildRequires: pkgconfig(vulkan) BuildRequires: pkgconfig(zlib) %if 0%{?suse_version} >= 1500 +%if 0%{?suse_version} < 1550 +BuildRequires: libboost_python-devel +%endif BuildRequires: java-headless BuildRequires: libboost_log-devel -BuildRequires: libboost_python-devel BuildRequires: libboost_python3-devel BuildRequires: libboost_system-devel BuildRequires: libboost_test-devel @@ -177,6 +187,12 @@ This package provides support for meson.build files in Vim. %patch6 -p0 ) %patch7 -p1 +%patch8 -p1 +%if 0%{?suse_version} >= 1550 +(cd "test cases/frameworks/1 boost" +%patch9 -p0 +) +%endif # Remove static boost tests from "test cases/frameworks/1 boost/". sed -i "/static/d" test\ cases/frameworks/1\ boost/meson.build