icza / scelight

The source code of the Scelight project with all its modules.
https://sites.google.com/site/scelight/
Apache License 2.0
123 stars 19 forks source link

Add Scelight to the Linux app store #18

Closed dmiller309 closed 5 years ago

dmiller309 commented 5 years ago

It would be great to get Scelight into the Linux app store so that more people could see and install it. I've been playing SC2 on Linux since Wings was released and I use Scelight to track my win percentages as different races. I'm willing to do the Linux app store packaging for you, and to walk you through the process so that you can do it yourself.

These are the changes I made to the Scelight source code to produce a cross-distro app store package:

To produce the snap file, install the tools for building snap applications on Linux:

sudo apt install snapcraft gradle

then build the snap package:

cd ~/IdeaProjects/scelight # change directory to the scelight source root
gradle build # produces snap/build and snap/icon
cd snap

######################################################
# If you don't have a Linux machine, I set up a Linux Docker image
# This part is optional
docker build -t snapbuild
# docker build only needs to be run when you want to update the 
# snapcraft version
./run-docker.sh # gives you a Linux shell with snapcraft installed
######################################################

nano snapcraft.yaml # update the version field in snapcraft.yaml from 3.1.3 to the current version
snapcraft clean scelight # run this after each gradle build
snapcraft # produces scelight_3.1.3_amd64.snap

To push to the snap store, run

snapcraft login # only needs to be run once ever.
snapcraft push --release=beta scelight_3.1.3_amd64.snap # replace with the current snap package name

and you can see the snap online at https://snapcraft.io/scelight or in your distro's software store application.

glhf, never give up, never surrender!

icza commented 5 years ago

Hi, and thank you very much for your efforts.

Some things to clarify. The app in the store, is that only the launcher? And once installed, it fetches Scelight's modules like the non-packaged version?

If only the non-launcher modules change, no need to repackage and reupload?

And if the launcher module changes, repackaging and reuploading is required? Because the launcher is capable of updating itself, so may it be that it would still work, just when users would install the old launcher, it would update itself on first launch?

dmiller309 commented 5 years ago

The Scelight app in the store bundles modules and is kept up-to-date by the daily snap system updates. Chrome and Firefox for example auto-update on Windows but use the system update mechanism on Linux. Maps are still pulled into the Scelight config folder. Bundling the modules does mean that you or I would need to reupload when non-launcher modules change, but reuploading is a bash one-liner and there is no human gatekeeper delaying store submissions.

From my experience packaging Polarr, I wouldn't worry about users being more than a week behind on snap updates because it's automatic. If it's important to the licensing of Scelight, I could do some more work to download the modules to the user's config directory (the installed app image is readonly).

Also, if you want to play a game sometime, add me on Battle.net as dmiller309@gmail.com.

icza commented 5 years ago

Sounds cool. Since they removed WoL and HotS ladder, I mostly play coop. Are you up for some coop?

dmiller309 commented 5 years ago

I enjoyed Swann and Karax on brutal mutators, but I haven't played coop since nova came out. I'd be up to play coop sometime.