GNU bug report logs - #38687
[PATCH] gnu: Add libtcod.

Previous Next

Package: guix-patches;

Reported by: Giacomo Leidi <goodoldpaul <at> autistici.org>

Date: Fri, 20 Dec 2019 12:39:02 UTC

Severity: normal

Tags: patch

Done: Marius Bakke <mbakke <at> fastmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Giacomo Leidi <goodoldpaul <at> autistici.org>
To: 38687 <at> debbugs.gnu.org
Cc: Giacomo Leidi <goodoldpaul <at> autistici.org>
Subject: [bug#38687] [PATCH 1/2] gnu: Add lodepng.
Date: Thu,  6 Feb 2020 21:17:12 +0100
* gnu/packages/image.scm (lodepng): New variable.
---
 gnu/packages/image.scm | 58 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index 45055858b4..18a51a8773 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -23,6 +23,7 @@
 ;;; Copyright © 2018 Pierre-Antoine Rouby <contact <at> parouby.fr>
 ;;; Copyright © 2018 Alex Vong <alexvong1995 <at> gmail.com>
 ;;; Copyright © 2018 Rutger Helling <rhelling <at> mykolab.com>
+;;; Copyright © 2020 Giacomo Leidi <goodoldpaul <at> autistici.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1841,3 +1842,60 @@ using only text tools.
 SNG is implemented by a compiler/decompiler called sng that
 losslessly translates between SNG and PNG.")
     (license license:zlib)))
+
+(define-public lodepng
+  ;; The project doesn't seem to use any
+  ;; kind of meaningful versioning scheme.
+  (let ((commit "5a0dba103893e6b8084be13945a826663917d00a")
+        (revision "1")
+        (version "0.0.0"))
+    (package
+      (name "lodepng")
+      (version (git-version version revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/lvandeve/lodepng")
+                      (commit commit)))
+                (sha256
+                 (base32
+                  "0nvlba82mf4n7xfc3rz2g9wwgnrxpjw64p5dsjmj2r06g5m4l38a"))
+                (file-name (git-file-name name version))))
+      (build-system gnu-build-system)
+      (arguments
+       '(#:phases
+         (modify-phases %standard-phases
+           (delete 'configure)
+           (replace 'build
+             (lambda _
+               (setenv "CXXFLAGS" "-fPIC")
+               (invoke "make" "lodepng.o")
+               (invoke "make" "lodepng_util.o")
+               (invoke "ar" "rv" "liblodepng.a" "lodepng.o" "lodepng_util.o")
+               (invoke "g++" "-fPIC" "-O3"
+                       "-o" "liblodepng.so"
+                       "-shared" "lodepng.o" "lodepng_util.o")
+               #t))
+           (replace 'check
+             (lambda _
+               (invoke "make" "unittest")
+               (invoke "./unittest")
+               #t))
+           (replace 'install
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (doc (string-append out "/share/doc"))
+                      (lib (string-append out "/lib"))
+                      (include (string-append out "/include")))
+                 (install-file "lodepng.h" include)
+                 (install-file "lodepng_util.h" include)
+                 (install-file "liblodepng.a" lib)
+                 (install-file "liblodepng.so" lib)
+                 (install-file "README.md" doc)
+                 #t))))))
+      (home-page "https://lodev.org/lodepng/")
+      (synopsis "PNG encoder and decoder in C and C++, without dependencies")
+      (description "LodePNG is a PNG image decoder and encoder, all in one,
+no dependency or linkage required.  It's made for C (ISO C90), and has a C++
+wrapper with a more convenient interface on top.")
+      (license license:zlib))))
-- 
2.25.0





This bug report was last modified 5 years and 147 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.