Fix patch of kiwix-desktop makefile for zstd.

- Copy the python script in kiwix-build repository instead of getting i
  from kymeria.fr
- Patch the makefile to change the lib for zstd.
This commit is contained in:
Matthieu Gautier 2020-04-10 11:35:00 +02:00
parent 39771c6481
commit af55ffed6d
2 changed files with 30 additions and 3 deletions

View File

@ -0,0 +1,29 @@
import re, sys, os
makefile = sys.argv[-1]
print("Patching '{}'".format(makefile))
with open(makefile, 'r') as f:
lines = f.readlines()
with open(makefile, 'w') as f:
for line in lines:
# if "/SUBSYSTEM:WINDOWS" in line:
# line = line.replace("/SUBSYSTEM:WINDOWS", "/SUBSYSTEM:CONSOLE")
# f.write(line)
# continue
if not line.startswith('LIBS '):
f.write(line)
continue
print("-- INPUT : {}".format(line))
for lib in ('kiwix', 'zim', 'pugixml', 'z', 'zstd'):
line = line.replace('{}.lib'.format(lib), 'lib{}.a'.format(lib))
for lib in ('lzma', 'curl'):
line = line.replace('lib{}.lib'.format(lib), 'lib{}.a'.format(lib))
line = line.strip()
# line += " pthreadVC2.lib"
# line += " icuin.lib icudt.lib icuuc.lib"
line += " Rpcrt4.lib Ws2_32.lib winmm.lib Shlwapi.lib"
line += os.linesep
print("++ OUTPUT : {}".format(line))
f.write(line)

View File

@ -2,12 +2,10 @@ REM ========================================================
REM Install kiwix-desktop
git clone https://github.com/kiwix/kiwix-desktop || exit /b 1
cd kiwix-desktop
echo "Getting fix_desktop"
curl -fsSL -O http://public.kymeria.fr/KIWIX/windows/fix_desktop_makefile.py_ || exit /b 1
echo "Running qmake"
C:\Qt\5.12\msvc2017_64\bin\qmake.exe "CONFIG+=static" || exit /b 1
echo "Running fix_desktop"
C:\Python36\Python fix_desktop_makefile.py_ Makefile.Release || exit /b 1
C:\Python36\Python ..\appveyor\fix_desktop_makefile.py Makefile.Release || exit /b 1
echo "Running nmake"
nmake || exit /b 1
cd ..