[Nix-dev] packaging windows applications through wine

Tomas Hlavaty tom at logand.com
Mon Apr 24 23:46:34 CEST 2017


Hi Taeer,

Taeer Bar-Yam <tb442 at cornell.edu> writes:
> Not sure if you intentionally didn't reply to the group, so I'll send this just to you.

ah, the message was meant for the list.  Thanks for telling me.

>> Hi Taeer,
>> 
>>> When one installs things through wine, one usually has to click
>>> through a bunch of agreements for things installed via winetricks. Can
>>> we bypass this so we can make nix packages for these things that
>>> installs nicely?
>> 
>> It depends.  Is it free software?  Then you can build it from source and
>> don't need any interactive installer.
>  
> LoL isn't free software. But regardless, the process of installing anything in
> wine (even free software) usually requires what I think is proprietary windows
> stuff which requires clicking through installation (like vcrun2005 or
> whatever)

If LoL requires users to click through a bunch of agreements, are you
allowed to bypass that?

>>> The other challenge I see is where do you put the wineprefix? Because
>>> on the one hand you want the installation to happen at system build
>>> time, so that would suggest the nix store. But you also want the
>>> application to be able to write files (like saves &c) so that would
>>> have to be in your home folder.
>> 
>> wineprefix should not be in the nix store.
>> 
>> At build-time, wineprefix can be in a temporary directory which is
>> writeable.
>> 
>> At run-time, it is usually in ~/.wine unless you specify something
>> different.
>
> Right, but the problem is if you're installing something via configuration.nix,
> all of the results have to go into the store, because you don't even know what
> users there are.

Yes, results go into the store.  It does not mean that wineprefix has to
point there, e.g.

$ WINEPREFIX=~/.wine64-test wine64 /nix/store/xxxxxx-myprog-1.0/bin/myprog.exe

can work.

>>> Is how to package wine applications a solved problem, or do I need to
>>> do some creative work?
>> 
>> It depends.  At work, we cross-compile some packages with mingw and test
>> them under wine.  This works quite well but is far from solved problem
>> as most packages don't work out of the box.  It's still better than
>> chasing prebuilt and up-to-date binaries or installers on the web.
>
> I'm talking specifically about making nix packages for applications run through
> wine. So you can just add e.g. league_of_legends to your systemPackages, and it
> will install it in a wine prefix and provides you an alias so you can just run
> it, and not even know it's running through wine.

There is not much special about nix packages for applications run
through wine.  Just write a package with a shell script which will do
everything necessary without users having to worry about anything.

I don't think "install it in a wine prefix" is correct way to describe
it.

Tomas


More information about the nix-dev mailing list