Use the build system “meson” (close #32)
Replace the build system “setuptools” with “meson”.
This commit is contained in:
parent
ff0eee8380
commit
fac7a85566
37 changed files with 848 additions and 361 deletions
41
src/__init__.py
Normal file
41
src/__init__.py
Normal file
|
@ -0,0 +1,41 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
import os
|
||||
|
||||
|
||||
|
||||
|
||||
# Set environment
|
||||
srcdir = os.path.abspath(os.path.dirname(__file__))
|
||||
datadir = os.path.join(srcdir, 'data')
|
||||
datadirdev = os.path.join(srcdir, '..', 'data')
|
||||
if os.path.exists(datadirdev):
|
||||
datadir = datadirdev
|
||||
localedir = None
|
||||
localedirdev = os.path.join(srcdir, '..', 'locale')
|
||||
if os.path.exists(localedirdev):
|
||||
localedir = localedirdev
|
||||
|
||||
# Set GSettings schema dir (if not set already)
|
||||
if not os.environ.get('GSETTINGS_SCHEMA_DIR'):
|
||||
os.environ['GSETTINGS_SCHEMA_DIR'] = datadirdev
|
||||
|
||||
|
||||
|
||||
|
||||
class Environment:
|
||||
"""Wrapper class to access environment settings."""
|
||||
|
||||
|
||||
def get_srcdir():
|
||||
return srcdir
|
||||
|
||||
|
||||
def get_data(subdir):
|
||||
return os.path.join(datadir, subdir)
|
||||
|
||||
|
||||
def get_locale():
|
||||
return localedir
|
Loading…
Add table
Add a link
Reference in a new issue