23dfae0
# Copyright (c) 2020 SUSE LLC
23dfae0
#
23dfae0
# All modifications and additions to the file contributed by third parties
23dfae0
# remain the property of their copyright owners, unless otherwise agreed
23dfae0
# upon. The license for this file, and modifications and additions to the
23dfae0
# file, is the same license as for the pristine package itself (unless the
23dfae0
# license for the pristine package is not an Open Source License, in which
23dfae0
# case the license is the MIT License). An "Open Source License" is a
23dfae0
# license that conforms to the Open Source Definition (Version 1.9)
23dfae0
# published by the Open Source Initiative.
23dfae0
23dfae0
Name:           python-pynest2d
23dfae0
Version:        4.8.0
880cbcb
Release:        %autorelease
23dfae0
Summary:        Python bindings for libnest2d
23dfae0
License:        LGPLv3
23dfae0
URL:            https://github.com/Ultimaker/pynest2d
23dfae0
Source:         %{url}/archive/%{version}/pynest2d-%{version}.tar.gz
23dfae0
# Downstream patch: add PyQt5 namespace
23dfae0
Patch0:         pynest2d-PyQt5.sip.patch
23dfae0
# Retrieve required flags from Libnest2D target
23dfae0
# https://github.com/Ultimaker/pynest2d/pull/3
23dfae0
Patch1:         Retrieve-required-flags-from-Libnest2D-target.patch
23dfae0
BuildRequires:  cmake
23dfae0
BuildRequires:  gcc-c++
23dfae0
BuildRequires:  libnest2d-static
23dfae0
BuildRequires:  python3-devel
23dfae0
BuildRequires:  python3-sip-devel < 5
23dfae0
BuildRequires:  python3-pyqt5-sip
23dfae0
Requires:       python3-pyqt5-sip
23dfae0
20c6a79
# we add a dependency on setuptools to provide the distutils module
20c6a79
# upstream already removed the distutils usage in version 5+
20c6a79
BuildRequires:  (python3-setuptools if python3-devel >= 3.12)
20c6a79
23dfae0
%description
23dfae0
Binding allowing libnest2d to be called from Python using NumPy.
23dfae0
23dfae0
%package -n python3-pynest2d
23dfae0
Summary:        %{summary}
23dfae0
23dfae0
%description -n python3-pynest2d
23dfae0
Binding allowing libnest2d to be called from Python using NumPy.
23dfae0
23dfae0
23dfae0
%prep
23dfae0
%autosetup -n pynest2d-%{version} -p1
23dfae0
cf17245
# Boost 1.75+ needs C++14, upstream: https://github.com/Ultimaker/pynest2d/pull/7
cf17245
sed -i 's/CMAKE_CXX_STANDARD 11/CMAKE_CXX_STANDARD 14/' CMakeLists.txt
cf17245
23dfae0
23dfae0
%build
23dfae0
%cmake
23dfae0
%cmake_build
23dfae0
23dfae0
23dfae0
%install
23dfae0
%cmake_install
23dfae0
23dfae0
23dfae0
%files -n python3-pynest2d
23dfae0
%license LICENSE
23dfae0
%doc README.md
23dfae0
%{python3_sitearch}/pynest2d.so
23dfae0
23dfae0
23dfae0
%changelog
880cbcb
%autochangelog