[PATCH] gnu: Add firebird.

  • Done
  • quality assurance status badge
Details
2 participants
  • Christopher Baines
  • Tobias Geerinckx-Rice
Owner
unassigned
Submitted by
Tobias Geerinckx-Rice
Severity
normal
T
T
Tobias Geerinckx-Rice wrote on 2 Nov 2020 12:48
(address . guix-patches@gnu.org)
20201102114852.7394-1-me@tobias.gr
* gnu/packages/databases.scm (firebird): New public variable.
---

Guix,

This adds Firebird to enable LibreOffice Base.

Kind regards,

T G-R

gnu/packages/databases.scm | 174 +++++++++++++++++++++++++++++++++++++
1 file changed, 174 insertions(+)

Toggle diff (201 lines)
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 0d8342b04a..c1a9482b5d 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -87,13 +87,16 @@
#:use-module (gnu packages guile)
#:use-module (gnu packages time)
#:use-module (gnu packages golang)
+ #:use-module (gnu packages icu4c)
#:use-module (gnu packages jemalloc)
#:use-module (gnu packages language)
+ #:use-module (gnu packages libedit)
#:use-module (gnu packages libevent)
#:use-module (gnu packages linux)
#:use-module (gnu packages logging)
#:use-module (gnu packages man)
#:use-module (gnu packages maths)
+ #:use-module (gnu packages multiprecision)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages onc-rpc)
#:use-module (gnu packages parallel)
@@ -308,6 +311,177 @@ ElasticSearch server")
(home-page "https://github.com/patientslikeme/es_dump_restore")
(license license:expat)))
+(define-public firebird
+ (package
+ (name "firebird")
+ (version "3.0.7")
+ (source
+ (let ((revision "33374-0"))
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/FirebirdSQL/"
+ "firebird/releases/download/R"
+ (string-replace-substring version "." "_") "/"
+ "Firebird-" version "." revision ".tar.bz2"))
+ (sha256
+ (base32 "0xpy1bncz36c6n28y7kllm1dkrdkn4vb4gw2n43f2351mznmrf5c"))
+ (modules '((guix build utils)))
+ (snippet
+ `(begin
+ (for-each
+ delete-file-recursively
+ (list "extern/btyacc/test" ; TODO: package and remove entirely
+ "extern/editline"
+ "extern/icu"
+ "extern/libtommath"
+ "extern/zlib"
+ "src/include/firebird/impl/boost"
+
+ ;; Missing licence.
+ "builds/install/arch-specific/solaris"
+ "extern/SfIO"
+ "src/msgs/templates.sql"
+
+ ;; Generated files missing sources.
+ "doc/Firebird-3-QuickStart.pdf"
+ (string-append "doc/Firebird-" ,version
+ "-ReleaseNotes.pdf")
+ "doc/README.SecureRemotePassword.html"))
+ #t)))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:configure-flags
+ (let ((out (assoc-ref %outputs "out")))
+ (list (string-append "--with-fbsbin=" out "/sbin")
+ (string-append "--with-fbdoc=" out "/share/doc/"
+ ,name "-" ,version)
+ (string-append "--with-fbconf=" out "/lib/firebird")
+ (string-append "--with-fbintl=" out "/lib/firebird/intl")
+ (string-append "--with-fbmisc=" out "/lib/firebird/misc")
+ (string-append "--with-fbmsg=" out "/lib/firebird")
+ (string-append "--with-fbplugins=" out "/lib/firebird/plugins")
+ (string-append "--with-fbudf=" out "/lib/firebird/UDF")
+ "--with-fbglock=/run/firebird"
+ "--with-fblog=/var/log/firebird"
+ "--with-fbhelp=/var/lib/firebird/system"
+ "--with-fbsecure-db=/var/lib/firebird/secure"
+ "--without-fbsample"
+ "--without-fbsample-db"
+ "--with-system-editline"))
+ #:make-flags
+ (list (string-append "CC=" ,(cc-for-target))
+ ;; The plugins/ can't find libfbclient otherwise.
+ (string-append "LDFLAGS=-Wl,-rpath="
+ (assoc-ref %outputs "out") "/lib"))
+ #:tests? #f ; no test suite
+ #:modules ((guix build gnu-build-system)
+ (guix build utils)
+ (srfi srfi-26))
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'use-system-boost
+ (lambda _
+ (substitute* "src/include/firebird/Message.h"
+ (("\"\\./impl/boost/preprocessor/seq/for_each_i\\.hpp\"")
+ "<boost/preprocessor/seq/for_each_i.hpp>")
+ (("FB_BOOST_") "BOOST_"))
+ #t))
+ (add-after 'unpack 'patch-installation
+ (lambda _
+ (substitute*
+ "builds/install/arch-specific/linux/makeInstallImage.sh.in"
+ (("/bin/sh") (which "bash"))
+ ;; Remove shell script helpers from $PATH.
+ (("(addLibs|cp) .*\\.sh .*@FB_SBINDIR@") ":")
+ ;; Put files where Guix users expect them.
+ (("(License\\.txt.*)@FB_CONFDIR" match)
+ (string-append match "@FB_DOCDIR@"))
+ (("@FB_CONFDIR@(.*License\\.txt.*)" match)
+ (string-append "@FB_DOCDIR@" match))
+ (("(cp .*/doc/.*)@FB_CONFDIR@(.*)" _ head tail)
+ (string-append head "@FB_DOCDIR@" tail "\n")))
+ (substitute*
+ (list "builds/install/posix-common/changeServerMode.sh.in"
+ "builds/install/posix-common/install.sh.in")
+ ;; Skip phases that (could) cause problems in Guix.
+ (("check(InstallUser|IfServerRunning|Libraries)|addFirebirdUser")
+ ":")
+ ;; Skip phases that are merely pointless on Guix.
+ (("buildUninstallFile|installInitdScript|startFirebird") ":")
+ ;; Omit randomly generated password with bonus timestamp.
+ (("setDBAPassword") ":"))
+
+ ;; These files are not relevant on Guix nor missed by install.sh.
+ (for-each delete-file-recursively
+ (find-files "doc" "README\\.(NT|Win)"))
+ #t))
+ (add-after 'configure 'delete-init-scripts
+ (lambda _
+ (delete-file-recursively "gen/install/misc")
+ #t))
+ (add-before 'build 'set-build-environment-variables
+ (lambda _
+ ;; ‘isql’ needs to run & find libfbclient.so during the build.
+ ;; This doubles as a rudimentary test in lieu of a test suite.
+ (setenv "LD_LIBRARY_PATH"
+ (string-append (assoc-ref %build-inputs "icu4c") "/lib"))
+ #t))
+ (add-after 'install 'remove-examples
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (for-each delete-file-recursively
+ (find-files out "example"))
+ #t)))
+ (add-after 'install 'remove-debug-symbols
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (for-each delete-file-recursively
+ (find-files out "^\\.debug$"))
+ ;; The ordering of lines in this file is not deterministic.
+ (delete-file
+ (string-append out "/lib/firebird/misc/manifest_debug.txt"))
+ #t))))))
+ (inputs
+ `(("boost" ,boost)
+ ("editline" ,editline)
+ ("icu4c" ,icu4c-67)
+ ("libtommath" ,libtommath)
+ ("ncurses" ,ncurses)
+ ("zlib" ,zlib)))
+ (home-page "https://www.firebirdsql.org")
+ (synopsis "Relational database with many ANSI SQL standard features")
+ (description
+ "Firebird is an SQL @acronym{RDBMS, relational database management system}
+with rich support for ANSI SQL (e.g., @code{INSERT...RETURNING}), PSQL stored
+procedures, cursors, and triggers, @acronym{UDFs, user-defined functions}, and
+more. Transactions provide full ACID-compliant referential integrity.
+
+The database requires very little manual maintenance once set up, making it
+ideal for small business or embedded use.
+
+When installed as a traditional local or remote (network) database server,
+Firebird can grow to terabyte scale with proper tuning---although PostgreSQL
+may be a better choice for such very large environments.
+
+Firebird can also be embedded into stand-alone applications that don't want or
+need a full client & server. Used in this manner, it offers richer SQL support
+than SQLite as well as the option to seamlessly migrate to a client/server
+database later.")
+ (properties
+ `((lint-hidden-cve . ("CVE-2017-6369"))))
+ (license
+ ;; See doc/license/README.license.usage.txt for rationale & details.
+ (list license:bsd-3 ; src/common/sha2/
+ license:bsd-4 ; src/common/enc.cpp
+ license:gpl2+ ; builds/posix/make.defaults
+ (license:non-copyleft "file:///builds/install/misc/IPLicense.txt"
+ "InterBase Public License v1.0")
+ (license:non-copyleft "file:///builds/install/misc/IDPLicense.txt"
+ "Initial Developer's Public License v1.0")
+ license:lgpl2.1 ; exception for OSI-compatible licences
+ license:mpl1.1 ; examples/interfaces/0{6,8}*.cpp
+ license:public-domain)))) ; including files without explicit licence
+
(define-public leveldb
(package
(name "leveldb")
--
2.29.2
C
C
Christopher Baines wrote on 7 Nov 2020 13:39
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)(address . 44389@debbugs.gnu.org)
87r1p5pchb.fsf@cbaines.net
Tobias Geerinckx-Rice via Guix-patches via <guix-patches@gnu.org> writes:

Toggle quote (184 lines)
> * gnu/packages/databases.scm (firebird): New public variable.
> ---
>
> Guix,
>
> This adds Firebird to enable LibreOffice Base.
>
> Kind regards,
>
> T G-R
>
> gnu/packages/databases.scm | 174 +++++++++++++++++++++++++++++++++++++
> 1 file changed, 174 insertions(+)
>
> diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
> index 0d8342b04a..c1a9482b5d 100644
> --- a/gnu/packages/databases.scm
> +++ b/gnu/packages/databases.scm
> @@ -87,13 +87,16 @@
> #:use-module (gnu packages guile)
> #:use-module (gnu packages time)
> #:use-module (gnu packages golang)
> + #:use-module (gnu packages icu4c)
> #:use-module (gnu packages jemalloc)
> #:use-module (gnu packages language)
> + #:use-module (gnu packages libedit)
> #:use-module (gnu packages libevent)
> #:use-module (gnu packages linux)
> #:use-module (gnu packages logging)
> #:use-module (gnu packages man)
> #:use-module (gnu packages maths)
> + #:use-module (gnu packages multiprecision)
> #:use-module (gnu packages ncurses)
> #:use-module (gnu packages onc-rpc)
> #:use-module (gnu packages parallel)
> @@ -308,6 +311,177 @@ ElasticSearch server")
> (home-page "https://github.com/patientslikeme/es_dump_restore")
> (license license:expat)))
>
> +(define-public firebird
> + (package
> + (name "firebird")
> + (version "3.0.7")
> + (source
> + (let ((revision "33374-0"))
> + (origin
> + (method url-fetch)
> + (uri (string-append "https://github.com/FirebirdSQL/"
> + "firebird/releases/download/R"
> + (string-replace-substring version "." "_") "/"
> + "Firebird-" version "." revision ".tar.bz2"))
> + (sha256
> + (base32 "0xpy1bncz36c6n28y7kllm1dkrdkn4vb4gw2n43f2351mznmrf5c"))
> + (modules '((guix build utils)))
> + (snippet
> + `(begin
> + (for-each
> + delete-file-recursively
> + (list "extern/btyacc/test" ; TODO: package and remove entirely
> + "extern/editline"
> + "extern/icu"
> + "extern/libtommath"
> + "extern/zlib"
> + "src/include/firebird/impl/boost"
> +
> + ;; Missing licence.
> + "builds/install/arch-specific/solaris"
> + "extern/SfIO"
> + "src/msgs/templates.sql"
> +
> + ;; Generated files missing sources.
> + "doc/Firebird-3-QuickStart.pdf"
> + (string-append "doc/Firebird-" ,version
> + "-ReleaseNotes.pdf")
> + "doc/README.SecureRemotePassword.html"))
> + #t)))))
> + (build-system gnu-build-system)
> + (arguments
> + `(#:configure-flags
> + (let ((out (assoc-ref %outputs "out")))
> + (list (string-append "--with-fbsbin=" out "/sbin")
> + (string-append "--with-fbdoc=" out "/share/doc/"
> + ,name "-" ,version)
> + (string-append "--with-fbconf=" out "/lib/firebird")
> + (string-append "--with-fbintl=" out "/lib/firebird/intl")
> + (string-append "--with-fbmisc=" out "/lib/firebird/misc")
> + (string-append "--with-fbmsg=" out "/lib/firebird")
> + (string-append "--with-fbplugins=" out "/lib/firebird/plugins")
> + (string-append "--with-fbudf=" out "/lib/firebird/UDF")
> + "--with-fbglock=/run/firebird"
> + "--with-fblog=/var/log/firebird"
> + "--with-fbhelp=/var/lib/firebird/system"
> + "--with-fbsecure-db=/var/lib/firebird/secure"
> + "--without-fbsample"
> + "--without-fbsample-db"
> + "--with-system-editline"))
> + #:make-flags
> + (list (string-append "CC=" ,(cc-for-target))
> + ;; The plugins/ can't find libfbclient otherwise.
> + (string-append "LDFLAGS=-Wl,-rpath="
> + (assoc-ref %outputs "out") "/lib"))
> + #:tests? #f ; no test suite
> + #:modules ((guix build gnu-build-system)
> + (guix build utils)
> + (srfi srfi-26))
> + #:phases
> + (modify-phases %standard-phases
> + (add-after 'unpack 'use-system-boost
> + (lambda _
> + (substitute* "src/include/firebird/Message.h"
> + (("\"\\./impl/boost/preprocessor/seq/for_each_i\\.hpp\"")
> + "<boost/preprocessor/seq/for_each_i.hpp>")
> + (("FB_BOOST_") "BOOST_"))
> + #t))
> + (add-after 'unpack 'patch-installation
> + (lambda _
> + (substitute*
> + "builds/install/arch-specific/linux/makeInstallImage.sh.in"
> + (("/bin/sh") (which "bash"))
> + ;; Remove shell script helpers from $PATH.
> + (("(addLibs|cp) .*\\.sh .*@FB_SBINDIR@") ":")
> + ;; Put files where Guix users expect them.
> + (("(License\\.txt.*)@FB_CONFDIR" match)
> + (string-append match "@FB_DOCDIR@"))
> + (("@FB_CONFDIR@(.*License\\.txt.*)" match)
> + (string-append "@FB_DOCDIR@" match))
> + (("(cp .*/doc/.*)@FB_CONFDIR@(.*)" _ head tail)
> + (string-append head "@FB_DOCDIR@" tail "\n")))
> + (substitute*
> + (list "builds/install/posix-common/changeServerMode.sh.in"
> + "builds/install/posix-common/install.sh.in")
> + ;; Skip phases that (could) cause problems in Guix.
> + (("check(InstallUser|IfServerRunning|Libraries)|addFirebirdUser")
> + ":")
> + ;; Skip phases that are merely pointless on Guix.
> + (("buildUninstallFile|installInitdScript|startFirebird") ":")
> + ;; Omit randomly generated password with bonus timestamp.
> + (("setDBAPassword") ":"))
> +
> + ;; These files are not relevant on Guix nor missed by install.sh.
> + (for-each delete-file-recursively
> + (find-files "doc" "README\\.(NT|Win)"))
> + #t))
> + (add-after 'configure 'delete-init-scripts
> + (lambda _
> + (delete-file-recursively "gen/install/misc")
> + #t))
> + (add-before 'build 'set-build-environment-variables
> + (lambda _
> + ;; ‘isql’ needs to run & find libfbclient.so during the build.
> + ;; This doubles as a rudimentary test in lieu of a test suite.
> + (setenv "LD_LIBRARY_PATH"
> + (string-append (assoc-ref %build-inputs "icu4c") "/lib"))
> + #t))
> + (add-after 'install 'remove-examples
> + (lambda* (#:key outputs #:allow-other-keys)
> + (let ((out (assoc-ref outputs "out")))
> + (for-each delete-file-recursively
> + (find-files out "example"))
> + #t)))
> + (add-after 'install 'remove-debug-symbols
> + (lambda* (#:key outputs #:allow-other-keys)
> + (let ((out (assoc-ref outputs "out")))
> + (for-each delete-file-recursively
> + (find-files out "^\\.debug$"))
> + ;; The ordering of lines in this file is not deterministic.
> + (delete-file
> + (string-append out "/lib/firebird/misc/manifest_debug.txt"))
> + #t))))))
> + (inputs
> + `(("boost" ,boost)
> + ("editline" ,editline)
> + ("icu4c" ,icu4c-67)
> + ("libtommath" ,libtommath)
> + ("ncurses" ,ncurses)
> + ("zlib" ,zlib)))
> + (home-page "https://www.firebirdsql.org")
> + (synopsis "Relational database with many ANSI SQL standard features")
> + (description
> + "Firebird is an SQL @acronym{RDBMS, relational database management system}
> +with rich support for ANSI SQL (e.g., @code{INSERT...RETURNING}), PSQL stored
> +procedures, cursors, and triggers, @acronym{UDFs, user-defined functions}, and
> +more. Transactions provide full ACID-compliant referential integrity.

I'm all for listing features in descriptions, but I generally remove
"and more" in favour of something like "... rich suppport for ANSI SQL
including PSQL stored procedures, cursors and triggers". The "and more"
just sounds to promotional. Anyway, the description as is is also fine.

Toggle quote (30 lines)
> +The database requires very little manual maintenance once set up, making it
> +ideal for small business or embedded use.
> +
> +When installed as a traditional local or remote (network) database server,
> +Firebird can grow to terabyte scale with proper tuning---although PostgreSQL
> +may be a better choice for such very large environments.
> +
> +Firebird can also be embedded into stand-alone applications that don't want or
> +need a full client & server. Used in this manner, it offers richer SQL support
> +than SQLite as well as the option to seamlessly migrate to a client/server
> +database later.")
> + (properties
> + `((lint-hidden-cve . ("CVE-2017-6369"))))
> + (license
> + ;; See doc/license/README.license.usage.txt for rationale & details.
> + (list license:bsd-3 ; src/common/sha2/
> + license:bsd-4 ; src/common/enc.cpp
> + license:gpl2+ ; builds/posix/make.defaults
> + (license:non-copyleft "file:///builds/install/misc/IPLicense.txt"
> + "InterBase Public License v1.0")
> + (license:non-copyleft "file:///builds/install/misc/IDPLicense.txt"
> + "Initial Developer's Public License v1.0")
> + license:lgpl2.1 ; exception for OSI-compatible licences
> + license:mpl1.1 ; examples/interfaces/0{6,8}*.cpp
> + license:public-domain)))) ; including files without explicit licence
> +
> (define-public leveldb
> (package
> (name "leveldb")

All looks good to me :)
-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl+mlZBfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9XcEUw/+N1gfN6vHc3/FCZBE2pQw/1PlMQpg8IKm
rzZ00zT7CZq/r0CmT6a8NgYbaoU4PrEZym4IhvEoj1x4fWrAaq4YXa3e9fYoCaLz
TcJw/eSajZi2x2LQcKz039iFnVu18mr1Ylns3v1Q3Cw9SiZv5HZCA/CKMjiObNw7
04QqxX7k1PEhfb8KS0q95TCI7OwQi8vbmJhfMAOMHBQz6/8gUm6UZYL9UhDQwaWo
uCtyciEUi80zsHzD90tdwIHeAdDovyMVSr4LSEr1eMsh55nt6A2tPQvOw6fPfZxb
DhAaiiKncMU8wlwo0hhdCb/Nc0fmHBx6D+yU4ZVKEikx5/dAa6YnPQrgwCrlgZJb
/YZWBIA+4MdkM9oYllb7vQ0+4BnQ4d2J9I5ZZTALGoRXGultaVlIUHrEJEMRcGDm
gne9zfcMsvwyc60mrvd6xVNuaXbbYoga8Itp/UoPB+Oi1+TDBl4/XdkY9PjbOSyV
lAkFGd0Fve0msP0niYrz7McTHWvLO7F1MCVzXi7IY1dMc4zb0/C7lyXg/L5Uv26s
VAmka5xjixf4nKaHvzqYT8FhnuMxsDSCJ97OlJpQGaOGLzjuZ53QIZsKM2m+Q9sQ
SPUaChC+V6g5c52JboXaNWuD2+ibNFLYKvL7J/HGH2oQuzt7VcHeBsrVgTwdYGT5
ndLn7dnqV/I=
=cCi1
-----END PGP SIGNATURE-----

T
T
Tobias Geerinckx-Rice wrote on 7 Nov 2020 13:58
(name . Christopher Baines)(address . mail@cbaines.net)(address . 44389-done@debbugs.gnu.org)
87tuu1727r.fsf@nckx
Chris,

Pushed as 3f8158d6f01d8d8f25e6413e38b8981562d75dbd seconds before
receiving your feedback. :-)

Christopher Baines ???
Toggle quote (9 lines)
> I'm all for listing features in descriptions, but I generally
> remove
> "and more" in favour of something like "... rich suppport for
> ANSI SQL
> including PSQL stored procedures, cursors and triggers". The
> "and more"
> just sounds to promotional. Anyway, the description as is is
> also fine.

You're right. Once put on the spot, ‘and more’ doesn't mean
anything meaningful. I'm going to remove it.

Thanks for reading all that,

T G-R
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCX6aaCA0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW15B/IBANpG8bwcFvzLvJPe6hTG86pexVqzQzP256noAEuu
QSGhAP4twkm8Sb32IVz1xBwf3SjTobvZs+i6+Y9s1UlTLcugCw==
=Ur5D
-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 44389@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 44389
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch