midori/data/wscript_build
2008-05-31 13:51:03 +02:00

34 lines
1.1 KiB
Python

#! /usr/bin/env python
# WAF build script for midori
import os
import pproc as subprocess
srcdir = os.getcwd ()
blddir = bld.m_bdir
install_files ('DATADIR', 'icons/hicolor/scalable/apps', 'midori.svg')
if bld.env ()['CONVERT']:
def mkdir (path):
if not os.access (path, os.F_OK):
os.mkdir (path)
mkdir (blddir + '/icons')
for size in [16, 24, 32, 48]:
format = str (size) + 'x' + str (size)
if size < 32:
small = str ((size / 3)) + 'x' + str ((size / 3.5))
else:
small = '0x0'
mkdir (blddir + '/icons/' + format)
convert = subprocess.Popen (['convert', '-adaptive-sharpen', small,
'-background', 'transparent',
'-geometry', format, '-extent', format,
srcdir + '/data/midori.svg',
blddir + '/icons/' + format + '/midori.png'])
if not convert.wait ():
install_files ('DATADIR', 'icons/hicolor/' + format + '/apps',
blddir + '/icons/' + format + '/midori.png')