From 0c4e16a8b83debd1c315fe57641ebdc26f1eff400f50cc81d27661d4558d137e Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Tue, 29 Jun 2021 08:45:44 +0000 Subject: [PATCH] Accepting request 902793 from home:alarrosa:branches:graphics New package lib2geom required by inkscape 1.1 OBS-URL: https://build.opensuse.org/request/show/902793 OBS-URL: https://build.opensuse.org/package/show/graphics/lib2geom?expand=0&rev=1 --- .gitattributes | 23 ++++ .gitignore | 1 + ...floating-point-epsilon-in-tests-i586.patch | 36 ++++++ fix-pkgconfig-libdir-path.patch | 22 ++++ lib2geom-1.1.tar.gz | 3 + lib2geom.changes | 64 ++++++++++ lib2geom.spec | 109 ++++++++++++++++++ 7 files changed, 258 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 fix-floating-point-epsilon-in-tests-i586.patch create mode 100644 fix-pkgconfig-libdir-path.patch create mode 100644 lib2geom-1.1.tar.gz create mode 100644 lib2geom.changes create mode 100644 lib2geom.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/fix-floating-point-epsilon-in-tests-i586.patch b/fix-floating-point-epsilon-in-tests-i586.patch new file mode 100644 index 0000000..7493bea --- /dev/null +++ b/fix-floating-point-epsilon-in-tests-i586.patch @@ -0,0 +1,36 @@ +From: Antonio Larrosa +Subject: Fix floating point error on i586 by using epsilon + +Submitted to upstream at +https://gitlab.com/inkscape/lib2geom/-/merge_requests/52 + +Index: lib2geom-1.1/tests/bezier-test.cpp +=================================================================== +--- lib2geom-1.1.orig/tests/bezier-test.cpp ++++ lib2geom-1.1/tests/bezier-test.cpp +@@ -134,12 +134,13 @@ TEST_F(BezierTest, Casteljau) { + unsigned N = wiggle.order() + 1; + std::vector left(N), right(N); + std::vector left2(N), right2(N); ++ double eps = 1e-15; + + for (unsigned i = 0; i < 10000; ++i) { + double t = g_random_double_range(0, 1); + double vok = bernstein_value_at(t, &wiggle[0], wiggle.order()); + double v = casteljau_subdivision(t, &wiggle[0], &left[0], &right[0], wiggle.order()); +- EXPECT_EQ(v, vok); ++ EXPECT_near(v, vok, eps); + EXPECT_EQ(left[0], wiggle.at0()); + EXPECT_EQ(left[wiggle.order()], right[0]); + EXPECT_EQ(right[wiggle.order()], wiggle.at1()); +@@ -147,8 +148,8 @@ TEST_F(BezierTest, Casteljau) { + double vl = casteljau_subdivision(t, &wiggle[0], &left2[0], NULL, wiggle.order()); + double vr = casteljau_subdivision(t, &wiggle[0], NULL, &right2[0], wiggle.order()); + EXPECT_EQ(vl, vok); +- EXPECT_EQ(vr, vok); +- EXPECT_vector_equal(left2, left); ++ EXPECT_near(vr, vok, eps); ++ EXPECT_vector_near(left2, left, eps); + EXPECT_vector_equal(right2, right); + + double vnone = casteljau_subdivision(t, &wiggle[0], NULL, NULL, wiggle.order()); diff --git a/fix-pkgconfig-libdir-path.patch b/fix-pkgconfig-libdir-path.patch new file mode 100644 index 0000000..e512a67 --- /dev/null +++ b/fix-pkgconfig-libdir-path.patch @@ -0,0 +1,22 @@ +Index: lib2geom-1.1/2geom.pc.in +=================================================================== +--- lib2geom-1.1.orig/2geom.pc.in ++++ lib2geom-1.1/2geom.pc.in +@@ -1,6 +1,6 @@ + prefix=@CMAKE_INSTALL_PREFIX@ + exec_prefix=${prefix} +-libdir=${exec_prefix}/lib ++libdir=%{prefix}/@CMAKE_INSTALL_LIBDIR@ + includedir=${prefix}/include + + Name: 2geom +Index: lib2geom-1.1/CMakeLists.txt +=================================================================== +--- lib2geom-1.1.orig/CMakeLists.txt ++++ lib2geom-1.1/CMakeLists.txt +@@ -147,4 +147,4 @@ install(DIRECTORY "${CMAKE_CURRENT_SOURC + + configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/2geom.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/2geom.pc @ONLY IMMEDIATE ) +-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/2geom.pc" DESTINATION lib/pkgconfig) ++install(FILES "${CMAKE_CURRENT_BINARY_DIR}/2geom.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") diff --git a/lib2geom-1.1.tar.gz b/lib2geom-1.1.tar.gz new file mode 100644 index 0000000..f8eb652 --- /dev/null +++ b/lib2geom-1.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8bc63348ac7cb1343b0500d4b4506e30aaa7477e80ebd7ac89a8c382f4d788c4 +size 1446383 diff --git a/lib2geom.changes b/lib2geom.changes new file mode 100644 index 0000000..0cba879 --- /dev/null +++ b/lib2geom.changes @@ -0,0 +1,64 @@ +------------------------------------------------------------------- +Mon Jun 28 10:16:01 UTC 2021 - Antonio Larrosa + +- Add patch to fix libdir in pkgconfig file and to install it to + the right location under %{_libdir}/pkgconfig instead of + %{_prefix}/lib/pkgconfig which is being used by upstream: + * fix-pkgconfig-libdir-path.patch + +------------------------------------------------------------------- +Wed Jun 16 07:47:47 UTC 2021 - Antonio Larrosa + +- Use -DCMAKE_SKIP_RPATH:BOOL=OFF so rpath is set on tests and they + can find the library in the build directory. Also use + -DCMAKE_SKIP_INSTALL_RPATHS:BOOL=ON so rpaths are not set in + installed files. + +------------------------------------------------------------------- +Tue Jun 15 16:25:05 UTC 2021 - Antonio Larrosa + +- Add patch to fix a floating point error when running tests on + i586: + * fix-floating-point-epsilon-in-tests-i586.patch + +------------------------------------------------------------------- +Tue Jun 15 07:53:25 UTC 2021 - Antonio Larrosa + +- Update to version 1.1: + * 2Geom v1.1 is not ABI compatible with v1.0, it switches + from boost::optional to std::optional. + * Add Geom::Parallelogram + * Add Geom::PathIteratorSink::inPath() + * Add Geom::are_near_rel() for Geom::Point + * Move headers to include directory + * Make build system git submodule friendly + * Fix Python 3 support (py2geom) + * Remove Python 2 support (py2geom) + +------------------------------------------------------------------- +Tue May 5 07:15:56 UTC 2020 - Dan Čermák + +- Cleanup spec file + * don't use _service, spectool can download the sources + * fix install location of the library + * use macros more consistently + +------------------------------------------------------------------- +Mon May 04 22:14:56 UTC 2020 - andythe_great@pm.me + +- Update to version 1.0: + * Release version 1.0 + * Stabilize API for upcoming release + * Embed googletest in source tree. + * Remove googletest as submodule + * README: Fix path to toys dir + * NEWS: Initial draft of a release announcement for 1.0 + * Fix crash in itemBounds returns an empty interval when the bounds are undefined + * CMake/py2geom: Remove broken/unnecessary win32-specific code + * CMake/py2geom: Make compatible with Boost versions lower than 1.67 + * Proper depends + +------------------------------------------------------------------- +Mon May 4 21:57:40 UTC 2020 - andy great + +- Initail package release. diff --git a/lib2geom.spec b/lib2geom.spec new file mode 100644 index 0000000..f5a4dd9 --- /dev/null +++ b/lib2geom.spec @@ -0,0 +1,109 @@ +# +# spec file for package lib2geom +# +# Copyright (c) 2020 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/ +# + + +%define __builder ninja +%define sonum 1_1_0 +%define libname lib2geom%{sonum} +%define develname 2geom +%define short_version 1.1 +Name: lib2geom +Version: 1.1.0 +Release: 0 +Summary: Easy to use 2D geometry library in C++ +License: LGPL-2.1-only AND MPL-1.1 +URL: https://gitlab.com/inkscape/%{name} +Group: System/Libraries +Source0: %{url}/-/archive/%{short_version}/%{name}-%{short_version}.tar.gz +# PATCH-FIX-UPSTREAM +Patch0: fix-floating-point-epsilon-in-tests-i586.patch +# PATCH-FIX-OPENSUSE +Patch1: fix-pkgconfig-libdir-path.patch +BuildRequires: libboost_headers-devel +BuildRequires: cmake >= 2.6 +BuildRequires: cmake(double-conversion) +BuildRequires: gcc-c++ +BuildRequires: glib2 +BuildRequires: gsl-devel +BuildRequires: gtest +BuildRequires: gtk3-devel +BuildRequires: ninja + +%description +A C++ 2D geometry library geared towards processing data +associated with vector graphics. The primary design consideration +is ease of use and clarity. + +%package -n %{libname} +Summary: Easy to use 2D geometry library in C++ + +%description -n %{libname} +A C++ 2D geometry library geared towards processing data +associated with vector graphics. The primary design consideration +is ease of use and clarity. + +%package devel +Summary: Development files for %{name} +Requires: %{libname} = %{version} +Group: Development/Libraries/C and C++ + +%description devel +This package contains all necessary include files and libraries +needed to develop applications that require %{name}. + +%prep +%autosetup -n %{name}-%{short_version} -p1 + +%build +%cmake -Wno-dev \ + -D2GEOM_BUILD_SHARED:BOOL=ON \ + -D2GEOM_TOYS:BOOL=OFF \ + -D2GEOM_TESTING:BOOL=ON \ + -DCMAKE_SKIP_RPATH:BOOL=OFF \ + -DCMAKE_SKIP_INSTALL_RPATHS:BOOL=ON \ + %{nil} + +%cmake_build + +%install +%cmake_install + +%post -n %{libname} -p /sbin/ldconfig +%postun -n %{libname} -p /sbin/ldconfig + +%check +%ctest + +%files -n %{libname} +%license COPYING-LGPL-2.1 COPYING-MPL-1.1 +%doc NEWS.md README.md +%{_libdir}/%{name}.so.%{version} + +%files devel +%dir %{_includedir}/%{develname}-%{version}/ +%dir %{_includedir}/%{develname}-%{version}/%{develname}/ +%{_includedir}/%{develname}-%{version}/%{develname}/numeric/ +%{_includedir}/%{develname}-%{version}/%{develname}/intervaltree/ +%{_includedir}/%{develname}-%{version}/%{develname}/orphan-code/ +%{_includedir}/%{develname}-%{version}/%{develname}/symbolic/ +%{_includedir}/%{develname}-%{version}/%{develname}/*.h + +%{_libdir}/%{name}.so +%{_libdir}/pkgconfig/%{develname}.pc +%{_libdir}/cmake/2Geom/ + +%changelog