From patchwork Sun Sep 22 12:03:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 15435 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 131F117408; Sun, 22 Sep 2019 13:04:15 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,UNPARSEABLE_RELAY, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id BD3D717406 for ; Sun, 22 Sep 2019 13:04:14 +0100 (BST) Received: from localhost ([::1]:46546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iC0b8-0005QD-2x for patchwork@mira.cbaines.net; Sun, 22 Sep 2019 08:04:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55481) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iC0az-0005OG-2X for guix-patches@gnu.org; Sun, 22 Sep 2019 08:04:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iC0aw-0005ue-Vs for guix-patches@gnu.org; Sun, 22 Sep 2019 08:04:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52863) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iC0aw-0005uI-O5 for guix-patches@gnu.org; Sun, 22 Sep 2019 08:04:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iC0aw-0002NI-JB for guix-patches@gnu.org; Sun, 22 Sep 2019 08:04:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#37412] [PATCH 1/2] gnu: Add guix-data-service. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 22 Sep 2019 12:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37412 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 37412@debbugs.gnu.org Received: via spool by 37412-submit@debbugs.gnu.org id=B37412.15691538229086 (code B ref 37412); Sun, 22 Sep 2019 12:04:02 +0000 Received: (at 37412) by debbugs.gnu.org; 22 Sep 2019 12:03:42 +0000 Received: from localhost ([127.0.0.1]:33450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iC0ab-0002MO-Uo for submit@debbugs.gnu.org; Sun, 22 Sep 2019 08:03:42 -0400 Received: from mira.cbaines.net ([212.71.252.8]:35900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iC0aY-0002M8-UD for 37412@debbugs.gnu.org; Sun, 22 Sep 2019 08:03:40 -0400 Received: from localhost (220.185.93.209.dyn.plus.net [209.93.185.220]) by mira.cbaines.net (Postfix) with ESMTPSA id 144AC17406 for <37412@debbugs.gnu.org>; Sun, 22 Sep 2019 13:03:38 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 14899235 for <37412@debbugs.gnu.org>; Sun, 22 Sep 2019 12:03:37 +0000 (UTC) From: Christopher Baines Date: Sun, 22 Sep 2019 13:03:36 +0100 Message-Id: <20190922120337.3533-1-mail@cbaines.net> X-Mailer: git-send-email 2.23.0 In-Reply-To: <87v9tt1l0h.fsf@cbaines.net> References: <87v9tt1l0h.fsf@cbaines.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/web.scm (guix-data-service): New variable. --- gnu/packages/web.scm | 102 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index 39475bd6a8..065979f959 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -56,6 +56,7 @@ #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (guix cvs-download) #:use-module (guix hg-download) @@ -77,6 +78,8 @@ #:use-module (gnu packages check) #:use-module (gnu packages documentation) #:use-module (gnu packages docbook) + #:use-module (gnu packages emacs) + #:use-module (gnu packages emacs-xyz) #:use-module (gnu packages autotools) #:use-module (gnu packages compression) #:use-module (gnu packages curl) @@ -3973,6 +3976,105 @@ CDF, Atom 0.3, and Atom 1.0 feeds.") (define-public python2-feedparser (package-with-python2 python-feedparser)) +(define-public guix-data-service + (let ((commit "970bcb31cf994b0e3b67e7f912734e5b53355d8d") + (revision "1")) + (package + (name "guix-data-service") + (version (string-append "0.0.1-" revision "." (string-take commit 7))) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://git.savannah.gnu.org/git/guix/data-service.git") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0wiw1m4g30sx155ldjrg4060ydqwgxv93day89pf6w515n5fv08j")))) + (build-system gnu-build-system) + (arguments + '(#:tests? #f ; TODO Tests require PostgreSQL + #:modules ((guix build utils) + (guix build gnu-build-system) + (ice-9 rdelim) + (ice-9 popen)) + #:phases + (modify-phases %standard-phases + (add-after 'set-paths 'set-GUIX_ENVIRONMENT + (lambda* (#:key inputs #:allow-other-keys) + ;; This means guix.el finds the Emacs modules + (setenv "GUIX_ENVIRONMENT" + (assoc-ref inputs "emacs-with-modules")) + #t)) + (add-before 'build 'set-GUILE_AUTO_COMPILE + (lambda _ + ;; To avoid errors relating to guild + (setenv "GUILE_AUTO_COMPILE" "0") + #t)) + (add-after 'install 'wrap-executable + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (guile (assoc-ref inputs "guile")) + (guile-effective-version + (read-line + (open-pipe* OPEN_READ + (string-append guile "/bin/guile") + "-c" "(display (effective-version))"))) + (scm (string-append out "/share/guile/site/" + guile-effective-version)) + (go (string-append out "/lib/guile/" + guile-effective-version + "/site-ccache"))) + (for-each + (lambda (file) + (wrap-program (string-append bin "/" file) + `("PATH" ":" prefix + (,bin)) + `("GUILE_LOAD_PATH" ":" prefix + (,scm ,(getenv "GUILE_LOAD_PATH"))) + `("GUILE_LOAD_COMPILED_PATH" ":" prefix + (,go ,(getenv "GUILE_LOAD_COMPILED_PATH"))))) + '("guix-data-service" + "guix-data-service-process-branch-updated-email" + "guix-data-service-process-job" + "guix-data-service-process-jobs" + "guix-data-service-query-build-servers")) + #t))) + (delete 'strip)))) ; As the .go files aren't compatible + (inputs + `(("guile" ,guile-2.2) + ("guix" ,guix) + ("guile-fibers" ,guile-fibers) + ("guile-json" ,guile-json-3) + ("guile-email" ,guile-email) + ("guile-squee" ,guile-squee) + ("postgresql" ,postgresql) + ("sqitch" ,sqitch))) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("emacs-with-modules" ,(directory-union + "emacs-union" + (list emacs-no-x + emacs-htmlize))) + ("pkg-config" ,pkg-config))) + (native-search-paths + ;; XXX guile-git requires this to be set, maybe there's a better way + (list (search-path-specification + (variable "GIT_SSL_CAINFO") + (file-type 'regular) + (separator #f) + (files '("etc/ssl/certs/ca-certificates.crt"))))) + (synopsis "Store and provide data about GNU Guix") + (description + "The Guix Data Service stores data about GNU Guix, and provides this +through a web interface. It supports listening to the guix-commits mailing +list to find out about new revisions, then loads the data from these in to a +PostgreSQL database.") + (home-page "http://data.guix.gnu.org/") + (license license:agpl3+)))) + (define-public gumbo-parser (package (name "gumbo-parser")