guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/03: gnu: Add solidity.


From: guix-commits
Subject: 03/03: gnu: Add solidity.
Date: Wed, 18 Nov 2020 03:13:31 -0500 (EST)

cbaines pushed a commit to branch core-updates
in repository guix.

commit b32d6258d8f92cbd52634fac9e4b6aec5c312ef8
Author: Martin Becze <mjbecze@riseup.net>
AuthorDate: Thu Nov 5 07:59:45 2020 -0600

    gnu: Add solidity.
    
    * gnu/packages/solidity.scm: New file.
    * gnu/local.mk (GNU_SYSTEM_MODULES): Add solidity.scm.
    
    Signed-off-by: Christopher Baines <mail@cbaines.net>
---
 gnu/local.mk              |  1 +
 gnu/packages/solidity.scm | 92 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 93 insertions(+)

diff --git a/gnu/local.mk b/gnu/local.mk
index 60d6b85..f9fed30 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -506,6 +506,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 0000000..26167ee
--- /dev/null
+++ b/gnu/packages/solidity.scm
@@ -0,0 +1,92 @@
+;;; 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
+           (add-after 'unpack 'create-commit_hash.txt
+             (lambda _
+               (with-output-to-file "commit_hash.txt"
+                 (lambda _
+                   (display
+                    (substring ,commit 0 8))))))
+           (delete 'configure)
+           (delete 'install)
+           (replace 'build
+             (lambda* (#:key outputs #:allow-other-keys)
+               ;; 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)))))
+      (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+))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]