8
0

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
This commit is contained in:
2024-05-18 20:10:26 +00:00
committed by Git OBS Bridge
commit c4bddbbd26
6 changed files with 167 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -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

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

View File

@@ -0,0 +1,30 @@
From 627ff935c580e5d43824b5ec884502e8b9811394 Mon Sep 17 00:00:00 2001
From: "Matwey V. Kornilov" <matwey.kornilov@gmail.com>
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

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:40ee01bd213aeb7bf64f6d8a3257f4fa98ed31c401596c6c7b3b115f61a473b9
size 65455

4
xtensor-python.changes Normal file
View File

@@ -0,0 +1,4 @@
-------------------------------------------------------------------
Mon May 6 13:29:15 UTC 2024 - Matwey Kornilov <matwey.kornilov@gmail.com>
- Initial version

106
xtensor-python.spec Normal file
View File

@@ -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