churchyard / rpms / pybind11

Forked from rpms/pybind11 3 years ago
Clone
1d3ad0b
# While the headers are architecture independent, the package must be
1d3ad0b
# built separately on all architectures so that the tests are run
1d3ad0b
# properly. See also
1d3ad0b
# https://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_Header_Only_Libraries
1d3ad0b
%global debug_package %{nil}
1d3ad0b
d6c7e26
# Whether to run the tests, enabled by default
d6c7e26
%bcond_without tests
d6c7e26
9eb1dfb
%if 0%{?fedora} >= 30 || 0%{?rhel} >= 9
2f09cf5
%global python2_enabled 0
2f09cf5
%else
2f09cf5
%global python2_enabled 1
2f09cf5
%endif
1524d6f
2f09cf5
%global python3_enabled 1
2f09cf5
7fc5961
Name:    pybind11
9a9939b
Version: 2.11.1
98878b3
Release: 2%{?dist}
1d3ad0b
Summary: Seamless operability between C++11 and Python
7fc5961
License: BSD
7fc5961
URL:	 https://github.com/pybind/pybind11
fcea12a
Source0: https://github.com/pybind/pybind11/archive/v%{version}/%{name}-%{version}.tar.gz
1d3ad0b
e3cb2b8
# Patch out header path
Jonathan 409601a
Patch1:  pybind11-2.10.1-hpath.patch
998fbc5
4ec630b
# Adapt to changed function name in Python 3.13
4ec630b
Patch2:  https://github.com/pybind/pybind11/pull/4902.patch
98878b3
# Fix make_static_property_type() on Python 3.13
98878b3
Patch3:  https://github.com/pybind/pybind11/pull/4971.patch
4ec630b
47b294e
BuildRequires: make
2f09cf5
%if %{python2_enabled}
998fbc5
# Needed to build the python libraries
1d3ad0b
BuildRequires: python2-devel
998fbc5
BuildRequires: python2-setuptools
998fbc5
# These are only needed for the checks
d6c7e26
%if %{with tests}
1d3ad0b
BuildRequires: python2-pytest
1d3ad0b
BuildRequires: python2-numpy
1d3ad0b
BuildRequires: python2-scipy
2f09cf5
%endif
d6c7e26
%endif
2f09cf5
2f09cf5
%if %{python3_enabled}
2f09cf5
# Needed to build the python libraries
2f09cf5
BuildRequires: python3-devel
2f09cf5
BuildRequires: python3-setuptools
2f09cf5
# These are only needed for the checks
d6c7e26
%if %{with tests}
1d3ad0b
BuildRequires: python3-pytest
1d3ad0b
BuildRequires: python3-numpy
1d3ad0b
BuildRequires: python3-scipy
2f09cf5
%endif
d6c7e26
%endif
2f09cf5
1d3ad0b
BuildRequires: eigen3-devel
1d3ad0b
BuildRequires: gcc-c++
1d3ad0b
BuildRequires: cmake
1d3ad0b
998fbc5
%global base_description \
998fbc5
pybind11 is a lightweight header-only library that exposes C++ types \
998fbc5
in Python and vice versa, mainly to create Python bindings of existing \
1d3ad0b
C++ code.
1d3ad0b
998fbc5
%description
998fbc5
%{base_description}
998fbc5
1d3ad0b
%package devel
1d3ad0b
Summary:  Development headers for pybind11
1d3ad0b
# https://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_Header_Only_Libraries
1d3ad0b
Provides: %{name}-static = %{version}-%{release}
1d3ad0b
# For dir ownership
1d3ad0b
Requires: cmake
1d3ad0b
1d3ad0b
%description devel
998fbc5
%{base_description}
1d3ad0b
1d3ad0b
This package contains the development headers for pybind11.
1d3ad0b
2f09cf5
%if %{python2_enabled}
998fbc5
%package -n     python2-%{name}
998fbc5
Summary:        %{summary}
36c2654
%{?python_provide:%python_provide python2-pybind11}
998fbc5
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
998fbc5
998fbc5
%description -n python2-%{name}
998fbc5
%{base_description}
998fbc5
998fbc5
This package contains the Python 2 files.
2f09cf5
%endif
998fbc5
2f09cf5
%if %{python3_enabled}
998fbc5
%package -n     python3-%{name}
998fbc5
Summary:        %{summary}
36c2654
%{?python_provide:%python_provide python3-pybind11}
998fbc5
998fbc5
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
998fbc5
2f09cf5
%if !%{python2_enabled}
2f09cf5
# Take care of upgrade path
2f09cf5
Obsoletes:      python2-%{name} < %{version}-%{release}
2f09cf5
%endif
2f09cf5
998fbc5
%description -n python3-%{name}
998fbc5
%{base_description}
998fbc5
998fbc5
This package contains the Python 3 files.
2f09cf5
%endif
998fbc5
1d3ad0b
%prep
998fbc5
%setup -q
e3cb2b8
%patch1 -p1 -b .hpath
4ec630b
%patch2 -p1 -b .4902
98878b3
%patch3 -p1 -b .4971
1d3ad0b
1d3ad0b
%build
2f09cf5
pys=""
2f09cf5
%if %{python2_enabled}
5ee4868
pys="$pys python2"
2f09cf5
%endif
2f09cf5
%if %{python3_enabled}
5ee4868
pys="$pys python3"
2f09cf5
%endif
2f09cf5
for py in $pys; do
998fbc5
    mkdir $py
