about summary refs log tree commit diff
path: root/gn/packages/jbrowse.scm
blob: d66350d835cc07339ee21bd7f76fe22759b4741d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
;;; 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
;;; <https://www.gnu.org/licenses/>.

(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)))