From e20ff3658f0d0fe007f72b2ea51b2ad3f4aaba51 Mon Sep 17 00:00:00 2001 From: Josep Bigorra Date: Wed, 15 Apr 2026 20:55:06 +0200 Subject: [PATCH] gnu: Add mutastructura. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/databases.scm (mutastructura): New variable. Change-Id: I777b1f760d87cdd1b404cee961be6ee6bc7d76c3 Signed-off-by: Ludovic Courtès --- gnu/packages/databases.scm | 51 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm index a2f929c0511..a337baeb9d8 100644 --- a/gnu/packages/databases.scm +++ b/gnu/packages/databases.scm @@ -70,6 +70,7 @@ ;;; Copyright © 2025 bdunahu ;;; Copyright © 2026 Spencer King ;;; Copyright © 2026 Peter Polidoro +;;; Copyright © 2026 Josep Bigorra ;;; ;;; This file is part of GNU Guix. ;;; @@ -126,6 +127,7 @@ #:use-module (gnu packages gperf) #:use-module (gnu packages gtk) #:use-module (gnu packages guile) + #:use-module (gnu packages guile-xyz) #:use-module (gnu packages icu4c) #:use-module (gnu packages jemalloc) #:use-module (gnu packages language) @@ -198,6 +200,7 @@ #:use-module (guix build-system emacs) #:use-module (guix build-system gnu) #:use-module (guix build-system go) + #:use-module (guix build-system guile) #:use-module (guix build-system meson) #:use-module (guix build-system perl) #:use-module (guix build-system pyproject) @@ -5046,6 +5049,54 @@ postgresql = postgresql://nixbld@/yoyo_test~%"))) files or Python scripts that define a list of migration steps.") (license license:asl2.0))) +(define-public mutastructura + (package + (name "mutastructura") + (version "0.6.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://codeberg.org/jjba23/mutastructura") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "08vzlc5imavqf3bdzgbh70c7z44xjhf05gr7i2g5ksl49lv39gzh")))) + (build-system guile-build-system) + (arguments + (list + #:source-directory "src" + #:phases + #~(modify-phases %standard-phases + (add-before 'build 'install-program-files + (lambda _ + (let* ((bin (string-append #$output "/bin")) + (share (string-append #$output "/share"))) + (copy-recursively "resources" + (string-append share "/resources")) + (install-file "scripts/mutastructura" bin) + (install-file "scripts/log.bash" + (string-append share "/scripts/")) + (chmod (string-append bin "/mutastructura") #o755))))))) + (native-inputs (list guile-3.0)) + (propagated-inputs (list guile-dbi + guile-dbd-mysql + guile-dbd-sqlite3 + guile-dbd-postgresql + guile-gcrypt)) + (inputs (list guile-3.0 bash-minimal)) + (home-page "https://codeberg.org/jjba23/mutastructura") + (synopsis "Relational database schema migrations powered by Guile Scheme") + (description + "Mutastructura provides a familiar, declarative and transactional +approach to managing database states. It exposes a user-friendly +@acronym{CLI, command-line interface} and has support for PostgreSQL, MySQL, and SQLite. +It also exposes library functions and can be imported and used directly from other Guile code. + +Features include executing migrations transactionally and computing SHA256 +checksums to track schema evolution in a @code{migrations_history} table.") + (license license:agpl3+))) + (define-public python-mysqlclient (package (name "python-mysqlclient")