From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id CGJIOe7ZtF+rNwAA0tVLHw (envelope-from ) for ; Wed, 18 Nov 2020 08:23:10 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id iHMpNe7ZtF/MPAAA1q6Kng (envelope-from ) for ; Wed, 18 Nov 2020 08:23:10 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3F52D9400D3 for ; Wed, 18 Nov 2020 08:23:10 +0000 (UTC) Received: from localhost ([::1]:53976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kfIk8-0005k8-Du for larch@yhetil.org; Wed, 18 Nov 2020 03:23:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48642) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfIk2-0005jz-GL for guix-patches@gnu.org; Wed, 18 Nov 2020 03:23:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:50586) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kfIk2-0003Ty-6R for guix-patches@gnu.org; Wed, 18 Nov 2020 03:23:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kfIk2-0004RF-2Q for guix-patches@gnu.org; Wed, 18 Nov 2020 03:23:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#44433] [PATCH 3/3] gnu: Add solidity. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 18 Nov 2020 08:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44433 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Martin Becze Cc: 44433@debbugs.gnu.org Received: via spool by 44433-submit@debbugs.gnu.org id=B44433.160568776317019 (code B ref 44433); Wed, 18 Nov 2020 08:23:02 +0000 Received: (at 44433) by debbugs.gnu.org; 18 Nov 2020 08:22:43 +0000 Received: from localhost ([127.0.0.1]:33899 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kfIjb-0004QG-LC for submit@debbugs.gnu.org; Wed, 18 Nov 2020 03:22:43 -0500 Received: from mira.cbaines.net ([212.71.252.8]:58822) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kfIjX-0004Q6-Br for 44433@debbugs.gnu.org; Wed, 18 Nov 2020 03:22:34 -0500 Received: from localhost (188.30.135.14.threembb.co.uk [188.30.135.14]) by mira.cbaines.net (Postfix) with ESMTPSA id CA33D27BBF5; Wed, 18 Nov 2020 08:22:30 +0000 (GMT) Received: from capella (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id cad88251; Wed, 18 Nov 2020 08:22:28 +0000 (UTC) References: <20201104122928.30408-1-mjbecze@riseup.net> <20201105135945.26384-1-mjbecze@riseup.net> <20201105135945.26384-3-mjbecze@riseup.net> User-agent: mu4e 1.4.13; emacs 27.1 From: Christopher Baines In-reply-to: <20201105135945.26384-3-mjbecze@riseup.net> Date: Wed, 18 Nov 2020 08:22:28 +0000 Message-ID: <87lfezkraz.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -3.11 X-TUID: fGBZu97kPdTe --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable I made a few tweaks to this patch before merging. Martin Becze writes: > * gnu/packages/solidity.scm: (solidity) New variable. It is a new variable, but I believe the convention for new files is just to say that, so I changed this to: * gnu/packages/solidity.scm: New file. > * gnu/local.mk (GNU_SYSTEM_MODULES): Add solidity.scm. > --- > gnu/local.mk | 1 + > gnu/packages/solidity.scm | 88 +++++++++++++++++++++++++++++++++++++++ > 2 files changed, 89 insertions(+) > create mode 100644 gnu/packages/solidity.scm > > diff --git a/gnu/local.mk b/gnu/local.mk > index 08a82c45f1..92be573355 100644 > --- a/gnu/local.mk > +++ b/gnu/local.mk > @@ -508,6 +508,7 @@ GNU_SYSTEM_MODULES =3D \ > %D%/packages/slang.scm \ > %D%/packages/smalltalk.scm \ > %D%/packages/sml.scm \ > + %D%/packages/solidity.scm \ > %D%/packages/speech.scm \ > %D%/packages/sphinx.scm \ > %D%/packages/spice.scm \ > diff --git a/gnu/packages/solidity.scm b/gnu/packages/solidity.scm > new file mode 100644 > index 0000000000..f67bae8146 > --- /dev/null > +++ b/gnu/packages/solidity.scm > @@ -0,0 +1,88 @@ > +;;; Copyright =C2=A9 2020 Martin Becze > +;;; > +;;; This file is part of GNU Guix. > +;;; > +;;; GNU Guix is free software; you can redistribute it and/or modify it > +;;; under the terms of the GNU General Public License as published by > +;;; the Free Software Foundation; either version 3 of the License, or (at > +;;; your option) any later version. > +;;; > +;;; GNU Guix is distributed in the hope that it will be useful, but > +;;; WITHOUT ANY WARRANTY; without even the implied warranty of > +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +;;; GNU General Public License for more details. > +;;; > +;;; You should have received a copy of the GNU General Public License > +;;; along with GNU Guix. If not, see . > + > +(define-module (gnu packages solidity) > + #:use-module (gnu packages base) > + #:use-module (gnu packages boost) > + #:use-module (gnu packages maths) > + #:use-module (gnu packages serialization) > + #:use-module (gnu packages python) > + #:use-module (gnu packages ncurses) > + #:use-module (guix packages) > + #:use-module (guix git-download) > + #:use-module (guix build-system cmake) > + #:use-module ((guix licenses) #:prefix license:)) > + > +(define-public solidity > + (let ((commit "3f05b770bdbf60eca866382049ea191dd701409a")) > + (package > + (name "solidity") > + (version "0.7.4") > + (source > + (origin > + (method git-fetch) > + (uri > + (git-reference > + (url "https://github.com/ethereum/solidity") > + (commit commit))) > + (file-name (git-file-name name version)) > + (sha256 > + (base32 "1mswhjymiwnd3n7h3sjvjx5x8223yih0yvfcr0zpqr4aizpfx5z8"= )))) > + (build-system cmake-build-system) > + (arguments > + `(#:phases > + (modify-phases %standard-phases > + (delete 'configure) > + (delete 'install) > + (replace 'build > + (lambda* (#:key outputs #:allow-other-keys) > + (with-output-to-file "commit_hash.txt" > + (lambda _ > + (display > + (substring ,commit 0 8)))) I moved this to a different phase, just because it makes it clearer what's going on. > + ;; Unbundle jsoncpp > + (delete-file "./cmake/jsoncpp.cmake") > + (substitute* "CMakeLists.txt" > + (("include\\(jsoncpp\\)") "")) > + ;; Bug list is always sorted since we only build releases > + (substitute* "./test/cmdlineTests.sh" > + (("\"\\$REPO_ROOT\"/scripts/update_bugs_by_version\\.py= ") "")) > + (substitute* "./scripts/build.sh" > + (("sudo\\ make\\ install") "make install") > + (("cmake\\ ..") > + (string-append "cmake .. -DCMAKE_INSTALL_PREFIX=3D" > + (assoc-ref outputs "out")))) > + (setenv "CIRCLECI" "1") > + (invoke "./scripts/build.sh") I'd perhaps be tempted to just use/adjust the cmake-build-system to handle the actual building. Just using cmake/make directly seems to be documented [1]. 1: https://docs.soliditylang.org/en/v0.7.4/installing-solidity.html#command= -line-build I noticed the build.sh script hardcodes the concurrency [2], which got me thinking this. 2: https://github.com/ethereum/solidity/blob/develop/scripts/build.sh#L21 Anyway, calling build.sh is also OK. > + #t)) > + (replace 'check > + (lambda _ > + (invoke "./scripts/tests.sh") > + #t))))) > + (native-inputs > + `(("boost-static" ,boost-static) > + ("jsoncpp" ,jsoncpp) > + ("python" ,python) > + ("tput" ,ncurses) > + ("xargs" ,findutils) > + ("z3" ,z3))) So, some of these inputs are still referenced by the package at runtime, which is a strong signal that they should be inputs, rather than native inputs. I split it like this: (inputs `(("boost-static" ,boost-static) ("jsoncpp" ,jsoncpp) ("z3" ,z3))) (native-inputs `(("python" ,python) ("tput" ,ncurses) ("xargs" ,findutils))) > + (home-page "https://solidity.readthedocs.io") > + (synopsis "Contract-Oriented Programming Language") > + (description > + "Solidity is a statically-typed curly-braces programming language > +designed for developing smart contracts that run on the Ethereum Virtual= Machine.") > + (license license:gpl3+)))) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl+02cRfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XdcKw/9E5wNfcWZCM5CWmyRvJ+Lo5EVaz5hlLoi ZwkI6TViAzcy/HztK5fBjQMSkGBeYh6Bpr0qYmjB2sugKSB9jf/MjyKmQbRKKKQQ DVBIO6Xis0/oKeZACYJtbRp3GlpIdUEL/kEVzLHeG9UIz3fF5Ta9y6Lu58JMj+Bv LGhOfjetD4UtHn+IZzTh+2AlqNTwXcqLiYMl6jQWmo8OEeFs0OaBQ8/mK5N40KUS RuIWvzX8iditlLp/QzbcTLPv5fLF0T/Df3x7hPyjXlpe7lZVdd55beXu179vuxkl RHbebjbmxxlSGWDcqXbIdvHKmgZzueSeYds0/0nw5/uWUxqD9IkiMhXA35xAsCwE i5iBIuLcRLi8N1A3H2sl5d6o2nwXFAqyJTmSU7dMir5j2jizGl092rV/jagoU5A5 0GrC1LhAAhp3ptFj3GqmCjJLryun7PZJwGUW+kxkUQBaqdaICTSyOKs145FLjDsi olYCe7HJ9sCucxiPRptcE+mtUVJe+kuBidAFrfzwzxgH1SzLpBEdJVsq8p2xceGw yTEXZvM7g9RqFIBAkDuA9r65rbNaYrlfVDv0UxhxOR98wCYhKuAHGkDu+dU14o/F nFlAqmMb4KkX9/yJfcnHFMqStTdMXCSZqmSU8TyeclFhH6g8R6moIHE+KeJbYulI sHAHGmZafFY= =ap49 -----END PGP SIGNATURE----- --=-=-=--