Compare commits

...

4 commits

Author SHA1 Message Date
Nicolas Graves
99a02b375d Merge branch 'electron' into 'master'
nongnu: electron: Improve style, update wrapper-plan and fix it.

Closes #399

See merge request nonguix/nonguix!699
2025-06-21 20:19:28 +00:00
Nicolas Graves
d8fd26103d
nongnu: electron: Fix wrapper-plan.
This fixes https://gitlab.com/nonguix/nonguix/-/issues/399

* nongnu/packages/electron.scm (electron-27)[arguments]{wrapper-plan}:
Also wrap chrome-sandbox and chrome_crashpad_handler.
2025-06-21 16:53:07 +02:00
Nicolas Graves
bc46e63c9c
nongnu: electron: Use extended wrapper-plan syntax.
This is a follow-up to 26778f221b.

* nongnu/packages/electron.scm (electron-27)
  [arguments]{wrapper-plan}: Update it.
  {phases}: Replace phase 'wrap-where-patchelf-does-not-work by
  lighter phase 'symlink-binary-file.
  [inputs]: Add nss, necessary for the RUNPATH.
2025-06-21 16:53:07 +02:00
Nicolas Graves
71b704c0fe
nongnu: electron-27: Improve style.
* nongnu/packages/electron.scm (electron-27): Improve style.
  [arguments]: Rewrite using Gexps.
  [inputs, native-inputs]: Rewrite.
2025-06-21 16:53:07 +02:00

View file

@ -5,16 +5,19 @@
;;; Copyright © 2024 Jonathan Brielmaier <jonathan.brielmaier@web.de>
;;; Copyright © 2025 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2025 Simen Endsjø <contact@simendsjo.me>
;;; Copyright © 2025 Nicolas Graves <ngraves@ngraves.fr>
(define-module (nongnu packages electron)
#:use-module (nonguix build-system chromium-binary)
#:use-module ((nonguix licenses) :prefix license:)
#:use-module (guix download)
#:use-module (guix gexp)
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (ice-9 match)
#:use-module (gnu packages compression)
#:use-module (gnu packages gtk)
#:use-module (gnu packages nss)
#:use-module (gnu packages video))
(define (electron-source version hash)
@ -42,13 +45,14 @@
"0qs5n6m0gj0rknjq5aqrbbpqwh2829a1cl51l6xj79p7aiggb9p3"))
(build-system chromium-binary-build-system)
(arguments
`(#:wrapper-plan
`("electron"
"libffmpeg.so"
"libGLESv2.so"
"libEGL.so")
(list
#:wrapper-plan
#~'(("electron" (("out" "/share/electron")
("nss" "/lib/nss")))
"chrome-sandbox"
"chrome_crashpad_handler")
#:install-plan
`(("." "share/electron/" #:include
#~'(("." "share/electron/" #:include
("electron"
"chrome-sandbox"
"chrome_100_percent.pak"
@ -65,24 +69,15 @@
("resources" "share/electron/")
("locales" "share/electron/"))
#:phases
(modify-phases %standard-phases
(add-before 'install-wrapper 'wrap-where-patchelf-does-not-work
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(bin (string-append out "/share/electron/electron"))
(wrapper (string-append out "/bin/electron")))
(mkdir-p (dirname wrapper))
(make-wrapper wrapper bin
`("LD_LIBRARY_PATH" ":"
prefix
(,(string-join
(list
(string-append out "/share/electron"))
":")))))
#t)))))
(native-inputs `(("unzip" ,unzip)))
(inputs `(("gdk-pixbuf" ,gdk-pixbuf)
("ffmpeg" ,ffmpeg)))
#~(modify-phases %standard-phases
(add-after 'install 'symlink-binary-file
(lambda _
(let ((bin (string-append #$output "/bin")))
(mkdir-p bin)
(symlink (string-append #$output "/share/electron/electron")
(string-append bin "/electron"))))))))
(native-inputs (list unzip))
(inputs (list ffmpeg gdk-pixbuf nss))
(home-page "https://www.electronjs.org/")
(synopsis "Cross platform desktop application shell")
(description "The Electron framework lets you write cross-platform desktop