Subject: [PATCH] gnu: Add clipper.

From: Nikolay Korotkiy <[email-masked]>
Date: Tue, 14 Dec 2021 13:16:28 +0300

* gnu/packages/cpp.scm (clipper): New variable.
---
 gnu/packages/cpp.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 9ab6e0b835..64f5a12c58 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -18,6 +18,7 @@
 ;;; Copyright © 2020 Brett Gilio <[email-masked]>
 ;;; Copyright © 2020 Milkey Mouse <[email-masked]>
 ;;; Copyright © 2021 Raghav Gururajan <[email-masked]>
+;;; Copyright © 2021 Nikolay Korotkiy <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1428,3 +1429,33 @@ (define-public simdjson
 validation.")
     (home-page "https://github.com/simdjson/simdjson")
     (license license:asl2.0)))
+
+(define-public clipper
+  (package
+    (name "clipper")
+    (version "6.4.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://sourceforge/polyclipping"
+                           "/clipper_ver" version ".zip"))
+       (sha256
+        (base32
+         "09q6jc5k7p9y5d75qr2na5d1gm0wly5cjnffh127r04l47c20hx1"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f ;no check target
+       #:phases (modify-phases %standard-phases
+                  (replace 'unpack
+                    (lambda* (#:key source #:allow-other-keys)
+                      (and (invoke "unzip" source)
+                           (chdir "cpp")))))))
+    (native-inputs
+     `(("unzip" ,unzip)))
+    (synopsis "A polygon and line clipping and offsetting library")
+    (description
+     "The Clipper library performs line & polygon clipping - intersection,
+union, difference & exclusive-or, and line & polygon offsetting.
+The library is based on Vatti's clipping algorithm.")
+    (home-page "https://sourceforge.net/projects/polyclipping")
+    (license license:boost1.0)))
-- 
2.34.0