aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2014, 2016 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2016 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2016, 2017, 2020, 2022, 2023 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2017 Rene Saavedra <rennes@openmailbox.org>
;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
;;; Copyright © 2017 Nikita <nikita@n0.is>
;;; Copyright © 2017, 2018, 2020–2022 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018, 2024 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2018, 2019, 2020, 2021, 2023 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2019, 2020, 2022 Marius Bakke <marius@gnu.org>
;;; Copyright © 2020 Roel Janssen <roel@gnu.org>
;;; Copyright © 2020, 2021, 2024 Nicolas Goaziou <mail@nicolasgoaziou.fr>
;;; Copyright © 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
;;; Copyright © 2022 Felipe Balbi <balbi@kernel.org>
;;; Copyright © 2023 gemmaro <gemmaro.dev@gmail.com>
;;; Copyright © 2023 John Kehayias <john.kehayias@protonmail.com>
;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2023 pinoaffe <pinoaffe@gmail.com>
;;; Copyright © 2024 Sören Tempel <soeren@soeren-tempel.net>
;;; Copyright © 2023 Zheng Junjie <873216071@qq.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 fontutils)
  #:use-module (gnu packages)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages bison)
  #:use-module (gnu packages check)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages datastructures)
  #:use-module (gnu packages docbook)
  #:use-module (gnu packages flex)
  #:use-module (gnu packages fonts)
  #:use-module (gnu packages freedesktop)
  #:use-module (gnu packages fribidi)
  #:use-module (gnu packages gcc)
  #:use-module (gnu packages gettext)
  #:use-module (gnu packages ghostscript)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages gnome)
  #:use-module (gnu packages gperf)
  #:use-module (gnu packages graphics)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages image)
  #:use-module (gnu packages java)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages man)
  #:use-module (gnu packages mc)
  #:use-module (gnu packages ninja)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages python)
  #:use-module (gnu packages python-build)
  #:use-module (gnu packages python-xyz)
  #:use-module (gnu packages qt)
  #:use-module (gnu packages sqlite)
  #:use-module (gnu packages webkit)
  #:use-module (gnu packages xdisorg)
  #:use-module (gnu packages xml)
  #:use-module (gnu packages xorg)
  #:use-module (gnu packages tex)
  #:use-module (gnu packages textutils)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix gexp)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix svn-download)
  #:use-module (guix git-download)
  #:use-module (guix build-system copy)
  #:use-module (guix build-system cmake)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system meson)
  #:use-module (guix build-system pyproject)
  #:use-module (guix build-system python)
  #:use-module (guix utils)
  #:use-module (srfi srfi-1))

(define-public freetype
  (package
    (name "freetype")
    (version "2.13.0")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "mirror://savannah/freetype/freetype-"
                           version ".tar.xz"))
       (sha256
        (base32 "0k32jaaz4pfhw34xwr6a38fncrpwr9fn5ij35m5w4dkn0jykmqjy"))))
    (build-system gnu-build-system)
    (arguments
     ;; The use of "freetype-config" is deprecated, but other packages still
     ;; depend on it.
     (list
      #:configure-flags #~(list "--enable-freetype-config")
      #:disallowed-references (list pkg-config)
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'install 'remove-reference-to-pkg-config
            (lambda* (#:key outputs #:allow-other-keys)
              (substitute* (search-input-file outputs "bin/freetype-config")
                (("/([a-zA-Z0-9/\\._-]+)/bin/([a-zA-Z0-9_-]+)?pkg-config"
                  _ store target)
                 "pkg-config")))))))
    (native-inputs (list pkg-config))
    ;; XXX: Not adding harfbuzz here, as it would introduce a dependency
    ;; cycle.
    (propagated-inputs (list libpng zlib))
    (synopsis "Font rendering library")
    (description
     "Freetype is a library that can be used by applications to access the
contents of font files.  It provides a uniform interface to access font files.
It supports both bitmap and scalable formats, including TrueType, OpenType,
Type1, CID, CFF, Windows FON/FNT, X11 PCF, and others.  It supports high-speed
anti-aliased glyph bitmap generation with 256 gray levels.")
    (license license:freetype)          ; some files have other licenses
    (home-page "https://freetype.org/")))

;; TODO: Make this change directly in freetype in the next large rebuild cycle
;; and remove this package.
(define-public freetype-with-brotli
  (package
    (inherit freetype)
    (name "freetype-with-brotli")
    (propagated-inputs
     (modify-inputs (package-propagated-inputs freetype)
       (prepend brotli)))))

(define-public opentype-sanitizer
  (package
    (name "opentype-sanitizer")
    (version "8.2.1")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://github.com/khaledhosny/ots"
                                  "/releases/download/v" version
                                  "/ots-" version ".tar.xz"))
              (sha256
               (base32
                "17z8cxv48rfig5k7j3xk3bmbf7rm3kxsc3bazix96l0wws58r569"))))
    (build-system meson-build-system)
    (native-inputs (list googletest pkg-config))
    (inputs (list freetype lz4 woff2 zlib))
    (home-page "https://github.com/khaledhosny/ots")
    (synopsis "Sanitizer for OpenType fonts")
    (description "The OpenType Sanitizer (OTS) parses and serializes OpenType
files (OTF, TTF) and WOFF and WOFF2 font files, validating them and sanitizing
them as it goes.")
    (license license:bsd-3)))

(define-public python-afdko
  (package
    (name "python-afdko")
    (version "3.9.5")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "afdko" version))
       (sha256
        (base32 "02c1rjx7ggbd1m9vqgsc2r28yiw66cjgvs5cq1a2fz0lkadbvrnb"))
       (modules '((guix build utils)))
       (snippet
        #~(begin
            (with-directory-excursion "c/makeotf/lib/hotconv"
              ;; Delete ANTLR-generated code.
              (for-each delete-file
                        (find-files
                         "." "Feat(Parser|Lexer).*\\.(h|cpp|interp|tokens)$")))))))
    (build-system python-build-system)
    (arguments
     (list
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'use-c++17
            (lambda _
              ;; ANTLR4 4.10 and later require C++ 17.
              (substitute* "CMakeLists.txt"
                (("CMAKE_CXX_STANDARD 11")
                 "CMAKE_CXX_STANDARD 17"))))
          (add-after 'unpack 'patch-problematic-requirements
            (lambda _
              (substitute* "requirements.txt"
                ;; Remove lxml because the version requested here is different
                ;; than the one propagated by the python-fonttools package.
                (("^lxml==.*") "")
                (("<=4.38.0") ">=4.38.0"))))
          (add-after 'unpack 'patch-setup.py
            (lambda _
              ;; There is no use for Python-provided CMake nor Ninja binaries.
              (substitute* '("pyproject.toml" "setup.py")
                ((".*cmake.*") "")
                ((".*ninja.*") ""))))
          (add-after 'unpack 'unbundle-antlr4-cpp
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "CMakeLists.txt"
                (("^include\\(ExternalAntlr4Cpp).*")
                 (format #f "include_directories(SYSTEM ~a)"
                         (search-input-directory inputs
                                                 "include/antlr4-runtime"))))
              (substitute* '("c/makeotf/lib/hotconv/CMakeLists.txt"
                             "c/makeotf/lib/cffread/CMakeLists.txt")
                (("antlr4_static")
                 "antlr4-runtime"))))
          (add-after 'unpack 'regenerate-hotconv-grammar
            (lambda _
              (let ((antlr-version #$(package-version
                                      (this-package-native-input "antlr4"))))
                (with-directory-excursion "c/makeotf/lib/hotconv"
                  (substitute* "BuildGrammar.py"
                    (("antlr_version = .*")
                     (string-append "antlr_version = \""
                                    antlr-version
                                    "\"")))
                  (invoke "python" "BuildGrammar.py")))))
          ;; The test suite expects the commands to be Python rather than
          ;; shell scripts, so move the wrap phase after the tests.
          (delete 'wrap)
          (replace 'check
            (lambda* (#:key tests? #:allow-other-keys)
              (when tests?
                (setenv "HOME" "/tmp")
                (invoke "pytest" "-vv" "--dist" "loadfile" "-n"
                        (number->string (parallel-job-count))
                        ;; This test fails because of a different date in the
                        ;; copyright header of an expected file since an
                        ;; update to ffmpeg.
                        "-k" "not test_alt_missing_glyph"))))
          (add-after 'check 'wrap
            (assoc-ref %standard-phases 'wrap))
          (add-before 'wrap 'wrap-PATH
            (lambda _
              ;; The commands execute other commands from this package from
              ;; PATH; by wrapping them with bindir, they can be found even
              ;; when the command is run from its store location.
              (let* ((bindir (string-append #$output "/bin"))
                     (commands (find-files bindir)))
                (for-each (lambda (c)
                            (wrap-program c
                              `("PATH" prefix (,bindir))))
                          commands)))))))
    (native-inputs
     (list antlr4
           openjdk                      ;required by antlr4
           ninja
           pkg-config
           python-pytest
           python-pytest-xdist
           python-scikit-build
           python-setuptools-scm
           python-wheel))
    (inputs
     (list bash-minimal
           java-antlr4-runtime-cpp
           libxml2
           `(,util-linux "lib")))
    (propagated-inputs
     (list psautohint
           python-booleanoperations
           python-defcon
           python-fontmath
           python-fonttools
           python-lxml
           python-tqdm
           python-ufonormalizer
           python-ufoprocessor))
    (home-page "https://github.com/adobe-type-tools/afdko")
    (synopsis "Adobe Font Development Kit for OpenType")
    (description "The Adobe Font Development Kit for OpenType (AFDKO) is a set
of tools for building OpenType font (OTF) files from PostScript and TrueType
font data.  It includes the following commands:
@table @command
@item buildcff2vf
Assemble a CFF2 variable font from a .designspace file.
@item buildmasterotfs
Build master source OpenType/CFF fonts from a @file{.designspace} file
and UFO master source fonts.
@item charplot
@itemx digiplot
@itemx fontplot
@itemx fontsetplot
@itemx hintplot
@itemx waterfallplot
Aliases for the corresponding options of the @command{proofpdf} command.
@item checkoutlinesufo
Perform outline quality checks.  It can also remove path overlaps.
@item comparefamily
Look in a specific directory, examine and report on all the OpenType fonts found.
@item type1
@itemx detype1
Compile and decompile, respectively, a Type 1 font to and from a plain-text
representation.
@item makeinstancesufo
Generate UFO font instances from a set of master UFO fonts.
@item makeotfexe
Read all the font data and build the final OpenType font.
@item makeotf
This command can be used to prepare the input files needed by
@command{makeotfexe}.
@item mergefonts
Merge one or more fonts into a parent font.
@item otc2otf
Extract all OpenType fonts from the parent OpenType Collection font.
@item otf2otc
Build an OpenType Collection font file from two or more OpenType font
files.
@item otf2ttf
Converts OpenType-CFF fonts to TrueType.
@item rotatefont
Apply a Postscript transform matrix to the source font files.
@item sfntdiff
Low-level comparison of two OpenType font files.
@item sfntedit
Support table-editing, listing, and checksumming options on
sfnt-formatted files such as OpenType Format (OTF) or TrueType.
@item spot
Dump sfnt data from plain files or Macintosh resource files.
@item ttfcomponentizer
Take in a TrueType font and look for a UFO font stored in the same directory.
Use the UFO's components data to compose matching TrueType glyphs.
@item ttfdecomponentizer
Take in a TrueType font and decompose any composite glyphs into simple glyphs.
@item ttxn
Make a normalized dump of the font, or of selected tables.
@item tx
The @command{tx} (Type eXchange) is a test harness for the CoreType libraries
but also provides many useful font conversion and analysis facilities.
@end table")
    (license license:asl2.0)))

(define-public python-afdko-3.6.1
  ;; This older version does not depend on Java and Antlr4.
  (package
    (inherit python-afdko)
    (version "3.6.1")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "afdko" version))
       (sha256
        (base32 "0187xhgw6spzaji93fs1mnhqnq30pxhdj1p2m88673szvzpf10av"))))
    (arguments
     (list #:phases
           #~(modify-phases %standard-phases
               (add-before 'build 'set-CC
                 (lambda _
                   (setenv "CC" "gcc"))))))
    (native-inputs
     (list pkg-config
           python-pytest
           python-setuptools-scm
           python-wheel))
    (inputs
     (list bash-minimal
           libxml2))
    (propagated-inputs
     (list psautohint
           python-booleanoperations
           python-defcon
           python-fontmath
           python-fonttools
           python-lxml
           python-tqdm
           python-ufonormalizer
           python-ufoprocessor))))

(define-public python-beziers
  (package
    (name "python-beziers")
    (version "0.5.0")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/simoncozens/beziers.py")
                    (commit (string-append "v" version))))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "1dyr45m15sclbgaz1mrcnw8kny50h09gd45dlpfkgv9qpfxphkg3"))))
    (build-system python-build-system)
    (arguments
     (list #:phases #~(modify-phases %standard-phases
                        (replace 'check
                          (lambda* (#:key tests? #:allow-other-keys)
                            (when tests?
                              (invoke "pytest" "-vv")))))))
    (native-inputs (list python-pytest python-dotmap python-matplotlib))
    (propagated-inputs (list python-pyclipper))
    (home-page "https://simoncozens.github.io/beziers.py/index.html")
    (synopsis "Python bezier manipulation library")
    (description
     "Beziers provides a variety of classes for constructing,
manipulating and drawing Bezier curves and paths.  Principally designed for
font design software, it allows you to join, split, offset, and perform many
other operations on paths.")
    (license license:expat)))

(define-public python-cffsubr
  (package
    (name "python-cffsubr")
    (version "0.2.9.post1")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "cffsubr" version))
       (modules '((guix build utils)))
       (snippet '(delete-file-recursively "external")) ;unbundle ADFKO
       (sha256
        (base32 "0p7wyagkmwf4agr6ysgswrpmpifx5rz8dnjbcs2gmj29rwnl2cbb"))))
    (build-system python-build-system)
    (arguments
     (list
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'patch-setup.py
            (lambda _
              (substitute* '("pyproject.toml"
                             "setup.py")
                ;; This is not needed when building the package.
                (("setuptools-git-ls-files") "")
                ;; Do not attempt to build the unbundled ADFKO.
                (("cmdclass\\[\"build_ext\"] = ExecutableBuildExt.*")
                 ""))))
          (add-after 'unpack 'patch-tx-path
            (lambda* (#:key inputs #:allow-other-keys)
              (define tx (search-input-file inputs "bin/tx"))
              (substitute* "src/cffsubr/__init__.py"
                (("TX_EXE = \"tx\"")
                 (format #f "TX_EXE = ~s" tx))
                ;; Use the full 'tx' file name directly.
                (("with path\\(__name__, TX_EXE) as tx_cli:")
                 "")
                (("    (return subprocess.run\\(\\[)str\\(tx_cli)(].*)" _ h t)
                 (format #f "~a~s~a" h tx t)))))
          (replace 'check
            (lambda* (#:key tests? #:allow-other-keys)
              (when tests?
                (invoke "pytest" "-vv")))))))
    (native-inputs (list python-pytest python-setuptools-scm python-wheel))

    ;; Use version 3.6.1, which matches the bundled version and does not
    ;; depend on Java.
    (inputs (list python-afdko-3.6.1))

    (propagated-inputs (list python-fonttools-minimal))
    (home-page "https://github.com/adobe-type-tools/cffsubr")
    (synopsis "Compact Font Format (CFF) subroutinizer")
    (description "This package provides the @command{cffsubr} command, a
Compact Font Format (CFF) subroutinizer based on the Adobe Font Development
Kit for OpenType (AFDKO) @command{tx} tool.")
    (license license:asl2.0)))

(define-public python-compreffor
  (package
    (name "python-compreffor")
    (version "0.5.4")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "compreffor" version))
       (sha256
        (base32 "05gpszc8xh6wn3mdra05d6yz6ns624y67m9xs4vv8gh68m0aasrh"))))
    (build-system python-build-system)
    (arguments
     (list
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'patch-setup.py
            (lambda _
              (substitute* "setup.py"
                ;; Not actually needed.
                ((", \"setuptools_git_ls_files\"") "")))))))
    (native-inputs (list python-pytest python-pytest-runner
                         python-setuptools-scm))
    (propagated-inputs (list python-fonttools-minimal))
    (home-page "https://github.com/googlefonts/compreffor")
    (synopsis "@acronym{CFF, Compact Font Format} subroutinizer for fontTools")
    (description "This package provides a @acronym{CFF, Compact Font Format}
subroutinizer for fontTools.")
    (license license:asl2.0)))

(define-public python-cu2qu
  (package
    (name "python-cu2qu")
    (version "1.6.7.post1")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "cu2qu" version ".zip"))
       (sha256
        (base32 "1x762r7bf39g6aivfvrmq00h6f07abvs9x1xm0fz8l81vq8jz64c"))))
    (build-system python-build-system)
    (propagated-inputs (list python-fonttools))
    (native-inputs
     (list python-cython
           python-defcon
           python-pytest
           python-pytest-runner
           python-setuptools-scm
           unzip))
    (home-page "https://github.com/googlefonts/cu2qu")
    (synopsis "Cubic-to-quadratic bezier curve conversion")
    (description "This library provides functions which take in @acronym{UFO,
Unified Font Object} objects (such as Defcon Fonts or Robofab RFonts) and
converts any cubic curves to quadratic.  The most useful function is probably
@code{fonts_to_quadratic}.")
    (license license:asl2.0)))

(define-public python-ufo2ft
  (package
    (name "python-ufo2ft")
    (version "2.31.0")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "ufo2ft" version))
       (sha256
        (base32 "1rg2997af8blvswlwif0kpz2vxrlh555gzqslz6yv9y7i7v8lphl"))))
    (build-system pyproject-build-system)
    (native-inputs
     (list python-pytest
           python-setuptools-scm
           python-setuptools
           python-wheel))
    (propagated-inputs
     (list python-booleanoperations
           python-cffsubr
           python-compreffor
           python-cu2qu
           python-defcon
           python-fonttools
           python-skia-pathops
           python-ufolib2))
    (home-page "https://github.com/googlefonts/ufo2ft")
    (synopsis "Generate OpenType fonts from Unified Font Objects (UFOs)")
    (description "@code{ufo2ft} (UFO to FontTools) is a fork of @code{ufo2fdk}
intended to leverage FontTools (a Python library) rather than the Adobe Font
Development Kit for OpenType (AFDKO), a set of C libraries/utilities so that
it can be more easily extended.  Like @code{ufo2fdk}, its primary purpose is
to generate OpenType font binaries from Unified Font Objects (UFOs).")
    (license license:expat)))

(define-public python-fontmath
  (package
    (name "python-fontmath")
    (version "0.9.3")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "fontMath" version ".zip"))
       (sha256
        (base32 "070v1jz5f18g15if459ppwswq4w5hzffwp1gvdc5j47bgz5qflva"))))
    (build-system python-build-system)
    (propagated-inputs (list python-fonttools-minimal))
    (native-inputs
     (list python-setuptools-scm
           python-pytest
           python-pytest-runner
           python-wheel
           unzip))
    (home-page "https://github.com/robotools/fontMath")
    (synopsis "Fast font mathematical operations library")
    (description "This package provides a set of objects for performing fast
font, glyph, etc. mathematical operations on font data.")
    (license license:expat)))

;;; An untested variant used to break a cycle with python-booleanoperations.
(define-public python-fontpens-bootstrap
  (package
    (name "python-fontpens-bootstrap")
    (version "0.2.4")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "fontPens" version ".zip"))
       (sha256
        (base32 "1za15dzsnymq6d9x7xdfqwgw4a3003wj75fn2crhyidkfd2s3nd6"))))
    (build-system python-build-system)
    (arguments (list #:tests? #f))
    (propagated-inputs (list python-fonttools-minimal))
    (native-inputs (list unzip))
    (home-page "https://github.com/robofab-developers/fontPens")
    (synopsis "Python classes implementing the pen protocol")
    (description "This package provides a collection of Python classes
implementing the pen protocol for manipulating glyphs.")
    (license license:bsd-3)))

(define-public python-fontpens
  (hidden-package
   (package/inherit python-fontpens-bootstrap
     (name "python-fontpens")
     (arguments
      (substitute-keyword-arguments (package-arguments python-fontpens-bootstrap)
        ((#:tests? _ #f)
         #t)
        ((#:phases phases #~%standard-phases)
         #~(modify-phases #$phases
             (add-after 'unpack 'drop-flaky-docstring
               ;; XXX This assertion fails on certain (Intel?) machines, but not
               ;; others (AMD?), so we can't patch in a ‘correct’ value.  Just
               ;; drop it until the proper fix lands upstream.  Reported there
               ;; as <https://github.com/robotools/fontPens/issues/41>.
               (lambda _
                 (substitute* "Lib/fontPens/penTools.py"
                   ((".*\\(\\(0, 0), \\(50, 20), \\(100, 40)).*") "")
                   ((".*107\\.70329614269009.*") ""))))))))
     (native-inputs
      (modify-inputs (package-native-inputs python-fontpens-bootstrap)
        (append python-fontparts-bootstrap
                python-fontpens-bootstrap
                python-pytest
                python-pytest-runner))))))

;;; A variant used to break a cycle with python-fontpens.
(define-public python-fontparts-bootstrap
  (hidden-package
   (package
     (name "python-fontparts-bootstrap")
     (version "0.11.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "fontParts" version ".zip"))
        (sha256
         (base32 "0j4h8hszky639gmfy1avmw670y80ya49kca8yc635h5ihl0c3v8x"))))
     (build-system python-build-system)
     (propagated-inputs
      (list python-booleanoperations
            python-defcon-bootstrap
            python-fontmath
            python-fonttools-minimal))
     (native-inputs (list python-setuptools-scm unzip))
     (home-page "https://github.com/robotools/fontParts")
     (synopsis "Library for interacting with font parts")
     (description "FontParts is an @acronym{API, Application Programming
Interface} for interacting with the parts of fonts during the font development
process.  FontParts is the successor of RoboFab.")
     (license license:expat))))

(define-public python-fontparts
  (package/inherit python-fontparts-bootstrap
    (name "python-fontparts")
    (propagated-inputs
     (modify-inputs (package-propagated-inputs python-fontparts-bootstrap)
       (replace "python-defcon-bootstrap" python-defcon)))
    (properties
     (alist-delete 'hidden?
                   (package-properties python-fontparts-bootstrap)))))

(define-public python-glyphslib
  (package
    (name "python-glyphslib")
    (version "6.0.7")
    (source (origin
              (method url-fetch)
              (uri (pypi-uri "glyphsLib" version))
              (sha256
               (base32
                "0mkkwd09g76hvif603ij5aqicxh47zvhgyyd0pjcjmpdy6dr70yw"))))
    (build-system pyproject-build-system)
    (arguments
     (list
      #:test-flags #~'(;; These fail because the test data has not yet been
                       ;; updated for newer FontTools:
                       ;;   https://github.com/googlefonts/glyphsLib/issues/787
                       ;; Re-enable for versions > 6.0.7.
                       "--ignore=tests/builder/designspace_gen_test.py"
                       "--ignore=tests/builder/interpolation_test.py")))
    (native-inputs
     (list python-setuptools-scm
           python-setuptools
           python-wheel
           ;; For tests.
           python-pytest
           python-xmldiff))
    (propagated-inputs
     (list python-defcon
           python-fonttools
           python-openstep-plist
           python-ufolib2
           python-ufo2ft
           python-ufonormalizer))
    (home-page "https://github.com/googlefonts/glyphsLib")
    (synopsis "Bridge Glyphs source files to UFOs")
    (description
     "This package provides a bridge from Glyphs source files (@file{.glyphs})
to UFOs and DesignSpace files via @code{defcon} and @code{designspaceLib}.")
    (license license:asl2.0)))

(define-public python-glyphsets
 (package
  (name "python-glyphsets")
  (version "0.5.2")
  (source (origin
            (method url-fetch)
            (uri (pypi-uri "glyphsets" version))
            (sha256
             (base32
              "1dc24i0hkd85gkkg3bqjhagjyw3xsqxazd86yh2l60c1wr5n9y6g"))))
  (build-system python-build-system)
  (arguments
   (list #:phases
         #~(modify-phases %standard-phases
             (add-after 'unpack 'loosen-version-constraints
               (lambda _
                 (substitute* "setup.py"
                   (("setuptools_scm>=4,<6\\.1")
                    "setuptools_scm>=4"))))
             (replace 'check
               (lambda* (#:key tests? #:allow-other-keys)
                 (when tests?
                   (invoke "pytest" "-vv" "tests/testglyphdata.py")
                   (invoke "pytest" "-vv" "tests/testusage.py")))))))
  (native-inputs (list python-pytest python-setuptools-scm))
  (propagated-inputs
   (list python-defcon python-fonttools-minimal python-glyphslib))
  (home-page "https://github.com/googlefonts/glyphsets/")
  (synopsis "Evaluate coverage of glyph sets")
  (description
   "This package provides an API with data about glyph sets for many
different scripts and languages.")
  (license license:asl2.0)))

(define-public python-opentype-sanitizer
  (package
    (name "python-opentype-sanitizer")
    (version "8.2.1")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "opentype-sanitizer" version))
       (sha256
        (base32 "1wjy6chbnj9ic5yjxal6spln5jfzr8cigqs6ab0gj7q60dndrl5k"))))
    (build-system python-build-system)
    (arguments
     (list
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'unbundle-opentype-sanitizer
            (lambda* (#:key inputs #:allow-other-keys)
              (delete-file-recursively "src/c")
              (substitute* "setup.py"
                (("^cmdclass\\[\"download\"].*") "")
                (("^cmdclass\\[\"build_ext\"].*") "")
                (("^cmdclass\\[\"egg_info\"].*") ""))
              (substitute* "src/python/ots/__init__.py"
                (("^OTS_SANITIZE = .*")
                 (format #f "OTS_SANITIZE = ~s~%"
                         (search-input-file inputs "bin/ots-sanitize"))))))
          (replace 'check
            (lambda* (#:key tests? #:allow-other-keys)
              (when tests?
                (invoke "pytest" "-vv")))))))
    (native-inputs (list python-pytest python-setuptools-scm))
    (inputs (list opentype-sanitizer))
    (home-page "https://github.com/googlefonts/ots-python")
    (synopsis "Python wrapper for OpenType Sanitizer")
    (description "Python wrapper for the OpenType Sanitizer library.")
    (license license:bsd-3)))

