From 870ce756ff8b18792628d22f7e541677bcce012a Mon Sep 17 00:00:00 2001 From: Louis Sautier Date: Tue, 7 Sep 2021 22:10:12 +0200 Subject: [PATCH 1/2] setup.py: do not build gschemas.compiled Having this file installed causes problems for packagers. Fedora and Arch Linux have to remove it manually. --- gui/setup.py | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/gui/setup.py b/gui/setup.py index 13fd99534..2acc04924 100644 --- a/gui/setup.py +++ b/gui/setup.py @@ -37,7 +37,7 @@ def get_prefix(): PREFIX = get_prefix() -class PrePlusPostInstall(install): +class PreInstall(install): def run(self): # Compile the resource bundle freshly print('==> Compiling resource bundle') @@ -59,24 +59,6 @@ def run(self): # Run the usual distutils install routine: install.run(self) - # Make sure the schema file is updated. - # Otherwise the gui will trace trap. - print('==> Compiling GLib Schema files') - - try: - subprocess.call([ - 'glib-compile-schemas', - os.path.join(PREFIX, 'share/glib-2.0/schemas') - ]) - except subprocess.CalledProcessError as err: - print('==> Could not update schemas: ', err) - print('==> Please run the following manually:\n') - print(' sudo glib-compile-schemas {prefix}'.format( - prefix=os.path.join(PREFIX, 'share/glib-2.0/schemas') - )) - else: - print('==> OK!') - setup( name='Shredder', @@ -88,7 +70,7 @@ def run(self): url='https://rmlint.rtfd.org', license='GPLv3', platforms='any', - cmdclass={'install': PrePlusPostInstall}, + cmdclass={'install': PreInstall}, packages=['shredder', 'shredder.views'], package_data={'': [ 'resources/*.gresource' From f3b12573b6e56dae476e55ab01fa3524c2f5c1ac Mon Sep 17 00:00:00 2001 From: Louis Sautier Date: Tue, 7 Sep 2021 22:11:23 +0200 Subject: [PATCH 2/2] SCons: allow disabling docs --- SConstruct | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/SConstruct b/SConstruct index 7e12d4134..2ed18276d 100755 --- a/SConstruct +++ b/SConstruct @@ -515,7 +515,7 @@ AddOption( action='store', metavar='DIR', help='libdir name (lib or lib64)' ) -for suffix in ['libelf', 'gettext', 'fiemap', 'blkid', 'json-glib', 'gui']: +for suffix in ['libelf', 'gettext', 'fiemap', 'blkid', 'json-glib', 'gui', 'docs']: AddOption( '--without-' + suffix, action='store_const', default=False, const=False, dest='with_' + suffix @@ -804,7 +804,8 @@ env.Default(library) SConscript('tests/SConscript', exports='programs') SConscript('po/SConscript') -SConscript('docs/SConscript') +if GetOption("with_docs"): + SConscript('docs/SConscript') SConscript('gui/SConscript') @@ -898,6 +899,9 @@ if 'config' in COMMAND_LINE_TARGETS: (needs for compile side support) : {locale} (needs msgfmt to compile .po files) : {msgfmt} + Enable GUI : {gui} + Build docs : {docs} + {grey}The following constants will be used during the build:{end} Version information : {version} @@ -925,6 +929,8 @@ Type 'scons' to actually compile rmlint now. Good luck. bigfiles=yesno(env['HAVE_BIGFILES']), bigofft=yesno(env['HAVE_BIG_OFF_T']), bigstat=yesno(env['HAVE_BIG_STAT']), + gui=yesno(GetOption("with_gui")), + docs=yesno(GetOption("with_docs")), sphinx=COLORS['green'] + 'yes, using ' + COLORS['end'] + sphinx_bin if sphinx_bin else yesno(sphinx_bin), compiler=env['CC'], prefix=GetOption('prefix'),