;;; Copyright © 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 (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+)))) 2020-12-15store-copy: 'populate-store' can optionally deduplicate files.Ludovic Courtès Until now deduplication was performed as an additional pass after copying files, which involve re-traversing all the files that had just been copied. * guix/store/deduplication.scm (copy-file/deduplicate): New procedure. * tests/store-deduplication.scm ("copy-file/deduplicate"): New test. * guix/build/store-copy.scm (populate-store): Add #:deduplicate? parameter and honor it. * tests/gexp.scm ("gexp->derivation, store copy"): Pass #:deduplicate? #f to 'populate-store'. * gnu/build/image.scm (initialize-root-partition): Pass #:deduplicate? to 'populate-store'. Pass #:deduplicate? #f to 'register-closure'. * gnu/build/vm.scm (root-partition-initializer): Likewise. * gnu/build/install.scm (populate-single-profile-directory): Pass #:deduplicate? #f to 'populate-store'. * gnu/build/linux-initrd.scm (build-initrd): Likewise. * guix/scripts/pack.scm (self-contained-tarball)[import-module?]: New procedure. [build]: Pass it as an argument to 'source-module-closure'. * guix/scripts/pack.scm (squashfs-image)[build]: Wrap in 'with-extensions'. * gnu/system/linux-initrd.scm (expression->initrd)[import-module?]: New procedure. [builder]: Pass it to 'source-module-closure'. * gnu/system/install.scm (cow-store-service-type)[import-module?]: New procedure. Pass it to 'source-module-closure'.