From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Allan Webber Subject: Re: [PATCH] gnu: Add stellar-core. Date: Fri, 19 Feb 2016 14:37:38 -0800 Message-ID: <871t88pbqc.fsf@dustycloud.org> References: <874md4pdai.fsf@dustycloud.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWtgu-0001UQ-Kr for guix-devel@gnu.org; Fri, 19 Feb 2016 17:38:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWtgr-0006LT-6x for guix-devel@gnu.org; Fri, 19 Feb 2016 17:38:24 -0500 Received: from dustycloud.org ([50.116.34.160]:45118) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWtgr-0006LA-0x for guix-devel@gnu.org; Fri, 19 Feb 2016 17:38:21 -0500 Received: from oolong (localhost [127.0.0.1]) by dustycloud.org (Postfix) with ESMTPS id EBC252673E for ; Fri, 19 Feb 2016 17:38:19 -0500 (EST) In-reply-to: <874md4pdai.fsf@dustycloud.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org --=-=-= Content-Type: text/plain I forgot that I *did* make a nicer workaround, and thus the comment in the middle of the package definition was unnecessary. --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-Add-stellar-core.patch Content-Transfer-Encoding: quoted-printable >From 056400626d070fd8653cdc03a9b0fbcdc49be5df Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Fri, 19 Feb 2016 13:47:19 -0800 Subject: [PATCH] gnu: Add stellar-core. * gnu/packages/finance.scm (stellar-core): New variable. * gnu/packages/patches/stellar-core-find-mk-files.patch: New file. --- gnu/packages/finance.scm | 60 ++++++++++++++++= ++++++ .../patches/stellar-core-find-mk-files.patch | 33 ++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 gnu/packages/patches/stellar-core-find-mk-files.patch diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm index e9487d4..e208791 100644 --- a/gnu/packages/finance.scm +++ b/gnu/packages/finance.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2015 Andreas Enge ;;; Copyright =C2=A9 2016 Efraim Flashner +;;; Copyright =C2=A9 2016 Christopher Allan Webber ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,9 +22,15 @@ #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix git-download) #:use-module (guix build utils) #:use-module (guix build-system gnu) + #:use-module (gnu packages) + #:use-module (gnu packages autogen) + #:use-module (gnu packages autotools) #:use-module (gnu packages boost) + #:use-module (gnu packages bison) + #:use-module (gnu packages flex) #:use-module (gnu packages databases) #:use-module (gnu packages linux) #:use-module (gnu packages pkg-config) @@ -81,3 +88,56 @@ collectively by the network. Bitcoin Core is the refe= rence implementation of the bitcoin protocol. This package provides the Bitcoin Core command line client and a client based on Qt.") (license license:expat))) + +(define-public stellar-core + (package + (name "stellar-core") + (version "0.4.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/stellar/stellar-core.git") + (commit "v0.4.1") + (recursive? #t))) + (sha256 + (base32 + "15mm1jk2kk5x34vn9gqwp7ijhsmhm6dwymznz7hqvjj8kjd088fi")) + (patches (list (search-patch + "stellar-core-find-mk-files.patch"))))) + (arguments + '(#:phases (modify-phases %standard-phases + (add-before 'configure 'autogen-self-and-submodules + (lambda _ + (and (zero? (system* "sh" "autogen.sh" + ;; we'll handle submodules ma= nually + "--skip-submodules")) + ;; Run autogen on libsodium too. + ;; In the future, we might also have to manua= lly + ;; run this on other git submodules which are + ;; introduced + (begin (chdir "lib/libsodium") #t) + (zero? (system* "sh" "autogen.sh")) + (begin (chdir "../..") #t))))) + ;; Tries to run tests with a running postgres server... + ;; well, sorry, we can't do that! + #:tests? #f)) + (build-system gnu-build-system) + (native-inputs + `(("pkg-config" ,pkg-config) + ("autoconf" ,autoconf) + ("automake" ,automake) + ("autogen" ,autogen) + ;; used by libsodium git submodule + ("libtool" ,libtool))) + (inputs + `(("bison" ,bison) + ("flex" ,flex) + ("postgresql" ,postgresql))) + (home-page "https://www.stellar.org/") + (synopsis "Communicate with the Stellar peer-to-peer network") + (description "Stellar-core is a replicated state machine that +maintains a local copy of a cryptographic ledger and processes +transactions against it, in consensus with a set of peers. +It implements the Stellar Consensus Protocol, a federated consensus +protocol.") + (license license:asl2.0))) diff --git a/gnu/packages/patches/stellar-core-find-mk-files.patch b/gnu/= packages/patches/stellar-core-find-mk-files.patch new file mode 100644 index 0000000..2b26171 --- /dev/null +++ b/gnu/packages/patches/stellar-core-find-mk-files.patch @@ -0,0 +1,33 @@ +Use "find" instead of "git ls-files" to fill in the src/src.mk file + +(Guix removes the .git directory, so we have to do this!) + +diff --git a/make-mks b/make-mks +index f3edf10..5972ebf 100755 +--- a/make-mks ++++ b/make-mks +@@ -6,21 +6,17 @@ case "$0" in + ;; + esac +=20 +-# Bail if not under git +-git rev-parse +- + trap 'rm -f src/src.mk lib/medida.mk lib/lib.mk' 0 +=20 + message=3D"# This file was generated by make-mks; don't edit it by hand= ." +=20 +-# Use only files git knows about, to avoid picking up autogenrated +-# files or other random cruft. When adding a new file foo.cpp, you +-# must run "git add -N foo.cpp" before running this script. ++# Since Guix is running not from git, we can just use find to fill ++# in this information instead of `git lsfiles` + (cd src + echo "$message" +- echo "SRC_H_FILES" =3D $(git ls-files '*.h' '*.[ih]pp') +- echo "SRC_CXX_FILES" =3D $(git ls-files '*.cpp') +- echo "SRC_X_FILES" =3D $(git ls-files '*.x') ++ echo "SRC_H_FILES" =3D $(find . -name '*.h') $(find . -name '*.[ih]pp'= ) ++ echo "SRC_CXX_FILES" =3D $(find . -name '*.cpp') ++ echo "SRC_X_FILES" =3D $(find . -name '*.x') + ) > src/src.mk --=20 2.6.3 --=-=-=--