Fix installing of data files
This commit is contained in:
parent
2376e20f4c
commit
7601ff8865
2 changed files with 10 additions and 22 deletions
|
@ -11,12 +11,6 @@ def add_image (bld, category, name):
|
|||
if not os.access (path, os.F_OK):
|
||||
os.mkdir (path)
|
||||
|
||||
def install_files (folder, destination, source):
|
||||
try:
|
||||
bld.install_files (folder, destination, source)
|
||||
except:
|
||||
pass
|
||||
|
||||
rsvg_convert = bld.env['RSVG_CONVERT']
|
||||
|
||||
if rsvg_convert:
|
||||
|
@ -25,8 +19,8 @@ def add_image (bld, category, name):
|
|||
for size in [16, 22, 32, 48]:
|
||||
format = str (size) + 'x' + str (size)
|
||||
if os.access (srcdir + '/icons/' + format + '/' + name + '.png', os.F_OK):
|
||||
install_files ('DATADIR', 'icons/hicolor/' + format + '/' + category,
|
||||
srcdir + '/icons/' + format + '/' + name + '.png')
|
||||
bld.install_files ('${DATADIR}/icons/hicolor/' + format + '/' + category,
|
||||
srcdir + '/icons/' + format + '/' + name + '.png')
|
||||
elif not rsvg_convert:
|
||||
pass
|
||||
elif os.access (srcdir + '/icons/scalable/' + name + '.svg', os.F_OK):
|
||||
|
@ -36,8 +30,8 @@ def add_image (bld, category, name):
|
|||
' -o ' + blddir + '/icons/' + format + '/' + name + '.png' + \
|
||||
' ' + srcdir + '/icons/scalable/' + name + '.svg'
|
||||
if not Utils.exec_command (command):
|
||||
install_files ('DATADIR', 'icons/hicolor/' + format + '/' + category,
|
||||
blddir + '/icons/' + format + '/' + name + '.png')
|
||||
bld.install_files ('${DATADIR}/icons/hicolor/' + format + '/' + category,
|
||||
blddir + '/icons/' + format + '/' + name + '.png')
|
||||
else:
|
||||
Utils.pprint ('BLUE', "Optimized icons could not be created.")
|
||||
break
|
||||
|
|
18
wscript
18
wscript
|
@ -262,19 +262,13 @@ def build (bld):
|
|||
if not os.access (path, os.F_OK):
|
||||
os.mkdir (path)
|
||||
|
||||
def install_files (folder, destination, source):
|
||||
try:
|
||||
bld.install_files (folder, destination, source)
|
||||
except:
|
||||
pass
|
||||
|
||||
bld.add_subdirs ('katze midori icons')
|
||||
|
||||
if option_enabled ('addons'):
|
||||
bld.add_subdirs ('extensions')
|
||||
|
||||
if option_enabled ('docs'):
|
||||
install_files ('DOCDIR', '/' + APPNAME + '/', \
|
||||
bld.install_files ('${DOCDIR}/' + APPNAME + '/', \
|
||||
'AUTHORS ChangeLog COPYING EXPAT README TRANSLATE')
|
||||
|
||||
if bld.env['RST2HTML']:
|
||||
|
@ -291,7 +285,7 @@ def build (bld):
|
|||
'../../../docs/user/midori.txt ' + 'midori.html'
|
||||
Utils.exec_command (command)
|
||||
os.chdir ('../../..')
|
||||
install_files ('DOCDIR', '/midori/user/', blddir + '/docs/user/midori.html')
|
||||
bld.install_files ('${DOCDIR}/midori/user/', blddir + '/docs/user/midori.html')
|
||||
|
||||
if bld.env['INTLTOOL']:
|
||||
obj = bld.new_task_gen ('intltool_po')
|
||||
|
@ -300,14 +294,14 @@ def build (bld):
|
|||
|
||||
if bld.env['GTKDOC_SCAN'] and Options.commands['build']:
|
||||
bld.add_subdirs ('docs/api')
|
||||
install_files ('DOCDIR', '/midori/api/', blddir + '/docs/api/*')
|
||||
bld.install_files ('${DOCDIR}/midori/api/', blddir + '/docs/api/*')
|
||||
|
||||
if bld.env['INTLTOOL']:
|
||||
obj = bld.new_task_gen ('intltool_in')
|
||||
obj.source = APPNAME + '.desktop.in'
|
||||
obj.install_path = '${DATADIR}/applications'
|
||||
obj.flags = '-d'
|
||||
install_files ('DATADIR', 'applications', APPNAME + '.desktop')
|
||||
bld.install_files ('${DATADIR}/applications', APPNAME + '.desktop')
|
||||
else:
|
||||
folder = os.path.dirname (bld.env['waf_config_files'][0])
|
||||
desktop = APPNAME + '.desktop'
|
||||
|
@ -323,7 +317,7 @@ def build (bld):
|
|||
after.write (line)
|
||||
after.close ()
|
||||
Utils.pprint ('BLUE', desktop + '.in -> ' + desktop)
|
||||
install_files ('DATADIR', 'applications', folder + '/' + desktop)
|
||||
bld.install_files ('${DATADIR}/applications', folder + '/' + desktop)
|
||||
except:
|
||||
Utils.pprint ('BLUE', 'File ' + desktop + ' not generated')
|
||||
finally:
|
||||
|
@ -335,7 +329,7 @@ def build (bld):
|
|||
' -o ' + blddir + '/data/logo-shade.png ' + \
|
||||
srcdir + '/data/logo-shade.svg'
|
||||
if not Utils.exec_command (command):
|
||||
install_files ('DATADIR', APPNAME, blddir + '/data/logo-shade.png')
|
||||
bld.install_files ('${DATADIR}/' + APPNAME, blddir + '/data/logo-shade.png')
|
||||
else:
|
||||
Utils.pprint ('BLUE', "logo-shade could not be rasterized.")
|
||||
|
||||
|
|
Loading…
Reference in a new issue