3 # SynfigStudio build script
4 # Copyright (c) 2008-2010 Konstantin Dmitriev
6 # This package is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation; either version 2 of
9 # the License, or (at your option) any later version.
11 # This package is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
17 # ./synfigstudio-linux-build.sh [mode] [revision]
20 # - [mode] is full|quick|package
21 # - [revision] - commit id, branch or tag (package mode only)
23 # To build packages it's required to run this script as root.
28 # Configure and (re)build synfigstudio into your homedir:
29 # ./synfigstudio-linux-build.sh
30 # Configure and make clean build synfigstudio into your homedir:
31 # ./synfigstudio-linux-build.sh full
32 # Quick rebuild of synfig (without configure) into your homedir:
33 # ./synfigstudio-linux-build.sh quick
36 # Build package from "master" branch:
37 # ./synfigstudio-linux-build.sh package
38 # Build package from "genete_setup_dialog" branch
39 # ./synfigstudio-linux-build.sh package origin/genete_setup_dialog
40 # Build package from commit with "synfigstudio-0.62.00" tag
41 # ./synfigstudio-linux-build.sh package synfigstudio-0.62.00
43 # Note: Make sure to run "git clean -f -x -d" after you switch branches.
46 # - debuginfo packages
51 PACKAGES_PATH=$HOME/synfig-packages # path where to write packages files
52 PACKAGES_BUILDROOT=/tmp/synfig-buildroot # path of for build infrastructure
53 MAKE_THREADS=2 #count of threads for make
55 # full = clean, configure, make
56 # standart = configure, make
58 # package = chroot, clean, configure, make
79 GITVERSION=1.7.0 # git version for chroot environment
84 # Allow overriding PREFIX and/or BREED
85 if [ -f "./synfigstudio-build.conf" ] ; then
86 . "./synfigstudio-build.conf"
94 SELECTEDREVISION=origin/master
99 if [ ! -d ${PREFIX}/include/sigc++-2.0 ]; then
101 [ ! -d libsigc++-${LIBSIGCPP} ] && tar -xjf libsigc++-${LIBSIGCPP}.tar.bz2
102 cd libsigc++-${LIBSIGCPP}
104 ./configure --prefix=${PREFIX}/ --includedir=${PREFIX}/include --disable-static --enable-shared
114 if [ ! -d ${PREFIX}/include/glibmm-2.4 ]; then
116 [ ! -d glibmm-${GLIBMM} ] && tar -xjf glibmm-${GLIBMM}.tar.bz2
118 #[[ $DOCLEAN == 1 ]] && make clean || true
119 ./configure --prefix=${PREFIX} --includedir=${PREFIX}/include --disable-static --enable-shared --disable-fulldocs
129 if [ ! -d ${PREFIX}/include/libxml++-2.6 ]; then
131 [ ! -d libxml++-${LIBXMLPP} ] && tar -xjf libxml++-${LIBXMLPP}.tar.bz2
132 cd libxml++-${LIBXMLPP}
133 #[[ $DOCLEAN == 1 ]] && make clean || true
134 ./configure --prefix=${PREFIX} --includedir=${PREFIX}/include --disable-static --enable-shared
144 if [ ! -d ${PREFIX}/include/ImageMagick ]; then
146 [ ! -d ImageMagick-${IMAGEMAGICK} ] && tar -xjf ImageMagick-${IMAGEMAGICK}-10.tar.bz2 && cd ImageMagick-${IMAGEMAGICK} && patch -p1 < ../ImageMagick-6.4.0-multilib.patch && cd ..
147 cd ImageMagick-${IMAGEMAGICK}
148 #[[ $DOCLEAN == 1 ]] && make clean || true
149 ./configure --prefix=${PREFIX} --includedir=${PREFIX}/include --disable-static --enable-shared \
154 --with-magick_plus_plus \
160 --without-windows-font-dir \
167 --without-fontconfig \
172 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
173 sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
183 [ ! -d glew-${GLEW} ] && tar -xzf glew-${GLEW}.tar.gz && cd glew && patch -p1 < glew-${GLEW}-makefile.patch && cd ..
186 #[[ $DOCLEAN == 1 ]] && make clean || true
187 sed -i -e 's/\r//g' config/config.guess
189 make install GLEW_DEST=${PREFIX} libdir=/lib bindir=/bin includedir=/include
196 if [ ! -d ${PREFIX}/include/cairomm-1.0 ]; then
198 [ ! -d cairomm-${CAIROMM} ] && tar -xzf cairomm-${CAIROMM}.tar.gz
199 cd cairomm-${CAIROMM}
200 #[[ $DOCLEAN == 1 ]] && make clean || true
201 ./configure --prefix=${PREFIX} --includedir=${PREFIX}/include --disable-static --enable-shared --enable-docs=no
210 if [ ! -d ${PREFIX}/include/gtkmm-2.4 ]; then
212 [ ! -d gtkmm-${GTKMM} ] && tar -xjf gtkmm-${GTKMM}.tar.bz2
214 #[[ $DOCLEAN == 1 ]] && make clean || true
215 ./configure --prefix=${PREFIX} --includedir=${PREFIX}/include --disable-static --enable-shared --disable-examples --disable-demos --disable-docs
226 [ ! -d freeglut-${FREEGLUT} ] && tar -xzf freeglut-${FREEGLUT}.tar.gz
227 cd freeglut-${FREEGLUT}
228 #[[ $DOCLEAN == 1 ]] && make clean || true
229 ./configure --prefix=${PREFIX} --includedir=${PREFIX}/include --disable-static --disable-warnings --enable-shared
239 if [ ! -d ftgl-${FTGL} ]; then
240 tar -xjf ftgl-${FTGL}.tar.bz2
242 patch -p1 -b < ftgl-2.1.2-destdir.patch
243 patch -p1 -b < ftgl-2.1.2-Glyph-g++_41.patch
244 patch -p1 -b < ftgl-2.1.2-pc_req.patch
245 patch -p1 -b < ftgl-2.1.2-rpath_FTGLDemo.patch
246 patch -p1 -b < ftgl-2.1.2-ttf_font.patch
247 sed -i.fixed_version -e 's|2.0.5|%{version}|g' unix/configure.ac unix/configure
252 #[[ $DOCLEAN == 1 ]] && make clean || true
253 ./configure --prefix=${PREFIX} --includedir=${PREFIX}/include --disable-static --enable-shared --with-gl-inc=${PREFIX}/include --with-gl-lib=${PREFIX}/lib --with-glut-inc=${PREFIX}/include --with-glut-lib=${PREFIX}/lib --with-x
254 make all -j$MAKE_THREADS
263 [ ! -d gtkglext-${GTKGLEXT} ] && tar -xjf gtkglext-${GTKGLEXT}.tar.bz2
264 cd gtkglext-${GTKGLEXT}
265 #[[ $DOCLEAN == 1 ]] && make clean || true
266 ./configure --prefix=${PREFIX} --includedir=${PREFIX}/include --disable-gtk-doc --disable-static --enable-shared
276 [ ! -d gtkglextmm-${GTKGLEXTMM} ] && tar -xjf gtkglextmm-${GTKGLEXTMM}.tar.bz2 && cd gtkglextmm-${GTKGLEXTMM} && patch -p1 < gtkglextmm-1.2.0-aclocal.diff && cd ..
277 cd gtkglextmm-${GTKGLEXTMM}
278 #[[ $DOCLEAN == 1 ]] && make clean || true
279 ./configure --prefix=${PREFIX} --includedir=${PREFIX}/include --disable-dependency-tracking --disable-static --enable-shared
289 [ ! -d git-${GITVERSION} ] && tar -xjf git-${GITVERSION}.tar.bz2
300 if [ -f ${SYNFIG_REPO_DIR}/ETL/trunk/configure.ac ]; then
301 pushd ${SYNFIG_REPO_DIR}/ETL/trunk
303 pushd ${SYNFIG_REPO_DIR}/ETL
307 if ( [[ $MODE == 'package' ]] || [[ $MODE == 'full' ]] ); then
308 echo "Cleaning source tree..."
313 if [[ $MODE != 'quick' ]]; then
314 echo "Going to configure..."
316 autoreconf --install --force
317 /bin/sh ./configure --prefix=${PREFIX} --includedir=${PREFIX}/include $DEBUG
328 if [ -d ${SYNFIG_REPO_DIR}/synfig-core/trunk/configure.ac ]; then
329 pushd ${SYNFIG_REPO_DIR}/synfig-core/trunk
331 pushd ${SYNFIG_REPO_DIR}/synfig-core
334 export CXXFLAGS=-I${PREFIX}/include/ImageMagick
336 ( [[ $MODE == 'package' ]] || [[ $MODE == 'full' ]] ) && make clean || true
338 if [[ $MODE != 'quick' ]]; then
339 libtoolize --ltdl --copy --force
340 sed -i 's/^AC_CONFIG_SUBDIRS(libltdl)$/m4_ifdef([_AC_SEEN_TAG(libltdl)], [], [AC_CONFIG_SUBDIRS(libltdl)])/' configure.ac || true
341 sed -i 's/^# AC_CONFIG_SUBDIRS(libltdl)$/m4_ifdef([_AC_SEEN_TAG(libltdl)], [], [AC_CONFIG_SUBDIRS(libltdl)])/' configure.ac || true
342 autoreconf --install --force
343 /bin/sh ./configure --prefix=${PREFIX} --includedir=${PREFIX}/include --disable-static --enable-shared --with-magickpp --without-libavcodec $DEBUG
346 #It looks like mod_libavcodec causes segfault on synfig-core when rendering to png.
347 #Tested on: ffmpeg-0.4.9-0.52.20080908.fc10.x86_64.
349 #if [[ $GIT == 1 ]]; then
350 # export CFLAGS=-I/opt/synfig/include/GL/
351 # export LDFLAGS=-L/opt/synfig/lib/
365 if [ -d ${SYNFIG_REPO_DIR}/synfig-studio/trunk/configure.ac ]; then
366 pushd ${SYNFIG_REPO_DIR}/synfig-studio/trunk
368 pushd ${SYNFIG_REPO_DIR}/synfig-studio
371 ( [[ $MODE == 'package' ]] || [[ $MODE == 'full' ]] ) && make clean || true
373 if [[ $MODE != 'quick' ]]; then
374 autoreconf --install --force
375 /bin/sh ./configure --prefix=${PREFIX} --includedir=${PREFIX}/include --disable-static --enable-shared $DEBUG
381 for n in AUTHORS COPYING NEWS README
386 if [ -e synfigstudio-cph-monitor ]; then
387 cp -f synfigstudio-cph-monitor ${PREFIX}/bin/
388 chmod a+x ${PREFIX}/bin/synfigstudio-cph-monitor
396 [ -d /packages ] || mkdir /packages
399 TBZPREFIX=/tmp/synfigstudio-${VERSION}-${REVISION}.$BREED.$RELEASE.${ARCH}
402 cp -r ${PREFIX}/* $TBZPREFIX
404 if [[ $DEBUG == '--enable-debug' ]]; then
405 GDB="which gdb && xterm -e gdb -ex run -ex quit \$PREFIX/bin/synfig \$@ || "
411 cat > $TBZPREFIX/synfig <<EOF
414 PREFIX=\`dirname \$0\`
415 PREFIX=\`cd \$PREFIX; pwd\`
416 export LD_LIBRARY_PATH=\${PREFIX}/lib:\$LD_LIBRARY_PATH
417 export SYNFIG_ROOT=\${PREFIX}/
418 export SYNFIG_MODULE_LIST=\${PREFIX}/etc/synfig_modules.cfg
420 $GDB\$PREFIX/bin/synfig \$@
422 if [[ $DEBUG == '--enable-debug' ]]; then
423 GDB="which gdb && xterm -e gdb -ex run -ex quit \$PREFIX/bin/synfigstudio \$@ || "
427 cat > $TBZPREFIX/synfigstudio <<EOF
430 PREFIX=\`dirname \$0\`
431 PREFIX=\`cd \$PREFIX; pwd\`
432 export LD_LIBRARY_PATH=\${PREFIX}/lib:\$LD_LIBRARY_PATH
433 export SYNFIG_ROOT=\${PREFIX}/
434 export SYNFIG_MODULE_LIST=\${PREFIX}/etc/synfig_modules.cfg
436 $GDB\$PREFIX/bin/synfigstudio \$@
438 chmod a+x $TBZPREFIX/synfig
439 chmod a+x $TBZPREFIX/synfigstudio
441 #cleaning devel stuff
442 mkdir $TBZPREFIX/bin.tmp
443 mv $TBZPREFIX/bin/synfig $TBZPREFIX/bin.tmp/synfig
444 mv $TBZPREFIX/bin/synfigstudio $TBZPREFIX/bin.tmp/synfigstudio
445 rm -rf $TBZPREFIX/bin
446 mv $TBZPREFIX/bin.tmp $TBZPREFIX/bin
448 rm -f $TBZPREFIX/lib/*.la
449 rm -f $TBZPREFIX/lib/*.a
450 rm -rf $TBZPREFIX/include
451 rm -rf $TBZPREFIX/lib/gdkmm-2.4
452 rm -rf $TBZPREFIX/lib/libxml++-2.6
453 rm -rf $TBZPREFIX/lib/glibmm-2.4
454 rm -rf $TBZPREFIX/lib/gtkmm-2.4
455 rm -rf $TBZPREFIX/lib/pkgconfig
456 rm -rf $TBZPREFIX/lib/sigc++-2.0
457 rm -rf $TBZPREFIX/share/doc
458 rm -rf $TBZPREFIX/share/aclocal
459 rm -rf $TBZPREFIX/share/ImageMagick-6.4.0
460 rm -rf $TBZPREFIX/share/man
462 rm -f /packages/synfigstudio-${VERSION}-${REVISION}.$BREED.$RELEASE.${ARCH}.tar.bz2
464 tar cjf /packages/synfigstudio-${VERSION}-${REVISION}.$BREED.$RELEASE.${ARCH}.tar.bz2 synfigstudio-${VERSION}-${REVISION}.$BREED.$RELEASE.${ARCH}
469 RPMREVISION=`echo $REVISION.$BREED | sed s/-/_/`
470 cat > synfigstudio.spec << EOF
471 %define __spec_install_post /bin/true
475 Release: ${RPMREVISION}.${RELEASE}
476 Summary: Film-Quality 2D Vector Animation package
477 Group: Applications/Graphics
479 URL: http://www.synfig.org/
480 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
481 Obsoletes: synfig ETL
486 Synfig Animation Studio is a powerful, industrial-strength vector-based
487 2D animation software, designed from the ground-up for producing
488 feature-film quality animation with fewer people and resources.
489 It is designed to be capable of producing feature-film quality
490 animation. It eliminates the need for tweening, preventing the
491 need to hand-draw each frame. Synfig features spatial and temporal
492 resolution independence (sharp and smoothat any resolution or framerate),
493 high dynamic range images, and a flexible plugin system.
502 rm -rf \$RPM_BUILD_ROOT
503 mkdir -p \$RPM_BUILD_ROOT/${PREFIX}
504 cp -r ${PREFIX}/* \$RPM_BUILD_ROOT/${PREFIX}
505 mkdir -p \$RPM_BUILD_ROOT/usr/share
506 mv \$RPM_BUILD_ROOT/${PREFIX}/share/applications \$RPM_BUILD_ROOT/usr/share
507 mv \$RPM_BUILD_ROOT/${PREFIX}/share/icons \$RPM_BUILD_ROOT/usr/share
508 mkdir -p \$RPM_BUILD_ROOT/usr/share/mime-info
509 ln -sf ${PREFIX}/share/mime-info/synfigstudio.keys \$RPM_BUILD_ROOT/usr/share/mime-info/synfigstudio.keys
510 ln -sf ${PREFIX}/share/mime-info/synfigstudio.mime \$RPM_BUILD_ROOT/usr/share/mime-info/synfigstudio.mime
511 mkdir -p \$RPM_BUILD_ROOT/usr/share/pixmaps
512 ln -sf ${PREFIX}/share/pixmaps/sif_icon.png \$RPM_BUILD_ROOT/usr/share/pixmaps/sif_icon.png
513 ln -sf ${PREFIX}/share/pixmaps/synfig_icon.png \$RPM_BUILD_ROOT/usr/share/pixmaps/synfig_icon.png
514 mkdir -p \$RPM_BUILD_ROOT/usr/bin
515 mv \$RPM_BUILD_ROOT/${PREFIX}/bin/synfig \$RPM_BUILD_ROOT/usr/bin/
516 mv \$RPM_BUILD_ROOT/${PREFIX}/bin/synfigstudio \$RPM_BUILD_ROOT/usr/bin/
518 if [ -e \$RPM_BUILD_ROOT/${PREFIX}/bin/synfigstudio-cph-monitor ]; then
519 mv \$RPM_BUILD_ROOT/${PREFIX}/bin/synfigstudio-cph-monitor \$RPM_BUILD_ROOT/usr/bin/
520 cat > \$RPM_BUILD_ROOT/usr/share/applications/synfigstudio-cph-monitor.desktop << EOD
523 Name=Synfig Studio CPH monitor
524 Comment=This application collecting statistics about synfig crashes
525 Exec=synfigstudio-cph-monitor
529 Categories=Graphics;Application;
530 X-Desktop-File-Install-Version=0.15
534 #cleaning devel stuff
535 rm -f \$RPM_BUILD_ROOT/${PREFIX}/lib/*.la
536 rm -f \$RPM_BUILD_ROOT/${PREFIX}/lib/*.a
537 rm -rf \$RPM_BUILD_ROOT/${PREFIX}/bin
538 rm -rf \$RPM_BUILD_ROOT/${PREFIX}/include
539 rm -rf \$RPM_BUILD_ROOT/${PREFIX}/lib/gdkmm-2.4
540 rm -rf \$RPM_BUILD_ROOT/${PREFIX}/lib/libxml++-2.6
541 rm -rf \$RPM_BUILD_ROOT/${PREFIX}/lib/glibmm-2.4
542 rm -rf \$RPM_BUILD_ROOT/${PREFIX}/lib/gtkmm-2.4
543 rm -rf \$RPM_BUILD_ROOT/${PREFIX}/lib/pkgconfig
544 rm -rf \$RPM_BUILD_ROOT/${PREFIX}/lib/sigc++-2.0
545 rm -rf \$RPM_BUILD_ROOT/${PREFIX}/share/doc
546 rm -rf \$RPM_BUILD_ROOT/${PREFIX}/share/aclocal
547 rm -rf \$RPM_BUILD_ROOT/${PREFIX}/share/ImageMagick-6.4.0
548 rm -rf \$RPM_BUILD_ROOT/${PREFIX}/share/man
552 rm -rf \$RPM_BUILD_ROOT
559 %defattr(-,root,root,-)
565 * Sat Mar 21 2009 Konstantin Dmitriev <ksee.zelgadis@gmail.com> - 0.61.09-2354.morevnapackage.1
567 - Include ImageMagick-c++
569 * Wed Jan 14 2009 Konstantin Dmitriev <ksee.zelgadis@gmail.com> - 0.61.09-2316.morevnapackage.1
573 rpmbuild -bb synfigstudio.spec
575 #cp /usr/src/redhat/RPMS/$ARCH/synfigstudio-${VERSION}-${RPMREVISION}.$RELEASE.${ARCH}.rpm ../
576 cp /usr/src/rpm/RPMS/$ARCH/synfigstudio-${VERSION}-${RPMREVISION}.$RELEASE.${ARCH}.rpm /packages/
578 alien -k synfigstudio-${VERSION}-${RPMREVISION}.$RELEASE.${ARCH}.rpm
579 rm -rf synfigstudio-${VERSION}
585 # Make sure we have all dependencies installed
586 echo "Checking dependencies..."
587 DEB_LIST_MINIMAL="build-essential autoconf automake libltdl3-dev libtool gettext cvs libpng12-dev libjpeg62-dev libfreetype6-dev libfontconfig1-dev libgtk2.0-dev libxml2-dev bzip2"
588 if which yum >/dev/null; then
590 if [[ $MODE == 'package' ]]; then
591 PKG_LIST="${PKG_LIST} debootstrap rsync"
593 PKG_LIST="${PKG_LIST} libpng-devel libjpeg-devel freetype-devel fontconfig-devel atk-devel pango-devel cairo-devel gtk2-devel gettext-devel libxml2-devel libxml++-devel gcc-c++ autoconf automake libtool libtool-ltdl-devel cvs"
594 PKG_LIST="${PKG_LIST} OpenEXR-devel libmng-devel ImageMagick-c++-devel gtkmm24-devel glibmm24-devel"
596 if ! ( rpm -qv $PKG_LIST ); then
597 echo "Running yum (you need root privelegies to do that)..."
598 su -c "yum install $PKG_LIST"
600 elif which apt-get >/dev/null; then
602 if [[ $MODE == 'package' ]]; then
603 if [[ `cat /etc/chroot.id` == "Synfig Packages Buildroot" ]]; then
604 #we are inside of chroot
605 PKG_LIST="$DEB_LIST_MINIMAL rpm alien xsltproc wget python"
607 #we have to prepare chroot
608 PKG_LIST="${PKG_LIST} debootstrap rsync"
611 PKG_LIST="${PKG_LIST} ${DEB_LIST_MINIMAL} libmng-dev libgtkmm-2.4-dev libglibmm-2.4-dev libsigc++-2.0-dev"
613 if ! ( dpkg -s $PKG_LIST >/dev/null ); then
614 echo "Running apt-get (you need root privelegies to do that)..."
616 #echo "http_proxy =====" $http_proxy
618 sudo apt-get update || true
619 sudo apt-get install -y $PKG_LIST
622 if [[ $MODE == 'package' ]]; then
623 if ! ( which git && which debootstrap ) ; then
624 echo "ERROR: Please install 'git' and 'debootstrap'."
628 echo "WARNING: This build script does not works with package mangement systems other than rpm/yum or apt/dpkg! You should install dependent packages manually."
634 if [[ $DEBUG == 1 ]]; then
635 DEBUG='--enable-debug'
642 if [[ $MODE == 'package' ]] && [[ `cat /etc/chroot.id` == "Synfig Packages Buildroot" ]]; then
643 SYNFIG_REPO_DIR="/source/synfig.git"
648 pushd $SYNFIG_REPO_DIR
650 git reset --hard HEAD
651 #we can't switch directly to specified commit wit old git, so let's create temporary branch:
652 #git checkout master || ( git branch -f master && git checkout master )
653 #git branch -f __build $SELECTEDREVISION
654 #git checkout __build
655 git checkout $SELECTEDREVISION
656 VERSION=`cat synfig-core/configure.ac |egrep "AC_INIT\(\[Synfig Core\],"| sed "s|.*Core\],\[||" | sed "s|\],\[.*||"`
657 if [ -z $BREED ]; then
658 BREED="`git branch -a --no-color --contains HEAD | sed -e s/\*\ // | sed -e s/\(no\ branch\)// | tr '\n' ' ' | tr -s ' ' | sed s/^' '//`"
659 if ( echo $BREED | egrep origin/master > /dev/null ); then
660 #give a priority to master branch
663 BREED=`echo $BREED | cut -d ' ' -f 1`
666 BREED=${BREED%_master}
668 if [[ ${VERSION##*-RC} != ${VERSION} ]]; then
669 if [[ $BREED == 'master' ]]; then
670 BREED=rc${VERSION##*-RC}
672 BREED=rc${VERSION##*-RC}.$BREED
674 VERSION=${VERSION%%-*}
676 [[ $DEBUG == 1 ]] && BREED=${BREED}_debug
677 REVISION=`git show --pretty=medium $SELECTEDREVISION | head -n 3 |tail -n 1 | sed 's/Date: *//' | sed 's/ +.*//'`
678 REVISION=`date --date="${REVISION}" +%Y%m%d`
681 echo "BUILDING synfigstudio-$VERSION-$REVISION.$BREED.$RELEASE"
687 #Trick to detect arch under chroot
688 #ARCH=`rpm -q --queryformat='%{arch}\n' e2fsprogs`
689 MACHINE_TYPE=`uname -m`
690 case ${MACHINE_TYPE} in
696 ARCH=${MACHINE_TYPE};;
700 if git rev-parse --git-dir >/dev/null; then
701 SYNFIG_REPO_DIR=$(dirname `git rev-parse --git-dir`)
706 export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
707 export PATH=${PREFIX}/bin:$PATH
708 export LD_LIBRARY_PATH=${PREFIX}/lib:$LD_LIBRARY_PATH
709 export LDFLAGS="-Wl,-rpath -Wl,\\\$\$ORIGIN/lib"
714 if [[ WORKDIR_IS_REPO == 0 ]]; then
715 SYNFIG_REPO_DIR=`pwd`/synfig.git/
716 git clone git://synfig.git.sourceforge.net/gitroot/synfig/synfig ${SYNFIG_REPO_DIR}
726 #check if we already in chroot
727 if [[ `cat /etc/chroot.id` == "Synfig Packages Buildroot" ]]; then
728 echo "We are in chroot now."
730 echo "[user]" > /root/.gitconfig
731 echo "email = packages@synfig.org" >> /root/.gitconfig
732 echo "name = Synfig Packager" >> /root/.gitconfig
740 if [[ $OPENGL == 1 ]]; then
747 if [[ $OPENGL == 1 ]]; then
760 [ -d $HOME/synfig-packages ] || mkdir -p $HOME/synfig-packages
761 #DEB_LIST="build-essential,autoconf,automake,libltdl3-dev,libtool,gettext,cvs,libpng12-dev,libjpeg62-dev,libfreetype6-dev,libfontconfig1-dev,libgtk2.0-dev,libxml2-dev,bzip2,rpm,alien,xsltproc"
762 for ARCH in amd64 i386; do
763 if [[ $ARCH == 'i386' ]];then
768 if ! [ -e $PACKAGES_BUILDROOT.$ARCH/etc/chroot.id ]; then
769 debootstrap --arch=$ARCH --variant=buildd --include=sudo etch $PACKAGES_BUILDROOT.$ARCH http://archive.debian.org/debian
772 echo "Synfig Packages Buildroot" > $PACKAGES_BUILDROOT.$ARCH/etc/chroot.id
773 cp -f $0 $PACKAGES_BUILDROOT.$ARCH/build.sh
775 if ! [ -z $http_proxy ]; then
776 #echo "export http_proxy=\"$http_proxy\";" >> $PACKAGES_BUILDROOT.$ARCH/root/.bashrc
777 #echo "echo 'proxy export done';" >> $PACKAGES_BUILDROOT.$ARCH/root/.bashrc
778 echo "Acquire::http::Proxy \"$http_proxy\";" > $PACKAGES_BUILDROOT.$ARCH/etc/apt/apt.conf
780 #fetch sources to cache
781 [ -d $PACKAGES_BUILDROOT.$ARCH/source ] && rm -rf $PACKAGES_BUILDROOT.$ARCH/source || true
782 if ! [ -d $PACKAGES_BUILDROOT/synfig.git ]; then
783 if [[ $WORKDIR_IS_REPO == 1 ]]; then
784 git clone $SYNFIG_REPO_DIR $PACKAGES_BUILDROOT/synfig.git
785 sed -i 's|url = .*|url = git://synfig.git.sourceforge.net/gitroot/synfig/synfig|' $PACKAGES_BUILDROOT/synfig.git/.git/config
787 git clone git://synfig.git.sourceforge.net/gitroot/synfig/synfig $PACKAGES_BUILDROOT/synfig.git
790 pushd $PACKAGES_BUILDROOT
791 cd synfig.git && git fetch && cd ..
792 [ ! -e git-$GITVERSION.tar.bz2 ] && wget -c http://kernel.org/pub/software/scm/git/git-$GITVERSION.tar.bz2
794 cairomm-${CAIROMM}.tar.gz \
795 glibmm-${GLIBMM}.tar.bz2 \
796 gtkmm-${GTKMM}.tar.bz2 \
797 libsigc++-${LIBSIGCPP}.tar.bz2 \
798 libxml++-${LIBXMLPP}.tar.bz2 \
799 ImageMagick-6.3.8-invalid-gerror-use.patch \
800 ImageMagick-${IMAGEMAGICK}-10.tar.bz2 \
801 ImageMagick-${IMAGEMAGICK}-multilib.patch \
802 ImageMagick-${IMAGEMAGICK}-xdg-open.patch
804 #[ ! -e $FILE ] && wget -c http://download.tuxfamily.org/morevna/morevnapackage/sources/$FILE
805 rsync -av rsync://download.tuxfamily.org/pub/synfig/packages/sources/$FILE ./
807 if [[ $OPENGL == 1 ]]; then
810 glew-${GLEW}-makefile.patch \
811 freeglut-${FREEGLUT}.tar.gz \
812 ftgl-${FTGL}.tar.gz \
813 ftgl-${FTGL}-destdir.patch \
814 ftgl-${FTGL}-Glyph-g++_41.patch \
815 ftgl-${FTGL}-pc_req.patch \
816 ftgl-${FTGL}-rpath_FTGLDemo.patch \
817 ftgl-${FTGL}-ttf_font.patch \
818 gtkglext-${GTKGLEXT}.tar.bz2 \
819 gtkglextmm-${GTKGLEXTMM}.tar.bz2 \
820 gtkglextmm-${GTKGLEXTMM}-aclocal.diff
822 #[ ! -e $FILE ] && wget -c http://download.tuxfamily.org/morevna/morevnapackage/sources/$FILE
823 rsync -av rsync://download.tuxfamily.org/pub/synfig/packages/sources/$FILE ./
828 [ -d $PACKAGES_BUILDROOT.$ARCH/source ] || mkdir -p $PACKAGES_BUILDROOT.$ARCH/source
829 cp -rf $PACKAGES_BUILDROOT/* $PACKAGES_BUILDROOT.$ARCH/source/
831 $SETARCH chroot $PACKAGES_BUILDROOT.$ARCH env http_proxy=$http_proxy bash /build.sh package $SELECTEDREVISION
832 mv -f $PACKAGES_BUILDROOT.$ARCH/packages/* $PACKAGES_PATH
836 find $PACKAGES_PATH/synfigstudio* -maxdepth 1
837 echo " DONE BUILDING PACKAGES INTO $HOME/synfig-packages"
842 ###=================================== MAIN ======================================