scripting / drummerRFC

A place to post RFCs for people who use and develop in Drummer.
MIT License
11 stars 0 forks source link

Building Electric Drummer for Linux #18

Open scripting opened 2 years ago

scripting commented 2 years ago

As long as @emk is here, let's figure out how this works.

I don't have a Linux with a GUI to test it on, so he'll have to do the testing.

I am using electron-package to build the Mac version.

https://github.com/electron/electron-packager

Now to figure out how to do a Linux build.

scripting commented 2 years ago

This is the command I use to build E/D for the Mac.

sudo electron-packager . "Electric Drummer" --platform=darwin --arch=all --overwrite --icon=drummer.icns --electron-version=7.1.10

I assume I want to change the platform value. What to change it to? I am looking for a list of possible platforms and coming up empty.

Should I just try it replacing "darwin" with "linux"?

scripting commented 2 years ago

I did try it, and sheeeeet it seems to have worked! :-)

Here's what the app said.

Official Linux/ia32 support is deprecated.
For more info: https://electronjs.org/blog/linux-32bit-support
Packaging app for platform linux x64 using electron v7.1.10
Packaging app for platform linux arm64 using electron v7.1.10
Packaging app for platform linux armv7l using electron v7.1.10
Packaging app for platform linux ia32 using electron v7.1.10
Wrote new apps to:
/Users/davewiner/nodeEditor/scripting.com-code-electricdrummer/Electric Drummer-linux-ia32
/Users/davewiner/nodeEditor/scripting.com-code-electricdrummer/Electric Drummer-linux-x64
/Users/davewiner/nodeEditor/scripting.com-code-electricdrummer/Electric Drummer-linux-armv7l
/Users/davewiner/nodeEditor/scripting.com-code-electricdrummer/Electric Drummer-linux-arm64
scripting commented 2 years ago

@emk -- which version would you like to try?

In the meantime I'm going to try to get Ubuntu running under VM Ware again.

This is kind of exciting! :-)

scotthansonde commented 2 years ago

If you want another Linux tester, I can help. I've got a spare notebook running ubuntu somewhere... 😄

scripting commented 2 years ago

@scotthansonde -- that'd be great. which version should i provide for you?

scotthansonde commented 2 years ago

@scripting x64, thanks!

kevinctofel commented 2 years ago

I don't have a Linux with a GUI to test it on, so he'll have to do the testing.

Just a quick mention for anyone that has a Chromebook (I know Dave recently got one): Chromebooks can run a persistent Debian client instance with CLI. And any GUI apps you install to that instance will run on your Chromebook in their own window. You’ll find the option to enable this in your Settings, under Advanced, Developer. I’ve been covering this feature (and using it heavily!) for about 3 years.

scripting commented 2 years ago

@scotthansonde -- I've been trying to upload it for an hour and it's not working. I think my ISP is having problems. I'll post a link here when it's available. Oy. ;-)

scripting commented 2 years ago

@scotthansonde & @emk -- here's the Linux download.

https://s3.amazonaws.com/scripting.com/publicfolder/downloads/electricDrummer-linux-x64.zip

emk commented 2 years ago

Thank you! This is great.

I downloaded it, set it as executable, and tried to run it.

❯ ~/bin/Electric\ Drummer
~/bin/Electric Drummer: error while loading shared libraries: libffmpeg.so: cannot open shared object file: No such file or directory

This looks like https://github.com/electron/electron/issues/25440.

This looks like it's the only library error of this type, too:

❯ ldd ~/bin/Electric\ Drummer | grep "not found"
    libffmpeg.so => not found

So we're probably really close, because this is a known Electron packaging issue on Linux. I could maybe help dig into this later.

scotthansonde commented 2 years ago

I tried making a Hello World Electron app on my Mac for Linux. After some false starts, I remembered that for Linux that you can't just copy over the executable file, but also the shared libraries and other resources that are needed.

The electron-packager README mentions some Linux package creators at the bottom. I tried electron-installer-debian, since Ubuntu uses .deb packages. After a couple of tries I was able to create a deb package for my Hello World, which I copied over to my Linux instance, installed with with sudo apt install ./electron-quick-start_1.0.0_amd64.deb, and was able to run. But even for Hello World the .deb package included 111 files!

CleanShot 2022-01-11 at 14 31 47

scotthansonde commented 2 years ago

I've put my project at https://github.com/scotthansonde/sample-electron-app

scripting commented 2 years ago

@scotthansonde -- thank you for picking up the ball on this.

I want to work on a different project today, but after that I'll swing back around to this.

Here's a question, if I uploaded to a private github repo the contents of my electron folder, would you attempt to build Electric Drummer for Linux? That might be a sensible way to proceed since you're already dug in on this.

scotthansonde commented 2 years ago

@scripting Yes, I'm willing to try that.

scripting commented 2 years ago

@scotthansonde -- i've created the repo and added you as a collaborator.

scripting commented 2 years ago

@kevinctofel -- I'm using the Chromebook now, and looking in Settings/Advanced/Developer, but don't see anything about enabling GUI apps. Here's a screen shot.

image

kevinctofel commented 2 years ago

What this gets you is a newly installed Terminal app, where you have a standard Linux CLI. Open the Terminal app (it should be in your list of Chrome OS apps, possibly in a folder called “Linux apps”. Once Terminal is running you can use apt install to install any Linux package. (Or you can download a .deb package from the browser, right click the downloaded file in the Chrome OS Files app and select “Instal to Linux”). Once a Linux GUI app is installed, Chrome OS will have a launcher icon for the Linux app in the Chrome OS launcher. Or you can execute the app from the CLI.

Example: In the attached image, I’m running VS Code for Linux in its own window on my Chromebook. In my dock at the bottom, there are icons showing VS Code and Terminal, alongside the Chrome OS apps. B9494C03-1522-4CF6-A447-E2FFD85951A4

Note that that’s an old screenshot, and the new Terminal icon looks slightly different.

kevinctofel commented 2 years ago

Another example where I explained how to install LibreOffice for Linux on a Chromebook: https://www.aboutchromebooks.com/news/how-to-install-libreoffice-for-linux-on-a-chromebook-after-downloading-it-as-a-tar-gz-file/

Once installed, the LibreOffice GUI app opens up automatically when run.

scripting commented 2 years ago

@kevinctofel -- aha -- yes I have been to the Terminal app. You didn't say that part. Your initial comment implied that turning on the GUI apps was done in the Advanced panel.

kevinctofel commented 2 years ago

@scripting apologies! Yeah, there's nothing to "enable" for Linux GUI apps. Just install 'em and run 'em. 😎 If you're curious about how this works under the hood, here's the Chromium dev documentation: https://chromium.googlesource.com/chromiumos/docs/+/master/containers_and_vms.md