Add bcond for tests
This commit is contained in:
parent
e3cb2b8111
commit
d6c7e261f5
@ -4,6 +4,9 @@
|
|||||||
# https://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_Header_Only_Libraries
|
# https://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_Header_Only_Libraries
|
||||||
%global debug_package %{nil}
|
%global debug_package %{nil}
|
||||||
|
|
||||||
|
# Whether to run the tests, enabled by default
|
||||||
|
%bcond_without tests
|
||||||
|
|
||||||
%if 0%{?fedora} >= 30
|
%if 0%{?fedora} >= 30
|
||||||
%global python2_enabled 0
|
%global python2_enabled 0
|
||||||
%else
|
%else
|
||||||
@ -29,20 +32,24 @@ Patch1: pybind11-2.5.0-hpath.patch
|
|||||||
BuildRequires: python2-devel
|
BuildRequires: python2-devel
|
||||||
BuildRequires: python2-setuptools
|
BuildRequires: python2-setuptools
|
||||||
# These are only needed for the checks
|
# These are only needed for the checks
|
||||||
|
%if %{with tests}
|
||||||
BuildRequires: python2-pytest
|
BuildRequires: python2-pytest
|
||||||
BuildRequires: python2-numpy
|
BuildRequires: python2-numpy
|
||||||
BuildRequires: python2-scipy
|
BuildRequires: python2-scipy
|
||||||
%endif
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
%if %{python3_enabled}
|
%if %{python3_enabled}
|
||||||
# Needed to build the python libraries
|
# Needed to build the python libraries
|
||||||
BuildRequires: python3-devel
|
BuildRequires: python3-devel
|
||||||
BuildRequires: python3-setuptools
|
BuildRequires: python3-setuptools
|
||||||
# These are only needed for the checks
|
# These are only needed for the checks
|
||||||
|
%if %{with tests}
|
||||||
BuildRequires: python3-pytest
|
BuildRequires: python3-pytest
|
||||||
BuildRequires: python3-numpy
|
BuildRequires: python3-numpy
|
||||||
BuildRequires: python3-scipy
|
BuildRequires: python3-scipy
|
||||||
%endif
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
BuildRequires: eigen3-devel
|
BuildRequires: eigen3-devel
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
@ -113,7 +120,7 @@ pys="$pys python3"
|
|||||||
for py in $pys; do
|
for py in $pys; do
|
||||||
mkdir $py
|
mkdir $py
|
||||||
cd $py
|
cd $py
|
||||||
%cmake .. -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=%{_bindir}/$py -DPYBIND11_INSTALL=TRUE -DUSE_PYTHON_INCLUDE_DIR=FALSE
|
%cmake .. -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=%{_bindir}/$py -DPYBIND11_INSTALL=TRUE -DUSE_PYTHON_INCLUDE_DIR=FALSE %{!?with_tests:-DPYBIND11_TEST=OFF}
|
||||||
make %{?_smp_mflags}
|
make %{?_smp_mflags}
|
||||||
cd ..
|
cd ..
|
||||||
done
|
done
|
||||||
@ -125,6 +132,7 @@ done
|
|||||||
%py3_build
|
%py3_build
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%if %{with tests}
|
||||||
%check
|
%check
|
||||||
%if %{python2_enabled}
|
%if %{python2_enabled}
|
||||||
make -C python2 check %{?_smp_mflags}
|
make -C python2 check %{?_smp_mflags}
|
||||||
@ -132,6 +140,7 @@ make -C python2 check %{?_smp_mflags}
|
|||||||
%if %{python3_enabled}
|
%if %{python3_enabled}
|
||||||
make -C python3 check %{?_smp_mflags}
|
make -C python3 check %{?_smp_mflags}
|
||||||
%endif
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
%install
|
%install
|
||||||
# Doesn't matter if both installs run
|
# Doesn't matter if both installs run
|
||||||
|
Loading…
Reference in New Issue
Block a user