Hi, So far the cockpit packages we have for openSUSE Tumbleweed use the upstream release tarball. That means all web assets are prebuilt. Therefore cannot be patched, it's almost like bundling binaries. So I've tried to come up with a concept to be able to fully rebuild cockpit. In openSUSE a package build is fully unattended, automatic and has no network access. That means all that nodejs stuff needs to be available. When talking to other developers that touched Nodejs before, they just recommended to tar up node_modules/. That's not acceptable either IMO as it also would be just some magic tarball that we don't really know how it was created.
So I wrote a PoC tool that parses package-lock.json instead. With that information we know what upstream nodejs modules npm decided to use and where to put them in node_modules/. That way we can have a spec file that refers to all upstream sources properly and rebuild node_modules/ from sources. Here's the tool: https://github.com/lnussel/nodejs-tarballs And how cockpit it built in OBS: https://build.opensuse.org/package/show/home:lnussel:branches:systemsmanagement:cockpit:rebuild/cockpit The madness comes from the huge amount of tarballs. Apart from that looks quite straight forward, doesn't it? :-) The most annoying bit to fix was gyp as it tries to download nodejs header files at build time. Sass also needs a patch as it doesn't compile. ATM those patches have to be duplicated in cockpit modules that are separate such as cockpit-podman. Also, cockpit-podman wants to use bits of cockpit (pkg/lib/patternfly) and the Makefile gets that from git if not present. So I had to create a cockpit-devel subpackage that can be consumed by cockpit-podman. Would that be something to consider for upstream too? Ie install those files and probably a pkgconfig file in cockpit, then check for that in the Makefiles of modules? cu Ludwig -- (o_ Ludwig Nussel //\ V_/_ http://www.suse.com/ SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer HRB 36809 (AG Nürnberg) _______________________________________________ cockpit-devel mailing list -- [email protected] To unsubscribe send an email to [email protected] Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/[email protected]
