gnu: Add datafly.
[jackhill/guix/guix.git] / gnu / packages / lisp-xyz.scm
index e2706a2..8f8862e 100644 (file)
@@ -3611,6 +3611,12 @@ RFC 1321 by R. Rivest, published April 1992.")
 (define-public cl-md5
   (sbcl-package->cl-source-package sbcl-md5))
 
+(define-public ecl-md5
+  (package
+    (inherit (sbcl-package->ecl-package sbcl-md5))
+    (inputs
+     `(("flexi-streams" ,ecl-flexi-streams)))))
+
 (define-public sbcl-cl+ssl
   (let ((commit "701e645081e6533a3f0f0b3ac86389d6f506c4b5")
         (revision "1"))
@@ -10910,6 +10916,19 @@ a PostgreSQL server over a socket.")))
 (define-public cl-postgres
   (sbcl-package->cl-source-package sbcl-cl-postgres))
 
+(define-public ecl-cl-postgres
+  (package
+    (inherit (sbcl-package->ecl-package sbcl-cl-postgres))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-ecl
+           (lambda _
+             (substitute* "cl-postgres.asd"
+               (("\\) \"usocket\"") " :ecl) \"usocket\""))
+             #t)))
+       #:tests? #f))))
+
 (define-public sbcl-simple-date-postgres-glue
   (package
     (inherit sbcl-simple-date)
@@ -13583,3 +13602,211 @@ 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))
+
+(define-public sbcl-kebab
+  (let ((commit "e7f77644c4e46131e7b8039d191d35fe6211f31b")
+        (revision "1"))
+    (package
+      (name "sbcl-kebab")
+      (version (git-version "0.1" revision commit))
+      (home-page "https://github.com/pocket7878/kebab")
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url home-page)
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "0j5haabnvj0vz0rx9mwyfsb3qzpga9nickbjw8xs6vypkdzlqv1b"))))
+      (build-system asdf-build-system/sbcl)
+      (inputs
+       `(("cl-ppcre" ,sbcl-cl-ppcre)
+         ("alexandria" ,sbcl-alexandria)
+         ("cl-interpol" ,sbcl-cl-interpol)
+         ("split-sequence" ,sbcl-split-sequence)))
+      (native-inputs
+       `(("prove-asdf" ,sbcl-prove-asdf)
+         ("prove" ,sbcl-prove)))
+      (arguments
+       ;; Tests passes but the phase fails with
+       ;; Component KEBAB-ASD::KEBAB-TEST not found, required by #<SYSTEM "kebab">.
+       `(#:tests? #f))
+      (synopsis "Common Lisp case converter")
+      (description "This Common Lisp library converts strings, symbols and
+keywords between any of the following typographical cases: PascalCase,
+camelCase, snake_case, kebab-case (lisp-case).")
+      (license license:llgpl))))
+
+(define-public cl-kebab
+  (sbcl-package->cl-source-package sbcl-kebab))
+
+(define-public ecl-kebab
+  (sbcl-package->ecl-package sbcl-kebab))
+
+(define-public sbcl-datafly
+  (let ((commit "adece27fcbc4b5ea39ad1a105048b6b7166e3b0d")
+        (revision "1"))
+    (package
+      (name "sbcl-datafly")
+      (version (git-version "0.1" revision commit))
+      (home-page "https://github.com/fukamachi/datafly")
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url home-page)
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "16b78kzmglp2a4nxlxxl7rpf5zaibsgagn0p3c56fsxvx0c4hszv"))))
+      (build-system asdf-build-system/sbcl)
+      (inputs
+       `(("alexandria" ,sbcl-alexandria)
+         ("iterate" ,sbcl-iterate)
+         ("optima" ,sbcl-optima)
+         ("trivial-types" ,sbcl-trivial-types)
+         ("closer-mop" ,sbcl-closer-mop)
+         ("cl-syntax-annot" ,sbcl-cl-syntax-annot)
+         ("sxql" ,sbcl-sxql)
+         ("dbi" ,sbcl-dbi)
+         ("babel" ,sbcl-babel)
+         ("local-time" ,sbcl-local-time)
+         ("function-cache" ,sbcl-function-cache)
+         ("jonathan" ,sbcl-jonathan)
+         ("kebab" ,sbcl-kebab)
+         ("log4cl" ,sbcl-log4cl)))
+      (native-inputs
+       `(("prove-asdf" ,sbcl-prove-asdf)
+         ("prove" ,sbcl-prove)
+         ("dbd-sqlite3" ,sbcl-dbd-sqlite3)))
+      (arguments
+       ;; TODO: Tests fail with
+       ;; While evaluating the form starting at line 22, column 0
+       ;;   of #P"/tmp/guix-build-sbcl-datafly-0.1-1.adece27.drv-0/source/t/datafly.lisp":
+       ;; Unhandled SQLITE:SQLITE-ERROR in thread #<SB-THREAD:THREAD "main thread" RUNNING
+       ;; {10009F8083}>:
+       ;;   Error when binding parameter 1 to value NIL.
+       ;; Code RANGE: column index out of range.
+       `(#:tests? #f))
+      (synopsis "Lightweight database library for Common Lisp")
+      (description "Datafly is a lightweight database library for Common Lisp.")
+      (license license:bsd-3))))
+
+(define-public cl-datafly
+  (sbcl-package->cl-source-package sbcl-datafly))
+
+(define-public ecl-datafly
+  (sbcl-package->ecl-package sbcl-datafly))