File: winbuild.sh

package info (click to toggle)
solfege 3.16.4-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 34,472 kB
  • ctags: 5,287
  • sloc: python: 22,642; xml: 14,196; ansic: 4,682; makefile: 621; sh: 287
file content (77 lines) | stat: -rwxr-xr-x 2,815 bytes parent folder | download
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
74
75
76
77
#!/bin/sh
PYVER=25
# This is used to select the prepackaged python tarball
MYPYVER=25
PYTHON=/c/Python$PYVER/python.exe

build() {
  # MS Windows have other defaults than linux. The 'sed' I have installed on
  # my windows machine don't support the -i option.
  mv default.config tmp.cfg
  sed -e "s/type=external-midiplayer/type=sequencer-device/" -e "s/csound=csound/csound=AUTODETECT/" -e "s/mma=mma/mma=AUTODETECT/" tmp.cfg > default.config
  rm tmp.cfg

  ./configure PYTHON=/c/Python$PYVER/python.exe --disable-pygtk-test --enable-winmidi
  make skipmanual=yes PYTHON_INCLUDES=-I/c/Python$PYVER/include
  make winbuild
}

prepare_installer() {
  rm win32 -rf
  make DESTDIR=win32 prefix="" install skipmanual=yes PYTHON_INCLUDES=-I/c/Python$PYVER/include
  mkdir win32/python
  (cd win32/python && tar zxf ../../../my-python-$MYPYVER.tgz)
  mv win32/python/DLLs win32/bin
  mv win32/python/Lib win32/bin
  mv win32/python/libs win32/bin
  mv win32/python/LICENSE.txt win32/LICENSE.python.txt
  mv win32/python/NEWS.txt win32/NEWS.python.txt
  mv win32/python/README.txt win32/README.python.txt
  mv win32/python/python.exe win32/bin
  mv win32/python/pythonw.exe win32/bin
  mv win32/python/w9xpopen.exe win32/bin
  $PYTHON tools/get-gtk-files.py bin
  $PYTHON tools/get-gtk-files.py unpack
  mv win32/zlib-1.2.4/zlib1.dll win32/bin
  # Move these so CSound can find python25.dll
  mv win32/python/python25.dll win32/bin
  mv win32/python/msvcr71.dll win32/bin
  cp -a ../pygtk-stuff/* win32/bin/lib/site-packages
  (cp solfege/soundcard/winmidi.pyd win32/share/solfege/solfege/soundcard)
  cp win32-start-solfege.pyw win32/bin
  cp solfegedebug.bat win32/bin/
  cp testgtkenv.bat testgtkenv.py win32/bin/
  cp README.txt INSTALL.win32.txt INSTALL.txt AUTHORS.txt COPYING.txt win32
  echo "gtk-theme-name = \"MS-Windows\""  > win32/etc/gtk-2.0/gtkrc
  (cd win32 && find -name *.pyc | xargs rm)
  $PYTHON tools/trim_win32_installer.py
  rm -rf win32/python
  echo "Now you must double click the file windowsinstaller.iss and"
  echo "build the installer"
}

mk_pygtk_stuff() {
  rm -rf ../pygtk-stuff
  mkdir ../pygtk-stuff
  cp /C/Python$PYVER/Lib/site-packages/pygtk.* ../pygtk-stuff/
  cp -a /C/Python$PYVER/Lib/site-packages/cairo/ ../pygtk-stuff/
  cp -a /C/Python$PYVER/Lib/site-packages/gtk-2.0/ ../pygtk-stuff/
}
 
if test "x$1" = "xbuild"; then
  build
fi
if test "x$1" = "xmkinstalldir"; then
  prepare_installer
fi
if test "x$1" = "xbuildenv"; then
  mk_pygtk_stuff
fi
if test "x$1" = "x-h"; then
  echo "sub commands:"
  echo "   buildenv      create ../pygtk-stuff/  This has to be done one with"
  echo "                 the pygtk binary installer package installed."
  echo "   build         build the package"
  echo "   mkinstalldir  create the win32/ folder that the installer will pack"
fi