gnu: guile-dbd-postgresql: Inherit from guile-dbi.

* gnu/packages/guile-xyz.scm (guile-dbd-postgresql): Inherit from
guile-dbi. Remove version, source, build-system, home-page and license fields.
[arguments]: Remove patch-src/Makefile.am phase. Do not return #t from phases.
[native-inputs]: Replace guile-dbi-bootstrap with guile-dbi.
This commit is contained in:
Arun Isaac 2021-09-08 19:52:18 +05:30
parent c4698e50f2
commit 8f1d146033
No known key found for this signature in database
GPG key ID: 2E25EE8B61802BB3

View file

@ -1612,60 +1612,34 @@ (define-public guile-dbd-sqlite3
SQL databases. This package implements the interface for SQLite."))) SQL databases. This package implements the interface for SQLite.")))
(define-public guile-dbd-postgresql (define-public guile-dbd-postgresql
(let ((commit "e97589b6b018b206c901e4cc24db463407a4036b") (package
(revision 0)) (inherit guile-dbi)
(package (name "guile-dbd-postgresql")
(name "guile-dbd-postgresql") (arguments
(version (string-append (substitute-keyword-arguments (package-arguments guile-dbi)
"2.1.6-" (number->string revision) "." (string-take commit 7))) ((#:phases phases)
(source `(modify-phases ,phases
(origin (replace 'chdir
(method git-fetch)
(uri (git-reference
(url "https://github.com/opencog/guile-dbi")
(commit commit)))
(file-name (git-file-name name version))
(sha256
(base32 "0n1gv9a0kdys10a4qmnrwvg5sydwb03880asri4gqdchcj3fimni"))))
(build-system gnu-build-system)
(arguments
'(#:phases
(modify-phases %standard-phases
(add-after 'unpack 'chdir
(lambda _ (lambda _
;; The upstream Git repository contains all the code, so change ;; The upstream Git repository contains all the code, so change
;; to the relevant directory. ;; to the directory specific to guile-dbd-mysql.
(chdir "guile-dbd-postgresql") (chdir "guile-dbd-postgresql")))
#t)) (add-after 'chdir 'patch-src
(add-after 'chdir 'patch-src/Makefile.am
(lambda* (#:key inputs #:allow-other-keys)
(substitute* "src/Makefile.am"
(("/usr/include")
(string-append (assoc-ref inputs "postgresql") "/include")))
#t))
(add-after 'patch-src/Makefile.am 'patch-src
(lambda _ (lambda _
(substitute* "src/guile-dbd-postgresql.c" (substitute* "src/guile-dbd-postgresql.c"
(("postgresql/libpq-fe\\.h") "libpq-fe.h")) (("postgresql/libpq-fe\\.h") "libpq-fe.h"))))
#t))))) (delete 'patch-extension-path)))))
(native-inputs (inputs
`(("pkg-config" ,pkg-config) `(("postgresql" ,postgresql)
("automake" ,automake) ("zlib" ,zlib)))
("autoconf" ,autoconf) (native-inputs
("perl" ,perl) `(("guile-dbi" ,guile-dbi) ; only required for headers
("libtool" ,libtool) ,@(package-native-inputs guile-dbi)))
("guile-dbi-bootstrap" ,guile-dbi-bootstrap))) (synopsis "Guile DBI driver for PostgreSQL")
(inputs (description
`(("postgresql" ,postgresql) "@code{guile-dbi} is a library for Guile that provides a convenient
("zlib" ,zlib)))
(synopsis "Guile DBI driver for PostgreSQL")
(home-page
"https://github.com/opencog/guile-dbi/tree/master/guile-dbd-postgresql")
(description
"@code{guile-dbi} is a library for Guile that provides a convenient
interface to SQL databases. This package implements the interface for interface to SQL databases. This package implements the interface for
PostgreSQL.") PostgreSQL.")))
(license license:gpl2+))))
(define-public guile-config (define-public guile-config
(package (package