69ba4e8
    # When -DCMAKE_BUILD_TYPE is set to Release, the tests in %%check might segfault.
69ba4e8
    # However, we do not ship any binaries, and therefore Debug
69ba4e8
    # build type does not affect the results.
69ba4e8
    # https://bugzilla.redhat.com/show_bug.cgi?id=1921199
69ba4e8
    %cmake -B $py -DCMAKE_BUILD_TYPE=Debug -DPYTHON_EXECUTABLE=%{_bindir}/$py -DPYBIND11_INSTALL=TRUE -DUSE_PYTHON_INCLUDE_DIR=FALSE %{!?with_tests:-DPYBIND11_TEST=OFF}
d4013f8
    %make_build -C $py
1d3ad0b
done
2f09cf5
2f09cf5
%if %{python2_enabled}
998fbc5
%py2_build
2f09cf5
%endif
2f09cf5
%if %{python3_enabled}
998fbc5
%py3_build
2f09cf5
%endif
1d3ad0b
d6c7e26
%if %{with tests}
1d3ad0b
%check
2f09cf5
%if %{python2_enabled}
1d3ad0b
make -C python2 check %{?_smp_mflags}
2f09cf5
%endif
2f09cf5
%if %{python3_enabled}
1d3ad0b
make -C python3 check %{?_smp_mflags}
2f09cf5
%endif
d6c7e26
%endif
1d3ad0b
1d3ad0b
%install
1524d6f
# Doesn't matter if both installs run
2f09cf5
%if %{python2_enabled}
1d3ad0b
%make_install -C python2
1524d6f
%endif
1524d6f
%if %{python3_enabled}
2f09cf5
%make_install -C python3
2f09cf5
%endif
998fbc5
# Force install to arch-ful directories instead.
2f09cf5
%if %{python2_enabled}
998fbc5
PYBIND11_USE_CMAKE=true %py2_install "--install-purelib" "%{python2_sitearch}"
2f09cf5
%endif
2f09cf5
%if %{python3_enabled}
998fbc5
PYBIND11_USE_CMAKE=true %py3_install "--install-purelib" "%{python3_sitearch}"
2f09cf5
%endif
1d3ad0b
1d3ad0b
%files devel
1d3ad0b
%license LICENSE
e082612
%doc README.rst
1d3ad0b
%{_includedir}/pybind11/
1d3ad0b
%{_datadir}/cmake/pybind11/
9ba40cf
%{_bindir}/pybind11-config
Jonathan 409601a
%{_datadir}/pkgconfig/%{name}.pc
1d3ad0b
2f09cf5
%if %{python2_enabled}
998fbc5
%files -n python2-%{name}
998fbc5
%{python2_sitearch}/%{name}/
998fbc5
%{python2_sitearch}/%{name}-%{version}-py?.?.egg-info
2f09cf5
%endif
998fbc5
2f09cf5
%if %{python3_enabled}
998fbc5
%files -n python3-%{name}
998fbc5
%{python3_sitearch}/%{name}/
c588499
%{python3_sitearch}/%{name}-%{version}-py%{python3_version}.egg-info
2f09cf5
%endif
1d3ad0b
1d3ad0b
%changelog
98878b3
* Wed Dec 13 2023 Miro Hrončok <mhroncok@redhat.com> - 2.11.1-2
98878b3
- Fix make_static_property_type() on Python 3.13
98878b3
- Fixes: rhbz#2252083
98878b3
9a9939b
* Mon Jul 24 2023 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.11.1-1
9a9939b
- Update to 2.11.1.
9a9939b
65daa1a
* Mon Jul 24 2023 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.11.0-1
65daa1a
- Update to 2.11.0.
65daa1a
61d13a0
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.10.4-4
61d13a0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
61d13a0
b10804f
* Fri Jun 16 2023 Python Maint <python-maint@redhat.com> - 2.10.4-3
b10804f
- Rebuilt for Python 3.12
b10804f
aceb3cd
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 2.10.4-2
aceb3cd
- Bootstrap for Python 3.12
aceb3cd
ef867e8
* Fri Mar 17 2023 Pavel Šimovec <psimovec@redhat.com> - 2.10.4-1
ef867e8
- Update to 2.10.4 rhbz#2179208
ef867e8
6f2c342
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.10.3-2
6f2c342
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
6f2c342
08e7d1e
* Mon Jan 09 2023 Jonathan Wright <jonathan@almalinux.org> - 2.10.3-1
08e7d1e
- Update to 2.10.3 rhbz#2155679
08e7d1e
Jonathan 409601a
* Mon Nov 07 2022 Jonathan Wright <jonathan@almalinux.org> - 2.10.1-1
Jonathan 409601a
- Update to 2.10.1 rhbz#2139245
Jonathan 409601a
b3e877b
* Tue Aug 02 2022 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.10.0-1
b3e877b
- Update to 2.10.0.
b3e877b
bdc21ac
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.2-4
bdc21ac
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
bdc21ac
ddbec05
* Tue Jun 14 2022 Python Maint <python-maint@redhat.com> - 2.9.2-3
ddbec05
- Rebuilt for Python 3.11
ddbec05
5beefc8
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 2.9.2-2
5beefc8
- Bootstrap for Python 3.11
5beefc8
cd5fcc4
* Sat Apr 02 2022 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.9.2-1
cd5fcc4
- Update to 2.9.2.
cd5fcc4
f3aef2a
* Tue Feb 08 2022 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.9.1-1
f3aef2a
- Update to 2.9.1.
f3aef2a
e913707
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.0-2
e913707
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
e913707
fcea12a
* Wed Dec 29 2021 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.9.0-1
fcea12a
- Update to 2.9.0.
fcea12a
81143c0
* Fri Nov 26 2021 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.8.1-1
81143c0
- Update to 2.8.1.
81143c0
aeff80c
* Wed Aug 04 2021 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.7.1-1
aeff80c
- Update to 2.7.1.
aeff80c
3a8b19f
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.0-2
3a8b19f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
3a8b19f
c0e8e28
* Sat Jul 17 2021 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.7.0-1
c0e8e28
- Update to 2.7.0.
c0e8e28
166fbf4
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 2.6.2-3
166fbf4
- Rebuilt for Python 3.10
166fbf4
40b5943
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 2.6.2-2
40b5943
- Bootstrap for Python 3.10
40b5943
a290a8f
* Wed Jan 27 2021 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.6.2-1
a290a8f
- Update to 2.6.2.
a290a8f
7e56d3a
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.1-2
7e56d3a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
7e56d3a
c720d29
* Thu Nov 12 2020 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.6.1-1
c720d29
- Update to 2.6.1.
c720d29
9eb1dfb
* Wed Aug 12 2020 Merlin Mathesius <mmathesi@redhat.com> - 2.5.0-5
9eb1dfb
- Drop Python 2 support for ELN and RHEL9+
9eb1dfb
d4013f8
* Wed Aug 05 2020 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.5.0-6
d4013f8
- Adapt to new CMake macros.
d4013f8
b27c91b
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.0-5
b27c91b
- Second attempt - Rebuilt for
b27c91b
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
b27c91b
1485579
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.0-4
1485579
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
1485579
3313a35
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 2.5.0-3
3313a35
- Rebuilt for Python 3.9
3313a35
1baedf1
* Mon May 25 2020 Miro Hrončok <mhroncok@redhat.com> - 2.5.0-2
1baedf1
- Bootstrap for Python 3.9
1baedf1
d4013f8
* Wed Apr 01 2020 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.5.0-1
e3cb2b8
- Update to 2.5.0.
e3cb2b8
37ead64
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.3-2
37ead64
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
37ead64
d4013f8
* Tue Oct 15 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.4.3-1
f2b41fb
- Update to 2.4.3.
f2b41fb
d4013f8
* Tue Oct 08 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.4.2-2
c9d4333
- Fix Python 3.8 incompatibility.
c9d4333
d4013f8
* Sat Sep 28 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.4.2-1
b3c6e37
- Update to 2.4.2.
b3c6e37
d4013f8
* Fri Sep 20 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.4.1-1
86256b1
- Update to 2.4.1.
86256b1
d4013f8
* Fri Sep 20 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.4.0-1
595d158
- Update to 2.4.0.
595d158
a0b23a8
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 2.3.0-3
a0b23a8
- Rebuilt for Python 3.8
a0b23a8
631ea2e
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.0-2
631ea2e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
631ea2e
d4013f8
* Wed Jul 10 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.3.0-1
7d7576c
- Update to 2.3.0.
7d7576c
d4013f8
* Fri May 03 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.2.4-3
db5e4f4
- Fix incompatibility with pytest 4.0.
db5e4f4
21a7fe2
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.4-2
21a7fe2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
21a7fe2
d4013f8
* Tue Sep 18 2018 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.2.4-1
2f09cf5
- Remove python2 packages for Fedora >= 30.
2f09cf5
- Update to 2.2.4.
2f09cf5
b9a3bbd
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.3-3
b9a3bbd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
b9a3bbd
d1939f6
* Sat Jun 23 2018 Miro Hrončok <mhroncok@redhat.com> - 2.2.3-2
d1939f6
- Rebuilt for Python 3.7
d1939f6
d4a1289
* Fri Jun 22 2018 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.2.3-1
d4a1289
- Update to 2.2.3.
d4a1289
e39cdd5
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 2.2.2-4
e39cdd5
- Rebuilt for Python 3.7
e39cdd5
998fbc5
* Mon Apr 16 2018 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.2.2-3
998fbc5
- Add Python subpackages based on Elliott Sales de Andrade's patch.
998fbc5
48d9465
* Sat Feb 17 2018 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.2.2-2
48d9465
- Fix FTBS by patch from upstream.
48d9465
1437f0b
* Wed Feb 14 2018 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.2.2-1
1437f0b
- Update to 2.2.2.
1437f0b
ee11255
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.1-2
ee11255
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
ee11255
5fc86bf
* Thu Dec 14 2017 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 2.2.1-1
5fc86bf
- Update to latest version
6ef401e
- Update Source URL to include project name.
5fc86bf
8174232
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-7
8174232
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
8174232
8918228
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-6
8918228
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
8918228
1d3ad0b
* Mon Feb 27 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-5
1d3ad0b
- Full compliance with header only libraries guidelines.
1d3ad0b
1d3ad0b
* Thu Feb 23 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-4
1d3ad0b
- As advised by upstream, disable dtypes test for now.
1d3ad0b
- Include patch for tests on bigendian systems.
1d3ad0b
1d3ad0b
* Thu Feb 23 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-3
1d3ad0b
- Make the package arched so that tests can be run on all architectures.
1d3ad0b
- Run tests both against python2 and python3.
1d3ad0b
1d3ad0b
* Wed Feb 22 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-2
1d3ad0b
- Switch to python3 for tests.
1d3ad0b
1d3ad0b
* Sun Feb 05 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-1
1d3ad0b
- First release.