Commit 15b8ff31 authored by Vasily Galkin's avatar Vasily Galkin

prepare for ci mingw building:

-moved copying of huge data (adwaita icons) to install_data stage
instead of build_exe stage to minimize copyings count.
-pygobject-win32 support dropped
-worked around autoinclusion of gdiplus
-disable bytecompilation of files included in
since they can be used only by humans reading source,
not by freezed executable
-simplify zip building by providing empty install prefix by default

-appveyour build broken by now, but appveyour.yml has a new cmdline
for fast building zip and msi from single folder,
which eliminates one more copying of icons.
parent 46bd5f6f
......@@ -45,8 +45,7 @@ install:
- cmd: |
%PYTHON_PREFIX%\Lib\site-packages\gnome\glib-compile-schemas data
%PYTHON_PREFIX%\python bdist_msi
%PYTHON_PREFIX%\python install --root build/install_root --prefix . bdist_dumb
%PYTHON_PREFIX%\python bdist_dumb --bdist-dir build\bdist.mingw\msi --keep-temp bdist_msi --keep-temp
- path: dist/*.msi
......@@ -12,33 +12,21 @@ import meld.build_helpers
import meld.conf
def get_non_python_dependencies():
def get_non_python_libs():
"""Returns list of tuples containing extra dependencies required to run
meld on current platform.
Every pair corresponds to a single required file/folder.
Every pair corresponds to a single library file.
First tuple item correspond to path expected in meld installation
relative to meld prefix.
Second tuple item is path in local filesystem during build.
Note that for returned dynamic libraries their dependencies
Note that for returned dynamic libraries and executables dependencies
are expected to be resolved by caller, for example by cx_freeze.
gtk_prefix = sys.prefix
gtk_exec_prefix = sys.prefix
sysconfig_platform = sysconfig.get_platform()
gtk_data = [
gtk_exec_prefix = os.path.join(sys.prefix, "bin")
gtk_exec = []
if 'mingw' in sysconfig_platform:
if 'mingw' in sysconfig.get_platform():
# dll imported by dll dependencies expected to be auto-resolved later
gtk_exec = [
......@@ -49,29 +37,48 @@ def get_non_python_dependencies():
gtk_exec_prefix = os.path.join(gtk_exec_prefix, "bin")
elif 'win32' in sysconfig_platform or 'win-amd64' in sysconfig_platform:
# Official python on windows (non-mingw)
# The required gtk version isn't available,
# so kept mostly for temporarily keep appveyour build green.
gtk_exec = [
gtk_prefix = os.path.join(gtk_prefix, "Lib", "site-packages", "gnome")
gtk_exec_prefix = gtk_prefix
path_list = [(os.path.join(gtk_prefix, path), path) for path in gtk_data]
path_list += [
(os.path.join(gtk_exec_prefix, path), path) for path in gtk_exec
return path_list
return [(os.path.join(gtk_exec_prefix, path), path) for path in gtk_exec]
gtk_data_dirs = [
gtk_data_files = []
for data_dir in gtk_data_dirs:
local_data_dir = os.path.join(sys.prefix, data_dir)
for local_data_subdir, dirs, files in os.walk(local_data_dir):
data_subdir = os.path.relpath(local_data_subdir, local_data_dir)
os.path.join(data_dir, data_subdir),
[os.path.join(local_data_subdir, file) for file in files]
# add libgdk_pixbuf-2.0-0.dll manually to forbid auto-pulling of gdiplus.dll
manually_added_libs = {
"libgdk_pixbuf-2.0-0.dll": os.path.join(sys.prefix, 'bin'),
for lib, possible_path in manually_added_libs.items():
local_lib = os.path.join(possible_path, lib)
if os.path.isfile(local_lib):
gtk_data_files.append((os.path.dirname(lib), [local_lib]))
build_exe_options = {
"includes": ["gi"],
"excludes": ["tkinter"],
"packages": ["gi", "weakref"],
"include_files": get_non_python_dependencies(),
"include_files": get_non_python_libs(),
"bin_excludes": list(manually_added_libs.keys()),
"zip_exclude_packages": [],
"zip_include_packages": ["*"],
......@@ -137,6 +144,10 @@ setup(
"build_exe": build_exe_options,
"bdist_msi": bdist_msi_options,
# cx_freeze + bdist_dumb fails on non-empty prefix
"install": {"prefix": "."},
# freezed binary doesn't use source files, they are only for humans
"install_lib": {"compile": False},
......@@ -171,7 +182,7 @@ setup(
glob.glob("data/ui/*.ui") + glob.glob("data/ui/*.xml")
] + gtk_data_files,
"build_i18n": meld.build_helpers.build_i18n,
"build_help": meld.build_helpers.build_help,
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment