;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2026 GeneNetwork team ;;; ;;; This file is part of guix-bioinformatics. ;;; ;;; guix-bioinformatics 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. ;;; ;;; guix-bioinformatics 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 guix-bioinformatics. If not, see ;;; . (define-module (gn packages jbrowse) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix download) #:use-module (guix gexp) #:use-module (guix packages) #:use-module (guix build-system trivial) #:use-module (gnu packages compression)) ;; JBrowse 2's web UI is a single-page app that is normally distributed ;; as a prebuilt zip attached to a GitHub release (this is exactly the ;; artifact `jbrowse create' downloads and unpacks into a user's ;; install). Building it from the pnpm monorepo would mean vendoring ;; ~1700 npm packages for one webpack run, so we package the released ;; artifact instead; it is version-stamped (share/jbrowse-web/version.txt) ;; and the app is configured at deployment time by dropping a config.json ;; next to index.html. ;; ;; The zip carries test_data/ (only the volvox demo) so that ;; test_data/config.json can serve as a working config out of the box. (define-public jbrowse-web (package (name "jbrowse-web") (version "4.3.0") (source (origin (method url-fetch) (uri (string-append "https://github.com/GMOD/jbrowse-components/releases/download/v" version "/jbrowse-web-v" version ".zip")) (file-name (string-append name "-" version ".zip")) (sha256 (base32 "00k7sxbdvyay27rmcv7ahilxcr8hgj2nsp7qrfhqiq1f20bj9m59")))) (build-system trivial-build-system) (inputs (list unzip)) (arguments (list #:modules '((guix build utils)) #:builder #~(begin (use-modules (guix build utils)) (let ((app (string-append #$output "/share/jbrowse-web"))) (mkdir-p app) (invoke (string-append #$(this-package-input "unzip") "/bin/unzip") "-q" #$source "-d" app))))) (home-page "https://jbrowse.org/jb2/") (synopsis "Web-based genome browser, prebuilt single-page app") (description "JBrowse 2 is a genome browser that runs in a web browser. This package ships the prebuilt @file{jbrowse-web} application (the zip published with the upstream GitHub release): @file{index.html}, the @file{static/} bundles and the volvox demo data under @file{test_data/}. Serve @file{share/jbrowse-web} with any web server and place a @file{config.json} next to @file{index.html} to describe the genomes and tracks to show.") (license license:asl2.0)))