Skip to content

Commit

Permalink
build: add install script for non-debian builds (#535)
Browse files Browse the repository at this point in the history
  • Loading branch information
okaestne committed May 20, 2022
1 parent 1a9a468 commit 436d16f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
15 changes: 15 additions & 0 deletions install-scripts/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# These scripts run as post-installation scripts.

# They're designed to do nothing if DESTDIR is set, which happens
# during debian builds for instance - there's a fake install target
# so running these would be pointless.

# When using deb packaging, these aren't needed, as these operations
# are run automatically by the package manager.

# They're really only necessary in straight builds where 'ninja install'
# will be run directly, to install the program onto the system.


# Re-compile gsettings
meson.add_install_script('meson_install_schemas.py')
10 changes: 10 additions & 0 deletions install-scripts/meson_install_schemas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/python3

import os
import subprocess

schemadir = os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share', 'glib-2.0', 'schemas')

if not os.environ.get('DESTDIR'):
print('Compiling gsettings schemas...')
subprocess.call(['glib-compile-schemas', schemadir])
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ subdir('help')
if get_option('docs')
subdir('docs/reference')
endif
subdir('install-scripts')

# The tests use an option that doesn't exist in meson before 0.46.
# Since they aren't strictly necessary, we'll just skip them for earlier versions
Expand Down

0 comments on commit 436d16f

Please sign in to comment.