pywine icon indicating copy to clipboard operation
pywine copied to clipboard

Git in Wine ?

Open olivierdalang opened this issue 2 years ago • 4 comments

Hey !! Thanks for the image, works flawlessly to cross build .exe !!

I'm however stuck with a project which relies on setuptools_scm, since there is not git in Wine.

I was not able to install it even by following https://github.com/git-for-windows/git/wiki/Silent-or-Unattended-Installation.

You probably don't want to include too much things in wine, but git would be a nice addition, especially in the context of CI.

olivierdalang avatar Jan 16 '24 16:01 olivierdalang

Interesting idea, I'll think about it...

TobiX avatar Jan 17 '24 08:01 TobiX

For reference, after fiddling quite a bit more, I found a way to make it work:

curl -L https://github.com/git-for-windows/git/releases/download/v2.43.0.windows.1/MinGit-2.43.0-64-bit.zip --output MinGit-2.43.0-64-bit.zip
unzip MinGit-2.43.0-64-bit.zip -d mingit
cp mingit/cmd/* ${WINEPREFIX}/drive_c/windows/system32/
cp mingit/mingw64/bin/* ${WINEPREFIX}/drive_c/windows/system32/

(I'm running these steps directly in my gitlab runner on your tobix/pywine:3.11, meaning it should probably work by just adding these steps in the dockerfile)

Not sure how clean it is to just write to c/windows/system32/, but trying to put it elsewhere and adding to path didn't cut it (some scripts with subprocess.run(..., shell=False) wouldn't find the git executable)

olivierdalang avatar Jan 17 '24 11:01 olivierdalang

When using the (headless) installer, did you try running wineboot afterwards? Maybe the PATH extension is delayed until the next "reboot"?

TobiX avatar Jan 17 '24 11:01 TobiX

I wasn't able to complete the headless installation due to https://github.com/git-for-windows/git/issues/3636 But maybe there's a way, I'm not familiar at all with wine nor the windows command line.

olivierdalang avatar Jan 17 '24 11:01 olivierdalang