This adds the Solidity compiler. It also updates Z3 and jsoncpp to versions needed by Solidity. I tested rebuilding quite a few packages that jsoncpp is a dependent of but I am not sure how to tests them all. Martin Becze (3): gnu: jsoncpp: Update to 1.9.4 gnu: z3: Update to 4.8.9. gnu: Add solidity. gnu/local.mk | 2 +- gnu/packages/maths.scm | 5 +- .../patches/jsoncpp-fix-inverted-case.patch | 22 ----- gnu/packages/serialization.scm | 6 +- gnu/packages/solidity.scm | 88 +++++++++++++++++++ 5 files changed, 95 insertions(+), 28 deletions(-) delete mode 100644 gnu/packages/patches/jsoncpp-fix-inverted-case.patch create mode 100644 gnu/packages/solidity.scm -- 2.29.1
* gnu/packages/serialization.scm (jsoncpp): Update to 1.9.4. * gnu/packages/patches/jsoncpp-fix-inverted-case.patch: Removed old patch. * gnu/local.mk (dist_patch_DATA): Remove old patch. --- gnu/local.mk | 1 - .../patches/jsoncpp-fix-inverted-case.patch | 22 ------------------- gnu/packages/serialization.scm | 6 ++--- 3 files changed, 3 insertions(+), 26 deletions(-) delete mode 100644 gnu/packages/patches/jsoncpp-fix-inverted-case.patch diff --git a/gnu/local.mk b/gnu/local.mk index d4d04c01b8..08a82c45f1 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1180,7 +1180,6 @@ dist_patch_DATA = \ %D%/packages/patches/java-xerces-xjavac_taskdef.patch \ %D%/packages/patches/jfsutils-add-sysmacros.patch \ %D%/packages/patches/jfsutils-include-systypes.patch \ - %D%/packages/patches/jsoncpp-fix-inverted-case.patch \ %D%/packages/patches/julia-SOURCE_DATE_EPOCH-mtime.patch \ %D%/packages/patches/kdbusaddons-kinit-file-name.patch \ %D%/packages/patches/libvirt-create-machine-cgroup.patch \ diff --git a/gnu/packages/patches/jsoncpp-fix-inverted-case.patch b/gnu/packages/patches/jsoncpp-fix-inverted-case.patch deleted file mode 100644 index e4897de1b8..0000000000 --- a/gnu/packages/patches/jsoncpp-fix-inverted-case.patch +++ /dev/null @@ -1,22 +0,0 @@ -This patch fixes a bug and related test failure on platforms where 'char' -is unsigned. - -Taken from upstream: -https://github.com/open-source-parsers/jsoncpp/commit/f11611c8785082ead760494cba06196f14a06dcb - -diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp -index 8e06cca2..56195dc1 100644 ---- a/src/lib_json/json_writer.cpp -+++ b/src/lib_json/json_writer.cpp -@@ -178,8 +178,9 @@ static bool isAnyCharRequiredQuoting(char const* s, size_t n) { - - char const* const end = s + n; - for (char const* cur = s; cur < end; ++cur) { -- if (*cur == '\\' || *cur == '\"' || *cur < ' ' || -- static_cast<unsigned char>(*cur) < 0x80) -+ if (*cur == '\\' || *cur == '\"' || -+ static_cast<unsigned char>(*cur) < ' ' || -+ static_cast<unsigned char>(*cur) >= 0x80) - return true; - } - return false; diff --git a/gnu/packages/serialization.scm b/gnu/packages/serialization.scm index fc0102caf0..86f6ac6a1c 100644 --- a/gnu/packages/serialization.scm +++ b/gnu/packages/serialization.scm @@ -10,6 +10,7 @@ ;;; Copyright © 2017 Nikita <nikita@n0.is> ;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com> +;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net> ;;; ;;; This file is part of GNU Guix. ;;; @@ -285,16 +286,15 @@ that implements both the msgpack and msgpack-rpc specifications.") (define-public jsoncpp (package (name "jsoncpp") - (version "1.9.2") + (version "1.9.4") (home-page "https://github.com/open-source-parsers/jsoncpp") (source (origin (method git-fetch) (uri (git-reference (url home-page) (commit version))) (file-name (git-file-name name version)) - (patches (search-patches "jsoncpp-fix-inverted-case.patch")) (sha256 (base32 - "037d1b1qdmn3rksmn1j71j26bv4hkjv7sn7da261k853xb5899sg")))) + "0qnx5y6c90fphl9mj9d20j2dfgy6s5yr5l0xnzid0vh71zrp6jwv")))) (build-system cmake-build-system) (arguments `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES" -- 2.29.1
* gnu/packages/maths.scm (z3): Update to 4.8.9. --- gnu/packages/maths.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index ba46937f9a..af1d15000c 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -41,6 +41,7 @@ ;;; Copyright © 2020 B. Wilson <elaexuotee@wilsonb.com> ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net> ;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com> +;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net> ;;; ;;; This file is part of GNU Guix. ;;; @@ -4703,7 +4704,7 @@ as equations, scalars, vectors, and matrices.") (define-public z3 (package (name "z3") - (version "4.8.8") + (version "4.8.9") (home-page "https://github.com/Z3Prover/z3") (source (origin (method git-fetch) @@ -4712,7 +4713,7 @@ as equations, scalars, vectors, and matrices.") (file-name (git-file-name name version)) (sha256 (base32 - "1rn538ghqwxq0v8i6578j8mflk6fyv0cp4hjfqynzvinjbps56da")))) + "1hnbzq10d23drd7ksm3c1n2611c3kd0q0yxgz8y78zaafwczvwxx")))) (build-system gnu-build-system) (arguments `(#:imported-modules ((guix build python-build-system) -- 2.29.1
* gnu/packages/solidity.scm: (solidity) New variable. * 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 = \ %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 © 2020 Martin Becze <mjbecze@riseup.net> +;;; +;;; 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 <http://www.gnu.org/licenses/>. + +(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)))) + ;; 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=" + (assoc-ref outputs "out")))) + (setenv "CIRCLECI" "1") + (invoke "./scripts/build.sh") + #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))) + (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+)))) -- 2.29.1
* gnu/packages/serialization.scm (jsoncpp): Update to 1.9.4. * gnu/packages/patches/jsoncpp-fix-inverted-case.patch: Removed old patch. * gnu/local.mk (dist_patch_DATA): Remove old patch. --- gnu/local.mk | 1 - .../patches/jsoncpp-fix-inverted-case.patch | 22 ------------------- gnu/packages/serialization.scm | 6 ++--- 3 files changed, 3 insertions(+), 26 deletions(-) delete mode 100644 gnu/packages/patches/jsoncpp-fix-inverted-case.patch diff --git a/gnu/local.mk b/gnu/local.mk index d4d04c01b8..08a82c45f1 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1180,7 +1180,6 @@ dist_patch_DATA = \ %D%/packages/patches/java-xerces-xjavac_taskdef.patch \ %D%/packages/patches/jfsutils-add-sysmacros.patch \ %D%/packages/patches/jfsutils-include-systypes.patch \ - %D%/packages/patches/jsoncpp-fix-inverted-case.patch \ %D%/packages/patches/julia-SOURCE_DATE_EPOCH-mtime.patch \ %D%/packages/patches/kdbusaddons-kinit-file-name.patch \ %D%/packages/patches/libvirt-create-machine-cgroup.patch \ diff --git a/gnu/packages/patches/jsoncpp-fix-inverted-case.patch b/gnu/packages/patches/jsoncpp-fix-inverted-case.patch deleted file mode 100644 index e4897de1b8..0000000000 --- a/gnu/packages/patches/jsoncpp-fix-inverted-case.patch +++ /dev/null @@ -1,22 +0,0 @@ -This patch fixes a bug and related test failure on platforms where 'char' -is unsigned. - -Taken from upstream: -https://github.com/open-source-parsers/jsoncpp/commit/f11611c8785082ead760494cba06196f14a06dcb - -diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp -index 8e06cca2..56195dc1 100644 ---- a/src/lib_json/json_writer.cpp -+++ b/src/lib_json/json_writer.cpp -@@ -178,8 +178,9 @@ static bool isAnyCharRequiredQuoting(char const* s, size_t n) { - - char const* const end = s + n; - for (char const* cur = s; cur < end; ++cur) { -- if (*cur == '\\' || *cur == '\"' || *cur < ' ' || -- static_cast<unsigned char>(*cur) < 0x80) -+ if (*cur == '\\' || *cur == '\"' || -+ static_cast<unsigned char>(*cur) < ' ' || -+ static_cast<unsigned char>(*cur) >= 0x80) - return true; - } - return false; diff --git a/gnu/packages/serialization.scm b/gnu/packages/serialization.scm index fc0102caf0..86f6ac6a1c 100644 --- a/gnu/packages/serialization.scm +++ b/gnu/packages/serialization.scm @@ -10,6 +10,7 @@ ;;; Copyright © 2017 Nikita <nikita@n0.is> ;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com> +;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net> ;;; ;;; This file is part of GNU Guix. ;;; @@ -285,16 +286,15 @@ that implements both the msgpack and msgpack-rpc specifications.") (define-public jsoncpp (package (name "jsoncpp") - (version "1.9.2") + (version "1.9.4") (home-page "https://github.com/open-source-parsers/jsoncpp") (source (origin (method git-fetch) (uri (git-reference (url home-page) (commit version))) (file-name (git-file-name name version)) - (patches (search-patches "jsoncpp-fix-inverted-case.patch")) (sha256 (base32 - "037d1b1qdmn3rksmn1j71j26bv4hkjv7sn7da261k853xb5899sg")))) + "0qnx5y6c90fphl9mj9d20j2dfgy6s5yr5l0xnzid0vh71zrp6jwv")))) (build-system cmake-build-system) (arguments `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES" -- 2.29.1
* gnu/packages/maths.scm (z3): Update to 4.8.9. --- gnu/packages/maths.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index ba46937f9a..af1d15000c 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -41,6 +41,7 @@ ;;; Copyright © 2020 B. Wilson <elaexuotee@wilsonb.com> ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net> ;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com> +;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net> ;;; ;;; This file is part of GNU Guix. ;;; @@ -4703,7 +4704,7 @@ as equations, scalars, vectors, and matrices.") (define-public z3 (package (name "z3") - (version "4.8.8") + (version "4.8.9") (home-page "https://github.com/Z3Prover/z3") (source (origin (method git-fetch) @@ -4712,7 +4713,7 @@ as equations, scalars, vectors, and matrices.") (file-name (git-file-name name version)) (sha256 (base32 - "1rn538ghqwxq0v8i6578j8mflk6fyv0cp4hjfqynzvinjbps56da")))) + "1hnbzq10d23drd7ksm3c1n2611c3kd0q0yxgz8y78zaafwczvwxx")))) (build-system gnu-build-system) (arguments `(#:imported-modules ((guix build python-build-system) -- 2.29.1
* gnu/packages/solidity.scm: (solidity) New variable. * 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 = \ %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 © 2020 Martin Becze <mjbecze@riseup.net> +;;; +;;; 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 <http://www.gnu.org/licenses/>. + +(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)))) + ;; 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=" + (assoc-ref outputs "out")))) + (setenv "CIRCLECI" "1") + (invoke "./scripts/build.sh") + #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))) + (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+)))) -- 2.29.1
close
this was a mistake
this was a mistake
[-- Attachment #1: Type: text/plain, Size: 1335 bytes --] Martin Becze <mjbecze@riseup.net> writes: > This adds the Solidity compiler. It also updates Z3 and jsoncpp to versions > needed by Solidity. I tested rebuilding quite a few packages that jsoncpp is a > dependent of but I am not sure how to tests them all. > > Martin Becze (3): > gnu: jsoncpp: Update to 1.9.4 > gnu: z3: Update to 4.8.9. > gnu: Add solidity. > > gnu/local.mk | 2 +- > gnu/packages/maths.scm | 5 +- > .../patches/jsoncpp-fix-inverted-case.patch | 22 ----- > gnu/packages/serialization.scm | 6 +- > gnu/packages/solidity.scm | 88 +++++++++++++++++++ > 5 files changed, 95 insertions(+), 28 deletions(-) > delete mode 100644 gnu/packages/patches/jsoncpp-fix-inverted-case.patch > create mode 100644 gnu/packages/solidity.scm Hi Martin, Thanks for the patches, they look good. I've pushed the z3 update to master, as that didn't have many dependent packages. As you've noticed, jsoncpp has quite a few dependencies. The current process to handle changes like this is to push them to the core-updates branch. I have tried building jsoncpp on core-updates, but I'm having problems with git, curl and HTTPS support... I'll hopefully have some more time to investigate further in a bit, Thanks again, Chris [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 987 bytes --]
[-- Attachment #1: Type: text/plain, Size: 1949 bytes --] Christopher Baines <mail@cbaines.net> writes: > Martin Becze <mjbecze@riseup.net> writes: > >> This adds the Solidity compiler. It also updates Z3 and jsoncpp to versions >> needed by Solidity. I tested rebuilding quite a few packages that jsoncpp is a >> dependent of but I am not sure how to tests them all. >> >> Martin Becze (3): >> gnu: jsoncpp: Update to 1.9.4 >> gnu: z3: Update to 4.8.9. >> gnu: Add solidity. >> >> gnu/local.mk | 2 +- >> gnu/packages/maths.scm | 5 +- >> .../patches/jsoncpp-fix-inverted-case.patch | 22 ----- >> gnu/packages/serialization.scm | 6 +- >> gnu/packages/solidity.scm | 88 +++++++++++++++++++ >> 5 files changed, 95 insertions(+), 28 deletions(-) >> delete mode 100644 gnu/packages/patches/jsoncpp-fix-inverted-case.patch >> create mode 100644 gnu/packages/solidity.scm > > Hi Martin, > > Thanks for the patches, they look good. I've pushed the z3 update to > master, as that didn't have many dependent packages. > > As you've noticed, jsoncpp has quite a few dependencies. The current > process to handle changes like this is to push them to the core-updates > branch. I have tried building jsoncpp on core-updates, but I'm having > problems with git, curl and HTTPS support... > > I'll hopefully have some more time to investigate further in a bit, Following up on this, I found out that I broke curl HTTPS support on the core-updates branch, which I've now fixed [1]. 1: https://git.savannah.gnu.org/cgit/guix.git/commit/?h=core-updates&id=8a594487700ddd2d6c293cc5e302ce74f3f56b70 With that fixed, I was able to push these branches in to the core-updates branch, they'll be merged in to master eventually, although that may take quite a few weeks. I'll close this bug, feel free to re-open it if you want to use it to track solidity being available in the master branch. Thanks again, Chris [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 987 bytes --]
[-- Attachment #1: Type: text/plain, Size: 5962 bytes --] I made a few tweaks to this patch before merging. Martin Becze <mjbecze@riseup.net> 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 = \ > %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 © 2020 Martin Becze <mjbecze@riseup.net> > +;;; > +;;; 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 <http://www.gnu.org/licenses/>. > + > +(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=" > + (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+)))) [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 987 bytes --]