From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:43153) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iznb9-0003dv-Lq for guix-patches@gnu.org; Thu, 06 Feb 2020 15:18:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iznb8-0005Lm-Er for guix-patches@gnu.org; Thu, 06 Feb 2020 15:18:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:42562) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iznb8-0005Lg-BL for guix-patches@gnu.org; Thu, 06 Feb 2020 15:18:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iznb8-0003JW-7Z for guix-patches@gnu.org; Thu, 06 Feb 2020 15:18:02 -0500 Subject: [bug#38687] [PATCH 1/2] gnu: Add lodepng. References: <20191220123739.18081-1-goodoldpaul@autistici.org> In-Reply-To: <20191220123739.18081-1-goodoldpaul@autistici.org> Resent-Message-ID: From: Giacomo Leidi Date: Thu, 6 Feb 2020 21:17:12 +0100 Message-Id: <20200206201713.8535-1-goodoldpaul@autistici.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 38687@debbugs.gnu.org Cc: Giacomo Leidi * 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 ;;; Copyright © 2018 Alex Vong ;;; Copyright © 2018 Rutger Helling +;;; Copyright © 2020 Giacomo Leidi ;;; ;;; 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