forked from digidream/borg-cygwin
-
Notifications
You must be signed in to change notification settings - Fork 7
/
build-installer.bat
70 lines (44 loc) · 2.3 KB
/
build-installer.bat
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
REM --- Change to use different CygWin platform and final install path
set CYGSETUP=setup-x86_64.exe
set TARGETPATH=.
REM --- NSIS must be installed! Get NSIS from http://nsis.sourceforge.net/Download
set MAKENSIS=C:\Program Files (x86)\NSIS\makensis.exe
set POWERSHELL=%windir%\System32\WindowsPowerShell\v1.0\powershell.exe
REM --- Fetch Cygwin setup from internet using powershell
"%POWERSHELL%" -Command "(New-Object Net.WebClient).DownloadFile('https://cygwin.com/setup-x86_64.exe', 'setup-x86_64.exe')"
REM --- Install build version of CygWin in a subfolder
set OURPATH=%cd%
set CYGBUILD=%OURPATH%\CygWin
set CYGMIRROR=http://mirrors.kernel.org/sourceware/cygwin/
set BUILDPKGS=python3,python3-devel,python3-setuptools,binutils,gcc-g++,libopenssl,openssl-devel,git,make,openssh,liblz4-devel,liblz4_1
%CYGSETUP% -q -B -o -n -R %CYGBUILD% -L -D -s %CYGMIRROR% -P %BUILDPKGS%
REM --- Build borgbackup
cd %CYGBUILD%
bin\bash --login -c 'easy_install-3.6 pip'
bin\bash --login -c 'pip install borgbackup'
cd %OURPATH%
REM --- Install release version of CygWin in a subfolder
set CYGPATH=%OURPATH%\Borg-installer
set INSTALLPKGS=python3,openssh,liblz4_1,python3-setuptools
set REMOVEPKGS=csih,gawk,lynx,man-db,groff,vim-minimal,tzcode,ncurses,info,util-linux
%CYGSETUP% -q -B -o -n -L -R %CYGPATH% -P %INSTALLPKGS% -x %REMOVEPKGS%
REM --- Adjust final CygWin environment
echo @"%TARGETPATH%\bin\bash" --login -c "cd $(cygpath '%cd%'); /bin/borg %%*" >%CYGPATH%\borg.bat
copy nsswitch.conf %CYGPATH%\etc\
copy fstab %CYGPATH%\etc\
REM --- Copy built packages into release path
cd %CYGBUILD%
copy bin\borg %CYGPATH%\bin
for /d %%d in (lib\python3.6\site-packages\borg*) do xcopy /s %%d %CYGPATH%\%%d\
for /d %%d in (lib\python3.6\site-packages\msgpack*) do xcopy /s %%d %CYGPATH%\%%d\
for /d %%d in (lib\python3.6\site-packages\pkg_resources) do xcopy /s %%d %CYGPATH%\%%d\
REM --- Remove all locales except EN (borg does not use them)
del /s /q %CYGPATH%\usr\share\locale\
for /d %%d in (usr\share\locale\en*) do xcopy /s %%d %CYGPATH%\%%d\
REM --- Remove all documentation
del /s /q %CYGPATH%\usr\share\doc\
del /s /q %CYGPATH%\usr\share\info\
del /s /q %CYGPATH%\usr\share\man\
REM --- Build Installer using NSIS
cd %OURPATH%
"%MAKENSIS%" nsis-installer.nsi