(define-public python-mutatormath
  (package
    (name "python-mutatormath")
    (version "3.0.1")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "MutatorMath" version ".zip"))
       (sha256
        (base32 "0r1qq45np49x14zz1zwkaayqrn7m8dn2jlipjldg2ihnmpzw29w1"))))
    (build-system python-build-system)
    (propagated-inputs (list python-defcon python-fontmath
                             python-fonttools-minimal))
    (native-inputs (list unzip))
    (home-page "https://github.com/LettError/MutatorMath")
    (synopsis "Piecewise linear interpolation Python library")
    (description "MutatorMath is a Python library for the calculation of
piecewise linear interpolations in n-dimensions with any number of masters. It
was developed for interpolating data related to fonts, but if can handle any
arithmetic object.")
    (license license:bsd-3)))

(define-public psautohint-font-data
  ;; There is no release tag, so use the latest commit.
  (let ((revision "0")
        (commit "1e4c5061d328105c4dcfcb6fdbc27ec49b3e9d23"))
    (hidden-package
     (package
       (name "psautohint-font-data")
       (version (git-version "0.0.0" revision commit))
       (source
        (origin
          (method git-fetch)
          (uri (git-reference
                (url "https://github.com/adobe-type-tools/psautohint-testdata")
                (commit commit)))
          (file-name (git-file-name name version))
          (sha256
           (base32
            "0p7g8mnndzp8zpbj9h6lkvfdpvd74fy10q8wmkagbg2ahbdi1zva"))))
       (build-system copy-build-system)
       (home-page "https://github.com/adobe-type-tools/psautohint-testdata")
       (synopsis "Test font data psautohint")
       (description "This package contains the font data used by the test
suite of the @code{psautohint} package.")
       ;; The bundle contains font data from the Cantarell, Libertinus, Source
       ;; Code Pro, Source Serif Pro, all available under the same license.
       (license license:silofl1.1)))))

(define-public psautohint
  (package
    (name "psautohint")
    (version "2.4.0")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "psautohint" version))
       (sha256
        (base32 "0zzz7hy1kkkjfrrm9ly2di3xv2x1ywdqhbyqy21k670jysldw3nm"))))
    (build-system pyproject-build-system)
    (arguments
     (list
      #:test-flags
      #~(list "-k"
              (string-join
               '(;; The CJKSparseVar.subset.hinted.otf test fails with slightly
                 ;; different output caused by the newer fonttools version used
                 ;; in Guix.
                 "not CJKSparseVar.subset.hinted.otf"
                 ;; These tests fails underministically, See also:
                 ;; https://github.com/adobe-type-tools/afdko/issues/1678
                 "not test_hashmap_no_version"
                 "not test_hashmap_old_version")
               " and "))
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'copy-font-data
            ;; The data is copied as it needs to be writable for the tests.
            (lambda _
              (copy-recursively
               #$(this-package-native-input "psautohint-font-data")
               "tests/integration/data")
              (for-each make-file-writable
                        (find-files "tests/integration/data")))))))
    (inputs (list python-fonttools))
    (native-inputs
     (list psautohint-font-data
           python-pytest
           python-pytest-cov
           python-pytest-xdist
           python-setuptools-scm
           python-setuptools
           python-wheel))
    (home-page "https://github.com/adobe-type-tools/psautohint")
    (synopsis "Adobe's PostScript autohinter")
    (description "This package provides the @command{autohinter} command that
can be used to hint PostScript fonts.  A Python wrapper is also included.")
    (license license:asl2.0)))

(define-public python-sfdlib
  (package
    (name "python-sfdlib")
    (version "1.2.3")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/aliftype/sfdLib")
                    (commit (string-append "v" version))))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "1q61km32i1h3cmn8nazcgsbzpm8q2nxp3kq3glqgfgvlxr1s3brm"))))
    (build-system python-build-system)
    (propagated-inputs (list python-ufolib2))
    (home-page "https://github.com/aliftype/sfdLib")
    (synopsis "Simple SFD to UFO converter")
    (description "This package provides the @command{sfd2ufo} command, a
converter from FontForge’s @acronym{SFD, Spline Font Database} fonts to
@acronym{UFO, Unified Font Object} fonts.")
    (license license:bsd-3)))

(define-public python-skia-pathops
  (package
    (name "python-skia-pathops")
    (version "0.8.0")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "skia-pathops" version ".zip"))
       (modules '((guix build utils)))
       (snippet '(delete-file-recursively "src/cpp")) ;140+ MiB of stuff
       (sha256
        (base32 "1vlwl1w6sn8c78fsh1w549n3lk9v3v9hcp866vrsdr4byb7g2ani"))))
    (build-system python-build-system)
    (arguments
     (list
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'configure-env
            (lambda _
              (setenv "BUILD_SKIA_FROM_SOURCE" "0")))
          (add-after 'unpack 'adjust-c++-language
            (lambda _
              ;; Our version of Skia requires c++17.
              (substitute* "setup.py"
                (("-std=c\\+\\+14")
                 "-std=c++17"))))
          (replace 'check
            (lambda* (#:key tests? #:allow-other-keys)
              (when tests?
                (invoke "pytest" "-vv")))))))
    (native-inputs
     (list pkg-config
           python-cython
           python-pytest
           python-setuptools-scm
           unzip))
    (inputs (list skia))
    (home-page "https://github.com/fonttools/skia-pathops")
    (synopsis "Python bindings for the Skia library's Path Ops module")
    (description "This package provides Python bindings for the Path Ops
module of the Skia library, performing boolean operations on
paths (intersection, union, difference, xor).")
    (license license:bsd-3)))

(define-public python-ufoprocessor
  (package
    (name "python-ufoprocessor")
    (version "1.9.0")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "ufoProcessor" version ".zip"))
       (sha256
        (base32 "0ns11aamgavgsfj8qf5kq7dvzmgl0mhr1cbych2f075ipfdvva5s"))))
    (build-system python-build-system)
    (arguments
     (list #:phases #~(modify-phases %standard-phases
                        (replace 'check
                          (lambda* (#:key tests? #:allow-other-keys)
                            (when tests?
                              ;; Most of the tests appear to be a work in
                              ;; progress; run only a subset.
                              (invoke "python" "Tests/tests.py")))))))
    (propagated-inputs
     (list python-defcon
           python-fontmath
           python-fontparts
           python-fonttools-minimal
           python-mutatormath))
    (native-inputs (list python-setuptools-scm unzip))
    (home-page "https://github.com/LettError/ufoProcessor")
    (synopsis "Process and generate @acronym{UFO, Unified Font Object} files")
    (description "This Python package processes and generates instances for
@acronym{UFO, Unified Font Object} files, glyphs and other data.  It can,
among other things:
@itemize
@item Collect source materials.
@item Provide mutators for specific glyphs, font info, kerning so that other
tools can generate partial instances.
@item Support designspace format 4 with layers.
@item Apply avar-like designspace bending.
@item Apply rules.
@item Generate actual UFO instances in formats 2 and 3.
@item Round geometry as requested.
@end itemize")
    (license license:expat)))

(define-public python-ufonormalizer
  (package
    (name "python-ufonormalizer")
    (version "0.6.1")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "ufonormalizer" version ".zip"))
       (sha256
        (base32 "0v5awian2alap7nvxfz38aahyqbqnma16nrqcpr8602hbbki04g6"))))
    (build-system python-build-system)
    (native-inputs (list python-setuptools-scm unzip))
    (home-page "https://github.com/unified-font-object/ufoNormalizer")
    (synopsis "Script to normalize @acronym{UFO, Unified Font Object} data")
    (description "The purpose of the @command{ufonormalizer} command is to
provide a standard formatting so that updates to @acronym{UFO, Unified Font
Object} data can be usefully versioned.  Examples of formatting applied by
ufoNormalizer include:
@itemize
@item Changing floating-point numbers to integers where it doesn't alter the
value (e.g. @samp{x=\"95.0\"} becomes @samp{x=\"95\"})
@item Rounding floating-point numbers to 10 digits
@item Formatting XML with tabs rather than spaces.
@end itemize")
    (license license:bsd-3)))

(define-public fontobene-qt
  (package
    (name "fontobene-qt")
    (version "1.0.0")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/fontobene/fontobene-qt")
                    (commit version)))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "098ys33l563hjyzm6azzw8kmlybja374vacakczwhh2k3ifn37r9"))))
    (inputs (list qtbase))
    (build-system cmake-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (replace 'check
           (lambda* (#:key tests? #:allow-other-keys)
             (when tests?
               (invoke "./tests/fontobene-qt-tests")))))))
    (home-page "https://github.com/fontobene/fontobene-qt5")
    (synopsis "Parser for FontoBene stroke fonts")
    (description "FontoBene-Qt is a header-only library to parse FontoBene
stroke fonts with C++11/Qt.")
    ;; Dual-licensed, either license applies.
    (license (list license:asl2.0 license:expat))))

(define-public fontobene-qt5
  (deprecated-package "fontobene-qt5" fontobene-qt))

(define-public ttfautohint
  (package
    (name "ttfautohint")
    (version "1.8.3")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "mirror://savannah/freetype/ttfautohint-"
                           version ".tar.gz"))
       (sha256
        (base32
         "0zpqgihn3yh3v51ynxwr8asqrijvs4gv686clwv7bm8sawr4kfw7"))))
    (build-system gnu-build-system)
    (native-inputs
     (list flex bison pkg-config))
    (inputs
     (list freetype harfbuzz))
    (arguments
     `(#:configure-flags '("--disable-static"
                           "--with-qt=no"))) ;no gui
    (synopsis "Automated font hinting")
    (description
     "ttfautohint provides a 99% automated hinting process and a platform for
finely hand-hinting the last 1%.  It is ideal for web fonts and supports many
scripts.")
    (license (list license:gpl2+ license:freetype)) ;choose one or the other
    (home-page "https://www.freetype.org/ttfautohint/")))

(define-public woff-tools
  (package
    (name "woff-tools")
    (version "2009.10.04")
    (source
     (origin
       (method url-fetch)
       ;; Upstream source is unversioned, so use Debian's versioned tarball
       (uri (string-append "mirror://debian/pool/main/w/woff-tools/"
                           "woff-tools_" version ".orig.tar.gz"))
       (file-name (string-append name "-" version ".tar.gz"))
       (sha256
        (base32
         "1i97gkqa6jfzlslsngqf556kx60knlgf7yc9pzsq2pizc6f0d4zl"))))
    (build-system gnu-build-system)
    (inputs
     (list zlib))
    (arguments
     `(#:make-flags '(,(string-append "CC=" (cc-for-target)))
       #:tests? #f                      ;no tests
       #:phases
       (modify-phases %standard-phases
         (delete 'configure)            ;no configuration
         (replace 'install
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (bin (string-append out "/bin")))
               (install-file "sfnt2woff" bin)
               (install-file "woff2sfnt" bin))
             #t)))))
    (synopsis "Convert between OpenType and WOFF fonts")
    (description
     "This package provides two tools:
@table @code
@item sfnt2woff
Converts OpenType fonts to WOFF fonts
@item woff2sfnt
Converts WOFF fonts to OpenType fonts
@end table")
    (license (list license:mpl1.1 license:gpl2+ license:lgpl2.1+))
    (home-page "https://people.mozilla.com/~jkew/woff/")))

(define-public ttf2eot
  (package
    (name "ttf2eot")
    (version "0.0.3")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/wget/ttf2eot")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32
         "0l2yh2ialx7135pjzhjs204kk3br7zxjr09zwaia493by2adzigr"))
       (patches (list (search-patch "ttf2eot-cstddef.patch")))))
    (build-system gnu-build-system)
    (arguments
     `(#:tests? #f                      ; no tests
       #:phases
       (modify-phases %standard-phases
         (delete 'configure)            ; no configuration
         (replace 'install              ; no install target
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (bin (string-append out "/bin")))
               (install-file "ttf2eot" bin)
               #t))))))
    (synopsis "Convert from TrueType to Embeddable Open Type")
    (description
     "This package contains a commandline wrapper around OpenTypeUtilities.cpp
from Chromium, used to make EOT (Embeddable Open Type) files from
TTF (TrueType/OpenType Font) files.")
    ;; While the README states "License: Derived from WebKit, so BSD/LGPL
    ;; 2/LGPL 2.1", the single derived source file includes only BSD in its
    ;; license header, and the wrapper source contains no license header.
    (license license:bsd-2)
    (home-page "https://github.com/wget/ttf2eot")))

(define-public ttf2pt1
  (package
    (name "ttf2pt1")
    (version "3.4.4")
    (source (origin
              (method url-fetch)
              (uri (string-append "mirror://sourceforge/ttf2pt1/ttf2pt1/"
                                  version "/ttf2pt1-" version ".tgz"))
              (sha256
               (base32
                "1l718n4k4widx49xz7qrj4mybzb8q67kp2jw7f47604ips4654mf"))
              (modules '((guix build utils)))
              (snippet
               '(begin
                  ;; Remove trailing backslashes in the sed expression of the
                  ;; 'install' rule since sed would otherwise fail.
                  (substitute* "Makefile"
                    (("\\|;\\\\[[:space:]]*$") "|; "))
                  #t))))
    (build-system gnu-build-system)
    (arguments
     '(#:tests? #f                                ;no tests
       #:phases (modify-phases %standard-phases
                  (replace 'configure
                    (lambda* (#:key outputs #:allow-other-keys)
                      (let ((out (assoc-ref outputs "out")))
                        (substitute* "Makefile"
                          (("INSTDIR =.*")
                           (string-append "INSTDIR = " out "\n"))
                          (("OWNER = .*")
                           "OWNER = `id -un`\n")
                          (("GROUP = .*")
                           "GROUP = `id -g`\n"))
                        #t)))
                  (replace 'build
                    (lambda _
                      (invoke "make" "-j"
                              (number->string (parallel-job-count))
                              "all" "CC=gcc"))))))
    (inputs (list perl))
    (synopsis "Convert TrueType fonts to Postscript Type 1")
    (description
     "TTF2PT1 provides tools to convert most TrueType fonts (or other formats
supported by the FreeType library) to an Adobe Type 1 @file{.pfa} or
@file{.pfb} file.  Another use is as a hinting engine: feed it an unhinted or
poorly hinted Adobe Type 1 font through the FreeType library and get it back
with freshly generated hints.  The files produced by default are in
human-readable form, which further needs to be encoded with t1utilities to
work with most software requiring Type 1 fonts.")
    (home-page "https://ttf2pt1.sourceforge.net/")
    (license license:bsd-3)))

(define-public woff2
  (package
    (name "woff2")
    (version "1.0.2")
    (source
     (origin
       (method git-fetch)
       (uri
        (git-reference
         (url "https://github.com/google/woff2")
         (commit (string-append "v" version))))
       (file-name
        (git-file-name name version))
       (sha256
        (base32 "13l4g536h0pr84ww4wxs2za439s0xp1va55g6l478rfbb1spp44y"))))
    (build-system cmake-build-system)
    (outputs '("out" "bin"))
    (arguments
     `(#:tests? #f                      ;no test suite
       #:configure-flags
       (list
        (string-append "-DCMAKE_INSTALL_BINDIR="
                       (assoc-ref %outputs "bin")
                       "/bin")
        (string-append "-DCMAKE_INSTALL_INCLUDEDIR="
                       (assoc-ref %outputs "out")
                       "/include")
        (string-append "-DCMAKE_INSTALL_LIBDIR="
                       (assoc-ref %outputs "out")
                       "/lib"))
       #:phases
       (modify-phases %standard-phases
         ;; To install both binaries and libraries.
         (add-after 'unpack 'patch-installation
           (lambda _
             (substitute* "CMakeLists.txt"
               (("NOT BUILD_SHARED_LIBS")
                "BUILD_SHARED_LIBS")))))))
    (native-inputs
     (list pkg-config))
    (propagated-inputs
     (list brotli))                     ;libwoff2dec.pc requires libbrotlidec
    (synopsis "Libraries and tools for WOFF2 font format")
    (description "WOFF2 provides libraries and tools to handle the Web Open
Font Format (WOFF).")
    (home-page "https://w3c.github.io/woff/woff2/")
    (license license:expat)))

