synfigstudio-cygwin-mingw-build.sh 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251
  1. #!/bin/bash
  2. #
  3. # SynfigStudio Windows package build script
  4. # Copyright (c) 2013 Konstantin Dmitriev
  5. #
  6. # This package is free software; you can redistribute it and/or
  7. # modify it under the terms of the GNU General Public License as
  8. # published by the Free Software Foundation; either version 2 of
  9. # the License, or (at your option) any later version.
  10. #
  11. # This package is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. # General Public License for more details.
  15. #
  16. #
  17. # = Usage notes =
  18. #
  19. # * Download and install Git (http://msysgit.github.io/).
  20. # * Open Git Bash and execute following commands:
  21. # ** mkdir C:\synfig-build
  22. # ** cd C:\synfig-build
  23. # ** git clone https://github.com/synfig/synfig.git
  24. # ** mkdir cygwin-dist
  25. # ** cd synfig
  26. # ** git config --global core.autocrlf input
  27. # ** exit
  28. # * Download Cygwin setup binary (http://www.cygwin.com/) and save it into C:\synfig-build\cygwin-dist\ directory.
  29. # * Run Cygwin setup and install with the default parameters.
  30. # * Download and install NSIS >=3.0 (http://nsis.sourceforge.net/). Install into C:\synfig-build\NSIS\ directory.
  31. # * (64-bit build only!) Download and install 7zip (http://downloads.sourceforge.net/sevenzip/7z920-x64.msi). Install into C:\synfig-build\7zip\ directory.
  32. # * Open Cygwin console (with administrator previlegies) and run the build script:
  33. # ** bash C:/synfig-build/synfig/autobuild/synfigstudio-cygwin-mingw-build.sh
  34. # * Installation bundle will be written to C:\synfig-build\
  35. #
  36. #
  37. # = Other notes =
  38. # * Builds from current repository, current revision. So you should manually checkout the desired revision to build
  39. # * Executing script without arguments makes a full clean build and produces installer package
  40. # * You can pass arguments to the script to invoke particular stage.
  41. # Available stages: mkprep, mketl, mksynfig, mksynfigstudio, mkpackage
  42. # Example:
  43. # synfigstudio-cygwin-mingw-build.sh mkpackage
  44. # * You can pass a custom command to be invoked in the build environment.
  45. # Example (executes make with respect to the build environment):
  46. # synfigstudio-cygwin-mingw-build.sh make -j2
  47. #================= EDIT THOSE VARIABLES BEFORE FIRST RUN! ======================
  48. export NSIS_BINARY="C:/synfig-build/NSIS/makensis.exe"
  49. export WORKSPACE="/cygdrive/c/synfig-build"
  50. if [ -z $ARCH ]; then
  51. export ARCH="32"
  52. fi
  53. if [ -z $DEBUG ]; then
  54. export DEBUG=1
  55. fi
  56. if [ -z $THREADS ]; then
  57. export THREADS=4
  58. fi
  59. #=========================== EDIT UNTIL HERE ===================================
  60. export DISTPREFIX=$WORKSPACE/dist
  61. export SRCPREFIX=`dirname "$0"`
  62. SRCPREFIX=$(cd "$SRCPREFIX/.."; pwd)
  63. if [[ $ARCH == "32" ]]; then
  64. export TOOLCHAIN_HOST="i686-w64-mingw32"
  65. export TOOLCHAIN="mingw64-i686" # mingw64-i686 | mingw64-x86_64 | mingw
  66. export EXT_ARCH=i386
  67. export EXT_ARCH2=i686
  68. export CYGWIN_SETUP="C:/synfig-build/cygwin-dist/setup-x86.exe"
  69. export SZIP_BINARY="7z"
  70. elif [[ $ARCH == "64" ]]; then
  71. export TOOLCHAIN_HOST="x86_64-w64-mingw32"
  72. export TOOLCHAIN="mingw64-x86_64"
  73. export EXT_ARCH=x86_64
  74. export EXT_ARCH2=x86_64
  75. export CYGWIN_SETUP="C:/synfig-build/cygwin64-dist/setup-x86_64.exe"
  76. export SZIP_BINARY="C:/synfig-build/7zip/7z.exe"
  77. fi
  78. export MINGWPREFIX="/usr/${TOOLCHAIN_HOST}/sys-root/mingw"
  79. set -e
  80. if [[ $DEBUG == 1 ]]; then
  81. DEBUG='--enable-debug --enable-optimization=0'
  82. else
  83. DEBUG=''
  84. fi
  85. export VERSION=`cat ${SRCPREFIX}/synfig-core/configure.ac |egrep "AC_INIT\(\[Synfig Core\],"| sed "s|.*Core\],\[||" | sed "s|\],\[.*||"`
  86. pushd "${SRCPREFIX}" > /dev/null
  87. export REVISION=`git show --pretty=format:%ci HEAD | head -c 10 | tr -d '-'`
  88. popd > /dev/null
  89. if [ ! -e "$SZIP_BINARY" ]; then
  90. if [[ $ARCH == "64" ]]; then
  91. echo "7zip not found! Please download and install 7zip (http://downloads.sourceforge.net/sevenzip/7z920-x64.msi). Install into C:\synfig-build\7zip\ directory."
  92. exit 1
  93. fi
  94. fi
  95. if [ ! -e "$NSIS_BINARY" ]; then
  96. echo "NSIS not found! Please download and install NSIS >=3.0 (http://nsis.sourceforge.net/). Install into C:\synfig-build\NSIS\ directory."
  97. exit 1
  98. fi
  99. chmod a+x ${MINGWPREFIX}/bin/*.dll || true
  100. prepare_mingw_env()
  101. {
  102. export CBUILD=i686-pc-cygwin
  103. export CHOST=${TOOLCHAIN_HOST}
  104. export CTARGET=${TOOLCHAIN_HOST}
  105. export CC=${TOOLCHAIN_HOST}-gcc
  106. export CXX=${TOOLCHAIN_HOST}-g++
  107. export F77=${TOOLCHAIN_HOST}-gfortran
  108. export FC=${TOOLCHAIN_HOST}-gfortran
  109. export GCJ=${TOOLCHAIN_HOST}-gcj
  110. export GOC=${TOOLCHAIN_HOST}-gccgo
  111. export OBJC=${TOOLCHAIN_HOST}-gcc
  112. export OBJCXX=${TOOLCHAIN_HOST}-g++
  113. export AR=${TOOLCHAIN_HOST}-ar
  114. export OBJDUMP=${TOOLCHAIN_HOST}-objdump
  115. export RANLIB=${TOOLCHAIN_HOST}-ranlib
  116. export STRIP=${TOOLCHAIN_HOST}-strip
  117. export RC=${TOOLCHAIN_HOST}-windres
  118. export CFLAGS=' -O2 -pipe -mms-bitfields'
  119. export CXXFLAGS=" -O2 -pipe -mms-bitfields"
  120. #export CXXFLAGS=" -O2 -pipe -mms-bitfields -I${MINGWPREFIX}/include/c++ -I${MINGWPREFIX}/include/c++/${TOOLCHAIN_HOST}"
  121. export F77FLAGS=' -mms-bitfields'
  122. export FCFLAGS=' -O2 -pipe -mms-bitfields'
  123. export GCJFLAGS=' -O2 -pipe -mms-bitfields'
  124. export GOCFLAGS=' -mms-bitfields'
  125. export OBJCFLAGS=' -O2 -pipe -mms-bitfields'
  126. export OBJCXXFLAGS=' -O2 -pipe -mms-bitfields'
  127. export PKG_CONFIG=/usr/bin/pkg-config
  128. export PKG_CONFIG_PATH="${MINGWPREFIX}/lib/pkgconfig"
  129. export PKG_CONFIG_LIBDIR="${MINGWPREFIX}/lib/pkgconfig:${MINGWPREFIX}/share/pkgconfig:/usr/share/pkgconfig"
  130. export PKG_CONFIG_SYSTEM_INCLUDE_PATH=${MINGWPREFIX}/include
  131. export PKG_CONFIG_SYSTEM_LIBRARY_PATH=${MINGWPREFIX}/lib
  132. export CPPFLAGS=" -I${MINGWPREFIX}/include "
  133. export LDFLAGS=" -L${MINGWPREFIX}/lib "
  134. export LIBS=""
  135. export PATH="${MINGWPREFIX}/bin/:$PATH"
  136. alias convert="${MINGWPREFIX}/bin/convert"
  137. }
  138. mknative()
  139. {
  140. export CBUILD=""
  141. export CHOST=""
  142. export CTARGET=""
  143. export CC="gcc"
  144. export CXX="g++"
  145. export F77=""
  146. export FC=""
  147. export GCJ=""
  148. export GOC=""
  149. export OBJC=""
  150. export OBJCXX=""
  151. export AR=""
  152. export OBJDUMP=""
  153. export RANLIB=""
  154. export STRIP=""
  155. export RC=""
  156. export CFLAGS=""
  157. export CXXFLAGS=""
  158. export F77FLAGS=""
  159. export FCFLAGS=""
  160. export GCJFLAGS=""
  161. export GOCFLAGS=""
  162. export OBJCFLAGS=""
  163. export OBJCXXFLAGS=""
  164. export PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/local/lib/pkgconfig"
  165. export PKG_CONFIG_LIBDIR=""
  166. export PKG_CONFIG_SYSTEM_INCLUDE_PATH=""
  167. export PKG_CONFIG_SYSTEM_LIBRARY_PATH=""
  168. export CPPFLAGS=""
  169. export LDFLAGS=""
  170. export PATH="/usr/local/bin:/usr/bin"
  171. $@
  172. }
  173. mkpopt()
  174. {
  175. PKG_NAME=popt
  176. PKG_VERSION=1.10.3
  177. cd $WORKSPACE
  178. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.gz ] || wget http://rpm5.org/files/popt/${PKG_NAME}-${PKG_VERSION}.tar.gz
  179. [ -d ${PKG_NAME}-${PKG_VERSION} ] || tar -xzf ${PKG_NAME}-${PKG_VERSION}.tar.gz
  180. cd ${PKG_NAME}-${PKG_VERSION}
  181. ./autogen.sh --noconfigure
  182. ./configure --prefix=/usr/local --libdir=/usr/local/lib
  183. make -j$THREADS install
  184. if [[ $ARCH == "64" ]]; then
  185. mv /usr/local/lib64/* /usr/local/lib
  186. fi
  187. # remove old version of popt
  188. [ ! -e /usr/bin/cygpopt-0.dll ] || rm /usr/bin/cygpopt-0.dll
  189. }
  190. mkrpm()
  191. {
  192. PKG_NAME=rpm
  193. #PKG_VERSION=4.11.1
  194. PKG_VERSION=4.10.3.1
  195. #PKG_VERSION=4.7.0
  196. TAREXT=bz2
  197. cd $WORKSPACE
  198. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget http://rpm.org/releases/rpm-4.10.x/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  199. if [ ! -d ${PKG_NAME}-${PKG_VERSION} ]; then
  200. tar -xjf ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  201. cd ${PKG_NAME}-${PKG_VERSION}
  202. patch -p1 < $SRCPREFIX/autobuild/cygwin/${PKG_NAME}-${PKG_VERSION}.patch
  203. patch -p1 < $SRCPREFIX/autobuild/cygwin/${PKG_NAME}-${PKG_VERSION}-python-fixes.patch
  204. else
  205. cd ${PKG_NAME}-${PKG_VERSION}
  206. fi
  207. LDFLAGS=" -L/usr/local/lib" CPPFLAGS="-I/usr/include/nspr -I/usr/include/nss -I/usr/include/db4.8/ -I/usr/include/python2.7/" ./autogen.sh \
  208. --with-external-db \
  209. --without-lua \
  210. --enable-python
  211. make -j$THREADS install
  212. cd python
  213. export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
  214. export LDFLAGS=" -L/usr/local/lib"
  215. python setup.py build
  216. python setup.py install
  217. }
  218. mkpyliblzma()
  219. {
  220. PKG_NAME=pyliblzma
  221. PKG_VERSION=0.5.3
  222. TAREXT=bz2
  223. cd $WORKSPACE
  224. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget https://pypi.python.org/packages/source/p/pyliblzma/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  225. if [ ! -d ${PKG_NAME}-${PKG_VERSION} ]; then
  226. tar -xf ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  227. cd ${PKG_NAME}-${PKG_VERSION}
  228. else
  229. cd ${PKG_NAME}-${PKG_VERSION}
  230. fi
  231. export PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/local/lib/pkgconfig"
  232. python setup.py build
  233. python setup.py install
  234. }
  235. mkpycurl()
  236. {
  237. PKG_NAME=pycurl
  238. PKG_VERSION=7.19.0
  239. TAREXT=gz
  240. cd $WORKSPACE
  241. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget http://pycurl.sourceforge.net/download/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  242. if [ ! -d ${PKG_NAME}-${PKG_VERSION} ]; then
  243. tar -xzf ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  244. cd ${PKG_NAME}-${PKG_VERSION}
  245. else
  246. cd ${PKG_NAME}-${PKG_VERSION}
  247. fi
  248. python setup.py build
  249. python setup.py install
  250. }
  251. mkurlgrabber()
  252. {
  253. PKG_NAME=urlgrabber
  254. PKG_VERSION=3.9.1
  255. TAREXT=gz
  256. cd $WORKSPACE
  257. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget http://urlgrabber.baseurl.org/download/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  258. if [ ! -d ${PKG_NAME}-${PKG_VERSION} ]; then
  259. tar -xzf ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  260. cd ${PKG_NAME}-${PKG_VERSION}
  261. else
  262. cd ${PKG_NAME}-${PKG_VERSION}
  263. fi
  264. python setup.py build
  265. python setup.py install
  266. }
  267. mkyum-metadata-parser()
  268. {
  269. PKG_NAME=yum-metadata-parser
  270. PKG_VERSION=1.1.4
  271. TAREXT=gz
  272. cd $WORKSPACE
  273. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget http://yum.baseurl.org/download/yum-metadata-parser/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  274. if [ ! -d ${PKG_NAME}-${PKG_VERSION} ]; then
  275. tar -xzf ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  276. cd ${PKG_NAME}-${PKG_VERSION}
  277. else
  278. cd ${PKG_NAME}-${PKG_VERSION}
  279. fi
  280. python setup.py build
  281. python setup.py install
  282. }
  283. mkyum()
  284. {
  285. PKG_NAME=yum
  286. PKG_VERSION=3.4.3
  287. TAREXT=gz
  288. cd $WORKSPACE
  289. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget http://yum.baseurl.org/download/3.4/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  290. if [ ! -d ${PKG_NAME}-${PKG_VERSION} ]; then
  291. tar -xzf ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  292. cd ${PKG_NAME}-${PKG_VERSION}
  293. else
  294. cd ${PKG_NAME}-${PKG_VERSION}
  295. fi
  296. rm INSTALL || true
  297. make install PREFIX="//" DESTDIR=""
  298. }
  299. mkyum-utils()
  300. {
  301. PKG_NAME=yum-utils
  302. PKG_VERSION=1.1.31
  303. TAREXT=gz
  304. cd $WORKSPACE
  305. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget http://yum.baseurl.org/download/yum-utils/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  306. if [ ! -d ${PKG_NAME}-${PKG_VERSION} ]; then
  307. tar -xzf ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  308. cd ${PKG_NAME}-${PKG_VERSION}
  309. else
  310. cd ${PKG_NAME}-${PKG_VERSION}
  311. fi
  312. make install || true
  313. if [ ! -e /usr/bin/yumdownloader ]; then
  314. exit 1
  315. fi
  316. }
  317. mklibcroco()
  318. {
  319. PKG_NAME=libcroco
  320. PKG_VERSION=0.6.8
  321. TAREXT=xz
  322. if ! pkg-config ${PKG_NAME}-0.6 --exact-version=${PKG_VERSION} --print-errors; then
  323. cd ${WORKSPACE}
  324. wget -c --no-check-certificate http://ftp.gnome.org/pub/gnome/sources/${PKG_NAME}/${PKG_VERSION%.*}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  325. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xf ${WORKSPACE}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  326. cd ${PKG_NAME}-${PKG_VERSION}
  327. [ ! -e config.cache ] || rm config.cache
  328. ./configure \
  329. --prefix=${MINGWPREFIX} \
  330. --exec-prefix=${MINGWPREFIX} \
  331. --bindir=${MINGWPREFIX}/bin \
  332. --sbindir=${MINGWPREFIX}/sbin \
  333. --libexecdir=${MINGWPREFIX}/lib \
  334. --datadir=${MINGWPREFIX}/share \
  335. --localstatedir=${MINGWPREFIX}/var \
  336. --sysconfdir=${MINGWPREFIX}/etc \
  337. --datarootdir=${MINGWPREFIX}/share \
  338. --docdir=/usr/share/doc/mingw-synfig -C \
  339. --build=i686-pc-cygwin --host=${TOOLCHAIN_HOST} \
  340. --disable-static --enable-shared
  341. make -j${THREADS}
  342. make install
  343. fi
  344. }
  345. mkgobjectintrospection()
  346. {
  347. #mkflex
  348. PKG_NAME=gobject-introspection
  349. PKG_VERSION=1.42.0
  350. TAREXT=xz
  351. if ! pkg-config ${PKG_NAME}-1.0 --exact-version=${PKG_VERSION} --print-errors; then
  352. cd ${WORKSPACE}
  353. wget -c --no-check-certificate http://ftp.gnome.org/pub/gnome/sources/${PKG_NAME}/${PKG_VERSION%.*}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  354. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xf ${WORKSPACE}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  355. cd ${PKG_NAME}-${PKG_VERSION}
  356. [ ! -e config.cache ] || rm config.cache
  357. CPPFLAGS="$CPPFLAGS -I/usr/include" ./configure \
  358. --prefix=${MINGWPREFIX} \
  359. --exec-prefix=${MINGWPREFIX} \
  360. --bindir=${MINGWPREFIX}/bin \
  361. --sbindir=${MINGWPREFIX}/sbin \
  362. --libexecdir=${MINGWPREFIX}/lib \
  363. --datadir=${MINGWPREFIX}/share \
  364. --localstatedir=${MINGWPREFIX}/var \
  365. --sysconfdir=${MINGWPREFIX}/etc \
  366. --datarootdir=${MINGWPREFIX}/share \
  367. --docdir=/usr/share/doc/mingw-synfig -C \
  368. --build=i686-pc-cygwin --host=${TOOLCHAIN_HOST} \
  369. --disable-static --enable-shared
  370. make -j${THREADS}
  371. make install
  372. fi
  373. }
  374. mklibrsvg()
  375. {
  376. mklibcroco
  377. mkgobjectintrospection
  378. PKG_NAME=librsvg
  379. PKG_VERSION=2.40.6
  380. TAREXT=xz
  381. if ! pkg-config ${PKG_NAME} --exact-version=${PKG_VERSION} --print-errors; then
  382. cd ${WORKSPACE}
  383. wget -c --no-check-certificate http://ftp.gnome.org/pub/gnome/sources/${PKG_NAME}/${PKG_VERSION%.*}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  384. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xf ${WORKSPACE}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  385. cd ${PKG_NAME}-${PKG_VERSION}
  386. [ ! -e config.cache ] || rm config.cache
  387. ./configure \
  388. --prefix=${MINGWPREFIX} \
  389. --exec-prefix=${MINGWPREFIX} \
  390. --bindir=${MINGWPREFIX}/bin \
  391. --sbindir=${MINGWPREFIX}/sbin \
  392. --libexecdir=${MINGWPREFIX}/lib \
  393. --datadir=${MINGWPREFIX}/share \
  394. --localstatedir=${MINGWPREFIX}/var \
  395. --sysconfdir=${MINGWPREFIX}/etc \
  396. --datarootdir=${MINGWPREFIX}/share \
  397. --docdir=/usr/share/doc/mingw-synfig -C \
  398. --build=i686-pc-cygwin --host=${TOOLCHAIN_HOST} \
  399. --disable-static --enable-shared
  400. make -j${THREADS}
  401. make install
  402. cd ..
  403. popd
  404. fi
  405. }
  406. mkgnomethemes()
  407. {
  408. mklibrsvg
  409. PKG_NAME=gnome-themes-standard
  410. PKG_VERSION=3.15.2
  411. TAREXT=xz
  412. if ! pkg-config ${PKG_NAME} --exact-version=${PKG_VERSION} --print-errors; then
  413. cd ${WORKSPACE}
  414. wget -c --no-check-certificate http://ftp.gnome.org/pub/gnome/sources/${PKG_NAME}/${PKG_VERSION%.*}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  415. [ ! -d ${PKG_NAME}-${PKG_VERSION} ] && tar -xf ${WORKSPACE}/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  416. cd ${PKG_NAME}-${PKG_VERSION}
  417. [ ! -e config.cache ] || rm config.cache
  418. ./configure \
  419. --prefix=${MINGWPREFIX} \
  420. --exec-prefix=${MINGWPREFIX} \
  421. --bindir=${MINGWPREFIX}/bin \
  422. --sbindir=${MINGWPREFIX}/sbin \
  423. --libexecdir=${MINGWPREFIX}/lib \
  424. --datadir=${MINGWPREFIX}/share \
  425. --localstatedir=${MINGWPREFIX}/var \
  426. --sysconfdir=${MINGWPREFIX}/etc \
  427. --datarootdir=${MINGWPREFIX}/share \
  428. --docdir=/usr/share/doc/mingw-synfig -C \
  429. --build=i686-pc-cygwin --host=${TOOLCHAIN_HOST} \
  430. --disable-static --enable-shared \
  431. --disable-gtk2-engine
  432. make -j${THREADS}
  433. make install
  434. cd ..
  435. popd
  436. fi
  437. }
  438. mkimagemagick()
  439. {
  440. PKG_NAME=ImageMagick
  441. #PKG_VERSION=6.8.6-10
  442. PKG_VERSION=6.8.7-10
  443. TAREXT=xz
  444. if ! pkg-config ${PKG_NAME} --exact-version=${PKG_VERSION%-*} --print-errors; then
  445. cd $WORKSPACE
  446. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget http://www.imagemagick.org/download/releases/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  447. if [ ! -d ${PKG_NAME}-${PKG_VERSION} ]; then
  448. tar -xf ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  449. cd ${PKG_NAME}-${PKG_VERSION}
  450. else
  451. cd ${PKG_NAME}-${PKG_VERSION}
  452. fi
  453. [ ! -e config.cache ] || rm config.cache
  454. autoreconf -i --verbose # does this really required?
  455. ./configure \
  456. --prefix=${MINGWPREFIX} \
  457. --exec-prefix=${MINGWPREFIX} \
  458. --bindir=${MINGWPREFIX}/bin \
  459. --sbindir=${MINGWPREFIX}/sbin \
  460. --libexecdir=${MINGWPREFIX}/lib \
  461. --datadir=${MINGWPREFIX}/share \
  462. --localstatedir=${MINGWPREFIX}/var \
  463. --sysconfdir=${MINGWPREFIX}/etc \
  464. --datarootdir=${MINGWPREFIX}/share \
  465. --docdir=/usr/share/doc/mingw-synfig -C \
  466. --build=i686-pc-cygwin --host=${TOOLCHAIN_HOST} \
  467. --disable-static --enable-shared \
  468. --without-modules \
  469. --without-perl \
  470. --without-x \
  471. --with-threads \
  472. --with-magick_plus_plus
  473. make -j${THREADS}
  474. make install
  475. fi
  476. }
  477. mklibogg()
  478. {
  479. PKG_NAME=libogg
  480. PKG_VERSION=1.3.1
  481. TAREXT=gz
  482. if ! pkg-config ogg --exact-version=${PKG_VERSION} --print-errors; then
  483. cd $WORKSPACE
  484. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget http://downloads.xiph.org/releases/ogg/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  485. if [ ! -d ${PKG_NAME}-${PKG_VERSION} ]; then
  486. tar -xzf ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  487. fi
  488. cd ${PKG_NAME}-${PKG_VERSION}
  489. [ ! -e config.cache ] || rm config.cache
  490. ./configure \
  491. --prefix=${MINGWPREFIX} \
  492. --exec-prefix=${MINGWPREFIX} \
  493. --bindir=${MINGWPREFIX}/bin \
  494. --sbindir=${MINGWPREFIX}/sbin \
  495. --libexecdir=${MINGWPREFIX}/lib \
  496. --datadir=${MINGWPREFIX}/share \
  497. --localstatedir=${MINGWPREFIX}/var \
  498. --sysconfdir=${MINGWPREFIX}/etc \
  499. --datarootdir=${MINGWPREFIX}/share \
  500. --docdir=/usr/share/doc/mingw-synfig -C \
  501. --build=i686-pc-cygwin --host=${TOOLCHAIN_HOST}
  502. make all
  503. make install
  504. fi
  505. }
  506. mklibvorbis()
  507. {
  508. mklibogg
  509. PKG_NAME=libvorbis
  510. PKG_VERSION=1.3.4
  511. TAREXT=gz
  512. if ! pkg-config vorbis --exact-version=${PKG_VERSION} --print-errors; then
  513. cd $WORKSPACE
  514. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget http://downloads.xiph.org/releases/vorbis/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  515. if [ ! -d ${PKG_NAME}-${PKG_VERSION} ]; then
  516. tar -xzf ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  517. fi
  518. cd ${PKG_NAME}-${PKG_VERSION}
  519. [ ! -e config.cache ] || rm config.cache
  520. ./configure \
  521. --prefix=${MINGWPREFIX} \
  522. --exec-prefix=${MINGWPREFIX} \
  523. --bindir=${MINGWPREFIX}/bin \
  524. --sbindir=${MINGWPREFIX}/sbin \
  525. --libexecdir=${MINGWPREFIX}/lib \
  526. --datadir=${MINGWPREFIX}/share \
  527. --localstatedir=${MINGWPREFIX}/var \
  528. --sysconfdir=${MINGWPREFIX}/etc \
  529. --datarootdir=${MINGWPREFIX}/share \
  530. --docdir=/usr/share/doc/mingw-synfig -C \
  531. --build=i686-pc-cygwin --host=${TOOLCHAIN_HOST}
  532. make all
  533. make install
  534. fi
  535. }
  536. mklibsamplerate()
  537. {
  538. PKG_NAME=libsamplerate
  539. PKG_VERSION=0.1.8
  540. TAREXT=gz
  541. if ! pkg-config samplerate --exact-version=${PKG_VERSION} --print-errors; then
  542. cd $WORKSPACE
  543. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget http://www.mega-nerd.com/SRC/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  544. if [ ! -d ${PKG_NAME}-${PKG_VERSION} ]; then
  545. tar -xzf ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  546. fi
  547. cd ${PKG_NAME}-${PKG_VERSION}
  548. [ ! -e config.cache ] || rm config.cache
  549. ./configure \
  550. --prefix=${MINGWPREFIX} \
  551. --exec-prefix=${MINGWPREFIX} \
  552. --bindir=${MINGWPREFIX}/bin \
  553. --sbindir=${MINGWPREFIX}/sbin \
  554. --libexecdir=${MINGWPREFIX}/lib \
  555. --datadir=${MINGWPREFIX}/share \
  556. --localstatedir=${MINGWPREFIX}/var \
  557. --sysconfdir=${MINGWPREFIX}/etc \
  558. --datarootdir=${MINGWPREFIX}/share \
  559. --docdir=/usr/share/doc/mingw-synfig -C \
  560. --build=i686-pc-cygwin --host=${TOOLCHAIN_HOST}
  561. make all
  562. make install
  563. fi
  564. }
  565. mksox()
  566. {
  567. PKG_NAME=sox
  568. PKG_VERSION=14.4.1
  569. TAREXT=gz
  570. if ! pkg-config ${PKG_NAME} --exact-version=${PKG_VERSION} --print-errors; then
  571. cd $WORKSPACE
  572. [ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget http://download.tuxfamily.org/synfig/packages/sources/base/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  573. if [ ! -d ${PKG_NAME}-${PKG_VERSION} ]; then
  574. tar -xzf ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  575. fi
  576. cd ${PKG_NAME}-${PKG_VERSION}
  577. [ ! -e config.cache ] || rm config.cache
  578. ./configure \
  579. --prefix=${MINGWPREFIX} \
  580. --exec-prefix=${MINGWPREFIX} \
  581. --bindir=${MINGWPREFIX}/bin \
  582. --sbindir=${MINGWPREFIX}/sbin \
  583. --libexecdir=${MINGWPREFIX}/lib \
  584. --datadir=${MINGWPREFIX}/share \
  585. --localstatedir=${MINGWPREFIX}/var \
  586. --sysconfdir=${MINGWPREFIX}/etc \
  587. --datarootdir=${MINGWPREFIX}/share \
  588. --docdir=/usr/share/doc/mingw-synfig -C \
  589. --build=i686-pc-cygwin --host=${TOOLCHAIN_HOST}
  590. make all
  591. make install
  592. fi
  593. }
  594. mkmlt()
  595. {
  596. PKG_NAME=mlt
  597. PKG_VERSION=0.9.6
  598. TAREXT=gz
  599. if ! pkg-config ${PKG_NAME}\+\+ --exact-version=${PKG_VERSION} --print-errors; then
  600. cd $WORKSPACE
  601. #[ -e ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT} ] || wget http://download.tuxfamily.org/synfig/packages/sources/base/${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  602. #if [ ! -d ${PKG_NAME}-${PKG_VERSION} ]; then
  603. # tar -xzf ${PKG_NAME}-${PKG_VERSION}.tar.${TAREXT}
  604. #fi
  605. #cd ${PKG_NAME}-${PKG_VERSION}
  606. if [ ! -d ${PKG_NAME} ]; then
  607. git clone https://github.com/morevnaproject/mlt
  608. fi
  609. cd mlt
  610. git reset --hard
  611. git checkout master
  612. git reset --hard
  613. git pull
  614. git clean -f -d
  615. [ ! -e config.cache ] || rm config.cache
  616. #autoreconf -i --verbose # does this really required?
  617. rm -rf ${MINGWPREFIX}/lib/libmlt* || true
  618. rm -rf ${MINGWPREFIX}/bin/libmlt* || true
  619. ./configure \
  620. --prefix=${MINGWPREFIX} \
  621. --exec-prefix=${MINGWPREFIX} \
  622. --bindir=${MINGWPREFIX}/bin \
  623. --sbindir=${MINGWPREFIX}/sbin \
  624. --libexecdir=${MINGWPREFIX}/lib \
  625. --datadir=${MINGWPREFIX}/share \
  626. --localstatedir=${MINGWPREFIX}/var \
  627. --sysconfdir=${MINGWPREFIX}/etc \
  628. --datarootdir=${MINGWPREFIX}/share \
  629. --docdir=/usr/share/doc/mingw-synfig -C \
  630. --build=i686-pc-cygwin --host=${TOOLCHAIN_HOST} \
  631. --avformat-shared=${MINGWPREFIX}/ \
  632. --enable-gpl --disable-decklink \
  633. --target-os=MinGW --target-arch=$EXT_ARCH \
  634. #$DEBUG
  635. if [ $ARCH == "64" ]; then
  636. touch src/modules/disable-motion_est
  637. touch src/modules/disable-xine
  638. fi
  639. touch src/modules/disable-gtk2
  640. make all
  641. make install
  642. mv ${MINGWPREFIX}/melt.exe ${MINGWPREFIX}/bin
  643. mv ${MINGWPREFIX}/libmlt*.dll ${MINGWPREFIX}/bin
  644. mkdir -p ${MINGWPREFIX}/bin/lib || true
  645. mkdir -p ${MINGWPREFIX}/bin/share || true
  646. cp -rf ${MINGWPREFIX}/lib/mlt ${MINGWPREFIX}/bin/lib/
  647. cp -rf ${MINGWPREFIX}/share/mlt ${MINGWPREFIX}/bin/share/
  648. fi
  649. }
  650. #mktoolchain()
  651. #{
  652. # cd ${WORKSPACE}
  653. # if [ ! -e mingw${ARCH}/done ]; then
  654. # [ ! -e ${WORKSPACE}/mingw32 ] || rm -rf ${WORKSPACE}/mingw32
  655. # TOOLCHAIN_ARCHIVE=${EXT_ARCH2}-4.9.2-release-posix-sjlj-rt_v3-rev1.7z
  656. # [ -e ${TOOLCHAIN_ARCHIVE} ] || wget http://downloads.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/4.9.2/threads-posix/sjlj/${TOOLCHAIN_ARCHIVE}
  657. # $SZIP_BINARY x ${TOOLCHAIN_ARCHIVE}
  658. # mkdir -p ${MINGWPREFIX} | true
  659. # mv mingw32/${TOOLCHAIN_HOST}/* ${MINGWPREFIX}
  660. # cp ${MINGWPREFIX}/lib/*.dll ${MINGWPREFIX}/bin
  661. # touch mingw${ARCH}/done
  662. # fi
  663. #}
  664. mkffmpeg()
  665. {
  666. export FFMPEG_VERSION=2.5.2
  667. if ! pkg-config libswscale --exact-version=${FFMPEG_VERSION} --print-errors; then
  668. pushd $WORKSPACE
  669. [ -e ffmpeg-${FFMPEG_VERSION}-win${ARCH}-dev.7z ] || wget http://ffmpeg.zeranoe.com/builds/win${ARCH}/dev/ffmpeg-${FFMPEG_VERSION}-win${ARCH}-dev.7z
  670. [ -e ffmpeg-${FFMPEG_VERSION}-win${ARCH}-shared.7z ] || wget http://ffmpeg.zeranoe.com/builds/win${ARCH}/shared/ffmpeg-${FFMPEG_VERSION}-win${ARCH}-shared.7z
  671. [ ! -d ffmpeg ] || rm -rf ffmpeg
  672. mkdir -p ffmpeg
  673. cd ffmpeg
  674. $SZIP_BINARY x ../ffmpeg-${FFMPEG_VERSION}-win${ARCH}-dev.7z
  675. cp -rf ffmpeg-${FFMPEG_VERSION}-win${ARCH}-dev/include/* ${MINGWPREFIX}/include/
  676. cp -rf ffmpeg-${FFMPEG_VERSION}-win${ARCH}-dev/lib/* ${MINGWPREFIX}/lib/
  677. $SZIP_BINARY x ../ffmpeg-${FFMPEG_VERSION}-win${ARCH}-shared.7z
  678. cp -rf ffmpeg-${FFMPEG_VERSION}-win${ARCH}-shared/bin/ffmpeg.exe ${MINGWPREFIX}/bin
  679. cp -rf ffmpeg-${FFMPEG_VERSION}-win${ARCH}-shared/bin/*.dll ${MINGWPREFIX}/bin
  680. mkdir -p ${MINGWPREFIX}/share/ffmpeg/presets/ || true
  681. cp -rf ffmpeg-${FFMPEG_VERSION}-win${ARCH}-shared/presets/* ${MINGWPREFIX}/share/ffmpeg/presets/
  682. mkdir -p ${MINGWPREFIX}/lib/pkgconfig/ || true
  683. for PKG in avcodec avutil avformat swscale avdevice; do
  684. cat > ${MINGWPREFIX}/lib/pkgconfig/lib${PKG}.pc <<EOF
  685. prefix=${MINGWPREFIX}
  686. exec_prefix=${MINGWPREFIX}
  687. libdir=${MINGWPREFIX}/lib
  688. includedir=${MINGWPREFIX}/include
  689. Name: lib${PKG}
  690. Description: FFMpeg
  691. Version: ${FFMPEG_VERSION}
  692. Libs: -l${PKG}
  693. EOF
  694. done
  695. popd
  696. fi
  697. }
  698. fedora-mingw-install()
  699. {
  700. [ -d $WORKSPACE/mingw-rpms ] || mkdir $WORKSPACE/mingw-rpms
  701. cd $WORKSPACE/mingw-rpms
  702. # Prepare custom yum.conf
  703. cat > $WORKSPACE/mingw-rpms/yum.conf <<EOF
  704. [main]
  705. cachedir=${WORKSPACE}mingw-rpms/yum
  706. keepcache=0
  707. debuglevel=2
  708. logfile=/var/log/yum.log
  709. exactarch=1
  710. obsoletes=1
  711. plugins=1
  712. installonly_limit=3
  713. [fedora]
  714. name=Fedora \$releasever - \$basearch
  715. failovermethod=priority
  716. #mirrorlist=http://mirrors.fedoraproject.org/metalink?repo=fedora-\$releasever&arch=\$basearch
  717. baseurl=http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/21/Everything/i386/os/
  718. #baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/21/Everything/i386/os/
  719. enabled=1
  720. metadata_expire=7d
  721. [updates]
  722. name=Fedora \$releasever - \$basearch - Updates
  723. failovermethod=priority
  724. #mirrorlist=http://mirrors.fedoraproject.org/metalink?repo=updates-released-f\$releasever&arch=\$basearch
  725. baseurl=http://archives.fedoraproject.org/pub/archive/fedora/linux/updates/21/i386/
  726. #baseurl=http://download.fedoraproject.org/pub/fedora/linux/updates/21/i386/
  727. enabled=1
  728. EOF
  729. if [ -z $2 ]; then
  730. RPMROOT=/
  731. else
  732. RPMROOT=$2
  733. fi
  734. URLS=`yumdownloader --urls --resolve -c $WORKSPACE/mingw-rpms/yum.conf --releasever=20 --installroot="$WORKSPACE/mingw-rpms" $1`
  735. for URL in $URLS; do
  736. if ( echo "$URL" | egrep "^http:" > /dev/null ); then
  737. PKG=`basename $URL`
  738. if ( echo "$PKG" | egrep "^mingw" > /dev/null ); then
  739. if [ -z $3 ]; then
  740. if ! ( echo $PKG | egrep "^mingw..-headers|^mingw..-gcc|^mingw-|^mingw..-filesystem|^mingw..-binutils|^mingw..-crt|^mingw..-cpp" > /dev/null); then
  741. echo $PKG
  742. wget -c "$URL"
  743. rpm -Uhv --ignoreos --nodeps --force --root "$RPMROOT" "$PKG"
  744. fi
  745. else
  746. if ( echo $PKG | egrep "$1" > /dev/null); then
  747. echo $PKG
  748. wget -c "$URL"
  749. rpm -Uhv --ignoreos --nodeps --force --root "$RPMROOT" "$PKG"
  750. fi
  751. fi
  752. fi
  753. fi
  754. done
  755. # Ensure all dlls have executable flag, otherwise the compiled binaries won't run
  756. chmod a+x ${MINGWPREFIX}/bin/*.dll
  757. }
  758. # Install dependencies
  759. mkprep()
  760. {
  761. export PREP_VERSION=6
  762. if [[ `cat /prep-done` != "${PREP_VERSION}" ]]; then
  763. $CYGWIN_SETUP \
  764. -s http://www.mirrorservice.org/sites/sourceware.org/pub/cygwin/ \
  765. -P git \
  766. -P make \
  767. -P gcc-core \
  768. -P gcc-g++ \
  769. -P $TOOLCHAIN-gcc \
  770. -P $TOOLCHAIN-gcc-g++ \
  771. -P gdb \
  772. -P intltool \
  773. -P autoconf \
  774. -P automake \
  775. -P libtool \
  776. -P pkg-config \
  777. -P p7zip \
  778. -P ImageMagick \
  779. -P cygport \
  780. -P zlib-devel \
  781. -P libnspr-devel \
  782. -P liblzma-devel \
  783. -P libnss-devel \
  784. -P libiconv \
  785. -P libdb4.8-devel \
  786. -P libpcre-devel \
  787. -P python \
  788. -P file-devel \
  789. -P zlib-devel \
  790. -P libdb-devel \
  791. -P flex \
  792. -P bison \
  793. -P python-setuptools \
  794. -q
  795. # yum dependencies
  796. $CYGWIN_SETUP \
  797. -s http://www.mirrorservice.org/sites/sourceware.org/pub/cygwin/ \
  798. -P urlgrabber \
  799. -P rpm-devel \
  800. -P rpm-python \
  801. -P libglib2.0-devel \
  802. -P libxml2-devel \
  803. -P libsqlite3-devel \
  804. -q
  805. #-P libglib2.0-devel \ # yum req
  806. #-P libsqlite3-devel \ # yum req
  807. #-P libxml2-devel \ # yum req
  808. #-P libcurl-devel \ # pycurl req
  809. #mktoolchain
  810. #echo "Building popt..."
  811. #mknative mkpopt
  812. echo "Building pyliblzma..."
  813. mknative mkpyliblzma
  814. #echo "Building rpm..."
  815. #mknative mkrpm
  816. #mknative mkurlgrabber
  817. echo "Building yum-metadata-parser..."
  818. mknative mkyum-metadata-parser
  819. #mknative mkyum
  820. #mknative mkyum-utils
  821. install_fedora_env
  822. echo ${PREP_VERSION} > /prep-done
  823. fi
  824. }
  825. install_fedora_env()
  826. {
  827. cd $WORKSPACE
  828. wget -c http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/20/Everything/i386/os/Packages/y/yum-3.4.3-106.fc20.noarch.rpm
  829. rpm -Uhv --force --ignoreos --nodeps yum-3.4.3-106.fc20.noarch.rpm
  830. wget -c http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/20/Everything/i386/os/Packages/y/yum-utils-1.1.31-18.fc20.noarch.rpm
  831. rpm -Uhv --force --ignoreos --nodeps yum-utils-1.1.31-18.fc20.noarch.rpm
  832. #wget -c http://fedora.inode.at/fedora/linux/releases/21/Everything/i386/os/Packages/y/yum-3.4.3-153.fc21.noarch.rpm
  833. #rpm -Uhv --force --ignoreos --nodeps yum-3.4.3-153.fc21.noarch.rpm
  834. #wget -c http://fedora.inode.at/fedora/linux/releases/21/Everything/i386/os/Packages/y/yum-utils-1.1.31-24.fc21.noarch.rpm
  835. #rpm -Uhv --force --ignoreos --nodeps yum-utils-1.1.31-24.fc21.noarch.rpm
  836. #[ ! -e C:/synfig-build/mingw-rpms/tmp ] || rm -rf C:/synfig-build/mingw-rpms/tmp
  837. #mkdir -p C:/synfig-build/mingw-rpms/tmp
  838. #fedora-mingw-install mingw${ARCH}-gcc-c++ C:/synfig-build/mingw-rpms/tmp 1
  839. #cp C:/synfig-build/mingw-rpms/tmp${MINGWPREFIX}/bin/libstdc++-6.dll ${MINGWPREFIX}/bin/
  840. #fedora-mingw-install mingw${ARCH}-adwaita-icon-theme
  841. #fedora-mingw-install mingw${ARCH}-hicolor-icon-theme
  842. fedora-mingw-install mingw${ARCH}-libxml++
  843. fedora-mingw-install mingw${ARCH}-cairo
  844. fedora-mingw-install mingw${ARCH}-pango
  845. fedora-mingw-install mingw${ARCH}-boost
  846. fedora-mingw-install mingw${ARCH}-libjpeg-turbo
  847. fedora-mingw-install mingw${ARCH}-gtkmm30
  848. fedora-mingw-install mingw${ARCH}-dlfcn
  849. fedora-mingw-install mingw${ARCH}-SDL
  850. fedora-mingw-install mingw${ARCH}-fftw
  851. cp ${MINGWPREFIX}/include/SDL/* ${MINGWPREFIX}/include/
  852. # Somehow this is required too...
  853. fedora-mingw-install mingw${ARCH}-pcre
  854. # Dependencies for magick++
  855. fedora-mingw-install mingw${ARCH}-libltdl
  856. fedora-mingw-install mingw${ARCH}-libtiff
  857. }
  858. mketl()
  859. {
  860. cd $SRCPREFIX/ETL
  861. [ ! -e config.cache ] || rm config.cache
  862. autoreconf --install --force
  863. ./configure \
  864. --prefix=${MINGWPREFIX} \
  865. --exec-prefix=${MINGWPREFIX} \
  866. --bindir=${MINGWPREFIX}/bin \
  867. --sbindir=${MINGWPREFIX}/sbin \
  868. --libexecdir=${MINGWPREFIX}/lib \
  869. --datadir=${MINGWPREFIX}/share \
  870. --localstatedir=${MINGWPREFIX}/var \
  871. --sysconfdir=${MINGWPREFIX}/etc \
  872. --datarootdir=${MINGWPREFIX}/share \
  873. --docdir=/usr/share/doc/mingw-synfig -C \
  874. --build=i686-pc-cygwin --host=${TOOLCHAIN_HOST} \
  875. --enable-shared --disable-static \
  876. --with-libiconv-prefix=no --with-libintl-prefix=no \
  877. --enable-maintainer-mode $DEBUG
  878. make install
  879. }
  880. mksynfig()
  881. {
  882. cd $SRCPREFIX/synfig-core
  883. [ ! -e config.cache ] || rm config.cache
  884. ./bootstrap.sh
  885. ./configure \
  886. --prefix=${MINGWPREFIX} \
  887. --exec-prefix=${MINGWPREFIX} \
  888. --bindir=${MINGWPREFIX}/bin \
  889. --sbindir=${MINGWPREFIX}/sbin \
  890. --libexecdir=${MINGWPREFIX}/lib \
  891. --datadir=${MINGWPREFIX}/share \
  892. --localstatedir=${MINGWPREFIX}/var \
  893. --sysconfdir=${MINGWPREFIX}/etc \
  894. --datarootdir=${MINGWPREFIX}/share \
  895. --docdir=/usr/share/doc/mingw-synfig -C \
  896. --build=i686-pc-cygwin --host=${TOOLCHAIN_HOST} \
  897. --enable-shared --disable-static \
  898. --with-libiconv-prefix=no --with-libintl-prefix=no \
  899. --with-magickpp=yes --with-boost=${MINGWPREFIX} \
  900. --enable-maintainer-mode $DEBUG
  901. make -j$THREADS
  902. make install
  903. }
  904. mksynfigstudio()
  905. {
  906. cd $SRCPREFIX/synfig-studio
  907. [ ! -e config.cache ] || rm config.cache
  908. ./bootstrap.sh
  909. ./configure \
  910. --prefix=${MINGWPREFIX} \
  911. --exec-prefix=${MINGWPREFIX} \
  912. --bindir=${MINGWPREFIX}/bin \
  913. --sbindir=${MINGWPREFIX}/sbin \
  914. --libexecdir=${MINGWPREFIX}/lib \
  915. --datadir=${MINGWPREFIX}/share \
  916. --localstatedir=${MINGWPREFIX}/var \
  917. --sysconfdir=${MINGWPREFIX}/etc \
  918. --datarootdir=${MINGWPREFIX}/share \
  919. --docdir=/usr/share/doc/mingw-synfig -C \
  920. --build=i686-pc-cygwin --host=${TOOLCHAIN_HOST} \
  921. --enable-shared --disable-static \
  922. --with-libiconv-prefix=no --with-libintl-prefix=no \
  923. --enable-maintainer-mode $DEBUG
  924. make -j$THREADS
  925. make install
  926. cp -rf ${MINGWPREFIX}/share/pixmaps/synfigstudio/* ${MINGWPREFIX}/share/pixmaps
  927. rm -rf ${MINGWPREFIX}/share/pixmaps/synfigstudio
  928. mkdir -p $MINGWPREFIX/licenses
  929. cp -rf COPYING $MINGWPREFIX/licenses/synfigstudio.txt
  930. cat > ${MINGWPREFIX}/etc/gtk-3.0/gtkrc <<EOF
  931. # Enable native look
  932. gtk-theme-name = "MS-Windows"
  933. # Use small toolbar buttons
  934. gtk-toolbar-style = 0
  935. EOF
  936. }
  937. mkpackage()
  938. {
  939. cp -rf ${SRCPREFIX}/autobuild/gtk-3.0/settings.ini $MINGWPREFIX/share/gtk-3.0
  940. [ ! -d $DISTPREFIX ] || rm -rf $DISTPREFIX
  941. mkdir -p $DISTPREFIX
  942. [ -d $DISTPREFIX/bin ] || mkdir -p $DISTPREFIX/bin
  943. [ -d $DISTPREFIX/licenses ] || mkdir -p $DISTPREFIX/licenses
  944. [ -d $DISTPREFIX/lib ] || mkdir -p $DISTPREFIX/lib
  945. [ -d $DISTPREFIX/share ] || mkdir -p $DISTPREFIX/share
  946. cd $WORKSPACE
  947. [ -e portable-python-3.2.5.1.zip ] || wget http://download.tuxfamily.org/synfig/packages/sources/portable-python-3.2.5.1.zip
  948. [ ! -d python ] || rm -rf python
  949. unzip portable-python-3.2.5.1.zip
  950. [ ! -d $DISTPREFIX/python ] || rm -rf $DISTPREFIX/python
  951. mv python $DISTPREFIX
  952. cp -rf $SRCPREFIX/synfig-core/examples $DISTPREFIX/
  953. cp -rf $SRCPREFIX/synfig-studio/COPYING $DISTPREFIX/licenses/synfigstudio.txt
  954. #copy compiled files
  955. #cp -rf $MINGWPREFIX/bin/*.exe $DISTPREFIX/bin/
  956. #TODO: strip binaries?
  957. #cp -rf $MINGWPREFIX/bin/*.dll $DISTPREFIX/bin/
  958. [ -d ${DISTPREFIX}/bin ] || mkdir -p ${DISTPREFIX}/bin
  959. for file in \
  960. av*.dll \
  961. ffmpeg.exe \
  962. iconv.dll \
  963. libatk-\*.dll \
  964. libatkmm-1.6-1.dll \
  965. libboost_chrono\*.dll \
  966. libboost_filesystem\*.dll \
  967. libboost_program_options\*.dll \
  968. libboost_system\*.dll \
  969. libbz2\*.dll \
  970. libcairo\*.dll \
  971. libdl.dll \
  972. libexpat\*.dll \
  973. libffi\*.dll \
  974. libfftw\*.dll \
  975. libfontconfig\*.dll \
  976. libfreetype\*.dll \
  977. libgcc_s_\*.dll \
  978. libgdk\*.dll \
  979. libgettext\*.dll \
  980. libgio\*.dll \
  981. libglib\*.dll \
  982. libgmodule\*.dll \
  983. libgobject\*.dll \
  984. libgomp*.dll \
  985. libgthread\*.dll \
  986. libgtk\*.dll \
  987. libharfbuzz\*.dll \
  988. libiconv\*.dll \
  989. libintl\*.dll \
  990. libjasper\*.dll \
  991. libjpeg\*.dll \
  992. libltdl*.dll \
  993. liblzma\*.dll \
  994. libMagick*.dll \
  995. libmlt*.dll \
  996. libogg*.dll \
  997. libpango\*.dll \
  998. libpixman\*.dll \
  999. libpng\*.dll \
  1000. libsamplerate*.dll \
  1001. libsigc\*.dll \
  1002. libsox*.dll \
  1003. libstdc++\*.dll \
  1004. libsynfig\*.dll \
  1005. libtiff\*.dll \
  1006. libturbojpeg.dll \
  1007. libvorbis*.dll \
  1008. libwinpthread*.dll \
  1009. libxml2\*.dll \
  1010. libxml++\*.dll \
  1011. libz\*.dll \
  1012. postproc*.dll \
  1013. pthread\*.dll \
  1014. SDL.dll \
  1015. swscale*.dll \
  1016. swresample*.dll \
  1017. zlib\*.dll \
  1018. convert.exe \
  1019. pango-querymodules.exe \
  1020. synfig.exe \
  1021. synfigstudio.exe \
  1022. lib \
  1023. share \
  1024. # this extra line is required!
  1025. do
  1026. cp -rf $MINGWPREFIX/bin/$file $DISTPREFIX/bin || true
  1027. done
  1028. cp -rf $MINGWPREFIX/etc $DISTPREFIX
  1029. cp -rf $MINGWPREFIX/lib/gdk-pixbuf-2.0 $DISTPREFIX/lib
  1030. cp -rf $MINGWPREFIX/lib/gtk-3.0 $DISTPREFIX/lib
  1031. cp -rf $MINGWPREFIX/lib/pango $DISTPREFIX/lib
  1032. cp -rf $MINGWPREFIX/lib/synfig $DISTPREFIX/lib
  1033. cp -rf $MINGWPREFIX/share/fontconfig $DISTPREFIX/share
  1034. cp -rf $MINGWPREFIX/share/glib-2.0 $DISTPREFIX/share
  1035. cp -rf $MINGWPREFIX/share/gtk-3.0 $DISTPREFIX/share
  1036. cp -rf $MINGWPREFIX/share/icons $DISTPREFIX/share || true
  1037. cp -rf $MINGWPREFIX/share/locale $DISTPREFIX/share
  1038. cp -rf $MINGWPREFIX/share/pixmaps $DISTPREFIX/share
  1039. if [ -d $DISTPREFIX/share/pixmaps/synfigstudio ]; then
  1040. cp -rf $DISTPREFIX/share/pixmaps/synfigstudio/* $DISTPREFIX/share/pixmaps
  1041. rm -rf $DISTPREFIX/share/pixmaps/synfigstudio
  1042. fi
  1043. cp -rf $MINGWPREFIX/share/synfig $DISTPREFIX/share
  1044. cp -rf $MINGWPREFIX/share/themes $DISTPREFIX/share
  1045. cp -rf $MINGWPREFIX/share/xml $DISTPREFIX/share
  1046. #cleanup
  1047. gen_list_nsh()
  1048. {
  1049. [ ! -e $2.nsh ] || rm $2.nsh
  1050. [ ! -e $2-uninst.nsh ] || rm $2-uninst.nsh
  1051. for line in `find $1 -print`; do
  1052. directory=`dirname $line`
  1053. line1=`echo $directory | sed "s|\./||g" | sed "s|/|\\\\\|g"`
  1054. line2=`echo $line | sed "s|\./||g" | sed "s|/|\\\\\|g"`
  1055. if [ -d $line ]; then
  1056. echo "RMDir \"\$INSTDIR\\$line2\"" >> $2-uninst.nsh
  1057. else
  1058. echo "SetOutPath \"\$INSTDIR\\$line1\"" >> $2.nsh
  1059. echo "File \"$line2\"" >> $2.nsh
  1060. echo "Delete \"\$INSTDIR\\$line2\"" >> $2-uninst.nsh
  1061. fi
  1062. done
  1063. # reverse order of uninstall commands
  1064. cp $2-uninst.nsh $2-uninst.nsh.tmp
  1065. tac $2-uninst.nsh.tmp > $2-uninst.nsh
  1066. rm $2-uninst.nsh.tmp
  1067. }
  1068. cd $DISTPREFIX
  1069. #generate file lists
  1070. gen_list_nsh bin bin
  1071. sed -i '/ffmpeg\.exe/d' bin.nsh # exclude ffmpeg from the list of binaries - it will go into separate group
  1072. gen_list_nsh etc etc
  1073. gen_list_nsh examples examples
  1074. gen_list_nsh lib/gdk-pixbuf-2.0 lib-gdk-pixbuf
  1075. gen_list_nsh lib/gtk-3.0 lib-gtk
  1076. gen_list_nsh lib/pango lib-pango
  1077. gen_list_nsh lib/synfig lib-synfig
  1078. gen_list_nsh licenses licenses
  1079. #gen_list_nsh python python # -- takes too long
  1080. gen_list_nsh share share
  1081. #make installer
  1082. cp -f $SRCPREFIX/autobuild/synfigstudio.nsi ./
  1083. sed -i "s/@VERSION@/$VERSION/g" ./synfigstudio.nsi
  1084. cp -f $SRCPREFIX/autobuild/win${ARCH}-specific.nsh ./arch-specific.nsh
  1085. "$NSIS_BINARY" -nocd -- synfigstudio.nsi
  1086. mv synfigstudio-${VERSION}.exe ../synfigstudio-${VERSION}-${REVISION}-${ARCH}bit.exe
  1087. INSTALLER_PATH=`cygpath -w "$WORKSPACE"`
  1088. echo
  1089. echo
  1090. echo
  1091. echo "Installer package generated:"
  1092. echo " ${INSTALLER_PATH}synfigstudio-${VERSION}-${REVISION}-${ARCH}bit.exe"
  1093. echo
  1094. }
  1095. mkall()
  1096. {
  1097. mkprep
  1098. mkffmpeg
  1099. prepare_mingw_env
  1100. mkimagemagick
  1101. mklibsamplerate
  1102. mksox
  1103. mklibvorbis
  1104. mkmlt
  1105. mketl
  1106. mksynfig
  1107. mksynfigstudio
  1108. mkpackage
  1109. }
  1110. if [ -z $1 ]; then
  1111. mkall
  1112. else
  1113. echo "Executing custom user command..."
  1114. prepare_mingw_env
  1115. $@
  1116. fi