Path: blob/main/accessibility/onboard/files/patch-setup.py
46590 views
--- setup.py.orig 2026-04-11 20:15:35 UTC1+++ setup.py2@@ -160,7 +160,7 @@ def clean_before_build(command):3if command in ["build", "build_ext", "clean", "sdist"]:4print("removing __pycache__ directories recursively")5subprocess.check_call(6- ['/bin/bash', '-c', "find . -name '__pycache__*' -prune | xargs rm -rf"])7+ ['/bin/sh', '-c', "find . -name '__pycache__*' -prune | xargs rm -rf"])89# Symlinked extension libraries trip up "setup.py sdist". Delete them.10if command in ["clean", "sdist"]:11@@ -313,8 +313,7 @@ class Extension_lm(Extension):12libraries = [],13define_macros=[('NDEBUG', '1')],14extra_compile_args=[15- "-Wsign-compare",16- "-Wlogical-op"],17+ "-Wsign-compare"],18)1920extension_lm = Extension_lm("Onboard", "Onboard")21@@ -401,7 +400,7 @@ class build_i18n_custom(DistUtilsExtra.auto.build_i18n22# Get the autostart directory23autostart_destination = os.path.join(config_path, "autostart")24else:25- autostart_destination = '/etc/xdg/autostart'26+ autostart_destination = 'etc/xdg/autostart'272829for i, file_set in enumerate(self.distribution.data_files):30@@ -439,33 +438,6 @@ class CustomInstallCommand(install):31# Run the default installation32install.run(self)3334- # Only run this if NOT inside a fakeroot environment35- if not os.getenv("FAKEROOTKEY"):36- print("Running tools/gen_gschema.py...")37-38-39-40- # Correct install base from setuptools41- install_base = Path(self.install_data)42- schema_dir = install_base / "share" / "glib-2.0" / "schemas"43-44-45- # Ensure the schema directory exists46- schema_dir.mkdir(parents=True, exist_ok=True)47-48- print("Running glib-compile-schemas...")49-50- try:51- if os.path.exists(schema_dir):52- subprocess.check_call(["glib-compile-schemas", schema_dir])53- else:54- print(f"Warning: Schema directory not found: {schema_dir}")55- except subprocess.CalledProcessError as e:56- print(f"Error running glib-compile-schemas: {e}")57- sys.exit(1)58- else:59- print("Skipping tools/gen_gschema.py and glib-compile-schemas since this is a fakeroot environment.")60-61class UninstallCommand(Command):62"""Custom uninstall command to remove all installed files"""6364@@ -621,16 +593,8 @@ DistUtilsExtra.auto.setup(65description = 'Simple On-screen Keyboard',6667packages = ['Onboard', 'Onboard.pypredict'],68- data_files = [('share/glib-2.0/schemas', glob.glob('data/*.gschema.xml')),69+ data_files = [('share/glib-2.0/schemas', glob.glob('data/org.onboard.gschema.xml')),70('share/dbus-1/services', glob.glob('data/org.onboard.Onboard.service')),71- ('share/doc/onboard', glob.glob('AUTHORS')),72- ('share/doc/onboard', glob.glob('CHANGELOG')),73- ('share/doc/onboard', glob.glob('COPYING*')),74- ('share/doc/onboard', glob.glob('HACKING')),75- ('share/doc/onboard', glob.glob('DBUS.md')),76- ('share/doc/onboard', glob.glob('README.md')),77- ('share/doc/onboard', glob.glob('onboard-defaults.conf.example')),78- ('share/doc/onboard', glob.glob('onboard-default-settings.gschema.override.example')),79('share/icons/hicolor/16x16/apps', glob.glob('icons/hicolor/16/*')),80('share/icons/hicolor/22x22/apps', glob.glob('icons/hicolor/22/*')),81('share/icons/hicolor/24x24/apps', glob.glob('icons/hicolor/24/*')),82@@ -650,17 +614,13 @@ DistUtilsExtra.auto.setup(83('share/onboard/models', glob.glob('models/*.lm')),84('share/onboard/tools', glob.glob('Onboard/pypredict/tools/checkmodels')),85('share/onboard/emojione/svg', glob.glob('emojione/svg/*.svg')),86- ('share/gnome-shell/extensions/[email protected]',87- glob_files('gnome/{}/[email protected]/*'.format(gnome_shell_version))),88- ('share/gnome-shell/extensions/[email protected]/schemas',89- glob_files('gnome/{}/[email protected]/schemas/*'.format(gnome_shell_version))),90],9192scripts = ['onboard', 'onboard-settings'],9394options={95'build_scripts': {96- 'executable': '/usr/bin/python3'97+ 'executable': '%%PYTHON_CMD%%'98}99},100101102103