Skip to content

Commit

Permalink
contrib/lib2geom: new package (1.3)
Browse files Browse the repository at this point in the history
  • Loading branch information
nekopsykose committed May 10, 2024
1 parent 6ffc6e2 commit 85ea466
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
1 change: 1 addition & 0 deletions contrib/lib2geom-devel
32 changes: 32 additions & 0 deletions contrib/lib2geom/patches/cpp20.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Patch-Source: https://gitlab.com/inkscape/lib2geom/-/commit/9b1ff56ae90db7fbbceebaac3ccf521f6ceb32f4
needed since poppler is c++20 now
--
From 9b1ff56ae90db7fbbceebaac3ccf521f6ceb32f4 Mon Sep 17 00:00:00 2001
From: PBS <pbs3141@gmail.com>
Date: Sun, 21 Apr 2024 11:58:04 +0900
Subject: [PATCH] Avoid std::shared_ptr<T>::unique()

Replace unique() with use_count() == 1, since unique() was removed in
C++20.

Fixes https://gitlab.com/inkscape/lib2geom/-/issues/74
---
include/2geom/path.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/2geom/path.h b/include/2geom/path.h
index f797dabf..25c8e5ce 100644
--- a/include/2geom/path.h
+++ b/include/2geom/path.h
@@ -843,7 +843,7 @@ private:
void _unshare() {
// Called before every mutation.
// Ensure we have our own copy of curve data and reset cached values
- if (!_data.unique()) {
+ if (_data.use_count() != 1) {
_data.reset(new PathData(*_data));
_closing_seg = static_cast<ClosingSegment*>(&_data->curves.back());
}
--
GitLab

45 changes: 45 additions & 0 deletions contrib/lib2geom/template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
pkgname = "lib2geom"
pkgver = "1.3"
pkgrel = 0
build_style = "cmake"
configure_args = [
"-D2GEOM_BUILD_SHARED=ON",
"-D2GEOM_TESTING=ON",
]
make_check_args = [
"-E",
"("
# tiny floating point errors
+ "circle-test"
+ "|ellipse-test"
# ??
+ "|bezier-test"
+ "|elliptical-arc-test"
+ ")",
]
hostmakedepends = [
"cmake",
"ninja",
"pkgconf",
"python-cython",
"ragel",
]
makedepends = [
"boost-devel",
"cairo-devel",
"double-conversion-devel",
"gsl-devel",
"gtest-devel",
"gtk+3-devel",
]
pkgdesc = "2D geometry library for C++"
maintainer = "psykose <alice@ayaya.dev>"
license = "MPL-1.1 OR LGPL-2.1-only"
url = "https://gitlab.com/inkscape/lib2geom"
source = f"https://gitlab.com/inkscape/lib2geom/-/archive/{pkgver}/lib2geom-{pkgver}.tar.gz"
sha256 = "732a81c6564d5c388bae44f0fdd350f628375e23294941abbe928ab87ec937ab"


@subpackage("lib2geom-devel")
def _devel(self):
return self.default_devel()

0 comments on commit 85ea466

Please sign in to comment.