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
44 # - debuginfo packages
49 PACKAGES_PATH=$HOME/synfig-packages # path where to write packages files
50 PACKAGES_BUILDROOT=/tmp/synfig-buildroot # path of for build infrastructure
52 # full = clean, configure, make
53 # standart = configure, make
55 # package = chroot, clean, configure, make
76 GITVERSION=1.7.0 # git version for chroot environment
81 # Allow overriding PREFIX and/or BREED
82 if [ -f "./synfigstudio-build.conf" ] ; then
83 . "./synfigstudio-build.conf"
91 SELECTEDREVISION=origin/master
96 if [ ! -d ${PREFIX}/include/sigc++-2.0 ]; then
98 [ ! -d libsigc++-${LIBSIGCPP} ] && tar -xjf libsigc++-${LIBSIGCPP}.tar.bz2
99 cd libsigc++-${LIBSIGCPP}
101 ./configure --prefix=${PREFIX}/ --includedir=${PREFIX}/include --disable-static --enable-shared
111 if [ ! -d ${PREFIX}/include/glibmm-2.4 ]; then
113 [ ! -d glibmm-${GLIBMM} ] && tar -xjf glibmm-${GLIBMM}.tar.bz2
115 #[[ $DOCLEAN == 1 ]] && make clean || true
116 ./configure --prefix=${PREFIX} --includedir=${PREFIX}/include --disable-static --enable-shared --disable-fulldocs
126 if [ ! -d ${PREFIX}/include/libxml++-2.6 ]; then
128 [ ! -d libxml++-${LIBXMLPP} ] && tar -xjf libxml++-${LIBXMLPP}.tar.bz2
129 cd libxml++-${LIBXMLPP}
130 #[[ $DOCLEAN == 1 ]] && make clean || true
131 ./configure --prefix=${PREFIX} --includedir=${PREFIX}/include --disable-static --enable-shared
141 if [ ! -d ${PREFIX}/include/ImageMagick ]; then
143 [ ! -d ImageMagick-${IMAGEMAGICK} ] && tar -xjf ImageMagick-${IMAGEMAGICK}-10.tar.bz2 && cd ImageMagick-${IMAGEMAGICK} && patch -p1 < ../ImageMagick-6.4.0-multilib.patch && cd ..
144 cd ImageMagick-${IMAGEMAGICK}
145 #[[ $DOCLEAN == 1 ]] && make clean || true
146 ./configure --prefix=${PREFIX} --includedir=${PREFIX}/include --disable-static --enable-shared \
151 --with-magick_plus_plus \
157 --without-windows-font-dir \
164 --without-fontconfig \
169 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
170 sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
180 [ ! -d glew-${GLEW} ] && tar -xzf glew-${GLEW}.tar.gz && cd glew && patch -p1 < glew-${GLEW}-makefile.patch && cd ..
183 #[[ $DOCLEAN == 1 ]] && make clean || true
184 sed -i -e 's/\r//g' config/config.guess
186 make install GLEW_DEST=${PREFIX} libdir=/lib bindir=/bin includedir=/include
193 if [ ! -d ${PREFIX}/include/cairomm-1.0 ]; then
195 [ ! -d cairomm-${CAIROMM} ] && tar -xzf cairomm-${CAIROMM}.tar.gz
196 cd cairomm-${CAIROMM}
197 #[[ $DOCLEAN == 1 ]] && make clean || true
198 ./configure --prefix=${PREFIX} --includedir=${PREFIX}/include --disable-static --enable-shared --enable-docs=no
207 if [ ! -d ${PREFIX}/include/gtkmm-2.4 ]; then
209 [ ! -d gtkmm-${GTKMM} ] && tar -xjf gtkmm-${GTKMM}.tar.bz2
211 #[[ $DOCLEAN == 1 ]] && make clean || true
212 ./configure --prefix=${PREFIX} --includedir=${PREFIX}/include --disable-static --enable-shared --disable-examples --disable-demos --disable-docs
223 [ ! -d freeglut-${FREEGLUT} ] && tar -xzf freeglut-${FREEGLUT}.tar.gz
224 cd freeglut-${FREEGLUT}
225 #[[ $DOCLEAN == 1 ]] && make clean || true
226 ./configure --prefix=${PREFIX} --includedir=${PREFIX}/include --disable-static --disable-warnings --enable-shared
236 if [ ! -d ftgl-${FTGL} ]; then
237 tar -xjf ftgl-${FTGL}.tar.bz2
239 patch -p1 -b < ftgl-2.1.2-destdir.patch
240 patch -p1 -b < ftgl-2.1.2-Glyph-g++_41.patch
241 patch -p1 -b < ftgl-2.1.2-pc_req.patch
242 patch -p1 -b < ftgl-2.1.2-rpath_FTGLDemo.patch
243 patch -p1 -b < ftgl-2.1.2-ttf_font.patch
244 sed -i.fixed_version -e 's|2.0.5|%{version}|g' unix/configure.ac unix/configure
249 #[[ $DOCLEAN == 1 ]] && make clean || true
250 ./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
260 [ ! -d gtkglext-${GTKGLEXT} ] && tar -xjf gtkglext-${GTKGLEXT}.tar.bz2
261 cd gtkglext-${GTKGLEXT}
262 #[[ $DOCLEAN == 1 ]] && make clean || true
263 ./configure --prefix=${PREFIX} --includedir=${PREFIX}/include --disable-gtk-doc --disable-static --enable-shared
273 [ ! -d gtkglextmm-${GTKGLEXTMM} ] && tar -xjf gtkglextmm-${GTKGLEXTMM}.tar.bz2 && cd gtkglextmm-${GTKGLEXTMM} && patch -p1 < gtkglextmm-1.2.0-aclocal.diff && cd ..
274 cd gtkglextmm-${GTKGLEXTMM}
275 #[[ $DOCLEAN == 1 ]] && make clean || true
276 ./configure --prefix=${PREFIX} --includedir=${PREFIX}/include --disable-dependency-tracking --disable-static --enable-shared
286 [ ! -d git-${GITVERSION} ] && tar -xjf git-${GITVERSION}.tar.bz2
297 if [ -d ${SYNFIG_REPO_DIR}/ETL/trunk ]; then
298 pushd ${SYNFIG_REPO_DIR}/ETL/trunk
300 pushd ${SYNFIG_REPO_DIR}/ETL
304 if ( [[ $MODE == 'package' ]] || [[ $MODE == 'full' ]] ); then
305 echo "Cleaning source tree..."
310 if [[ $MODE != 'quick' ]]; then
311 echo "Going to configure..."
313 autoreconf --install --force
314 bash ./configure --prefix=${PREFIX} --includedir=${PREFIX}/include $DEBUG
325 if [ -d ${SYNFIG_REPO_DIR}/synfig-core/trunk ]; then
326 pushd ${SYNFIG_REPO_DIR}/synfig-core/trunk
328 pushd ${SYNFIG_REPO_DIR}/synfig-core
331 export CXXFLAGS=-I${PREFIX}/include/ImageMagick
333 ( [[ $MODE == 'package' ]] || [[ $MODE == 'full' ]] ) && make clean || true
335 if [[ $MODE != 'quick' ]]; then
336 libtoolize --ltdl --copy --force
337 sed -i 's/^AC_CONFIG_SUBDIRS(libltdl)$/m4_ifdef([_AC_SEEN_TAG(libltdl)], [], [AC_CONFIG_SUBDIRS(libltdl)])/' configure.ac || true
338 sed -i 's/^# AC_CONFIG_SUBDIRS(libltdl)$/m4_ifdef([_AC_SEEN_TAG(libltdl)], [], [AC_CONFIG_SUBDIRS(libltdl)])/' configure.ac || true
339 autoreconf --install --force
340 bash ./configure --prefix=${PREFIX} --includedir=${PREFIX}/include --disable-static --enable-shared --with-magickpp --without-libavcodec $DEBUG
343 #It looks like mod_libavcodec causes segfault on synfig-core when rendering to png.
344 #Tested on: ffmpeg-0.4.9-0.52.20080908.fc10.x86_64.
346 #if [[ $GIT == 1 ]]; then
347 # export CFLAGS=-I/opt/synfig/include/GL/
348 # export LDFLAGS=-L/opt/synfig/lib/
362 if [ -d ${SYNFIG_REPO_DIR}/synfig-studio/trunk ]; then
363 pushd ${SYNFIG_REPO_DIR}/synfig-studio/trunk
365 pushd ${SYNFIG_REPO_DIR}/synfig-studio
368 ( [[ $MODE == 'package' ]] || [[ $MODE == 'full' ]] ) && make clean || true
370 if [[ $MODE != 'quick' ]]; then
371 autoreconf --install --force
372 bash ./configure --prefix=${PREFIX} --includedir=${PREFIX}/include --disable-static --enable-shared $DEBUG
378 for n in AUTHORS COPYING NEWS README
383 if [ -e synfigstudio-cph-monitor ]; then
384 cp -f synfigstudio-cph-monitor ${PREFIX}/bin/
385 chmod a+x ${PREFIX}/bin/synfigstudio-cph-monitor
393 [ -d /packages ] || mkdir /packages
396 TBZPREFIX=/tmp/synfigstudio-${VERSION}-${REVISION}.$BREED.$RELEASE.${ARCH}
399 cp -r ${PREFIX}/* $TBZPREFIX
401 if [[ $DEBUG == '--enable-debug' ]]; then
402 GDB="which gdb && xterm -e gdb -ex run -ex quit \$PREFIX/bin/synfig \$@ || "
408 cat > $TBZPREFIX/synfig <<EOF
411 PREFIX=\`dirname \$0\`
412 PREFIX=\`cd \$PREFIX; pwd\`
413 export LD_LIBRARY_PATH=\${PREFIX}/lib:\$LD_LIBRARY_PATH
414 export SYNFIG_ROOT=\${PREFIX}/
415 export SYNFIG_MODULE_LIST=\${PREFIX}/etc/synfig_modules.cfg
417 $GDB\$PREFIX/bin/synfig \$@
419 if [[ $DEBUG == '--enable-debug' ]]; then
420 GDB="which gdb && xterm -e gdb -ex run -ex quit \$PREFIX/bin/synfigstudio \$@ || "
424 cat > $TBZPREFIX/synfigstudio <<EOF
427 PREFIX=\`dirname \$0\`
428 PREFIX=\`cd \$PREFIX; pwd\`
429 export LD_LIBRARY_PATH=\${PREFIX}/lib:\$LD_LIBRARY_PATH
430 export SYNFIG_ROOT=\${PREFIX}/
431 export SYNFIG_MODULE_LIST=\${PREFIX}/etc/synfig_modules.cfg
433 $GDB\$PREFIX/bin/synfigstudio \$@
435 chmod a+x $TBZPREFIX/synfig
436 chmod a+x $TBZPREFIX/synfigstudio
438 #cleaning devel stuff
439 mkdir $TBZPREFIX/bin.tmp
440 mv $TBZPREFIX/bin/synfig $TBZPREFIX/bin.tmp/synfig
441 mv $TBZPREFIX/bin/synfigstudio $TBZPREFIX/bin.tmp/synfigstudio
442 rm -rf $TBZPREFIX/bin
443 mv $TBZPREFIX/bin.tmp $TBZPREFIX/bin
445 rm -f $TBZPREFIX/lib/*.la
446 rm -f $TBZPREFIX/lib/*.a
447 rm -rf $TBZPREFIX/include
448 rm -rf $TBZPREFIX/lib/gdkmm-2.4
449 rm -rf $TBZPREFIX/lib/libxml++-2.6
450 rm -rf $TBZPREFIX/lib/glibmm-2.4
451 rm -rf $TBZPREFIX/lib/gtkmm-2.4
452 rm -rf $TBZPREFIX/lib/pkgconfig
453 rm -rf $TBZPREFIX/lib/sigc++-2.0
454 rm -rf $TBZPREFIX/share/doc
455 rm -rf $TBZPREFIX/share/aclocal
456 rm -rf $TBZPREFIX/share/ImageMagick-6.4.0
457 rm -rf $TBZPREFIX/share/man
459 rm -f /packages/synfigstudio-${VERSION}-${REVISION}.$BREED.$RELEASE.${ARCH}.tar.bz2
461 tar cjf /packages/synfigstudio-${VERSION}-${REVISION}.$BREED.$RELEASE.${ARCH}.tar.bz2 synfigstudio-${VERSION}-${REVISION}.$BREED.$RELEASE.${ARCH}
466 RPMREVISION=`echo $REVISION.$BREED | sed s/-/_/`
467 cat > synfigstudio.spec << EOF
468 %define __spec_install_post /bin/true
472 Release: ${RPMREVISION}.${RELEASE}
473 Summary: Film-Quality 2D Vector Animation package
474 Group: Applications/Graphics
476 URL: http://www.synfig.org/
477 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
478 Obsoletes: synfig ETL
483 Synfig Animation Studio is a powerful, industrial-strength vector-based
484 2D animation software, designed from the ground-up for producing
485 feature-film quality animation with fewer people and resources.
486 It is designed to be capable of producing feature-film quality
487 animation. It eliminates the need for tweening, preventing the
488 need to hand-draw each frame. Synfig features spatial and temporal
489 resolution independence (sharp and smoothat any resolution or framerate),
490 high dynamic range images, and a flexible plugin system.
499 rm -rf \$RPM_BUILD_ROOT
500 mkdir -p \$RPM_BUILD_ROOT/${PREFIX}
501 cp -r ${PREFIX}/* \$RPM_BUILD_ROOT/${PREFIX}
502 mkdir -p \$RPM_BUILD_ROOT/usr/share
503 mv \$RPM_BUILD_ROOT/${PREFIX}/share/applications \$RPM_BUILD_ROOT/usr/share
504 mv \$RPM_BUILD_ROOT/${PREFIX}/share/icons \$RPM_BUILD_ROOT/usr/share
505 mkdir -p \$RPM_BUILD_ROOT/usr/share/mime-info
506 ln -sf ${PREFIX}/share/mime-info/synfigstudio.keys \$RPM_BUILD_ROOT/usr/share/mime-info/synfigstudio.keys
507 ln -sf ${PREFIX}/share/mime-info/synfigstudio.mime \$RPM_BUILD_ROOT/usr/share/mime-info/synfigstudio.mime
508 mkdir -p \$RPM_BUILD_ROOT/usr/share/pixmaps
509 ln -sf ${PREFIX}/share/pixmaps/sif_icon.png \$RPM_BUILD_ROOT/usr/share/pixmaps/sif_icon.png
510 ln -sf ${PREFIX}/share/pixmaps/synfig_icon.png \$RPM_BUILD_ROOT/usr/share/pixmaps/synfig_icon.png
511 mkdir -p \$RPM_BUILD_ROOT/usr/bin
512 mv \$RPM_BUILD_ROOT/${PREFIX}/bin/synfig \$RPM_BUILD_ROOT/usr/bin/
513 mv \$RPM_BUILD_ROOT/${PREFIX}/bin/synfigstudio \$RPM_BUILD_ROOT/usr/bin/
515 if [ -e \$RPM_BUILD_ROOT/${PREFIX}/bin/synfigstudio-cph-monitor ]; then
516 mv \$RPM_BUILD_ROOT/${PREFIX}/bin/synfigstudio-cph-monitor \$RPM_BUILD_ROOT/usr/bin/
517 cat > \$RPM_BUILD_ROOT/usr/share/applications/synfigstudio-cph-monitor.desktop << EOD
520 Name=Synfig Studio CPH monitor
521 Comment=This application collecting statistics about synfig crashes
522 Exec=synfigstudio-cph-monitor
526 Categories=Graphics;Application;
527 X-Desktop-File-Install-Version=0.15
531 #cleaning devel stuff
532 rm -f \$RPM_BUILD_ROOT/${PREFIX}/lib/*.la
533 rm -f \$RPM_BUILD_ROOT/${PREFIX}/lib/*.a
534 rm -rf \$RPM_BUILD_ROOT/${PREFIX}/bin
535 rm -rf \$RPM_BUILD_ROOT/${PREFIX}/include
536 rm -rf \$RPM_BUILD_ROOT/${PREFIX}/lib/gdkmm-2.4
537 rm -rf \$RPM_BUILD_ROOT/${PREFIX}/lib/libxml++-2.6
538 rm -rf \$RPM_BUILD_ROOT/${PREFIX}/lib/glibmm-2.4
539 rm -rf \$RPM_BUILD_ROOT/${PREFIX}/lib/gtkmm-2.4
540 rm -rf \$RPM_BUILD_ROOT/${PREFIX}/lib/pkgconfig
541 rm -rf \$RPM_BUILD_ROOT/${PREFIX}/lib/sigc++-2.0
542 rm -rf \$RPM_BUILD_ROOT/${PREFIX}/share/doc
543 rm -rf \$RPM_BUILD_ROOT/${PREFIX}/share/aclocal
544 rm -rf \$RPM_BUILD_ROOT/${PREFIX}/share/ImageMagick-6.4.0
545 rm -rf \$RPM_BUILD_ROOT/${PREFIX}/share/man
549 rm -rf \$RPM_BUILD_ROOT
556 %defattr(-,root,root,-)
562 * Sat Mar 21 2009 Konstantin Dmitriev <ksee.zelgadis@gmail.com> - 0.61.09-2354.morevnapackage.1
564 - Include ImageMagick-c++
566 * Wed Jan 14 2009 Konstantin Dmitriev <ksee.zelgadis@gmail.com> - 0.61.09-2316.morevnapackage.1
570 rpmbuild -bb synfigstudio.spec
572 #cp /usr/src/redhat/RPMS/$ARCH/synfigstudio-${VERSION}-${RPMREVISION}.$RELEASE.${ARCH}.rpm ../
573 cp /usr/src/rpm/RPMS/$ARCH/synfigstudio-${VERSION}-${RPMREVISION}.$RELEASE.${ARCH}.rpm /packages/
575 alien -k synfigstudio-${VERSION}-${RPMREVISION}.$RELEASE.${ARCH}.rpm
576 rm -rf synfigstudio-${VERSION}
582 # Make sure we have all dependencies installed
583 echo "Checking dependencies..."
584 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"
585 if which yum >/dev/null; then
587 if [[ $MODE == 'package' ]]; then
588 PKG_LIST="${PKG_LIST} debootstrap rsync"
590 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"
591 PKG_LIST="${PKG_LIST} OpenEXR-devel libmng-devel ImageMagick-c++-devel gtkmm24-devel glibmm24-devel"
593 if ! ( rpm -qv $PKG_LIST ); then
594 echo "Running yum (you need root privelegies to do that)..."
595 su -c "yum install $PKG_LIST"
597 elif which apt-get >/dev/null; then
599 if [[ $MODE == 'package' ]]; then
600 if [[ `cat /etc/chroot.id` == "Synfig Packages Buildroot" ]]; then
601 #we are inside of chroot
602 PKG_LIST="$DEB_LIST_MINIMAL rpm alien xsltproc wget python"
604 #we have to prepare chroot
605 PKG_LIST="${PKG_LIST} debootstrap rsync"
608 PKG_LIST="${PKG_LIST} ${DEB_LIST_MINIMAL} libmng-dev libgtkmm-2.4-dev libglibmm-2.4-dev libsigc++-2.0-dev"
610 if ! ( dpkg -s $PKG_LIST >/dev/null ); then
611 echo "Running apt-get (you need root privelegies to do that)..."
613 #echo "http_proxy =====" $http_proxy
616 sudo apt-get install -y $PKG_LIST
619 if [[ $MODE == 'package' ]]; then
620 if ! ( which git && which debootstrap ) ; then
621 echo "ERROR: Please install 'git' and 'debootstrap'."
625 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."
631 if [[ $DEBUG == 1 ]]; then
632 DEBUG='--enable-debug'
639 if [[ $MODE == 'package' ]] && [[ `cat /etc/chroot.id` == "Synfig Packages Buildroot" ]]; then
640 SYNFIG_REPO_DIR="/source/synfig.git"
645 pushd $SYNFIG_REPO_DIR
647 git reset --hard HEAD
648 #we can't switch directly to specified commit wit old git, so let's create temporary branch:
649 #git checkout master || ( git branch -f master && git checkout master )
650 #git branch -f __build $SELECTEDREVISION
651 #git checkout __build
652 git checkout $SELECTEDREVISION
653 VERSION=`cat synfig-core/configure.ac |egrep "AC_INIT\(\[Synfig Core\],"| sed "s|.*Core\],\[||" | sed "s|\],\[.*||"`
654 if [ -z $BREED ]; then
655 BREED="`git branch -a --no-color --contains HEAD | sed -e s/\*\ // | sed -e s/\(no\ branch\)// | tr '\n' ' ' | tr -s ' ' | sed s/^' '//`"
656 if ( echo $BREED | egrep origin/master > /dev/null ); then
657 #give a priority to master branch
660 BREED=`echo $BREED | cut -d ' ' -f 1`
663 BREED=${BREED%_master}
665 [[ $DEBUG == 1 ]] && BREED=${BREED}_debug
666 REVISION=`git show --pretty=medium $SELECTEDREVISION | head -n 3 |tail -n 1 | sed 's/Date: *//' | sed 's/ +.*//'`
667 REVISION=`date --date="${REVISION}" +%Y%m%d`
670 echo "BUILDING synfigstudio-$VERSION-$REVISION.$BREED.$RELEASE"
676 #Trick to detect arch under chroot
677 #ARCH=`rpm -q --queryformat='%{arch}\n' e2fsprogs`
678 MACHINE_TYPE=`uname -m`
679 case ${MACHINE_TYPE} in
685 ARCH=${MACHINE_TYPE};;
689 if git rev-parse --git-dir >/dev/null; then
690 SYNFIG_REPO_DIR=$(dirname `git rev-parse --git-dir`)
695 export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
696 export PATH=${PREFIX}/bin:$PATH
697 export LD_LIBRARY_PATH=${PREFIX}/lib:$LD_LIBRARY_PATH
698 export LDFLAGS="-Wl,-rpath -Wl,\\\$\$ORIGIN/lib"
703 if [[ WORKDIR_IS_REPO == 0 ]]; then
704 SYNFIG_REPO_DIR=`pwd`/synfig.git/
705 git clone git://synfig.git.sourceforge.net/gitroot/synfig/synfig ${SYNFIG_REPO_DIR}
715 #check if we already in chroot
716 if [[ `cat /etc/chroot.id` == "Synfig Packages Buildroot" ]]; then
717 echo "We are in chroot now."
719 echo "[user]" > $HOME/.gitconfig
720 echo "email = packages@synfig.org" >> $HOME/.gitconfig
721 echo "name = Synfig Packager" >> $HOME/.gitconfig
729 if [[ $OPENGL == 1 ]]; then
736 if [[ $OPENGL == 1 ]]; then
749 [ -d $HOME/synfig-packages ] || mkdir -p $HOME/synfig-packages
750 #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"
751 for ARCH in i386 amd64; do
752 if [[ $ARCH == 'i386' ]];then
757 if ! [ -e $PACKAGES_BUILDROOT.$ARCH/etc/chroot.id ]; then
758 debootstrap --arch=$ARCH --variant=buildd --include=sudo etch $PACKAGES_BUILDROOT.$ARCH http://ftp.us.debian.org/debian
761 echo "Synfig Packages Buildroot" > $PACKAGES_BUILDROOT.$ARCH/etc/chroot.id
762 cp -f $0 $PACKAGES_BUILDROOT.$ARCH/build.sh
764 if ! [ -z $http_proxy ]; then
765 #echo "export http_proxy=\"$http_proxy\";" >> $PACKAGES_BUILDROOT.$ARCH/root/.bashrc
766 #echo "echo 'proxy export done';" >> $PACKAGES_BUILDROOT.$ARCH/root/.bashrc
767 echo "Acquire::http::Proxy \"$http_proxy\";" > $PACKAGES_BUILDROOT.$ARCH/etc/apt/apt.conf
769 #fetch sources to cache
770 [ -d $PACKAGES_BUILDROOT.$ARCH/source ] && rm -rf $PACKAGES_BUILDROOT.$ARCH/source || true
771 if ! [ -d $PACKAGES_BUILDROOT/synfig.git ]; then
772 if [[ $WORKDIR_IS_REPO == 1 ]]; then
773 git clone $SYNFIG_REPO_DIR $PACKAGES_BUILDROOT/synfig.git
774 sed -i 's|url = .*|url = git://synfig.git.sourceforge.net/gitroot/synfig/synfig|' $PACKAGES_BUILDROOT/synfig.git/.git/config
776 git clone git://synfig.git.sourceforge.net/gitroot/synfig/synfig $PACKAGES_BUILDROOT/synfig.git
779 pushd $PACKAGES_BUILDROOT
780 cd synfig.git && git fetch && cd ..
781 [ ! -e git-$GITVERSION.tar.bz2 ] && wget -c http://kernel.org/pub/software/scm/git/git-$GITVERSION.tar.bz2
783 cairomm-${CAIROMM}.tar.gz \
784 glibmm-${GLIBMM}.tar.bz2 \
785 gtkmm-${GTKMM}.tar.bz2 \
786 libsigc++-${LIBSIGCPP}.tar.bz2 \
787 libxml++-${LIBXMLPP}.tar.bz2 \
788 ImageMagick-6.3.8-invalid-gerror-use.patch \
789 ImageMagick-${IMAGEMAGICK}-10.tar.bz2 \
790 ImageMagick-${IMAGEMAGICK}-multilib.patch \
791 ImageMagick-${IMAGEMAGICK}-xdg-open.patch
793 #[ ! -e $FILE ] && wget -c http://download.tuxfamily.org/morevna/morevnapackage/sources/$FILE
794 rsync -av rsync://download.tuxfamily.org/pub/synfig/packages/sources/$FILE ./
796 if [[ $OPENGL == 1 ]]; then
799 glew-${GLEW}-makefile.patch \
800 freeglut-${FREEGLUT}.tar.gz \
801 ftgl-${FTGL}.tar.gz \
802 ftgl-${FTGL}-destdir.patch \
803 ftgl-${FTGL}-Glyph-g++_41.patch \
804 ftgl-${FTGL}-pc_req.patch \
805 ftgl-${FTGL}-rpath_FTGLDemo.patch \
806 ftgl-${FTGL}-ttf_font.patch \
807 gtkglext-${GTKGLEXT}.tar.bz2 \
808 gtkglextmm-${GTKGLEXTMM}.tar.bz2 \
809 gtkglextmm-${GTKGLEXTMM}-aclocal.diff
811 #[ ! -e $FILE ] && wget -c http://download.tuxfamily.org/morevna/morevnapackage/sources/$FILE
812 rsync -av rsync://download.tuxfamily.org/pub/synfig/packages/sources/$FILE ./
817 [ -d $PACKAGES_BUILDROOT.$ARCH/source ] || mkdir -p $PACKAGES_BUILDROOT.$ARCH/source
818 cp -rf $PACKAGES_BUILDROOT/* $PACKAGES_BUILDROOT.$ARCH/source/
820 $SETARCH chroot $PACKAGES_BUILDROOT.$ARCH env http_proxy=$http_proxy bash /build.sh package $SELECTEDREVISION
821 mv -f $PACKAGES_BUILDROOT.$ARCH/packages/* $PACKAGES_PATH
825 find $PACKAGES_PATH/synfigstudio* -maxdepth 1
826 echo " DONE BUILDING PACKAGES INTO $HOME/synfig-packages"
831 ###=================================== MAIN ======================================