;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015 Andreas Enge ;;; Copyright © 2014 Sree Harsha Totakura ;;; Copyright © 2015, 2017, 2018, 2019 Ludovic Courtès ;;; Copyright © 2015, 2017, 2019, 2020 Efraim Flashner ;;; Copyright © 2016 Ricardo Wurmus ;;; Copyright © 2016 Mark H Weaver ;;; Copyright © 2016, 2017, 2018, 2019 ng0 ;;; Copyright © 2016, 2017, 2018, 2019 Tobias Geerinckx-Rice ;;; Copyright © 2018 Alex Vong ;;; Copyright © 2019 Brett Gilio ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Gu
aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2015, 2018, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014, 2015, 2016, 2018 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2014 Sree Harsha Totakura <sreeharsha@totakura.in>
;;; Copyright © 2015, 2016 Sou Bunnbu <iyzsong@gmail.com>
;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
;;; Copyright © 2016 David Craven <david@craven.ch>
;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Marius Bakke <marius@gnu.org>
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2017 Jelle Licht <jlicht@fsfe.org>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2022 Matthew James Kraai <kraai@ftbfs.org>
;;; Copyright © 2024 Zhu Zihao <all_but_last@163.com>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages sqlite)
  #:use-module (gnu packages)
  #:use-module (gnu packages hurd)
  #:use-module (gnu packages readline)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system gnu)
  #:use-module (guix utils)
  #:use-module (guix deprecation)
  #:use-module (ice-9 match)
  #:use-module (srfi srfi-26))

;;; Commentary:
;;;
;;; This module has been separated from (gnu packages databases) to reduce the
;;; number of module references for core packages.

