guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

04/10: gnu: Add mito.


From: guix-commits
Subject: 04/10: gnu: Add mito.
Date: Tue, 1 Sep 2020 12:26:48 -0400 (EDT)

ambrevar pushed a commit to branch master
in repository guix.

commit f5e31b1d3567162d834d2bb49163a199c672da5c
Author: Pierre Neidhardt <mail@ambrevar.xyz>
AuthorDate: Tue Sep 1 13:51:42 2020 +0200

    gnu: Add mito.
    
    * gnu/packages/lisp-xyz.scm (cl-mito, sbcl-mito): New variables.
---
 gnu/packages/lisp-xyz.scm | 112 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 112 insertions(+)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index cfac25e..f681153 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -13602,3 +13602,115 @@ can separate configuration system from an 
implementation.")
 
 (define-public ecl-envy
   (sbcl-package->ecl-package sbcl-envy))
+
+(define sbcl-mito-core
+  (let ((commit "d3b9e375ef364a65692da2185085a08c969ac88a")
+       (revision "1"))
+    (package
+      (name "sbcl-mito-core")
+      (version (git-version "0.1" revision commit))
+      (home-page "https://github.com/fukamachi/mito";)
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url home-page)
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "08mncgzjnbbsf1a6am3l73iw4lyfvz5ldjg5g84awfaxml4p73mb"))))
+      (build-system asdf-build-system/sbcl)
+      (inputs
+       `(("dbi" ,sbcl-dbi)
+         ("sxql" ,sbcl-sxql)
+         ("cl-ppcre" ,sbcl-cl-ppcre)
+         ("closer-mop" ,sbcl-closer-mop)
+         ("dissect" ,sbcl-dissect)
+         ("optima" ,sbcl-optima)
+         ("cl-reexport" ,sbcl-cl-reexport)
+         ("local-time" ,sbcl-local-time)
+         ("uuid" ,sbcl-uuid)
+         ("alexandria" ,sbcl-alexandria)))
+      (synopsis "ORM for Common Lisp with migrations and relationships 
support")
+      (description "Mito is yet another object relational mapper, and it aims
+to be a successor of Integral.
+
+@itemize
+@item Support MySQL, PostgreSQL and SQLite3.
+@item Add id (serial/uuid primary key), created_at and updated_at by default
+like Ruby's ActiveRecord.
+@item Migrations.
+@item Database schema versioning.
+@end itemize\n")
+      (license license:llgpl))))
+
+(define sbcl-mito-migration
+  (package
+    (inherit sbcl-mito-core)
+    (name "sbcl-mito-migration")
+    (inputs
+     `(("mito-core" ,sbcl-mito-core)
+       ("dbi" ,sbcl-dbi)
+       ("sxql" ,sbcl-sxql)
+       ("closer-mop" ,sbcl-closer-mop)
+       ("cl-reexport" ,sbcl-cl-reexport)
+       ("uuid" ,sbcl-uuid)
+       ("alexandria" ,sbcl-alexandria)
+       ("esrap" ,sbcl-esrap)))))
+
+(define sbcl-lack-middleware-mito
+  (package
+    (inherit sbcl-mito-core)
+    (name "sbcl-lack-middleware-mito")
+    (inputs
+     `(("mito-core" ,sbcl-mito-core)
+       ("dbi" ,sbcl-dbi)))
+    (arguments
+       '(#:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'fix-build
+             (lambda _
+               (substitute* "lack-middleware-mito.asd"
+                 (("cl-dbi") "dbi"))
+               #t)))))))
+
+(define-public sbcl-mito
+  (package
+    (inherit sbcl-mito-core)
+    (name "sbcl-mito")
+    (inputs
+     `(("mito-core" ,sbcl-mito-core)
+       ("mito-migration" ,sbcl-mito-migration)
+       ("lack-middleware-mito" ,sbcl-lack-middleware-mito)
+       ("cl-reexport" ,sbcl-cl-reexport)))
+    (native-inputs
+     `(("prove" ,sbcl-prove)
+       ("prove-asdf" ,sbcl-prove-asdf)
+       ("dbd-mysql" ,sbcl-dbd-mysql)
+       ("dbd-postgres" ,sbcl-dbd-postgres)
+       ("dbd-sqlite3" ,sbcl-dbd-sqlite3)))
+    (arguments
+       '(#:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'remove-non-functional-tests
+             (lambda _
+               (substitute* "mito-test.asd"
+                 ;; (("\\(:test-file \"migration/mysql\"\\)") "")
+                 (("\\(:test-file \"db/mysql\"\\)") "")
+                 (("\\(:test-file \"db/postgres\"\\)") "")
+                 (("\\(:test-file \"dao\"\\)") "")
+                 ;; TODO: migration/sqlite3 should work, re-enable once
+                 ;; upstream has fixed it:
+                 ;; https://github.com/fukamachi/mito/issues/70
+                 (("\\(:test-file \"migration/sqlite3\"\\)") "")
+                 (("\\(:test-file \"migration/mysql\"\\)") "")
+                 (("\\(:test-file \"migration/postgres\"\\)") "")
+                 (("\\(:test-file \"postgres-types\"\\)") "")
+                 (("\\(:test-file \"mixin\"\\)") ""))
+               #t)))
+         ;; TODO: While all enabled tests pass, the phase fails with:
+         ;; Component MITO-ASD::MITO-TEST not found, required by #<SYSTEM 
"mito">
+         #:tests? #f))))
+
+(define-public cl-mito
+  (sbcl-package->cl-source-package sbcl-mito))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]