scripts icon indicating copy to clipboard operation
scripts copied to clipboard

Support for Lutris's scripts

Open t0msk opened this issue 7 years ago • 19 comments

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.

t0msk avatar Jan 04 '19 12:01 t0msk

I'm not sure if this is possible. I would assume that it's probably easier to simply write a Phoenicis script manually.

plata avatar Jan 04 '19 12:01 plata

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.

t0msk avatar Jan 04 '19 12:01 t0msk

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 avatar Jan 04 '19 12:01 plata

@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

qparis avatar Jan 04 '19 12:01 qparis

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

Kreyren avatar Jan 04 '19 12:01 Kreyren

@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.

plata avatar Jan 04 '19 12:01 plata

Yes this is the idea. I think Jackson could do that

qparis avatar Jan 04 '19 12:01 qparis

Would you want to have a LutrisDTO or use the map directly?

plata avatar Jan 04 '19 12:01 plata

As long as we just want to access the file in JS, a Map should be sufficient

qparis avatar Jan 04 '19 13:01 qparis

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?

plata avatar Jan 04 '19 13:01 plata

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).

ImperatorS79 avatar Jan 04 '19 13:01 ImperatorS79

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

  1. [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

  1. [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.

  1. [Phoenicis] [Optional, but would demonstrate the power of phoenicis architecture] Create a Repository Implementation that automatically sends yaml to this script.

qparis avatar Jan 04 '19 19:01 qparis

@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.

madoar avatar Jan 04 '19 19:01 madoar

I think this would work for most of them. Any unsupported "verbs" will throw an exception and this can be improved later

qparis avatar Jan 04 '19 19:01 qparis

For example, you can start with winesteam runner

qparis avatar Jan 04 '19 19:01 qparis

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).

plata avatar Jan 04 '19 22:01 plata

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

qparis avatar Jan 04 '19 22:01 qparis

How can you find out if we have a similar build automatically?

plata avatar Jan 04 '19 22:01 plata

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

qparis avatar Jan 04 '19 23:01 qparis