summaryrefslogtreecommitdiff
path: root/Makefile
blob: 7e9ec69dfdd59a978074ce0f4fcbfe467a83b799 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
SYSTRAY := 0xacab.org/leap/bitmask-systray
STAGING := staging

deps_win:
	choco install -y golang python upx nssm nsis wget 7zip
openvpn_win:
	if not exist staging\openvpn mkdir staging\openvpn
	wget https://build.openvpn.net/downloads/releases/latest/tap-windows-latest-stable.exe -O staging/openvpn/tap-windows.exe
# eventually, this should be built statically and cross compiled in the same pipeline that we build the installer. 
	wget https://downloads.leap.se/thirdparty/windows/openvpn-x86_64-w64-mingw32.tar.bz2 -O staging/openvpn/openvpn.tar.bz2
	7z e -y -ostaging/openvpn/ staging/openvpn/openvpn.tar.bz2
	7z e -y -r -ostaging/openvpn/ staging/openvpn/openvpn.tar *.dll
	7z e -y -r -ostaging/openvpn/ staging/openvpn/openvpn.tar *.exe
	copy .\staging\openvpn\openvpn.exe .\staging
	copy .\staging\openvpn\*.dll .\staging
helper_win:
	go build -ldflags "-s -w" -o $(STAGING)/bitmask_helper.exe .\helper
	upx $(STAGING)/bitmask_helper.exe
systray_win:
	go get -tags "standalone" -u $(SYSTRAY)
	go build -tags "standalone" -ldflags "-H windowsgui -s -w" -o $(STAGING)/bitmask-systray.exe $(SYSTRAY)
build_win: staging\nssm.exe helper_win systray_win
# since it's tedious, I assume you did bootstrap openvpn_win manually already.
	echo "[+] building windows"
	if not exist dist mkdir dist
	make -C win
	"C:\Program Files (x86)\NSIS\makensis.exe" win/RiseupVPN-installer.nsi
build_osx:
	echo "[+] building osx..."
build_snap:
	echo "[+] building snap..."

staging\nssm.exe:
	xcopy /y "C:\ProgramData\chocolatey\lib\NSSM\tools\nssm.exe" $(STAGING)