From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:47587) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1GOX-000440-Bl for guix-patches@gnu.org; Mon, 10 Feb 2020 16:15:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1GOV-0001vk-0m for guix-patches@gnu.org; Mon, 10 Feb 2020 16:15:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49637) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j1GOU-0001u2-P1 for guix-patches@gnu.org; Mon, 10 Feb 2020 16:15:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j1GOU-0004IB-Hp for guix-patches@gnu.org; Mon, 10 Feb 2020 16:15:02 -0500 Subject: [bug#38687] [PATCH 1/2] gnu: Add lodepng. Resent-Message-ID: From: Marius Bakke In-Reply-To: <20200206201713.8535-1-goodoldpaul@autistici.org> References: <20191220123739.18081-1-goodoldpaul@autistici.org> <20200206201713.8535-1-goodoldpaul@autistici.org> Date: Mon, 10 Feb 2020 22:14:48 +0100 Message-ID: <87k14u2lh3.fsf@devup.no> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" 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: Giacomo Leidi , 38687@debbugs.gnu.org --=-=-= Content-Type: text/plain Giacomo Leidi writes: > * gnu/packages/image.scm (lodepng): New variable. [...] > +(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")) There is a LODEPNG_VERSION_STRING in lodepng.cpp, can you set the "version" variable here to that? > + (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) We try to avoid static libraries in Guix, so no need to install this file. Otherwise LGTM. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl5Bx8gACgkQoqBt8qM6 VPrCFAf+N2wYO+ZVQN8zb4THvPsVkIDyece9cITwV22YeQbeZUdbSzSBBNZ3imi0 RxZ5rSBkR57ilPxIIXUUPnFDWr0Ini5d2p/KUVKL05QCyySxOpsc7O6+YVe/jT3e FxAxeB0My5GgKGtIe3CacrLGkRfnrB/+xT2B1vRnLROT9CDtLQ6qBZ8dunR+1DhN 2Xm3UvVyV86ppqlBBpgaU7nFz44ENS7qibthbI+RNfR9MrPhVa+TMWvx8dlkzVdJ ZRT6WMq1tHKBMHEa5xYpUougxO7gqVE1EZ2gD6TI7bC/4RVdZiwS7SBl82OXc6V3 2FZ3mPr0hw88I0QnRRM2uRi9Y54Jag== =+GmG -----END PGP SIGNATURE----- --=-=-=--