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

Windows compatible? #9

Open
Darthagnon opened this issue Sep 9, 2023 · 9 comments
Open

Windows compatible? #9

Darthagnon opened this issue Sep 9, 2023 · 9 comments
Labels
enhancement New feature or request

Comments

@Darthagnon
Copy link

Was just wondering if this awesome project was Windows-compatible? GoLang stuff usually is, but I saw references to GTK, which is a little more complicated on Windows.

@pojntfx pojntfx added the enhancement New feature or request label Sep 10, 2023
@pojntfx
Copy link
Owner

pojntfx commented Sep 10, 2023

Yup, it is! I made sure that it spawns MPV etc. correctly, and tested it on Windows 11. There used to be a complete CI/CD setup I've set up for Windows, but I decided to drop it before release since I can't really test it properly:

multiplex/Hydrunfile

Lines 54 to 99 in b2e0f2e

# Windows (see https://gist.github.com/pojntfx/36a1f41ffd34af7d2f3abe43646142e1)
if [ "$1" = "windows" ]; then
# Install native dependencies
sudo dnf update -y
sudo dnf install -y curl wine
# Install MSYS2
curl -L -o /tmp/msys2.exe 'https://github.com/msys2/msys2-installer/releases/download/2021-11-30/msys2-base-x86_64-20211130.sfx.exe'
wine64 /tmp/msys2.exe x -y -oC:/
# Fix MSYS2
sed -i ~/.wine/drive_c/msys64/etc/pacman.conf -e 's/SigLevel = Required/SigLevel = Never/g'
cat /etc/pki/tls/certs/ca-bundle.crt >~/.wine/drive_c/msys64/usr/ssl/certs/ca-bundle.crt
cat /etc/pki/tls/certs/ca-bundle.trust.crt >~/.wine/drive_c/msys64/usr/ssl/certs/ca-bundle.trust.crt
export WINEPATH="C:\\msys64\\usr\\bin"
# Install GCC, Go, GTK4 and libadwaita (plus any other packages you want to be included in the image)
rm -f ~/.wine/drive_c/msys64/var/lib/pacman/db.lck
wine64 bash.exe -c 'pacman --noconfirm --ignore pacman -Syy'
rm -f ~/.wine/drive_c/msys64/var/lib/pacman/db.lck
wine64 bash.exe -c 'pacman --noconfirm --ignore pacman --needed -S git mingw-w64-x86_64-gcc mingw-w64-x86_64-go mingw-w64-x86_64-pkg-config mingw-w64-x86_64-gtk4 mingw-w64-x86_64-gobject-introspection mingw-w64-x86_64-gobject-introspection-runtime mingw-w64-x86_64-glib2 mingw-w64-x86_64-libadwaita mingw-w64-x86_64-mpv'
sed -i ~/.wine/drive_c/msys64/mingw64/lib/pkgconfig/* -e 's/-Wl,-luuid/-luuid/g' # See https://github.com/gotk3/gotk3/wiki/Installing-on-Windows#chocolatey, fails with invalid flag in pkg-config --libs: -Wl,-luuid otherwise
mkdir -p ~/.wine/drive_c/go ~/.wine/drive_c/tmp
# Copy source code to directory on C drive
rm -rf ~/.wine/drive_c/users/$(whoami)/Documents/gotk4-workspace
mkdir -p ~/.wine/drive_c/users/$(whoami)/Documents/gotk4-workspace
rm -rf out
cp -r . ~/.wine/drive_c/users/$(whoami)/Documents/gotk4-workspace
# Build
wine64 bash.exe -c "export PATH=$PATH:/mingw64/bin GOPATH=/c/go GOROOT=/mingw64/lib/go TMP=/c/tmp TEMP=/c/tmp GOARCH=amd64 && cd /c/users/$(whoami)/Documents/gotk4-workspace && go generate ./..."
wine64 bash.exe -c "export PATH=$PATH:/mingw64/bin GOPATH=/c/go GOROOT=/mingw64/lib/go TMP=/c/tmp TEMP=/c/tmp GOARCH=amd64 && cd /c/users/$(whoami)/Documents/gotk4-workspace && go build -buildvcs=false -ldflags='-linkmode=external' -x -v -o out/vintangle-gui.exe ./cmd/vintangle-gui"
# Copy binaries to staging directory
rm -rf out
mkdir -p out/dist/bin
yes | cp -f ~/.wine/drive_c/users/$(whoami)/Documents/gotk4-workspace/out/* out/dist/bin
# Package
cp -r ~/.wine/drive_c/msys64/mingw64/* out/dist
cd out/dist || exit
zip -FSr ../vintangle-gui.windows-x86_64.exe.zip .
cd ..
rm -rf dist
fi

@pojntfx
Copy link
Owner

pojntfx commented Sep 10, 2023

I'm def. open to building it on Windows again, but for that to be viable I would need to be able to build and test the Windows build from Linux for it to be maintainable.

@Siilwyn
Copy link

Siilwyn commented Sep 12, 2023

Or if possible sharing a webapp? Sharing a link with people would be an even lower barrier for entry, using WebRTC just to watch so only one person needs to have Linux.

@pojntfx
Copy link
Owner

pojntfx commented Sep 12, 2023

While the web sharing idea would be optimal, implementing it is a bit challenging due to browser limitations and legal concerns. See: #5

@gmankab
Copy link

gmankab commented Sep 15, 2023

@pojntfx, can you publish windows build on releases tab please?

@pojntfx
Copy link
Owner

pojntfx commented Sep 18, 2023

@pojntfx, can you publish windows build on releases tab please?

I'm actively looking into it now that I got WINE on MSYS2 to work again, but I'm still not sure if I can genuinely support the platform considering that I don't really have a machine to do the testing for it on. See #9 (comment)

@gmankab
Copy link

gmankab commented Oct 5, 2023

you can just publish it and community will test it :)

@pojntfx
Copy link
Owner

pojntfx commented Oct 9, 2023

That could be a way of doing it, but publishing a release without being able to test it on my end will eventually lead to a lot of issues that I can't really account for.

@gmankab
Copy link

gmankab commented Oct 18, 2023

:(

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

No branches or pull requests

4 participants