Merge.
[dcpomatic.git] / graphics / update
1 #!/bin/bash
2 #
3 # Update generated stuff in graphics/ from the source files.
4 #
5 # It would be nice to do this with waf but:
6 # a) getting the wscript right is a complete pain in the arse
7 # b) running Inkscape from the command line on OS X is a complete pain in the arse
8
9 pwd=`pwd`
10 if [ `basename $pwd` != "graphics" ]; then
11   echo "$0: run within graphics/"
12   exit 1
13 fi
14
15 if [ `uname -s` == "Darwin" ]; then
16     # Convert OS X icons using OS X-only iconutil
17     for p in dcpomatic2 dcpomatic2_kdm dcpomatic2_server dcpomatic2_batch; do
18         iconutil --convert icns --output $p.icns $p.iconset
19     done
20 else
21     INKSCAPE="inkscape -z -C -e"
22
23     # OS X application icons
24     for r in 16 32 128 256 512; do
25         for p in dcpomatic2 dcpomatic2_kdm dcpomatic2_server dcpomatic2_batch; do
26             mkdir -p $p.iconset
27             $INKSCAPE $p.iconset/icon_$rx$r.png -w $r -h $r $p.svg
28             $INKSCAPE $p.iconset/icon_$rx$r@2x.png -w $r -h $r $p.svg
29         done
30     done
31
32     # Linux application icons
33     for r in 16 22 32 48 64 128 256 512; do
34         mkdir -p $r
35         for p in dcpomatic2 dcpomatic2_kdm dcpomatic2_server dcpomatic2_batch; do
36             $INKSCAPE $r/$p.png $p.svg -w $r -h $r
37         done
38     done
39
40     # Windows application icons
41     for p in dcpomatic2 dcpomatic2_kdm dcpomatic2_server dcpomatic2_batch; do
42         icotool -c -o $p.ico 48/$p.png
43     done
44     icotool -c -o dcpomatic2_server_small.ico dcpomatic2_server_small.png
45     $INKSCAPE dcpomatic.png dcpomatic2.svg -w 400 -h 400
46     convert dcpomatic.png dcpomatic.bmp
47
48     # OS X preferences icons
49     # servers.png does not have an SVG version
50     for i in colour_conversions defaults kdm_email keys tms; do
51         $INKSCAPE $i.png $i.svg -w 32 -h 32
52     done
53
54     # Splash screen (all platforms)
55     $INKSCAPE splash.png splash.svg -w 400 -h 300
56 fi