Fix Windows build

This commit is contained in:
Philipp Hörist 2017-09-19 15:59:40 +02:00
parent 81a6be74ad
commit b9e54cd92c
9 changed files with 38 additions and 77 deletions

View File

@ -22,7 +22,7 @@ install:
}
bash 'pacman -Sy --noconfirm git'
bash 'git clone https://dev.gajim.org/gajim/gajim.git'
bash 'git clone C:/projects/gajim C:/msys64/home/appveyor/gajim'
- cmd: '%MSYS% C:/msys64/home/appveyor/gajim/win/build.sh'
# Ugly workaround, because i found no way to tell when mingw32.exe returns

Binary file not shown.

Before

Width:  |  Height:  |  Size: 293 KiB

View File

@ -269,7 +269,7 @@ setup(
package_data={'gajim': package_data},
data_files=data_files,
install_requires=[
'dbus-python',
'dbus-python;sys_platform=="linux"',
'nbxmpp',
'pyOpenSSL'
],

View File

@ -96,14 +96,6 @@ pillow
--force-reinstall $(echo "$PIP_REQUIREMENTS" | tr ["\\n"] [" "])
build_pip install python-axolotl
build_pacman --noconfirm -Rdd mingw-w64-"${ARCH}"-shared-mime-info \
mingw-w64-"${ARCH}"-"${PYTHON_ID}"-pip mingw-w64-"${ARCH}"-ncurses || true
build_pacman --noconfirm -Rdd mingw-w64-"${ARCH}"-tk || true
build_pacman --noconfirm -Rdd mingw-w64-"${ARCH}"-tcl || true
build_pacman --noconfirm -Rdd mingw-w64-"${ARCH}"-gnome-common || true
build_pacman --noconfirm -Rdd mingw-w64-"${ARCH}"-gsl || true
build_pacman --noconfirm -Rdd mingw-w64-"${ARCH}"-libvpx || true
# remove the large png icons, they should be used rarely and svg works fine
rm -Rf "${MINGW_ROOT}/share/icons/Adwaita/512x512"
rm -Rf "${MINGW_ROOT}/share/icons/Adwaita/256x256"
@ -121,62 +113,53 @@ pillow
function install_gajim {
[ -z "$1" ] && (echo "Missing arg"; exit 1)
rm -Rf "${PACKAGE_DIR}/gajim"
rm -Rf "${REPO_CLONE}"
git clone "${DIR}"/.. "${REPO_CLONE}"
mv "${REPO_CLONE}/gajim" "${PACKAGE_DIR}"
rm -Rf "${PACKAGE_DIR}"/gajim*
(cd "${REPO_CLONE}" && git checkout "$1") || exit 1
cd ..
if [ "$1" = "master" ]
then
local GIT_REV=$(git rev-list --count HEAD)
local GIT_HASH=$(git rev-parse --short HEAD)
QL_VERSION_DESC="QL_VERSION-rev$GIT_REV-$GIT_HASH"
else
QL_VERSION_DESC=$1
QL_VERSION=$1
fi
build_pip install .
QL_VERSION=$(MSYSTEM= build_python -c \
"import gajim; import sys; sys.stdout.write(gajim.__version__.split('-')[0])")
QL_VERSION_DESC=$(MSYSTEM= build_python -c \
"import gajim; import sys; sys.stdout.write(gajim.__version__)")
# Create launchers
build_python "${MISC}"/create-launcher.py \
"${QL_VERSION}" "${MINGW_ROOT}"/bin
# Install plugin installer
wget -P "${REPO_CLONE}/plugins" -c https://ftp.gajim.org/plugins_1/plugin_installer.zip
7z x -o"${REPO_CLONE}"/plugins "${REPO_CLONE}"/plugins/plugin_installer.zip
rm -f "${REPO_CLONE}"/plugins/plugin_installer.zip
wget -P "${BUILD_ROOT}" -c https://ftp.gajim.org/plugins_1/plugin_installer.zip
mkdir "${PACKAGE_DIR}"/gajim/data/plugins
7z x -o"${PACKAGE_DIR}"/gajim/data/plugins "${BUILD_ROOT}"/plugin_installer.zip
# Install themes
rm -Rf "${MINGW_ROOT}"/etc
rm -Rf "${MINGW_ROOT}"/share/themes
mv "${REPO_CLONE}"/win/etc "${MINGW_ROOT}"
mv "${REPO_CLONE}"/win/themes "${MINGW_ROOT}"/share
cp -r win/etc "${MINGW_ROOT}"
cp -r win/themes "${MINGW_ROOT}"/share
# Install our own icons
rm -Rf "${MINGW_ROOT}/share/icons/hicolor"
mv "${REPO_CLONE}"/icons/hicolor "${MINGW_ROOT}"/share/icons
cp -r gajim/data/icons/hicolor "${MINGW_ROOT}"/share/icons
# we installed our app icons into hicolor
# Update icon cache
"${MINGW_ROOT}"/bin/gtk-update-icon-cache-3.0.exe --force \
"${MINGW_ROOT}/share/icons/hicolor"
# Create translation files
for f in "${REPO_CLONE}"/po/*.po; do
fullfilename=$(basename "$f")
filename="${fullfilename%.*}"
directory="${MINGW_ROOT}"/share/locale/"$filename"
if [ ! -d "$directory" ]; then
printf "create dir\n"
mkdir -p "${directory}"/LC_MESSAGES
fi
printf "compile $filename\n"
msgfmt -o "${directory}"/LC_MESSAGES/gajim.mo "$f"
done
}
function cleanup_install {
build_pacman --noconfirm -Rdd mingw-w64-"${ARCH}"-shared-mime-info \
mingw-w64-"${ARCH}"-"${PYTHON_ID}"-pip mingw-w64-"${ARCH}"-ncurses || true
build_pacman --noconfirm -Rdd mingw-w64-"${ARCH}"-tk || true
build_pacman --noconfirm -Rdd mingw-w64-"${ARCH}"-tcl || true
build_pacman --noconfirm -Rdd mingw-w64-"${ARCH}"-gnome-common || true
build_pacman --noconfirm -Rdd mingw-w64-"${ARCH}"-gsl || true
build_pacman --noconfirm -Rdd mingw-w64-"${ARCH}"-libvpx || true
#delete translations we don't support
for d in "${MINGW_ROOT}"/share/locale/*/LC_MESSAGES; do
if [ ! -f "${d}"/gajim.mo ]; then
@ -188,28 +171,6 @@ function cleanup_install {
-iregex ".*/(gajim|python|history_manager)[^/]*\\.exe" \
-exec rm -f {} \;
rm -Rf "${REPO_CLONE}"/.git
rm -Rf "${REPO_CLONE}"/.gitlab-ci.yml
rm -Rf "${REPO_CLONE}"/debian
rm -Rf "${REPO_CLONE}"/doc
rm -Rf "${REPO_CLONE}"/m4
rm -Rf "${REPO_CLONE}"/scripts
rm -Rf "${REPO_CLONE}"/test
rm -Rf "${REPO_CLONE}"/win
rm -Rf "${REPO_CLONE}"/icons
rm -Rf "${REPO_CLONE}"/po
rm -Rf "${REPO_CLONE}"/plugins/acronyms_expander
rm -Rf "${REPO_CLONE}"/plugins/dbus_plugin
rm -Rf "${REPO_CLONE}"/plugins/events_dump
rm -Rf "${REPO_CLONE}"/plugins/new_events_example
rm -Rf "${REPO_CLONE}"/plugins/roster_buttons
rm -Rf "${REPO_CLONE}"/data/emoticons/noto-emoticons/png
rm -Rf "${REPO_CLONE}"/data/emoticons/noto-emoticons/README.md
find "${REPO_CLONE}"/* -maxdepth 0 -type f ! -regex ".*/\(AUTHORS\|COPYING\|THANKS\|THANKS.artists\)" -exec rm -f {} \;
find "${REPO_CLONE}"/data/* -maxdepth 0 -type f -exec rm -f {} \;
rm -Rf "${MINGW_ROOT}"/libexec
rm -Rf "${MINGW_ROOT}"/share/gtk-doc
rm -Rf "${MINGW_ROOT}"/include
@ -258,7 +219,6 @@ function cleanup_install {
rm -Rf "${MINGW_ROOT}"/lib/tcl8
rm -Rf "${MINGW_ROOT}"/lib/tcl8.6
rm -f "${MINGW_ROOT}"/lib/gstreamer-1.0/libgstvpx.dll
rm -f "${MINGW_ROOT}"/lib/gstreamer-1.0/libgstdaala.dll
rm -f "${MINGW_ROOT}"/lib/gstreamer-1.0/libgstdvdread.dll
@ -316,6 +276,8 @@ function cleanup_install {
find "${MINGW_ROOT}"/bin -name "*.pyo" -exec rm -f {} \;
find "${MINGW_ROOT}"/bin -name "*.pyc" -exec rm -f {} \;
# This file is not able to compile because of syntax errors
find "${MINGW_ROOT}"/bin -name "glib-gettextize-script.py" -exec rm -f {} \;
build_compileall -q "${MINGW_ROOT}"
find "${MINGW_ROOT}" -name "*.py" ! -name "*theme.py" -exec rm -f {} \;
find "${MINGW_ROOT}"/bin -name "*.pyc" -exec rm -f {} \;

View File

@ -89,7 +89,6 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
PySys_SetArgvEx(__argc, szArglist, 0);
result = PyRun_SimpleString("import sys; import os;"
"sys.frozen=True;"
"os.chdir('../gajim');"
"import gajim.gajim as g;"
"g.GajimApplication().run(sys.argv);");
Py_Finalize();

View File

@ -15,14 +15,14 @@ RequestExecutionLevel user
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "mingw32\gajim\data\pixmaps\nsis_header.bmp"
!define MUI_WELCOMEFINISHPAGE_BITMAP "mingw32\gajim\data\pixmaps\nsis_wizard.bmp"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "mingw32\gajim\data\pixmaps\nsis_wizard.bmp"
!define MUI_HEADERIMAGE_BITMAP "..\misc\nsis_header.bmp"
!define MUI_WELCOMEFINISHPAGE_BITMAP "..\misc\nsis_wizard.bmp"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "..\misc\nsis_wizard.bmp"
!define MUI_COMPONENTSPAGE_SMALLDESC
!define MUI_ABORTWARNING
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "mingw32\gajim\COPYING"
!insertmacro MUI_PAGE_LICENSE "..\..\COPYING"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES

View File

@ -19,15 +19,15 @@ Var StartMenuFolder
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "mingw32\gajim\data\pixmaps\nsis_header.bmp"
!define MUI_WELCOMEFINISHPAGE_BITMAP "mingw32\gajim\data\pixmaps\nsis_wizard.bmp"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "mingw32\gajim\data\pixmaps\nsis_wizard.bmp"
!define MUI_HEADERIMAGE_BITMAP "..\misc\nsis_header.bmp"
!define MUI_WELCOMEFINISHPAGE_BITMAP "..\misc\nsis_wizard.bmp"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "..\misc\nsis_wizard.bmp"
;!define MUI_COMPONENTSPAGE_CHECKBITMAP "${NSISDIR}\Contrib\Graphics\Checks\colorful.bmp"
!define MUI_COMPONENTSPAGE_SMALLDESC
!define MUI_ABORTWARNING
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "mingw32\gajim\COPYING"
!insertmacro MUI_PAGE_LICENSE "..\..\COPYING"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 151 KiB

After

Width:  |  Height:  |  Size: 151 KiB