fedora-crosscompile-linux.sh 71 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424
  1. #!/bin/bash
  2. # TODO: Bundle ALL dependent lib (libpng issue)
  3. # TODO: FFmpeg/libx264 - stick to particular version
  4. # TODO: FFmpeg/libx264/mlt - cache sources
  5. # TODO: Debug builds for dependent libraries
  6. # TODO: Use BUILDROOT_LIBRARY_SET_ID
  7. set -e
  8. export SCRIPTPATH=$(cd `dirname "$0"`; pwd)
  9. RELEASE=10
  10. BUILDROOT_VERSION=5
  11. BUILDROOT_LIBRARY_SET_ID=2
  12. if [ -z $ARCH ]; then
  13. if [[ `uname -i` == "x86_64" ]]; then
  14. export ARCH="64"
  15. else
  16. export ARCH="32"
  17. fi
  18. fi
  19. if [ -z $THREADS ]; then
  20. export THREADS=2
  21. fi
  22. if [ -z $DEBUG ]; then
  23. export DEBUG=0
  24. fi
  25. if [[ $DEBUG == 1 ]]; then
  26. echo
  27. echo "Debug mode: enabled"
  28. echo
  29. DEBUG_OPT='--enable-debug --enable-optimization=0'
  30. DEBUG_OPT2='--enable-debug=yes'
  31. export SUFFIX="-debug"
  32. else
  33. DEBUG_OPT='--enable-optimization=3'
  34. fi
  35. if [ ! -z $SUBSET ]; then
  36. export SUFFIX="-$SUBSET"
  37. fi
  38. export WORKSPACE=$HOME/synfig-buildroot
  39. export SYSPREFIX=$WORKSPACE/linux$ARCH$SUFFIX/sys
  40. export PREFIX=$WORKSPACE/linux$ARCH$SUFFIX/build
  41. #export DEPSPREFIX=$WORKSPACE/linux$ARCH$SUFFIX/build
  42. export DEPSPREFIX=$WORKSPACE/linux$ARCH$SUFFIX/sys-deps
  43. export TOOLSPREFIX=$WORKSPACE/linux$ARCH$SUFFIX/tools
  44. export SRCPREFIX=$WORKSPACE/linux$ARCH$SUFFIX/source
  45. export DISTPREFIX=$WORKSPACE/linux$ARCH$SUFFIX/dist
  46. export CACHEDIR=$WORKSPACE/cache
  47. [ -e ${SRCPREFIX} ] || mkdir -p ${SRCPREFIX}
  48. [ -e ${WORKSPACE}/cache ] || mkdir -p ${WORKSPACE}/cache
  49. export EMAIL='root@synfig.org'
  50. SOURCES_URL="rsync://download.tuxfamily.org/pub/synfig/packages/sources/base"
  51. # Bundled libraries
  52. LIBJPEG_VERSION=1.3.1
  53. LIBSIGCPP_VERSION=2.2.10
  54. GLEW_VERSION=1.5.1
  55. CAIROMM_VERSION=1.10.0
  56. PANGOMM_VERSION=2.34.0
  57. GTKMM_VERSION=3.14.0
  58. FTGL_VERSION=2.1.2
  59. FREEGLUT_VERSION=2.4.0
  60. GTKGLEXT_VERSION=1.2.0
  61. GTKGLEXTMM_VERSION=1.2.0
  62. LIBXMLPP_VERSION=2.22.0
  63. GLIBMM_VERSION=2.42.0
  64. CAIRO_VERSION=1.12.18
  65. BOOST_VERSION=1_53_0
  66. ATK_VERSION=2.14.0
  67. AT_SPI2_VERSION=2.10.2
  68. AT_SPI2_ATK_VERSION=2.10.2
  69. GLIB_VERSION=2.42.1
  70. GDK_PIXBUF_VERSION=2.31.3
  71. GTK_VERSION=3.14.14
  72. PIXMAN_VERSION=0.30.0 # required by CAIRO 1.12.0
  73. HARFBUZZ_VERSION=0.9.24
  74. PANGO_VERSION=1.36.8
  75. ATKMM_VERSION=2.22.7
  76. IMAGEMAGICK_VERSION=6.9.1
  77. # System libraries
  78. FONTCONFIG_VERSION=2.11.0
  79. JACK_VERSION=0.124.1
  80. if [[ $ARCH == "32" ]]; then
  81. export SYS_ARCH=i386
  82. export RPM_ARCH=i386
  83. export GCC_ARCH=i486
  84. export LIBDIR="lib"
  85. export HOST=i686-pc-linux-gnu
  86. if ( cat /etc/issue | egrep "Ubuntu" ); then
  87. export UBUNTU_LIBDIR="/lib/i386-linux-gnu/"
  88. fi
  89. else
  90. export SYS_ARCH=amd64
  91. export RPM_ARCH=x86_64
  92. export GCC_ARCH=x86_64
  93. export LIBDIR="lib64"
  94. export HOST=x86_64-pc-linux-gnu
  95. if ( cat /etc/issue | egrep "Ubuntu" ); then
  96. export UBUNTU_LIBDIR="/lib/x86_64-linux-gnu/"
  97. fi
  98. fi
  99. #if [[ `uname -i` == "x86_64" ]]; then
  100. #export NATIVE_LIBDIR="lib64"
  101. pushd "${SCRIPTPATH}" > /dev/null
  102. export VERSION=`cat ${SCRIPTPATH}/../synfig-core/configure.ac |egrep "AC_INIT\(\[Synfig Core\],"| sed "s|.*Core\],\[||" | sed "s|\],\[.*||"`
  103. export REVISION=`git show --pretty=format:%ci HEAD | head -c 10 | tr -d '-'`
  104. if [ -z $BREED ]; then
  105. BREED="`git branch -a --no-color --contains HEAD | sed -e s/\*\ // | sed -e s/\(no\ branch\)// | tr '\n' ' ' | tr -s ' ' | sed s/^' '//`"
  106. if ( echo $BREED | egrep origin/master > /dev/null ); then
  107. #give a priority to master branch
  108. BREED='master'
  109. else
  110. BREED=`echo $BREED | cut -d ' ' -f 1`
  111. BREED=${BREED##*/}
  112. fi
  113. BREED=${BREED%_master}
  114. fi
  115. if [[ ${VERSION##*-RC} != ${VERSION} ]]; then
  116. #if [[ $BREED == 'master' ]]; then
  117. BREED=rc${VERSION##*-RC}
  118. #else
  119. # BREED=rc${VERSION##*-RC}.$BREED
  120. #fi
  121. VERSION=${VERSION%%-*}
  122. fi
  123. [[ $DEBUG == 1 ]] && BREED=${BREED}.dbg
  124. BREED=`echo $BREED | tr _ . | tr - .` # No "-" or "_" characters, becuse RPM and DEB complain
  125. popd > /dev/null
  126. set_environment()
  127. {
  128. #export LD_LIBRARY_PATH=${DEPSPREFIX}/lib:/${LIBDIR}:${SYSPREFIX}/${LIBDIR}:${SYSPREFIX}/usr/${LIBDIR}
  129. #export LD_LIBRARY_PATH=${SYSPREFIX}/lib-native:${PREFIX}/lib:${DEPSPREFIX}/lib:${SYSPREFIX}/${LIBDIR}:${SYSPREFIX}/usr/${LIBDIR}
  130. if ( cat /etc/issue | egrep "Ubuntu" ); then
  131. export LD_PRELOAD=${UBUNTU_LIBDIR}/libc.so.6:${UBUNTU_LIBDIR}/libpthread.so.0:${UBUNTU_LIBDIR}/libdl.so.2
  132. else
  133. export LD_PRELOAD=/${LIBDIR}/libc.so.6:/${LIBDIR}/libpthread.so.0:/${LIBDIR}/libdl.so.2
  134. fi
  135. export LD_LIBRARY_PATH=${PREFIX}/lib:${DEPSPREFIX}/lib:${SYSPREFIX}/${LIBDIR}:${SYSPREFIX}/usr/lib:${SYSPREFIX}/lib/${RPM_ARCH}-linux-gnu:${SYSPREFIX}/usr/lib/${RPM_ARCH}-linux-gnu
  136. export PATH=${DEPSPREFIX}/bin:${PREFIX}/bin:${SYSPREFIX}/bin:${SYSPREFIX}/usr/bin
  137. export LDFLAGS="-Wl,-rpath -Wl,\\\$\$ORIGIN/lib -L${PREFIX}/lib -L${DEPSPREFIX}/lib -L${SYSPREFIX}/${LIBDIR} -L${SYSPREFIX}/usr/${LIBDIR} -L${SYSPREFIX}/lib/${RPM_ARCH}-linux-gnu/ -L${SYSPREFIX}/usr/lib/${RPM_ARCH}-linux-gnu/"
  138. if [[ $DEBUG == 1 ]]; then
  139. export CFLAGS="-O0"
  140. export CXXFLAGS="-O0"
  141. else
  142. export CFLAGS="-O3"
  143. export CXXFLAGS="-O3"
  144. fi
  145. #export CFLAGS=" -nostdinc -I${SYSPREFIX}/usr/lib/gcc/${RPM_ARCH}-linux-gnu/4.3.2/include -I${SYSPREFIX}/usr/lib/gcc/${RPM_ARCH}-linux-gnu/4.3.2/include-fixed -I${PREFIX}/include -I${DEPSPREFIX}/include -I${SYSPREFIX}/usr/include"
  146. GCC_VER=4.7
  147. export CPPFLAGS="-I${SYSPREFIX}/usr/include -I${DEPSPREFIX}/include -I${PREFIX}/include -I${SYSPREFIX}/usr/include/${RPM_ARCH}-linux-gnu"
  148. #export CXXFLAGS="-I${SYSPREFIX}/usr/include/linux/ -I${SYSPREFIX}/usr/include/c++/${GCC_VER}/ -I${SYSPREFIX}/usr/include/c++/${GCC_VER}/${GCC_ARCH}-linux-gnu/ -I${SYSPREFIX}/usr/lib/gcc/${GCC_ARCH}-linux-gnu/${GCC_VER}/include/ -I${SYSPREFIX}/usr/lib/gcc/${GCC_ARCH}-linux-gnu/${GCC_VER}/include-fixed/ -I${SYSPREFIX}/usr/${GCC_ARCH}-linux-gnu/include"
  149. #export CXXFLAGS="-I${SYSPREFIX}/usr/local/include/x86_64-linux-gnu -I${SYSPREFIX}/usr/lib/gcc/x86_64-linux-gnu/4.4.5/include -I${SYSPREFIX}/usr/lib/gcc/x86_64-linux-gnu/4.4.5/include-fixed -I${SYSPREFIX}/usr/lib/gcc/../../x86_64-linux-gnu/include -I${SYSPREFIX}/usr/include/x86_64-linux-gnu"
  150. #export CXXFLAGS=" -nostdinc -I${SYSPREFIX}/usr/lib/gcc/../../include/c++/4.3 -I${SYSPREFIX}/usr/lib/gcc/../../include/c++/4.3/x86_64-linux-gnu -I${SYSPREFIX}/usr/lib/gcc/../../include/c++/4.3/backward -I${SYSPREFIX}/usr/lib/gcc/x86_64-linux-gnu/4.3.2/include -I${SYSPREFIX}/usr/lib/gcc/x86_64-linux-gnu/4.3.2/include-fixed -I${PREFIX}/include -I${DEPSPREFIX}/include -I${SYSPREFIX}/usr/include"
  151. export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig:${DEPSPREFIX}/lib/pkgconfig:${SYSPREFIX}/usr/lib/pkgconfig:${SYSPREFIX}/usr/lib/${RPM_ARCH}-linux-gnu/pkgconfig:${SYSPREFIX}/usr/share/pkgconfig
  152. PERL_VERSION=`perl -v | grep "This is perl" | sed "s|This is perl .*(v||g" | sed "s|).*||"`
  153. export NM=nm
  154. export PERL5LIB="${SYSPREFIX}/etc/perl:${SYSPREFIX}/usr/share/automake-1.11:${DEPSPREFIX}/lib/perl/${PERL_VERSION}:${DEPSPREFIX}/share/perl/${PERL_VERSION}:${SYSPREFIX}/usr/lib/perl5:${SYSPREFIX}/usr/share/perl5:${SYSPREFIX}/usr/lib/perl/${PERL_VERSION}:${SYSPREFIX}/usr/share/perl/${PERL_VERSION}:${DEPSPREFIX}/lib/site_perl"
  155. if [[ $ARCH == "32" ]]; then
  156. export CFLAGS="$CFLAGS -m32"
  157. export CXXFLAGS="$CXXFLAGS -m32"
  158. export LDFLAGS="$LDFLAGS -m32"
  159. fi
  160. }
  161. run_native()
  162. {
  163. LD_PRELOAD=""
  164. LD_LIBRARY_PATH=""
  165. PATH="/usr/local/bin/:/usr/sbin:/usr/bin:/bin"
  166. LDFLAGS=""
  167. CFLAGS=""
  168. CXXFLAGS=""
  169. PKG_CONFIG_PATH=""
  170. PERL5LIB=""
  171. if [[ $ARCH == "32" ]]; then
  172. export CFLAGS="$CFLAGS -m32"
  173. export CXXFLAGS="$CXXFLAGS -m32"
  174. export LDFLAGS="$LDFLAGS -m32"
  175. fi
  176. "$@"
  177. set_environment
  178. }
  179. mkprefix_()
  180. {
  181. [ ! -e ${SYSPREFIX}/dev ] || rm -rf ${SYSPREFIX}/dev
  182. [ ! -e ${SYSPREFIX}/proc ] || rm -rf ${SYSPREFIX}/proc
  183. #deb http://debootstrap.invalid/ lenny main
  184. LD_LIBRARY_PATH=${UBUNTU_LIBDIR}:/${LIBDIR}:${SYSPREFIX}/usr/${LIBDIR} \
  185. PATH=/usr/local/sbin:/usr/sbin:/sbin:/sbin:/bin:/usr/bin:${SYSPREFIX}/usr/sbin:${SYSPREFIX}/sbin:${SYSPREFIX}/usr/bin:${SYSPREFIX}/bin:$PATH HOME=/ LOGNAME=root \
  186. fakeroot \
  187. ${SYSPREFIX}/usr/bin/apt-get \
  188. -o Dir::Etc::SourceList="${SYSPREFIX}/etc/apt/sources.list" \
  189. -o Dir::Etc::Parts="${SYSPREFIX}/etc/apt/apt.conf.d/" \
  190. -o Dir::State::Lists="${SYSPREFIX}/var/lib/apt/lists/" \
  191. -o Dir::Cache::Archives="${SYSPREFIX}/var/cache/apt/archives/" \
  192. -o Dir::Etc::Preferences="${SYSPREFIX}/etc/apt/preferences" \
  193. --print-uris --yes install m4
  194. }
  195. mkprefix()
  196. {
  197. #[ -e $WORKSPACE/linux$ARCH$SUFFIX/tools/bin/fakeroot ] || mkfakeroot
  198. #[ -e $WORKSPACE/linux$ARCH$SUFFIX/tools/bin/fakechroot ] || mkfakechroot
  199. DEB_LIST_MINIMAL="\
  200. build-essential \
  201. libpng12-dev \
  202. libfreetype6-dev \
  203. libxml2-dev \
  204. libjasper-dev \
  205. libffi-dev \
  206. libasound2-dev \
  207. x11proto-xext-dev libdirectfb-dev libxfixes-dev libxinerama-dev libxdamage-dev libxcomposite-dev libxcursor-dev libxft-dev libxrender-dev libxt-dev libxrandr-dev libxi-dev libxext-dev libx11-dev \
  208. libxtst-dev \
  209. libpthread-stubs0-dev \
  210. libxml-parser-perl \
  211. libdb-dev uuid-dev \
  212. libdbus-1-dev \
  213. wget mawk \
  214. python-dev \
  215. gettext autopoint \
  216. libpciaccess-dev multiarch-support libx11-xcb-dev \
  217. libudev-dev \
  218. x11proto-gl-dev \
  219. bzip2"
  220. #autoconf automake m4 \
  221. #libtool intltool gettext \
  222. # libgl1-mesa-dev \
  223. #llvm-dev \
  224. INCLUDE_LIST=""
  225. for deb in $DEB_LIST_MINIMAL; do
  226. INCLUDE_LIST="$deb,$INCLUDE_LIST"
  227. done
  228. [ ! -e ${SYSPREFIX}/dev ] || rm -rf ${SYSPREFIX}/dev
  229. [ ! -e ${SYSPREFIX}/proc ] || rm -rf ${SYSPREFIX}/proc
  230. # --foreign --variant=fakechroot
  231. LD_LIBRARY_PATH=${UBUNTU_LIBDIR}:/${LIBDIR}:${SYSPREFIX}/usr/${LIBDIR} \
  232. PATH=/usr/local/sbin:/usr/sbin:/sbin:/sbin:/bin:/usr/bin:${SYSPREFIX}/usr/sbin:${SYSPREFIX}/sbin:${SYSPREFIX}/usr/bin:${SYSPREFIX}/bin:$PATH HOME=/ LOGNAME=root \
  233. fakeroot fakechroot \
  234. debootstrap --variant=fakechroot --download-only --keep-debootstrap-dir --arch=$SYS_ARCH \
  235. --include=$INCLUDE_LIST \
  236. wheezy ${SYSPREFIX} http://ftp.ru.debian.org/debian #http://archive.debian.org/debian
  237. #LD_LIBRARY_PATH=${UBUNTU_LIBDIR}:/${LIBDIR}:${SYSPREFIX}/usr/${LIBDIR} PATH=/usr/local/sbin:/usr/sbin:/sbin:/sbin:/bin:/usr/bin:${SYSPREFIX}/usr/sbin:${SYSPREFIX}/sbin:${SYSPREFIX}/usr/bin:${SYSPREFIX}/bin:$PATH HOME=/ LOGNAME=root fakeroot fakechroot debootstrap --variant=fakechroot --arch=$SYS_ARCH --foreign --keep-debootstrap-dir --include=sudo --include=apt lenny ${SYSPREFIX} http://archive.debian.org/debian
  238. #LD_LIBRARY_PATH=${UBUNTU_LIBDIR}:/${LIBDIR}:${SYSPREFIX}/usr/${LIBDIR} PATH=/usr/local/sbin:/usr/sbin:/sbin:/sbin:/bin:/usr/bin:${SYSPREFIX}/usr/sbin:${SYSPREFIX}/sbin:${SYSPREFIX}/usr/bin:${SYSPREFIX}/bin:$PATH fakeroot fakechroot linux32 chroot ${SYSPREFIX} #${SYSPREFIX}/debootstrap/debootstrap --second-stage
  239. #pushd ${SYSPREFIX}/var/cache/apt/archives/
  240. #wget -c https://mirror.hmc.edu/debian/pool/main/libx/libxshmfence/libxshmfence-dev_1.2-1_${SYS_ARCH}.deb --no-check-certificate
  241. #wget -c https://mirror.hmc.edu/debian/pool/main/libx/libxshmfence/libxshmfence1_1.2-1_${SYS_ARCH}.deb --no-check-certificate
  242. #wget -c https://mirror.hmc.edu/debian/pool/main/x/x11proto-dri2/x11proto-dri2-dev_2.8-2_all.deb --no-check-certificate
  243. #wget -c https://mirror.hmc.edu/debian/pool/main/x/x11proto-dri3/x11proto-dri3-dev_1.0-1_all.deb --no-check-certificate
  244. #popd
  245. for file in `ls -1 ${SYSPREFIX}/var/cache/apt/archives/*.deb`; do
  246. echo $file
  247. dpkg -x $file ${SYSPREFIX}
  248. done
  249. #touch /home/zelgadis/synfig-buildroot/linux64/sys.off/var/lib/dpkg/status
  250. #fakeroot dpkg --log=/home/zelgadis/synfig-buildroot/linux64/sys.off/var/log/dpkg.log --unpack --force-not-root --root=/home/zelgadis/synfig-buildroot/linux64/sys.off --ignore-depends=multiarch-support,libc6 ./libxshmfence-dev_1.2-1_amd64.deb ./libxshmfence1_1.2-1_amd64.deb
  251. echo "Synfig Buildroot v${BUILDROOT_VERSION}" > ${SYSPREFIX}/etc/chroot.id
  252. }
  253. mkprep()
  254. {
  255. MISSING_PKGS=""
  256. for PKG in \
  257. debootstrap \
  258. dpkg \
  259. automake autoconf \
  260. which \
  261. fakeroot \
  262. fakechroot \
  263. rpmbuild \
  264. git \
  265. flex \
  266. bison; do
  267. if ! ( which $PKG > /dev/null ) ; then
  268. MISSING_PKGS="$MISSING_PKGS $PKG"
  269. fi
  270. done
  271. if ! ( which dpkg-buildpackage > /dev/null ); then
  272. MISSING_PKGS="$MISSING_PKGS dpkg-dev"
  273. fi
  274. if [ ! -z "$MISSING_PKGS" ]; then
  275. echo "ERROR: Please install following packages:"
  276. echo " $MISSING_PKGS"
  277. exit 1
  278. fi
  279. if [ ! -e ${SYSPREFIX}/etc/chroot.id ]; then
  280. mkprefix
  281. elif [[ `cat ${SYSPREFIX}/etc/chroot.id` != "Synfig Buildroot v${BUILDROOT_VERSION}" ]]; then
  282. #rm -rf ${SYSPREFIX} || true
  283. mkprefix
  284. fi
  285. mkprepconf
  286. }
  287. mkprepconf()
  288. {
  289. #[ ! -e ${SYSPREFIX}/lib-native ] || rm -rf ${SYSPREFIX}/lib-native
  290. #mkdir -p ${SYSPREFIX}/lib-native
  291. #for file in libc.so.6 libpthread.so.0 ; do
  292. # cp -L /${LIBDIR}/${file} ${SYSPREFIX}/lib-native
  293. #done
  294. ln -sf ${SYSPREFIX}/usr/bin/mawk ${SYSPREFIX}/usr/bin/awk
  295. ln -sf ${SYSPREFIX}/usr/bin/aclocal-1.11 ${SYSPREFIX}/usr/bin/aclocal
  296. # Patching libraries ...
  297. for lib in libc libpthread; do
  298. sed -i "s| /lib/| ${SYSPREFIX}/lib/|g" ${SYSPREFIX}/usr/lib/${RPM_ARCH}-linux-gnu/$lib.so
  299. sed -i "s| /usr/lib/| ${SYSPREFIX}/usr/lib/|g" ${SYSPREFIX}/usr/lib/${RPM_ARCH}-linux-gnu/$lib.so
  300. done
  301. sed -i "s|prefix=\"/usr\"|prefix=\"${SYSPREFIX}/usr\"|g" ${SYSPREFIX}/usr/bin/autopoint
  302. #sed -i "s|@automake_includes = (\"/usr/share/aclocal|@automake_includes = (\"${SYSPREFIX}/usr/share/aclocal|g" ${SYSPREFIX}/usr/bin/aclocal-1.11
  303. #sed -i "s|p@system_includes = ('/usr/share/aclocal')|@system_includes = ('${SYSPREFIX}/usr/share/aclocal')|g" ${SYSPREFIX}/usr/bin/aclocal-1.11
  304. for file in `find ${SYSPREFIX}/usr/lib/pkgconfig/ -type f -name "*.pc"`; do
  305. sed -i "s|=/usr|=${SYSPREFIX}/usr|g" ${file}
  306. done
  307. for file in `find ${SYSPREFIX}/usr/lib/${RPM_ARCH}-linux-gnu/pkgconfig/ -type f -name "*.pc"`; do
  308. sed -i "s|=/usr|=${SYSPREFIX}/usr|g" ${file}
  309. done
  310. for file in `find ${SYSPREFIX}/usr/bin/ -type f -name "*-config"`; do
  311. sed -i "s|=/usr|=${SYSPREFIX}/usr|g" ${file}
  312. done
  313. for file in `find ${SYSPREFIX}/usr/lib/ -type f -name "*.la"`; do
  314. sed -i "s|libdir='/usr/lib|libdir='${SYSPREFIX}/usr/lib|g" ${file}
  315. sed -i "s| /usr/lib| ${SYSPREFIX}/usr/lib|g" ${file}
  316. done
  317. for file in `find ${SYSPREFIX}/usr/lib/${RPM_ARCH}-linux-gnu/ -type f -name "*.la"`; do
  318. sed -i "s|libdir='/usr/lib|libdir='${SYSPREFIX}/usr/lib|g" ${file}
  319. sed -i "s| /usr/lib| ${SYSPREFIX}/usr/lib|g" ${file}
  320. done
  321. sed -i "s|#! /usr/bin/python2.7|#!${SYSPREFIX}/usr/bin/python2.7|g" ${SYSPREFIX}/usr/bin/python2.7-config
  322. # Fixing symlinks
  323. if [[ $ARCH == 64off ]]; then
  324. rm ${SYSPREFIX}/lib64
  325. rm ${SYSPREFIX}/usr/lib64
  326. ln -sf ${SYSPREFIX}/lib ${SYSPREFIX}/lib64
  327. ln -sf ${SYSPREFIX}/usr/lib ${SYSPREFIX}/usr/lib64
  328. fi
  329. # For some reason we have to specify ${SYSPREFIX}/usr/lib explicitly
  330. for CHECKPATH in ${SYSPREFIX} ${SYSPREFIX}/usr/lib ${SYSPREFIX}/bin; do
  331. for LINK in `find -L ${CHECKPATH} -xtype l`; do
  332. LINK_TARGET=`readlink "$LINK"`
  333. if [[ ${LINK_TARGET::1} == "/" ]] && ! ( echo $LINK |grep ssl ); then
  334. if [[ "${LINK_TARGET:0:${#SYSPREFIX}}" != "$SYSPREFIX" ]]; then
  335. echo "Fixing link: $LINK ($LINK_TARGET)"
  336. ln -sf "${SYSPREFIX}/${LINK_TARGET}" "${LINK}" || true
  337. fi
  338. fi
  339. done
  340. done
  341. ln -sf ${SYSPREFIX}/usr/bin/gcc ${SYSPREFIX}/usr/bin/cc
  342. [ -e "${PREFIX}/lib" ] || mkdir -p ${PREFIX}/lib
  343. #cp ${SYSPREFIX}/usr/lib/libltdl* ${PREFIX}/lib/
  344. cp ${SYSPREFIX}/lib/${RPM_ARCH}-linux-gnu/libpng12* ${PREFIX}/lib/
  345. cp ${SYSPREFIX}/usr/lib/${RPM_ARCH}-linux-gnu/libdb-5*.so ${PREFIX}/lib/
  346. cp ${SYSPREFIX}/lib/${RPM_ARCH}-linux-gnu/libpcre.so* ${PREFIX}/lib/
  347. cp ${SYSPREFIX}/usr/lib/${RPM_ARCH}-linux-gnu/libffi*.so* ${PREFIX}/lib
  348. # SDL deps
  349. cp ${SYSPREFIX}/usr/lib/${RPM_ARCH}-linux-gnu/libdirect-*.so* ${PREFIX}/lib/
  350. cp ${SYSPREFIX}/usr/lib/${RPM_ARCH}-linux-gnu/libdirectfb-*.so* ${PREFIX}/lib/
  351. cp ${SYSPREFIX}/usr/lib/${RPM_ARCH}-linux-gnu/libfusion*.so* ${PREFIX}/lib/
  352. #RANDOM_SYSPREFIX=`tr -cd '[:alnum:]' < /dev/urandom | fold -w8 | head -n1`
  353. #DATE=`date +%s`
  354. #LIB_PATH=${SYSPREFIX}/tmp/lib-\${DATE}-\${RANDOM_SYSPREFIX}
  355. #mkdir -p \${LIB_PATH} || true
  356. #for lib in libc.so.6 libpthread.so.0; do
  357. # cp -L ${SYSPREFIX}/${LIBDIR}/\${lib} \${LIB_PATH}
  358. #done
  359. [ -e ${DEPSPREFIX}/bin ] || mkdir -p ${DEPSPREFIX}/bin
  360. cat > ${DEPSPREFIX}/bin/gcc <<EOF
  361. #!/bin/sh
  362. #${SYSPREFIX}/usr/bin/gcc -nostdinc -I${SYSPREFIX}/usr/lib/gcc/${GCC_ARCH}-linux-gnu/4.3.2/include -I${SYSPREFIX}/usr/lib/gcc/${GCC_ARCH}-linux-gnu/4.3.2/include-fixed -I${PREFIX}/include -I${DEPSPREFIX}/include -I${SYSPREFIX}/usr/include "\$@"
  363. ${SYSPREFIX}/usr/bin/gcc --sysroot=${SYSPREFIX} "\$@"
  364. EOF
  365. chmod a+x ${DEPSPREFIX}/bin/gcc
  366. cat > ${DEPSPREFIX}/bin/g++ <<EOF
  367. #!/bin/sh
  368. #${SYSPREFIX}/usr/bin/g++ -nostdinc -I${SYSPREFIX}/usr/lib/gcc/../../include/c++/4.3 -I${SYSPREFIX}/usr/lib/gcc/../../include/c++/4.3/${GCC_ARCH}-linux-gnu -I${SYSPREFIX}/usr/lib/gcc/../../include/c++/4.3/backward -I${SYSPREFIX}/usr/lib/gcc/${GCC_ARCH}-linux-gnu/4.3.2/include -I${SYSPREFIX}/usr/lib/gcc/${GCC_ARCH}-linux-gnu/4.3.2/include-fixed -I${PREFIX}/include -I${DEPSPREFIX}/include -I${SYSPREFIX}/usr/include "\$@"
  369. ${SYSPREFIX}/usr/bin/g++ --sysroot=${SYSPREFIX} "\$@"
  370. EOF
  371. chmod a+x ${DEPSPREFIX}/bin/g++ || true
  372. cat > ${DEPSPREFIX}/bin/synfig-- <<EOF
  373. #!/bin/sh
  374. #if [ -d ${DEPSPREFIX} ]; then
  375. #mv ${DEPSPREFIX} ${DEPSPREFIX}.off
  376. #fi
  377. export LD_PRELOAD=""
  378. export LD_LIBRARY_PATH=""
  379. export PATH="/usr/local/bin/:/usr/sbin:/usr/bin:/bin"
  380. export LDFLAGS=""
  381. export CFLAGS=""
  382. export CXXFLAGS=""
  383. export PKG_CONFIG_PATH=""
  384. export PERL5LIB=""
  385. echo "-----------------!!!-------------"
  386. ~/synfig/bin/synfig "\$@"
  387. EOF
  388. #chmod a+x ${DEPSPREFIX}/bin/synfig || true
  389. cat > ${DEPSPREFIX}/bin/rsync <<EOF
  390. #!/bin/sh
  391. /usr/bin/rsync "\$@"
  392. EOF
  393. chmod a+x ${DEPSPREFIX}/bin/rsync
  394. cat > ${DEPSPREFIX}/bin/flex <<EOF
  395. #!/bin/sh
  396. /usr/bin/flex "\$@"
  397. EOF
  398. chmod a+x ${DEPSPREFIX}/bin/flex
  399. cat > ${DEPSPREFIX}/bin/bison <<EOF
  400. #!/bin/sh
  401. /usr/bin/bison "\$@"
  402. EOF
  403. chmod a+x ${DEPSPREFIX}/bin/bison
  404. cat > ${DEPSPREFIX}/bin/git <<EOF
  405. #!/bin/sh
  406. /usr/bin/git "\$@"
  407. EOF
  408. chmod a+x ${DEPSPREFIX}/bin/git
  409. #for binary in bzip2; do
  410. # ln -sf /usr/bin/$binary ${DEPSPREFIX}/bin/$binary
  411. #done
  412. }
  413. mkglib()
  414. {
  415. PKG_NAME=glib
  416. PKG_VERSION="${GLIB_VERSION}"
  417. TAREXT=xz
  418. if ! pkg-config ${PKG_NAME}-2.0 --exact-version=${PKG_VERSION} --print-errors; then
  419. cd ${CACHEDIR}
  420. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget http://ftp.gnome.org/pub/gnome/sources/glib/${PKG_VERSION%.*}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  421. cd ${SRCPREFIX}
  422. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  423. cd ${PKG_NAME}-${PKG_VERSION}
  424. ./configure --host=${HOST} --disable-static --enable-shared --prefix=${PREFIX}/
  425. make -j${THREADS}
  426. make install
  427. cd ..
  428. fi
  429. }
  430. mkfontconfig()
  431. {
  432. PKG_NAME=fontconfig
  433. PKG_VERSION="${FONTCONFIG_VERSION}"
  434. TAREXT=bz2
  435. if ! pkg-config ${PKG_NAME} --exact-version=${PKG_VERSION} --print-errors; then
  436. ( cd ${WORKSPACE}/cache/ && wget -c --no-check-certificate http://www.freedesktop.org/software/fontconfig/release/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  437. pushd ${SRCPREFIX}
  438. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  439. cd ${PKG_NAME}-${PKG_VERSION}
  440. ./configure --host=${HOST} --disable-static --enable-shared --prefix=${DEPSPREFIX}/
  441. make -j${THREADS}
  442. make install
  443. cd ..
  444. popd
  445. fi
  446. sed -i "s?<cachedir>${DEPSPREFIX}.*</cachedir>??" ${DEPSPREFIX}/etc/fonts/fonts.conf
  447. }
  448. mkatk()
  449. {
  450. PKG_NAME=atk
  451. PKG_VERSION="${ATK_VERSION}"
  452. TAREXT=xz
  453. if ! pkg-config ${PKG_NAME} --exact-version=${PKG_VERSION} --print-errors; then
  454. cd ${CACHEDIR}
  455. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget http://ftp.gnome.org/pub/gnome/sources/atk/${PKG_VERSION%.*}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  456. pushd ${SRCPREFIX}
  457. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  458. cd ${PKG_NAME}-${PKG_VERSION}
  459. ./configure --host=${HOST} --disable-static --enable-shared --prefix=${PREFIX}/
  460. make -j${THREADS}
  461. make install
  462. cd ..
  463. popd
  464. fi
  465. }
  466. mkatkmm()
  467. {
  468. PKG_NAME=atkmm
  469. PKG_VERSION="${ATKMM_VERSION}"
  470. TAREXT=xz
  471. if [ ! -f ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done ]; then
  472. cd ${CACHEDIR}
  473. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget http://ftp.gnome.org/pub/gnome/sources/${PKG_NAME}/${PKG_VERSION%.*}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  474. pushd ${SRCPREFIX}
  475. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  476. cd ${PKG_NAME}-${PKG_VERSION}
  477. ./configure --host=${HOST} --disable-static --enable-shared --prefix=${PREFIX}/
  478. make -j${THREADS}
  479. make install
  480. cd ..
  481. popd
  482. touch ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done
  483. fi
  484. }
  485. mkatspi2()
  486. {
  487. PKG_NAME=at-spi2-core
  488. PKG_VERSION="${AT_SPI2_VERSION}"
  489. TAREXT=xz
  490. if [ ! -f ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done ]; then
  491. ( cd ${WORKSPACE}/cache/ && wget -c --no-check-certificate http://ftp.gnome.org/pub/gnome/sources/${PKG_NAME}/${PKG_VERSION%.*}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  492. pushd ${SRCPREFIX}
  493. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  494. cd ${PKG_NAME}-${PKG_VERSION}
  495. [ ! -e config.cache ] || rm config.cache
  496. ./configure --build=${HOST} --prefix=${PREFIX}/ \
  497. --disable-static --enable-shared
  498. make -j${THREADS}
  499. make install
  500. cd ..
  501. popd
  502. touch ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done
  503. fi
  504. }
  505. mkatspi2atk()
  506. {
  507. mkatspi2
  508. PKG_NAME=at-spi2-atk
  509. PKG_VERSION="${AT_SPI2_ATK_VERSION}"
  510. TAREXT=xz
  511. if ! pkg-config atk-bridge-2.0 --exact-version=${PKG_VERSION} --print-errors; then
  512. ( cd ${WORKSPACE}/cache/ && wget -c --no-check-certificate http://ftp.gnome.org/pub/gnome/sources/${PKG_NAME}/${PKG_VERSION%.*}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  513. pushd ${SRCPREFIX}
  514. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  515. cd ${PKG_NAME}-${PKG_VERSION}
  516. [ ! -e config.cache ] || rm config.cache
  517. ./configure --build=${HOST} --prefix=${PREFIX}/ \
  518. --disable-static --enable-shared
  519. make -j${THREADS}
  520. make install
  521. cd ..
  522. popd
  523. fi
  524. }
  525. mkpixman()
  526. {
  527. PKG_NAME=pixman
  528. PKG_VERSION="${PIXMAN_VERSION}"
  529. TAREXT=gz
  530. if ! pkg-config ${PKG_NAME}-1 --exact-version=${PKG_VERSION} --print-errors; then
  531. ( cd ${WORKSPACE}/cache/ && wget -c --no-check-certificate http://cairographics.org/releases/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  532. pushd ${SRCPREFIX}
  533. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xzf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  534. cd ${PKG_NAME}-${PKG_VERSION}
  535. ./configure --host=${HOST} --disable-static --enable-shared --prefix=${PREFIX}/
  536. make -j${THREADS}
  537. make install
  538. cd ..
  539. popd
  540. fi
  541. }
  542. mkharfbuzz()
  543. {
  544. PKG_NAME=harfbuzz
  545. PKG_VERSION="${HARFBUZZ_VERSION}"
  546. TAREXT=bz2
  547. if ! pkg-config ${PKG_NAME} --exact-version=${PKG_VERSION} --print-errors; then
  548. ( cd ${WORKSPACE}/cache/ && wget -c --no-check-certificate http://www.freedesktop.org/software/harfbuzz/release/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  549. pushd ${SRCPREFIX}
  550. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  551. cd ${PKG_NAME}-${PKG_VERSION}
  552. ./configure --host=${HOST} --prefix=${PREFIX}
  553. make -j${THREADS}
  554. make install
  555. cd ..
  556. popd
  557. fi
  558. }
  559. mkcairo()
  560. {
  561. PKG_NAME=cairo
  562. PKG_VERSION="${CAIRO_VERSION}"
  563. TAREXT=xz
  564. if ! pkg-config ${PKG_NAME} --exact-version=${PKG_VERSION} --print-errors; then
  565. ( cd ${WORKSPACE}/cache/ && wget -c --no-check-certificate http://cairographics.org/releases/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  566. pushd ${SRCPREFIX}
  567. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  568. cd ${PKG_NAME}-${PKG_VERSION}
  569. sed -i 's|if test "x$cairo_cc_stderr" != "x"; then|if test "x$cairo_cc_stderr___" != "x"; then|g' configure
  570. ./configure --host=${HOST} --prefix=${PREFIX} \
  571. --disable-static \
  572. --enable-warnings \
  573. --enable-xlib \
  574. --enable-freetype \
  575. --enable-pdf \
  576. --enable-gobject \
  577. --disable-gtk-doc
  578. make -j${THREADS}
  579. make install
  580. cd ..
  581. popd
  582. fi
  583. }
  584. mkgdkpixbuf()
  585. {
  586. mkgobjectintrospection
  587. PKG_NAME=gdk-pixbuf
  588. PKG_VERSION="${GDK_PIXBUF_VERSION}"
  589. TAREXT=xz
  590. if [ ! -f ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done ]; then
  591. ( cd ${WORKSPACE}/cache/ && wget -c --no-check-certificate http://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/${PKG_VERSION%.*}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  592. pushd ${SRCPREFIX}
  593. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  594. cd ${PKG_NAME}-${PKG_VERSION}
  595. [ ! -e config.cache ] || rm config.cache
  596. sed -i 's|^enable_relocations=no|enable_relocations=yes|g' configure
  597. ./configure --host=${HOST} --prefix=${PREFIX}/ \
  598. --enable-introspection=yes \
  599. ${DEBUG_OPT2} \
  600. --disable-static --enable-shared
  601. make -j${THREADS}
  602. make install
  603. cd ..
  604. popd
  605. touch ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done
  606. fi
  607. }
  608. mkpango()
  609. {
  610. PKG_NAME=pango
  611. PKG_VERSION="${PANGO_VERSION}"
  612. TAREXT=xz
  613. if ! pkg-config ${PKG_NAME} --exact-version=${PKG_VERSION} --print-errors; then
  614. ( cd ${WORKSPACE}/cache/ && wget -c --no-check-certificate http://ftp.gnome.org/pub/gnome/sources/pango/${PKG_VERSION%.*}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  615. pushd ${SRCPREFIX}
  616. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  617. cd ${PKG_NAME}-${PKG_VERSION}
  618. [ ! -e config.cache ] || rm config.cache
  619. ./configure --host=${HOST} --prefix=${PREFIX}/ \
  620. --disable-static --enable-shared \
  621. --with-included-modules=yes
  622. make -j${THREADS}
  623. make install
  624. cd ..
  625. popd
  626. fi
  627. }
  628. mkgtk()
  629. {
  630. PKG_NAME=gtk\+
  631. PKG_VERSION="${GTK_VERSION}"
  632. TAREXT=xz
  633. if [ ! -f ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done ]; then
  634. ( cd ${WORKSPACE}/cache/ && wget -c --no-check-certificate http://ftp.gnome.org/pub/gnome/sources/gtk+/${PKG_VERSION%.*}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  635. pushd ${SRCPREFIX}
  636. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  637. cd ${PKG_NAME}-${PKG_VERSION}
  638. # Special fix that prevents retrieving some options from XSettings daemon
  639. #sed -i '/Net\/ThemeName/d' ./gdk/x11/gdksettings.c
  640. #sed -i '/Gtk\/MenuImages/d' ./gdk/x11/gdksettings.c
  641. [ ! -e config.cache ] || rm config.cache
  642. ./configure --build=${HOST} --prefix=${PREFIX}/ \
  643. ${DEBUG_OPT2} \
  644. --disable-static --enable-shared
  645. make -j${THREADS}
  646. make install
  647. cd ..
  648. popd
  649. touch ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done
  650. fi
  651. }
  652. mklibcroco()
  653. {
  654. PKG_NAME=libcroco
  655. PKG_VERSION=0.6.8
  656. TAREXT=xz
  657. if ! pkg-config ${PKG_NAME}-0.6 --exact-version=${PKG_VERSION} --print-errors; then
  658. ( cd ${WORKSPACE}/cache/ && wget -c --no-check-certificate http://ftp.gnome.org/pub/gnome/sources/${PKG_NAME}/${PKG_VERSION%.*}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  659. pushd ${SRCPREFIX}
  660. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  661. cd ${PKG_NAME}-${PKG_VERSION}
  662. [ ! -e config.cache ] || rm config.cache
  663. ./configure --build=${HOST} --prefix=${PREFIX}/ \
  664. --disable-static --enable-shared
  665. make -j${THREADS}
  666. make install
  667. cd ..
  668. popd
  669. fi
  670. }
  671. mkgobjectintrospection()
  672. {
  673. PKG_NAME=gobject-introspection
  674. PKG_VERSION=1.42.0
  675. TAREXT=xz
  676. if ! pkg-config ${PKG_NAME}-1.0 --exact-version=${PKG_VERSION} --print-errors; then
  677. ( cd ${WORKSPACE}/cache/ && wget -c --no-check-certificate http://ftp.gnome.org/pub/gnome/sources/${PKG_NAME}/${PKG_VERSION%.*}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  678. pushd ${SRCPREFIX}
  679. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  680. cd ${PKG_NAME}-${PKG_VERSION}
  681. [ ! -e config.cache ] || rm config.cache
  682. ./configure --build=${HOST} --prefix=${PREFIX}/ \
  683. --disable-static --enable-shared
  684. make -j${THREADS}
  685. make install
  686. cd ..
  687. popd
  688. fi
  689. }
  690. mklibrsvg()
  691. {
  692. mkgobjectintrospection
  693. mkgdkpixbuf
  694. mklibcroco
  695. PKG_NAME=librsvg
  696. PKG_VERSION=2.40.6
  697. TAREXT=xz
  698. if ! pkg-config ${PKG_NAME}-2.0 --exact-version=${PKG_VERSION} --print-errors; then
  699. ( cd ${WORKSPACE}/cache/ && wget -c --no-check-certificate http://ftp.gnome.org/pub/gnome/sources/${PKG_NAME}/${PKG_VERSION%.*}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  700. pushd ${SRCPREFIX}
  701. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  702. cd ${PKG_NAME}-${PKG_VERSION}
  703. [ ! -e config.cache ] || rm config.cache
  704. ./configure --build=${HOST} --prefix=${PREFIX}/ \
  705. --disable-static --enable-shared
  706. make -j${THREADS}
  707. make install
  708. cd ..
  709. popd
  710. fi
  711. }
  712. # Not used
  713. mkgnomethemes()
  714. {
  715. mklibrsvg
  716. PKG_NAME=gnome-themes-standard
  717. PKG_VERSION=3.15.2
  718. TAREXT=xz
  719. if [ ! -f ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done ]; then
  720. ( cd ${WORKSPACE}/cache/ && wget -c --no-check-certificate http://ftp.gnome.org/pub/gnome/sources/${PKG_NAME}/${PKG_VERSION%.*}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  721. pushd ${SRCPREFIX}
  722. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  723. cd ${PKG_NAME}-${PKG_VERSION}
  724. [ ! -e config.cache ] || rm config.cache
  725. ./configure --build=${HOST} --prefix=${PREFIX}/ \
  726. --disable-gtk2-engine \
  727. --disable-static --enable-shared
  728. make -j${THREADS}
  729. make install
  730. cd ..
  731. popd
  732. touch ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done
  733. fi
  734. }
  735. mkadwaitaicons()
  736. {
  737. mklibrsvg
  738. PKG_NAME=adwaita-icon-theme
  739. PKG_VERSION=3.15.1
  740. TAREXT=xz
  741. if [ ! -f ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done ]; then
  742. ( cd ${WORKSPACE}/cache/ && wget -c --no-check-certificate http://ftp.gnome.org/pub/gnome/sources/${PKG_NAME}/${PKG_VERSION%.*}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  743. pushd ${SRCPREFIX}
  744. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  745. cd ${PKG_NAME}-${PKG_VERSION}
  746. [ ! -e config.cache ] || rm config.cache
  747. ./configure --build=${HOST} --prefix=${PREFIX}/ \
  748. --disable-gtk2-engine \
  749. --disable-static --enable-shared
  750. make -j${THREADS}
  751. make install
  752. cd ..
  753. popd
  754. touch ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done
  755. fi
  756. }
  757. mklibsigcpp()
  758. {
  759. PKG_NAME=libsigc++
  760. PKG_VERSION="${LIBSIGCPP_VERSION}"
  761. TAREXT=bz2
  762. if ! pkg-config sigc++-2.0 --exact-version=${PKG_VERSION} --print-errors; then
  763. #rsync -av ${SOURCES_URL}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  764. #rsync -av ${SOURCES_URL}/libsigc++-2.0_2.0.18-2.diff ${WORKSPACE}/cache/libsigc++-2.0_2.0.18-2.diff
  765. ( cd ${WORKSPACE}/cache/ && wget -c --no-check-certificate http://ftp.gnome.org/pub/GNOME/sources/libsigc++/${PKG_VERSION%.*}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  766. pushd ${SRCPREFIX}
  767. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xjf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} # && cd ${PKG_NAME}-${PKG_VERSION} && patch -p1 < ${WORKSPACE}/cache/libsigc++-2.0_2.0.18-2.diff && cd ..
  768. cd ${PKG_NAME}-${PKG_VERSION}
  769. ./configure --host=${HOST} --prefix=${PREFIX} --includedir=${PREFIX}/include \
  770. --disable-static --enable-shared
  771. make -j${THREADS}
  772. make install
  773. cd ..
  774. popd
  775. fi
  776. }
  777. mkglibmm()
  778. {
  779. PKG_NAME=glibmm
  780. PKG_VERSION="${GLIBMM_VERSION}"
  781. TAREXT=xz
  782. if ! pkg-config ${PKG_NAME}-2.4 --exact-version=${PKG_VERSION} --print-errors; then
  783. ( cd ${WORKSPACE}/cache/ && wget -c --no-check-certificate http://ftp.gnome.org/pub/GNOME/sources/${PKG_NAME}/${PKG_VERSION%.*}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  784. pushd ${SRCPREFIX}
  785. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  786. cd ${PKG_NAME}-${PKG_VERSION}
  787. ./configure --host=${HOST} --prefix=${PREFIX} --includedir=${PREFIX}/include \
  788. --disable-fulldocs \
  789. --disable-static --enable-shared
  790. make -j${THREADS}
  791. make install
  792. cd ..
  793. popd
  794. fi
  795. }
  796. mklibtiff()
  797. {
  798. PKG_NAME=tiff
  799. PKG_VERSION=4.0.3
  800. TAREXT=gz
  801. if [ ! -f ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done ]; then
  802. cd $CACHEDIR
  803. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget http://download.osgeo.org/lib${PKG_NAME}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  804. cd $SRCPREFIX
  805. if [ ! -d ${PKG_NAME}-${PKG_VERSION} ]; then
  806. tar -xzf $CACHEDIR/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  807. fi
  808. cd ${PKG_NAME}-${PKG_VERSION}
  809. [ ! -e config.cache ] || rm config.cache
  810. ./configure \
  811. --host=${HOST} \
  812. --prefix=${PREFIX} \
  813. --includedir=${PREFIX}/include \
  814. --disable-static --enable-shared
  815. make -j$THREADS
  816. make install -j$THREADS
  817. touch ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done
  818. fi
  819. }
  820. mklibjpeg()
  821. {
  822. mkyasm
  823. PKG_NAME=libjpeg-turbo
  824. PKG_VERSION=${LIBJPEG_VERSION}
  825. TAREXT=gz
  826. if [ ! -f ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done ]; then
  827. cd $CACHEDIR
  828. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget http://sourceforge.net/projects/libjpeg-turbo/files/${PKG_VERSION}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  829. cd $SRCPREFIX
  830. if [ ! -d ${PKG_NAME}-${PKG_VERSION} ]; then
  831. tar -xzf $CACHEDIR/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  832. fi
  833. cd ${PKG_NAME}-${PKG_VERSION}
  834. [ ! -e config.cache ] || rm config.cache
  835. ./configure \
  836. --host=${HOST} \
  837. --prefix=${PREFIX} \
  838. --includedir=${PREFIX}/include \
  839. --disable-static --enable-shared
  840. make -j$THREADS
  841. make install -j$THREADS
  842. touch ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done
  843. fi
  844. }
  845. mklibxmlpp()
  846. {
  847. PKG_NAME=libxml++
  848. PKG_VERSION="${LIBXMLPP_VERSION}"
  849. TAREXT=bz2
  850. if ! pkg-config libxml++-2.6 --exact-version=${PKG_VERSION} --print-errors; then
  851. rsync -av ${SOURCES_URL}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  852. pushd ${SRCPREFIX}
  853. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xjf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  854. cd ${PKG_NAME}-${PKG_VERSION}
  855. ./configure --host=${HOST} --prefix=${PREFIX} --includedir=${PREFIX}/include \
  856. --disable-static --enable-shared
  857. make -j${THREADS}
  858. make install
  859. cd ..
  860. popd
  861. fi
  862. }
  863. mkimagemagick()
  864. {
  865. PKG_NAME=ImageMagick
  866. PKG_VERSION="${IMAGEMAGICK_VERSION}-10"
  867. TAREXT=xz
  868. if [ ! -f ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done ]; then
  869. ( cd ${WORKSPACE}/cache/ && wget -c http://www.imagemagick.org/download/releases/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  870. pushd ${SRCPREFIX}
  871. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar xf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  872. cd ${PKG_NAME}-${PKG_VERSION}
  873. ./configure --host=${HOST} --prefix=${PREFIX} --includedir=${PREFIX}/include \
  874. --disable-static --enable-shared \
  875. --with-modules \
  876. --without-perl \
  877. --without-x \
  878. --with-threads \
  879. --with-magick_plus_plus
  880. sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
  881. sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
  882. make -j${THREADS}
  883. make install
  884. cd ..
  885. popd
  886. touch ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done
  887. fi
  888. }
  889. mklibogg()
  890. {
  891. PKG_NAME=libogg
  892. PKG_VERSION=1.3.1
  893. TAREXT=gz
  894. if ! pkg-config ogg --exact-version=${PKG_VERSION} --print-errors; then
  895. cd $CACHEDIR
  896. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget http://downloads.xiph.org/releases/ogg/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  897. cd $SRCPREFIX
  898. if [ ! -d ${PKG_NAME}-${PKG_VERSION} ]; then
  899. tar -xzf $CACHEDIR/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  900. fi
  901. cd ${PKG_NAME}-${PKG_VERSION}
  902. [ ! -e config.cache ] || rm config.cache
  903. ./configure --host=${HOST} --prefix=${PREFIX} --includedir=${PREFIX}/include \
  904. --disable-static --enable-shared
  905. make all -j$THREADS
  906. make install -j$THREADS
  907. fi
  908. }
  909. mklibvorbis()
  910. {
  911. mklibogg
  912. PKG_NAME=libvorbis
  913. PKG_VERSION=1.3.4
  914. TAREXT=gz
  915. if ! pkg-config vorbis --exact-version=${PKG_VERSION} --print-errors; then
  916. cd $CACHEDIR
  917. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget http://downloads.xiph.org/releases/vorbis/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  918. cd $SRCPREFIX
  919. if [ ! -d ${PKG_NAME}-${PKG_VERSION} ]; then
  920. tar -xzf $CACHEDIR/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  921. fi
  922. cd ${PKG_NAME}-${PKG_VERSION}
  923. [ ! -e config.cache ] || rm config.cache
  924. ./configure --host=${HOST} --prefix=${PREFIX} --includedir=${PREFIX}/include \
  925. --disable-static --enable-shared
  926. make all -j$THREADS
  927. make install -j$THREADS
  928. fi
  929. }
  930. mklibsamplerate()
  931. {
  932. PKG_NAME=libsamplerate
  933. PKG_VERSION=0.1.8
  934. TAREXT=gz
  935. if ! pkg-config samplerate --exact-version=${PKG_VERSION} --print-errors; then
  936. cd $CACHEDIR
  937. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget http://www.mega-nerd.com/SRC/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  938. cd $SRCPREFIX
  939. if [ ! -d ${PKG_NAME}-${PKG_VERSION} ]; then
  940. tar -xzf $CACHEDIR/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  941. fi
  942. cd ${PKG_NAME}-${PKG_VERSION}
  943. [ ! -e config.cache ] || rm config.cache
  944. ./configure \
  945. --host=${HOST} --prefix=${PREFIX} --includedir=${PREFIX}/include \
  946. --disable-static --enable-shared
  947. make all -j$THREADS
  948. make install -j$THREADS
  949. fi
  950. }
  951. mksox()
  952. {
  953. PKG_NAME=sox
  954. PKG_VERSION=14.4.1
  955. TAREXT=gz
  956. if ! pkg-config ${PKG_NAME} --exact-version=${PKG_VERSION} --print-errors; then
  957. cd $CACHEDIR
  958. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget http://download.tuxfamily.org/synfig/packages/sources/base/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  959. cd $SRCPREFIX
  960. if [ ! -d ${PKG_NAME}-${PKG_VERSION} ]; then
  961. tar -xzf $CACHEDIR/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  962. fi
  963. cd ${PKG_NAME}-${PKG_VERSION}
  964. [ ! -e config.cache ] || rm config.cache
  965. ./configure \
  966. --host=${HOST} --prefix=${PREFIX} --includedir=${PREFIX}/include \
  967. --disable-static --enable-shared
  968. make all -j$THREADS
  969. make install -j$THREADS
  970. fi
  971. }
  972. mklame()
  973. {
  974. PKG_NAME=lame
  975. PKG_VERSION=3.99.5
  976. TAREXT=gz
  977. if [ ! -f ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done ]; then
  978. cd $CACHEDIR
  979. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget http://sourceforge.net/projects/lame/files/lame/3.99/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  980. cd $SRCPREFIX
  981. if [ ! -d ${PKG_NAME}-${PKG_VERSION} ]; then
  982. tar -xzf $CACHEDIR/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  983. fi
  984. cd ${PKG_NAME}-${PKG_VERSION}
  985. [ ! -e config.cache ] || rm config.cache
  986. ./configure --host=${HOST} --prefix=${PREFIX} --includedir=${PREFIX}/include \
  987. --disable-static --enable-shared
  988. make all -j$THREADS
  989. make install -j$THREADS
  990. touch ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done
  991. fi
  992. }
  993. mklibtheora()
  994. {
  995. mklibogg
  996. PKG_NAME=libtheora
  997. PKG_VERSION=1.1.1
  998. TAREXT=gz
  999. if [ ! -f ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done ]; then
  1000. cd $CACHEDIR
  1001. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget http://downloads.xiph.org/releases/theora/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1002. cd $SRCPREFIX
  1003. if [ ! -d ${PKG_NAME}-${PKG_VERSION} ]; then
  1004. tar -xzf $CACHEDIR/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1005. fi
  1006. cd ${PKG_NAME}-${PKG_VERSION}
  1007. [ ! -e config.cache ] || rm config.cache
  1008. ./configure --host=${HOST} --prefix=${PREFIX} --includedir=${PREFIX}/include \
  1009. --disable-static --enable-shared
  1010. make all -j$THREADS
  1011. make install -j$THREADS
  1012. touch ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done
  1013. fi
  1014. }
  1015. mkx264()
  1016. {
  1017. PKG_NAME=x264
  1018. PKG_VERSION=3.99.5
  1019. TAREXT=gz
  1020. if [ ! -f ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done ]; then
  1021. if [ -d x264 ]; then
  1022. cd x264
  1023. /usr/bin/git pull -v
  1024. cd ..
  1025. else
  1026. /usr/bin/git clone git://git.videolan.org/x264.git
  1027. fi
  1028. cd ${PKG_NAME}
  1029. [ ! -e config.cache ] || rm config.cache
  1030. ./configure --host=${HOST} --prefix=${PREFIX} --includedir=${PREFIX}/include \
  1031. --disable-static --enable-shared
  1032. make all -j$THREADS
  1033. make install -j$THREADS
  1034. touch ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done
  1035. fi
  1036. }
  1037. mkfaac()
  1038. {
  1039. PKG_NAME=faac
  1040. PKG_VERSION=1.28
  1041. TAREXT=bz2
  1042. if [ ! -f ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done ]; then
  1043. cd $CACHEDIR
  1044. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget http://downloads.sourceforge.net/faac/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1045. cd $SRCPREFIX
  1046. if [ ! -d ${PKG_NAME}-${PKG_VERSION} ]; then
  1047. tar -xjf $CACHEDIR/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1048. fi
  1049. cd ${PKG_NAME}-${PKG_VERSION}
  1050. [ ! -e config.cache ] || rm config.cache
  1051. ./configure --host=${HOST} --prefix=${PREFIX} --includedir=${PREFIX}/include \
  1052. --disable-static --enable-shared
  1053. if [ ! -f common/mp4v2/mpeg4ip.h.patch ]; then
  1054. sed -i '126 s|^|//|' common/mp4v2/mpeg4ip.h
  1055. touch common/mp4v2/mpeg4ip.h.patch
  1056. fi
  1057. make all -j$THREADS
  1058. make install -j$THREADS
  1059. sed -i '53 s|^|//|' ${PREFIX}/include/faac.h
  1060. touch ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done
  1061. fi
  1062. }
  1063. mkyasm()
  1064. {
  1065. PKG_NAME=yasm
  1066. PKG_VERSION=1.2.0
  1067. TAREXT=gz
  1068. if [ ! -f ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done ]; then
  1069. cd $CACHEDIR
  1070. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget http://www.tortall.net/projects/yasm/releases/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1071. cd $SRCPREFIX
  1072. if [ ! -d ${PKG_NAME}-${PKG_VERSION} ]; then
  1073. tar -xzf $CACHEDIR/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1074. fi
  1075. cd ${PKG_NAME}-${PKG_VERSION}
  1076. [ ! -e config.cache ] || rm config.cache
  1077. ./configure --host=${HOST} --disable-static --enable-shared --prefix=${DEPSPREFIX}/
  1078. make -j${THREADS}
  1079. make install
  1080. cd ..
  1081. touch ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done
  1082. fi
  1083. }
  1084. mkfftw()
  1085. {
  1086. PKG_NAME=fftw
  1087. PKG_VERSION=3.3.4
  1088. TAREXT=gz
  1089. if [ ! -f ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done ]; then
  1090. ( cd ${WORKSPACE}/cache/ && wget -c --no-check-certificate http://www.fftw.org/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  1091. pushd ${SRCPREFIX}
  1092. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1093. cd ${PKG_NAME}-${PKG_VERSION}
  1094. [ ! -e config.cache ] || rm config.cache
  1095. ./configure --host=${HOST} --prefix=${PREFIX}/ \
  1096. ${DEBUG_OPT2} \
  1097. --disable-static --enable-shared
  1098. make -j${THREADS}
  1099. make install
  1100. cd ..
  1101. popd
  1102. touch ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done
  1103. fi
  1104. }
  1105. mkffmpeg()
  1106. {
  1107. #mkfaac
  1108. mkyasm
  1109. mklame
  1110. mklibtheora
  1111. mklibvorbis
  1112. mkx264
  1113. PKG_NAME=ffmpeg
  1114. PKG_VERSION=2.4.x
  1115. TAREXT=bz2
  1116. if [ ! -f ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done ]; then
  1117. pushd ${SRCPREFIX}
  1118. if [ -d ffmpeg ]; then
  1119. cd ffmpeg
  1120. /usr/bin/git fetch
  1121. cd ..
  1122. else
  1123. /usr/bin/git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
  1124. fi
  1125. #rsync -av ${SOURCES_URL}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1126. #[ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xjf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1127. #cd ${PKG_NAME}-${PKG_VERSION}
  1128. cd ${PKG_NAME}
  1129. git reset --hard
  1130. git checkout a194298954e98d9157
  1131. ./configure --prefix=${PREFIX} \
  1132. --arch=${SYS_ARCH} \
  1133. --enable-rpath \
  1134. --enable-gpl --enable-nonfree \
  1135. --enable-libx264 --enable-libmp3lame \
  1136. --enable-libtheora --enable-libvorbis \
  1137. --disable-static --enable-shared
  1138. #--enable-libfaac
  1139. make -j${THREADS}
  1140. make install
  1141. cd ..
  1142. popd
  1143. touch ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done
  1144. fi
  1145. }
  1146. mksdl()
  1147. {
  1148. PKG_NAME=SDL
  1149. PKG_VERSION=1.2.15
  1150. TAREXT=gz
  1151. if [ ! -f ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done ]; then
  1152. cd $CACHEDIR
  1153. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget http://www.libsdl.org/release/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1154. cd $SRCPREFIX
  1155. if [ ! -d ${PKG_NAME}-${PKG_VERSION} ]; then
  1156. tar -xzf $CACHEDIR/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1157. fi
  1158. cd ${PKG_NAME}-${PKG_VERSION}
  1159. [ ! -e config.cache ] || rm config.cache
  1160. ./configure --host=${HOST} --disable-static --enable-shared --prefix=${PREFIX}/
  1161. make -j${THREADS}
  1162. make install
  1163. cd ..
  1164. touch ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done
  1165. fi
  1166. }
  1167. mkmlt()
  1168. {
  1169. mksdl
  1170. mkffmpeg
  1171. mklibsamplerate
  1172. mklibvorbis
  1173. mksox
  1174. PKG_NAME=mlt
  1175. PKG_VERSION=0.9.6
  1176. TAREXT=gz
  1177. if [ ! -f ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done ]; then
  1178. #export CPPFLAGS=" -I/usr/${TOOLCHAIN_HOST}/sys-root/mingw/include/SDL $CPPFLAGS"
  1179. #export LDFLAGS=" $LDFLAGS -lmingw32 -lSDLmain -lSDL -mwindows"
  1180. cd $SRCPREFIX
  1181. if [ ! -d ${PKG_NAME} ]; then
  1182. /usr/bin/git clone http://github.com/morevnaproject/mlt
  1183. fi
  1184. cd mlt
  1185. /usr/bin/git reset --hard
  1186. /usr/bin/git checkout master
  1187. /usr/bin/git reset --hard
  1188. /usr/bin/git pull
  1189. /usr/bin/git clean -f -d
  1190. [ ! -e config.cache ] || rm config.cache
  1191. ./configure \
  1192. --host=${HOST} --prefix=${PREFIX} --includedir=${PREFIX}/include \
  1193. --avformat-shared=${PREFIX}/ \
  1194. --target-arch=${RPM_ARCH} \
  1195. --enable-gpl --disable-decklink \
  1196. $DEBUG
  1197. touch src/modules/disable-gtk2
  1198. make all -j$THREADS
  1199. make install -j$THREADS
  1200. if [ ! -f ${PREFIX}/lib/mlt/libmltsdl.so ]; then
  1201. echo "ERROR: No SDL module compiled for MLT."
  1202. exit 1
  1203. fi
  1204. touch ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done
  1205. fi
  1206. }
  1207. mkboost()
  1208. {
  1209. PKG_NAME=boost
  1210. PKG_VERSION="${BOOST_VERSION}"
  1211. TAREXT=bz2
  1212. if ! cat ${PREFIX}/include/boost/version.hpp |egrep "BOOST_LIB_VERSION \"${PKG_VERSION%_*}\""; then
  1213. #PATH_BAK=$PATH
  1214. #PATH="${DEPSPREFIX}/bin-gcc/:$PATH"
  1215. #rm -rf ${DEPSPREFIX}/lib/libboost_program_options* || true
  1216. #rm -rf ${PREFIX}/lib/libboost_program_options* || true
  1217. rsync -av ${SOURCES_URL}/${PKG_NAME}_${PKG_VERSION}.tar.${TAREXT} ${WORKSPACE}/cache/${PKG_NAME}_${PKG_VERSION}.tar.${TAREXT}
  1218. pushd ${SRCPREFIX}
  1219. [ ! -d ${PKG_NAME}_${PKG_VERSION} ] && tar -xjf ${WORKSPACE}/cache/${PKG_NAME}_${PKG_VERSION}.tar.${TAREXT}
  1220. cd ${PKG_NAME}_${PKG_VERSION}
  1221. ./bootstrap.sh --prefix=${PREFIX} \
  1222. --libdir=${PREFIX}/lib \
  1223. --exec-prefix=${PREFIX} \
  1224. --with-libraries=program_options,filesystem,system,chrono
  1225. ./b2
  1226. ./b2 install || true
  1227. cd ..
  1228. popd
  1229. #PATH="$PATH_BAK"
  1230. fi
  1231. #cp ${DEPSPREFIX}/lib/libboost_program_options.so.*.0 ${PREFIX}/lib/
  1232. }
  1233. mklibdrm()
  1234. {
  1235. PKG_NAME=libdrm
  1236. PKG_VERSION=2.4.65
  1237. TAREXT=gz
  1238. if [ ! -f ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done ]; then
  1239. ( cd ${WORKSPACE}/cache/ && wget -c --no-check-certificate http://dri.freedesktop.org/libdrm/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  1240. pushd ${SRCPREFIX}
  1241. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xzf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1242. cd ${PKG_NAME}-${PKG_VERSION}
  1243. ./configure --host=${HOST} --prefix=${DEPSPREFIX} --includedir=${DEPSPREFIX}/include \
  1244. --disable-static --enable-shared
  1245. make -j${THREADS}
  1246. make install
  1247. cd ..
  1248. popd
  1249. touch ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done
  1250. fi
  1251. }
  1252. mkxcb-proto()
  1253. {
  1254. PKG_NAME=xcb-proto
  1255. PKG_VERSION=1.11
  1256. TAREXT=bz2
  1257. if [ ! -f ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done ]; then
  1258. ( cd ${WORKSPACE}/cache/ && wget -c --no-check-certificate http://xcb.freedesktop.org/dist/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  1259. pushd ${SRCPREFIX}
  1260. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar xf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1261. cd ${PKG_NAME}-${PKG_VERSION}
  1262. ./configure --host=${HOST} --prefix=${DEPSPREFIX} --includedir=${DEPSPREFIX}/include \
  1263. --disable-static --enable-shared
  1264. make -j${THREADS}
  1265. make install
  1266. cd ..
  1267. popd
  1268. touch ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done
  1269. fi
  1270. }
  1271. mklibxcb()
  1272. {
  1273. mkxcb-proto
  1274. PKG_NAME=libxcb
  1275. PKG_VERSION=1.11.1
  1276. TAREXT=bz2
  1277. if [ ! -f ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done ]; then
  1278. ( cd ${WORKSPACE}/cache/ && wget -c --no-check-certificate http://xcb.freedesktop.org/dist/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  1279. pushd ${SRCPREFIX}
  1280. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar xf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1281. cd ${PKG_NAME}-${PKG_VERSION}
  1282. ./configure --host=${HOST} --prefix=${DEPSPREFIX} --includedir=${DEPSPREFIX}/include \
  1283. --disable-static --enable-shared
  1284. make -j${THREADS}
  1285. make install
  1286. cd ..
  1287. popd
  1288. touch ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done
  1289. fi
  1290. }
  1291. mkmesa()
  1292. {
  1293. mklibxcb
  1294. mklibdrm
  1295. PKG_NAME=mesa
  1296. PKG_VERSION=10.6.9
  1297. TAREXT=gz
  1298. if [ ! -f ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done ]; then
  1299. #( cd ${WORKSPACE}/cache/ && wget -c --no-check-certificate ftp://ftp.freedesktop.org/pub/mesa/${PKG_VERSION}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  1300. pushd ${SRCPREFIX}
  1301. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xzf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1302. cd ${PKG_NAME}-${PKG_VERSION}
  1303. ./configure --host=${HOST} --prefix=${DEPSPREFIX} --includedir=${DEPSPREFIX}/include \
  1304. --with-gallium-drivers="swrast" \
  1305. --with-dri-drivers="swrast" \
  1306. --disable-static --enable-shared
  1307. # \
  1308. # --disable-egl \
  1309. make -j${THREADS}
  1310. make install
  1311. cd ..
  1312. popd
  1313. touch ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done
  1314. fi
  1315. }
  1316. mkcairomm()
  1317. {
  1318. PKG_NAME=cairomm
  1319. PKG_VERSION="${CAIROMM_VERSION}"
  1320. TAREXT=gz
  1321. if ! pkg-config ${PKG_NAME}-1.0 --exact-version=${PKG_VERSION} --print-errors; then
  1322. ( cd ${WORKSPACE}/cache/ && wget -c --no-check-certificate http://cairographics.org/releases/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  1323. pushd ${SRCPREFIX}
  1324. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xzf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1325. cd ${PKG_NAME}-${PKG_VERSION}
  1326. ./configure --host=${HOST} --prefix=${PREFIX} --includedir=${PREFIX}/include \
  1327. --enable-docs=no \
  1328. --disable-static --enable-shared
  1329. make -j${THREADS}
  1330. make install
  1331. cd ..
  1332. popd
  1333. fi
  1334. }
  1335. mkpangomm()
  1336. {
  1337. PKG_NAME=pangomm
  1338. PKG_VERSION="${PANGOMM_VERSION}"
  1339. TAREXT=xz
  1340. if ! pkg-config ${PKG_NAME}-1.4 --exact-version=${PKG_VERSION} --print-errors; then
  1341. ( cd ${WORKSPACE}/cache/ && wget -c --no-check-certificate http://ftp.gnome.org/pub/GNOME/sources/${PKG_NAME}/${PKG_VERSION%.*}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  1342. pushd ${SRCPREFIX}
  1343. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1344. cd ${PKG_NAME}-${PKG_VERSION}
  1345. ./configure --host=${HOST} --prefix=${PREFIX} --includedir=${PREFIX}/include \
  1346. --disable-docs \
  1347. --disable-static --enable-shared
  1348. make -j${THREADS}
  1349. make install
  1350. cd ..
  1351. popd
  1352. fi
  1353. }
  1354. mkgtkmm()
  1355. {
  1356. mkatkmm
  1357. PKG_NAME=gtkmm
  1358. PKG_VERSION="${GTKMM_VERSION}"
  1359. TAREXT=xz
  1360. if ! pkg-config ${PKG_NAME}-3.0 --exact-version=${PKG_VERSION} --print-errors; then
  1361. ( cd ${WORKSPACE}/cache/ && wget -c --no-check-certificate http://ftp.gnome.org/pub/GNOME/sources/${PKG_NAME}/${PKG_VERSION%.*}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  1362. #rsync -av ${SOURCES_URL}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1363. pushd ${SRCPREFIX}
  1364. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1365. cd ${PKG_NAME}-${PKG_VERSION}
  1366. ./configure --host=${HOST} --prefix=${PREFIX} --includedir=${PREFIX}/include \
  1367. --disable-examples --disable-demos --disable-docs \
  1368. --disable-static --enable-shared
  1369. make -j${THREADS}
  1370. make install
  1371. cd ..
  1372. popd
  1373. fi
  1374. }
  1375. mkjack()
  1376. {
  1377. PKG_NAME=jack-audio-connection-kit
  1378. PKG_VERSION="${JACK_VERSION}"
  1379. TAREXT=gz
  1380. if ! pkg-config jack --exact-version=${PKG_VERSION} --print-errors; then
  1381. rsync -av ${SOURCES_URL}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1382. pushd ${SRCPREFIX}
  1383. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xzf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1384. cd ${PKG_NAME}-${PKG_VERSION}
  1385. # Disable check for parallel jack installs
  1386. sed -i 's|if test $not_overwriting -gt 0 ; then|if test $not_overwriting -gt 500 ; then|g' configure
  1387. ./configure --host=${HOST} --prefix=${DEPSPREFIX} --includedir=${DEPSPREFIX}/include \
  1388. --libdir=${DEPSPREFIX}/lib \
  1389. --disable-static --enable-shared
  1390. make -j${THREADS}
  1391. make install
  1392. cd ..
  1393. popd
  1394. fi
  1395. [ -e "${PREFIX}/lib.extra" ] || mkdir -p ${PREFIX}/lib.extra
  1396. if [ ${PREFIX} != ${DEPSPREFIX} ]; then
  1397. cp ${DEPSPREFIX}/lib/libjack.so* ${PREFIX}/lib.extra/
  1398. fi
  1399. }
  1400. mkm4()
  1401. {
  1402. PKG_NAME=m4
  1403. PKG_VERSION="1.4.17"
  1404. TAREXT=gz
  1405. # TODO: DEPSPREFIX -> TOOLSPREFIX ?
  1406. if [ ! -e ${DEPSPREFIX}/bin/m4 ]; then
  1407. ( cd ${WORKSPACE}/cache/ && wget -c http://ftp.gnu.org/gnu/m4/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  1408. pushd ${SRCPREFIX}
  1409. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xzf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1410. cd ${PKG_NAME}-${PKG_VERSION}
  1411. ./configure --host=${HOST} --prefix=${DEPSPREFIX}
  1412. make -j${THREADS}
  1413. make install
  1414. cd ..
  1415. popd
  1416. fi
  1417. }
  1418. mkautoconf()
  1419. {
  1420. PKG_NAME=autoconf
  1421. PKG_VERSION="2.69"
  1422. TAREXT=gz
  1423. # TODO: DEPSPREFIX -> TOOLSPREFIX ?
  1424. if [ ! -e ${DEPSPREFIX}/bin/autoconf ]; then
  1425. ( cd ${WORKSPACE}/cache/ && wget -c http://ftp.gnu.org/gnu/autoconf/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  1426. pushd ${SRCPREFIX}
  1427. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xzf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1428. cd ${PKG_NAME}-${PKG_VERSION}
  1429. ./configure --host=${HOST} --prefix=${DEPSPREFIX}
  1430. make -j${THREADS}
  1431. make install
  1432. cd ..
  1433. popd
  1434. fi
  1435. }
  1436. mkautomake()
  1437. {
  1438. PKG_NAME=automake
  1439. PKG_VERSION="1.14"
  1440. TAREXT=gz
  1441. # TODO: DEPSPREFIX -> TOOLSPREFIX ?
  1442. if [ ! -e ${DEPSPREFIX}/bin/automake ]; then
  1443. ( cd ${WORKSPACE}/cache/ && wget -c http://ftp.gnu.org/gnu/automake/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  1444. pushd ${SRCPREFIX}
  1445. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xzf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1446. cd ${PKG_NAME}-${PKG_VERSION}
  1447. ./configure --host=${HOST} --prefix=${DEPSPREFIX}
  1448. make -j${THREADS}
  1449. make install
  1450. cd ..
  1451. popd
  1452. fi
  1453. }
  1454. mklibtool()
  1455. {
  1456. PKG_NAME=libtool
  1457. PKG_VERSION="2.4.2"
  1458. TAREXT=gz
  1459. mkdir -p $SYSPREFIX/tmp/${PKG_NAME}-bin || true
  1460. cat > $SYSPREFIX/tmp/${PKG_NAME}-bin/gcc <<EOF
  1461. #!/bin/sh
  1462. ${SYSPREFIX}/usr/bin/gcc "\$@"
  1463. EOF
  1464. chmod a+x $SYSPREFIX/tmp/${PKG_NAME}-bin/gcc
  1465. PATH_BAK=$PATH
  1466. PATH="$SYSPREFIX/tmp/${PKG_NAME}-bin/:$PATH"
  1467. if [ ! -e ${DEPSPREFIX}/bin/libtoolize ]; then
  1468. ( cd ${WORKSPACE}/cache/ && wget -c http://ftpmirror.gnu.org/libtool/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  1469. pushd ${SRCPREFIX}
  1470. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xzf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1471. cd ${PKG_NAME}-${PKG_VERSION}
  1472. IFS=" " ./configure --host=${HOST} --prefix=${DEPSPREFIX} --enable-ltdl-install
  1473. make -j${THREADS}
  1474. make install
  1475. cd ..
  1476. popd
  1477. fi
  1478. [ -e ${PREFIX}/lib/ ] || mkdir -p ${PREFIX}/lib/
  1479. if [[ "${PREFIX}" != "${DEPSPREFIX}" ]]; then
  1480. #rm -rf ${PREFIX}/lib/libltdl* || true
  1481. cp ${DEPSPREFIX}/lib/libltdl.so* ${PREFIX}/lib/
  1482. fi
  1483. PATH="$PATH_BAK"
  1484. }
  1485. mkintltool()
  1486. {
  1487. PKG_NAME=intltool
  1488. PKG_VERSION="0.50.2"
  1489. TAREXT=gz
  1490. if [ ! -e ${DEPSPREFIX}/bin/intltoolize ]; then
  1491. ( cd ${WORKSPACE}/cache/ && wget -c --no-check-certificate https://launchpad.net/intltool/trunk/0.50.2/+download/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  1492. pushd ${SRCPREFIX}
  1493. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xzf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1494. cd ${PKG_NAME}-${PKG_VERSION}
  1495. ./configure --host=${HOST} --prefix=${DEPSPREFIX}
  1496. make -j${THREADS}
  1497. make install
  1498. cd ..
  1499. popd
  1500. fi
  1501. }
  1502. # TODO: remove?
  1503. mkgettext()
  1504. {
  1505. PKG_NAME=gettext
  1506. PKG_VERSION="0.19.6"
  1507. TAREXT=gz
  1508. mkdir -p $SYSPREFIX/tmp/gettext-bin || true
  1509. cat > $SYSPREFIX/tmp/gettext-bin/gij <<EOF
  1510. #!/bin/sh
  1511. false
  1512. EOF
  1513. chmod a+x $SYSPREFIX/tmp/gettext-bin/gij
  1514. cat > $SYSPREFIX/tmp/gettext-bin/gcc <<EOF
  1515. #!/bin/sh
  1516. ${SYSPREFIX}/usr/bin/gcc "\$@"
  1517. EOF
  1518. chmod a+x $SYSPREFIX/tmp/gettext-bin/gcc
  1519. #rm -rf $SYSPREFIX/tmp/gettext-bin
  1520. PATH_BAK=$PATH
  1521. PATH="$SYSPREFIX/tmp/gettext-bin/:$PATH"
  1522. if [ ! -e ${DEPSPREFIX}/bin/gettext ]; then
  1523. ( cd ${WORKSPACE}/cache/ && wget -c http://ftp.gnu.org/pub/gnu/gettext/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} )
  1524. pushd ${SRCPREFIX}
  1525. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xzf ${WORKSPACE}/cache/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  1526. # cd ${PKG_NAME}-${PKG_VERSION} && patch -p1 < ${WORKSPACE}/cache/gettext-${PKG_VERSION}-4.patch && cd ..
  1527. cd ${PKG_NAME}-${PKG_VERSION}
  1528. ./configure --host=${HOST} --prefix=${DEPSPREFIX} \
  1529. --disable-java --disable-native-java
  1530. make -j${THREADS}
  1531. make install
  1532. cd ..
  1533. popd
  1534. fi
  1535. PATH="$PATH_BAK"
  1536. }
  1537. #ETL
  1538. mketl()
  1539. {
  1540. cd $SCRIPTPATH/../ETL
  1541. make clean || true
  1542. run_native autoreconf --install --force
  1543. ./configure --host=${HOST} --prefix=${PREFIX} \
  1544. --includedir=${PREFIX}/include --libdir=${PREFIX}/lib \
  1545. --bindir=${PREFIX}/bin \
  1546. $DEBUG_OPT
  1547. make -j${THREADS}
  1548. make install
  1549. }
  1550. #synfig-core
  1551. mksynfig()
  1552. {
  1553. cd $SCRIPTPATH/../synfig-core/
  1554. make clean || true
  1555. [ ! -e config.cache ] || rm config.cache
  1556. /bin/sh ./bootstrap.sh
  1557. ./configure --host=${HOST} --prefix=${PREFIX} \
  1558. --includedir=${PREFIX}/include \
  1559. --libdir=${PREFIX}/lib --bindir=${PREFIX}/bin \
  1560. --sysconfdir=${PREFIX}/etc \
  1561. --disable-static --enable-shared \
  1562. --with-magickpp --without-libavcodec \
  1563. --with-boost=${PREFIX}/ \
  1564. --enable-warnings=minimum \
  1565. $DEBUG_OPT
  1566. make -j${THREADS}
  1567. make install
  1568. }
  1569. #synfig-studio
  1570. mksynfigstudio()
  1571. {
  1572. cd $SCRIPTPATH/../synfig-studio/
  1573. make clean || true
  1574. [ ! -e config.cache ] || rm config.cache
  1575. /bin/sh ./bootstrap.sh
  1576. ./configure --host=${HOST} --prefix=${PREFIX} \
  1577. --includedir=${SYSPREFIX}/include \
  1578. --libdir=${PREFIX}/lib --bindir=${PREFIX}/bin \
  1579. --sysconfdir=${PREFIX}/etc --datadir=${PREFIX}/share \
  1580. --disable-static --enable-shared \
  1581. $DEBUG_OPT
  1582. make -j${THREADS} install
  1583. #for DIR in build_tools src plugins po brushes; do
  1584. #cd $DIR
  1585. #make -j${THREADS}
  1586. #make -j${THREADS} install
  1587. #cd ..
  1588. #done
  1589. }
  1590. mkconfig()
  1591. {
  1592. #if [ ${PREFIX} == ${DEPSPREFIX} ]; then
  1593. #if [ ! -e "${PREFIX}/etc/pango/pango.modules.in" ]; then
  1594. # sed "s?${PREFIX}/lib/pango/1.6.0/modules?@ROOTDIR@/modules?" < ${PREFIX}/etc/pango/pango.modules > ${PREFIX}/etc/pango/pango.modules.in
  1595. #fi
  1596. if [ ! -e "${PREFIX}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache.in" ]; then
  1597. sed "s?${PREFIX}/lib/gdk-pixbuf-2.0/2.10.0/loaders?@ROOTDIR@/loaders?" < ${PREFIX}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache > ${PREFIX}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache.in
  1598. fi
  1599. #fi
  1600. cat > ${PREFIX}/synfig <<EOF
  1601. #!/bin/sh
  1602. SYSPREFIX=\$(cd \`dirname "\$0"\`; pwd)
  1603. export LD_LIBRARY_PATH=\${SYSPREFIX}/lib:\$LD_LIBRARY_PATH
  1604. export SYNFIG_ROOT=\${SYSPREFIX}/
  1605. export SYNFIG_MODULE_LIST=\${SYSPREFIX}/etc/synfig_modules.cfg
  1606. export MLT_DATA="\${SYSPREFIX}/share/mlt/"
  1607. export MLT_REPOSITORY="\${SYSPREFIX}/lib/mlt/"
  1608. export MAGICK_CODER_FILTER_PATH="\${SYSPREFIX}/lib/ImageMagick-${IMAGEMAGICK_VERSION}/config-Q16/"
  1609. export MAGICK_CODER_MODULE_PATH="\${SYSPREFIX}/lib/ImageMagick-${IMAGEMAGICK_VERSION}/modules-Q16/coders/"
  1610. export MAGICK_CONFIGURE_PATH="\${SYSPREFIX}/lib/ImageMagick-${IMAGEMAGICK_VERSION}/modules-Q16/filters/"
  1611. \$SYSPREFIX/bin/synfig "\$@"
  1612. EOF
  1613. chmod a+x $PREFIX/synfig
  1614. cat > ${PREFIX}/synfigstudio <<EOF
  1615. #!/bin/sh
  1616. SYSPREFIX=\$(cd \`dirname "\$0"\`; pwd)
  1617. # Check if this system have JACK installed
  1618. if ( ! ldconfig -p | grep libjack.so >/dev/null ) || ( ! which jackd >/dev/null ) ; then
  1619. # No JACK, so disable this functionality.
  1620. # (The bundled libjack won't work correctly anyway).
  1621. export SYNFIG_DISABLE_JACK=1
  1622. export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\${SYSPREFIX}/lib.extra
  1623. fi
  1624. USER_CONFIG_DIR=\$HOME/.config/synfig
  1625. export ETC_DIR=\${SYSPREFIX}/etc
  1626. export LD_LIBRARY_PATH=\${SYSPREFIX}/lib:\$LD_LIBRARY_PATH
  1627. export SYNFIG_ROOT=\${SYSPREFIX}/
  1628. export SYNFIG_GTK_THEME="Adwaita"
  1629. export SYNFIG_MODULE_LIST=\${SYSPREFIX}/etc/synfig_modules.cfg
  1630. export XDG_DATA_DIRS="\${SYSPREFIX}/share/:\$XDG_DATA_DIRS:/usr/local/share/:/usr/share/"
  1631. export XDG_CONFIG_DIRS="\$HOME/.config/synfig:\$XDG_CONFIG_DIRS"
  1632. #export GDK_PIXBUF_MODULEDIR="\${SYSPREFIX}/lib/gtk-2.0/2.10.0/loaders"
  1633. export GSETTINGS_SCHEMA_DIR="\${SYSPREFIX}/share/glib-2.0/schemas/"
  1634. export FONTCONFIG_PATH="\${SYSPREFIX}/etc/fonts"
  1635. export MLT_DATA="\${SYSPREFIX}/share/mlt/"
  1636. export MLT_REPOSITORY="\${SYSPREFIX}/lib/mlt/"
  1637. export MAGICK_CONFIGURE_PATH="\${SYSPREFIX}/lib/ImageMagick-${IMAGEMAGICK_VERSION}/config-Q16/"
  1638. export MAGICK_CODER_MODULE_PATH="\${SYSPREFIX}/lib/ImageMagick-${IMAGEMAGICK_VERSION}/modules-Q16/coders/"
  1639. export MAGICK_CODER_FILTER_PATH="\${SYSPREFIX}/lib/ImageMagick-${IMAGEMAGICK_VERSION}/modules-Q16/filters/"
  1640. # Create install-location-dependent config files for Pango and GDK image loaders
  1641. # We have to do this every time because its possible that SYSPREFIX has changed
  1642. [ -e "\$USER_CONFIG_DIR" ] || mkdir -p "\$USER_CONFIG_DIR"
  1643. #sed "s?@ROOTDIR@/modules?\${SYSPREFIX}/lib/pango/1.6.0/modules?" < \$ETC_DIR/pango/pango.modules.in > \$USER_CONFIG_DIR/pango/pango.modules
  1644. if [ -e \${SYSPREFIX}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache.in ]; then
  1645. export GDK_PIXBUF_MODULE_FILE="\${USER_CONFIG_DIR}/gdk-pixbuf.loaders"
  1646. sed "s?@ROOTDIR@/loaders?\${SYSPREFIX}/lib/gdk-pixbuf-2.0/2.10.0/loaders?" < \${SYSPREFIX}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache.in > \$GDK_PIXBUF_MODULE_FILE
  1647. fi
  1648. \${SYSPREFIX}/bin/synfigstudio "\$@"
  1649. EOF
  1650. chmod +x ${PREFIX}/synfigstudio
  1651. }
  1652. mkpreloader()
  1653. {
  1654. mkdir -p ${SRCPREFIX}/preloader
  1655. pushd ${SRCPREFIX}/preloader >/dev/null
  1656. cat > synfig-pkg-preloader.c <<EOF
  1657. #define _GNU_SOURCE
  1658. #include <stdio.h>
  1659. #include <string.h>
  1660. #include <dlfcn.h>
  1661. static int (*fopen_orig)(const char * pathname, int flags) = NULL;
  1662. int open(const char * pathname, int flags) {
  1663. //printf("Blocking");
  1664. printf("Testing %s read\n", pathname);
  1665. if (fopen_orig == NULL)
  1666. fopen_orig = dlsym(RTLD_NEXT, "open");
  1667. if (strstr(pathname, "/home/zelgadis/synfig-buildroot/linux64/sys") != NULL) {
  1668. printf("Blocking %s read\n", pathname);
  1669. return -1;
  1670. }
  1671. return fopen_orig(pathname, flags);
  1672. }
  1673. FILE *fopen(const char *path, const char *mode) {
  1674. //printf("In our own fopen, opening %s\n", path);
  1675. FILE *(*original_fopen)(const char*, const char*);
  1676. original_fopen = dlsym(RTLD_NEXT, "fopen");
  1677. return (*original_fopen)(path, mode);
  1678. }
  1679. EOF
  1680. gcc -shared -fPIC -ldl -O2 -o synfig-pkg-preloader.so synfig-pkg-preloader.c
  1681. cp synfig-pkg-preloader.so ${PREFIX}/lib
  1682. }
  1683. mkpackage()
  1684. {
  1685. [ ! -e ${DISTPREFIX} ] || rm -rf ${DISTPREFIX}
  1686. mkdir -p ${DISTPREFIX}
  1687. cp -r ${PREFIX}/etc ${DISTPREFIX}
  1688. cp -r ${PREFIX}/lib ${DISTPREFIX}
  1689. cp -r ${PREFIX}/lib.extra ${DISTPREFIX}
  1690. cp -r ${PREFIX}/share ${DISTPREFIX}
  1691. cp -r ${PREFIX}/synfig ${DISTPREFIX}
  1692. cp -r ${PREFIX}/synfigstudio ${DISTPREFIX}
  1693. mkdir -p ${DISTPREFIX}/bin
  1694. BINARIES="\
  1695. identify
  1696. synfig
  1697. synfigstudio"
  1698. for FILE in $BINARIES; do
  1699. cp -r ${PREFIX}/bin/${FILE} ${DISTPREFIX}/bin/
  1700. done
  1701. #cleaning devel stuff
  1702. rm -f ${DISTPREFIX}/lib/*.la
  1703. rm -f ${DISTPREFIX}/lib/*.a
  1704. rm -f ${DISTPREFIX}/lib/cairo/*.la
  1705. rm -rf ${DISTPREFIX}/include
  1706. rm -rf ${DISTPREFIX}/lib/gdkmm-2.4
  1707. rm -rf ${DISTPREFIX}/lib/libxml++-2.6
  1708. rm -rf ${DISTPREFIX}/lib/giomm-2.4
  1709. rm -rf ${DISTPREFIX}/lib/glibmm-2.4
  1710. rm -rf ${DISTPREFIX}/lib/pangomm-1.4
  1711. rm -rf ${DISTPREFIX}/lib/gtkmm-2.4
  1712. rm -rf ${DISTPREFIX}/lib/pkgconfig
  1713. rm -rf ${DISTPREFIX}/lib/sigc++-2.0
  1714. rm -rf ${DISTPREFIX}/share/applications/gtk3-*
  1715. rm -rf ${DISTPREFIX}/share/doc
  1716. rm -rf ${DISTPREFIX}/share/devhelp
  1717. rm -rf ${DISTPREFIX}/share/gtk-doc
  1718. rm -rf ${DISTPREFIX}/share/gtkmm-2.4
  1719. rm -rf ${DISTPREFIX}/share/aclocal
  1720. rm -rf ${DISTPREFIX}/share/ImageMagick-6.4.0
  1721. rm -rf ${DISTPREFIX}/share/man
  1722. mkpackage_tar
  1723. mkpackage_rpm
  1724. mkpackage_deb
  1725. }
  1726. mkpackage_tar()
  1727. {
  1728. #== tar.bz2 ==
  1729. rm -f ${WORKSPACE}/synfigstudio-${VERSION}-${REVISION}.$BREED.${RPM_ARCH}.tar.bz2 || true
  1730. pushd ${DISTPREFIX}/..
  1731. [ ! -d synfigstudio-${VERSION}-${REVISION}.${RPM_ARCH} ] || rm -rf synfigstudio-${VERSION}-${REVISION}${RPM_ARCH}
  1732. cp -rf dist synfigstudio-${VERSION}-${REVISION}.${RPM_ARCH}
  1733. tar cjf ${WORKSPACE}/synfigstudio-${VERSION}-${REVISION}.${RPM_ARCH}.tar.bz2 synfigstudio-${VERSION}-${REVISION}.${RPM_ARCH}
  1734. rm -rf synfigstudio-${VERSION}-${REVISION}.${RPM_ARCH}
  1735. popd
  1736. }
  1737. mkpackage_rpm()
  1738. {
  1739. #== rpm ==
  1740. cat > ${WORKSPACE}/linux$ARCH$SUFFIX/synfigstudio.spec << EOF
  1741. %define __spec_install_post /bin/true
  1742. Name: synfigstudio
  1743. Version: ${VERSION}
  1744. Release: ${REVISION}
  1745. Summary: Film-Quality 2D Vector Animation package
  1746. Group: Applications/Graphics
  1747. License: GPL
  1748. URL: http://www.synfig.org/
  1749. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
  1750. Obsoletes: synfig ETL
  1751. AutoReqProv: no
  1752. %description
  1753. Synfig Animation Studio is a powerful, industrial-strength vector-based
  1754. 2D animation software, designed from the ground-up for producing
  1755. feature-film quality animation with fewer people and resources.
  1756. It eliminates the need for tweening, preventing the need to hand-draw
  1757. each frame. Synfig features spatial and temporal resolution independence
  1758. (sharp and smooth at any resolution or framerate), high dynamic range
  1759. images, and a flexible plugin system.
  1760. %prep
  1761. %build
  1762. %install
  1763. rm -rf \$RPM_BUILD_ROOT
  1764. mkdir -p \$RPM_BUILD_ROOT/opt/synfig
  1765. cp -r ${DISTPREFIX}/* \$RPM_BUILD_ROOT/opt/synfig
  1766. mkdir -p \$RPM_BUILD_ROOT/usr/share
  1767. mkdir -p \$RPM_BUILD_ROOT/usr/share/icons
  1768. mv \$RPM_BUILD_ROOT/opt/synfig/share/applications \$RPM_BUILD_ROOT/usr/share
  1769. mv \$RPM_BUILD_ROOT/opt/synfig/share/appdata \$RPM_BUILD_ROOT/usr/share
  1770. mv \$RPM_BUILD_ROOT/opt/synfig/share/icons/hicolor \$RPM_BUILD_ROOT/usr/share/icons
  1771. mv \$RPM_BUILD_ROOT/opt/synfig/share/mime \$RPM_BUILD_ROOT/usr/share
  1772. mv \$RPM_BUILD_ROOT/opt/synfig/share/mime-info \$RPM_BUILD_ROOT/usr/share
  1773. mkdir -p \$RPM_BUILD_ROOT/usr/share/pixmaps
  1774. ln -sf /opt/synfig/share/pixmaps/sif_icon.png \$RPM_BUILD_ROOT/usr/share/pixmaps/sif_icon.png
  1775. ln -sf /opt/synfig/share/pixmaps/synfig_icon.png \$RPM_BUILD_ROOT/usr/share/pixmaps/synfig_icon.png
  1776. mkdir -p \$RPM_BUILD_ROOT/usr/bin
  1777. cp \$RPM_BUILD_ROOT/opt/synfig/synfig \$RPM_BUILD_ROOT/usr/bin/
  1778. cp \$RPM_BUILD_ROOT/opt/synfig/synfigstudio \$RPM_BUILD_ROOT/usr/bin/
  1779. sed -i 's|^SYSPREFIX=.*|SYSPREFIX=/opt/synfig|' \$RPM_BUILD_ROOT/usr/bin/synfig
  1780. sed -i 's|^SYSPREFIX=.*|SYSPREFIX=/opt/synfig|' \$RPM_BUILD_ROOT/usr/bin/synfigstudio
  1781. %clean
  1782. rm -rf \$RPM_BUILD_ROOT
  1783. %post
  1784. if [ -x /usr/bin/update-mime-database ]; then
  1785. update-mime-database /usr/share/mime
  1786. fi
  1787. if [ -x /usr/bin/update-desktop-database ]; then
  1788. update-desktop-database
  1789. fi
  1790. %postun
  1791. if [ -x /usr/bin/update-mime-database ]; then
  1792. update-mime-database /usr/share/mime
  1793. fi
  1794. if [ -x /usr/bin/update-desktop-database ]; then
  1795. update-desktop-database
  1796. fi
  1797. %files
  1798. %defattr(-,root,root,-)
  1799. /opt/synfig/
  1800. /usr/share/*
  1801. /usr/bin/*
  1802. %changelog
  1803. * Sat Mar 21 2009 Konstantin Dmitriev <ksee.zelgadis@gmail.com> - 0.61.09-2354.morevnapackage.1
  1804. - Update to SVN2354
  1805. - Include ImageMagick-c++
  1806. * Wed Jan 14 2009 Konstantin Dmitriev <ksee.zelgadis@gmail.com> - 0.61.09-2316.morevnapackage.1
  1807. - First release
  1808. EOF
  1809. run_native linux${ARCH} rpmbuild -bb --target ${RPM_ARCH} ${WORKSPACE}/linux$ARCH$SUFFIX/synfigstudio.spec
  1810. cp $HOME/rpmbuild/RPMS/${RPM_ARCH}/synfigstudio-${VERSION}-${REVISION}.${RPM_ARCH}.rpm ${WORKSPACE}
  1811. }
  1812. mkpackage_deb()
  1813. {
  1814. rm -rf ${WORKSPACE}/linux$ARCH$SUFFIX/dist-deb || true
  1815. mkdir ${WORKSPACE}/linux$ARCH$SUFFIX/dist-deb
  1816. cd ${WORKSPACE}/linux$ARCH$SUFFIX/dist-deb
  1817. mkdir synfigstudio-${VERSION}
  1818. DEB_DIST=${WORKSPACE}/linux$ARCH$SUFFIX/dist-deb/synfigstudio-${VERSION}
  1819. mkdir -p ${DEB_DIST}/opt/synfig
  1820. cp -r ${DISTPREFIX}/* ${DEB_DIST}/opt/synfig
  1821. mkdir -p ${DEB_DIST}/usr/share
  1822. mkdir -p ${DEB_DIST}/usr/share/icons
  1823. mv ${DEB_DIST}/opt/synfig/share/applications ${DEB_DIST}/usr/share
  1824. mv ${DEB_DIST}/opt/synfig/share/appdata ${DEB_DIST}/usr/share
  1825. mv ${DEB_DIST}/opt/synfig/share/icons/hicolor ${DEB_DIST}/usr/share/icons
  1826. mv ${DEB_DIST}/opt/synfig/share/mime ${DEB_DIST}/usr/share
  1827. mv ${DEB_DIST}/opt/synfig/share/mime-info ${DEB_DIST}/usr/share
  1828. mkdir -p ${DEB_DIST}/usr/share/pixmaps
  1829. ln -sf /opt/synfig/share/pixmaps/sif_icon.png ${DEB_DIST}/usr/share/pixmaps/sif_icon.png
  1830. ln -sf /opt/synfig/share/pixmaps/synfig_icon.png ${DEB_DIST}/usr/share/pixmaps/synfig_icon.png
  1831. mkdir -p ${DEB_DIST}/usr/bin
  1832. cp ${DEB_DIST}/opt/synfig/synfig ${DEB_DIST}/usr/bin/
  1833. cp ${DEB_DIST}/opt/synfig/synfigstudio ${DEB_DIST}/usr/bin/
  1834. sed -i 's|^SYSPREFIX=.*|SYSPREFIX=/opt/synfig|' ${DEB_DIST}/usr/bin/synfig
  1835. sed -i 's|^SYSPREFIX=.*|SYSPREFIX=/opt/synfig|' ${DEB_DIST}/usr/bin/synfigstudio
  1836. mkdir -p ${DEB_DIST}/debian
  1837. echo "9" > ${DEB_DIST}/debian/compat
  1838. cat > ${DEB_DIST}/debian/control << EOF
  1839. Source: synfigstudio
  1840. Section: graphics
  1841. Priority: extra
  1842. Maintainer: Konstantin Dmitiev <root@synfig.org>
  1843. Package: synfigstudio
  1844. Provides: synfig
  1845. Recommends: synfig-examples
  1846. Architecture: any
  1847. Description: Film-Quality 2D Vector Animation package
  1848. Synfig Animation Studio is a powerful, industrial-strength vector-based
  1849. 2D animation software, designed from the ground-up for producing
  1850. feature-film quality animation with fewer people and resources.
  1851. It eliminates the need for tweening, preventing the need to hand-draw
  1852. each frame. Synfig features spatial and temporal resolution independence
  1853. (sharp and smooth at any resolution or framerate), high dynamic range
  1854. images, and a flexible plugin system.
  1855. EOF
  1856. cat > ${DEB_DIST}/debian/copyright << EOF
  1857. Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
  1858. Upstream-Name: synfig
  1859. Source: http://sourceforge.net/projects/synfig/files/synfigstudio/
  1860. Files: *
  1861. Copyright: 2002-2005 Adrian Bentley
  1862. 2009 Carlos A. Sosa Navarro
  1863. 2008-2013 Carlos López
  1864. 2010-2011 Carlos López González
  1865. 2007-2008 Chris Moore
  1866. 2008 David Roden
  1867. 2008 Gerald Young
  1868. 2008-2009 Gerco Ballintijn
  1869. 2013 Ivan Mahonin
  1870. 2009,2012-2013 Konstantin Dmitriev <ksee.zelgadis@gmail.com>
  1871. 2009-2011 Nikita Kitaev
  1872. 2007-2008 Paul Wise
  1873. 2001-2014 Robert B. Quattlebaum Jr.
  1874. 2006 Yue Shi Lai
  1875. License: GPL-2+
  1876. Comment: see list of all contributors in file README
  1877. EOF
  1878. cat > ${DEB_DIST}/debian/changelog << EOF
  1879. synfigstudio (${VERSION}-${REVISION}) unstable; urgency=medium
  1880. * Custom Debian package form synfig.org.
  1881. -- Konstantin Dmitriev <ksee.zelgadis@gmail.com> Sun, 18 Jan 2015 16:22:23 +1100
  1882. EOF
  1883. cat > ${DEB_DIST}/debian/postinst << EOF
  1884. #!/bin/bash
  1885. if [ -x /usr/bin/update-mime-database ]; then
  1886. update-mime-database /usr/share/mime
  1887. fi
  1888. if [ -x /usr/bin/update-desktop-database ]; then
  1889. update-desktop-database
  1890. fi
  1891. #chmod a+rX -R /opt/synfig
  1892. #chmod a+rX /opt
  1893. EOF
  1894. chmod a+x ${DEB_DIST}/debian/postinst
  1895. cat > ${DEB_DIST}/debian/postrm << EOF
  1896. #!/bin/bash
  1897. if [ -x /usr/bin/update-mime-database ]; then
  1898. update-mime-database /usr/share/mime
  1899. fi
  1900. if [ -x /usr/bin/update-desktop-database ]; then
  1901. update-desktop-database
  1902. fi
  1903. EOF
  1904. chmod a+x ${DEB_DIST}/debian/postrm
  1905. cat > ${DEB_DIST}/debian/rules << EOF
  1906. #!/usr/bin/make -f
  1907. # debian/rules for alien
  1908. PACKAGE=\$(shell dh_listpackages)
  1909. build:
  1910. dh_testdir
  1911. clean:
  1912. dh_testdir
  1913. dh_testroot
  1914. dh_clean -d
  1915. binary-indep: build
  1916. binary-arch: build
  1917. dh_testdir
  1918. dh_testroot
  1919. dh_prep
  1920. dh_installdirs
  1921. dh_installdocs
  1922. dh_installchangelogs
  1923. # Copy the packages's files.
  1924. find . -maxdepth 1 -mindepth 1 -not -name debian -print0 | \
  1925. xargs -0 -r -i cp -a {} debian/\$(PACKAGE)
  1926. #
  1927. # If you need to move files around in debian/\$(PACKAGE) or do some
  1928. # binary patching, do it here
  1929. #
  1930. # This has been known to break on some wacky binaries.
  1931. # dh_strip
  1932. dh_compress
  1933. # dh_fixperms
  1934. dh_makeshlibs
  1935. dh_installdeb
  1936. -dh_shlibdeps
  1937. dh_gencontrol
  1938. dh_md5sums
  1939. # dh_builddeb
  1940. binary: binary-indep binary-arch
  1941. .PHONY: build clean binary-indep binary-arch binary
  1942. EOF
  1943. #run_native fakeroot alien -g -k --scripts synfigstudio-${VERSION}-${REVISION}.${RPM_ARCH}.rpm
  1944. cd synfigstudio-${VERSION}
  1945. run_native dpkg-buildpackage -rfakeroot -a${SYS_ARCH} -d || true
  1946. # We have to use "dpkg-deb" command from chroot,
  1947. # because recent dpkg-deb seems broken on Fedora
  1948. chmod -R a+rX debian/synfigstudio
  1949. run_native /usr/bin/fakeroot dpkg-deb -Zgzip -b debian/synfigstudio
  1950. #run_native fakeroot dpkg-deb --build synfigstudio
  1951. if [ ! -e debian/synfigstudio.deb ]; then
  1952. echo "Failed to generate deb package"
  1953. exit 1
  1954. fi
  1955. mv debian/synfigstudio.deb ../synfigstudio_${VERSION}-${REVISION}_${SYS_ARCH}.deb
  1956. mv ../synfigstudio_${VERSION}-${REVISION}_${SYS_ARCH}.deb ${WORKSPACE}
  1957. rm -rf synfigstudio-${VERSION}.orig
  1958. rm -rf synfigstudio_${VERSION}.orig.tar.gz
  1959. rm -rf synfigstudio_${VERSION}-${REVISION}_${SYS_ARCH}.changes
  1960. rm -rf synfigstudio_${VERSION}-${REVISION}.diff.gz
  1961. rm -rf synfigstudio_${VERSION}-${REVISION}.dsc
  1962. rm -rf synfigstudio-${VERSION}
  1963. rm -rf ${WORKSPACE}/linux$ARCH$SUFFIX/dist-deb
  1964. }
  1965. mkall()
  1966. {
  1967. mkprep
  1968. set_environment
  1969. # build tools
  1970. mkm4
  1971. mkautoconf
  1972. mkautomake
  1973. mklibtool
  1974. mkintltool
  1975. #mkgettext
  1976. # system libraries
  1977. mklibjpeg
  1978. mklibtiff
  1979. mkglib
  1980. mkharfbuzz
  1981. mkfontconfig
  1982. mkgobjectintrospection
  1983. mkatk
  1984. mkatspi2atk
  1985. mkpixman
  1986. mkcairo # bundled library
  1987. mkpango
  1988. mkgdkpixbuf
  1989. mkgtk
  1990. mkadwaitaicons
  1991. mkgnomethemes
  1992. mkjack
  1993. # synfig-core deps
  1994. #mkmesa
  1995. mklibsigcpp
  1996. mkglibmm
  1997. mklibxmlpp
  1998. #if [[ $OPENGL == 1 ]]; then
  1999. # mkglew
  2000. #fi
  2001. mkmlt
  2002. mkimagemagick
  2003. mkboost
  2004. mkfftw
  2005. # synfig-studio deps
  2006. mkcairomm
  2007. mkpangomm
  2008. mkgtkmm
  2009. #if [[ $OPENGL == 1 ]]; then
  2010. # mkfreeglut
  2011. # mkftgl
  2012. # mkgtkglext
  2013. # mkgtkglextmm
  2014. #fi
  2015. mketl
  2016. mksynfig
  2017. mksynfigstudio
  2018. mkconfig
  2019. mkpackage
  2020. }
  2021. do_cleanup()
  2022. {
  2023. echo "Cleaning up..."
  2024. if [ ${PREFIX} != ${DEPSPREFIX} ]; then
  2025. [ ! -e ${DEPSPREFIX} ] || mv ${DEPSPREFIX} ${DEPSPREFIX}.off
  2026. fi
  2027. [ ! -e ${SYSPREFIX} ] || mv ${SYSPREFIX} ${SYSPREFIX}.off
  2028. exit
  2029. }
  2030. trap do_cleanup INT SIGINT SIGTERM EXIT
  2031. [ ! -e ${SYSPREFIX}.off ] || mv ${SYSPREFIX}.off ${SYSPREFIX}
  2032. [ ! -e ${DEPSPREFIX}.off ] || mv ${DEPSPREFIX}.off ${DEPSPREFIX}
  2033. [ -e ${DEPSPREFIX} ] || mkdir -p ${DEPSPREFIX}
  2034. if [ -z $1 ]; then
  2035. mkall
  2036. else
  2037. echo "Executing custom user command..."
  2038. #mkprep
  2039. set_environment
  2040. $@
  2041. fi
  2042. do_cleanup