2019-07-25 20:11:55 +00:00
|
|
|
#
|
|
|
|
# spec file for package python-pybind11
|
|
|
|
#
|
2021-02-08 14:50:35 +00:00
|
|
|
# Copyright (c) 2021 SUSE LLC
|
2019-07-25 20:11:55 +00:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2019-08-24 07:39:27 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
#
|
2019-07-25 20:11:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
|
|
|
Name: python-pybind11
|
2021-02-08 14:50:35 +00:00
|
|
|
Version: 2.6.2
|
2019-07-25 20:11:55 +00:00
|
|
|
Release: 0
|
2019-08-24 07:39:27 +00:00
|
|
|
Summary: Module for operability between C++11 and Python
|
2019-07-25 20:11:55 +00:00
|
|
|
License: BSD-3-Clause
|
2019-10-08 10:40:06 +00:00
|
|
|
URL: https://github.com/pybind/pybind11
|
2019-10-08 10:16:24 +00:00
|
|
|
Source: https://github.com/pybind/pybind11/archive/v%{version}.tar.gz#/pybind11-%{version}.tar.gz
|
2021-07-08 10:06:06 +00:00
|
|
|
# PATCH-FIX-UPSTREAM https://github.com/pybind/pybind11/commit/0c93a0f3fcf6bf26be584558d7426564720cea6f Fix Unicode support for ostream redirects
|
|
|
|
Patch0: unicode.patch
|
2019-07-25 20:11:55 +00:00
|
|
|
BuildRequires: %{python_module devel}
|
2019-10-08 10:16:24 +00:00
|
|
|
BuildRequires: %{python_module pytest}
|
2019-07-25 20:11:55 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2019-10-08 10:16:24 +00:00
|
|
|
BuildRequires: cmake
|
2019-07-25 20:11:55 +00:00
|
|
|
BuildRequires: fdupes
|
2019-10-08 10:16:24 +00:00
|
|
|
BuildRequires: gcc-c++
|
2019-08-24 07:39:27 +00:00
|
|
|
BuildRequires: python-rpm-macros
|
2021-07-08 10:06:06 +00:00
|
|
|
BuildRequires: %{python_module numpy if (%python-base without python36-base)}
|
2019-07-25 20:11:55 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
2019-08-24 07:39:27 +00:00
|
|
|
pybind11 is a header-only library that exposes C++ types in Python
|
|
|
|
and vice versa, mainly to create Python bindings of existing C++
|
|
|
|
code. It can reduce boilerplate code in traditional extension modules
|
|
|
|
by inferring type information using compile-time introspection.
|
2019-07-25 20:11:55 +00:00
|
|
|
|
2020-02-13 14:54:10 +00:00
|
|
|
%package -n %{name}-common-devel
|
2019-08-24 07:39:27 +00:00
|
|
|
Summary: Development files for pybind11
|
2020-02-13 14:54:10 +00:00
|
|
|
Provides: %{python_module pybind11-common-devel = %{version}}
|
|
|
|
|
|
|
|
%description -n %{name}-common-devel
|
|
|
|
This package contains files for developing applications using pybind11.
|
|
|
|
|
|
|
|
%package devel
|
|
|
|
Summary: Development files for pybind11
|
|
|
|
Requires: %{name}-common-devel = %{version}
|
2019-07-25 20:11:55 +00:00
|
|
|
Requires: python-devel
|
2020-04-23 10:05:22 +00:00
|
|
|
Requires: python-pybind11 = %{version}
|
2019-07-25 20:11:55 +00:00
|
|
|
|
2020-02-13 14:54:10 +00:00
|
|
|
%description devel
|
2019-07-25 20:11:55 +00:00
|
|
|
This package contains files for developing applications using pybind11.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n pybind11-%{version}
|
2021-07-08 10:06:06 +00:00
|
|
|
%autopatch -p1
|
2019-07-25 20:11:55 +00:00
|
|
|
|
|
|
|
%build
|
|
|
|
%python_build
|
2019-10-08 10:40:06 +00:00
|
|
|
# calling cmake to install header to right location and
|
|
|
|
# generate cmake include files
|
2020-07-17 06:35:58 +00:00
|
|
|
%{python_expand pushd .
|
2020-07-07 07:48:28 +00:00
|
|
|
%cmake \
|
|
|
|
-DPYBIND11_INSTALL=ON \
|
|
|
|
-DPYBIND11_TEST=ON \
|
2020-07-17 06:35:58 +00:00
|
|
|
-DPYTHON_EXECUTABLE:FILEPATH=%{_bindir}/$python \
|
2020-07-07 07:48:28 +00:00
|
|
|
|
2019-10-08 10:16:24 +00:00
|
|
|
%cmake_build
|
2020-07-17 06:35:58 +00:00
|
|
|
popd
|
|
|
|
}
|
2019-07-25 20:11:55 +00:00
|
|
|
|
|
|
|
%install
|
|
|
|
%python_install
|
2021-02-08 14:50:35 +00:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/pybind11-config
|
2020-07-17 06:35:58 +00:00
|
|
|
%python_expand %cmake_install
|
2019-07-25 20:11:55 +00:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2020-02-13 14:54:10 +00:00
|
|
|
# removing duplicated header files
|
2020-03-11 16:57:36 +00:00
|
|
|
rm -rfv %{buildroot}%{_includedir}/python2.*/pybind11/
|
|
|
|
rm -rfv %{buildroot}%{_includedir}/python3.*/pybind11
|
2019-07-25 20:11:55 +00:00
|
|
|
|
2020-07-17 06:35:58 +00:00
|
|
|
%check
|
2020-07-07 07:48:28 +00:00
|
|
|
# test fails as python3-widget is not in distribuion
|
|
|
|
rm tests/test_embed/test_interpreter.py
|
2021-02-08 14:50:35 +00:00
|
|
|
export PYTHONPATH=${PWD}/build/tests/
|
|
|
|
%pytest -k 'not (tests_build_wheel or tests_build_global_wheel)'
|
|
|
|
|
|
|
|
%post
|
|
|
|
%python_install_alternative pybind11-config
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%python_uninstall_alternative pybind11-config
|
2020-07-07 07:48:28 +00:00
|
|
|
|
2019-07-25 20:11:55 +00:00
|
|
|
%files %{python_files}
|
2021-02-08 14:50:35 +00:00
|
|
|
%doc README.rst docs/changelog.rst
|
2019-07-25 20:11:55 +00:00
|
|
|
%license LICENSE
|
2021-02-08 14:50:35 +00:00
|
|
|
%python_alternative %{_bindir}/pybind11-config
|
2020-07-07 07:48:28 +00:00
|
|
|
%{python_sitelib}/pybind11*
|
|
|
|
%exclude %{python_sitelib}/pybind11/include
|
2019-07-25 20:11:55 +00:00
|
|
|
|
2020-02-13 14:54:10 +00:00
|
|
|
%files -n %{name}-common-devel
|
2019-10-08 10:16:24 +00:00
|
|
|
%{_includedir}/pybind11
|
2019-07-25 20:11:55 +00:00
|
|
|
%license LICENSE
|
2019-10-08 10:16:24 +00:00
|
|
|
%{_datadir}/cmake/pybind11
|
2019-07-25 20:11:55 +00:00
|
|
|
|
2020-02-13 14:54:10 +00:00
|
|
|
%files %{python_files devel}
|
|
|
|
%license LICENSE
|
|
|
|
|
2019-07-25 20:11:55 +00:00
|
|
|
%changelog
|