From 3853fb03cbd15ab84a6744cb8f65231e5702b0e1 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Thu, 6 Feb 2020 00:13:06 -0500 Subject: [PATCH 14/14] gnu: WIP: Add libdepixelize. WIP: This currently fails to build. We need to figure out which ancient version of lib2geom it needs to link against. * gnu/packages/graphics.scm (libdepixelize): New variable. --- gnu/packages/graphics.scm | 67 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm index 208e2a521c..d27440dfea 100644 --- a/gnu/packages/graphics.scm +++ b/gnu/packages/graphics.scm @@ -71,6 +71,7 @@ #:use-module (gnu packages photo) #:use-module (gnu packages pkg-config) #:use-module (gnu packages plotutils) + #:use-module (gnu packages popt) #:use-module (gnu packages pth) #:use-module (gnu packages pulseaudio) ; libsndfile, libsamplerate #:use-module (gnu packages python) @@ -87,6 +88,7 @@ #:use-module (guix build-system gnu) #:use-module (guix build-system python) #:use-module (guix download) + #:use-module (guix bzr-download) #:use-module (guix git-download) #:use-module (guix hg-download) #:use-module ((guix licenses) #:prefix license:) @@ -465,6 +467,71 @@ basic geometries.") ;; and https://gitlab.com/inkscape/inkscape/issues/784). (license license:gpl3+)))) +;;; This older version of 2geom is used by libpixelize. +(define-public lib2geom-0.9 + (package + (inherit lib2geom) + (name "lib2geom") + (version "0.9") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://gitlab.com/inkscape/lib2geom.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1zfb9mkggn36pxyp04z67dvj7r0vqfdw8yy2a41zg7rlcw5v6v67")) + (modules '((guix build utils))) + (snippet + '(begin + (delete-file-recursively "src/googletest") + ;; Fix py2geom module initialization (see: + ;; https://gitlab.com/inkscape/lib2geom/merge_requests/18). + (substitute* "src/py2geom/__init__.py" + (("_py2geom") "py2geom._py2geom")) + ;; Disable toys and tests, as they cause build issues. + (substitute* "src/CMakeLists.txt" + ((".*ADD_SUBDIRECTORY \\(.*tests\\).*") "") + ((".*ADD_SUBDIRECTORY \\(toys\\).*") "") + ((".*gtest.*") "")) + #t)))))) + +(define-public libdepixelize + (let ((revision "187") ;no tags or official releases + (guix-revision "1")) + (package + (name "libdepixelize") + (version (string-append "0.0.0-" guix-revision "." revision)) + (source (origin + (method bzr-fetch) + (uri (bzr-reference + (url (string-append "lp:" name)) + (revision revision))) + (file-name (string-append name "-" version "-checkout")) + (sha256 + (base32 + "19znvam2d2bya05d9sxcj37lnrnvj9c0403aa2p5fv60985xi5b9")))) + (build-system cmake-build-system) + (arguments + `(#:phases (modify-phases %standard-phases + (add-after 'unpack 'patch-sources + (lambda _ + (substitute* "src/priv/splines-kopf2011.h" + ((".*dest\\.pathVector\\.reserve.*") "")) + #t))))) + (native-inputs `(("pkg-config" ,pkg-config))) + (inputs `(("gtkmm" ,gtkmm-2) + ("lib2geom" ,lib2geom-0.9) + ("popt" ,popt))) + (home-page "https://launchpad.net/libdepixelize") + (synopsis "C++ library for vectorizing raster graphics") + (description "Depixelize is a library (and utility) for converting +raster graphics into vector graphics. It implements the algorithm described in +@url{https://johanneskopf.de/publications/pixelart/paper/pixel.pdf,Depixelizing +Pixel Art}.") + (license (list license:gpl2+ license:lgpl2.1+))))) ;dual licensed + (define-public pstoedit (package (name "pstoedit") -- 2.26.2