~cypheon/elfelli

366eb2da9b0ba700e35ed60878bbf8e9416d2539 — Johann Rudloff 14 years ago 9af1d51
Better and cleaner installation.
5 files changed, 19 insertions(+), 22 deletions(-)

M SConstruct
M data/SConscript
M po/SConscript
M src/SConscript
A tools/.gitignore
M SConstruct => SConstruct +11 -10
@@ 2,6 2,9 @@

import tools.Gettext

def DefQuote(str):
        return r'\"%s\"' % str

def CheckPkgConfig(context, min_version='0'):
        context.Message('Checking for pkgconfig... ')
        r = context.TryAction('pkg-config --atleast-pkgconfig-version %s' % min_version)


@@ 35,27 38,25 @@ conf = env.Configure(custom_tests =

if not conf.CheckPkgConfig('0.15'):
        Exit(1)

if not conf.PkgConfig('gtkmm-2.4', '2.8'):
        Exit(1)

if env['profiling']:
	env.AppendUnique(CPPDEFINES='PROFILING ')
	env.AppendUnique(CPPDEFINES='PROFILING')

if env['debug']:
	env.AppendUnique(CXXFLAGS=['-g', '-O0'], CPPDEFINES='DEBUG')
else:
	env.AppendUnique(CXXFLAGS=['-O3'], CPPDEFINES='NDEBUG')

paths = {"bindir": env['prefix'] + '/bin',
         "datadir": env['prefix'] + '/share/elfelli',
         "localedir": env['prefix'] + '/share/locale'}
env.Dictionary().update(paths)

env.AppendUnique(CPPDEFINES=[('DATADIR', DefQuote(env['datadir'])),
                             ('LOCALEDIR', DefQuote(env['localedir']))])

paths = {
        "bindir": env['prefix']+'/bin',
        "datadir": env['prefix']+'/share/elfelli',
        "localedir": env['prefix']+'/share/locale'}

env.AppendUnique(CPPFLAGS=r'-DDATADIR=\"%s\" '%paths['datadir'])
env.AppendUnique(CPPFLAGS=r'-DLOCALEDIR=\"%s\" '%paths['localedir'])
env.Alias("install", paths.values())

Help("""


@@ 65,5 66,5 @@ scons -h     Show this help.

Options:""" + opts.GenerateHelpText(env))

Export('env paths targets')
Export('env')
SConscript(['src/SConscript', 'data/SConscript', 'po/SConscript'])

M data/SConscript => data/SConscript +2 -3
@@ 1,6 1,6 @@
# -*- Python -*-

Import('env paths targets')
Import('env')

data_files = ['elfelli-logo.svg',
              'negative.svg',


@@ 9,5 9,4 @@ data_files = ['elfelli-logo.svg',
              'positive-plate.svg',
              'ui.xml']

if 'install' in targets:
    env.Install(paths['datadir'], data_files)
env.Install(env['datadir'], data_files)

M po/SConscript => po/SConscript +3 -6
@@ 2,13 2,10 @@

from glob import glob

Import('env paths targets')
Import('env')

locales = map(lambda str: str[:-3], glob('*.po'))
for locale in locales:
    env.MO('locale/%s/LC_MESSAGES/elfelli' % locale, locale)

if 'install' in targets:
    for locale in locales:
        env.InstallAs('%s/%s/LC_MESSAGES/elfelli.mo' % (paths['localedir'], locale),
                      'locale/%s/LC_MESSAGES/elfelli.mo' % locale)
    env.InstallAs('%s/%s/LC_MESSAGES/elfelli.mo' % (env['localedir'], locale),
                  'locale/%s/LC_MESSAGES/elfelli.mo' % locale)

M src/SConscript => src/SConscript +2 -3
@@ 1,6 1,6 @@
# -*- Python -*-

Import('env paths targets')
Import('env')

elfelli_sources = ['Application.cpp',
                   'Canvas.cpp',


@@ 10,5 10,4 @@ elfelli_sources = ['Application.cpp',

elfelli = env.Program('elfelli', elfelli_sources)

if 'install' in targets:
    env.Install(paths['bindir'], elfelli)
env.Install(env['bindir'], elfelli)

A tools/.gitignore => tools/.gitignore +1 -0
@@ 0,0 1,1 @@
/*.pyc