(define-public fontconfig
  (hidden-package
   (package
     (name "fontconfig-minimal")
     (version "2.14.0")
     (source (origin
               (method url-fetch)
               (uri (string-append
                     "https://www.freedesktop.org/software/"
                     "fontconfig/release/fontconfig-" version ".tar.xz"))
               (sha256 (base32
                        "1b4v1r94ri44p4a3kbwd38ig5jgdgcfgwdfm6fqzvfvlki6bignw"))
               (patches (search-patches "fontconfig-cache-ignore-mtime.patch"))))
     (build-system gnu-build-system)
     ;; In Requires or Requires.private of fontconfig.pc.
     (propagated-inputs `(("expat" ,expat)
                          ("freetype" ,freetype)
                          ("libuuid" ,util-linux "lib")))
     (inputs
      ;; We use to use 'font-ghostscript' but they are not recognized by newer
      ;; versions of Pango, causing many applications to fail to find fonts
      ;; otherwise.
      (list font-dejavu))
     (native-inputs
      `(("gperf" ,gperf)
        ("pkg-config" ,pkg-config)
        ("python" ,python-minimal)))    ;to avoid a cycle through tk
     (arguments
      `(#:configure-flags
        (list "--disable-docs"
              "--with-cache-dir=/var/cache/fontconfig"
              ;; register the default fonts
              (string-append "--with-default-fonts="
                             (assoc-ref %build-inputs "font-dejavu")
                             "/share/fonts"))
        #:phases
        (modify-phases %standard-phases
          (add-before 'check 'skip-problematic-tests
            (lambda _
              ;; SOURCE_DATE_EPOCH doesn't make sense when ignoring mtime
              (unsetenv "SOURCE_DATE_EPOCH")

              (substitute* "test/run-test.sh"
                ;; The crbug1004254 test attempts to fetch fonts from the
                ;; network.
                (("\\[ -x \"\\$BUILDTESTDIR\"/test-crbug1004254 \\]")
                 "false"))))
          (replace 'install
            (lambda _
              ;; Don't try to create /var/cache/fontconfig.
              (invoke "make" "install"
                      "fc_cachedir=$(TMPDIR)"
                      "RUN_FC_CACHE_TEST=false"))))))
     (synopsis "Library for configuring and customizing font access")
     (description
      "Fontconfig can discover new fonts when installed automatically;
perform font name substitution, so that appropriate alternative fonts can
be selected if fonts are missing;
identify the set of fonts required to completely cover a set of languages;
have GUI configuration tools built as it uses an XML-based configuration file;
efficiently and quickly find needed fonts among the set of installed fonts;
be used in concert with the X Render Extension and FreeType to implement
high quality, anti-aliased and subpixel rendered text on a display.")
                                        ; The exact license is more X11-style than BSD-style.
     (license (license:non-copyleft "file://COPYING"
                                    "See COPYING in the distribution."))
     (native-search-paths
      ;; Since version 2.13.94, fontconfig knows to find fonts from
      ;; XDG_DATA_DIRS.
      (list (search-path-specification
             (variable "XDG_DATA_DIRS")
             (files '("share")))))
     (home-page "https://www.freedesktop.org/wiki/Software/fontconfig"))))

;;; The documentation of fontconfig is built in a separate package, as it
;;; causes a dramatic increase in the size of the closure of fontconfig.  This
;;; is intentionally named 'fontconfig', as it's intended as the user-facing
;;; fontconfig package.
(define-public fontconfig-with-documentation
  (package
    (inherit fontconfig)
    (name "fontconfig")
    (outputs (cons "doc" (package-outputs fontconfig)))
    (arguments
     (substitute-keyword-arguments (package-arguments fontconfig)
       ((#:configure-flags configure-flags)
        `(delete "--disable-docs" ,configure-flags))
       ((#:phases phases '%standard-phases)
        `(modify-phases ,phases
           (add-after 'unpack 'no-pdf-doc
             (lambda _
               ;; Don't build documentation as PDF.
               (substitute* "doc/Makefile.in"
                 (("^PDF_FILES = .*")
                  "PDF_FILES =\n"))))
           (add-after 'install 'move-man-sections
             (lambda* (#:key outputs #:allow-other-keys)
               ;; Move share/man/man{3,5} to the "doc" output.  Leave "man1" in
               ;; "out" for convenience.
               (let ((out (assoc-ref outputs "out"))
                     (doc (assoc-ref outputs "doc")))
                 (for-each (lambda (section)
                             (let ((source (string-append out "/share/man/"
                                                          section))
                                   (target (string-append doc "/share/man/"
                                                          section)))
                               (copy-recursively source target)
                               (delete-file-recursively source)))
                           '("man3" "man5")))))))))
    (native-inputs
     (append (package-native-inputs fontconfig)
             `(("docbook-utils" ,docbook-utils))))
    (properties (alist-delete 'hidden? (package-properties fontconfig)))))

(define-public t1lib
  (package
   (name "t1lib")
   (version "5.1.2")
   (source (origin
            (method url-fetch)
            (uri (list (string-append "ftp://sunsite.unc.edu/pub/Linux/libs/"
                                      "graphics/" name "-" version ".tar.gz")
                       (string-append "https://fossies.org/linux/misc/old/"
                                      name "-" version ".tar.gz")))
            (sha256 (base32
                     "0nbvjpnmcznib1nlgg8xckrmsw3haa154byds2h90y2g0nsjh4w2"))
            (patches (search-patches
                       "t1lib-CVE-2010-2642.patch" ; 2011-0443, 2011-5244
                       "t1lib-CVE-2011-0764.patch"
                       "t1lib-CVE-2011-1552+.patch")))) ; 2011-1553, 2011-1554
   (properties `((lint-hidden-cve . ("CVE-2011-0433"
                                     "CVE-2011-1553"
                                     "CVE-2011-1554"
                                     "CVE-2011-5244"))))
   (build-system gnu-build-system)
   (arguments
    ;; Making the documentation requires latex, but t1lib is also an input
    ;; for building texlive.
    `(#:tests? #f ; no test target
      #:make-flags
      '("without_doc")))
   (synopsis "Library for generating bitmaps from Type 1 fonts")
   (description
    "T1lib is a library for generating/rasterising bitmaps from Type 1 fonts.
It is based on the code of the X11 rasteriser of the X11 project.

The bitmaps created by t1lib are returned in a data structure with type
GLYPH.  This special GLYPH-type is also used in the X11 window system to
describe character bitmaps.  It contains the bitmap data as well as some
metric information.  But t1lib is in itself entirely independent of the
X11-system or any other graphical user interface.")
   (license license:gpl2)
   (home-page "https://www.t1lib.org/")))

(define-public teckit
  (package
    (name "teckit")
    (version "2.5.10")                  ; signed by key 0xC9183BEA0288CDEE
    (source
     (origin
       (method url-fetch)
       (uri (string-append "https://github.com/silnrsi/teckit/releases/"
                           "download/v" version "/teckit-" version ".tar.gz"))
       (sha256
        (base32 "12qnf8nhxyr4d5pc01s3vc6h726506957an4vvmmfz633cqi5796"))))
    (build-system gnu-build-system)
    (arguments
     '(#:configure-flags '("--disable-static")))
    (inputs
     (list zlib expat))
    (native-inputs
     (list perl))                 ;for the tests
    (synopsis "Toolkit for encoding conversions")
    (description
     "TECkit is a low-level toolkit intended to be used by other applications
that need to perform encoding conversions (e.g., when importing legacy data
into a Unicode-based application).  The primary component of the TECkit
package is therefore a library that performs conversions; this is the
\"TECkit engine\".  The engine relies on mapping tables in a specific binary
format (for which documentation is available); there is a compiler that
creates such tables from a human-readable mapping description (a simple
text file).

To facilitate the development and testing of mapping tables for TECkit,
several applications are also included in the current package; these
include simple tools for applying conversions to plain-text and Standard
Format files, as well as both command-line and simple GUI versions of the
TECkit compiler.  However, it is not intended that these tools will be the
primary means by which end users perform conversions, and they have not
been designed, tested, and debugged to the extent that general-purpose
applications should be.")
    (license license:lgpl2.1+)
    (home-page "https://scripts.sil.org/cms/scripts/page.php?cat_id=teckit")))

(define-public graphite2
  (package
   (name "graphite2")
   (version "1.3.13")
   (source
     (origin
       (method url-fetch)
       (uri (string-append "https://github.com/silnrsi/graphite/releases/"
                           "download/" version "/" name "-" version ".tgz"))
       (sha256
        (base32
         "01jzhwnj1c3d68dmw15jdxly0hwkmd8ja4kw755rbkykn1ly2qyx"))))
   (build-system cmake-build-system)
   (native-inputs
    (list python python-fonttools-minimal))
   (inputs
    (list freetype))
   (arguments
    (if (system-hurd?)
        (list
         #:phases
         #~(modify-phases %standard-phases
             (replace 'check
               ;; cmake-build-system ignores #:make-flags for make check
               (lambda* (#:key test-target tests? parallel-tests?
                         #:allow-other-keys)
                 (if tests?
                     (let ((jobs (if parallel-tests?
                                     (number->string (parallel-job-count))
                                     "1")))
                       (invoke "make"
                               (string-append
                                "ARGS=-j " jobs " --exclude-regex ^awamicmp3$")
                               test-target))
                     (format #t "test suite not run~%"))))))
        '()))
   (synopsis "Reimplementation of the SIL Graphite text processing engine")
   (description
    "Graphite2 is a reimplementation of the SIL Graphite text processing
engine.  Graphite is a smart font technology designed to facilitate the
process known as shaping.  This process takes an input Unicode text string
and returns a sequence of positioned glyphids from the font.")
   (license license:lgpl2.1+)
   (home-page "https://github.com/silnrsi/graphite")))

(define-public potrace
  (package
    (name "potrace")
    (version "1.16")
    (source
     (origin
      (method url-fetch)
      (uri (string-append "mirror://sourceforge/potrace/" version
                          "/potrace-" version ".tar.gz"))
      (sha256
       (base32
        "1k3sxgjqq0jnpk9xxys05q32sl5hbf1lbk1gmfxcrmpdgnhli0my"))))
    (build-system gnu-build-system)
    (native-inputs (list ghostscript)) ;for tests
    (inputs (list zlib))
    (arguments
     `(#:configure-flags
      `("--with-libpotrace"))) ; install library and headers
    (synopsis "Transform bitmaps into vector graphics")
    (description
     "Potrace is a tool for tracing a bitmap, which means, transforming a
bitmap into a smooth, scalable image.  The input is a bitmap (PBM, PGM, PPM,
or BMP format), and the default output is an encapsulated PostScript
file (EPS).  A typical use is to create EPS files from scanned data, such as
company or university logos, handwritten notes, etc.  The resulting image is
not \"jaggy\" like a bitmap, but smooth.  It can then be rendered at any
resolution.")
    (license license:gpl2+)
    (home-page "https://potrace.sourceforge.net/")))

(define-public psftools
  (package
    (name "psftools")
    (version "1.1.1")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "https://www.seasip.info/Unix/PSF/"
                           "psftools-" version ".tar.gz"))
       (sha256
        (base32 "1lv6kvrcbspyh7a0hlji84wbmw6xh87r3iaafq3khp88kgh1irri"))))
    (build-system gnu-build-system)
    (arguments
     (list
      #:configure-flags #~(list "--disable-static")))
    (home-page "https://www.seasip.info/Unix/PSF/")
    (synopsis
     "Convert PSF fixed-width bitmap (console) fonts from/to other formats")
    (description
     "@acronym{PSF, PC Screen Font} is the simple monospaced bitmap font format
used by the Linux kernel for console fonts.  The PSF Tools convert between PSF
and many other font formats, similar to what the NetPBM package does for images.

It includes converters for a good number of common bitmap font formats such as
@file{.BDF}, @file{.FNT}, and @file{.FON} files, Berkeley vfonts, classic
Amstrad/Sinclair/Hercules/BBC Micro soft fonts, and raw (DOS-style) fonts.

It also supports less traditional formats such as PBM/XBM images, plain text
(for rudimentary editing), and C header files.")
    (license license:gpl2+)))

(define-public libotf
  (package
    (name "libotf")
    (version "0.9.16")
    (source (origin
              (method url-fetch)
              (uri (string-append "mirror://savannah/m17n/libotf-"
                                  version ".tar.gz"))
              (sha256
               (base32 "0sq6g3xaxw388akws6qrllp3kp2sxgk2dv4j79k6mm52rnihrnv8"))))
    (build-system gnu-build-system)
    (native-inputs
     (list pkg-config))
    (propagated-inputs
     (list freetype))
    (home-page "https://www.nongnu.org/m17n/")
    (synopsis "Library for handling OpenType Font")
    (description "This library can read Open Type Layout Tables from an OTF
file.  Currently these tables are supported; head, name, cmap, GDEF, GSUB, and
GPOS.  It can convert a Unicode character sequence to a glyph code sequence by
using the above tables.")
    (license license:lgpl2.0+)))

(define-public libspiro
  (package
    (name "libspiro")
    (version "20200505")
    (source
     (origin
      (method url-fetch)
      (uri (string-append "https://github.com/fontforge/libspiro/releases"
                          "/download/" version "/libspiro-dist-" version ".tar.gz"))
      (sha256
       (base32
        "0j8fmyj4wz6mqk17dqs6f8jx0i52n68gv5px17qbrjnbilg9mih6"))))
    (build-system gnu-build-system)
    (arguments
     '(#:configure-flags '("--disable-static")))
    (synopsis "Clothoid to bezier conversion library")
    (description
     "Raph Levien's Spiro package as a library.  A mechanism for drawing
smooth contours with constant curvature at the spline joins.")
    (license license:gpl2+)
    (home-page "https://libspiro.sourceforge.net/")))

(define-public libuninameslist
  (package
    (name "libuninameslist")
    (version "20200313")
    (home-page "https://github.com/fontforge/libuninameslist")
    (source
     (origin
       (method url-fetch)
       (uri (string-append home-page "/releases/download/" version
                           "/libuninameslist-dist-" version ".tar.gz"))
       (sha256
        (base32
         "10ri80c64xb4rhbif3sr87y5vhi3m702zb0m02imvj1jib9rq0m8"))))
    (build-system gnu-build-system)
    (synopsis "Unicode names and annotation list")
    (description
     "LibUniNamesList holds www.unicode.org Nameslist.txt data which can be
useful for programs that need Unicode \"Names\", \"Annotations\", and block
definitions.")
    ;; COPYING specifies GPL2, but according to LICENSE it only covers the
    ;; configure script.  The actual code is BSD-3, and the Unicode data
    ;; is governed by an X11-style license only found on the web.
    (license (list license:bsd-3
                   (license:x11-style
                    "https://www.unicode.org/copyright.html#License")))))

(define-public fontforge
  (package
    (name "fontforge")
    (version "20220308")
    (source (origin
              (method url-fetch)
              (uri (string-append
                    "https://github.com/fontforge/fontforge/releases/download/"
                    version "/fontforge-" version ".tar.xz"))
              (sha256
               (base32 "0ncfc4ajwy4ng6b6h79w52jh9z3lngvf3f3ldi1wzkhcg9zh3r01"))))
    (build-system cmake-build-system)
    (native-inputs
     (list pkg-config))
    (inputs
     (list cairo
           bash-minimal
           fontconfig                   ;dlopen'd
           freetype
           gettext-minimal
           libice
           libsm
           libx11
           libxi
           libjpeg-turbo
           libltdl
           libpng
           libspiro
           libtiff
           libungif
           libxft
           libxml2
           pango
           potrace
           python
           zlib))
    (arguments
     (list
      #:configure-flags #~'( ;; TODO: Provide GTK+ for the Wayland-friendly GDK
                            ;; backend, instead of the legacy X11 backend.
                            ;; Currently it introduces a circular dependency.
                            "-DENABLE_X11=ON")
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'do-not-override-RPATH
            (lambda _
              ;; Do not attempt to set a default RPATH, as our ld-wrapper
              ;; already does the right thing.
              (substitute* "CMakeLists.txt"
                (("^set_default_rpath\\(\\)")
                 ""))))
          #$@(if (target-hurd?)
                 #~((add-after 'unpack 'apply-hurd-patch
                      (lambda _
                        (let ((patch-file
                               #$(local-file
                                  (search-patch "fontforge-hurd.patch"))))
                          (invoke "patch" "--force" "-p1" "-i" patch-file)))))
                 #~())
          #$@(if (system-hurd?)
                 #~((replace 'check
                      ;; cmake-build-system ignores #:make-flags for make check
                      (lambda* (#:key test-target tests? parallel-tests?
                                #:allow-other-keys)
                        (let ((skip '("test0001_py" "test0001_pyhook")))
                          (if tests?
                              (let ((jobs
                                     (if parallel-tests?
                                         (number->string (parallel-job-count))
                                         "1")))
                                (invoke "make"
                                        (string-append "ARGS=-j " jobs
                                                       " --exclude-regex ^"
                                                       (string-join skip "\\|")
                                                       "$")
                                        test-target))
                              (format #t "test suite not run~%"))))))
                 #~())
          (add-after 'install 'set-library-path
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let ((out (assoc-ref outputs "out"))
                    (potrace (dirname
                              (search-input-file inputs "bin/potrace"))))
                (wrap-program (string-append out "/bin/fontforge")
                  ;; Fontforge dynamically opens libraries.
                  `("LD_LIBRARY_PATH" ":" prefix
                    ,(map (lambda (input)
                            (string-append (assoc-ref inputs input)
                                           "/lib"))
                          '("libtiff" "libjpeg-turbo" "libpng" "libungif"
                            "libxml2" "zlib" "libspiro" "freetype"
                            "pango" "cairo" "fontconfig-minimal")))
                  ;; Checks for potrace program at runtime
                  `("PATH" ":" prefix (,potrace)))))))))
    (synopsis "Outline font editor")
    (description
     "FontForge allows you to create and modify postscript, truetype and
opentype fonts.  You can save fonts in many different outline formats, and
generate bitmaps.")
    (license license:gpl3+)
    (home-page "https://fontforge.github.io")))

(define-public python-statmake
  (package
    (name "python-statmake")
    (version "0.6.0")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/daltonmaag/statmake")
                    (commit (string-append "v" version))))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "1k6fkzyhsfkgi599sb017wzf4jzbnp5wjg1kla1b33vgjpa7n5nw"))))
    (build-system pyproject-build-system)
    (arguments
     (list
      #:test-flags
      ;; The code no longer raises <class 'ValueError'>
      '(list "-k" "not test_load_stylespace_broken_range")
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'adjust-for-older-attrs
            ;; Our older attrs package is using the 'attr' rather than 'attrs'
            ;; namespace.
            ;; TODO: Remove after python-attrs is updated to >= 21.4.0.
            (lambda _
              (substitute* "pyproject.toml"
                (("attrs = \">=21.3\"")
                 "attrs = \">=21.2\"")
                (("cattrs = \">=22.2\"")
                 "cattrs = \">=22.1\""))
              (substitute* (find-files "." "\\.py$")
                (("from attrs\\b")
                 "from attr")
                (("import attrs")
                 "import attr")
                (("@attrs")
                 "@attr")
                (("\\battrs\\.")
                 "attr.")))))))
    (native-inputs
     (list python-poetry-core
           python-pytest
           python-ufo2ft))
    (propagated-inputs
     (list python-attrs
           python-cattrs
           python-fonttools))
    (home-page "https://github.com/daltonmaag/statmake")
    (synopsis "Apply OpenType STAT information to a variable font")
    (description
     "@command{statmake} takes a user-written Stylespace that defines
@url{https://docs.microsoft.com/en-us/typography/opentype/spec/stat, OpenType
STAT information} for an entire font family and then (potentially subsets and)
applies it to a specific variable font.  This spares users from having to deal
with @url{https://github.com/fonttools/fonttools/, raw TTX dumps} and juggling
with @samp{nameIDs}.")
    (license license:expat)))

(define-public python-ufolib2
  (package
    (name "python-ufolib2")
    (version "0.13.1")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "ufoLib2" version))
       (sha256
        (base32 "0yx4i8q5rfyqhr2fj70a7z1bp1jv7bdlr64ww9z4nv9ycbda4x9j"))))
    (build-system pyproject-build-system)
    (native-inputs
     (list python-pytest
           python-setuptools
           python-setuptools-scm
           python-wheel))
    (propagated-inputs
     (list python-attrs
           python-fonttools))
    (home-page "https://github.com/fonttools/ufoLib2")
    (synopsis "Unified Font Object (UFO) font processing library")
    (description "The ufoLib2 Python library is meant to be a thin
representation of the Unified Font Object (UFO) version 3 data model, intended
for programmatic manipulation and fast batch processing of UFOs.  It resembles
the defcon library, but does without notifications, the layout engine and
other support classes.  Where useful and possible, ufoLib2 tries to be
API-compatible with defcon.")
    (license license:asl2.0)))

;;; A variant used to break a cycle between python-fontpens and
;;; python-fontparts.
(define-public python-defcon-bootstrap
  (package
    (name "python-defcon-bootstrap")
    (version "0.10.3")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "defcon" version ".zip"))
       (sha256
        (base32 "036clkwjfv5mmvy6s67s0pbni73n9hdw32z20gm4w5jzqzbjdpjn"))))
    (build-system python-build-system)
    (propagated-inputs (list python-fontpens-bootstrap python-fonttools))
    (native-inputs
     (list python-pytest
           python-pytest-runner
           python-setuptools-scm
           unzip))
    (home-page "https://github.com/robotools/defcon")
    (synopsis "Flexible objects for representing @acronym{UFO, unified font object} data")
    (description "Defcon is a set of @acronym{UFO, unified font object} based
objects optimized for use in font editing applications.  The objects are built
to be lightweight, fast and flexible.  The objects are very bare-bones and
they are not meant to be end-all, be-all objects.  Rather, they are meant to
provide base functionality so that you can focus on your application’s
behavior, not object observing or maintaining cached data.  Defcon implements
UFO3 as described by the UFO font format.")
    (license license:expat)))

(define-public python-defcon
  (hidden-package
   (package/inherit python-defcon-bootstrap
     (name "python-defcon")
     (propagated-inputs
      (modify-inputs (package-propagated-inputs python-defcon-bootstrap)
        (replace "python-fontpens-bootstrap" python-fontpens))))))

(define-public nototools
  (package
    (name "nototools")
    (version "0.2.16")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/googlefonts/nototools")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32
         "14rrdamkmhrykff8ln07fq9cm8zwj3k113lzwjcy0lgz23g51jyl"))))
    (build-system python-build-system)
    (arguments
     (list
      #:phases
      #~(modify-phases %standard-phases
          (add-before 'build 'pretend-version
            (lambda _
              (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$version)))
          (replace 'check
            (lambda* (#:key tests? #:allow-other-keys)
              (with-directory-excursion "tests"
                (invoke "./run_tests")))))))
    (native-inputs (list python-setuptools-scm))
    (propagated-inputs (list python-afdko))
    (home-page "https://github.com/googlei18n/nototools")
    (synopsis "Noto fonts support tools and scripts")
    (description
     "Nototools is a Python package containing Python scripts used to
maintain the Noto Fonts project.")
    (license (list license:asl2.0
                   ;; Sample texts are attributed to UN and OHCHR.
                   ;; The permissions on the UDHR are pretty lax:
                   ;; http://www.ohchr.org/EN/UDHR/Pages/Introduction.aspx
                   ;; "If UDHR translations or materials are reproduced, users
                   ;; should make reference to this website as a source by
                   ;; providing a link."
                   license:public-domain
                   (license:non-copyleft
                    "file://sample_texts/attributions.txt"
                    "See sample_texts/attributions.txt in the distribution.")))))

(define-public fcft
  (package
    (name "fcft")
    (version "3.1.9")
    (home-page "https://codeberg.org/dnkl/fcft")
    (source (origin
              (method git-fetch)
              (uri (git-reference (url home-page) (commit version)))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "0j127fk5v2nlk5s0gibympcnzjyzfk5dwgz524gvlczfh7cbm18g"))))
    (build-system meson-build-system)
    (native-inputs
     (list check pkg-config scdoc))
    (propagated-inputs
     (list ;; Required by fcft.pc.
           utf8proc
           fontconfig
           freetype
           harfbuzz
           pixman
           tllist))
    (synopsis "Font loading and glyph rasterization library")
    (description
     "@code{fcft} is a small font loading and glyph rasterization library
built on-top of FontConfig, FreeType2 and pixman.

It can load and cache fonts from a fontconfig-formatted name string, e.g.
@code{Monospace:size=12}, optionally with user configured fallback fonts.

After a font has been loaded, you can rasterize glyphs.  When doing so, the
primary font is first considered.  If it does not have the requested glyph,
the user configured fallback fonts (if any) are considered.  If none of the
user configured fallback fonts has the requested glyph, the FontConfig
generated list of fallback fonts are checked.")
    ;; The code is distributed under the Expat license, but embeds Unicode
    ;; data files carrying the Unicode license.
    (license (list license:expat license:unicode))))

(define-public fontmanager
  (package
   (name "fontmanager")
   (version "0.8.7")
   (source
    (origin
      (method git-fetch)
      (uri (git-reference
            (url "https://github.com/FontManager/font-manager")
            (commit version)))
      (file-name (git-file-name name version))
      (sha256
       (base32 "0nyda2a6vbzyz4sn9mmrr8bkifzxmmjp7x9a3c4s6n925ccy79cn"))))
   (build-system meson-build-system)
   (arguments
    `(#:glib-or-gtk? #t
      #:build-type "release"
      #:configure-flags
      (list (string-append "-Dc_link_args=-Wl,-rpath="
                           (assoc-ref %outputs "out")
                           "/lib/font-manager"))))
   (native-inputs
    `(("desktop-file-utils" ,desktop-file-utils)
      ("gettext" ,gettext-minimal)
      ("glib" ,glib "bin")
      ("gobject-introspection" ,gobject-introspection)
      ("pkg-config" ,pkg-config)
      ("python-wrapper" ,python-wrapper)
      ("vala" ,vala-0.52)
      ("yelp-tools" ,yelp-tools)))
   (inputs
    `(("fonconfig" ,fontconfig)
      ("freetype" ,freetype)
      ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
      ("gtk+" ,gtk+)
      ("json-glib" ,json-glib)
      ("libsoup" ,libsoup-minimal-2)
      ("sqlite" ,sqlite)
      ("webkitgtk" ,webkitgtk-with-libsoup2)))
   (home-page "https://fontmanager.github.io/")
   (synopsis "Simple font management for GTK+ desktop environments")
   (description "Font Manager is intended to provide a way for users to
easily manage desktop fonts, without having to resort to command-line
tools or editing configuration files by hand.
While designed primarily with the GNOME Desktop Environment in mind, it should
work well with other GTK+ desktop environments.")
   (license license:gpl3+)))

(define-public fntsample
  (package
    (name "fntsample")
    (version "5.4")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                     (url "https://github.com/eugmes/fntsample")
                     (commit (string-append "release/" version))))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "0pcqqdriv6hq64zrqd9vhdd9p2vhimjnajcxdz10qnqgrkmm751v"))))
    (build-system cmake-build-system)
    (arguments
     `(#:tests? #f ; There are no tests.
       #:configure-flags
       (list (string-append
              "-DUNICODE_BLOCKS=" (assoc-ref %build-inputs "unicode-blocks")))
       #:phases
       (modify-phases %standard-phases
         (add-after 'install 'set-library-path
           (lambda* (#:key inputs outputs #:allow-other-keys)
             (let* ((out      (assoc-ref outputs "out"))
                    (pdf-api2 (assoc-ref inputs "perl-pdf-api2"))
                    (intl     (assoc-ref inputs "perl-libintl-perl"))
                    (perllib  (string-append pdf-api2
                                             "/lib/perl5/site_perl/"
                                             ,(package-version perl)
                                             ":" intl
                                             "/lib/perl5/site_perl/"
                                             ,(package-version perl))))
               (wrap-program (string-append out "/bin/pdfoutline")
                 `("PERL5LIB" ":" prefix (,perllib)))))))))
    (native-inputs
     `(("pkg-config" ,pkg-config)
       ("gettext" ,gettext-minimal)))
    (inputs
     `(("cairo" ,cairo)
       ("bash-minimal", bash-minimal)
       ("fontconfig" ,fontconfig)
       ("freetype" ,freetype)
       ("glib" ,glib)
       ("pango" ,pango)
       ("perl-pdf-api2" ,perl-pdf-api2)
       ("perl-libintl-perl" ,perl-libintl-perl)
       ("unicode-blocks"
        ,(let ((version "14.0.0"))
           (origin
             (method url-fetch)
             (uri (string-append "https://unicode.org/Public/"
                                 version "/ucd/Blocks.txt"))
             (file-name (string-append "unicode-blocks-" version ".txt"))
             (sha256
              (base32
               "05vzgrvfp35mgxjgkm4wnxjjgzva8n6545i9jxd4pczpvvfp122r")))))))
    (home-page "https://github.com/eugmes/fntsample")
    (synopsis "PDF and PostScript font samples generator")
    (description "This package provides a tool that can be used to make font
samples that show coverage of the font and are similar in appearance to
Unicode Charts.  It was developed for use with DejaVu Fonts project.")
    (license license:gpl3+)))

(define-public libraqm
  (package
    (name "libraqm")
    (version "0.10.1")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/HOST-Oman/libraqm")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1bzdrvacgj9629r4mgmag9sm5ay5914fbs8pnxf8xphvrbnbxm8z"))))
    (build-system meson-build-system)
    (native-inputs
     (list gtk-doc/stable pkg-config python-wrapper))
    (inputs
     (list freetype fribidi harfbuzz))
    (home-page "https://github.com/HOST-Oman/libraqm")
    (synopsis "Library for complex text layout")
    (description
     "Raqm is a small library that encapsulates the logic for complex text
layout and provides a convenient API.

It currently provides bidirectional text support (using FriBiDi),
shaping (using HarfBuzz), and proper script itemization.  As a result, Raqm
can support most writing systems covered by Unicode.")
    (license license:expat)))


(define-public fontopia
  (package
    (name "fontopia")
    (version "2.0")
    (source (origin
             (method url-fetch)
             (uri (string-append "mirror://gnu/fontopia/fontopia-"
                                 version ".tar.gz"))
             (sha256
              (base32 "0wv7bd7gdm1ma4xgq9av73ic3xhpwyszj6g6c6311xjk26xm9ahd"))))
    (build-system gnu-build-system)
    (inputs
     (list gnudos))
    (home-page "https://www.gnu.org/software/fontopia/")
    (synopsis "Text-based, console font editor")
    (description
     "GNU fontopia is an easy-to-use, text-based, console font editor.  You can
edit the fonts that your GNU/Linux kernel is using to display your text on text-
based (vs graphical) terminals.")
    (license license:gpl3+)))


(define-public lcdf-typetools
  (package
    (name "lcdf-typetools")
    (version "2.108")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                     (url "https://github.com/kohler/lcdf-typetools")
                     (commit (string-append "v" version))))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "0a6jqaqwq43ldjjjlnsh6mczs2la9363qav7v9fyrfzkfj8kw9ad"))))
    (build-system gnu-build-system)
    (arguments
     `(#:configure-flags
       ;; This is only provided by the monolithic texlive distribution.
       ;; FIXME: texlive-kpathsea doesn't come with the library and headers
       (list "--without-kpathsea")))
    (native-inputs
     (list autoconf automake))
    (home-page "https://lcdf.org/type/")
    (synopsis "Multiple font manipulation tools")
    (description "LCDF Typetools comprises several programs for manipulating
PostScript Type 1, Type 1 Multiple Master, OpenType, and TrueType fonts.
These tools are cfftot1, mmafm, mmpfb, otfinfo, otftotfm, t1dotlessj, t1lint,
t1rawfm, t1reencode, t1testpage and ttftotype42.")
    (license license:gpl2+)))

(define-public bdf2sfd
  (package
    (name "bdf2sfd")
    (version "1.1.8")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/fcambus/bdf2sfd")
                    (commit "1.1.8")))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "0pa92gjiijp9xqnw9dcvz24s6qk11a4lp5q6s5psd6mpkhpd88zq"))))
    (build-system cmake-build-system)
    (home-page "https://github.com/fcambus/bdf2sfd")
    (synopsis "BDF to SFD converter, allowing to vectorize bitmap fonts")
    (description
     "bdf2sfd is a
@uref{https://en.wikipedia.org/wiki/Glyph_Bitmap_Distribution_Format,
BDF} to @uref{https://fontforge.org/docs/techref/sfdformat.html, SFD}
converter, allowing to vectorize bitmap fonts.  It works by converting
each pixel of a glyph to a polygon, which produces large and
unoptimized SFD files that should be post-processed using
@uref{https://fontforge.org, FontForge}.")
    (license license:bsd-2)))
age (name "sqlcrush") (version (git-version "0.1.5" revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/coffeeandscripts/sqlcrush") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 "0x2q4m9ryw68kifalnm3x4bv9v2xrc2ffsiap8m9wnw6lf1h05la")))) (build-system python-build-system) (inputs (list python-psycopg2 python-pymysql python-sqlalchemy)) (home-page "https://github.com/coffeeandscripts/sqlcrush") (synopsis "Text console-based database viewer and editor") (description "SQLcrush lets you view and edit a database directly from the text console through an ncurses interface. You can explore each table's structure, browse and edit the contents, add and delete entries, all while tracking your changes.") (license license:gpl3+)))) ; no headers, see README.md (define-public tdb (package (name "tdb") (version "1.4.7") (source (origin (method url-fetch) (uri (string-append "https://www.samba.org/ftp/tdb/tdb-" version ".tar.gz")) (sha256 (base32 "03n2hz4sv003gpkyp57hk5kiw4xk9f2dkxq75kzk2gskxy6idyx4")))) (build-system gnu-build-system) (arguments '(#:phases (modify-phases %standard-phases (replace 'configure (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) ;; The 'configure' script is a wrapper for Waf and ;; doesn't recognize things like '--enable-fast-install'. (invoke "./configure" (string-append "--prefix=" out)))))))) (native-inputs (list docbook-xsl libxcrypt libxslt python ;for the Waf build system which)) (home-page "https://tdb.samba.org/") (synopsis "Trivial database") (description "TDB is a Trivial Database. In concept, it is very much like GDBM, and BSD's DB except that it allows multiple simultaneous writers and uses locking internally to keep writers from trampling on each other. TDB is also extremely small.") (license license:lgpl3+))) (define-public perl-dbi (package (name "perl-dbi") (version "1.643") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/T/TI/TIMB/DBI-" version ".tar.gz")) (sha256 (base32 "1yinx39960y241vf2sknxj0dfz82a5m9gvklq5rw78k0nlyrjawa")))) (build-system perl-build-system) (synopsis "Database independent interface for Perl") (description "This package provides a database interface for Perl.") (home-page "https://metacpan.org/release/DBI") (license license:perl-license))) (define-public perl-dbix-class (package (name "perl-dbix-class") (version "0.082843") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/" "DBIx-Class-" version ".tar.gz")) (sha256 (base32 "0lgjw7z4y2inf3yyfph1ljdp4f5zdmy9vh56fj8w9n19rdp0n7il")))) (build-system perl-build-system) (native-inputs (list perl-dbd-sqlite perl-module-install perl-package-stash perl-test-deep perl-test-exception perl-test-warn)) (propagated-inputs (list perl-class-accessor-grouped perl-class-c3-componentised perl-class-inspector perl-config-any perl-context-preserve perl-data-dumper-concise perl-data-page perl-dbi perl-devel-globaldestruction perl-hash-merge perl-module-find perl-moo-2 perl-mro-compat perl-namespace-clean perl-path-class perl-scope-guard perl-sql-abstract-classic perl-sub-name perl-try-tiny)) (home-page "https://metacpan.org/release/DBIx-Class") (synopsis "Extensible and flexible object <-> relational mapper") (description "An SQL to OO mapper with an object API inspired by Class::DBI (with a compatibility layer as a springboard for porting) and a resultset API that allows abstract encapsulation of database operations. It aims to make representing queries in your code as perl-ish as possible while still providing access to as many of the capabilities of the database as possible, including retrieving related records from multiple tables in a single query, \"JOIN\", \"LEFT JOIN\", \"COUNT\", \"DISTINCT\", \"GROUP BY\", \"ORDER BY\" and \"HAVING\" support.") (properties ;; This is needed for perl-catalyst-authentication-store-dbix-class `((updater-extra-propagated-inputs . ("perl-data-page")))) (license license:perl-license))) (define-public perl-dbix-class-cursor-cached (package (name "perl-dbix-class-cursor-cached") (version "1.001004") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/A/AR/ARCANEZ/" "DBIx-Class-Cursor-Cached-" version ".tar.gz")) (sha256 (base32 "09b2jahn2x12qm4f7qm1jzsxbz7qn1czp6a3fnl5l2i3l4r5421p")))) (build-system perl-build-system) (native-inputs (list perl-cache-cache perl-dbd-sqlite perl-module-install)) (propagated-inputs (list perl-carp-clan perl-dbix-class)) (home-page "https://metacpan.org/release/DBIx-Class-Cursor-Cached") (synopsis "Cursor with built-in caching support") (description "DBIx::Class::Cursor::Cached provides a cursor class with built-in caching support.") (license license:perl-license))) (define-public perl-dbix-class-introspectablem2m (package (name "perl-dbix-class-introspectablem2m") (version "0.001002") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/" "DBIx-Class-IntrospectableM2M-" version ".tar.gz")) (sha256 (base32 "1w47rh2241iy5x3a9bqsyd5kdp9sk43dksr99frzv4qn4jsazfn6")))) (build-system perl-build-system) (native-inputs (list perl-module-install)) (propagated-inputs (list perl-dbix-class)) (home-page "https://metacpan.org/release/DBIx-Class-IntrospectableM2M") (synopsis "Introspect many-to-many relationships") (description "Because the many-to-many relationships are not real relationships, they can not be introspected with DBIx::Class. Many-to-many relationships are actually just a collection of convenience methods installed to bridge two relationships. This DBIx::Class component can be used to store all relevant information about these non-relationships so they can later be introspected and examined.") (license license:perl-license))) (define-public perl-dbix-class-schema-loader (package (name "perl-dbix-class-schema-loader") (version "0.07049") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/" "DBIx-Class-Schema-Loader-" version ".tar.gz")) (sha256 (base32 "0r57fv71ypxafb85cpxph1hdqii7ipjwvc19yb6fpkvq2ggcssg8")))) (build-system perl-build-system) (native-inputs (list perl-config-any perl-config-general perl-dbd-sqlite perl-dbix-class-introspectablem2m perl-module-install perl-moose perl-moosex-markasmethods perl-moosex-nonmoose perl-namespace-autoclean perl-test-deep perl-test-differences perl-test-exception perl-test-pod perl-test-warn)) (propagated-inputs (list perl-class-unload perl-class-inspector perl-class-accessor-grouped perl-class-c3-componentised perl-carp-clan perl-data-dump perl-dbix-class perl-hash-merge perl-list-moreutils perl-lingua-en-inflect-phrase perl-lingua-en-inflect-number perl-lingua-en-tagger perl-namespace-clean perl-mro-compat perl-scope-guard perl-string-camelcase perl-string-toidentifier-en perl-sub-name perl-try-tiny)) (arguments `(#:tests? #f)) ;TODO: t/20invocations.t fails (home-page "https://metacpan.org/release/DBIx-Class-Schema-Loader") (synopsis "Create a DBIx::Class::Schema based on a database") (description "DBIx::Class::Schema::Loader automates the definition of a DBIx::Class::Schema by scanning database table definitions and setting up the columns, primary keys, unique constraints and relationships.") (license license:perl-license))) (define-public perl-dbix-class-deploymenthandler (package (name "perl-dbix-class-deploymenthandler") (version "0.002233") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/M/MM/MMCCLIMON/DBIx-Class-DeploymentHandler-" version ".tar.gz")) (sha256 (base32 "1bikp1q3pm1xphfdr8kmsqvzzpk06an3112mhb6gl8vlpg81ch4m")))) (build-system perl-build-system) (native-inputs (list perl-aliased perl-dbd-sqlite perl-dbix-class-schema-loader perl-test-fatal perl-test-most perl-test-requires)) (propagated-inputs (list perl-carp-clan perl-context-preserve perl-dbix-class perl-log-contextual perl-module-runtime perl-moose perl-moosex-role-parameterized perl-namespace-autoclean perl-path-class perl-sql-splitstatement perl-sql-translator perl-sub-exporter-progressive perl-sub-quote perl-text-brew perl-try-tiny perl-yaml)) (home-page "https://metacpan.org/release/DBIx-Class-DeploymentHandler") (synopsis "Extensible DBIx::Class deployment") (description "@code{DBIx::Class::DeploymentHandler} is a tool for deploying and upgrading databases with @code{DBIx::Class}. It is designed to be much more flexible than @code{DBIx::Class::Schema::Versioned}, hence the use of Moose and lots of roles.") (license license:perl-license))) (define-public perl-dbix-simple (package (name "perl-dbix-simple") (version "1.37") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/J/JU/JUERD/DBIx-Simple-" version ".tar.gz")) (sha256 (base32 "1qyaj01zb6xplzcp7pj0b9609fvd89c9c4an3i00g2g05jm13ls6")))) (build-system perl-build-system) (propagated-inputs (list perl-dbi)) (home-page "https://metacpan.org/release/DBIx-Simple") (synopsis "Object-oriented interface to DBI") (description "DBIx::Simple provides a simplified interface to DBI, Perl's powerful database module. This module is aimed at rapid development and easy maintenance. Query preparation and execution are combined in a single method, the result object (which is a wrapper around the statement handle) provides easy row-by-row and slurping methods.") ;; The POD info says: "Pick your favorite OSI-approved license" ;; Use unlicense because it has the least restrictions. (license license:unlicense))) (define-public perl-dbicx-testdatabase (package (name "perl-dbicx-testdatabase") (version "0.05") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/J/JR/JROCKWAY/DBICx-TestDatabase-" version ".tar.gz")) (sha256 (base32 "1kqaiygxiarrqkgqbq1s3xilx77msbdsqrdaqf4628811d9w4fwf")))) (build-system perl-build-system) (native-inputs (list perl-dbix-class perl-module-install)) (propagated-inputs (list perl-dbd-sqlite perl-sql-translator)) (home-page "https://metacpan.org/release/DBICx-TestDatabase") (synopsis "Create a temporary database from a DBIx::Class::Schema") (description "This module creates a temporary SQLite database, deploys a DBIC schema, and then connects to it. This lets you easily test DBIC schema. Since you have a fresh database for every test, you don't have to worry about cleaning up after your tests, ordering of tests affecting failure, etc.") (license license:perl-license))) (define-public perl-dbix-class-dynamicdefault (package (name "perl-dbix-class-dynamicdefault") (version "0.04") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/M/MS/MSTROUT/DBIx-Class-DynamicDefault-" version ".tar.gz")) (sha256 (base32 "1yssda00988hn9v96jl95apbzib74vgbcgf69m5mhhj64amm33r2")))) (build-system perl-build-system) (native-inputs (list perl-dbicx-testdatabase perl-module-install)) (propagated-inputs (list perl-dbix-class)) (home-page "https://metacpan.org/release/DBIx-Class-DynamicDefault") (synopsis "Automatically set and update fields") (description "Automatically set and update fields with values calculated at runtime. Ipdate or create actions will set the specified columns to the value returned by the callback you specified as a method name or code reference.") (license license:perl-license))) (define-public perl-dbix-class-timestamp (package (name "perl-dbix-class-timestamp") (version "0.14") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/DBIx-Class-TimeStamp-" version ".tar.gz")) (sha256 (base32 "1zhr4r5ffihqsh2imap7zmps2y0h71piqqhg2nqhcwkjhvlxb958")))) (build-system perl-build-system) (native-inputs (list perl-class-accessor-grouped perl-datetime-format-mysql perl-datetime-format-sqlite perl-dbd-sqlite perl-module-install perl-test-pod perl-time-warp)) (propagated-inputs (list perl-datetime perl-dbix-class perl-dbix-class-dynamicdefault)) (home-page "https://metacpan.org/release/DBIx-Class-TimeStamp") (synopsis "DBIx::Class extension to update and create date and time based fields") (description "This package works in conjunction with @code{InflateColumn::DateTime} to automatically set update and create date and time based fields in a table.") (license license:perl-license))) (define-public perl-dbd-pg (package (name "perl-dbd-pg") (version "3.15.1") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/T/TU/TURNSTEP/" "DBD-Pg-" version ".tar.gz")) (sha256 (base32 "0zn17xb6bmixkmv53p576igzw1jd43cwql35r19m56jwahxm9iqk")))) (build-system perl-build-system) (native-inputs (list perl-dbi)) (propagated-inputs (list perl-dbi postgresql)) (home-page "https://metacpan.org/release/DBD-Pg") (synopsis "DBI PostgreSQL interface") (description "This package provides a PostgreSQL driver for the Perl5 @dfn{Database Interface} (DBI).") (license license:perl-license))) (define-public perl-dbd-mysql (package (name "perl-dbd-mysql") (version "4.050") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/D/DV/DVEEDEN/" "DBD-mysql-" version ".tar.gz")) (sha256 (base32 "0y4djb048i09dk19av7mzfb3khr72vw11p3ayw2p82jsy4gm8j2g")))) (build-system perl-build-system) (arguments `(#:phases (modify-phases %standard-phases (add-before 'configure 'skip-library-detection ;; Avoid depencies on perl-devel-checklib, openssl, and zlib. They ;; are really only needed for the test suite; their absence does not ;; affect the build or the end result. (lambda _ (substitute* "Makefile.PL" (("use Devel::CheckLib;" match) (string-append "# " match)) (("assert_lib") "print")) #t))) ;; Tests require running MySQL server. #:tests? #f)) (propagated-inputs `(("perl-dbi" ,perl-dbi) ("mysql" ,mariadb "lib") ("mysql-dev" ,mariadb "dev"))) (home-page "https://metacpan.org/release/DBD-mysql") (synopsis "DBI MySQL interface") (description "This package provides a MySQL driver for the Perl5 @dfn{Database Interface} (DBI).") (license license:perl-license))) (define-public perl-dbd-sqlite (package (name "perl-dbd-sqlite") (version "1.66") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/I/IS/ISHIGAKI/DBD-SQLite-" version ".tar.gz")) (sha256 (base32 "1zljln5nh61gj3k22a1fv2vhx5l83waizmarwkh77hk6kzzmvrw9")))) (build-system perl-build-system) (inputs (list sqlite)) (propagated-inputs (list perl-dbi)) (synopsis "SQlite interface for Perl") (description "DBD::SQLite is a Perl DBI driver for SQLite, that includes the entire thing in the distribution. So in order to get a fast transaction capable RDBMS working for your Perl project you simply have to install this module, and nothing else.") (license license:perl-license) (home-page "https://metacpan.org/release/DBD-SQLite"))) (define-public perl-mysql-config (package (name "perl-mysql-config") (version "1.04") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/D/DA/DARREN/MySQL-Config-" version ".tar.gz")) (sha256 (base32 "1svn7ccw2gc4cazvc58j84rxhnc9vs01zpird0l8460598j475qr")))) (build-system perl-build-system) (home-page "https://metacpan.org/release/MySQL-Config") (synopsis "Parse and utilize MySQL's /etc/my.cnf and ~/.my.cnf files") (description "@code{MySQL::Config} emulates the @code{load_defaults} function from libmysqlclient. It will fill an array with long options, ready to be parsed by @code{Getopt::Long}.") (license license:perl-license))) (define-public perl-sql-abstract (package (name "perl-sql-abstract") (version "1.87") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/I/IL/ILMARI/" "SQL-Abstract-" version ".tar.gz")) (sha256 (base32 "0jhw91b23wc9bkfwcgvka4x5ddxk58m9bcp5ay7a3vx77nla09p9")))) (build-system perl-build-system) (native-inputs (list perl-module-install perl-test-deep perl-test-exception perl-test-warn)) (propagated-inputs (list perl-hash-merge perl-moo perl-mro-compat perl-text-balanced)) (home-page "https://metacpan.org/release/SQL-Abstract") (synopsis "Generate SQL from Perl data structures") (description "This module was inspired by the excellent DBIx::Abstract. While based on the concepts used by DBIx::Abstract, the concepts used have been modified to make the SQL easier to generate from Perl data structures. The underlying idea is for this module to do what you mean, based on the data structures you provide it, so that you don't have to modify your code every time your data changes.") (license license:perl-license))) (define-public perl-sql-abstract-classic (package (name "perl-sql-abstract-classic") (version "1.91") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/R/RI/RIBASUSHI/" "SQL-Abstract-Classic-" version ".tar.gz")) (sha256 (base32 "0a7g13hs3kdxrjn43sfli09mgsi9d6w0dfw6hlk268av17yisgaf")))) (build-system perl-build-system) (native-inputs (list perl-test-deep perl-test-exception perl-test-warn)) (propagated-inputs (list perl-mro-compat perl-sql-abstract)) (home-page "https://metacpan.org/release/SQL-Abstract-Classic") (synopsis "Generate SQL from Perl data structures") (description "This module is nearly identical to @code{SQL::Abstract} 1.81, and exists to preserve the ability of users to opt into the new way of doing things in later versions according to their own schedules. It is an abstract SQL generation module based on the concepts used by @code{DBIx::Abstract}, with several important differences, especially when it comes to @code{WHERE} clauses. These concepts were modified to make the SQL easier to generate from Perl data structures. The underlying idea is for this module to do what you mean, based on the data structures you provide it. You shouldn't have to modify your code every time your data changes, as this module figures it out.") (license license:perl-license))) (define-public perl-sql-splitstatement (package (name "perl-sql-splitstatement") (version "1.00023") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/V/VE/VEESH/" "SQL-SplitStatement-" version ".tar.gz")) (sha256 (base32 "0ppkx46nydzlnsxf9a8pkyb74wggfrdiiwafab143lrarlh88x0s")))) (build-system perl-build-system) (native-inputs (list perl-test-differences perl-test-exception perl-test-script)) (propagated-inputs (list perl-class-accessor perl-list-moreutils perl-regexp-common perl-sql-tokenizer)) (home-page "https://metacpan.org/release/SQL-SplitStatement") (synopsis "Split SQL code into atomic statements") (description "This module tries to split any SQL code, even including non-standard extensions, into the atomic statements it is composed of.") (license license:perl-license))) (define-public perl-sql-tokenizer (package (name "perl-sql-tokenizer") (version "0.24") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/I/IZ/IZUT/" "SQL-Tokenizer-" version ".tar.gz")) (sha256 (base32 "1qa2dfbzdlr5qqdam9yn78z5w3al5r8577x06qan8wv58ay6ka7s")))) (build-system perl-build-system) (home-page "https://metacpan.org/release/SQL-Tokenizer") (synopsis "SQL tokenizer") (description "SQL::Tokenizer is a tokenizer for SQL queries. It does not claim to be a parser or query verifier. It just creates sane tokens from a valid SQL query.") (license license:perl-license))) (define-public perl-sql-translator (package (name "perl-sql-translator") (version "1.63") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/V/VE/VEESH/SQL-Translator-" version ".tar.gz")) (sha256 (base32 "0cric118ms3dcnb3m2a1jdhdxmai8wwp5jbx34mf72s9jd6b11aq")))) (build-system perl-build-system) (native-inputs (list perl-file-sharedir-install perl-json-maybexs perl-test-differences perl-test-exception perl-test-most perl-xml-writer perl-yaml)) (propagated-inputs (list perl-carp-clan perl-dbi perl-file-sharedir perl-gd perl-graph perl-graphviz perl-moo perl-package-variant perl-parse-recdescent perl-spreadsheet-parseexcel perl-strictures-2 perl-sub-quote perl-template-toolkit perl-text-recordparser perl-try-tiny perl-xml-libxml)) (home-page "https://metacpan.org/release/SQL-Translator") (synopsis "Manipulate structured data definitions (SQL and more)") (description "@code{SQL::Translator} is a group of Perl modules that converts vendor-specific SQL table definitions into other formats, such as other vendor-specific SQL, ER diagrams, documentation (POD and HTML), XML, and @code{Class::DBI} classes. The main focus is SQL, but parsers exist for other structured data formats, including Excel spreadsheets and arbitrarily delimited text files. Through the separation of the code into parsers and producers with an object model in between, it's possible to combine any parser with any producer, to plug in custom parsers or producers, or to manipulate the parsed data via the built-in object model. Presently only the definition parts of SQL are handled (CREATE, ALTER), not the manipulation of data (INSERT, UPDATE, DELETE).") (license license:perl-license))) (define-public perl-test-postgresql (package (name "perl-test-postgresql") (version "1.29") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/T/TJ/TJC/Test-PostgreSQL-" version ".tar.gz")) (sha256 (base32 "17jgiqdyprb8q4855anica2kr0lxdi9rnq27vsfclk6ai7jzgb0q")))) (build-system perl-build-system) (arguments (list #:tests? #f)) ;2/41 fail, require running Postgres server (native-inputs (list perl-module-build-tiny perl-test-sharedfork)) (propagated-inputs (list perl-dbd-pg perl-dbi perl-file-which perl-function-parameters perl-moo perl-tie-hash-method perl-try-tiny perl-type-tiny)) (home-page "https://metacpan.org/release/Test-PostgreSQL") (synopsis "PostgreSQL runner for tests") (description "@code{Test::PostgreSQL} automatically setups a PostgreSQL instance in a temporary directory, and destroys it when the perl script exits.") (license license:artistic2.0))) (define-public unixodbc (package (name "unixodbc") (version "2.3.9") (source (origin (method url-fetch) (uri (string-append "ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-" version ".tar.gz")) (sha256 (base32 "01xj65d02i3yjy7p9z08y9jakcs5szmz4rask868n7387nn3x0sj")))) (build-system gnu-build-system) (synopsis "Data source abstraction library") (description "Unixodbc is a library providing an API with which to access data sources. Data sources include SQL Servers and any software with an ODBC Driver.") (license license:lgpl2.1+) ;; COPYING contains copy of lgpl2.1 - but copyright notices just say "LGPL" (home-page "https://www.unixodbc.org"))) (define-public nanodbc (package (name "nanodbc") (version "2.14.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/nanodbc/nanodbc") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "1253bnrmchga3ra99jqkd2p29bc5h2ip79xd8afblz6b1v00wmbm")))) (build-system cmake-build-system) (arguments `(#:configure-flags ;; The tests require ODBC backends to be installed. (list "-DNANODBC_DISABLE_TESTS=ON" "-DBUILD_SHARED_LIBS=ON") #:tests? #false)) (inputs (list unixodbc)) (home-page "https://nanodbc.io/") (synopsis "C++ wrapper for the native C ODBC API") (description "The goal for nanodbc is to make developers happy by providing a simpler and less verbose API for working with ODBC. Common tasks should be easy, requiring concise and simple code.") (license license:expat))) (define-public nanodbc-for-irods (package (inherit nanodbc) (arguments `(#:tests? #false #:configure-flags '("-DBUILD_SHARED_LIBS=ON" ;; The tests require ODBC backends to be installed. "-DNANODBC_DISABLE_TESTS=ON" "-DCMAKE_CXX_COMPILER=clang++" "-DCMAKE_CXX_FLAGS=-stdlib=libc++" "-DCMAKE_EXE_LINKER_FLAGS=-lc++abi") #:phases (modify-phases %standard-phases (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH (lambda* (#:key inputs #:allow-other-keys) (let ((gcc (assoc-ref inputs "gcc"))) (setenv "CPLUS_INCLUDE_PATH" (string-join (cons (string-append (assoc-ref inputs "libcxx") "/include/c++/v1") ;; Hide GCC's C++ headers so that they do not interfere with ;; the Clang headers. (delete (string-append gcc "/include/c++") (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))) ":")) (format #true "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%" (getenv "CPLUS_INCLUDE_PATH")))))))) (properties `((hidden? . #true))) (inputs `(("unixodbc" ,unixodbc) ("libcxx" ,libcxx+libcxxabi-6) ("libcxxabi" ,libcxxabi-6) ("clang" ,clang-6))))) (define-public unqlite (package (name "unqlite") (version "1.1.6") (source (origin (method url-fetch) ;; Contains bug fixes against the official release, and has an ;; autotooled build system. (uri (string-append "https://github.com/aidin36/tocc/releases/" "download/v1.0.0/" "unqlite-unofficial-" version ".tar.gz")) (sha256 (base32 "1sbpvhg15gadq0mpcy16q7k3rkg4b4dicpnn5xifpkpn02sqik3s")))) (build-system gnu-build-system) (arguments `(#:tests? #f)) ;No check target (home-page "https://www.unqlite.org") (synopsis "In-memory key/value and document store") (description "UnQLite is an in-process software library which implements a self-contained, serverless, zero-configuration, transactional NoSQL database engine. UnQLite is a document store database similar to Redis, CouchDB, etc., as well as a standard key/value store similar to BerkeleyDB, LevelDB, etc.") (license license:bsd-2))) ;; NOTE: When upgrading redis, make sure that redis is still released ;; under a Free Software license. (define-public redis (package (name "redis") (version "7.2.6") (source (origin (method url-fetch) (uri (string-append "https://download.redis.io/releases/redis-" version".tar.gz")) (sha256 (base32 "03ixkzdc43lr4q3my0yax1f1gqz6sr6hch5qdipmbd725xxdc47v")) (modules '((guix build utils))) (snippet ;; Delete bundled jemalloc, as the package will use the libc one '(begin (delete-file-recursively "deps/jemalloc"))))) (build-system gnu-build-system) (arguments (list #:make-flags #~(list (string-append "CC=" #$(cc-for-target)) "MALLOC=libc" "LDFLAGS=-ldl" (string-append "PREFIX=" #$output)) #:phases #~(modify-phases %standard-phases (delete 'configure) (add-after 'unpack 'patch-paths (lambda _ (substitute* "runtest" (("^TCLSH=.*") (string-append "TCLSH=" (which "tclsh")))) (substitute* "tests/support/server.tcl" (("/usr/bin/env") (which "env"))))) (add-after 'unpack 'adjust-tests (lambda _ ;; Disable failing tests. (substitute* "tests/test_helper.tcl" ;; The AOF tests cause the test suite to hang waiting for a ;; "background AOF rewrite to finish", perhaps because dead ;; processes persist as zombies in the build environment. (("unit/aofrw") "") (("integration/aof([^-]|-multi-part)") "") ;; The OOM score tests try to raise the current OOM score, but ;; our build environment already sets it for all children to ;; the highest possible one (1000). We can't lower it because ;; we don't have CAP_SYS_RESOURCE. (("unit/oom-score-adj") "") (("integration/failover") "") (("integration/replication[^-]") ""))))))) (native-inputs (list pkg-config procps tcl which)) (synopsis "Key-value cache and store") (description "Redis is an advanced key-value cache and store. Redis supports many data structures including strings, hashes, lists, sets, sorted sets, bitmaps and hyperloglogs.") (home-page "https://redis.io/") ;; These two CVEs have long been fixed. (properties `((lint-hidden-cve . ("CVE-2022-3647" "CVE-2022-33105")))) (license license:bsd-3))) (define-public hiredis (package (name "hiredis") (version "1.1.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/redis/hiredis") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "1zld30j3kpzqr9w3vkpd6mm3f1b1yk3dlgp9lp6gpsybjjfr2i6h")))) (build-system cmake-build-system) (native-inputs ;; needed for testing (list redis)) (synopsis "Minimalistic C client library for the Redis database") (description "This package provides a library for sending commands and receiving replies to and from a Redis server. It comes with a synchronous API, asynchronous API and reply parsing API. Only the binary-safe Redis protocol is supported.") (home-page "https://github.com/redis/hiredis") (license license:bsd-3))) (define-public ruby-hiredis (package (name "ruby-hiredis") (version "0.6.3") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/redis/hiredis-rb") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "05y4g7frhym59m9x208zpvg2qvqvfjlgqmygxj8sqgl07n0ww1ks")) (patches (search-patches "ruby-hiredis-use-system-hiredis.patch")))) (build-system ruby-build-system) (arguments (list #:tests? #f ;require native extension #:phases #~(modify-phases %standard-phases (add-after 'unpack 'patch-hiredis-include-directory (lambda* (#:key inputs #:allow-other-keys) (substitute* "ext/hiredis_ext/extconf.rb" ;; Adjust the hiredis include directory. (("\\$CFLAGS << \" -I/usr/include/hiredis\"") (format #f "$CFLAGS << \" -I~a\"" (search-input-directory inputs "include/hiredis")))))) (add-after 'unpack 'disable-building-c-extension (lambda _ ;; FIXME: The produced native extension appears to segfault when ;; run; disable building it until a solution is found (see: ;; https://github.com/redis/hiredis-rb/issues/93). (substitute* "ext/hiredis_ext/extconf.rb" (("build_hiredis = true") "build_hiredis = false")))) ;; FIXME: Un-comment phase after the extension can be made to run ;; without crashing (see above). ;; (add-after 'build 'build-ext ;; (lambda _ ;; (setenv "CC" #$(cc-for-target)) ;; (invoke "rake" "compile"))) (add-before 'check 'start-redis (lambda _ (invoke "redis-server" "--daemonize" "yes"))) (add-after 'install 'delete-mkmf.log (lambda _ ;; This build log captures non-deterministic file names (see: ;; https://github.com/rubygems/rubygems/issues/6259). (for-each delete-file (find-files #$output "^mkmf\\.log$"))))))) (native-inputs (list redis ruby-rake-compiler)) (inputs (list hiredis)) (synopsis "Ruby wrapper for hiredis") (description "@code{hiredis-rb} is a Ruby extension that wraps @code{hiredis}, a minimalist C client for Redis. Both the synchronous connection API and a separate protocol reader are supported. It is primarily intended to speed up parsing multi bulk replies.") (home-page "https://github.com/redis/hiredis-rb") (license license:bsd-3))) (define-public ruby-redis (package (name "ruby-redis") (version "4.2.5") (source (origin (method url-fetch) (uri (rubygems-uri "redis" version)) (sha256 (base32 "15x2sr6h094rjbvg8pkq6m3lcd5abpyx93aifvfdz3wv6x55xa48")))) (build-system ruby-build-system) (arguments `(#:tests? #f)) ; Tests require a running redis server. (synopsis "Ruby client for Redis' API") (description "This package provides a Ruby client that tries to match Redis' API one-to-one, while still providing an idiomatic interface.") (home-page "https://github.com/redis/redis-rb") (license license:expat))) (define-public go-github-com-cupcake-rdb (package (name "go-github-com-cupcake-rdb") (version "0.0.0-20161107195141-43ba34106c76") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/tent/rdb") (commit (go-version->git-ref version)))) (file-name (git-file-name name version)) (sha256 (base32 "1l4bsn5yj8r875crz1rsk6dlvhv0bd8mgazsch5vl4c19v0fs2ib")))) (build-system go-build-system) (arguments '(#:import-path "github.com/cupcake/rdb")) (native-inputs (list go-gopkg-in-check-v1)) (home-page "https://github.com/tent/rdb") (synopsis "Redis RDB parser for Go") (description "Package rdb implements parsing and encoding of the Redis RDB file format.") (license license:expat))) (define-public go-github-com-gomodule-redigo (package (name "go-github-com-gomodule-redigo") (version "1.8.8") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/gomodule/redigo") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "0wplaaxg7f6c6c08gdp33l48hygn8gq1rhlnjzr1c9qcggsm07k1")))) (build-system go-build-system) (arguments '(#:unpack-path "github.com/gomodule/redigo" #:import-path "github.com/gomodule/redigo/redis")) (native-inputs (list go-github-com-stretchr-testify redis)) (home-page "https://github.com/gomodule/redigo") (synopsis "Go client for Redis") (description "Redigo is a Go client for the Redis database.") (license license:asl2.0))) (define-public kyotocabinet (package (name "kyotocabinet") (version "1.2.79") (source (origin (method url-fetch) (uri (string-append "https://fallabs.com/kyotocabinet/pkg/" "kyotocabinet-" version ".tar.gz")) (sha256 (base32 "079ymsahlrijswgwfr2la9yw5h57l752cprhp5dz31iamsj1vyv7")))) (build-system gnu-build-system) (arguments `(#:configure-flags (list "--disable-opt" ;"-march=native". XXX this also turns off -O0. (string-append "LDFLAGS=-Wl,-rpath=" (assoc-ref %outputs "out") "/lib")))) (inputs (list zlib)) (home-page "https://fallabs.com/kyotocabinet/") (synopsis "Kyoto Cabinet is a modern implementation of the DBM database") (description "Kyoto Cabinet is a standalone file-based database that supports Hash and B+ Tree data storage models. It is a fast key-value lightweight database and supports many programming languages. It is a NoSQL database.") (license license:gpl3+))) (define-public tokyocabinet (package (name "tokyocabinet") (version "1.4.48") (source (origin (method url-fetch) (uri (string-append "http://fallabs.com/tokyocabinet/" name "-" version ".tar.gz")) (sha256 (base32 "140zvr0n8kvsl0fbn2qn3f2kh3yynfwnizn4dgbj47m975yg80x0")))) (build-system gnu-build-system) (arguments `(#:configure-flags (list "--enable-pthread" "--enable-off64" ,@(if (target-x86?) ;; Enables x86 specific cflags. '("--enable-fastest") '()) (string-append "LDFLAGS=-Wl,-rpath=" (assoc-ref %outputs "out") "/lib")))) (inputs (list zlib)) (home-page "http://fallabs.com/tokyocabinet/") (synopsis "Tokyo Cabinet is a modern implementation of the DBM database") (description "Tokyo Cabinet is a library of routines for managing a database. The database is a simple data file containing records, each is a pair of a key and a value. Every key and value is serial bytes with variable length. Both binary data and character string can be used as a key and a value. There is neither concept of data tables nor data types. Records are organized in hash table, B+ tree, or fixed-length array.") (license license:lgpl2.1+))) (define-public wiredtiger (package (name "wiredtiger") (version "2.9.1") (source (origin (method url-fetch) (uri (string-append "http://source.wiredtiger.com/releases/wiredtiger-" version ".tar.bz2")) (sha256 (base32 "0krwnb2zfbhvjaskwl875qzd3y626s84zcciq2mxr5c5riw3yh6s")))) (build-system gnu-build-system) (arguments '(#:configure-flags '("--enable-lz4" "--with-builtins=snappy,zlib") #:phases (modify-phases %standard-phases (add-before 'check 'disable-test/fops (lambda _ ;; XXX: timed out after 3600 seconds of silence (substitute* "Makefile" (("test/fops") "")) #t))))) (inputs (list lz4 zlib snappy)) (home-page "https://source.wiredtiger.com/") (synopsis "NoSQL data engine") (description "WiredTiger is an extensible platform for data management. It supports row-oriented storage (where all columns of a row are stored together), column-oriented storage (where columns are stored in groups, allowing for more efficient access and storage of column subsets) and log-structured merge trees (LSM), for sustained throughput under random insert workloads.") (license license:gpl3) ; or GPL-2 ;; configure.ac: WiredTiger requires a 64-bit build. (supported-systems (delete "riscv64-linux" %64bit-supported-systems)))) (define-public wiredtiger-3 (package (inherit wiredtiger) (name "wiredtiger") (version "3.1.0") (source (origin (method url-fetch) (uri (string-append "http://source.wiredtiger.com/releases/wiredtiger-" version ".tar.bz2")) (sha256 (base32 "014awypv579ascg4jbx4pndj2wld337m79yyzrzyr7hxrff139jx")))))) (define-public guile-wiredtiger (package (name "guile-wiredtiger") (version "0.7.0") (source (origin (method git-fetch) (uri (git-reference (url "https://framagit.org/a-guile-mind/guile-wiredtiger.git") (commit "340ad4bc2ff4dcc6216a2f5c6f9172ca320ac66b"))) (file-name (string-append name "-" version "-checkout")) (sha256 (base32 "15j36bvxxzil7qpwlmh1rffqpva3ynvrcpqhhqbj2c9208ayz595")))) (build-system gnu-build-system) (arguments '(#:parallel-tests? #f ;; tests can't be run in parallel, yet. #:configure-flags (list (string-append "--with-libwiredtiger-prefix=" (assoc-ref %build-inputs "wiredtiger"))) #:make-flags '("GUILE_AUTO_COMPILE=0"))) (native-inputs (list autoconf automake pkg-config)) (inputs (list wiredtiger-3 guile-2.2)) (propagated-inputs (list guile2.2-bytestructures)) (synopsis "WiredTiger bindings for GNU Guile") (description "This package provides Guile bindings to the WiredTiger ``NoSQL'' database.") (home-page "https://framagit.org/a-guile-mind/guile-wiredtiger") (license license:gpl3+))) (define-public perl-db-file (package (name "perl-db-file") (version "1.858") (source (origin (method url-fetch) (uri (string-append "mirror://cpan/authors/id/P/PM/PMQS/DB_File-" version ".tar.gz")) (sha256 (base32 "1xm7s2ag15498kp7g8r20gxk22ncz3b3hz4b3srqf7ypif3a5dyf")))) (build-system perl-build-system) (arguments (list #:phases #~(modify-phases %standard-phases (add-before 'configure 'modify-config.in (lambda _ (substitute* "config.in" (("/usr/local/BerkeleyDB") #$(this-package-input "bdb")))))))) (inputs (list bdb)) (native-inputs (list perl-test-pod)) (home-page "https://metacpan.org/release/DB_File") (synopsis "Perl5 access to Berkeley DB version 1.x") (description "The DB::File module provides Perl bindings to the Berkeley DB version 1.x.") (license license:perl-license))) (define-public lmdb (package (name "lmdb") (version "0.9.29") (source (origin (method git-fetch) (uri (git-reference (url "https://git.openldap.org/openldap/openldap.git") (commit (string-append "LMDB_" version)))) (file-name (git-file-name name version)) (sha256 (base32 "0airps4cd0d91nbgy7hgvifa801snxwxzwxyr6pdv61plsi7h8l3")))) (build-system gnu-build-system) (arguments `(#:test-target "test" ;; TODO: Make this unconditional on core-updates. ,@(if (%current-target-system) `(#:make-flags `(,(string-append "CC=" ,(cc-for-target)) ,(string-append "AR=" ,(ar-for-target)))) '()) #:phases (modify-phases %standard-phases (replace 'configure (lambda* (#:key outputs #:allow-other-keys) (chdir "libraries/liblmdb") (substitute* "Makefile" (("/usr/local") (assoc-ref outputs "out"))) #t)) (add-after 'install 'create-pkg-config-file (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (mkdir-p (string-append out "/lib/pkgconfig")) (with-output-to-file (string-append out "/lib/pkgconfig/liblmdb.pc") (lambda _ (format #t "prefix=~a~@ exec_prefix=~a~@ libdir=~a/lib~@ includedir=~a/include~@ ~@ Name: liblmdb~@ Version: ~a~@ Description: Lightning Memory-Mapped Database library~@ Libs: -L${libdir} -llmdb~@ Cflags: -I${includedir}~%" out out out out ,version))) #t)))))) (home-page "https://symas.com/lmdb/") (synopsis "Lightning Memory-Mapped Database library") (description "The @dfn{Lightning Memory-Mapped Database} (LMDB) is a high-performance transactional database. Unlike more complex relational databases, LMDB handles only key-value pairs (stored as arbitrary byte arrays) and relies on the underlying operating system for caching and locking, keeping the code small and simple. The use of ‘zero-copy’ memory-mapped files combines the persistence of classic disk-based databases with high read performance that scales linearly over multiple cores. The size of each database is limited only by the size of the virtual address space — not physical RAM.") (license license:openldap2.8))) (define-public lmdbxx (package (name "lmdbxx") (version "1.0.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/hoytech/lmdbxx") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "12k5rz74d1l0skcks9apry1svkl96g9lf5dcgylgjmh7v1jm0b7c")))) (arguments `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))) #:phases (modify-phases %standard-phases (delete 'configure)))) (build-system gnu-build-system) (inputs (list lmdb)) (home-page "https://github.com/hoytech/lmdbxx") (synopsis "C++11 wrapper for the LMDB embedded B+ tree database library") (description "@code{lmdbxx} is a comprehensive @code{C++} wrapper for the @code{LMDB} embedded database library, offering both an error-checked procedural interface and an object-oriented resource interface with RAII semantics.") (license license:unlicense))) (define-public libpqxx (package (name "libpqxx") (version "7.7.4") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/jtv/libpqxx") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "1qwpfba8g55jjv0xnsk4hhf2cmhk7mdirxx115cvnjjw97ppy0z0")))) (build-system gnu-build-system) (native-inputs (list gcc-11 python-wrapper)) (inputs (list postgresql)) (arguments '(#:tests? #f)) ;tests require a running PostgreSQL server (synopsis "C++ connector for PostgreSQL") (description "Libpqxx is a C++ library to enable user programs to communicate with the PostgreSQL database back-end. The database back-end can be local or it may be on another machine, accessed via TCP/IP.") (home-page "https://pqxx.org/") (license license:bsd-3))) (define-public python-peewee (package (name "python-peewee") (version "3.14.4") (source (origin (method url-fetch) (uri (pypi-uri "peewee" version)) (sha256 (base32 "18jidir2wid0cp8a61m9vf9mf0pdvm6nzspc8bfwdbifghr6ndcy")))) (build-system python-build-system) (arguments `(#:tests? #f)) ; fails to import test data (inputs (list sqlite)) (native-inputs (list python-cython)) (home-page "https://github.com/coleifer/peewee/") (synopsis "Small object-relational mapping utility") (description "Peewee is a simple and small ORM (object-relation mapping) tool. Peewee handles converting between pythonic values and those used by databases, so you can use Python types in your code without having to worry. It has built-in support for sqlite, mysql and postgresql. If you already have a database, you can autogenerate peewee models using @code{pwiz}, a model generator.") (license license:expat))) (define-public python-pypika-tortoise (package (name "python-pypika-tortoise") (version "0.1.6") (source (origin (method url-fetch) (uri (pypi-uri "pypika-tortoise" version)) (sha256 (base32 "0dmzpsnlqjjz0vm0r9xjk69xfsm235bpnk3jccr8ww4s8y7qc0nq")))) (build-system pyproject-build-system) (native-inputs (list poetry)) (home-page "https://github.com/tortoise/pypika-tortoise") (synopsis "Pypika fork for tortoise-orm") (description "Pypika-tortoise is a fork of pypika which has been streamlined for its use in the context of tortoise-orm. It removes support for many database kinds that tortoise-orm doesn't need, for example.") (license license:asl2.0))) (define-public python-sphinxcontrib-asyncio (package (name "python-sphinxcontrib-asyncio") (version "0.3.0") (source (origin (method url-fetch) (uri (pypi-uri "sphinxcontrib-asyncio" version)) (sha256 (base32 "0bkj010ygsr7m769llf2aq4bbjfhdwqrrabi98j8gpvyzvh2dzcr")))) (build-system python-build-system) (arguments '(#:tests? #f)) ;no test suite (propagated-inputs (list python-sphinx)) (home-page "https://github.com/aio-libs/sphinxcontrib-asyncio") (synopsis "Sphinx extension to support coroutines in markup") (description "This package is a Sphinx extension providing additional coroutine-specific markup.") (license license:asl2.0))) (define-public python-asyncpg (package (name "python-asyncpg") (version "0.25.0") (source (origin (method url-fetch) (uri (pypi-uri "asyncpg" version)) (sha256 (base32 "0h1573lp4607nppflnnjrhn7yrfy6i54cm98gi4qbcikjykfdy33")))) (build-system python-build-system) (propagated-inputs (list python-typing-extensions)) (native-inputs (list postgresql python-cython python-pytest python-uvloop)) (home-page "https://github.com/MagicStack/asyncpg") (synopsis "Fast PostgreSQL database client library for Python") (description "@code{asyncpg} is a database interface library designed specifically for PostgreSQL and Python/asyncio. @code{asyncpg} is an efficient, clean implementation of PostgreSQL server binary protocol for use with Python's asyncio framework.") (license license:asl2.0))) (define-public python-asyncmy (package (name "python-asyncmy") (version "0.2.5") (source (origin (method url-fetch) (uri (pypi-uri "asyncmy" version)) (sha256 (base32 "0i18zxy6xvzv6dk791xifn2sw2q4zvqwpzrzy8qx51d3mp8z6gng")))) (build-system python-build-system) (native-inputs (list python-cython)) (home-page "https://github.com/long2ice/asyncmy") (synopsis "Fast MySQL driver for Python") (description "@code{asyncmy} is a fast @code{asyncio} MySQL driver, which reuses most of @code{pymysql} and @code{aiomysql} but rewrites the core protocol with Cython for performance.") (license license:asl2.0))) (define-public python-aiomysql (package (name "python-aiomysql") (version "0.1.1") (source (origin (method url-fetch) (uri (pypi-uri "aiomysql" version)) (sha256 (base32 "0zhhisf2bz2hv0vcklw45k54yr0f7gx61gnq4lc7vdp6v97nqs0d")))) (build-system pyproject-build-system) (arguments '(#:tests? #f)) ;test suite requires docker (propagated-inputs (list python-pymysql)) (native-inputs (list python-setuptools python-wheel)) (home-page "https://github.com/aio-libs/aiomysql") (synopsis "MySQL driver for Python") (description "@code{aiomysql} is a driver for accessing a MySQL database from the @code{asyncio} Python framework. It depends on and reuses most parts of PyMySQL. @code{aiomysql} tries to preserve the same API as the @code{aiopg} library.") (license license:expat))) (define-public python-tortoise-orm (package (name "python-tortoise-orm") (version "0.20.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/tortoise/tortoise-orm") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "19rgyvs2y9gn27x71y7djdz6rb6bszgvprv55q1hr4266wy6g999")))) (build-system pyproject-build-system) ;; The test suite relies on asynctest, which is abandoned and doesn't ;; support Python >= 3.8. (arguments '(#:tests? #f)) (native-inputs (list poetry)) (propagated-inputs (list python-aiomysql python-aiosqlite-0.17 python-asyncmy python-asyncpg python-ciso8601 python-iso8601 python-pypika-tortoise python-pytz python-rapidjson python-uvloop)) (home-page "https://github.com/tortoise/tortoise-orm") (synopsis "Asynchronous Object Relational Mapper (ORM) for Python") (description "Tortoise ORM is an easy-to-use asyncio ORM (Object Relational Mapper) inspired by Django. Tortoise ORM was built with relations in mind and admiration for the excellent and popular Django ORM. It's engraved in its design that you are working not with just tables, you work with relational data.") (license license:asl2.0))) (define-public aerich (package (name "aerich") (version "0.7.2") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/tortoise/aerich") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "0pcy945bg890p12s7cyw0mg7hxwsxyy570j600sbf7kwj2d3lilg")))) (build-system pyproject-build-system) (native-inputs (list poetry python-bandit python-cryptography python-isort python-pydantic python-pytest python-pytest-asyncio python-pytest-mock python-pytest-xdist)) (propagated-inputs (list python-asyncmy python-asyncpg python-click python-ddlparse python-dictdiffer python-tomlkit python-tortoise-orm)) (home-page "https://github.com/tortoise/aerich") (synopsis "Database migrations tool for Tortoise @acronym{ORM, Object Relational Mapper}") (description "This package provides @code{aerich}, a Python database migrations tool for Tortoise @acronym{ORM, Object Relational Mapper}. It can be used both programmatically or as a standalone CLI application.") (license license:asl2.0))) (define-public sqlcipher (package (name "sqlcipher") (version "3.4.2") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/sqlcipher/sqlcipher") (commit (string-append "v" version)))) (sha256 (base32 "168wb6fvyap7y8j86fb3xl5rd4wmhiq0dxvx9wxwi5kwm1j4vn1a")) (file-name (git-file-name name version)))) (build-system gnu-build-system) (inputs `(("libcrypto" ,openssl) ("libtcl8.6" ,tcl))) ; required for running the tests (native-inputs (list tcl)) (arguments '(#:configure-flags '("--enable-tempstore=yes" "CFLAGS=-DSQLITE_HAS_CODEC -DSQLITE_ENABLE_FTS3" "LDFLAGS=-lcrypto -ltcl8.6" "--disable-tcl") ;; tests cannot be run from the Makefile ;; see: <https://github.com/sqlcipher/sqlcipher/issues/172> #:test-target "testfixture" #:phases (modify-phases %standard-phases (add-before 'check 'build-test-runner (assoc-ref %standard-phases 'check)) (replace 'check (lambda _ (invoke "./testfixture" "test/crypto.test")))))) (home-page "https://www.zetetic.net/sqlcipher/") (synopsis "Library providing transparent encryption of SQLite database files") (description "SQLCipher is an implementation of SQLite, extended to provide transparent 256-bit AES encryption of database files. Pages are encrypted before being written to disk and are decrypted when read back. It’s well suited for protecting embedded application databases and for mobile development.") ;; The source files ;; src/{crypto.c,crypto_impl.c,crypto.h,crypto_cc.c,crypto_libtomcrypt.c}, ;; src/{crypto_openssl.c,sqlcipher.h}, tool/crypto-speedtest.tcl, ;; test/crypto.test are licensed under a 3-clause BSD license. All other ;; source files are in the public domain. (license (list license:public-domain license:bsd-3)))) (define-public python-pyodbc-c (package (name "python-pyodbc-c") (version "3.1.5") (source (origin (method git-fetch) (uri (git-reference (url "https://gitlab.com/daym/pyodbc-c/") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "08y60c5sx0k953zfx0s2a155l8py968sb17ap9a9fg8bjnj783k8")))) (build-system python-build-system) (inputs (list unixodbc)) (arguments `(;; The tests require a running SQL server that they don't help set up. #:tests? #f)) (home-page "https://gitlab.com/daym/pyodbc-c") (synopsis "Python ODBC Library written in C") (description "@code{python-pyodbc-c} provides a Python DB-API driver for ODBC, similar to python-pyodbc but written in C. It's designed to stand alone and not have other dependencies on other packages or languages. It uses only Python's built-in data types.") (license (license:x11-style "file://LICENSE.TXT")))) (define-public python-pyodbc (package (name "python-pyodbc") (version "4.0.35") (source (origin (method url-fetch) (uri (pypi-uri "pyodbc" version)) (sha256 (base32 "1j7577acd2f16zifw49ajg0aw7vm0pdg6jxrr1dlaa5rx14azfcj")) (modules '((guix build utils))) (snippet ;; Delete precompiled binaries. The corresponding source is included. #~(for-each delete-file (find-files "." "\\.pyc$"))))) (build-system python-build-system) (inputs (list unixodbc)) (arguments ;; XXX Tests fail with ‘Can't open lib 'SQL Server Native Client 10.0' : ;; file not found (0) (SQLDriverConnect)")’. (list #:tests? #f #:phases #~(modify-phases %standard-phases (replace 'check (lambda* (#:key tests? #:allow-other-keys) (when tests? (invoke "python3" "tests3/test.py"))))))) (home-page "https://github.com/mkleehammer/pyodbc") (synopsis "Python ODBC Library") (description "@code{python-pyodbc} provides a Python DB-API driver for ODBC.") (license (license:x11-style "file:///LICENSE.TXT")))) (define-public mdbtools (package (name "mdbtools") (version "0.7.1") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/brianb/mdbtools") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "0gwcpp9y09xhs21g7my2fs8ncb8i6ahlyixcx8jd3q97jbzj441l")))) (build-system gnu-build-system) (inputs (list glib)) (native-inputs (list autoconf automake libtool pkg-config txt2man which)) (home-page "https://mdbtools.sourceforge.net/") (synopsis "Read Microsoft Access databases") (description "MDB Tools is a set of tools and applications to read the proprietary MDB file format used in Microsoft's Access database package. This includes programs to export schema and data from Microsoft's Access database file format to other databases such as MySQL, Oracle, Sybase, PostgreSQL, etc., and an SQL engine for performing simple SQL queries.") (license (list license:lgpl2.0 license:gpl2+)))) (define-public go-gopkg-in-mgo-v2 (package (name "go-gopkg-in-mgo-v2") (version "2.0.0-20190816093944-a6b53ec6cb22") (source (origin (method git-fetch) (uri (git-reference (url "https://gopkg.in/mgo.v2") (commit (go-version->git-ref version)))) (file-name (git-file-name name version)) (sha256 (base32 "1lgvwxsbmdrf4938qkxl56wbwgbphk2qqnmpf73qdmlv4qsg14na")))) (build-system go-build-system) (arguments '(#:tests? #f ; Tests try to use a running mongodb server. #:import-path "gopkg.in/mgo.v2")) (propagated-inputs (list go-gopkg.in-tomb.v2)) (inputs (list cyrus-sasl)) (native-inputs (list go-gopkg-in-check-v1)) (home-page "https://gopkg.in/mgo.v2") (synopsis "MongoDB driver for Go") (description "This package provides a MongoDB driver for Go.") (license license:bsd-2))) (define-public python-lmdb (package (name "python-lmdb") (version "1.0.0") (source (origin (method url-fetch) (uri (pypi-uri "lmdb" version)) (sha256 (base32 "1di1gj2agbxwqqwrpk4w58dpfah0kl10ha20s63dlqdd1bgzydj1")) (modules '((guix build utils))) (snippet ;; Delete bundled lmdb source files. '(begin (for-each delete-file (list "lib/lmdb.h" "lib/mdb.c" "lib/midl.c" "lib/midl.h")) #t)))) (build-system python-build-system) (inputs (list lmdb)) (arguments `(#:phases (modify-phases %standard-phases (add-before 'build 'use-system-lmdb (lambda* (#:key inputs #:allow-other-keys) (let ((lmdb (assoc-ref inputs "lmdb"))) (setenv "LMDB_PURE" "set") ; don't apply env-copy-txn.patch (setenv "LMDB_FORCE_SYSTEM" "set") (setenv "LMDB_INCLUDEDIR" (string-append lmdb "/include")) (setenv "LMDB_LIBDIR" (string-append lmdb "/lib")) #t)))) ;; Tests fail with: ‘lmdb.tool: Please specify environment (--env)’. #:tests? #f)) (home-page "https://github.com/dw/py-lmdb") (synopsis "Python binding for the ‘Lightning’ database (LMDB)") (description "python-lmdb or py-lmdb is a Python binding for the @dfn{Lightning Memory-Mapped Database} (LMDB), a high-performance key-value store.") (license (list license:openldap2.8 ;; ‘lib/win32/inttypes.h’ and ‘lib/win32-stdint/stdint.h’ are BSD-3, ;; but not actually needed on platforms currently supported by Guix. license:bsd-3)))) (define-public virtuoso-ose (package (name "virtuoso-ose") (version "7.2.11") (source (origin (method url-fetch) (uri (string-append "mirror://sourceforge/virtuoso/virtuoso/" version "/" "virtuoso-opensource-" version ".tar.gz")) (sha256 (base32 "0mk25gr1pafmps4nsydjprwswbzwch8b583nlwh7x2031sz7ald1")) (patches (search-patches "virtuoso-ose-remove-pre-built-jar-files.patch")) (modules '((guix build utils))) ;; This snippet removes pre-built Java archives. (snippet #~(for-each delete-file-recursively (list "binsrc/hibernate" "binsrc/jena" "binsrc/jena2" "binsrc/jena3" "binsrc/jena4" "binsrc/rdf4j" "binsrc/sesame" "binsrc/sesame2" "binsrc/sesame3" "binsrc/sesame4" "libsrc/JDBCDriverType4"))))) (build-system gnu-build-system) (arguments (list #:tests? #f ; tests require a network connection ;; TODO: Removing the libsrc/zlib source directory breaks the build. ;; This indicates that the internal zlib code may still be used. #:configure-flags #~(list "--without-internal-zlib" "--with-readline" "--enable-static=no") #:phases #~(modify-phases %standard-phases (replace 'bootstrap (lambda _ (invoke "sh" "autogen.sh"))) (add-after 'unpack 'avoid-embedding-kernel-and-timestamps ;; For a reproducible build, avoid embedding the kernel version and ;; timestamps. (lambda _ (substitute* (list "bin/makever" "appsrc/ODS-Polls/make_vad.sh" "appsrc/ODS-Blog/make_vad.sh" "appsrc/ODS-Community/make_vad.sh" "appsrc/ODS-Framework/make_vad.sh" "appsrc/ODS-Framework/oauth/make_vad.sh" "appsrc/ODS-WebMail/make_vad.sh" "appsrc/ODS-Calendar/make_vad.sh" "appsrc/ODS-Gallery/make_vad.sh" "appsrc/ODS-Briefcase/make_vad.sh" "appsrc/ODS-FeedManager/make_vad.sh" "appsrc/ODS-Bookmark/make_vad.sh" "appsrc/ODS-Addressbook/make_vad.sh" "binsrc/dbpedia/make_vad.sh" "binsrc/samples/demo/make_vad.sh" "binsrc/samples/demo/mkdoc.sh" "binsrc/samples/sparql_demo/make_vad.sh" "binsrc/bpel/make_vad.sh" "binsrc/fct/make_vad.sh" "binsrc/rdf_mappers/make_vad.sh" "binsrc/isparql/make_vad.sh" "binsrc/conductor/mkvad.sh") (("^UNAME_SYSTEM=.*") "UNAME_SYSTEM=unknown\n") (("^UNAME_RELEASE=.*") "UNAME_RELEASE=unknown\n") (("^PACKDATE=.*") "PACKDATE=2012-04-18\n") (("^DATE=.*") "DATE=2012-04-18\n")))) ;; Even with "--enable-static=no", "libvirtuoso-t.a" is left in ;; the build output. The following phase removes it. (add-after 'install 'remove-static-libs (lambda _ (for-each (lambda (file) (delete-file (string-append #$output "/lib/" file))) '("libvirtuoso-t.a" "libvirtuoso-t.la"))))))) (native-inputs (list autoconf automake bison flex gperf libtool)) (inputs (list openssl net-tools readline which zlib)) (home-page "https://vos.openlinksw.com/owiki/wiki/VOS/") (synopsis "Multi-model database system") (description "Virtuoso is a scalable cross-platform server that combines relational, graph, and document data management with web application server and web services platform functionality.") ;; configure: error: ... can only be build on 64bit platforms (supported-systems %64bit-supported-systems) (license license:gpl2))) (define-public python-ccm (package (name "python-ccm") (version "2.1.6") (source (origin (method url-fetch) (uri (pypi-uri "ccm" version)) (sha256 (base32 "177dfxsmk3k4cih6fh6v8d91bh4nqx7ns6pc07w7m7i3cvdx3c8n")))) (build-system python-build-system) (propagated-inputs (list python-pyyaml ;; Not listed in setup.py, but used in ccmlib/node.py for full ;; functionality python-psutil python-six)) (home-page "https://github.com/pcmanus/ccm") (synopsis "Cassandra Cluster Manager for Apache Cassandra clusters on localhost") (description "Cassandra Cluster Manager is a development tool for testing local Cassandra clusters. It creates, launches and removes Cassandra clusters on localhost.") (license license:asl2.0))) (define-public python-sqlalchemy (package (name "python-sqlalchemy") (version "1.4.42") (source (origin (method url-fetch) (uri (pypi-uri "SQLAlchemy" version)) (sha256 (base32 "0qzkxy47y06fqh1m7a0p7q2r9h48x9k5kl3znzhx2vj79j8l2zhp")))) (build-system pyproject-build-system) (native-inputs (list python-cython ; for C extensions python-pytest python-mock python-pytest-xdist ; for tests python-setuptools python-wheel)) (propagated-inputs (list python-greenlet)) (arguments (list #:test-flags '(list ;; The memory usage tests are very expensive and run in sequence; ;; skip them. "-k" "not test_memusage.py"))) (home-page "https://www.sqlalchemy.org") (synopsis "Database abstraction library") (description "SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL. It provides a full suite of well known enterprise-level persistence patterns, designed for efficient and high-performing database access, adapted into a simple and Pythonic domain language.") (license license:x11))) (define-public python-sqlalchemy-2 (package (name "python-sqlalchemy") (version "2.0.36") (source (origin (method url-fetch) (uri (pypi-uri "sqlalchemy" version)) (sha256 (base32 "1i99kgm8hc38iffgp3wdbixpdc5jfjklabh8lyp9h8vd1dl6f9vz")))) (build-system pyproject-build-system) (arguments (list #:test-flags ;; Remove expensive tests. #~(list "--ignore=test/aaa_profiling/test_memusage.py" "--ignore=test/ext/mypy/test_mypy_plugin_py3k.py" "--ignore=test/typing/test_mypy.py" ;; Disable a test that fails randomly. "-k" "test_recycle_pool_no_race"))) (native-inputs (list python-cython python-pytest python-setuptools python-wheel)) (propagated-inputs (list python-greenlet python-typing-extensions)) (home-page "https://www.sqlalchemy.org") (synopsis "SQL toolkit and object relational mapper") (description "SQLAlchemy is the Python SQL toolkit and @acronym{ORM, Object Relational Mapper} that gives application developers the full power and flexibility of SQL. It provides a full suite of well known enterprise-level persistence patterns, designed for efficient and high-performing database access, adapted into a simple and Pythonic domain language.") (license license:expat))) (define-public python-sqlalchemy-stubs (package (name "python-sqlalchemy-stubs") (version "0.4") (source (origin (method url-fetch) (uri (pypi-uri "sqlalchemy-stubs" version)) (sha256 (base32 "1bppjmv7v7m0q8gwg791pgxbx4ay7mna0zq204pn9vw28kfxcrf6")))) (build-system python-build-system) (propagated-inputs (list python-mypy python-typing-extensions)) (home-page "https://github.com/dropbox/sqlalchemy-stubs") (synopsis "SQLAlchemy stubs and mypy plugin") (description "This package contains type stubs and a mypy plugin to provide more precise static types and type inference for SQLAlchemy framework.") (license license:asl2.0))) (define-public python-sqlalchemy-utils (package (name "python-sqlalchemy-utils") (version "0.38.3") (source (origin (method url-fetch) (uri (pypi-uri "SQLAlchemy-Utils" version)) (sha256 (base32 "0k8z0mjhvdv302kn0nhci8b2dgw4cn2akprsf37ma1540ykgp6lz")))) (build-system python-build-system) (arguments '(#:tests? #f)) ; FIXME: Many tests require a running database server. ;; #:phases ;; (modify-phases %standard-phases ;; (replace 'check ;; (lambda _ ;; (zero? (system* "py.test" "sqlalchemy_utils" "tests"))))) (propagated-inputs (list python-six python-sqlalchemy)) (native-inputs (list python-dateutil python-flexmock python-psycopg2 python-pytest python-pytz)) (home-page "https://github.com/kvesteri/sqlalchemy-utils") (synopsis "Various utility functions for SQLAlchemy") (description "SQLAlchemy-utils provides various utility functions and custom data types for SQLAlchemy. SQLAlchemy is an SQL database abstraction library for Python. You might also want to install the following optional dependencies: @enumerate @item @code{python-passlib} @item @code{python-babel} @item @code{python-cryptography} @item @code{python-pytz} @item @code{python-psycopg2} @item @code{python-furl} @item @code{python-flask-babel} @end enumerate ") (license license:bsd-3))) (define-public python-alchemy-mock (package (name "python-alchemy-mock") (version "0.4.3") (home-page "https://github.com/miki725/alchemy-mock") (source (origin (method url-fetch) (uri (pypi-uri "alchemy-mock" version)) (sha256 (base32 "0ylxygl3bcdapzz529n8wgk7vx9gjwb3ism564ypkpd7dbsw653r")) (snippet #~(begin (use-modules (guix build utils)) (substitute* "alchemy_mock/comparison.py" (("collections\\.Mapping") "collections.abc.Mapping")))))) (build-system python-build-system) (arguments '(#:phases (modify-phases %standard-phases (replace 'check (lambda _ ;; Create pytest.ini that adds doctest options to ;; prevent test failure. Taken from tox.ini. (call-with-output-file "pytest.ini" (lambda (port) (format port "[pytest] doctest_optionflags=IGNORE_EXCEPTION_DETAIL "))) (invoke "pytest" "-vv" "--doctest-modules" "alchemy_mock/")))))) (native-inputs (list python-mock python-pytest)) (propagated-inputs (list python-six python-sqlalchemy)) (synopsis "Mock helpers for SQLAlchemy") (description "This package provides mock helpers for SQLAlchemy that makes it easy to mock an SQLAlchemy session while preserving the ability to do asserts. Normally Normally SQLAlchemy's expressions cannot be easily compared as comparison on binary expression produces yet another binary expression, but this library provides functions to facilitate such comparisons.") (license license:expat))) (define-public python-alembic (package (name "python-alembic") (version "1.14.0") (source (origin (method url-fetch) (uri (pypi-uri "alembic" version)) (sha256 (base32 "0jrh9q4h2jv2bafpd6isx2dvc90rpx6j7fpdvfwd0hin7fsr425h")))) (build-system pyproject-build-system) (arguments (list #:test-flags #~(list "--ignore=tests/integration" "-k" (string-join ;; XXX: Tests require fresh python-pytz timezones, remove ;; when updated. (list "not test_custom_tz" "test_custom_tz_lowercase" "test_custom_tz_utc" "test_custom_tzdata_tz") " and not ")))) (native-inputs (list python-mock python-pytest python-setuptools python-wheel)) (propagated-inputs (list python-dateutil python-editor python-mako python-sqlalchemy python-typing-extensions)) (home-page "https://bitbucket.org/zzzeek/alembic") (synopsis "Database migration tool for SQLAlchemy") (description "Alembic is a lightweight database migration tool for usage with the SQLAlchemy Database Toolkit for Python.") (license license:expat))) (define-public python-sqlite-fts4 (package (name "python-sqlite-fts4") (version "1.0.3") (source (origin (method url-fetch) (uri (pypi-uri "sqlite-fts4" version)) (sha256 (base32 "034kx0ac556sywy1p4qcrc36l24w3q0xwswqv2z9s3k8yvm5xc3q")))) (build-system python-build-system) (native-inputs (list python-pytest)) (home-page "https://github.com/simonw/sqlite-fts4") (synopsis "Python functions for working with SQLite FTS4 search") (description "This package provides custom SQLite functions written in Python for ranking documents indexed using the SQLite's FTS4 full text search extension.") (license license:asl2.0))) (define-public python-sqlite-utils (package (name "python-sqlite-utils") (version "3.32.1") (source (origin (method git-fetch) ;for tests (uri (git-reference (url "https://github.com/simonw/sqlite-utils") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "1qf9zwn9gdkx8825klicwkw8zj5wpidd8csdhjxvybq56nkgnrpm")))) (build-system pyproject-build-system) (arguments (list #:phases #~(modify-phases %standard-phases (add-after 'unpack 'relax-requirements (lambda _ (substitute* "setup.py" ;; This is a variant designed to have a binary ;; wheel made available on PyPI, which is not a ;; concern to Guix. (("click-default-group-wheel") "click-default-group"))))))) (propagated-inputs (list python-click python-click-default-group python-dateutil python-sqlite-fts4 python-tabulate)) (native-inputs (list python-pytest python-setuptools python-wheel)) (home-page "https://github.com/simonw/sqlite-utils") (synopsis "CLI tool and Python utility functions for manipulating SQLite databases") (description "This package provides a CLI tool and Python utility functions for manipulating SQLite databases. It's main features are: @itemize @item Pipe JSON (or CSV or TSV) directly into a new SQLite database file, automatically creating a table with the appropriate schema. @item Run in-memory SQL queries, including joins, directly against data in CSV, TSV or JSON files and view the results. @item Configure SQLite full-text search against your database tables and run search queries against them, ordered by relevance. @item Run transformations against your tables to make schema changes that SQLite ALTER TABLE does not directly support, such as changing the type of a column. @item Extract columns into separate tables to better normalize your existing data. @end itemize") (license license:asl2.0))) (define-public python-pickleshare (package (name "python-pickleshare") (version "0.7.5") (source (origin (method url-fetch) (uri (pypi-uri "pickleshare" version)) (sha256 (base32 "1jmghg3c53yp1i8cm6pcrm280ayi8621rwyav9fac7awjr3kss47")))) (build-system pyproject-build-system) (native-inputs (list python-pytest python-setuptools python-wheel)) (home-page "https://github.com/vivainio/pickleshare") (synopsis "Tiny key value database with concurrency support") (description "PickleShare is a small ‘shelve’-like datastore with concurrency support. Like shelve, a PickleShareDB object acts like a normal dictionary. Unlike shelve, many processes can access the database simultaneously. Changing a value in database is immediately visible to other processes accessing the same database. Concurrency is possible because the values are stored in separate files. Hence the “database” is a directory where all files are governed by PickleShare.") (license license:expat))) (define-public python-apsw (package (name "python-apsw") (version "3.46.0.0") ;; The compressed release has fetching functionality disabled. (source (origin (method url-fetch) (uri (string-append "https://github.com/rogerbinns/apsw/releases/download/" version "/apsw-" version ".zip")) (sha256 (base32 "10yfbasi4mq63g0svyl1h49ylwn9znjylq78id16dzxzk9q9ipdx")))) (build-system pyproject-build-system) (native-inputs (list unzip python-setuptools python-wheel)) (inputs (list sqlite-next)) ;SQLite 3.45.1 required. (arguments (list #:phases #~(modify-phases %standard-phases (add-before 'build 'build-extensions (lambda _ (invoke "python" "setup.py" "build" "--enable-all-extensions" "--enable=load_extension"))) (add-after 'build 'build-test-helper (lambda _ (invoke "gcc" "-fPIC" "-shared" "-o" "./testextension.sqlext" "-I." "-Isqlite3" "src/testextension.c")))))) (home-page "https://github.com/rogerbinns/apsw/") (synopsis "Another Python SQLite Wrapper") (description "APSW is a Python wrapper for the SQLite embedded relational database engine. In contrast to other wrappers such as pysqlite it focuses on being a minimal layer over SQLite attempting just to translate the complete SQLite API into Python.") (license license:zlib))) (define-public python-aiosqlite (package (name "python-aiosqlite") (version "0.18.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/omnilib/aiosqlite") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "1a8sggh1wwbpl46k5qcfmp97s9hjysna0x7mwwc53kyfm0m95wf8")))) (build-system pyproject-build-system) (arguments (list #:phases #~(modify-phases %standard-phases (replace 'check (lambda* (#:key tests? #:allow-other-keys) (when tests? (invoke "python" "-m" "coverage" "run" "-m" "aiosqlite.tests") (invoke "python" "-m" "coverage" "report"))))))) (native-inputs (list python-flit-core python-coverage python-mypy)) (home-page "https://github.com/jreese/aiosqlite") (synopsis "Asyncio bridge for sqlite3") (description "The package aiosqlite replicates the standard sqlite3 module, but with async versions of all the standard connection and cursor methods, and context managers for automatically closing connections.") (license license:expat))) (define-public python-aiosqlite-0.17 (package (inherit python-aiosqlite) (version "0.17.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/omnilib/aiosqlite") (commit (string-append "v" version)))) (file-name (git-file-name (package-name python-aiosqlite) version)) (sha256 (base32 "1agh7b9g7rgryvb8flph85i8m80ai1rinpljxzlsrs0s0y616qgg")))) (build-system pyproject-build-system) (arguments '(#:phases (modify-phases %standard-phases (replace 'check (lambda* (#:key tests? #:allow-other-keys) (if tests? (invoke "python" "-m" "unittest" "aiosqlite.tests") (format #t "test suite not run~%"))))))) (propagated-inputs (list python-typing-extensions)) (native-inputs (list python-flit-core python-aiounittest)))) (define-public python-databases (package (name "python-databases") (version "0.7.0") (source (origin (method url-fetch) (uri (pypi-uri "databases" version)) (sha256 (base32 "0x5nqhzgjqimv2ybjbzy5vv0l23g0n1g5f6fnyahbf1f7nfl2bga")))) (build-system python-build-system) (propagated-inputs (list python-aiosqlite python-aiopg python-aiomysql python-asyncpg python-asyncmy python-sqlalchemy)) (home-page "https://github.com/encode/databases") (synopsis "Asynchronous database abstraction library") (description "Databases provides a wrapper around asynchronous database libraries with SQLALchemy.") (license license:bsd-3))) (define-public python-psycopg2 (package (name "python-psycopg2") (version "2.9.6") (source (origin (method url-fetch) (uri (pypi-uri "psycopg2" version)) (sha256 (base32 "04chl9f7v7k1zssa40pmk06jvpyqiss2lpjq50dq69nqix0mhlgi")))) (build-system python-build-system) (arguments ;; Tests would require a postgresql database "psycopg2_test" ;; and a running postgresql database management service. '(#:tests? #f)) ; TODO re-enable after providing a test-db. (inputs (list postgresql)) ; libpq (home-page "https://www.psycopg.org/") (synopsis "Python PostgreSQL adapter") (description "psycopg2 is a thread-safe PostgreSQL adapter that implements DB-API 2.0.") (license license:lgpl3+))) (define-public python-psycopg-pool (package (name "python-psycopg-pool") ;; The connection pooling code is on a different release cadence ;; from the driver code, so fetch the latest PyPI release. (version "3.1.7") (source (origin (method url-fetch) (uri (pypi-uri "psycopg-pool" version)) (sha256 (base32 "1pkx7nj1mhacwpna7ldzqfqxd1xg8826600r0bs9ad1h93f429yh")))) (build-system python-build-system) (arguments (list #:tests? #f ;run for psycopg below #:phases #~(modify-phases %standard-phases ;; This module requires 'psycopg', however psycopg needs this ;; for its tests. Disable sanity check to break the cycle. (delete 'sanity-check)))) (home-page "https://www.psycopg.org/") (synopsis "Connection pooler for psycopg") (description "This module provides connection pool implementations that can be used with the @code{psycopg} PostgreSQL driver.") (license license:lgpl3+))) (define-public python-psycopg (package (name "python-psycopg") (version "3.1.10") (source (origin ;; Fetch from git because PyPI contains only cythonized sources. (method git-fetch) (uri (git-reference (url "https://github.com/psycopg/psycopg") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "0hqk45wlaflz69cy1r0hbv11bwb89p6hjb7zmgqas26gdhg37n0r")))) (build-system python-build-system) (arguments (list #:phases #~(modify-phases %standard-phases (add-before 'build 'change-directory (lambda _ (chdir "psycopg"))) (add-after 'build 'build-c-extensions (lambda _ (with-directory-excursion "../psycopg_c" ((assoc-ref %standard-phases 'build))))) (add-after 'install 'install-c-extensions (lambda* (#:key inputs outputs #:allow-other-keys) ;; For some reason setup.py refuses to install if the ;; installation directory is not on PYTHONPATH. (setenv "PYTHONPATH" (site-packages inputs outputs)) (with-directory-excursion "../psycopg_c" ((assoc-ref %standard-phases 'install) #:inputs inputs #:outputs outputs)))) (add-before 'check 'start-postgresql (lambda _ (let ((dbdir (string-append (getcwd) "/../pgdir"))) (invoke "initdb" "-D" dbdir) (invoke "pg_ctl" "-D" dbdir "-o" (string-append "-k " dbdir) "-l" (string-append dbdir "/db.log") "start") (invoke "psql" "-h" dbdir "-d" "postgres" "-c" "CREATE DATABASE nixbld;")))) (replace 'check (lambda* (#:key inputs tests? #:allow-other-keys) (when tests? (setenv "TZDIR" (search-input-directory inputs "share/zoneinfo")) (with-directory-excursion ".." (invoke "pytest" "-vv" "-o" "asyncio_mode=auto" ;; FIXME: Many of the typing tests are failing, ;; conveniently tagged as slow... "-k" "not slow"))))) ;; The sanity check phase attempts loading the C extension ;; before the Python library, which results in the following: ;; <ImportError: the psycopg package should be imported ;; before psycopg_c>. (delete 'sanity-check)))) (native-inputs (list python-cython-3 python-mypy python-psycopg-pool python-pytest python-pytest-asyncio python-anyio python-tenacity pproxy tzdata-for-tests)) (inputs (list postgresql)) (home-page "https://www.psycopg.org/") (synopsis "PostgreSQL driver for Python") (description "Psycopg 3 is a new implementation of the popular @code{psycopg2} database adapter for Python.") (license license:lgpl3+))) (define-public python-sadisplay (package (name "python-sadisplay") (version "0.4.9") (source (origin (method url-fetch) (uri (pypi-uri "sadisplay" version)) (sha256 (base32 "15jxwgla3q4xsp6rw8inqaiy1kdzc8l2cixj8amqcf0ji47icrxg")))) (build-system python-build-system) (arguments '(#:phases (modify-phases %standard-phases (replace 'check (lambda* (#:key tests? #:allow-other-keys) (if tests? (begin (setenv "PYTHONPATH" (string-append ".:" (or (getenv "PYTHONPATH") ""))) (invoke "pytest" "-vv")) (format #t "test suite not run~%"))))))) (propagated-inputs (list python-sqlalchemy)) (native-inputs ;; For tests. (list python-pytest)) (home-page "https://bitbucket.org/estin/sadisplay") (synopsis "SQLAlchemy schema displayer") (description "This package provides a program to build Entity Relationship diagrams from a SQLAlchemy model (or directly from the database).") (license license:bsd-3))) (define-public yoyo-migrations (package (name "yoyo-migrations") (version "8.2.0") (source (origin ;; We use the upstream repository, as the tests are not included in the ;; PyPI releases. (method hg-fetch) (uri (hg-reference (url "https://hg.sr.ht/~olly/yoyo") (changeset (string-append "v" version "-release")))) (file-name (string-append name "-" version "-checkout")) (sha256 (base32 "1al030ix0w63hr4s3mqry6s0mlqdj8p242pdqks06br7c25nx3yj")))) (build-system python-build-system) (arguments ;; XXX: Tests require a connection to some pgsql database and psycopg ;; fails to connect to it. '(#:tests? #f)) (propagated-inputs (list python-sqlparse python-tabulate python-importlib-metadata)) (home-page "https://ollycope.com/software/yoyo/latest/") (synopsis "Database migrations with SQL") (description "Yoyo is a database schema migration tool. Migrations are written as SQL files or Python scripts that define a list of migration steps.") (license license:asl2.0))) (define-public python-mysqlclient (package (name "python-mysqlclient") (version "2.2.4") (source (origin (method url-fetch) (uri (pypi-uri "mysqlclient" version)) (sha256 (base32 "0hdznfz9095d2qhl7awbp39s7wpqbxn37xzan487qzaf8srrzg1k")))) (build-system pyproject-build-system) (arguments (list #:test-flags #~'("tests/test__mysql.py" ;tests not needing a live db "tests/test_MySQLdb_times.py"))) (native-inputs (list pkg-config python-pytest python-setuptools python-wheel)) (inputs (list mariadb-connector-c)) (home-page "https://github.com/PyMySQL/mysqlclient") (synopsis "MySQLdb is an interface to the popular MySQL database server for Python") (description "MySQLdb is an interface to the popular MySQL database server for Python. The design goals are: @enumerate @item Compliance with Python database API version 2.0 [PEP-0249], @item Thread-safety, @item Thread-friendliness (threads will not block each other). @end enumerate") (license license:gpl2))) (define-public python-hiredis (package (name "python-hiredis") (version "2.2.2") (source (origin (method git-fetch) ;for tests (uri (git-reference (url "https://github.com/redis/hiredis-py") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "066rm5m7aa8skm0a57cf45153bwmbl9yyi4s60an14hb25n947gi")) (patches (search-patches "python-hiredis-fix-header.patch" "python-hiredis-use-system-hiredis.patch")))) (build-system pyproject-build-system) (arguments (list #:phases #~(modify-phases %standard-phases (add-before 'check 'delete-extraneous-__init__.py (lambda _ ;; The fix was forwarded upstream, see: ;; https://github.com/redis/hiredis-py/pull/160. (delete-file "tests/__init__.py")))))) (native-inputs (list python-pytest python-setuptools python-wheel)) (inputs (list hiredis)) (home-page "https://github.com/redis/hiredis-py") (synopsis "Python extension that wraps protocol parsing code in hiredis") (description "Python-hiredis is a python extension that wraps protocol parsing code in hiredis. It primarily speeds up parsing of multi bulk replies.") (license license:bsd-3))) (define-public python-fakeredis (package (name "python-fakeredis") (version "2.26.1") (source (origin (method git-fetch) ;for tests (uri (git-reference (url "https://github.com/cunla/fakeredis-py") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "10f9qwpc9vlcd2411c398n9kwjsk399vk1pjd9dbczlhvsn9s5bq")))) (build-system pyproject-build-system) (arguments (list #:test-flags '(list "-m" "not slow") #:phases #~(modify-phases %standard-phases (add-after 'unpack 'poetry-compatibility (lambda _ ;; Our version of poetry does not understand "to". (substitute* "pyproject.toml" ((", to = \"fakeredis\" ") "")))) (add-after 'unpack 'relax-requirements (lambda _ (substitute* "pyproject.toml" (("sortedcontainers = \"\\^2\\.4\"") "sortedcontainers = \"^2.1\"")))) ;; Tests require a running Redis server. (add-before 'check 'start-redis (lambda* (#:key tests? #:allow-other-keys) (when tests? (invoke "redis-server" "--daemonize" "yes" "--port" "6390"))))))) (native-inputs (list python-poetry-core python-pytest python-pytest-asyncio python-pytest-mock redis)) (propagated-inputs (list python-redis python-sortedcontainers python-typing-extensions)) (home-page "https://github.com/cunla/fakeredis-py") (synopsis "Fake implementation of redis API for testing purposes") (description "Fakeredis is a pure-Python implementation of the redis-py Python client that simulates talking to a redis server. It was created for a single purpose: to write unit tests. Setting up redis is not hard, but one often wants to write unit tests that don't talk to an external server such as redis. This module can be used as a reasonable substitute.") (license license:bsd-3))) (define-public python-redis (package (name "python-redis") (version "5.2.0") (source (origin ;; The PyPI archive lacks some test resources such as the TLS ;; certificates under docker/stunnel/keys. (method git-fetch) (uri (git-reference (url "https://github.com/redis/redis-py") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "0f38s704gpm8ra6vdrqhicfq7m77in60kbgcmhvmviq9qj6v3505")))) (build-system pyproject-build-system) (arguments (list #:test-flags #~(list "-m" ;; These tests are disabled in the official CI run (see: ;; https://raw.githubusercontent.com/redis/redis-py/master/ ;; .github/workflows/install_and_test.sh). (string-append "not onlycluster " "and not redismod " "and not ssl " "and not graph") "-k" (string-join (list ;; The autoclaim test fails with "AssertionError: assert ;; [b'0-0', [], []] == [b'0-0', []]". "not test_xautoclaim " ;; These tests cause the following error: "Error 111 ;; connecting to localhost:6380. Connection refused." ;; (see: https://github.com/redis/redis-py/issues/2109). "test_sync" "test_psync" ;; Same with: "Error 111 connecting to ;; localhost:6479. Connection refused." "test_tfcall" "test_tfunction_load_delete" "test_tfunction_list" ;; AssertionError: assert 3 == 2 "test_acl_list") " and not ")) #:phases #~(modify-phases %standard-phases ;; Tests require a running Redis server. (add-before 'check 'start-redis (lambda* (#:key tests? #:allow-other-keys) (when tests? (invoke "redis-server" "--daemonize" "yes" "--enable-debug-command" "yes" "--enable-module-command" "local"))))))) (native-inputs (list python-numpy python-pytest python-pytest-asyncio-0.23 python-pytest-cov python-pytest-timeout python-setuptools python-wheel redis)) (propagated-inputs (list python-async-timeout)) (home-page "https://github.com/redis/redis-py") (synopsis "Redis Python client") (description "This package provides a Python interface to the Redis key-value store.") (license license:expat))) (define-public python-aioredis (deprecated-package "python-aioredis" python-redis)) (define-public python-rq (package (name "python-rq") (version "1.11.1") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/rq/rq") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "0dnjm2s036l4j4ypq0h903vh132dp2wiwjrn8jicz1nw829dqpzf")))) (build-system python-build-system) (arguments '(#:phases (modify-phases %standard-phases (add-before 'check 'start-redis (lambda _ (invoke "redis-server" "--daemonize" "yes"))) (replace 'check (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) ;; Drop test that needs the SDK for Sentry.io. (delete-file "tests/test_sentry.py") ;; Ensure 'rq' and 'rqworker' ends up on PATH. (setenv "PATH" (string-append out "/bin:" (getenv "PATH"))) (invoke "pytest" "-vv"))))))) (native-inputs (list python-mock python-psutil python-pytest redis)) (propagated-inputs (list python-click python-redis)) (home-page "https://python-rq.org/") (synopsis "Simple job queues for Python") (description "RQ (Redis Queue) is a simple Python library for queueing jobs and processing them in the background with workers. It is backed by Redis and it is designed to have a low barrier to entry.") (license license:bsd-2))) (define-public python-rq-scheduler (package (name "python-rq-scheduler") (version "0.10.0") (home-page "https://github.com/rq/rq-scheduler") (source (origin (method git-fetch) (uri (git-reference (url home-page) (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "0xg6yazqs5kbr2ayvhvljs1h5vgx5k5dds613fmhswln7gglf9hk")))) (build-system python-build-system) (arguments '(#:phases (modify-phases %standard-phases (add-before 'check 'start-redis (lambda _ (invoke "redis-server" "--daemonize" "yes"))) (replace 'check (lambda _ (substitute* "run_tests.py" (("/usr/bin/env") (which "env"))) (invoke "./run_tests.py")))))) (native-inputs (list redis which)) (propagated-inputs (list python-croniter python-rq)) (synopsis "Job scheduling capabilities for RQ (Redis Queue)") (description "This package provides job scheduling capabilities to @code{python-rq} (Redis Queue).") (license license:expat))) (define-public python-sqlparse (package (name "python-sqlparse") (version "0.4.3") (source (origin (method url-fetch) (uri (pypi-uri "sqlparse" version)) (sha256 (base32 "0s3jyllg0ka0n7pgqfng1hzvh39li853dr40qcp4s4dv8r481jk9")))) (build-system python-build-system) (arguments `(#:phases (modify-phases %standard-phases (replace 'check (lambda _ (invoke "py.test"))) ;; XXX: The regular wrap phase ends up storing pytest as a runtime ;; dependency. See <https://bugs.gnu.org/25235>. (replace 'wrap (lambda* (#:key native-inputs inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (python (assoc-ref (or native-inputs inputs) "python")) (sitedir (string-append "/lib/python" (python-version python) "/site-packages"))) (wrap-program (string-append out "/bin/sqlformat") `("PYTHONPATH" ":" prefix ,(map (lambda (output) (string-append output sitedir)) (list python out)))))))))) (native-inputs (list python-pytest)) (inputs (list bash-minimal)) (home-page "https://github.com/andialbrecht/sqlparse") (synopsis "Non-validating SQL parser") (description "Sqlparse is a non-validating SQL parser for Python. It provides support for parsing, splitting and formatting SQL statements.") (license license:bsd-3) (properties '((cpe-name . "sqlparse"))))) (define-public python-sql (package (name "python-sql") (version "1.3.0") (source (origin (method url-fetch) (uri (pypi-uri "python-sql" version)) (sha256 (base32 "0xnimfzlxj1ddrb5xj3s4gaii278a0gpxrvwmdmrdxgjfdi3lq4x")))) (build-system python-build-system) (home-page "https://python-sql.tryton.org/") (synopsis "Library to write SQL queries in a pythonic way") (description "@code{python-sql} is a library to write SQL queries, that transforms idiomatic python function calls to well-formed SQL queries.") (license license:bsd-3))) (define-public python-pypika (package (name "python-pypika") (version "0.47.6") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/kayak/pypika") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "001pg36sw9a36zdd1kccbymcxndphjcjbbrsy6ri7ng8h4dgz549")))) (build-system python-build-system) (native-inputs (list python-parameterized)) (home-page "https://github.com/kayak/pypika") (synopsis "SQL query builder API for Python") (description "PyPika is a python SQL query builder that exposes the full richness of the SQL language using a syntax that reflects the resulting query.") (license license:asl2.0))) (define-public apache-orc (package (name "apache-orc") (version "2.0.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/apache/orc") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "1fi6d045wakks0x8clplyxgal342kljqjql7vq5gbd6a2qnaz6m2")))) (build-system cmake-build-system) (arguments (list #:build-type "Release" #:configure-flags #~(list "-DBUILD_JAVA=OFF" "-DINSTALL_VENDORED_LIBS=OFF" "-DCMAKE_CXX_FLAGS=-fPIC" (string-append "-DGTEST_HOME=" #$(this-package-native-input "googletest")) (string-append "-DZSTD_HOME=" (assoc-ref %build-inputs "zstd:lib")) (string-append "-DZLIB_HOME=" #$(this-package-input "zlib")) (string-append "-DPROTOBUF_HOME=" #$(this-package-input "protobuf")) (string-append "-DLZ4_HOME=" #$(this-package-input "lz4")) (string-append "-DSNAPPY_HOME=" #$(this-package-input "snappy"))) #:phases #~(modify-phases %standard-phases (add-after 'unpack 'disable-bad-test (lambda _ ;; This one test fails with an obscure error: ;; ;; Expected: (std::string::npos) != (error.find(error_msg)), ;; actual: 18446744073709551615 vs 18446744073709551615 (substitute* "tools/test/TestFileScan.cc" (("findProgram\\(\"tools/src/orc-scan\"\\);" m) (string-append m "return;"))))) (add-after 'unpack 'do-not-download-orc-format (lambda _ (substitute* "cmake_modules/ThirdpartyToolchain.cmake" (("URL \"https://archive.apache.org/dist/orc/orc-format.*") (string-append "URL \"file://" #$(this-package-native-input "orc-format") "\"\n"))))) (add-after 'unpack 'timezone-fallback (lambda _ ;; In the build container we don't have /etc/localtime (substitute* "c++/src/Timezone.cc" (("return getTimezoneByFilename\\(LOCAL_TIMEZONE\\);") "if (!std::filesystem::exists(std::filesystem::path(LOCAL_TIMEZONE))) { return getTimezoneByName(\"UTC\"); } return getTimezoneByFilename(LOCAL_TIMEZONE);")))) (add-before 'check 'pre-check (lambda* (#:key inputs #:allow-other-keys) (setenv "TZDIR" (search-input-directory inputs "share/zoneinfo"))))))) (inputs `(("lz4" ,lz4) ("protobuf" ,protobuf) ("snappy" ,snappy) ("zlib" ,zlib "static") ("zstd" ,zstd) ("zstd:lib" ,zstd "lib"))) (native-inputs `(("googletest" ,googletest) ("orc-format" ,(origin (method url-fetch) (uri "https://archive.apache.org/dist/orc/orc-format-1.0.0/\ orc-format-1.0.0.tar.gz") (sha256 (base32 "1mccbna3mqhhlqs4pw0fa4pgjnq4c41jhxrh84mq27sbz5gsx7vk")))) ("pkg-config" ,pkg-config) ("tzdata" ,tzdata-for-tests))) (home-page "https://orc.apache.org/") (synopsis "Columnar storage for Hadoop workloads") (description "ORC is a self-describing type-aware columnar file format designed for Hadoop workloads. It is optimized for large streaming reads, but with integrated support for finding required rows quickly.") (license license:asl2.0))) ;; There are many wrappers for this in other languages. When touching, please ;; be sure to ensure all dependencies continue to build. (define-public apache-arrow (package (name "apache-arrow") (version "17.0.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/apache/arrow") (commit (string-append "apache-arrow-" version)))) (file-name (git-file-name name version)) (sha256 (base32 "11yzhqdvvcq8k4dhcfnwhc0hl0a2k09gyijln00zbglajk7ihfsk")))) (build-system cmake-build-system) (arguments (list #:tests? #f #:phases #~(modify-phases %standard-phases (add-before 'configure 'enter-source-directory (lambda _ (chdir "cpp"))) (add-after 'unpack 'set-env (lambda* (#:key inputs #:allow-other-keys) (substitute* "cpp/cmake_modules/ThirdpartyToolchain.cmake" (("set\\(xsimd_SOURCE.*") "")) (setenv "BOOST_ROOT" #$(this-package-input "boost")) (setenv "BROTLI_HOME" #$(this-package-input "brotli")) (setenv "FLATBUFFERS_HOME" #$(this-package-input "flatbuffers")) (setenv "RAPIDJSON_HOME" #$(this-package-input "rapidjson"))))) #:build-type "Release" #:configure-flags #~(list "-DARROW_PYTHON=ON" ;; Parquet options "-DARROW_PARQUET=ON" "-DPARQUET_BUILD_EXECUTABLES=ON" ;; The maintainers disallow using system versions of ;; jemalloc: ;; https://issues.apache.org/jira/browse/ARROW-3507. This ;; is unfortunate because jemalloc increases performance: ;; https://arrow.apache.org/blog/2018/07/20/jemalloc/. "-DARROW_JEMALLOC=OFF" ;; The CMake option ARROW_DEPENDENCY_SOURCE is a global ;; option that instructs the build system how to resolve ;; each dependency. SYSTEM = Finding the dependency in ;; system paths using CMake's built-in find_package ;; function, or using pkg-config for packages that do not ;; have this feature "-DARROW_DEPENDENCY_SOURCE=SYSTEM" "-Dxsimd_SOURCE=SYSTEM" "-DARROW_RUNTIME_SIMD_LEVEL=NONE" "-DARROW_SIMD_LEVEL=NONE" "-DARROW_PACKAGE_KIND=Guix" ;; Split output into its component packages. (string-append "-DCMAKE_INSTALL_PREFIX=" #$output:lib) (string-append "-DCMAKE_INSTALL_RPATH=" #$output:lib "/lib") (string-append "-DCMAKE_INSTALL_BINDIR=" #$output "/bin") (string-append "-DCMAKE_INSTALL_INCLUDEDIR=" #$output:include "/share/include") "-DARROW_WITH_SNAPPY=ON" "-DARROW_WITH_ZLIB=ON" "-DARROW_WITH_ZSTD=ON" "-DARROW_WITH_LZ4=ON" "-DARROW_COMPUTE=ON" "-DARROW_CSV=ON" "-DARROW_DATASET=ON" "-DARROW_FILESYSTEM=ON" "-DARROW_HDFS=ON" "-DARROW_JSON=ON" ;; Arrow Python C++ integration library (required for ;; building pyarrow). This library must be built against ;; the same Python version for which you are building ;; pyarrow. NumPy must also be installed. Enabling this ;; option also enables ARROW_COMPUTE, ARROW_CSV, ;; ARROW_DATASET, ARROW_FILESYSTEM, ARROW_HDFS, and ;; ARROW_JSON. "-DARROW_PYTHON=ON" "-DARROW_ORC=ON" "-DORC_SOURCE=SYSTEM" ;; Building the tests forces on all the ;; optional features and the use of static ;; libraries. "-DARROW_BUILD_TESTS=OFF" ;;"-DBENCHMARK_ENABLE_TESTING=OFF" "-DARROW_BUILD_STATIC=OFF"))) (inputs (list apache-orc boost brotli bzip2 double-conversion gflags glog grpc protobuf python python-numpy rapidjson re2 snappy xsimd)) ;; These are all listed under Requires.private in arrow.pc (propagated-inputs (list `(,apache-thrift "lib") lz4 utf8proc zlib `(,zstd "lib"))) (native-inputs (list pkg-config)) (outputs '("out" "lib" "include")) (home-page "https://arrow.apache.org/") (synopsis "Columnar in-memory analytics") (description "Apache Arrow is a columnar in-memory analytics layer designed to accelerate big data. It houses a set of canonical in-memory representations of flat and hierarchical data along with multiple language-bindings for structure manipulation. It also provides IPC and common algorithm implementations.") (license license:asl2.0))) (define-public apache-arrow-for-ceph (package (name "apache-arrow") (version "6.0.1") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/apache/arrow") (commit (string-append "apache-arrow-" version)))) (file-name (git-file-name name version)) (sha256 (base32 "0mcw361akqw4sxnnpnr9c9v1zk4hphk6gcq763pcb19yzljh88ig")))) (build-system cmake-build-system) (arguments `(#:tests? #f #:phases (modify-phases %standard-phases (add-before 'configure 'enter-source-directory (lambda _ (chdir "cpp"))) (add-after 'unpack 'set-env (lambda* (#:key inputs #:allow-other-keys) (substitute* "cpp/src/parquet/parquet.pc.in" (("includedir=\\$\\{prefix\\}/") "includedir=")) (substitute* "cpp/cmake_modules/ThirdpartyToolchain.cmake" (("set\\(xsimd_SOURCE.*") "")) (setenv "BOOST_ROOT" (assoc-ref inputs "boost")) (setenv "BROTLI_HOME" (assoc-ref inputs "brotli")) (setenv "FLATBUFFERS_HOME" (assoc-ref inputs "flatbuffers")) (setenv "RAPIDJSON_HOME" (assoc-ref inputs "rapidjson"))))) #:build-type "Release" #:configure-flags (list "-DARROW_PYTHON=ON" "-DARROW_GLOG=ON" ;; Parquet options "-DARROW_PARQUET=ON" "-DPARQUET_BUILD_EXECUTABLES=ON" ;; The maintainers disallow using system versions of ;; jemalloc: ;; https://issues.apache.org/jira/browse/ARROW-3507. This ;; is unfortunate because jemalloc increases performance: ;; https://arrow.apache.org/blog/2018/07/20/jemalloc/. "-DARROW_JEMALLOC=OFF" ;; The CMake option ARROW_DEPENDENCY_SOURCE is a global ;; option that instructs the build system how to resolve ;; each dependency. SYSTEM = Finding the dependency in ;; system paths using CMake's built-in find_package ;; function, or using pkg-config for packages that do not ;; have this feature "-DARROW_DEPENDENCY_SOURCE=SYSTEM" "-Dxsimd_SOURCE=SYSTEM" "-DARROW_RUNTIME_SIMD_LEVEL=NONE" "-DARROW_SIMD_LEVEL=NONE" "-DARROW_PACKAGE_KIND=Guix" ;; Split output into its component packages. (string-append "-DCMAKE_INSTALL_PREFIX=" (assoc-ref %outputs "lib")) (string-append "-DCMAKE_INSTALL_RPATH=" (assoc-ref %outputs "lib") "/lib") (string-append "-DCMAKE_INSTALL_BINDIR=" (assoc-ref %outputs "out") "/bin") (string-append "-DCMAKE_INSTALL_INCLUDEDIR=" (assoc-ref %outputs "include") "/share/include") "-DARROW_WITH_SNAPPY=ON" "-DARROW_WITH_ZLIB=ON" "-DARROW_WITH_ZSTD=ON" "-DARROW_WITH_LZ4=ON" "-DARROW_COMPUTE=ON" "-DARROW_CSV=ON" "-DARROW_DATASET=ON" "-DARROW_FILESYSTEM=ON" "-DARROW_HDFS=ON" "-DARROW_JSON=ON" ;; Arrow Python C++ integration library (required for ;; building pyarrow). This library must be built against ;; the same Python version for which you are building ;; pyarrow. NumPy must also be installed. Enabling this ;; option also enables ARROW_COMPUTE, ARROW_CSV, ;; ARROW_DATASET, ARROW_FILESYSTEM, ARROW_HDFS, and ;; ARROW_JSON. "-DARROW_PYTHON=ON" ;; Building the tests forces on all the ;; optional features and the use of static ;; libraries. "-DARROW_BUILD_TESTS=OFF" "-DBENCHMARK_ENABLE_GTEST_TESTS=OFF" ;;"-DBENCHMARK_ENABLE_TESTING=OFF" "-DARROW_BUILD_STATIC=OFF"))) (inputs (list boost brotli bzip2 double-conversion gflags glog grpc protobuf python python-numpy rapidjson re2 snappy xsimd)) ;; These are all listed under Requires.private in arrow.pc (propagated-inputs (list (list apache-thrift "lib") lz4 utf8proc zlib (list zstd "lib"))) (native-inputs (list pkg-config)) (outputs '("out" "lib" "include")) (home-page "https://arrow.apache.org/") (synopsis "Columnar in-memory analytics") (description "Apache Arrow is a columnar in-memory analytics layer designed to accelerate big data. It houses a set of canonical in-memory representations of flat and hierarchical data along with multiple language-bindings for structure manipulation. It also provides IPC and common algorithm implementations.") (license license:asl2.0))) (define-public apache-arrow-0.16 (package (name "apache-arrow") (version "0.16.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/apache/arrow") (commit (string-append "apache-arrow-" version)))) (file-name (git-file-name name version)) (sha256 (base32 "15bplqy5708bxy1mynzjkd3d2g8v2wd36z8l0ap8yyyq54l3gdvy")))) (build-system cmake-build-system) (arguments `(#:tests? #f #:phases (modify-phases %standard-phases (add-before 'configure 'enter-source-directory (lambda _ (chdir "cpp") (substitute* "src/parquet/CMakeLists.txt" ((" parquet_constants.cpp") "") (("set\\(THRIFT_OUTPUT_FILES \\$\\{THRIFT_OUTPUT_FILES\\}.*") "") ((".*\"\\$\\{THRIFT_OUTPUT_DIR\\}/parquet_constants.cpp\"\\).*") "")))) (add-after 'unpack 'set-env (lambda _ (setenv "BOOST_ROOT" (assoc-ref %build-inputs "boost")) (setenv "BROTLI_HOME" (assoc-ref %build-inputs "brotli")) (setenv "FLATBUFFERS_HOME" (assoc-ref %build-inputs "flatbuffers")) (setenv "RAPIDJSON_HOME" (assoc-ref %build-inputs "rapidjson"))))) #:build-type "Release" #:configure-flags (list "-DARROW_PYTHON=ON" "-DARROW_GLOG=ON" "-DARROW_SSE42=OFF" "-DARROW_BOOST_USE_SHARED=ON" ;; Parquet options "-DARROW_PARQUET=ON" ;; The maintainers disallow using system versions of ;; jemalloc: ;; https://issues.apache.org/jira/browse/ARROW-3507. This ;; is unfortunate because jemalloc increases performance: ;; https://arrow.apache.org/blog/2018/07/20/jemalloc/. "-DARROW_JEMALLOC=OFF" ;; The CMake option ARROW_DEPENDENCY_SOURCE is a global ;; option that instructs the build system how to resolve ;; each dependency. SYSTEM = Finding the dependency in ;; system paths using CMake's built-in find_package ;; function, or using pkg-config for packages that do not ;; have this feature "-DARROW_DEPENDENCY_SOURCE=SYSTEM" ;; Split output into its component packages. (string-append "-DCMAKE_INSTALL_PREFIX=" (assoc-ref %outputs "out")) (string-append "-DCMAKE_INSTALL_RPATH=" (assoc-ref %outputs "out") "/lib") (string-append "-DCMAKE_INSTALL_BINDIR=" (assoc-ref %outputs "out") "/bin") (string-append "-DCMAKE_INSTALL_INCLUDEDIR=" (assoc-ref %outputs "include") "/share/include") "-DARROW_WITH_SNAPPY=ON" "-DARROW_WITH_ZLIB=ON" "-DARROW_WITH_ZSTD=ON" "-DARROW_WITH_LZ4=ON" "-DARROW_COMPUTE=ON" "-DARROW_CSV=ON" "-DARROW_DATASET=ON" "-DARROW_FILESYSTEM=ON" "-DARROW_HDFS=ON" "-DARROW_JSON=ON" ;; Arrow Python C++ integration library (required for ;; building pyarrow). This library must be built against ;; the same Python version for which you are building ;; pyarrow. NumPy must also be installed. Enabling this ;; option also enables ARROW_COMPUTE, ARROW_CSV, ;; ARROW_DATASET, ARROW_FILESYSTEM, ARROW_HDFS, and ;; ARROW_JSON. "-DARROW_PYTHON=ON" ;; Building the tests forces on all the ;; optional features and the use of static ;; libraries. "-DARROW_BUILD_TESTS=OFF" "-DBENCHMARK_ENABLE_GTEST_TESTS=OFF" ;;"-DBENCHMARK_ENABLE_TESTING=OFF" "-DARROW_BUILD_STATIC=OFF"))) (inputs `(("boost" ,boost) ("brotli" ,brotli) ("double-conversion" ,double-conversion) ("snappy" ,snappy) ("gflags" ,gflags) ("glog" ,glog) ("apache-thrift" ,apache-thrift "lib") ("protobuf" ,protobuf) ("rapidjson" ,rapidjson) ("zlib" ,zlib) ("bzip2" ,bzip2) ("lz4" ,lz4) ("zstd" ,zstd "lib") ("re2" ,re2) ("grpc" ,grpc) ("python-3" ,python) ("python-numpy" ,python-numpy))) (native-inputs (list pkg-config apache-thrift)) (outputs '("out" "include")) (home-page "https://arrow.apache.org/") (synopsis "Columnar in-memory analytics") (description "Apache Arrow is a columnar in-memory analytics layer designed to accelerate big data. It houses a set of canonical in-memory representations of flat and hierarchical data along with multiple language-bindings for structure manipulation. It also provides IPC and common algorithm implementations.") (license license:asl2.0))) (define-public python-pyarrow (package (inherit apache-arrow) (name "python-pyarrow") (build-system python-build-system) (arguments (list ;; XXX: Test data is distributed sepratly in ;; <https://github.com/apache/arrow-testing> 39MiB and requires ;; additional steps to be implemented, see ;; <https://github.com/apache/arrow/blob/main/ci/scripts/python_build.sh>. #:tests? #f #:phases #~(modify-phases %standard-phases (delete 'build) ; XXX the build is performed again during the install phase (add-after 'unpack 'enter-source-directory (lambda _ (chdir "python"))) (add-after 'enter-source-directory 'set-version (lambda _ ;; XXX: This python-setuptools-scm option is available in v8+: ;; TypeError: Configuration.__init__() got an unexpected ;; keyword argument 'version_file' (substitute* "pyproject.toml" (("version_file = .*") "")) ;; Version file generation ad-hoc, remove when a newer version ;; of python-setuptools-scm is packed. (with-output-to-file "pyarrow/_generated_version.py" (let* ((version #$(package-version this-package) ) (version-tuple (string-join (string-split version #\.) ", "))) (lambda () (format #t "__version__ = version = '~a' __version_tuple__ = version_tuple = (~a)~%" version version-tuple)))))) (add-before 'install 'set-pyarrow-build-options (lambda _ (setenv "PYARROW_BUNDLE_ARROW_CPP_HEADERS" "0") (setenv "PYARROW_CMAKE_OPTIONS" (string-append "-DCMAKE_INSTALL_RPATH=" #$output)) (setenv "PYARROW_PARALLEL" (number->string (parallel-job-count))) (setenv "PYARROW_WITH_DATASET" "1") (setenv "PYARROW_WITH_HDFS" "1") (setenv "PYARROW_WITH_ORC" "1") (setenv "PYARROW_WITH_PARQUET" "1")))))) (propagated-inputs (list (list apache-arrow "lib") (list apache-arrow "include") apache-orc python-numpy python-pandas python-six)) (native-inputs (list cmake-minimal pkg-config python-cython python-pytest python-pytest-runner python-setuptools-scm)) (outputs '("out")) (home-page "https://arrow.apache.org/docs/python/") (synopsis "Python bindings for Apache Arrow") (description "This library provides a Pythonic API wrapper for the reference Arrow C++ implementation, along with tools for interoperability with pandas, NumPy, and other traditional Python scientific computing packages.") (license license:asl2.0))) (define-public python-pyarrow-0.16 (package (inherit apache-arrow-0.16) (name "python-pyarrow") (build-system python-build-system) (arguments '(#:tests? #f ; XXX There are no tests in the "python" directory #:phases (modify-phases %standard-phases (delete 'build) ; XXX the build is performed again during the install phase (add-after 'unpack 'enter-source-directory (lambda _ (chdir "python"))) (add-after 'unpack 'make-git-checkout-writable (lambda _ (for-each make-file-writable (find-files ".")))) (add-before 'install 'patch-cmake-variables (lambda* (#:key inputs #:allow-other-keys) ;; Replace cmake locations with hardcoded guix links for the ;; underlying C++ library and headers. This is a pretty awful ;; hack. (substitute* "cmake_modules/FindParquet.cmake" (("# Licensed to the Apache Software Foundation" m) (string-append "set(PARQUET_INCLUDE_DIR \"" (assoc-ref inputs "apache-arrow:include") "/share/include\")\n" m)) (("find_package_handle_standard_args" m) (string-append "set(PARQUET_LIB_DIR \"" (assoc-ref inputs "apache-arrow:lib") "/lib\")\n" m))))) (add-before 'install 'patch-parquet-library (lambda _ (substitute* "CMakeLists.txt" (("parquet_shared") "parquet")))) (add-before 'install 'set-PYARROW_WITH_PARQUET (lambda _ (setenv "PYARROW_WITH_PARQUET" "1")))))) (propagated-inputs `(("apache-arrow:lib" ,apache-arrow-0.16) ("apache-arrow:include" ,apache-arrow-0.16 "include") ("python-numpy" ,python-numpy) ("python-pandas" ,python-pandas) ("python-six" ,python-six))) (native-inputs (list cmake-minimal pkg-config python-cython python-pytest python-pytest-runner python-setuptools-scm)) (outputs '("out")) (home-page "https://arrow.apache.org/docs/python/") (synopsis "Python bindings for Apache Arrow") (description "This library provides a Pythonic API wrapper for the reference Arrow C++ implementation, along with tools for interoperability with pandas, NumPy, and other traditional Python scientific computing packages.") (license license:asl2.0))) (define-public python-fastparquet (package (name "python-fastparquet") (version "2024.2.0") (source (origin ;; Fastparquet uses setuptools-scm to find the current version. This ;; only works when we use the PyPI tarball, which does not contain ;; tests. Instead, we use the git-fetch method and set the version via ;; envar. (method git-fetch) (uri (git-reference (url "https://github.com/dask/fastparquet") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "0f32dj1xvd11l0siznqd33dpjlhg9siylcjcfkcdlqfcy45jfj3v")))) (build-system pyproject-build-system) (arguments (list #:test-flags #~(list "--numprocesses" (number->string (parallel-job-count))) #:phases #~(modify-phases %standard-phases (add-after 'unpack 'relax-requirements (lambda _ (substitute* "setup.py" ;; Remove dependencies on git. (("^.*\"git\", \"status\".*$") "") ;; Guix is only compatible with a single version of numpy ;; at a time. We can safely remove this dependency. (("'oldest-supported-numpy'") "")))) (add-before 'build 'pretend-version ;; The version string is usually derived via setuptools-scm, but ;; without the git metadata available, the version string is set ;; to '0.0.0'. (lambda _ (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$version))) (add-before 'check 'build-cython-extensions ;; Cython extensions need to be built for the check phase. (lambda _ (invoke "python" "setup.py" "build_ext" "--inplace")))))) (propagated-inputs (list python-cramjam python-fsspec python-lzo python-numpy python-packaging python-pandas)) (native-inputs (list python-cython python-pytest-runner python-pytest-xdist python-setuptools-scm)) (home-page "https://github.com/dask/fastparquet") (synopsis "Python implementation of the Parquet file format") (description "@code{fastparquet} is a Python implementation of the Parquet file format. @code{fastparquet} is used implicitly by @code{dask}, @code{pandas} and @code{intake-parquet}. It supports the following compression algorithms: @itemize @item Gzip @item Snappy @item Brotli @item LZ4 @item Zstd @item LZO (optionally) @end itemize") (license license:asl2.0))) (define-public python-crate (package (name "python-crate") (version "0.23.2") (source (origin (method url-fetch) (uri (pypi-uri "crate" version)) (sha256 (base32 "0ngmlvi320c5gsxab0s7qgq0ck4jdlcwvb6lbjhnfprafdp56vvx")))) (build-system python-build-system) (propagated-inputs (list python-urllib3)) (home-page "https://github.com/crate/crate-python") (synopsis "CrateDB Python client") (description "This package provides a Python client library for CrateDB. It implements the Python DB API 2.0 specification and includes support for SQLAlchemy.") (license license:asl2.0))) (define-public libdbi (package (name "libdbi") (version "0.9.0") (source (origin (method url-fetch) (uri (string-append "mirror://sourceforge/libdbi/libdbi/libdbi-" version "/libdbi-" version ".tar.gz")) (sha256 (base32 "00s5ra7hdlq25iv23nwf4h1v3kmbiyzx0v9bhggjiii4lpf6ryys")))) (build-system gnu-build-system) (synopsis "Database independent abstraction layer in C") (description "This library implements a database independent abstraction layer in C, similar to the DBI/DBD layer in Perl. Writing one generic set of code, programmers can leverage the power of multiple databases and multiple simultaneous database connections by using this framework.") (home-page "https://libdbi.sourceforge.net/") (license license:lgpl2.1+))) (define-public libdbi-drivers (package (name "libdbi-drivers") (version "0.9.0") (source (origin (method url-fetch) (uri (string-append "mirror://sourceforge/libdbi-drivers/" "libdbi-drivers/libdbi-drivers-" version "/libdbi-drivers-" version ".tar.gz")) (sha256 (base32 "0m680h8cc4428xin4p733azysamzgzcmv4psjvraykrsaz6ymlj3")))) (build-system gnu-build-system) (native-inputs (list ;; For tests. inetutils glibc-locales mariadb)) (inputs `(("libdbi" ,libdbi) ("mariadb:dev" ,mariadb "dev") ("mariadb:lib" ,mariadb "lib") ("postgresql" ,postgresql) ("sqlite" ,sqlite))) (arguments `(#:configure-flags (let ((libdbi (assoc-ref %build-inputs "libdbi")) (mysql:inc (assoc-ref %build-inputs "mariadb:dev")) (mysql:lib (assoc-ref %build-inputs "mariadb:lib")) (postgresql (assoc-ref %build-inputs "postgresql")) (sqlite (assoc-ref %build-inputs "sqlite"))) (list "--disable-docs" (string-append "--with-dbi-incdir=" libdbi "/include") (string-append "--with-dbi-libdir=" libdbi "/lib") "--with-mysql" (string-append "--with-mysql-incdir=" mysql:inc "/include/mysql") (string-append "--with-mysql-libdir=" mysql:lib "/lib") "--with-pgsql" (string-append "--with-pgsql-incdir=" postgresql "/include") (string-append "--with-pgsql-libdir=" postgresql "/lib") "--with-sqlite3" (string-append "--with-sqlite-incdir=" sqlite "/include") (string-append "--with-sqlite-libdir=" sqlite "/lib"))) #:tests? #f ; FIXME: Find why the tests get stuck forever. #:phases (modify-phases %standard-phases (add-after 'unpack 'fix-tests (lambda* (#:key inputs #:allow-other-keys) (substitute* "tests/test_mysql.sh" (("^MYMYSQLD=.*") (string-append "MYMYSQLD=" (assoc-ref inputs "mariadb") "/bin/mysqld"))) #t)) (add-after 'install 'remove-empty-directories (lambda* (#:key outputs #:allow-other-keys) (let ((var (string-append (assoc-ref outputs "out") "/var"))) (delete-file-recursively var)) #t))))) (synopsis "Database drivers for the libdbi framework") (description "The @code{libdbi-drivers} library provides the database specific drivers for the @code{libdbi} framework. The drivers officially supported by @code{libdbi} are: @itemize @item MySQL, @item PostgreSQL, @item SQLite. @end itemize") (home-page "https://libdbi-drivers.sourceforge.net/") (license license:lgpl2.1+))) (define-public soci (package (name "soci") (version "4.0.3") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/SOCI/soci/") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "12aq7pama96l2c1kmfkclb4bvrsxs9a8ppgk5gmzw45w2lg35i0y")))) (build-system cmake-build-system) (propagated-inputs ;; Headers of soci has include-references to headers of these inputs. `(("firebird" ,firebird) ("postgresql" ,postgresql) ("sqlite" ,sqlite) ("odbc" ,unixodbc) ("boost" ,boost) ("mariadb:dev" ,mariadb "dev"))) (arguments `(#:configure-flags ;; C++11 (-DSOCI_CXX11) is OFF by default. hyperledger-iroha needs it. (list "-DCMAKE_CXX_STANDARD=17" "-DSOCI_LIBDIR=lib" ;; This is for relocation when linking statically "-DCMAKE_CXX_FLAGS=-fPIE") #:tests? #f)) ; may require running database management systems (synopsis "C++ Database Access Library") (description "SOCI is an abstraction layer for several database backends, including PostreSQL, SQLite, ODBC and MySQL.") (home-page "https://soci.sourceforge.net/") (license license:boost1.0))) (define-public freetds (package (name "freetds") (version "1.2.20") (source (origin (method url-fetch) (uri (string-append "https://www.freetds.org/files/stable/" "freetds-" version ".tar.gz")) (sha256 (base32 "11fzwcahc1bc8npxbif0448v9cwyf7k04167i7fcspmfw7a0hj0d")))) (build-system gnu-build-system) (arguments ;; NOTE: (Sharlatan-20210110213908+0000) some tests require DB connection, ;; disabled for now. `(#:tests? #f)) (home-page "https://www.freetds.org/") (synopsis "Client libraries for MS SQL and Sybase servers") (description "FreeTDS is an implementation of the Tabular DataStream protocol, used for connecting to MS SQL and Sybase servers over TCP/IP.") (license license:lgpl2.0+))) (define-public python-tinydb (package (name "python-tinydb") (version "4.8.0") (source (origin (method url-fetch) (uri (pypi-uri "tinydb" version)) (sha256 (base32 "0r6mavw0wm03lbmqbgglsyff3vws86ddg3q8h29glpd7qnlqdmkd")))) (build-system pyproject-build-system) (native-inputs (list python-poetry-core python-pytest)) (home-page "https://github.com/msiemens/tinydb") (synopsis "TinyDB is a lightweight document oriented database") (description "TinyDB is a small document oriented database written in pure Python with no external dependencies. The targets are small apps that would be blown away by a SQL-DB or an external database server.") (license license:expat))) (define-public sequeler (package (name "sequeler") (version "0.8.2") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/Alecaddd/sequeler") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "0biggmsn8k7j6pdrwk29whl56qlfgvf5d9vjpgz4nyqih56wgh9j")))) (build-system meson-build-system) (arguments '(#:glib-or-gtk? #t #:phases (modify-phases %standard-phases (add-after 'unpack 'skip-gtk-update-icon-cache ;; Don't create 'icon-theme.cache'. (lambda _ (substitute* "build-aux/meson_post_install.py" (("gtk-update-icon-cache") "true") (("update-desktop-database") "true"))))))) (native-inputs `(;("appstream-glib" ,appstream-glib) ; validation fails for lack of network ("gettext-minimal" ,gettext-minimal) ("glib:bin" ,glib "bin") ; for glib-compile-resources ("gtk+" ,gtk+ "bin") ("pkg-config" ,pkg-config) ("vala" ,vala))) (inputs `(("glib" ,glib) ("granite" ,granite) ("gsettings-desktop-schemas" ,gsettings-desktop-schemas) ("gtk+" ,gtk+) ("gtksourceview-3" ,gtksourceview-3) ("libgda" ,libgda) ("libgee" ,libgee) ("libsecret" ,libsecret) ("libssh2" ,libssh2) ("libxml2" ,libxml2))) (synopsis "Friendly SQL Client") (description "Sequeler is a native Linux SQL client built in Vala and Gtk. It allows you to connect to your local and remote databases, write SQL in a handy text editor with language recognition, and visualize SELECT results in a Gtk.Grid Widget.") (home-page "https://github.com/Alecaddd/sequeler") (license license:gpl2+))) (define-public sqlitebrowser (package (name "sqlitebrowser") (version "3.13.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/sqlitebrowser/sqlitebrowser") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "0v4a59lgqng9hqvbc2k504aclinpwpk8hi6ckirbr6m1pnf26kfr")) (modules '((guix build utils))) (snippet '(begin (delete-file-recursively "libs/qcustomplot-source/") (delete-file-recursively "libs/qhexedit/") (delete-file-recursively "libs/qscintilla"))))) (build-system qt-build-system) (arguments (list #:configure-flags ;; TODO: Unbundle json (nlohmann-json). #~(list (string-append "-DQSCINTILLA_INCLUDE_DIR=" #$(this-package-input "qscintilla") "/include/Qsci") "-DFORCE_INTERNAL_QCUSTOMPLOT=OFF" "-DFORCE_INTERNAL_QHEXEDIT=OFF" "-DENABLE_TESTING=ON"))) (inputs (list qcustomplot qhexedit qscintilla qtbase-5 sqlite)) (native-inputs (list qttools-5)) (home-page "https://sqlitebrowser.org/") (synopsis "Visual database browser and editor for SQLite") (description "Sqlitebrowser lets you create, design, and edit database files compatible with SQLite using a graphical user interface.") (license ;; dual license (list license:gpl3+ license:mpl2.0)))) (define-public sqls (package (name "sqls") ;; TODO: The latest version requires a way more packages to be available ;; in Guix. (version "0.2.18") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/sqls-server/sqls") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "13837v27avdp2nls3vyy7ml12nj7rxragchwf92adn10ffp4aj6c")))) (build-system go-build-system) (arguments (list #:install-source? #f #:import-path "github.com/lighttiger2505/sqls")) (native-inputs (list go-github-com-google-go-cmp go-github-com-go-sql-driver-mysql go-github-com-k0kubun-pp go-github-com-lib-pq go-github-com-mattn-go-runewidth go-github-com-mattn-go-sqlite3 go-github-com-olekukonko-tablewriter go-github-com-pkg-errors go-github-com-sourcegraph-jsonrpc2 go-golang-org-x-crypto go-golang-org-x-xerrors go-gopkg-in-yaml-v2)) (home-page "https://github.com/sqls-server/sqls") (synopsis "SQL language server written in Go") (description "This package implements the @acronym{LSP, Language Server Protocol} for SQL.") (license license:expat))) (define-public python-dogpile.cache (package (name "python-dogpile.cache") (version "1.1.8") (source (origin (method url-fetch) (uri (pypi-uri "dogpile.cache" version)) (sha256 (base32 "0kpx42vxzss4sz5ic6mp01a97zinzm6q76n8li2gbi4ccfxyhi6q")))) (build-system python-build-system) (arguments '(#:phases (modify-phases %standard-phases (replace 'check (lambda* (#:key tests? #:allow-other-keys) (when tests? (invoke "pytest"))))))) (native-inputs (list python-mako python-pytest)) (propagated-inputs (list python-decorator python-stevedore)) (home-page "https://github.com/sqlalchemy/dogpile.cache") (synopsis "Caching front-end based on the Dogpile lock") (description "@code{dogpile.cache} is a caching API which provides a generic interface to caching backends of any variety, and additionally provides API hooks which integrate these cache backends with the locking mechanism of @code{dogpile}.") (license license:expat))) (define-public datasette (package (name "datasette") (version "1.0a7") (source (origin (method git-fetch) ;for tests (uri (git-reference (url "https://github.com/simonw/datasette") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "1wwdx2xqkxygbww1nzpr6h702ims6zcxpjskh8fldn1kby591qgg")))) (build-system pyproject-build-system) (arguments (list #:test-flags ;; There are multiple unexplained test failures (see: ;; https://github.com/simonw/datasette/issues/2048). #~(list "-k" (string-append "not (test_database_page_for_database_with_dot_in_name" " or test_row_strange_table_name" " or test_database_with_space_in_name" " or test_tilde_encoded_database_names" " or test_weird_database_names" " or test_css_classes_on_body" " or test_templates_considered" " or test_row_html_compound_primary_key" " or test_edit_sql_link_on_canned_queries" " or test_alternate_url_json" " or test_table_with_slashes_in_name" " or test_searchable" " or test_custom_query_with_unicode_characters" " or test_searchmode)") "-n" (number->string (parallel-job-count)) "-m" "not serial") ;cannot run in parallel #:phases #~(modify-phases %standard-phases (add-after 'unpack 'relax-requirements (lambda _ ;; The package needlessly specifies exact versions ;; of dependencies, when it works fine with others. (substitute* "setup.py" (("(black)==[0-9\\.]+" _ package) package) (("click-default-group-wheel") "click-default-group"))))))) (propagated-inputs (list python-aiofiles python-asgi-csrf python-asgiref python-asyncinject python-click python-click-default-group python-httpx python-hupper python-itsdangerous python-janus python-jinja2 python-mergedeep python-pint python-pluggy python-pyyaml python-sqlite-utils python-uvicorn)) (native-inputs (list python-beautifulsoup4 python-black python-cogapp python-pip python-pytest python-pytest-asyncio python-pytest-runner python-pytest-timeout python-pytest-xdist python-setuptools python-trustme python-wheel)) (home-page "https://datasette.io/") (synopsis "Multi-tool for exploring and publishing data") (description "Datasette is a tool for exploring and publishing data. It helps people take data of any shape or size and publish that as an interactive, explorable website and accompanying API.") (license license:asl2.0)))