summaryrefslogtreecommitdiff
blob: a60aafe1fa67f8f44314750195daefd2cad30159 (plain)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
--- 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')
 
 
@@ -883,7 +884,6 @@ if 'config' in COMMAND_LINE_TARGETS:
     Find non-stripped binaries (needs libelf)             : {libelf}
     Optimize using ioctl(FS_IOC_FIEMAP) (needs linux)     : {fiemap}
     Support for SHA512 (needs glib >= 2.31)               : {sha512}
-    Build manpage from docs/rmlint.1.rst                  : {sphinx}
     Support for caching checksums in file's xattr         : {xattr}
     Support for reading json caches (needs json-glib)     : {json_glib}
     Checking for proper support of big files >= 4GB       : {bigfiles}
@@ -898,6 +898,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}
@@ -925,6 +928,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'),
--- 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 @@ class PrePlusPostInstall(install):
         # 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 @@ setup(
     url='https://rmlint.rtfd.org',
     license='GPLv3',
     platforms='any',
-    cmdclass={'install': PrePlusPostInstall},
+    cmdclass={'install': PreInstall},
     packages=['shredder', 'shredder.views'],
     package_data={'': [
         'resources/*.gresource'