From c4bddbbd263372fa567e3344d61d45e3f931a8a17f2517367a5fbc3cdcc17347 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 18 May 2024 20:10:26 +0000 Subject: [PATCH] Accepting request 1172260 from home:matwey:xtensor Hi. This is a glue between xtensor library and pybind11 library. OBS-URL: https://build.opensuse.org/request/show/1172260 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/xtensor-python?expand=0&rev=1 --- .gitattributes | 23 ++++++ .gitignore | 1 + 0001-Install-as-arch-independent.patch | 30 +++++++ xtensor-python-0.27.0.tar.gz | 3 + xtensor-python.changes | 4 + xtensor-python.spec | 106 +++++++++++++++++++++++++ 6 files changed, 167 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 0001-Install-as-arch-independent.patch create mode 100644 xtensor-python-0.27.0.tar.gz create mode 100644 xtensor-python.changes create mode 100644 xtensor-python.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/0001-Install-as-arch-independent.patch b/0001-Install-as-arch-independent.patch new file mode 100644 index 0000000..941775f --- /dev/null +++ b/0001-Install-as-arch-independent.patch @@ -0,0 +1,30 @@ +From 627ff935c580e5d43824b5ec884502e8b9811394 Mon Sep 17 00:00:00 2001 +From: "Matwey V. Kornilov" +Date: Mon, 6 May 2024 20:57:19 +0300 +Subject: [PATCH] Install as arch-independent + +xternsor-python is header only library, so prefer arch-independed paths cmake. + +References: + * https://github.com/xtensor-stack/xtl/commit/d877d94836aff4d0f727acf3eaab8f4880ecb625 + * https://github.com/xtensor-stack/xtensor/commit/7738389861044c9618c7d59fb7602f7dddc1df7f +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6521c98..47af271 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -123,7 +123,7 @@ export(EXPORT ${PROJECT_NAME}-targets + install(FILES ${XTENSOR_PYTHON_HEADERS} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/xtensor-python) + +-set(XTENSOR_PYTHON_CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" CACHE ++set(XTENSOR_PYTHON_CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/cmake/${PROJECT_NAME}" CACHE + STRING "install path for xtensor-pythonConfig.cmake") + + configure_package_config_file(${PROJECT_NAME}Config.cmake.in +-- +2.44.0 + diff --git a/xtensor-python-0.27.0.tar.gz b/xtensor-python-0.27.0.tar.gz new file mode 100644 index 0000000..4bdc78a --- /dev/null +++ b/xtensor-python-0.27.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40ee01bd213aeb7bf64f6d8a3257f4fa98ed31c401596c6c7b3b115f61a473b9 +size 65455 diff --git a/xtensor-python.changes b/xtensor-python.changes new file mode 100644 index 0000000..6ce78ec --- /dev/null +++ b/xtensor-python.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Mon May 6 13:29:15 UTC 2024 - Matwey Kornilov + +- Initial version diff --git a/xtensor-python.spec b/xtensor-python.spec new file mode 100644 index 0000000..820287c --- /dev/null +++ b/xtensor-python.spec @@ -0,0 +1,106 @@ +# +# spec file for package xtensor-python +# +# Copyright (c) 2024 SUSE LLC +# +# 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. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: xtensor-python +Version: 0.27.0 +Release: 0 +Summary: Python bindings for the xtensor C++ multi-dimensional array library +License: BSD-3-Clause +URL: https://github.com/xtensor-stack/xtensor-python +Source0: https://github.com/xtensor-stack/xtensor-python/archive/refs/tags/%{version}/%{name}-%{version}.tar.gz +Patch0: 0001-Install-as-arch-independent.patch +BuildRequires: cmake +BuildRequires: doctest-devel +BuildRequires: doxygen +BuildRequires: gcc-c++ +BuildRequires: gtest +BuildRequires: make +BuildRequires: python3 +BuildRequires: python3-breathe +BuildRequires: python3-numpy-devel +BuildRequires: xtensor-devel >= 0.25.0 +BuildRequires: cmake(pybind11) >= 2.6.1 +Group: Development/Libraries/C and C++ + +%description +Enables inplace use of numpy arrays in C++ with all the benefits from xtensor: + * C++ universal function and broadcasting, + * STL - compliant APIs, + * A broad coverage of numpy APIs. + +The Python bindings for xtensor are based on the pybind11 C++ library, which +enables seamless interoperability between C++ and Python. + +%package devel +Summary: Development files for xtensor-python +BuildArch: noarch +Requires: xtensor-devel + +%description devel +Enables inplace use of numpy arrays in C++ with all the benefits from xtensor: + * C++ universal function and broadcasting, + * STL - compliant APIs, + * A broad coverage of numpy APIs. + +The Python bindings for xtensor are based on the pybind11 C++ library, which +enables seamless interoperability between C++ and Python. + +%package doc +Summary: Documentation for xtensor-python +Group: Documentation/HTML +BuildArch: noarch + +%description doc +Enables inplace use of numpy arrays in C++ with all the benefits from xtensor: + * C++ universal function and broadcasting, + * STL - compliant APIs, + * A broad coverage of numpy APIs. + +The Python bindings for xtensor are based on the pybind11 C++ library, which +enables seamless interoperability between C++ and Python. + +%prep +%autosetup -p1 + +%build +%cmake -DBUILD_TESTS:BOOL=ON +%cmake_build + +#build documentation +cd %{_builddir}/%{name}-%{version}/docs +make html + +%install +%cmake_install + +#install documentation +mkdir -p %{buildroot}/%{_docdir}/%{name} +cp -r %{_builddir}/%{name}-%{version}/docs/build/html/* %{buildroot}/%{_docdir}/%{name} + +%check +%cmake_build -C %{__builddir} xtest + +%files doc +%doc %{_docdir}/%{name} + +%files devel +%license LICENSE +%{_includedir}/xtensor-python +%{_datadir}/cmake/xtensor-python + +%changelog