_Razorblade_ n00b

Joined: 01 Jan 2004 Posts: 33
|
Posted: Sat Feb 04, 2023 12:46 pm Post subject: best practice for Electron-based apps |
|
|
I use several Electron-based apps, some have a binary ebuild already (i.e. Signal, Rocket.Chat) some don't (i.e. Joplin). For multiple reasons (consistent package management, increased execution speed due to host-optimized build options, increased trust by building from verifiable source) I would like to build these packages rather than relying on their binary builds (even if an ebuild is available, the binary is just stripped from an AppImage package).
Is there a best-practice for doing so? I saw several attempts to convert (or rather wrap) npm packages in ebuilds, but they all lack dependency management. One example is the eclass available in the neurogeek overlay.
The hurdle I'm currently struggling with is indeed dependency management when building from source:
Usually npm or yarn would be used interactively to satisfy the dependencies, but this would not result in reliable, predictable, reproducible builds and - as far as I know - contradict the Gentoo / ebuild concept.
So instead one could bundle all needed node_modules on a different system and pull them as additional source in the ebuild
I'm currently giving this a test drive by cloning the source repo at GitHub and running a GitHub Action to satisfy dependencies and storing node_modules as artifact.
A future problem may Chromium/Electron build-time. Standalone-Chromium seems to be very resource intensive, I'm currently using ccache in the hope to minimize build times, but I'm not sure if this would also help here as there would be different chromium build per app.
Any other recommendations are also highly appreciated!
C |
|