unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: add guile-pg. (Needs help)
@ 2015-07-23 16:28 Christopher Allan Webber
  2015-07-24 10:11 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Christopher Allan Webber @ 2015-07-23 16:28 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1104 bytes --]

I'm working on some stuff that requires database support in my guile
applications, so I thought I'd package more guile database packages.  I
started working on guile-pg... however, it has a few issues:

 - .scm files are not installed, it doesn't look like these files are
   compiled .go files either.  The files installed look like they have
   all whitespace and niceties stripped, which makes it had to read.
   But that's the default from the way the package is set up to install
   things.  Maybe doing otherwise requires setting a flag, or getting a
   patch upstream?

 - I couldn't get tests to work because it was either looking to start a
   database connection or use one that existed, and neither of those
   worked, so I disabled tests.

 - It installs to the wrong place, and I don't know enough about
   autotools to fix it.  It installs to the profile's
   "share/guile/site/" rather than "share/guile/site/2.0/"
   so I found that it was not on my default guile path.  Not sure how to
   deal with this.

Anyone interested or knowledgable enough to help on this one?

Thanks!
 - Chris


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-guile-pg.patch --]
[-- Type: text/x-diff, Size: 2035 bytes --]

From ec7c5f24bb9ce3c6766ee9edbf8c5f944a1e30b7 Mon Sep 17 00:00:00 2001
From: Christopher Allan Webber <cwebber@dustycloud.org>
Date: Thu, 23 Jul 2015 09:27:16 -0700
Subject: [PATCH] gnu: Add guile-pg.

* gnu/packages/guile.scm (guile-pg): New variable.
---
 gnu/packages/guile.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index e85c84a..6e59e2c 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -39,6 +39,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages gdbm)
+  #:use-module (gnu packages databases)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix git-download)
@@ -535,4 +536,34 @@ See http://minikanren.org/ for more on miniKanren generally.")
 Guile's foreign function interface.")
     (license gpl3+)))
 
+(define-public guile-pg
+  (package
+    (name "guile-pg")
+    (version "0.47")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://savannah/guile-pg/guile-pg-"
+                           version ".tar.xz"))
+       (sha256
+        (base32
+         "0h3p0zw5x233k7ax1lbfhzchwyrnw12bv7jn3qw3f2vr1ckscw0x"))))
+    (build-system gnu-build-system)
+    (inputs `(("guile" ,guile-2.0)
+              ("postgresql" ,postgresql)))
+    (arguments
+     `(;; XXX Tests seemingly don't run because they require a running
+       ;; postgres daemon, or starting one
+       #:tests? #f))
+    (home-page "http://www.nongnu.org/guile-pg/")
+    (synopsis "Guile bindings to the PostgreSQL RDBMS")
+    (description
+     "Guile-PG is a collection of modules for Guile allowing access to
+the PostgreSQL RDBMS from Scheme programs.  Guile-PG provides almost
+one-to-one correspondence between the PostgreSQL \"libpq\" C library
+interface, as well as modules which provide abstractions and
+convenience features.")
+    (license gpl3+)))
+
+
 ;;; guile.scm ends here
-- 
2.1.4


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

* Re: [PATCH] gnu: add guile-pg. (Needs help)
  2015-07-23 16:28 [PATCH] gnu: add guile-pg. (Needs help) Christopher Allan Webber
@ 2015-07-24 10:11 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2015-07-24 10:11 UTC (permalink / raw)
  To: Christopher Allan Webber; +Cc: guix-devel

Christopher Allan Webber <cwebber@dustycloud.org> skribis:

>  - .scm files are not installed, it doesn't look like these files are
>    compiled .go files either.  The files installed look like they have
>    all whitespace and niceties stripped, which makes it had to read.
>    But that's the default from the way the package is set up to install
>    things.  Maybe doing otherwise requires setting a flag, or getting a
>    patch upstream?

Not having the .go files is OK.

Whitespace stripping is a remnant from the 1.8 and earlier days, where
doing that would speed things up (!).  I guess it’s done by running
‘guile-tools punify’, so probably you just need to patch Makefile.in to
replace that with ‘true’ or similar.

>  - I couldn't get tests to work because it was either looking to start a
>    database connection or use one that existed, and neither of those
>    worked, so I disabled tests.

Ideally a new phase added before the ‘check’ phase would spawn the pgsql
server.

>  - It installs to the wrong place, and I don't know enough about
>    autotools to fix it.  It installs to the profile's
>    "share/guile/site/" rather than "share/guile/site/2.0/"
>    so I found that it was not on my default guile path.  Not sure how to
>    deal with this.

Either there’s a configure option to pass a different installation
directory, or you’ll have to patch Makefile.in, or to move files after
installation.

No actual patch from me, but I hope this helps!  :-)

Ludo’.

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

end of thread, other threads:[~2015-07-24 10:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-23 16:28 [PATCH] gnu: add guile-pg. (Needs help) Christopher Allan Webber
2015-07-24 10:11 ` Ludovic Courtès

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).