sciencefair-land / sciencefair

The futuristic, fabulous and free desktop app for working with scientific literature :microscope: :book:
https://sciencefair-app.com
MIT License
604 stars 52 forks source link

Snap package for sciencefair. #175

Open SirRujak opened 5 years ago

SirRujak commented 5 years ago

I was trying to give this a try on Solus today and found that there wasn't a terribly easy way to install it. I took a bit of time to familiarize myself with node since I haven't really used it before but from what I can tell it should be pretty simple to build a snap using electron-builder.

After a bit of work getting the current code to build I was then able to get it to produce a functional snap.

Here is the git diff for what I did:

diff --git a/app/package.json b/app/package.json
index be4b496..09b3feb 100644
--- a/app/package.json
+++ b/app/package.json
@@ -39,7 +39,7 @@
     "electron-debug": "^1.2.0",
     "electron-default-menu": "^1.0.1",
     "electron-log": "^2.0.0",
-    "electron-updater": "^2.4.2",
+    "electron-updater": "^3.1.2",
     "end-of-stream": "^1.1.0",
     "findandreplacedomtext": "^0.4.4",
     "folder-walker": "^3.1.0",
diff --git a/electron-builder.yml b/electron-builder.yml
index 3deab1f..3ffac36 100644
--- a/electron-builder.yml
+++ b/electron-builder.yml
@@ -34,6 +34,7 @@ linux:
   target:
     - deb
     - rpm
+    - snap
   maintainer: "Richard Smith-Unna <rik@fathomlabs.io>"
 win:
   icon: "build/icon.ico"

The first is just to get sciencefair to build at all and the second makes it spit out a snap. Would there be any interest in either the project having them automatically built and added to the snapcraft store or would it just be a better idea to add it myself at the moment as a community build?

Thank you for taking a look!

bencevans commented 5 years ago

An official snap would be great. Either a deb where it's pushed to an apt repo or snap anyway. I'd suggest maybe creating a community build anyway under a differing name from what the official may be... snap install sirrujak-sciencefair?

SirRujak commented 5 years ago

Ok, I went ahead and made sirrujak-sciencefair available as a beta in the snap store. I had to use your pull request @bencevans due to an issue with snapcraft building electron applications prior to electron- 1.8.3 and rename the project so I could upload it to the snapcraft store. Otherwise I only made the change that has electron builder output a snap.

If you would like to test it using snap install sirrujak-sciencefair --beta just to make sure it is properly working on someone else's machine as well I would greatly appreciate it! If it does end up working I'll go ahead and push it to the stable branch pending any complaints of instability.

bencevans commented 5 years ago

Breeze to install! Works great :tada:

SirRujak commented 5 years ago

Awesome! I'll go ahead and push it into stable then. This means it should be showing up in the Ubuntu software store now and any other distro that has snaps in their gui app finder as well.