deckmaster icon indicating copy to clipboard operation
deckmaster copied to clipboard

Getting deckmaster running under Wine?

Open JeffHoogland opened this issue 6 years ago • 11 comments

Hey There -

This may or may not be something that can be done, but I was wondering if you could give me some insight as to the Windows dependencies of the addon that I might be able to install to get the app to run properly under Wine on Ubuntu. Been running / streaming MTGA from Linux without issue, but would like to get this addon working under it as well if possible.

It seems to load up fine, but the UI doesn't populate: image

If have ideas that would be great, either way, thanks for reading!

JeffHoogland avatar Oct 02 '18 00:10 JeffHoogland

Hey @JeffHoogland I'm a viewer/subscriber on your stream (RootSamurai), and also a developer. I took a look into this and it looks like the main problem is that Chrome/Chromium-based things currently don't run well on Wine. If you take a look at https://appdb.winehq.org/objectManager.php?sClass=category&iId=33&sAction=view&sTitle=Browse+Applications, Chrome along with everything Chromium-based are all listed as Garbage or Bronze status. All the entries I looked at indicated pages don't render. This project is using electron, which is effectively an embedded Chromium browser with nodejs, so I think you're running into the same Chromium support issues with Wine.

That said, I think there might be a way to get you up and running with your Linux rig. It seems Deckmaster at it's core just tails/follows the Arena log files. It might be possible to run the electron-based UI directly on Linux and point it at the Arena log files in your wine prefix (~/.wine/drive_c/<path to arena logs>). Then the electron process would be running directly on Linux, which handles Chrome/Chromium just fine.

Thoughts, @Fugiman ?

bobziuchkovski avatar Oct 23 '18 17:10 bobziuchkovski

Yeah - in theory the code here should build + run cross platform from my understanding of what Electron is doing. I just don't have the experience to get it to build correctly on Ubuntu 18.04. Simply following the build directions after installing the dependencies hit some errors for me after I pointed it to the correct location of my output log file.

If my time permits I might also take a look at seeing how it sends information to Twitch. Odds are I could probably write a similar tool in Python that scraps the log and sends up the information it needs to populate the UI.

JeffHoogland avatar Oct 23 '18 20:10 JeffHoogland

@JeffHoogland I've forked and pushed a build-on-linux branch here. You should only need nodejs and yarn installed on your Linux box in order to build. I built with node version 10.12.0 and yarn version 1.10.1, but other versions should be fine, too.

Just run the updated build.sh script, set the ARENA_LOG_PATH environment variable to point to the output_log.txt from your wine install, and run the deckmaster binary from the dist directory.

Feel free to review the commits. I had to disable the Sentry release plugin, drop a bogus reference to a static directory, and drop the auto-updater check since this repo has no linux builds pushed. Nothing too crazy, but those were some small adaptations required to get it to run without throwing exceptions.

CC @Fugiman on the Sentry release plugin and static directory reference -- having the webpacker config wired to notify Sentry means other contributors can't build without having Sentry configured locally...might make sense to use their CLI command instead and wire that up to a release script or something instead. And the static directory reference seems like some outdated/unused reference for production builds?

bobziuchkovski avatar Oct 24 '18 17:10 bobziuchkovski

Builds, launches, and detects as expected!

https://cdn.discordapp.com/attachments/200494040502894595/504762734898970644/unknown.png

I'll try it on a live stream tomorrow afternoon to confirm it sends the info to Twitch correctly.

Will the path to my output file be baked into this app image directly, or will I need to make sure to set it in my terminal before running the app image?

JeffHoogland avatar Oct 24 '18 21:10 JeffHoogland

@JeffHoogland Glad it works! You'll need to set the ARENA_LOG_PATH in your terminal before launching each time (or create a wrapper script/shortcut or similar that sets it before launching). I could make it configurable via the UI and persist the path, but I figured it would make sense to get something working first and see if @Fugiman chimes in with any thoughts on how best to handle going forward. Ideally we could agree on some changes that don't affect the windows builds but make it flexible enough to use like you're using, too.

bobziuchkovski avatar Oct 24 '18 22:10 bobziuchkovski

Makes sense - I'll confirm it sends to twitch tomorrow.

Other apps that work off the log file auto detect it (which works for most installs) and then also leave the option to manually point to it in a settings panel. Something like that might work well here as well so it leaves people who have stock setups alone, but lets others like mine work as expected.

JeffHoogland avatar Oct 24 '18 22:10 JeffHoogland

Yep, that's probably the best way forward

bobziuchkovski avatar Oct 24 '18 22:10 bobziuchkovski

Just wanted to confirm that this works as expected running from Linux.

JeffHoogland avatar Oct 25 '18 20:10 JeffHoogland

Awesome!

@Fugiman I realize you probably aren't planning to release linux builds, but are you open to accepting some PRs that would at least make it easier for @JeffHoogland and others to build and run on Linux/Mac themselves, assuming the changes don't impact the existing Windows support?

I think the main things would be:

  • Detect the presence of the output_log.txt file and add a UI element that allows the user to select the path to the file if it can't be auto-detected. Technically this might even help some Windows users if they use non-standard paths.
  • Update the build scripts/config to support running on Linux/Mac and running on a fresh clone of the repo without Sentry or anything else configured.

I'd be happy to make these changes and submit as PRs, but want to check if you'd accept them before I invest the time.

bobziuchkovski avatar Oct 25 '18 23:10 bobziuchkovski

@Fugiman it would be really nice if you could take the time to look over this fork and merge the few changes it needs to build on Linux into your main branch here. @bobziuchkovski even offered to help a bit.

I think I've updated it successfully for RNA cards, but I'll have to wait till Thursday to find out.

If time / money is an issue I'm willing to pay you to take the time to do this as I am likely one of the few that would end up using it.

Thanks!

JeffHoogland avatar Jan 16 '19 12:01 JeffHoogland

@Fugiman - also adding support for any/all PRs to include MTGA streamers via Wine installation.

mianosm avatar Mar 05 '19 12:03 mianosm