Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: allow disabling docs, do not build gschemas.compiled #520

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')


Expand Down Expand Up @@ -898,6 +899,9 @@ if 'config' in COMMAND_LINE_TARGETS:
(needs <locale.h> 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}
Expand Down Expand Up @@ -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'),
Expand Down
22 changes: 2 additions & 20 deletions gui/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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',
Expand All @@ -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'
Expand Down