From ac25a7202682f7f8dcd64a4b3643a92c3458fcfe Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sat, 15 Dec 2018 00:31:37 +0100 Subject: [PATCH 2/2] gnu: SQLite: Add static output. * gnu/packages/databases.scm (sqlite)[arguments]: Add phase 'move-static-library'. [outputs]: New field. --- gnu/packages/databases.scm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm index a3848dee8e..148b77882f 100644 --- a/gnu/packages/databases.scm +++ b/gnu/packages/databases.scm @@ -1209,7 +1209,22 @@ changes.") ;; to use the system SQLite unless these options are enabled. (list (string-append "CFLAGS=-O2 -DSQLITE_SECURE_DELETE " "-DSQLITE_ENABLE_UNLOCK_NOTIFY " - "-DSQLITE_ENABLE_DBSTAT_VTAB")))) + "-DSQLITE_ENABLE_DBSTAT_VTAB")) + #:phases (modify-phases %standard-phases + (add-after 'install 'move-static-library + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (static (assoc-ref outputs "static"))) + (mkdir-p (string-append static "/lib")) + (rename-file (string-append out "/lib/libsqlite3.a") + (string-append static "/lib/libsqlite3.a")) + ;; Remove reference to the static library from the .la file + ;; so Libtool does the right thing when both the shared and + ;; static library is available. + (substitute* (string-append out "/lib/libsqlite3.la") + (("^old_library='libsqlite3.a'") "old_library=''")) + #t)))))) + (outputs '("out" "static")) (home-page "https://www.sqlite.org/") (synopsis "The SQLite database management system") (description -- 2.20.0