pybind11-vl.spec 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. # While the headers are architecture independent, the package must be
  2. # built separately on all architectures so that the tests are run
  3. # properly. See also
  4. # https://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_Header_Only_Libraries
  5. %global debug_package %{nil}
  6. # Whether to run the tests, enabled by default
  7. %bcond_with tests
  8. %global python2_enabled 0
  9. %global python3_enabled 1
  10. Summary: Seamless operability between C++11 and Python
  11. Name: pybind11
  12. Version: 2.5.0
  13. Release: 7%{?_dist_release}
  14. Group: programming
  15. Vendor: Project Vine
  16. Distribution: Vine Linux
  17. License: BSD
  18. URL: https://github.com/pybind/pybind11
  19. Source0: https://github.com/pybind/pybind11/archive/v%{version}/%{name}-%{version}.tar.gz
  20. # Patch out header path
  21. Patch1: pybind11-2.5.0-hpath.patch
  22. BuildRequires: python-rpm-macros
  23. %if %{python2_enabled}
  24. # Needed to build the python libraries
  25. BuildRequires: python-devel
  26. BuildRequires: python2-setuptools
  27. BuildRequires: python3-rpm-macros
  28. # These are only needed for the checks
  29. %if %{with tests}
  30. BuildRequires: python-pytest
  31. BuildRequires: python-numpy
  32. BuildRequires: python-scipy
  33. %endif
  34. %endif
  35. %if %{python3_enabled}
  36. # Needed to build the python libraries
  37. BuildRequires: python3-devel
  38. BuildRequires: python3-setuptools
  39. BuildRequires: python3-rpm-macros
  40. # These are only needed for the checks
  41. %if %{with tests}
  42. BuildRequires: python3-pytest
  43. BuildRequires: python3-numpy
  44. BuildRequires: python3-scipy
  45. %endif
  46. %endif
  47. BuildRequires: eigen3-devel
  48. BuildRequires: gcc-c++
  49. BuildRequires: cmake
  50. %global base_description \
  51. pybind11 is a lightweight header-only library that exposes C++ types \
  52. in Python and vice versa, mainly to create Python bindings of existing \
  53. C++ code.
  54. %description
  55. %{base_description}
  56. %package devel
  57. Summary: Development headers for pybind11
  58. Group: programming
  59. # https://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_Header_Only_Libraries
  60. Provides: %{name}-static = %{version}-%{release}
  61. # For dir ownership
  62. Requires: cmake
  63. %description devel
  64. %{base_description}
  65. This package contains the development headers for pybind11.
  66. %if %{python2_enabled}
  67. %package -n python-%{name}
  68. Summary: %{summary}
  69. Group: programming
  70. %{?python_provide:%python_provide python2-%{srcname}}
  71. Requires: %{name}-devel%{?_isa} = %{version}-%{release}
  72. %description -n python-%{name}
  73. %{base_description}
  74. This package contains the Python 2 files.
  75. %endif
  76. %if %{python3_enabled}
  77. %package -n python3-%{name}
  78. Summary: %{summary}
  79. Group: programming
  80. %{?python_provide:%python_provide python3-%{srcname}}
  81. Requires: %{name}-devel%{?_isa} = %{version}-%{release}
  82. %if !%{python2_enabled}
  83. # Take care of upgrade path
  84. Obsoletes: python-%{name} < %{version}-%{release}
  85. %endif
  86. %description -n python3-%{name}
  87. %{base_description}
  88. This package contains the Python 3 files.
  89. %endif
  90. %prep
  91. %setup -q
  92. %patch1 -p1 -b .hpath
  93. %build
  94. pys=""
  95. %if %{python2_enabled}
  96. pys="$pys python2"
  97. %endif
  98. %if %{python3_enabled}
  99. pys="$pys python3"
  100. %endif
  101. for py in $pys; do
  102. mkdir $py
  103. %cmake -B $py -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=%{_bindir}/$py -DPYBIND11_INSTALL=TRUE -DUSE_PYTHON_INCLUDE_DIR=FALSE %{!?with_tests:-DPYBIND11_TEST=OFF}
  104. %make_build -C $py
  105. done
  106. %if %{python2_enabled}
  107. %py2_build
  108. %endif
  109. %if %{python3_enabled}
  110. %py3_build
  111. %endif
  112. %if %{with tests}
  113. %check
  114. %if %{python2_enabled}
  115. make -C python2 check %{?_smp_mflags}
  116. %endif
  117. %if %{python3_enabled}
  118. make -C python3 check %{?_smp_mflags}
  119. %endif
  120. %endif
  121. %install
  122. # Doesn't matter if both installs run
  123. %if %{python2_enabled}
  124. %make_install -C python2
  125. %endif
  126. %if %{python3_enabled}
  127. %make_install -C python3
  128. %endif
  129. # Force install to arch-ful directories instead.
  130. %if %{python2_enabled}
  131. PYBIND11_USE_CMAKE=true %py2_install "--install-purelib" "%{python2_sitearch}"
  132. %endif
  133. %if %{python3_enabled}
  134. PYBIND11_USE_CMAKE=true %py3_install "--install-purelib" "%{python3_sitearch}"
  135. %endif
  136. %files devel
  137. %license LICENSE
  138. %doc README.md
  139. %{_includedir}/pybind11/
  140. %{_datadir}/cmake/pybind11/
  141. %if %{python2_enabled}
  142. %files -n python2-%{name}
  143. %{python2_sitearch}/%{name}/
  144. %{python2_sitearch}/%{name}-%{version}-py?.?.egg-info
  145. %endif
  146. %if %{python3_enabled}
  147. %files -n python3-%{name}
  148. %{python3_sitearch}/%{name}/
  149. %{python3_sitearch}/%{name}-%{version}-py%{python3_version}.egg-info
  150. %endif
  151. %changelog
  152. * Fri Sep 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 2.5.0-7
  153. - initial build for Vine Linux.
  154. * Wed Aug 05 2020 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.5.0-6
  155. - Adapt to new CMake macros.
  156. * Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.0-5
  157. - Second attempt - Rebuilt for
  158. https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
  159. * Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.0-4
  160. - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
  161. * Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 2.5.0-3
  162. - Rebuilt for Python 3.9
  163. * Mon May 25 2020 Miro Hrončok <mhroncok@redhat.com> - 2.5.0-2
  164. - Bootstrap for Python 3.9
  165. * Wed Apr 01 2020 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.5.0-1
  166. - Update to 2.5.0.
  167. * Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.3-2
  168. - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
  169. * Tue Oct 15 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.4.3-1
  170. - Update to 2.4.3.
  171. * Tue Oct 08 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.4.2-2
  172. - Fix Python 3.8 incompatibility.
  173. * Sat Sep 28 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.4.2-1
  174. - Update to 2.4.2.
  175. * Fri Sep 20 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.4.1-1
  176. - Update to 2.4.1.
  177. * Fri Sep 20 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.4.0-1
  178. - Update to 2.4.0.
  179. * Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 2.3.0-3
  180. - Rebuilt for Python 3.8
  181. * Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.0-2
  182. - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
  183. * Wed Jul 10 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.3.0-1
  184. - Update to 2.3.0.
  185. * Fri May 03 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.2.4-3
  186. - Fix incompatibility with pytest 4.0.
  187. * Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.4-2
  188. - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
  189. * Tue Sep 18 2018 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.2.4-1
  190. - Remove python2 packages for Fedora >= 30.
  191. - Update to 2.2.4.
  192. * Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.3-3
  193. - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
  194. * Sat Jun 23 2018 Miro Hrončok <mhroncok@redhat.com> - 2.2.3-2
  195. - Rebuilt for Python 3.7
  196. * Fri Jun 22 2018 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.2.3-1
  197. - Update to 2.2.3.
  198. * Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 2.2.2-4
  199. - Rebuilt for Python 3.7
  200. * Mon Apr 16 2018 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.2.2-3
  201. - Add Python subpackages based on Elliott Sales de Andrade's patch.
  202. * Sat Feb 17 2018 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.2.2-2
  203. - Fix FTBS by patch from upstream.
  204. * Wed Feb 14 2018 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.2.2-1
  205. - Update to 2.2.2.
  206. * Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.1-2
  207. - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
  208. * Thu Dec 14 2017 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 2.2.1-1
  209. - Update to latest version
  210. - Update Source URL to include project name.
  211. * Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-7
  212. - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
  213. * Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-6
  214. - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
  215. * Mon Feb 27 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-5
  216. - Full compliance with header only libraries guidelines.
  217. * Thu Feb 23 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-4
  218. - As advised by upstream, disable dtypes test for now.
  219. - Include patch for tests on bigendian systems.
  220. * Thu Feb 23 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-3
  221. - Make the package arched so that tests can be run on all architectures.
  222. - Run tests both against python2 and python3.
  223. * Wed Feb 22 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-2
  224. - Switch to python3 for tests.
  225. * Sun Feb 05 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-1
  226. - First release.