(define (sqlite-uri version year)
  (let ((numeric-version
         (match (string-split version #\.)
           ((first-digit other-digits ...)
            (string-append first-digit
                           (string-pad-right
                            (string-concatenate
                             (map (cut string-pad <> 2 #\0)
                                  other-digits))
                            6 #\0))))))
    (string-append "https://sqlite.org/" (number->string year)
                   "/sqlite-autoconf-" numeric-version ".tar.gz")))

(define-public sqlite
  (package
   (name "sqlite")
   (version "3.39.3")
   (source (origin
            (method url-fetch)
            (uri (sqlite-uri version 2022))
            (patches (search-patches "sqlite-hurd.patch"))
            (sha256
             (base32
              "1f922kq16g7f4h3gpzim78lvrp5xw9nvlvqw97s2qgxyh8qgns3q"))))
   (build-system gnu-build-system)
   (inputs (list readline))
   (outputs '("out" "static"))
   (arguments
    `(#:configure-flags
      ;; Add -DSQLITE_SECURE_DELETE, -DSQLITE_ENABLE_FTS3,
      ;; -DSQLITE_ENABLE_UNLOCK_NOTIFY and -DSQLITE_ENABLE_DBSTAT_VTAB
      ;; to CFLAGS.  GNU Icecat will refuse to use the system SQLite
      ;; unless these options are enabled.
      (list (string-append "CFLAGS=-O2 -g -DSQLITE_SECURE_DELETE "
                           "-DSQLITE_ENABLE_FTS3 "
                           "-DSQLITE_ENABLE_UNLOCK_NOTIFY "
                           "-DSQLITE_ENABLE_DBSTAT_VTAB "
                           ;; Column metadata is required by GNU Jami and Qt, et.al.
                           "-DSQLITE_ENABLE_COLUMN_METADATA"))
      #: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"))
                            (source (string-append out "/lib/libsqlite3.a")))
                       (mkdir-p (string-append static "/lib"))
                       (link source (string-append static "/lib/libsqlite3.a"))
                       (delete-file source)

                       ;; Remove reference to the static library from the .la file
                       ;; so that Libtool looks for it in the usual places.
                       (substitute* (string-append out "/lib/libsqlite3.la")
                         (("^old_library=.*")
                          "old_library=''\n"))
                       #t))))))
   (home-page "https://www.sqlite.org/")
   (synopsis "The SQLite database management system")
   (description
    "SQLite is a software library that implements a self-contained, serverless,
zero-configuration, transactional SQL database engine.  SQLite is the most
widely deployed SQL database engine in the world.  The source code for SQLite
is in the public domain.")
   (license license:public-domain)))

;; Newer version required for e.g. fossil.
(define-public sqlite-next
  (package
    (inherit sqlite)
    (version "3.46.0")
    (source (origin
              (method url-fetch)
              (uri (sqlite-uri version 2024))
              (sha256
               (base32
                "0zbs853s8ly693qdg0l7vs4shwn3plmvdczr2s478wsj6dxnm3kg"))))))
l" "--without-libpsl" "--without-librtmp" "--disable-ntlm-wb") #:phases (modify-phases %standard-phases (add-after 'install 'move-man3-pages (lambda* (#:key outputs #:allow-other-keys) ;; Move section 3 man pages to "doc". (let ((out (assoc-ref outputs "out")) (doc (assoc-ref outputs "doc"))) (mkdir-p (string-append doc "/share/man")) (rename-file (string-append out "/share/man/man3") (string-append doc "/share/man/man3")) #t))) ;; We have to patch runtests.pl in tests/ directory (replace 'check (lambda _ (substitute* "tests/runtests.pl" (("/bin/sh") (which "sh"))) ;; Make test output more verbose. (invoke "make" "-C" "tests" "test")))))) (synopsis "Microfork of cURL with support for the HTTP/HTTPS/GnuTLS subset of cURL") (description "Gnurl is a microfork of cURL, a command line tool for transferring data with URL syntax. While cURL supports many crypto backends, libgnurl only supports HTTP, HTTPS and GnuTLS.") (license (license:non-copyleft "file://COPYING" "See COPYING in the distribution.")) (properties '((ftp-server . "ftp.gnu.org") (ftp-directory . "/gnunet"))) (home-page "https://gnunet.org/gnurl"))) (define-public gnunet (package (name "gnunet") (version "0.11.8") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/gnunet/gnunet-" version ".tar.gz")) (sha256 (base32 "1zkmcq75sfr3iyg8rgxp9dbl7fwsvc1a71rc0vgisghcbrx1n7yj")))) (build-system gnu-build-system) (inputs `(("bluez" ,bluez) ("glpk" ,glpk) ("gnurl" ,gnurl) ("gnutls" ,gnutls/dane) ("gstreamer" ,gstreamer) ("jansson" ,jansson) ("libextractor" ,libextractor) ("libidn" ,libidn2) ("libgcrypt" ,libgcrypt) ("libltdl" ,libltdl) ("libmicrohttpd" ,libmicrohttpd) ("libogg" ,libogg) ("libunistring" ,libunistring) ("miniupnpc" ,miniupnpc) ("opus" ,opus) ("pulseaudio" ,pulseaudio) ("sqlite" ,sqlite) ("zbar" ,zbar) ("zlib" ,zlib))) (native-inputs `(("pkg-config" ,pkg-config) ("python" ,python) ("xxd" ,xxd) ("which" ,(@ (gnu packages base) which)))) (arguments '(#:parallel-tests? #f ; Parallel tests aren't supported. #:phases (modify-phases %standard-phases (add-after 'configure 'remove-failing-tests ;; These tests fail in Guix's building envrionment. (lambda _ (substitute* "src/transport/Makefile" (("test_transport_api_udp_nat\\$\\(EXEEXT\\) \\\\\n") "") (("test_transport_api_manipulation_cfg\\$\\(EXEEXT\\) \\\\\n") "")) (substitute* "src/topology/Makefile" (("^check_PROGRAMS.*") "\n") (("test_gnunet_daemon_topology\\$\\(EXEEXT\\)\n") "")) (substitute* "src/namestore/Makefile" (("\\$\\(am__append_2\\)") "")) (substitute* "src/gns/Makefile" (("\\$\\(am__append_4\\)") "")) (substitute* "contrib/Makefile" (("^check_PROGRAMS.*") "\n")) ;; 'test' from coreutils doesn't behave as the test expects. (substitute* '("src/gns/gnunet-gns-proxy-setup-ca.in" "src/transport/gnunet-transport-certificate-creation.in") (("gnutls-certtool") "certtool")) #t)) ;; Swap 'check and 'install phases and add installed binaries to $PATH. (add-before 'check 'set-path-for-check (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (setenv "GNUNET_PREFIX" (string-append out "/lib")) (setenv "PATH" (string-append (getenv "PATH") ":" out "/bin"))) #t)) (delete 'check) (add-after 'install 'check (assoc-ref %standard-phases 'check))))) (synopsis "Secure, decentralized, peer-to-peer networking framework") (description "GNUnet is a framework for secure peer-to-peer networking. The high-level goal is to provide a strong foundation of free software for a global, distributed network that provides security and privacy. GNUnet in that sense aims to replace the current internet protocol stack. Along with an application for secure publication of files, it has grown to include all kinds of basic applications for the foundation of a GNU internet.") (license license:agpl3+) (home-page "https://gnunet.org/"))) (define-public guile-gnunet ;GSoC 2015! (let ((commit "d12167ab3c8d7d6caffd9c606e389ef043760602") (revision "1")) (package (name "guile-gnunet") (version (git-version "0.0" revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://git.savannah.gnu.org/git/guix/gnunet.git/") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 "0nqc18jh9j30y4l6yh6j35byfg6qalq7yr3frv9rk10qa041c2sv")))) (build-system gnu-build-system) (native-inputs `(("pkg-config" ,pkg-config) ("autoconf" ,autoconf-wrapper) ("automake" ,automake))) (inputs `(("guile" ,guile-2.0) ("gnunet" ,gnunet))) (synopsis "Guile bindings for GNUnet services") (description "This package provides Guile bindings to the client libraries of various GNUnet services, including the @dfn{identity} and @dfn{file sharing} services.") (home-page "https://gnu.org/software/guix") (license license:gpl3+)))) ;; FIXME: "gnunet-setup" segfaults under certain conditions and "gnunet-gtk" ;; does not seem to be fully functional. This has been reported upstream: ;; http://lists.gnu.org/archive/html/gnunet-developers/2016-02/msg00004.html (define-public gnunet-gtk (package (inherit gnunet) (name "gnunet-gtk") (version "0.11.7") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/gnunet/gnunet-gtk-" version ".tar.gz")) (sha256 (base32 "061ifhqk6q9kx71z5404fm4d60yj2dihlwwmdqmhkn5nn4bvcwb5")))) (arguments `(#:configure-flags (list "--with-libunique" "--with-qrencode" (string-append "--with-gnunet=" (assoc-ref %build-inputs "gnunet"))))) (inputs `(("glade3" ,glade3) ("gnunet" ,gnunet) ("gnutls" ,gnutls/dane) ("gtk+" ,gtk+) ("libextractor" ,libextractor) ("libgcrypt" ,libgcrypt) ("libunique" ,libunique) ("qrencode" ,qrencode))) (native-inputs `(("pkg-config" ,pkg-config) ("libglade" ,libglade))) (synopsis "Graphical front-end tools for GNUnet") (properties '((ftp-server . "ftp.gnu.org") (ftp-directory . "/gnunet")))))