6

I've been doing some research: You can't build PPA's from a Node.js application.

Apparently, this is not a rule, since there are a few projects that have successfully achieve this. WebUDP8 is an example; they build the PPA's for Atom IDE (using Electron) & Popcorn Time (using Node-Webkit)

I did what any human being would do: bother these guys, since there's no documentation (or at least, none that I found).

Their answer:

Launchpad PPAs don't support nodejs yet because they don't allow fetching external resources. So the Popcorn TIme PPA used to be a simple installer that automatically downloaded Popcorn Time from its servers.

But, as far as I'm aware of, I'm not using external resources. It's not like I am downloading dependences from the package.json. They are all --saved in the folder to build.

How can I make a PPA of my Electron App? Does the Software Center work with PPA's as well, or only .deb's?

2 Answers 2

3

I think you are right. If Atom has its own PPA, any Electron app could.

This should help: How do I create a PPA?

0

WebUPD8's Atom PPA simply ships pre-built binaries. It works like this:

  1. WebUPD8 builds Atom on their infrastructure as usual (with access to the internet).
  2. Once they have x86 and amd64 binaries with all required files they package them into atom-linux32.tar or atom-linux64.tar, add icons, desktop file etc. and package this as orig tarball (upstream provided source in terms of Launchpad).
  3. Then they add debian/ packaging portion of source which is supposed to build the package - but in fact it doesn't build anything, it just checks on which architecture it runs and based on that unpacks appropriate atom-linux(32|64).tar archive so that it "looks" for DPKG build system binaries were built
  4. From there all is same, files in install target in debian/rules will be packaged as binary package for that architecture.

This is not nice nor safe for users as such binary can contain malicious code added by WEBUPD8 or someone who had access to their infrastructure where they built the binaries. I also believe packaging binaries as source packages is circumvention and abuse of Launchpad PPA policy citing:

Note: We do not allow uploading pre-built binary packages.

as also mentioned in this answer.

You can check how they did it by downloading original source archive as well as their debian patch from this page: https://launchpad.net/~webupd8team/+archive/ubuntu/atom/+packages (package details).

Proper way would be to pre-fetch all required files (entire node_modules/, all electron source files, etc.) into source package and build your application from debian/rules on Launchpad build servers. Even if you have all files in node_modules/ Electron during build downloads certain bits from the Internet and that is not going to work in Launchpad.

There's option for Electron that allows to cache build artifact sources on your machine (so you can theoretically include them in your source package) and then reuse during Launchpad build. All this is very complicated, error prone and requires to have environment identical to build environment etc. and probably not worth the effort. Alternative solution could be distributing your app as a snap image.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .