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
This commit is contained in:
Marcus Meissner 2021-06-29 08:45:44 +00:00 committed by Git OBS Bridge
commit 0c4e16a8b8
7 changed files with 258 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,36 @@
From: Antonio Larrosa <alarrosa@suse.com>
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<Coord> left(N), right(N);
std::vector<Coord> 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<double>(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<double>(t, &wiggle[0], &left2[0], NULL, wiggle.order());
double vr = casteljau_subdivision<double>(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<double>(t, &wiggle[0], NULL, NULL, wiggle.order());

View File

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

3
lib2geom-1.1.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8bc63348ac7cb1343b0500d4b4506e30aaa7477e80ebd7ac89a8c382f4d788c4
size 1446383

64
lib2geom.changes Normal file
View File

@ -0,0 +1,64 @@
-------------------------------------------------------------------
Mon Jun 28 10:16:01 UTC 2021 - Antonio Larrosa <alarrosa@suse.com>
- 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 <alarrosa@suse.com>
- 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 <alarrosa@suse.com>
- 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 <alarrosa@suse.com>
- 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 <dcermak@suse.com>
- 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 <andythe_great@pm.me>
- Initail package release.

109
lib2geom.spec Normal file
View File

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