Building Source Packages for Electron.JS apps

Asked by ceramicfox


I was looking into publishing an Electron.JS application on a PPA. But I realized it wouldn't be possible without packaging the binary into the Source Package itself since Launchpad wouldn't let npm fetch the required parts.

I was wondering if it is actually possible and I'm missing something? And if this is not the case, doesn't packaging the binary in the Source Package go against Launchpad rules, since I have seen other PPAs doing this to package Electron apps?

I'm looking for the best practice to address this issue.

Question information

English Edit question
Launchpad itself Edit question
No assignee Edit question
Solved by:
Colin Watson
Last query:
Last reply:
Revision history for this message
Guruprasad (lgp171188) said :


I am quoting the reply from my colleague, Colin, answering your question.

> Vendoring the source for the npm dependencies into the source package
> should be fine as long as all the relevant licences permit it. In most
> cases I think node_modules is a close enough approximation of editable
> source, but if it isn't then there are some other approaches that might
> work, e.g. an npm cache:
> (I am in no way an npm expert, though.)

Revision history for this message
ceramicfox (ceramicfox) said :

Thank you, I will look into vendoring the dependencies and npm cache.
In case these methods fail, would it be acceptable to ship the binary in an archive and extract it during the build?
I believe webupd8 does this for atom application in their PPA.

Revision history for this message
Best Colin Watson (cjwatson) said :

If the licence of the code you're distributing permits it (it is your responsibility to check this), and if you're careful to ship the corresponding source code alongside the built version, then I think it's fine. It would likely not be acceptable for Ubuntu itself, but the criteria for PPA hosting are essentially that it needs to be open source (we won't help people distribute their proprietary code for free) and that distributing the code won't get Canonical into trouble with its licensors.

Revision history for this message
ceramicfox (ceramicfox) said :

Thanks Colin Watson, that solved my question.

Revision history for this message
ceramicfox (ceramicfox) said :

Thank you Guruprasad and Colin Watson for your answers.
Knowing about both of these methods is very helpful.
I appreciate your detailed explanation.