about summary refs log tree commit diff
path: root/.guix
diff options
context:
space:
mode:
Diffstat (limited to '.guix')
-rw-r--r--.guix/domagi-package.scm95
-rw-r--r--.guix/odgi-package.scm72
2 files changed, 167 insertions, 0 deletions
diff --git a/.guix/domagi-package.scm b/.guix/domagi-package.scm
new file mode 100644
index 0000000..2bbed06
--- /dev/null
+++ b/.guix/domagi-package.scm
@@ -0,0 +1,95 @@
+;;; domagi --- DuckDB-powered pangenome Swiss Army knife
+;;; Copyright © 2026 Arun Isaac <arunisaac@systemreboot.net>
+;;;
+;;; This file is part of domagi.
+;;;
+;;; domagi 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.
+;;;
+;;; domagi 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
+;;; domagi. If not, see <https://www.gnu.org/licenses/>.
+
+(define-module (domagi-package)
+  #:use-module ((gnu packages check) #:select (python-pytest))
+  #:use-module ((gnu packages cmake) #:select (cmake))
+  #:use-module ((gnu packages duckdb) #:select (duckdb python-duckdb))
+  #:use-module ((gnu packages pkg-config) #:select (pkg-config))
+  #:use-module ((gnu packages python-xyz) #:select (python-click python-meson))
+  #:use-module (guix build-system copy)
+  #:use-module (guix build-system pyproject)
+  #:use-module (guix gexp)
+  #:use-module (guix git-download)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix utils))
+
+(define-public verstable
+  (package
+    (name "verstable")
+    (version "2.2.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                     (url "https://github.com/JacksonAllan/Verstable")
+                     (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0lwh9kh0jl2vxcijd8606h5xvsjxxa051qaqlx82cl36nh0hkkxp"))))
+    (build-system copy-build-system)
+    (arguments
+     (list #:install-plan
+           #~'(("verstable.h" "include/verstable.h"))))
+    (home-page "https://github.com/JacksonAllan/Verstable")
+    (synopsis "Generic C hash table library")
+    (description "Verstable is a versatile generic hash table intended
+to bring the speed and memory efficiency of state-of-the-art C++ hash
+tables such as Abseil/Swiss, Boost, and Bytell to C.
+
+Its features include:
+@begin itemize
+@item Type safety
+@item Customizable hash, comparison, and destructor functions
+@item Single header
+@item C99 compatibility
+@item Generic API in C11 and later
+@item High speed mostly impervious to load factor
+@item Only two bytes of overhead per bucket
+@item Tombstone-free deletion
+@end itemize")
+    (license license:expat)))
+
+(define-public domagi
+  (package
+    (name "domagi")
+    (version "0.1.0")
+    (source (local-file ".."
+                        "domagi-checkout"
+                        #:recursive? #t
+                        #:select? (or (git-predicate (dirname (current-source-directory)))
+                                      (const #t))))
+    (build-system pyproject-build-system)
+    (inputs
+     (list duckdb
+           python-click
+           python-duckdb))
+    (native-inputs
+     (list cmake
+           python-meson
+           pkg-config
+           python-pytest
+           verstable))
+    (home-page "https://github.com/arunisaac/domagi")
+    (synopsis "DuckDB-powered pangenome Swiss Army knife")
+    (description "domagi is a DuckDB-powered clone of odgi, the pangenome
+manipulation tool.")
+    (license license:gpl3+)))
+
+domagi
diff --git a/.guix/odgi-package.scm b/.guix/odgi-package.scm
new file mode 100644
index 0000000..5fa94d1
--- /dev/null
+++ b/.guix/odgi-package.scm
@@ -0,0 +1,72 @@
+;; This odgi package definition is from https://git.genenetwork.org/guix-bioinformatics/tree/gn/packages/pangenome.scm?id=e586976ac493d2f7480784f098d58c9fed065b02#n524
+
+(define-module (odgi-package)
+  #:use-module ((gnu packages datastructures)
+                #:select (libdivsufsort sdsl-lite))
+  #:use-module ((gnu packages jemalloc) #:select (jemalloc))
+  #:use-module ((gnu packages mpi) #:select (openmpi))
+  #:use-module ((gnu packages pkg-config) #:select (pkg-config))
+  #:use-module ((gnu packages python) #:select (python))
+  #:use-module ((gnu packages python-xyz) #:select (pybind11))
+  #:use-module (guix build-system cmake)
+  #:use-module (guix download)
+  #:use-module (guix gexp)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages))
+
+(define-public odgi
+  (package
+    (name "odgi")
+    (version "0.9.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/pangenome/odgi/releases"
+                                  "/download/v" version
+                                  "/odgi-v" version ".tar.gz"))
+              (sha256
+               (base32
+                "0brg0sz45v1wv4ld3p4jwiab10nyp2f691zfwpiva6g6f71q3cbk"))
+              (snippet
+               #~(begin
+                   (use-modules (guix build utils))
+                   (substitute* "CMakeLists.txt"
+                     (("-march=native") "")
+                     (("-msse4\\.2") ""))))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      #:tests? #f
+      #:parallel-build? #f  ; parallel build uses too much memory
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'use-gnuinstalldirs-macros
+            (lambda _
+              (substitute* "CMakeLists.txt"
+                (("project\\(odgi\\)" all)
+                 (string-append all "\ninclude(GNUInstallDirs)"))
+                (("LIBRARY DESTINATION lib")
+                 "LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}")
+                (("ARCHIVE DESTINATION lib")
+                 "ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}"))))
+          (add-after 'unpack 'link-to-libodgi
+            (lambda _
+              (substitute* "CMakeLists.txt"
+                (("^  \\$<TARGET_OBJECTS:odgi_objs>.*") "")
+                (("target_link_libraries\\(odgi " all)
+                 (string-append all "libodgi_shared "))))))))
+    (native-inputs (list pkg-config))
+    (inputs
+     (list jemalloc
+           libdivsufsort
+           openmpi
+           pybind11
+           python
+           sdsl-lite))
+    (properties '((tunable? . #t)))
+    (home-page "https://github.com/vgteam/odgi")
+    (synopsis "Optimized Dynamic Genome/Graph Implementation")
+    (description "odgi provides an efficient and succinct dynamic DNA
+sequence graph model, as well as algorithms for pangenome analysis.")
+    (license license:expat)))
+
+odgi