From 2c9e7d447e8c703aec82e33168d61aaa91896a0d Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Mon, 9 Jan 2012 22:58:04 +0100 Subject: [PATCH] Add SConstruct file for building icons, docs and manpage. --- SConstruct | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 SConstruct diff --git a/SConstruct b/SConstruct new file mode 100644 index 0000000..b0bd1a5 --- /dev/null +++ b/SConstruct @@ -0,0 +1,45 @@ +# -*- mode: python ; coding: utf-8 -*- +# +# Build requirements +# - docutils +# - inkscape +# +# For building examles +# Build requirements +# - ImageMagick +# + +import os + +ENV = { + 'PYTHONPATH': os.environ['PYTHONPATH'], + 'PATH': os.environ['PATH'], + } + +env = Environment(ENV=ENV) +env.SConsignFile() + +env.Export(['env']) + +env.Command(['doc/pdfjoin.1', 'doc/pdfjoin.html'], + 'pdfjoin.rst', + 'python setup.py build_docs') + +# create PNG projectlogo for project homepage +env.Command('projectlogo.png', 'projectlogo.svg', + 'inkscape -z -f $SOURCE -e $TARGET --export-height=100') + +hires_logo = env.Command('build/icons/projectlogo-hires.png', 'projectlogo.svg', + 'inkscape -z -f $SOURCE -e $TARGET') + +icon_parts = [ + env.Command('build/icons/project-${WIDTH}x${HEIGHT}.pnm', hires_logo, + 'pngtopnm $SOURCE ' \ + '| pnmscale -width=$WIDTH -height=$HEIGHT ' \ + '| ppmquant 256 > $TARGET', + WIDTH=w, HEIGHT=w) + for w in (16, 32, 48) + ] + +env.Command('projectlogo.ico', icon_parts, + 'ppmtowinicon $SOURCES > $TARGET') -- 2.1.4