summaryrefslogtreecommitdiff
path: root/data/wscript
blob: 7ada8834211881e3042d40f74e6dc0d00102c0ca (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
#! /usr/bin/env python
# encoding: utf-8

top = '..'
out = '../build'

from waflib import Logs as logs
from waflib import Utils as utils


def options(opts):
	pass


def configure(conf):
	pass


def build(bld):
	if bld.cmd == 'install':
		#intl does not like the keys in (not an xml and no translation strings)
		#add to potfiles in for another try
		bld.install_as ('${DATADIR}/mime-info/oregano.keys', 'mime/oregano.keys.in')
		bld.install_files ('${DATADIR}/icons/hicolor/48x48/apps/', 'mime/oregano.png')
		bld.install_files ('${DATADIR}/icons/hicolor/scalable/apps/', 'mime/oregano.svg')
		bld.install_files ('${DATADIR}/oregano/ui/', 'xml/splash.xpm')
		#things we need to be known by the app are already defined and stored in the main wscript
		bld.install_files (bld.env.path_lang, 'netlist.lang')
		bld.install_files (bld.env.path_model, bld.path.ant_glob('models/*.model'))
		bld.install_files (bld.env.path_datadir, bld.path.ant_glob('help/**/*'), cwd=bld.path, relative_trick=True)
		bld.install_files (bld.env.path_examples, bld.path.ant_glob('examples/*.oregano'))
		bld.install_files (bld.env.path_partslib, bld.path.ant_glob('libraries/*.oreglib'))
		bld.install_files (bld.env.path_ui, bld.path.ant_glob('xml/*.ui'))

		if not bld.options.no_xdg:
			try:
				bld.exec_command(['update-desktop-database', utils.subst_vars('${DATADIR}/applications', bld.env)])
			except:
				logs.warn('Failed to execute xdg desktop database update.')

			try:
				bld.exec_command(['update-mime-database', utils.subst_vars('${DATADIR}/mime', bld.env)])
			except:
				logs.warn('Failed to execute xdg mime database update.')

	bld(
		features  = 'intltool_in',
		podir     = "../po",
		style     = "desktop",
		source    = 'oregano.desktop.in',
		target    = 'oregano.desktop',
		install_path = '${DATADIR}/applications',
	)

	bld(
		features  = 'intltool_in',
		podir     = "../po",
		style     = "schemas",
		source    = 'settings/io.ahoi.oregano.gschema.xml',
	)

	bld(
		features  = 'intltool_in',
		podir     = "../po",
		style     = "xml",
		source    = 'mime/oregano-mimetypes.xml.in',
		target    = 'mime/oregano.xml',
		install_path = '${DATADIR}/mime/packages/',
	)


	bld(rule = "nroff -man -c ${SRC} > ${TGT}", source="oregano.MAN.in", target="oregano.1")
	bld.install_files ('${MANDIR}/man1', 'oregano.1')