Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POC: Read lutris installer #788

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

qparis
Copy link
Member

@qparis qparis commented Jan 4, 2019

No description provided.

@plata
Copy link
Collaborator

plata commented Jan 4, 2019

Is the Theme Hospital script related to Lutris at all?

Does it make sense to implement it like this? I mean if you have to implement a wrapper script anyways, you could directly implement a Phoenicis script. My idea was a bit different: implement something like CustomInstallerScript for Lutris. So there would be only one generic script. If you run it, you give it the slug and the rest is handled by the script.

@qparis
Copy link
Member Author

qparis commented Jan 4, 2019

Is the Theme Hospital script related to Lutris at all?

Nope, and it does not work at all. I had just forgotten to remove it.

Does it make sense to implement it like this? I mean if you have to implement a wrapper script anyways, you could directly implement a Phoenicis script. My idea was a bit different: implement something like CustomInstallerScript for Lutris. So there would be only one generic script. If you run it, you give it the slug and the rest is handled by the script.

The script sample is not important. It is just a way for us to test that the core script works correctly.
Afterwards, we can directly implement a Repository in java to wrap all the scripts directly

@plata
Copy link
Collaborator

plata commented Jan 4, 2019

Understood. Do you want to create a Lutris SteamScript, a Lutris UplayScript etc or only one Lutris Script?

@qparis
Copy link
Member Author

qparis commented Jan 4, 2019

Understood. Do you want to create Lutris SteamScript Lutris UplayScript etc or only one Lutris Script?

Maybe safer to start small. At the end, you always can write a LutrisGenericScript that will redirect to the right subscript.

You can also factorize some tools (like installer step reading) somewhere else if you want

@madoar
Copy link
Collaborator

madoar commented Jan 4, 2019

In my opinion this sounds like a task for a converter.
This would be the easiest way to handle this.
In a nutshell, we can then provide a LutrisInstallerScript, which only takes a slug.
The approach would then be as followed:

  1. download the lutris script
  2. convert it to a Phoenicis script
  3. execute the converted Phoenicis script

I also think that the conversion shouldn't be implemented in JavaScript, because there are too many conversion cases in my opinion.
If we did this in a single JavaScript file it would be quite long and hard to read.

@plata
Copy link
Collaborator

plata commented Jan 4, 2019

That's true. I somehow feel a bit uncomfortable about the way the Lutris repository will be created from Java. I'm sure it will work but from our concept it should rather be in Javascript. Especially because the Java repository will need this particular scripts repository. That doesn't feel right for me.

@qparis
Copy link
Member Author

qparis commented Jan 4, 2019

I'm not sure that you need to retranslate everything. It's way easier than that. If you look at my MR, you'll see that the structure is basically here (and it works).

What needs to be done is to look-up all the kind of task we can have (there is a finite number because lutris scripts are descriptive and not imperative).

Look at this method, we need to make it a little more abstract.

LutrisWineSteamScript.prototype._evalInstallerStep = function (installerStep, wine, wizard) {
    if (installerStep["task"] && installerStep["task"]["name"] === "winetricks") {
        var verb = nstallerStep["task"]["app"];

        // TODO
    }
}

What we can do here is to "register" a list of adapter instances written in JS to LutrisWineSteamScript.

An adapter just have two methods:
-String defineTaskName()
-void execStep(wine, wizard)

Then, we just implement a few time this interface and we are good

@qparis
Copy link
Member Author

qparis commented Jan 4, 2019

That's true. I somehow feel a bit uncomfortable about the way the Lutris repository will be created from Java. I'm sure it will work but from our concept it should rather be in Javascript. Especially because the Java repository will need this particular scripts repository. That doesn't feel right for me.

It can be done on an other place like a small microservice hosted somewhere

@qparis
Copy link
Member Author

qparis commented Jan 4, 2019

Or we can implement a system of script decorators.

@madoar
Copy link
Collaborator

madoar commented Jan 4, 2019

@qparis it is not that easy I believe.
Lutris scripts can also contain an execute block, where you can basically do everything you want as I understand it, for example executing unzip. We would need to convert these too. When doing this we will also want to check, whether we have our own tool for the execution task. For example we want to call our unzip script and not the system tool.

@madoar
Copy link
Collaborator

madoar commented Jan 4, 2019

Additionally there seem to be system variables, wine configuration variables and other things.
I'm not sure how much effort it is to translate/convert these things.

@qparis
Copy link
Member Author

qparis commented Jan 4, 2019

@qparis it is not that easy I believe.
Lutris scripts can also contain an execute block, where you can basically do everything you want as I understand it, for example executing unzip. We would need to convert these too. When doing this we will also want to check, whether we have our own tool for the execution task. For example we want to call our unzip script and not the system tool.

We can call the system tool as a "catch-all" backup, this is fine. Then, we can tune to optimize

@qparis
Copy link
Member Author

qparis commented Jan 4, 2019

Or we can implement a system of script decorators.

Or an automatic instancier

@plata
Copy link
Collaborator

plata commented Jan 4, 2019

It would be nice if the Lutris support could work just like any other repository without special mechanisms. It's a bit similar like for engines: they also have a special mechanism to get their versions. I wonder if we could streamline all this.
My vision would be that every entity in the repository is a first class citizen which can be used in a common way. Not sure if that will really be possible but maybe it helps you understand what I'm thinking about.

@qparis
Copy link
Member Author

qparis commented Jan 4, 2019

In your vision, is it possible to fetch inside a repository something that can help fetching other repositories?

@plata
Copy link
Collaborator

plata commented Jan 4, 2019

Yes, why not. As long as this is not restricted to certain script types etc. I think it would be valid if e.g. Wine populates the repository with all available Wine versions (or in this case Lutris with all Lutris scripts).

@qparis
Copy link
Member Author

qparis commented Jan 4, 2019

Why not implementing these behaviors at phoenicis side?

@plata
Copy link
Collaborator

plata commented Jan 4, 2019

We we find a good way to implement this, sure. Maybe we should discuss this in a separate issue?

@qparis
Copy link
Member Author

qparis commented Jan 4, 2019

Yes but I’d just like to ensure that @madoar is ok with the approach.
Don’t make me wrong, Lutris support is just a pretext to challenge our architecture. If we manage to do it without too much effort, we can then do a repository for GOG, etc...

@madoar
Copy link
Collaborator

madoar commented Jan 4, 2019

I'm not sure I understand what exactly you have in mind.
I'm fine with providing support for lutris scripts.
I'm just not sure how to do it best.
In addition I think that we should watch out what we do on the JavaScript side, because JavaScript tends to become messy if the code gets too long and complex.

@plata
Copy link
Collaborator

plata commented Jan 4, 2019

Yes, we could basically provide a naive script for each and every Steam app. We could reuse the apps tab implementation to install engines, provide all winetricks verbs... There are so many things possible.

@plata
Copy link
Collaborator

plata commented Jan 4, 2019

Let's move this discussion to a new issue. @qparis can you open it? Then we can explain the idea in more detail.

@qparis
Copy link
Member Author

qparis commented Jan 4, 2019

Ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants