File: winsetup.py

package info (click to toggle)
nfoview 1.28-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 620 kB
  • sloc: python: 1,556; sh: 76; makefile: 19
file content (39 lines) | stat: -rw-r--r-- 1,271 bytes parent folder | download
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
#!/usr/bin/env python3

"""cx_Freeze installation routines built on top of setup.py."""

import cx_Freeze
import glob
import os
import site

from setup import setup_kwargs

include_files = [(os.path.join("build", "usr", "share"), "share")]
gnome_dir = os.path.join(site.getsitepackages()[1], "gnome")
for dll in sorted(glob.glob("{}/*.dll".format(gnome_dir))):
    include_files.append((dll, os.path.basename(dll)))
include_files.append((os.path.join(gnome_dir, "etc"), "etc"))
include_files.append((os.path.join(gnome_dir, "lib"), "lib"))
include_files.append((os.path.join(gnome_dir, "share"), "share"))

setup_kwargs.update({
    "options": {"build_exe": {
        "compressed": False,
        "include_files": include_files,
        "includes": ["cairo", "nfoview", "gi"],
        "packages": ["cairo", "nfoview", "gi"],
    }},
    "executables": [cx_Freeze.Executable(
        script="bin/nfoview",
        base="WIN32GUI",
        icon="data/icons/io.otsaloma.nfoview.ico",
    )],
})

if __name__ == "__main__":
    cx_Freeze.setup(**setup_kwargs)
    # Enable header bars on builtin GTK dialogs.
    path = glob.glob("build/exe.*/etc/gtk-3.0/settings.ini")[0]
    with open(path, "a", encoding="us_ascii") as f:
        f.write("\ngtk-dialogs-use-header = 1\n")