5 [ "$cygwin" == "mingw" ] && sub_packages="doc extra"
7 depends="libfontconfig1 libfreetype6 libguile16 libintl3 libpango1"
8 build_depends="mingw-devel gettext-devel guile-devel pango-devel"
10 v=$(expr "$ver" : "\(.*\)-[0-9]*")
14 # copy and include extra mknetrel stuff
15 . $src/$cygwin/mknetrel.extras || . $mknetrel/extras
18 # doc works, but take too long to build each time
19 [ "$cygwin" == "mingw" ] && return 1
26 [ "$cygwin" == "mingw" ] && if grep 'PYTHON_DEVEL(REQUIRED)' $src/configure.in; then
27 sed -i~ -e 's/PYTHON_DEVEL(REQUIRED)/PYTHON_DEVEL(OPTIONAL)/' \
30 [ "$cygwin" == "mingw" ] && cd $src && ./autogen.sh --noconfigure
33 # cross-compiling: configure for build-host
36 export HOST_CC=${HOST_CC:-gcc}
37 export HOST_CXX=${HOST_CXX:-g++}
38 export HOST_PKG_CONFIG=${HOST_PKG_CONFIG:-pkg-config}
39 export HOST_PKG_CONFIG_PATH=${HOST_PKG_CONFIG_PATH:-}
40 export HOST_FREETYPE_CONFIG=${HOST_FREETYPE_CONFIG:-freetype-config}
41 (PATH="$build:$save_PATH" \
47 PKG_CONFIG=$HOST_PKG_CONFIG \
48 PKG_CONFIG_PATH=$HOST_PKG_CONFIG_PATH \
49 FREETYPE_CONFIG=$HOST_FREETYPE_CONFIG \
50 $src/configure --prefix=$prefix --enable-config=for-build)
53 GUILE=$(GUILE_LOAD_PATH=$cygwin_prefix/share/guile/* $cygwin_prefix/bin/guile-config --version 2>&1 | awk '{print $NF}')
54 cat > $target-guile-config <<EOF
55 [ "\$1" == "--version" ] && echo "$target-guile-config - Guile version $GUILE"
56 [ "\$1" == "compile" ] && echo "-I$cygwin_prefix/include"
57 [ "\$1" == "link" ] && echo "-L$cygwin_prefix/lib -lguile -lgmp"
60 chmod 755 $target-guile-config
62 build_cxx="$build_cxx -I$(pwd)"
63 if [ "$cygwin" == "mingw" ]; then
64 CONFIGOPTS="--without-kpathsea $CONFIGOPTS"
65 #CPPFLAGS="-DARGV0_RELOCATION=1 $CPPFLAGS"
66 CONFIGOPTS="--enable-relocation $CONFIGOPTS"
67 # There's a problem with inlining the string utils.
68 # The -O2 flag is still passed by default through opt.
69 CONFIGOPTS="--disable-optimising $CONFIGOPTS"
74 if [ "$cygwin" == "mingw" ]; then
75 cp /usr/include/FlexLexer.h .
77 cp /usr/include/python2.3/Python.h python2.3
79 CXX="$(echo $build_cxx | sed 's/ -mwindows//')" \
80 CXX_FOR_TARGET="${build_cxx}" \
82 CC_FOR_TARGET="${build_cc}" \
83 GCC_FOR_TARGET="${build_cc}" \
84 RANLIB="${build_ranlib}" \
85 RANLIB_FOR_TARGET="${build_ranlib}" \
86 DLLWRAP="${build_dllwrap}" \
87 AR="${build_ar}" NM="${build_nm}" \
88 LD=$(${build_cc} -print-prog-name=ld) \
89 $src/configure --enable-config=console $CONFIGOPTS
92 iscygwin || crosscache
101 # shortcircuit python for mingw
102 if [ "$cygwin" == "mingw" ]; then
103 #sed -e s/-mwindows// < config.make > config-console.make
104 #cp config.hh config-console.hh
106 mkdir -p python/out python/out-console
107 touch python/out/midi.lo python/out/midi.so python/out/midi.dll
108 touch python/out-console/midi.lo python/out-console/midi.so python/out-console/midi.dll
111 # cross-compiling: build for build-host, generate doc
120 (PATH="$build:$save_PATH" \
126 eval make conf=for-build $args) || exit 1
130 cp -pv mf/out-for-build/* mf/out
131 mkdir -p Documentation/user/out
132 cp -pv Documentation/user/out-for-build/*{tely,texi} Documentation/user/out
135 if [ "$cygwin" == "mingw" ]; then
137 mkdir -p mf/out-console
138 cp -pv mf/out-for-build/* mf/out-console
139 mkdir -p Documentation/user/out-console
140 cp -pv Documentation/user/out-for-build/*{tely,texi} Documentation/user/out-console
141 # fake manual pages, only works without --enable-config
142 mkdir -p scripts/out-console
143 cp scripts/out-for-build/*.1 scripts/out-console
144 mkdir -p lily/out-console
145 cp lily/out-for-build/*.1 lily/out-console
146 make conf=console || exit 1
149 addmakeflags "target=$target" ' '
150 if [ -f "$cygwin_prefix/bin/libpython2.4.dll" ]; then
151 addmakeflags LDFLAGS="$cygwin_prefix/bin/libpython2.4.dll" ' '
154 if iscygwin && doc; then
155 addmakeflags all ' ' doc ' ' web ' '
161 if iscygwin && doc; then
162 addmakeflags webdir="$inst-doc/$packagedocdir" ' ' web-install
167 if [ "$cygwin" == "mingw" ]; then
168 cp $inst/usr/share/lilypond/$v/python/* $inst/usr/bin
169 install -m755 $build/lily/out/lilypond $inst/usr/bin/lilypond-windows
170 install -m755 $build/lily/out-console/lilypond $inst/usr/bin/
175 if [ "$cygwin" == "mingw" ]; then
176 for i in $inst/usr/bin/*; do
178 if echo "$m" | grep "guile"; then
180 elif echo "$m" | grep "python"; then
187 if ! iscygwin && doc; then
188 make conf=for-build webdir=$inst-doc/$packagedocdir web-install
191 # txt files reside elsewhere
192 cd $build/Documentation/topdocs/out
193 install -m644 AUTHORS.txt INSTALL.txt NEWS.txt README.txt $inst/$packagedocdir
196 cp -prv input $inst/$packagedocdir
197 rm -rf $(find $inst/$packagedocdir -name 'CVS')
198 rm -f $(find $inst/$packagedocdir -name 'SCons*')
199 rm -f $(find $inst/$packagedocdir -name 'GNUmakefile*')
201 rm -rf $(find $inst/usr/share/lilypond -name '*.pyc')
202 rm -f $inst/usr/share/lilypond/$v/tex/texinfo.tex
204 if [ "$cygwin" == "mingw" ]; then
205 find $inst -name '*ly' | xargs unix2dos
208 install -d -m755 $inst-doc/$infodir/lilypond
210 cd $inst-doc/$infodir/lilypond && ln -sf ../../doc/$base-$ver/Documentation/user/out-www/*png .
216 mkdir -p ./$packagedocdir/input
217 mv $inst/$packagedocdir/input/{no-notation,regression,test,tutorial} ./$packagedocdir/input
218 mkdir -p ./$prefix/share/lilypond/$v/fonts
219 mv $inst/$prefix/share/lilypond/$v/fonts/source ./$prefix/share/lilypond/$v/fonts
227 # should be in devel...
228 mkdir -p ./$prefix/share/lilypond/$v
229 for i in make python tex vim; do
230 #for i in make tex vim; do
231 mv $inst/$prefix/share/lilypond/$v/$i ./$prefix/share/lilypond/$v
233 mkdir -p ./$prefix/share/lilypond/$v/fonts
234 for i in source svg tfm; do
235 mv $inst/$prefix/share/lilypond/$v/fonts/$i ./$prefix/share/lilypond/$v/fonts
238 mkdir -p ./$prefix/share
239 for i in locale omf; do
240 mv $inst/$prefix/share/$i ./$prefix/share