I'm trying to build the wireguard-android sources on my windows machine, fixing the problems step by step with trial and error.
I have CMake and Make installed, the first problem I encountered was the 'bad' value reported by uname
(mingw64), not matching with the golang filenames hosted by Google.
I've edited (hacked) the make file to point to the real filename of the windows version (amd64). The problem is the windows version has a .zip
extension instead of .tar.gz
and the result from zip doesn't seem compatible with the piped command.
Original command:
curl "https://dl.google.com/go/go$(DESIRED_GO_VERSION).$(shell uname -s | tr '[:upper:]' '[:lower:]')-$(NDK_GO_ARCH_MAP_$(shell uname -m)).tar.gz" | tar -C "$(dir $@)" --strip-components=1 -xzf -
My attempted changes: (uses an if-else because it still needs to run on mac too)
ifeq "msys" "$(shell uname -o | tr '[:upper:]' '[:lower:]')"
# Note: when enclosed in the ifeq, the ARCH_MAP part no longer worked
# Note: using tar with the zip fails, because we cant untar a zip (signal 13)
# Note: using unzip with the zip fails with confusing paths
curl "https://dl.google.com/go/go$(DESIRED_GO_VERSION).windows-amd64.zip" | unzip -C "$(dir $@)" --strip-components=1 -xzf -
else
curl "https://dl.google.com/go/go$(DESIRED_GO_VERSION).$(shell uname -s | tr '[:upper:]' '[:lower:]')-$(NDK_GO_ARCH_MAP_$(shell uname -m)).tar.gz" | tar -C "$(dir $@)" --strip-components=1 -xzf -
endif
Resulting error if using unzip:
unzip: cannot find or open C:\wireguard-android\app\build\intermediates\cmake\debug\obj\armeabi-v7a/../generated-src/go-1.13.7/, C:\wireguard-android\app\build\intermediates\cmake\debug\obj\armeabi-v7a/../generated-src/go-1.13.7/.zip or C:\wireguard-android\app\build\intermediates\cmake\debug\obj\armeabi-v7a/../generated-src/go-1.13.7/.ZIP.
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 127M 0 5419 0 0 26694 0 1:23:47 --:--:-- 1:23:47 26694
curl: (23) Failed writing body (34 != 1357)
make: *** [C:\wireguard-android\app\build\intermediates\cmake\debug\obj\armeabi-v7a/../generated-src/go-1.13.7/.prepared] Error 9
Resulting error if using tar:
curl "https://dl.google.com/go/go1.13.7.windows-amd64.zip" | tar -C "C:\wireguard-android\app\build\intermediates\cmake\debug\obj\armeabi-v7a/../generated-src/go-1.13.7/" --strip-components=1 -xzf -
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0gzip: stdin has more than one entry--rest ignored tar: Child died with signal 13 tar: Error is not recoverable: exiting now
0 127M 0 108k 0 0 248k 0 0:08:47 --:--:-- 0:08:47 248k
curl: (23) Failed writing body (738 != 1357)
make: *** [C:\wireguard-android\app\build\intermediates\cmake\debug\obj\armeabi-v7a/../generated-src/go-1.13.7/.prepared] Error 2
- How should I get this command working? (With either tar or zip/unzip)
- Somebody pointed out to me, that maybe I need the Android distro, not the Windows one. In that case I would assume I need armeabi-v7a, but I can only see ARMv6 and ARMv8 packages. What distribution should I use?