[packages/lib2geom] - new - pc patch to fix libdir in .pc file - python-install patch to fix python3 module install path

qboosh qboosh at pld-linux.org
Tue Feb 8 16:34:59 CET 2022


commit 72198c6fc955e0db0879da82aaf106f5cfa40743
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Tue Feb 8 16:36:26 2022 +0100

    - new
    - pc patch to fix libdir in .pc file
    - python-install patch to fix python3 module install path

 lib2geom-pc.patch             |  10 ++++
 lib2geom-python-install.patch |  14 +++++
 lib2geom.spec                 | 135 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 159 insertions(+)
---
diff --git a/lib2geom.spec b/lib2geom.spec
new file mode 100644
index 0000000..991091f
--- /dev/null
+++ b/lib2geom.spec
@@ -0,0 +1,135 @@
+#
+# Conditional build:
+%bcond_without	python	# Python bindings
+#
+Summary:	2Geom - easy 2D graphics library
+Summary(pl.UTF-8):	2Geom - łatwa biblioteka do grafiki 2D
+Name:		lib2geom
+Version:	1.1
+Release:	1
+License:	LGPL v2.1 or MPL v1.1
+Group:		Libraries
+#Source0Download: https://gitlab.com/inkscape/lib2geom/-/tags
+Source0:	https://gitlab.com/inkscape/lib2geom/-/archive/%{version}/%{name}-%{version}.tar.bz2
+# Source0-md5:	438a95f4c92b8370b3ab00a843c8a5fa
+Patch0:		%{name}-pc.patch
+Patch1:		%{name}-python-install.patch
+URL:		https://gitlab.com/inkscape/lib2geom
+BuildRequires:	boost-devel >= 1.60
+%{?with_python:BuildRequires:	boost-python3-devel >= 1.60}
+BuildRequires:	cairo-devel
+BuildRequires:	cmake >= 3.12
+BuildRequires:	double-conversion-devel
+BuildRequires:	glib2-devel >= 2.0
+BuildRequires:	gsl-devel
+BuildRequires:	gtk+3-devel >= 3.0
+BuildRequires:	pkgconfig
+%{?with_python:BuildRequires:	python3-Cython >= 0.16}
+%{?with_python:BuildRequires:	python3-devel >= 1:3.2}
+BuildRequires:	libstdc++-devel >= 6:7
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+2Geom is a C++ 2D geometry library geared towards robust processing of
+computational geometry data associated with vector graphics. The
+primary design consideration is ease of use and clarity. It is
+dual-licensed under LGPL 2.1 and MPL 1.1.
+
+%description -l pl.UTF-8
+2Geom to biblioteka C++ do geometrii 2D, nakierowana głównie na bogate
+przetwarzanie danych geometrii obliczeniowej, związanych z grafiką
+wektorową. Główne założenia projektowe to łatwość użycia i
+przejrzystość. Kod biblioteki jest na podwójnej licencji LGPL 2.1 i
+MPL 1.1.
+
+%package devel
+Summary:	Header files for 2Geom library
+Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki 2Geom
+Group:		Development/Libraries
+Requires:	%{name} = %{version}-%{release}
+Requires:	boost-devel >= 1.60
+Requires:	gsl-devel
+Requires:	libstdc++-devel >= 6:7
+
+%description devel
+Header files for 2Geom library.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki 2Geom.
+
+%package -n python3-py2geom
+Summary:	Python bindings for lib2geom
+Summary(pl.UTF-8):	Wiązania Pythona do lib2geom
+Group:		Libraries/Python
+Requires:	%{name} = %{version}-%{release}
+
+%description -n python3-py2geom
+Boost-based Python bindings for lib2geom.
+
+%description -n python3-py2geom -l pl.UTF-8
+Wiązania Pythona do lib2geom oparte na bibliotece Boost.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+
+%build
+install -d build
+cd build
+%cmake .. \
+	-D2GEOM_BUILD_SHARED=ON \
+	%{?with_python:-D2GEOM_BOOST_PYTHON=ON} \
+	%{?with_python:-D2GEOM_CYTHON_BINDINGS=ON} \
+	-DCMAKE_SKIP_RPATH=ON \
+	-DPYTHON3_SITEARCH_INSTALL_DIR=%{py3_sitedir}
+
+%{__make}
+
+%if %{with python}
+# cy2geom code seems outdated
+#%{__make} -C src/cython
+
+%{__make} -C src/py2geom
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} -C build install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+%if %{with python}
+%{__make} -C build/src/py2geom install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+%py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
+%py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post	-p /sbin/ldconfig
+%postun	-p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc AUTHORS.md LICENSE.md NEWS.md README.md TODO.md
+%attr(755,root,root) %{_libdir}/lib2geom.so.1.1.0
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/lib2geom.so
+%{_includedir}/2geom-1.1.0
+%{_pkgconfigdir}/2geom.pc
+%{_libdir}/cmake/2Geom
+
+%if %{with python}
+%files -n python3-py2geom
+%defattr(644,root,root,755)
+%dir %{py3_sitedir}/py2geom
+%{py3_sitedir}/py2geom/__pycache__
+%{py3_sitedir}/py2geom/__init__.py
+%attr(755,root,root) %{py3_sitedir}/py2geom/_py2geom.so
+%endif
diff --git a/lib2geom-pc.patch b/lib2geom-pc.patch
new file mode 100644
index 0000000..7779521
--- /dev/null
+++ b/lib2geom-pc.patch
@@ -0,0 +1,10 @@
+--- lib2geom-1.1/2geom.pc.in.orig	2021-01-15 18:42:28.000000000 +0100
++++ lib2geom-1.1/2geom.pc.in	2022-02-08 16:21:55.187190307 +0100
+@@ -1,6 +1,6 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=${prefix}
+-libdir=${exec_prefix}/lib
++libdir=${exec_prefix}/lib at LIB_SUFFIX@
+ includedir=${prefix}/include
+ 
+ Name: 2geom
diff --git a/lib2geom-python-install.patch b/lib2geom-python-install.patch
new file mode 100644
index 0000000..91faeb4
--- /dev/null
+++ b/lib2geom-python-install.patch
@@ -0,0 +1,14 @@
+--- lib2geom-1.1/src/py2geom/CMakeLists.txt.orig	2021-01-15 18:42:28.000000000 +0100
++++ lib2geom-1.1/src/py2geom/CMakeLists.txt	2022-02-08 16:17:51.016422578 +0100
+@@ -110,8 +110,9 @@ IF(2GEOM_BOOST_PYTHON)
+             TARGET_LINK_LIBRARIES(py2geom ${Cairo_LIBRARIES})
+         ENDIF(PYCAIRO_FOUND)
+ 
+-	INSTALL(TARGETS py2geom DESTINATION "${Python3_SITEARCH}/py2geom")
+-        INSTALL(FILES "${CMAKE_CURRENT_SOURCE_DIR}/__init__.py" DESTINATION "${Python3_SITEARCH}/py2geom")
++	SET(PYTHON3_SITEARCH_INSTALL_DIR "${Python3_SITEARCH}" CACHE INTERNAL "")
++	INSTALL(TARGETS py2geom DESTINATION "${PYTHON3_SITEARCH_INSTALL_DIR}/py2geom")
++	INSTALL(FILES "${CMAKE_CURRENT_SOURCE_DIR}/__init__.py" DESTINATION "${PYTHON3_SITEARCH_INSTALL_DIR}/py2geom")
+ ENDIF(2GEOM_BOOST_PYTHON)
+ 
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/lib2geom.git/commitdiff/72198c6fc955e0db0879da82aaf106f5cfa40743



More information about the pld-cvs-commit mailing list