about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--gn/packages/javascript.scm64
1 files changed, 45 insertions, 19 deletions
diff --git a/gn/packages/javascript.scm b/gn/packages/javascript.scm
index a3f6dd4..059999b 100644
--- a/gn/packages/javascript.scm
+++ b/gn/packages/javascript.scm
@@ -2243,27 +2243,53 @@ vector graphics.")
     "A low-level markdown compiler for parsing markdown without caching or blocking for long periods of time.")
    (license license:expat)))
 
+
 (define-public javascript-marked-highlight
   (package
-   (name "javascript-marked-highlight")
-   (version "2.0.6")
-   (source
-    (origin
-     (method url-fetch)
-     (uri
-      (string-append "https://github.com/markedjs/marked-highlight/archive/refs/tags/v"
-                     version
-                     ".tar.gz"))
-     (sha256
-      (base32
-       "14pvaknic0pwh1ll7i0z66mi2gviww35palmk03xidyywlbvwklr"))))
-   (build-system minify-build-system)
-   (native-inputs `(("source" ,source)))
-   (home-page "https://github.com/markedjs/marked-highlight")
-   (synopsis "Highlight code blocks.")
-   (description
-    "Add code highlighting to marked.")
-   (license license:expat)))
+    (name "javascript-marked-highlight")
+    (version "2.0.6")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://github.com/markedjs/marked-highlight/archive/refs/tags/v"
+             version ".tar.gz"))
+       (sha256
+        (base32 "14pvaknic0pwh1ll7i0z66mi2gviww35palmk03xidyywlbvwklr"))))
+    (build-system minify-build-system)
+    (arguments
+     `(#:javascript-files (list "src/index.js")
+       #:phases (modify-phases %standard-phases
+                  (add-before 'install 'rename-minified-js
+                    (lambda* _
+                      (for-each (lambda (file)
+                                  ;; rename to "marked-highlight.js"
+                                  (copy-recursively file
+                                                    (string-append (dirname
+                                                                    file)
+                                                     "/marked-highlight.js")))
+                                (find-files (string-append (getcwd)
+                                                           "/guix/build")
+                                            "\\.min\\.js$"))))
+                  (replace 'install
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (use-modules (guix build utils))
+                      (let* ((out (assoc-ref outputs "out"))
+                             (targetdir (string-append out
+                                         "/share/genenetwork2/javascript/marked")))
+                        (mkdir-p targetdir)
+                        (for-each (lambda (file)
+                                    (install-file file targetdir))
+                                  (find-files (string-append (getcwd)
+                                                             "/guix/build")
+                                              "marked-highlight\\.js$"))))))))
+    (home-page "https://github.com/markedjs/marked-highlight")
+    (synopsis "Code highlighting extension for Marked")
+    (description
+     "This package provides a plugin for the Marked Markdown parser that adds
+syntax highlighting support for fenced code blocks.")
+    (license license:expat)))
+
 
 (define-public javascript-ace
   (package