Support for Lutris's scripts
Hello,
it would be great if we add another scripts "repository" which would contain Lutris's scripts.
I know that Lutris has scripts in different format, but you could make something like parser and vocabulary table which converts it to Phoenicis "language". If user select app from Library, which has both Phoenicis and Lutris scripts, then show popup, where user can choose which script to use.
I'm not sure if this is possible. I would assume that it's probably easier to simply write a Phoenicis script manually.
It should be possible if we make parser for it. I mean we should "unite" these app scripts for Linux (like Lutris), it would be great, if there was client which can work with many scripts / engines.
Ok, but still I doubt that it will work 100% automatically. So maybe it would be better to have a simple converter. Then you could fix possible issues manually after the conversion.
@plata I think the two ways can be done at the same time. First we create an abstract script that can import any yaml file and that can be extended. Then, if we have good result, we try to create a repository implementation
Afaik there are like 5 scripts that would be worth migrading on phoenicis and i'm currently working on two of those (Overwatch, League Of Legends)
Based on my experience the rest is semi~non-functonal..
Aldo i would like to see emulator support on phoenics :thinking:
but i think that support for bash, json (YAML) installers might prove beneficial too
@qparis just to get you right: You're idea is to implement this in Javascript? So derive InstallerScript? I think that could work. We would probably need a generic YAML parser Bean.
Yes this is the idea. I think Jackson could do that
Would you want to have a LutrisDTO or use the map directly?
As long as we just want to access the file in JS, a Map should be sufficient
Can you describe the steps which would be required to do this in a way that someone who doesn't know Phoenicis in detail could implement it?
Maybe you can also improve the scripting tutorial, with explanations like : "in Lutris script, it is that".
Also, a link for the documentation inside the main github bar would be is easier to find (instead of scrolling inside the readme).
Can you describe the steps which would be required to do this in a way that someone who doesn't know Phoenicis in detail could implement it?
1. [Phoenicis] Create a bean "Yaml parser" (maybe inside phoenicis-tools) with two publics methods:
- String serialize(Map objectToSerialize)
- Map unserialize(String yamlString)
- See https://github.com/FasterXML/jackson-dataformats-text
- [Scripts] Write an interface so that all the scripts can use this bean (2 - 3 lines of code max)
At this point, scripts can parse any YAML file to do whatever they want with it
In fact this step is not needed
- [Scripts] Create a "Lutris Windows Script" Script. The template of "GoG Script" can be copied and pasted, because it is basically the same. Try to implement it from examples. Should not be too hard
- Two way of running a script:
- From a raw yaml string
- From a URL
At this point, scripts can quickly run YAML formated scripts.
- [Phoenicis] [Optional, but would demonstrate the power of phoenicis architecture] Create a Repository Implementation that automatically sends yaml to this script.
@qparis I don't think step 3 will work. When looking at the lutris scripts, they seem to be quite different compared to our scripts.
Basically we would require a converter, which converts a lutris script into a Phoenicis script. If during this process something can't be converted, the resulting Phoenicis script is likely not usable.
To write such a converter the implementer requires very deep knowledge of both the Phoenicis scripts and the lutris scripts.
I think this would work for most of them. Any unsupported "verbs" will throw an exception and this can be improved later
For example, you can start with winesteam runner
A point we need to think about: what do we do about the Wine version? In general, the Lutris Wine version is not available (unless we include the Lutris Wine builds by default - which would work).
It depends. If we have similar build, better using it. If we don't have similar build, the question is: do we need similar build? If so, we modify winebuild. If not, we provide an alternative and suitable build
How can you find out if we have a similar build automatically?
They have very few number of builds and they sems to be managed “by hand”. So I guess we jut have to map them. We can create some distributions if that helps