From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46889) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dAIAJ-0000Qg-L0 for guix-patches@gnu.org; Mon, 15 May 2017 11:44:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dAIAF-0006n6-3J for guix-patches@gnu.org; Mon, 15 May 2017 11:44:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:44061) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dAIAE-0006ms-OE for guix-patches@gnu.org; Mon, 15 May 2017 11:44:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dAIAE-0000xK-Fm for guix-patches@gnu.org; Mon, 15 May 2017 11:44:02 -0400 Subject: bug#26730: [PATCH 1/2] gnu: bzip2: Use 'modify-phases' syntax. Resent-Message-ID: From: Marius Bakke In-Reply-To: <20170501101015.30567-1-mail@cbaines.net> References: <20170501101015.30567-1-mail@cbaines.net> Date: Mon, 15 May 2017 17:43:06 +0200 Message-ID: <87tw4mf7n9.fsf@fastmail.com> 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: Christopher Baines , 26730@debbugs.gnu.org --=-=-= Content-Type: text/plain Christopher Baines writes: > * gnu/packages/compression.scm (bzip2)[arguments]: Use 'modify-phases' syntax. Thanks a lot for sorting this out! I only have a few nitpicks: > + (replace 'configure > + (lambda* (#:key target #:allow-other-keys) > + (if ,(%current-target-system) > + ;; Cross-compilation: use the cross tools. > + (substitute* (find-files "." "Makefile") > + (("CC=.*$") > + (string-append "CC = " target "-gcc\n")) > + (("AR=.*$") > + (string-append "AR = " target "-ar\n")) > + (("RANLIB=.*$") > + (string-append "RANLIB = " target "-ranlib\n")) > + (("^all:(.*)test" _ prerequisites) > + ;; Remove 'all' -> 'test' dependency. > + (string-append "all:" prerequisites "\n")))))) Noob question: What is returned here when (%current-target-system) is false? Can we make it more explicit? We try to make sure all phases end on a #t. > + (add-after 'install 'install-shared-lib > + (lambda* (#:key outputs #:allow-other-keys) > + (let* ((out (assoc-ref outputs "out")) > + (libdir (string-append out "/lib"))) > + (for-each (lambda (file) > + (let ((base (basename file))) > + (format #t "installing `~a' to `~a'~%" > + base libdir) > + (copy-file file > + (string-append libdir "/" base)))) > + (find-files "." "^libbz2\\.so")))))) Similarly, if you send an updated patch, can you add a #t at the end of this phase, since "for-each" has an unspecified return value? Otherwise I can do so in a follow-up commit. Apart from these "added-value" nitpicks LGTM. Tricky one! --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlkZzIoACgkQoqBt8qM6 VPrJJggAzVo0lxfOdXomUfkNNE4fxq4lK3zVziqrFSxma9E/pBdjsNsPuWYaWMht pFVWoRWy8cWvWXu+kXdQ9LfDHIr8aG+OczpeNAyHhGbRN5+CzidZEv54+cpIeYB8 KWCzzAzh7Dku1Ga2N3s8aP3cD52Hhk43pSegE6KRlmYjS3Ojh5Cw12TI8QAXgbPT wvkHVwWOZs3oFbAA4rTqse1O5uHDRnMCYFiJmH9FSkmlpuVSUnoxhTbaC50j8Wym nCAjD6NJjduQKixqxK3qZa5Rk5EE+zSXfcUlEhoIGK7sggdT3cNwGkMk9NIVZczC B0oHiYlrdKPm69EaEQVeoEGPNJqK8A== =bgPn -----END PGP SIGNATURE----- --=-=-=--