From e292026720467277e36097aca3b1b4f427134ba7 Mon Sep 17 00:00:00 2001 From: Alexander_Kabui Date: Wed, 14 Aug 2024 15:49:50 +0300 Subject: gn: javascript: Add javascript-diff. * gn/packages/javascript.scm (javascript-diff): New package. Reviewed-by: Munyoki Kilyungi --- gn/packages/javascript.scm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'gn/packages') diff --git a/gn/packages/javascript.scm b/gn/packages/javascript.scm index ba27e4c..3e1d558 100644 --- a/gn/packages/javascript.scm +++ b/gn/packages/javascript.scm @@ -2232,3 +2232,32 @@ for developing fast and powerful web interfaces.") (copy-file source (string-append targetdir "/diff2html.min.css")))))) (native-inputs `(("source" ,source))))) + +(define-public javascript-diff + (package + (name "javascript-diff") + (version "5.1.0") + (source + (origin + (method url-fetch) + (uri (string-append "https://cdn.jsdelivr.net/npm/diff@" version + "/dist/diff.min.js")) + (sha256 + (base32 "0zvbllgfyq8x3hjkygc9fd0gqqkbvz6qa02mcilvs6djfj9vsa9s")))) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder (begin + (use-modules (guix build utils)) + (let* ((source (assoc-ref %build-inputs "source")) + (out (assoc-ref %outputs "out")) + (targetdir (string-append out + "/share/genenetwork2/javascript/jsdiff"))) + (mkdir-p targetdir) + (copy-file source + (string-append targetdir "/diff.min.js")))))) + (native-inputs `(("source" ,source))) + (home-page "https://github.com/kpdecker/jsdiff#readme") + (synopsis "A JavaScript text differencing implementation. ") + (description "A JavaScript text differencing implementation.") + (license license:bsd-3))) -- cgit v1.2.3