summaryrefslogtreecommitdiff
path: root/rodion/packages
diff options
context:
space:
mode:
authorRodion Goritskov <rodion.goritskov@gmail.com>2024-03-23 00:32:41 +0400
committerRodion Goritskov <rodion.goritskov@gmail.com>2024-03-23 00:32:41 +0400
commit5e5da53a594f6546e10105e0febc996a000af291 (patch)
treed4cfb1918befbefcafaad4f5897061126c56ace6 /rodion/packages
parent6a5426e063cc59f4775cc879b9d2e803da491f02 (diff)
gnu: Add latest NodeJS LTS.
* rodion/packages/node.scm (node-fresh): New variable.
Diffstat (limited to 'rodion/packages')
-rw-r--r--rodion/packages/node.scm44
1 files changed, 44 insertions, 0 deletions
diff --git a/rodion/packages/node.scm b/rodion/packages/node.scm
new file mode 100644
index 0000000..77e051e
--- /dev/null
+++ b/rodion/packages/node.scm
@@ -0,0 +1,44 @@
+(define-module (rodion packages node)
+ #:use-module (guix packages)
+ #:use-module (guix download)
+ #:use-module (gnu packages gcc)
+ #:use-module (gnu packages base)
+ #:use-module (gnu packages commencement)
+ #:use-module (nonguix build-system binary)
+ #:use-module (guix licenses))
+
+(define-public node-fresh
+ (package
+ (name "node")
+ (version "20.11.1")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://nodejs.org/dist/v" version
+ "/node-v" version "-linux-x64.tar.xz"))
+ (sha256
+ (base32
+ "1gkgrz4vsps9idmb4kp7js6bbqrxkxlmf8maaqrv0wlnn14vbnnq"))))
+ (build-system binary-build-system)
+ (arguments
+ `(#:install-plan '(("bin" "bin")
+ ("include" "include")
+ ("lib" "lib")
+ ("share" "share"))
+ #:patchelf-plan `(("bin/node" ("gcc" "gcc-toolchain")))
+ #:strip-binaries? #f
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'install 'install-corepack
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; FIXME: Cannot install npm because installing npm with corepack causes segmentation fault
+ (invoke (string-append (assoc-ref outputs "out") "/bin/node")
+ (string-append (assoc-ref outputs "out") "/bin/corepack")
+ "enable"
+ "--install-directory" (string-append (assoc-ref outputs "out") "/bin")))))))
+ (inputs `((,gcc "lib")
+ ,gcc-toolchain))
+ (home-page "https://nodejs.org/")
+ (synopsis "nodejs")
+ (description
+ "Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine.")
+ (license expat)))