unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add sparql-query.
@ 2016-06-07  9:30 Roel Janssen
  2016-06-10 12:25 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Roel Janssen @ 2016-06-07  9:30 UTC (permalink / raw)
  To: guix-devel

Hello Guix,

This patch adds sparql-query.  I carefully tried to make it as clean and
clear as possible.  Is it OK to push?

Kind regards,
Roel Janssen


From 883355fe91e7ab5f045b40c5ffbbb63a6c626842 Mon Sep 17 00:00:00 2001
From: Roel Janssen <roel@gnu.org>
Date: Tue, 7 Jun 2016 11:27:53 +0200
Subject: [PATCH] gnu: Add sparql-query.

* gnu/packages/databases.scm (sparql-query): New variable.
---
 gnu/packages/databases.scm | 65 ++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 63 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 7e0188b..3869e69 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -55,8 +55,8 @@
   #:use-module (gnu packages bison)
   #:use-module (gnu packages jemalloc)
   #:use-module ((guix licenses)
-                #:select (gpl2 gpl3 gpl3+ lgpl2.1+ lgpl3+ x11-style non-copyleft
-                          bsd-2 bsd-3 public-domain))
+                #:select (gpl2 gpl2+ gpl3 gpl3+ lgpl2.1+ lgpl3+ x11-style
+                          non-copyleft bsd-2 bsd-3 public-domain))
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
@@ -400,6 +400,67 @@ types are supported, as is encryption.")
     (license gpl3+)
     (home-page "http://www.gnu.org/software/recutils/")))
 
+(define-public sparql-query
+  (package
+    (name "sparql-query")
+    (version "1.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/tialaramex/"
+                                  name "/archive/" version ".tar.gz"))
+              (sha256
+               (base32 "0yq3k20472rv8npcc420q9ab6idy584g5y0q501d360k5q0ggr8w"))
+              (file-name (string-append name "-" version ".tar.gz"))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("readline" ,readline)
+       ("ncurses" ,ncurses)
+       ("glib" ,glib)
+       ("libxml2" ,libxml2)
+       ("curl" ,curl)))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (arguments
+     `(#:make-flags '("CC=gcc")
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         ;; The Makefile uses git to obtain versioning information. This phase
+         ;; substitutes the git invocation with the package version.
+         (add-after 'unpack 'remove-git-dependency
+           (lambda _
+             (substitute* "Makefile"
+               (("^gitrev :=.*$")
+                (string-append "gitrev = \"v" ,version "\"")))))
+         ;; The install phase of the Makefile assumes $PREFIX/usr/local/bin.
+         ;; This replacement does the same thing, except for using $PREFIX/bin
+         ;; instead.
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin")))
+               (install-file "sparql-query" bin)
+               (system* "ln" "--symbolic"
+                        (string-append bin "/sparql-query")
+                        (string-append bin "/sparql-update")))))
+         (replace 'check
+           (lambda* (#:key make-flags #:allow-other-keys)
+             (and
+              (zero? (apply system* "make" `(,@make-flags "scan-test")))
+              (zero? (system "./scan-test"))))))))
+    (home-page "https://github.com/tialaramex/sparql-query/")
+    (synopsis "Command-line tool for accessing SPARQL endpoints over HTTP")
+    (description "Sparql-query is a command-line tool for accessing SPARQL
+endpoints over HTTP.  It has been intentionally designed to 'feel' similar to
+tools for interrogating SQL databases.  For example, you can enter a query over
+several lines, using a semi-colon at the end of a line to indicate the end of
+your query.  It also supports readline so that you can more easily recall and
+edit previous queries, even across sessions.  It can be used non-interactively,
+for example from a shell script.")
+    ;; Some files (like scan-sparql.c) contain a GPLv3+ license header, while
+    ;; others (like sparql-query.c) contain a GPLv2+ license header.
+    (license (list gpl2+ gpl3+))))
+
 (define-public sqlite
   (package
    (name "sqlite")
-- 
2.8.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] gnu: Add sparql-query.
  2016-06-07  9:30 [PATCH] gnu: Add sparql-query Roel Janssen
@ 2016-06-10 12:25 ` Ludovic Courtès
  2016-06-10 12:47   ` Roel Janssen
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2016-06-10 12:25 UTC (permalink / raw)
  To: Roel Janssen; +Cc: guix-devel

Roel Janssen <roel@gnu.org> skribis:

>From 883355fe91e7ab5f045b40c5ffbbb63a6c626842 Mon Sep 17 00:00:00 2001
> From: Roel Janssen <roel@gnu.org>
> Date: Tue, 7 Jun 2016 11:27:53 +0200
> Subject: [PATCH] gnu: Add sparql-query.
>
> * gnu/packages/databases.scm (sparql-query): New variable.

[...]

> +    ;; Some files (like scan-sparql.c) contain a GPLv3+ license header, while
> +    ;; others (like sparql-query.c) contain a GPLv2+ license header.
> +    (license (list gpl2+ gpl3+))))

I think it’s enough to list gpl3+ here.

OK with this change, thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gnu: Add sparql-query.
  2016-06-10 12:25 ` Ludovic Courtès
@ 2016-06-10 12:47   ` Roel Janssen
  0 siblings, 0 replies; 3+ messages in thread
From: Roel Janssen @ 2016-06-10 12:47 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel


Ludovic Courtès writes:

> Roel Janssen <roel@gnu.org> skribis:
>
>>From 883355fe91e7ab5f045b40c5ffbbb63a6c626842 Mon Sep 17 00:00:00 2001
>> From: Roel Janssen <roel@gnu.org>
>> Date: Tue, 7 Jun 2016 11:27:53 +0200
>> Subject: [PATCH] gnu: Add sparql-query.
>>
>> * gnu/packages/databases.scm (sparql-query): New variable.
>
> [...]
>
>> +    ;; Some files (like scan-sparql.c) contain a GPLv3+ license header, while
>> +    ;; others (like sparql-query.c) contain a GPLv2+ license header.
>> +    (license (list gpl2+ gpl3+))))
>
> I think it’s enough to list gpl3+ here.
>
> OK with this change, thanks!

Pushed with this change.

Thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-10 12:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-07  9:30 [PATCH] gnu: Add sparql-query Roel Janssen
2016-06-10 12:25 ` Ludovic Courtès
2016-06-10 12:47   ` Roel Janssen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).