diff --git a/README.md b/README.md index 47ee54b..a005d56 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ZenBuild -ZenBuild is a one-shot component-level build-system, aimed at easing the build of free software projets. +ZenBuild is a one-shot component-level build-system, aimed at easing the build of free software projects. It also aims at making cross-building seamless. Syntax @@ -48,3 +48,9 @@ Authors - Sebastien Alaiwan - Romain Bouqueau + +Contributors +------------ + +- badr-badri ( https://github.com/badr-badri ) + diff --git a/check.sh b/check.sh new file mode 100755 index 0000000..3e235b3 --- /dev/null +++ b/check.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -euo pipefail + +readonly JOBS=$(nproc) +export MAKE="make -j$JOBS" + +rm -f "/tmp/test-zenbuild/flags/x86_64-linux-gnu/all.built" +./zenbuild.sh "/tmp/test-zenbuild" all x86_64-linux-gnu + +rm -f "/tmp/test-zenbuild/flags/x86_64-w64-mingw32/all.built" +./zenbuild.sh "/tmp/test-zenbuild" all x86_64-w64-mingw32 + diff --git a/patches/jack_01_OptionalPortAudio.diff b/patches/jack_01_OptionalPortAudio.diff index 807bfb7..5431f03 100644 --- a/patches/jack_01_OptionalPortAudio.diff +++ b/patches/jack_01_OptionalPortAudio.diff @@ -1,8 +1,8 @@ diff --git a/common/wscript b/common/wscript -index 4302b1e..53d453d 100644 +index 4302b1e..c39aec1 100644 --- a/common/wscript +++ b/common/wscript -@@ -380,7 +381,7 @@ def build(bld): +@@ -380,7 +380,7 @@ def build(bld): process = create_jack_process_obj(bld, 'audioadapter', audio_adapter_sources, serverlib) process.use = 'SAMPLERATE' @@ -12,15 +12,15 @@ index 4302b1e..53d453d 100644 process = create_jack_process_obj(bld, 'audioadapter', audio_adapter_sources, serverlib) process.use += ['SAMPLERATE', 'PORTAUDIO'] diff --git a/windows/wscript b/windows/wscript -index fdae9bb..069fd53 100644 +index ea4dd3d..f00d66e 100644 --- a/windows/wscript +++ b/windows/wscript -@@ -6,7 +6,7 @@ import re - import os +@@ -2,7 +2,7 @@ + # encoding: utf-8 def configure(conf): -- conf.check_cc(function_name='Pa_GetVersion', header_name='portaudio.h', lib='portaudio', uselib_store="PORTAUDIO", define_name='HAVE_PORTAUDIO') -+ conf.check_cc(function_name='Pa_GetVersion', header_name='portaudio.h', lib='portaudio', uselib_store="PORTAUDIO", define_name='HAVE_PORTAUDIO', mandatory=False) +- conf.check_cfg(package='portaudio-2.0', uselib_store='PORTAUDIO', atleast_version='19', args='--cflags --libs') ++ conf.check_cfg(package='portaudio-2.0', uselib_store='PORTAUDIO', atleast_version='19', args='--cflags --libs', mandatory=False) conf.env['BUILD_DRIVER_PORTAUDIO'] = conf.is_defined('HAVE_PORTAUDIO') - def build(bld): + def create_jack_driver_obj(bld, target, sources, uselib = None): diff --git a/zen-all.sh b/zen-all.sh new file mode 100755 index 0000000..97aff37 --- /dev/null +++ b/zen-all.sh @@ -0,0 +1,75 @@ + +# Copyright (C) 2015 - Sebastien Alaiwan +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +function all_build { + echo "Done" +} + +function all_get_deps { + echo "dbus" + echo "expat" +# echo "faad2" # error: "two or more data types in declaration specifiers" +# echo "ffmpeg" + echo "fontconfig" + echo "freetype2" + echo "fribidi" + echo "gmplib" +# echo "gnutls" + echo "gpac" + echo "jack" + echo "liba52" +# echo "libalsa" + echo "libass" +# echo "libav" + echo "libfdk-aac" + echo "libgcrypt" + echo "libgpg-error" + echo "libjpeg" + echo "libmad" + echo "libnettle" + echo "libogg" + echo "libopenjpeg" + echo "libpng" +# echo "libpthread" + echo "librtmp" + echo "libsamplerate" + echo "libsdl" + echo "libsndfile" + echo "libtheora" + echo "libvorbis" + echo "libvpx" +# echo "libxau" +# echo "libxcb" +# echo "libxvidcore" + echo "opencore-amr" + echo "openh264" +# echo "openhevc" + echo "opus" + echo "portaudio" +# #echo "pthreads" can only be built for windows + echo "sodium" + echo "toxcore" + echo "tre" +# #echo "utox" depends on xrender and other missing stuff, causing pkg-config to return nothing +# #echo "vlc" requires ffmpeg -fPIC + echo "x264" + echo "x265" +# echo "xcb-proto" +# echo "xcbproto" +# echo "xcbpthreadstubs" + echo "xproto" + echo "zlib" +} + diff --git a/zen-dbus.sh b/zen-dbus.sh new file mode 100755 index 0000000..736ec2d --- /dev/null +++ b/zen-dbus.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +# Copyright (C) 2014 - Sebastien Alaiwan +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +function dbus_build { + host=$1 + pushDir $WORK/src + + lazy_download "dbus.tar.gz" "http://dbus.freedesktop.org/releases/dbus/dbus-1.8.8.tar.gz" + lazy_extract "dbus.tar.gz" + + mkdir -p dbus/build/$host + pushDir dbus/build/$host + CFLAGS+=" -I$PREFIX/$host/include " \ + LDFLAGS+=" -L$PREFIX/$host/lib " \ + ../../configure \ + --host=$host \ + --enable-static \ + --enable-abstract-sockets \ + --disable-shared \ + --prefix=$PREFIX/$host + $MAKE + $MAKE install + popDir + + popDir +} + +function dbus_get_deps { + echo "expat" +} + diff --git a/zen-expat.sh b/zen-expat.sh new file mode 100755 index 0000000..4499929 --- /dev/null +++ b/zen-expat.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# Copyright (C) 2015 - Sebastien Alaiwan +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +function expat_build { + local host=$1 + pushDir $WORK/src + + lazy_download "expat.tar.xz" "http://sourceforge.net/projects/expat/files/expat/2.1.0/expat-2.1.0.tar.gz/download" + lazy_extract "expat.tar.xz" + mkgit "expat" + + CFLAGS+=" -I$PREFIX/$host/include " \ + LDFLAGS+=" -L$PREFIX/$host/lib " \ + autoconf_build $host "expat" \ + --enable-static \ + --disable-shared + + popDir +} + +function expat_get_deps { + local a=0 +} + diff --git a/zen-faad2.sh b/zen-faad2.sh index 8667291..acb382e 100755 --- a/zen-faad2.sh +++ b/zen-faad2.sh @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -function build_faad2 { +function faad2_build { host=$1 pushDir $WORK/src diff --git a/zen-ffmpeg.sh b/zen-ffmpeg.sh index 478908e..8fb797b 100755 --- a/zen-ffmpeg.sh +++ b/zen-ffmpeg.sh @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -function build_ffmpeg { +function ffmpeg_build { host=$1 pushDir $WORK/src @@ -66,9 +66,9 @@ function build_ffmpeg { } function ffmpeg_get_deps { + echo libass echo fontconfig echo librtmp - echo libass echo libfdk-aac echo x264 echo x265 diff --git a/zen-fontconfig.sh b/zen-fontconfig.sh old mode 100644 new mode 100755 index ad3babe..75e3eea --- a/zen-fontconfig.sh +++ b/zen-fontconfig.sh @@ -16,12 +16,24 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -function build_fontconfig { +function fontconfig_build { host=$1 - pushDir $WORK/src + pushDir $WORK/src - lazy_git_clone "git://anongit.freedesktop.org/fontconfig" fontconfig "tags/2.11.1" + lazy_download "fontconfig.tar.bz2" "http://www.freedesktop.org/software/fontconfig/release/fontconfig-2.11.92.tar.bz2" + lazy_extract "fontconfig.tar.bz2" + mkgit "fontconfig" - autoconf_build $host "fontconfig" + LDFLAGS+=" -L$WORK/release/$host/lib" \ + autoconf_build $host "fontconfig" \ + --enable-static \ + --disable-shared popDir } + +function fontconfig_get_deps { + echo "expat" + echo "freetype2" + echo "libpng" +} + diff --git a/zen-freetype2.sh b/zen-freetype2.sh index 9e6aae5..cc504a2 100755 --- a/zen-freetype2.sh +++ b/zen-freetype2.sh @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -function build_freetype2 { +function freetype2_build { host=$1 pushDir $WORK/src diff --git a/zen-fribidi.sh b/zen-fribidi.sh old mode 100644 new mode 100755 index 049f88e..f81005b --- a/zen-fribidi.sh +++ b/zen-fribidi.sh @@ -1,34 +1,34 @@ -#!/bin/bash - -# Copyright (C) 2014 - Romain Bouqueau -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 3 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - -function build_fribidi { - host=$1 - pushDir $WORK/src - - lazy_download "fribidi.tar.xz" "http://fribidi.org/download/fribidi-0.19.6.tar.bz2" - lazy_extract "fribidi.tar.xz" - - mkgit "fribidi" - - autoconf_build $host "fribidi" --disable-shared - popDir -} - -function fribidi_get_deps { - local a=0; -} +#!/bin/bash + +# Copyright (C) 2014 - Romain Bouqueau +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +function fribidi_build { + host=$1 + pushDir $WORK/src + + lazy_download "fribidi.tar.xz" "http://fribidi.org/download/fribidi-0.19.6.tar.bz2" + lazy_extract "fribidi.tar.xz" + + mkgit "fribidi" + + autoconf_build $host "fribidi" --disable-shared + popDir +} + +function fribidi_get_deps { + local a=0 +} diff --git a/zen-gmplib.sh b/zen-gmplib.sh new file mode 100755 index 0000000..48bad3d --- /dev/null +++ b/zen-gmplib.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# Copyright (C) 2014 - Badr BADRI +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +function gmplib_get_deps { + local a=0 +} + +function gmplib_build { + + local host=$1 + pushDir $WORK/src + + lazy_download "gmplib.tar.lz" "https://gmplib.org/download/gmp/gmp-6.0.0a.tar.lz" + + lazy_extract "gmplib.tar.lz" + + autoconf_build $host "gmplib.tar.lz" + + popDir + +} diff --git a/zen-gnutls.sh b/zen-gnutls.sh new file mode 100755 index 0000000..12253c3 --- /dev/null +++ b/zen-gnutls.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# Copyright (C) 2014 - Badr BADRI +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +function gnutls_get_deps { + echo "gmplib" + echo "libnettle" +} + +function gnutls_build { + + local host=$1 + pushDir $WORK/src + + lazy_download "gnutls.tar.lz" "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.3/gnutls-3.3.12.tar.lz" + + lazy_extract "gnutls.tar.lz" + + autoconf_build $host "gnutls.tar.lz" + + popDir + +} + + diff --git a/zen-gpac.sh b/zen-gpac.sh index ab2d96a..18dacec 100755 --- a/zen-gpac.sh +++ b/zen-gpac.sh @@ -15,11 +15,11 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -function build_gpac { +function gpac_build { host=$1 pushDir $WORK/src - svn co svn://svn.code.sf.net/p/gpac/code/trunk/gpac gpac -r 5244 + svn co svn://svn.code.sf.net/p/gpac/code/trunk/gpac gpac -r 5600 pushDir gpac svn revert -R . popDir @@ -35,22 +35,30 @@ function build_gpac { pushDir gpac/build/$host ../../configure \ --target-os=$OS \ - --prefix=$PREFIX/$host \ + --cross-prefix="$crossPrefix" \ --extra-cflags="-I$PREFIX/$host/include -w -fPIC" \ --extra-ldflags="-L$PREFIX/$host/lib" \ --disable-jack \ - --cross-prefix="$crossPrefix" + --enable-amr \ + --prefix=$PREFIX/$host $MAKE - $MAKE install-lib + + # 'make install' is broken, ignore the following error. + # install: cannot stat ‘bin/gcc/libgpac.dll.a’: No such file or directory + # Makefile:174: recipe for target 'installdylib' failed + $MAKE install-lib -k || true + popDir popDir } function gpac_get_deps { + echo opencore-amr echo zlib - #echo freetype2 + echo libsdl + echo freetype2 echo libvorbis echo libogg } diff --git a/zen-jack.sh b/zen-jack.sh index c620b25..6a832d8 100755 --- a/zen-jack.sh +++ b/zen-jack.sh @@ -21,25 +21,35 @@ function jack_get_deps { echo tre } -function build_jack { +function jack_build { host=$1 pushDir $WORK/src - lazy_git_clone "git://github.com/jackaudio/jack2.git" jack2_$host f90f76f + lazy_git_clone "git://github.com/jackaudio/jack2.git" jack2_$host 9159e9f85f1b85df525c3bc95260e51c72ef9d65 --depth=100 CFLAGS="-I$PREFIX/$host/include -L$PREFIX/$host/lib" - CFLAGS+=" -I$PREFIX/$host/include/tre" pushDir jack2_$host applyPatch $scriptDir/patches/jack_01_OptionalPortAudio.diff applyPatch $scriptDir/patches/jack_03_NoExamples.diff applyPatch $scriptDir/patches/jack_04_OptionalSampleRate.diff + sed -i "s/.*tests.*//" wscript + sed -i "s/.*example-clients.*//" wscript + + local options="" + + case $host in + *mingw*) + CFLAGS+=" -I$PREFIX/$host/include/tre" + options+=" --winmme --dist-target mingw" + ;; + esac CC="$host-gcc $CFLAGS" \ CXX="$host-g++ $CFLAGS" \ PREFIX=$PREFIX/$host \ - python2 ./waf configure --winmme --dist-target mingw + python2 ./waf configure $options python2 ./waf build python2 ./waf install popDir diff --git a/zen-liba52.sh b/zen-liba52.sh index ab36265..fb2f9d8 100755 --- a/zen-liba52.sh +++ b/zen-liba52.sh @@ -14,16 +14,24 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -function build_liba52 { +function liba52_build { host=$1 pushDir $WORK/src lazy_download "liba52.tar.xz" "http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz" lazy_extract "liba52.tar.xz" - autoconf_build $host "liba52" + mkdir -p liba52/build/$host + pushDir liba52/build/$host + ../../configure \ + --host=$host \ + --prefix=$PREFIX/$host + $MAKE + $MAKE install popDir + popDir + } function liba52_get_deps { diff --git a/zen-libalsa.sh b/zen-libalsa.sh new file mode 100755 index 0000000..71e4527 --- /dev/null +++ b/zen-libalsa.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# Copyright (C) 2014 - Badr BADRI +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +function libalsa_get_deps { + local a=0 +} + +function libalsa_build { + + host=$1 + pushDir $WORK/src + + lazy_download "libalsa.tar.gz" "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.0.28.tar.bz2" + + lazy_extract "libalsa.tar.gz" + + autoconf_build $host "libalsa" + + popDir + +} diff --git a/zen-libass.sh b/zen-libass.sh old mode 100644 new mode 100755 index 6e325fe..50c1d5f --- a/zen-libass.sh +++ b/zen-libass.sh @@ -14,7 +14,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -function build_libass { +function libass_build { host=$1 pushDir $WORK/src @@ -31,4 +31,4 @@ function libass_get_deps { echo freetype2 echo fribidi echo fontconfig -} \ No newline at end of file +} diff --git a/zen-libav.sh b/zen-libav.sh index 40cd398..2a130e7 100755 --- a/zen-libav.sh +++ b/zen-libav.sh @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -function build_libav { +function libav_build { host=$1 pushDir $WORK/src diff --git a/zen-libfdk-aac.sh b/zen-libfdk-aac.sh old mode 100644 new mode 100755 index a1b6fb4..bc4af35 --- a/zen-libfdk-aac.sh +++ b/zen-libfdk-aac.sh @@ -14,7 +14,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -function build_libfdk-aac { +function libfdk-aac_build { host=$1 pushDir $WORK/src diff --git a/zen-libgcrypt.sh b/zen-libgcrypt.sh new file mode 100755 index 0000000..ee81bb4 --- /dev/null +++ b/zen-libgcrypt.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +# Copyright (C) 2014 - Badr BADRI +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +function libgcrypt_build { + local host=$1 + pushDir $WORK/src + + lazy_download "libgcrypt.tar.gz" "ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.6.2.tar.gz" + + lazy_extract "libgcrypt.tar.gz" + + CFLAGS+=" -I$PREFIX/$host/include " \ + LDFLAGS+=" -L$PREFIX/$host/lib " \ + autoconf_build $host "libgcrypt" \ + --with-gpg-error-prefix=$PREFIX/$host \ + --disable-asm \ + --disable-optimization \ + --disable-shared \ + --enable-static + + popDir + +} + +function libgcrypt_get_deps { + echo "libgpg-error" +} + diff --git a/zen-libjpeg.sh b/zen-libjpeg.sh new file mode 100755 index 0000000..ad9d81d --- /dev/null +++ b/zen-libjpeg.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# Copyright (C) 2014 - Badr BADRI +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +function libjpeg_get_deps { + local a=0 +} + +function libjpeg_build { + local host=$1 + + pushDir $WORK/src + lazy_download "libjpeg-$host.tar.gz" "http://www.ijg.org/files/jpegsrc.v9a.tar.gz" + + lazy_extract "libjpeg-$host.tar.gz" + + autoconf_build $host "libjpeg-$host" \ + --enable-dependency-tracking + + popDir +} + diff --git a/zen-libmad.sh b/zen-libmad.sh new file mode 100755 index 0000000..c14af78 --- /dev/null +++ b/zen-libmad.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# Copyright (C) 2014 - Badr BADRI +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +function libmad_get_deps { + local a=0 +} + +function libmad_build { + + local host=$1 + pushDir $WORK/src + + lazy_download "libmad.tar.gz" "http://sourceforge.net/projects/mad/files/libmad/0.15.1b/libmad-0.15.1b.tar.gz" + lazy_extract "libmad.tar.gz" + + sed -i "s/-fforce-mem//" libmad/configure + + autoconf_build $host "libmad" --with-pic + + popDir + +} diff --git a/zen-libnettle.sh b/zen-libnettle.sh new file mode 100755 index 0000000..c1a07f5 --- /dev/null +++ b/zen-libnettle.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# Copyright (C) 2014 - Badr BADRI +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +function libnettle_get_deps { + local a=0 +} + +function libnettle_build { + + local host=$1 + pushDir $WORK/src + + lazy_download "libnettle.tar.gz" "https://ftp.gnu.org/gnu/nettle/nettle-2.7.1.tar.gz" + + lazy_extract "libnettle.tar.gz" + + autoconf_build $host "libnettle" + + popDir + +} diff --git a/zen-libogg.sh b/zen-libogg.sh index 3a14537..d51a921 100755 --- a/zen-libogg.sh +++ b/zen-libogg.sh @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -function build_libogg { +function libogg_build { host=$1 pushDir $WORK/src diff --git a/zen-libopenjpeg.sh b/zen-libopenjpeg.sh new file mode 100755 index 0000000..2051ecf --- /dev/null +++ b/zen-libopenjpeg.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +# Copyright (C) 2014 - Badr BADRI +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +function libopenjpeg_build { + + local host=$1 + pushDir $WORK/src + + svn co http://openjpeg.googlecode.com/svn/trunk/ libopenjpeg -r 2989 + pushDir libopenjpeg + svn revert -R . + popDir + + mkdir -p libopenjpeg/build/$host + pushDir libopenjpeg/build/$host + cmake -DCMAKE_INSTALL_PREFIX=$PREFIX/$host ../../ + $MAKE + $MAKE install + popDir + + popDir + +} + +function libopenjpeg_get_deps { + local a=0 +} diff --git a/zen-libpng.sh b/zen-libpng.sh index 1d96495..4e41e92 100755 --- a/zen-libpng.sh +++ b/zen-libpng.sh @@ -15,16 +15,17 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -function build_libpng { +function libpng_build { host=$1 pushDir $WORK/src - lazy_download "libpng.tar.xz" "http://prdownloads.sourceforge.net/libpng/libpng-1.6.10.tar.xz?download" + lazy_download "libpng.tar.xz" "http://prdownloads.sourceforge.net/libpng/libpng-1.2.52.tar.xz?download" lazy_extract "libpng.tar.xz" mkgit "libpng" LDFLAGS+=" -L$WORK/release/$host/lib" \ CFLAGS+=" -I$WORK/release/$host/include" \ + CPPFLAGS+=" -I$WORK/release/$host/include" \ autoconf_build $host "libpng" popDir } diff --git a/zen-libpthread.sh b/zen-libpthread.sh new file mode 100755 index 0000000..c41569c --- /dev/null +++ b/zen-libpthread.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# Copyright (C) 2014 - Badr BADRI +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + +function libpthread_get_deps { + local a=0 +} + +function libpthread_build { + + local host=$1 + pushDir $WORK/src + + lazy_download "libpthread.tar.bz2" "http://xcb.freedesktop.org/dist/libpthread-stubs-0.1.tar.bz2" + + lazy_extract "libpthread.tar.bz2" + + autoconf_build $host "libpthread" + + popDir + +} diff --git a/zen-librtmp.sh b/zen-librtmp.sh index 4b8b8d5..c9c1785 100755 --- a/zen-librtmp.sh +++ b/zen-librtmp.sh @@ -19,7 +19,7 @@ function librtmp_get_deps { local a=0 } -function build_librtmp { +function librtmp_build { host=$1 pushDir $WORK/src lazy_git_clone "git://git.ffmpeg.org/rtmpdump" rtmpdump 79459a2b43f41ac44a2ec001139bcb7b1b8f7497 @@ -27,7 +27,13 @@ function build_librtmp { pushDir rtmpdump/librtmp - sed -i "s/^SYS=posix/SYS=mingw/" Makefile + case $host in + *mingw*) + sed -i "s/^SYS=posix/SYS=mingw/" Makefile + echo "# YO" >> Makefile + ;; + esac + sed -i "s@^prefix=.*@prefix=$PREFIX/$host@" Makefile sed -i "s@^CRYPTO=.*@@" Makefile diff --git a/zen-libsamplerate.sh b/zen-libsamplerate.sh index 13e7851..c185ab0 100755 --- a/zen-libsamplerate.sh +++ b/zen-libsamplerate.sh @@ -15,7 +15,7 @@ # along with this program. If not, see . -function build_libsamplerate { +function libsamplerate_build { host=$1 pushd $WORK/src @@ -32,3 +32,6 @@ function build_libsamplerate { popd } +function libsamplerate_get_deps { + local a=0 +} diff --git a/zen-libsdl.sh b/zen-libsdl.sh new file mode 100755 index 0000000..ad68f1b --- /dev/null +++ b/zen-libsdl.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# Copyright (C) 2014 - Badr BADRI +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +function libsdl_get_deps { + local a=0 +} + +function libsdl_build { + + local host=$1 + pushDir $WORK/src + + lazy_download "libsdl.tar.gz" "https://www.libsdl.org/release/SDL2-2.0.3.tar.gz" + lazy_extract "libsdl.tar.gz" + + autoconf_build $host "libsdl" + + popDir + +} diff --git a/zen-libsndfile.sh b/zen-libsndfile.sh index 0268948..9178e55 100755 --- a/zen-libsndfile.sh +++ b/zen-libsndfile.sh @@ -19,7 +19,7 @@ function libsndfile_get_deps { local a=0 } -function build_libsndfile { +function libsndfile_build { host=$1 pushDir $WORK/src diff --git a/zen-libtheora.sh b/zen-libtheora.sh index 99ed79e..0bf5141 100755 --- a/zen-libtheora.sh +++ b/zen-libtheora.sh @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -function build_libtheora { +function libtheora_build { host=$1 pushDir $WORK/src @@ -23,7 +23,10 @@ function build_libtheora { lazy_extract "libtheora.tar.bz2" mkgit "libtheora" - autoconf_build $host "libtheora" + autoconf_build $host "libtheora" \ + --enable-static \ + --disable-shared \ + --disable-examples popDir } diff --git a/zen-libvorbis.sh b/zen-libvorbis.sh index b01cdc6..2e7138f 100755 --- a/zen-libvorbis.sh +++ b/zen-libvorbis.sh @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -function build_libvorbis { +function libvorbis_build { host=$1 pushDir $WORK/src diff --git a/zen-libvpx.sh b/zen-libvpx.sh new file mode 100755 index 0000000..2b929fa --- /dev/null +++ b/zen-libvpx.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +# Copyright (C) 2014 - Sebastien Alaiwan +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +function libvpx_build { + host=$1 + pushDir $WORK/src + + lazy_git_clone https://chromium.googlesource.com/webm/libvpx libvpx c5718a7aa3b5490fbfbc47d6f82e7cb3eed46a1e + + local host2=$(echo $host | sed "s/x86_64-w64-mingw32/x86_64-win64-gcc/") + host2=$(echo $host2 | sed "s/i686-w64-mingw32/x86-win32-gcc/") + host2=$(echo $host2 | sed "s/x86_64-linux-gnu/x86_64-linux-gcc/") + mkdir -p libvpx/build/$host + pushDir libvpx/build/$host +# CFLAGS+=" -I$PREFIX/$host/include " \ +# LDFLAGS+=" -L$PREFIX/$host/lib " \ + ../../configure \ + --target=$host2 \ + --disable-examples \ + --disable-unit-tests \ + --disable-docs \ + --prefix=$PREFIX/$host + $MAKE + $MAKE install + popDir + + popDir +} + +function libvpx_get_deps { + local a=0 +} + diff --git a/zen-libxau.sh b/zen-libxau.sh new file mode 100755 index 0000000..955c063 --- /dev/null +++ b/zen-libxau.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# Copyright (C) 2014 - Badr BADRI +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + +function libxau_get_deps { + echo "xproto" +} + +function libxau_build { + + local host=$1 + pushDir $WORK/src + + lazy_download "libxau.tar.gz" "http://www.x.org/releases/individual/lib/libXau-1.0.8.tar.gz" + + lazy_extract "libxau.tar.gz" + + autoconf_build $host "libxau" + + popDir + +} diff --git a/zen-libxcb.sh b/zen-libxcb.sh new file mode 100755 index 0000000..5a389db --- /dev/null +++ b/zen-libxcb.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# Copyright (C) 2014 - Badr BADRI +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + +function libxcb_get_deps { + echo xcb-proto + echo libpthread + echo libxau +} + +function libxcb_build { + + local host=$1 + pushDir $WORK/src + + lazy_download "libxcb.tar.gz" "http://xcb.freedesktop.org/dist/libxcb-1.11.tar.gz" + + lazy_extract "libxcb.tar.gz" + + autoconf_build $host "libxcb" + + popDir + +} + + diff --git a/zen-libxvidcore.sh b/zen-libxvidcore.sh new file mode 100755 index 0000000..674fbda --- /dev/null +++ b/zen-libxvidcore.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +# Copyright (C) 2014 - Badr BADRI +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +function libxvidcore_get_deps { + local a=0 +} + +function libxvidcore_build { + local host=$1 + pushDir $WORK/src + + lazy_download "libxvidcore.tar.gz" "http://downloads.xvid.org/downloads/xvidcore-1.3.3.tar.gz" + lazy_extract "libxvidcore.tar.gz" + + pushDir libxvidcore/build/generic + + ./configure \ + --host=$host \ + --prefix=$PREFIX/$host + + $MAKE + $MAKE install + + + popDir + popDir +} + diff --git a/zen-opencore-amr.sh b/zen-opencore-amr.sh new file mode 100755 index 0000000..7bfd9a0 --- /dev/null +++ b/zen-opencore-amr.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# Copyright (C) 2014 - Badr BADRI +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +function opencore-amr_get_deps { + local a=0 +} + +function opencore-amr_build { + + local host=$1 + pushDir $WORK/src + + lazy_download "opencore-amr.tar.gz" "http://sourceforge.net/projects/opencore-amr/files/opencore-amr/opencore-amr-0.1.3.tar.gz" + lazy_extract "opencore-amr.tar.gz" + + autoconf_build $host "opencore-amr" --enable-shared + + popDir + +} diff --git a/zen-openh264.sh b/zen-openh264.sh new file mode 100755 index 0000000..9ab63b8 --- /dev/null +++ b/zen-openh264.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +# Copyright (C) 2014 - Badr BADRI +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +function openh264_build { + + host=$1 + pushDir $WORK/src + local ARCH=$(get_arch $host) + local OS=$(get_os $host) + + lazy_download "openh264.tar.gz" "https://github.com/cisco/openh264/archive/v1.3.1.tar.gz" + lazy_extract "openh264.tar.gz" + mkgit "openh264" + + pushDir openh264 + + sed -i "s@^PREFIX=.*@PREFIX=$PREFIX/$host@" Makefile + sed -i "s@^ARCH=.*@ARCH=$ARCH@" Makefile + sed -i "s@^OS=.*@OS=$OS@" Makefile + sed -i "s/gnu/linux/" Makefile + sed -i "s/mingw32/mingw_nt/" Makefile + + $MAKE + $MAKE install + + popDir + popDir +} + +function openh264_get_deps { + local a=0 +} + diff --git a/zen-openhevc.sh b/zen-openhevc.sh new file mode 100755 index 0000000..22ac75e --- /dev/null +++ b/zen-openhevc.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +# Copyright (C) 2014 - Badr BADRI +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +function openhevc_get_deps { + local a=0 +} + +function openhevc_build { + local host=$1 + pushDir $WORK/src + + lazy_git_clone "https://github.com/OpenHEVC/openHEVC" openhevc + + pushDir openhevc + mkdir build + pushDir build + + echo "SET(CMAKE_C_COMPILER $host-gcc)" > config.cmake + echo "SET(CMAKE_CXX_COMPILER $host-g++)" >> config.cmake + echo "SET(CMAKE_RC_COMPILER $host-windres)" >> config.cmake + echo "" >> config.cmake + + cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_TOOLCHAIN_FILE=config.cmake -DCMAKE_INSTALL_PREFIX=$PREFIX/$host .. + $MAKE + $MAKE install + + popDir + popDir + popDir + +} diff --git a/zen-opus.sh b/zen-opus.sh index f08e5d0..fa9940b 100755 --- a/zen-opus.sh +++ b/zen-opus.sh @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -function build_opus { +function opus_build { host=$1 pushDir $WORK/src diff --git a/zen-portaudio.sh b/zen-portaudio.sh index fa64567..7821ae7 100755 --- a/zen-portaudio.sh +++ b/zen-portaudio.sh @@ -1,5 +1,5 @@ -function build_portaudio { +function portaudio_build { host=$1 pushd $WORK/src lazy_download "portaudio.tar.gz" "http://www.portaudio.com/archives/pa_stable_v19_20140130.tgz" diff --git a/zen-pthreads.sh b/zen-pthreads.sh index e79489b..01614a5 100755 --- a/zen-pthreads.sh +++ b/zen-pthreads.sh @@ -1,5 +1,5 @@ -build_pthreads() { +pthreads()_build { host=$1 pushd $WORK/src diff --git a/zen-sodium.sh b/zen-sodium.sh index f43f071..48b5fa9 100755 --- a/zen-sodium.sh +++ b/zen-sodium.sh @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -function build_sodium { +function sodium_build { host=$1 pushDir $WORK/src diff --git a/zen-toxcore.sh b/zen-toxcore.sh index e66b9ba..1385810 100755 --- a/zen-toxcore.sh +++ b/zen-toxcore.sh @@ -15,11 +15,11 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -function build_toxcore { +function toxcore_build { host=$1 pushDir $WORK/src - lazy_git_clone "https://github.com/irungentoo/toxcore.git" toxcore + lazy_git_clone "https://github.com/irungentoo/toxcore.git" toxcore 627e4d3aa629038b0e195f2189e9826b32c9531a mkdir -p toxcore/build/$host pushDir toxcore @@ -28,6 +28,8 @@ function build_toxcore { mkdir -p toxcore/build/$host pushDir toxcore/build/$host + CFLAGS+=" -I$PREFIX/$host/include " \ + LDFLAGS+=" -L$PREFIX/$host/lib " \ ../../configure \ --enable-static \ --disable-shared \ @@ -44,5 +46,6 @@ function build_toxcore { function toxcore_get_deps { echo sodium echo opus + echo libvpx } diff --git a/zen-tre.sh b/zen-tre.sh index 13fbbfd..8268976 100755 --- a/zen-tre.sh +++ b/zen-tre.sh @@ -20,7 +20,7 @@ function tre_get_deps { local a=0 } -function build_tre { +function tre_build { host=$1 pushDir $WORK/src diff --git a/zen-utox.sh b/zen-utox.sh index 0414dcd..fb129be 100755 --- a/zen-utox.sh +++ b/zen-utox.sh @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -function build_utox { +function utox_build { host=$1 pushDir $WORK/src diff --git a/zen-vlc.sh b/zen-vlc.sh index 0a52f1d..7cc2486 100755 --- a/zen-vlc.sh +++ b/zen-vlc.sh @@ -14,7 +14,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -function build_vlc { +function vlc_build { host=$1 pushDir $WORK/src @@ -30,7 +30,6 @@ function build_vlc { --enable-fribidi \ --disable-mad \ --disable-lua \ - --disable-libgcrypt \ --prefix=$PREFIX/$host $MAKE $MAKE install @@ -43,5 +42,8 @@ function vlc_get_deps { echo "ffmpeg" echo "liba52" echo "fribidi" + echo "libgcrypt" + echo "libxcb" + echo "libalsa" } diff --git a/zen-x264.sh b/zen-x264.sh index 7afe06b..c8f9b6d 100755 --- a/zen-x264.sh +++ b/zen-x264.sh @@ -16,19 +16,16 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -function x264_get_deps { - local a=0 -} - -function build_x264 { +function x264_build { local host=$1 local crossPrefix=$(get_cross_prefix $BUILD $host) pushDir $WORK/src - lazy_git_clone "git://git.videolan.org/x264.git" x264 + lazy_git_clone "git://git.videolan.org/x264.git" x264 40bb56814e56ed342040bdbf30258aab39ee9e89 autoconf_build $host "x264" \ - --enable-shared \ + --enable-static \ + --enable-pic \ --disable-gpl \ --disable-cli \ --enable-win32thread \ @@ -44,3 +41,7 @@ function build_x264 { popDir } +function x264_get_deps { + local a=0 +} + diff --git a/zen-x265.sh b/zen-x265.sh old mode 100644 new mode 100755 index 859bcd7..5685d08 --- a/zen-x265.sh +++ b/zen-x265.sh @@ -16,24 +16,34 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -function x265_get_deps { - local a=0 -} - -function build_x265 { +function x265_build { local host=$1 local crossPrefix=$(get_cross_prefix $BUILD $host) pushDir $WORK/src - hg clone -r 6879 https://bitbucket.org/multicoreware/x265 x265 - + if [ ! -d "x264/.hg" ] ; then + rm -rf x265 + hg clone -r 6879 https://bitbucket.org/multicoreware/x265 x265 + else + pushDir x265 + hg revert + popDir + fi + pushDir x265/ applyPatch $scriptDir/patches/x265_02_version.diff - - mkdir -p build/$host - pushDir build/$host - echo "SET(CMAKE_C_COMPILER $host-gcc)" > config.cmake + mkdir -p bin/$host + pushDir bin/$host + + echo "" > config.cmake + case $host in + *mingw*) + echo "SET(CMAKE_SYSTEM_NAME Windows)" >> config.cmake + ;; + esac + + echo "SET(CMAKE_C_COMPILER $host-gcc)" >> config.cmake echo "SET(CMAKE_CXX_COMPILER $host-g++)" >> config.cmake echo "SET(CMAKE_RC_COMPILER $host-windres)" >> config.cmake echo "SET(CMAKE_RANLIB $host-ranlib)" >> config.cmake @@ -44,13 +54,17 @@ function build_x265 { echo "SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS \"-static-libgcc -static-libstdc++ -static -O3 -s\")" >> config.cmake echo "SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS \"-static-libgcc -static-libstdc++ -static -O3 -s\")" >> config.cmake echo "SET(CMAKE_SHARED_LINKER_FLAGS \"-static-libgcc -static-libstdc++ -static -O3 -s\")" >> config.cmake - + cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=config.cmake -DCMAKE_INSTALL_PREFIX=$PREFIX/$host ../../source $MAKE x265-shared $MAKE install - + popDir popDir popDir } +function x265_get_deps { + local a=0 +} + diff --git a/zen-xcb-proto.sh b/zen-xcb-proto.sh new file mode 100755 index 0000000..b1226cd --- /dev/null +++ b/zen-xcb-proto.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# Copyright (C) 2014 - Badr BADRI +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +function xcb-proto_get_deps { + local a=0 +} + +function xcb-proto_build { + + local host=$1 + pushDir $WORK/src + + + lazy_download "xcb-proto.tar.gz" "http://xcb.freedesktop.org/dist/xcb-proto-1.11.tar.gz" + + lazy_extract "xcb-proto.tar.gz" + + autoconf_build $host "xcb-proto" + + popDir + +} diff --git a/zen-xproto.sh b/zen-xproto.sh new file mode 100755 index 0000000..1cadc28 --- /dev/null +++ b/zen-xproto.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# Copyright (C) 2014 - Sebastien Alaiwan +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +function xproto_build { + host=$1 + pushDir $WORK/src + + lazy_git_clone "git://anongit.freedesktop.org/xorg/proto/xproto" xproto + + autoconf_build $host "xproto" + popDir +} + +function xproto_get_deps { + local a=0 +} + diff --git a/zen-zlib.sh b/zen-zlib.sh index 0d5c89c..77b5818 100755 --- a/zen-zlib.sh +++ b/zen-zlib.sh @@ -20,7 +20,7 @@ function zlib_get_deps { local a=0 } -function build_zlib { +function zlib_build { host=$1 pushDir $WORK/src diff --git a/zenbuild.sh b/zenbuild.sh index 0aaf5d7..a6952bc 100755 --- a/zenbuild.sh +++ b/zenbuild.sh @@ -58,7 +58,8 @@ function lazy_download local url="$2" if [ ! -e "$CACHE/$file" ]; then - wget "$url" -c -O "$CACHE/${file}.tmp" + echo "Downloading: $file" + wget "$url" -c -O "$CACHE/${file}.tmp" --no-verbose mv "$CACHE/${file}.tmp" "$CACHE/$file" fi } @@ -174,6 +175,14 @@ function main { } function initCflags { + + # avoid interferences from environment + unset CC + unset CXX + unset CFLAGS + unset CXXFLAGS + unset LDFLAGS + CFLAGS="-O2" CXXFLAGS="-O2" LDFLAGS="-s" @@ -188,8 +197,10 @@ function initCflags { export CXXFLAGS export LDFLAGS + local cores=$(nproc) + if [ -z "$MAKE" ]; then - MAKE="make" + MAKE="make -j$cores" fi export MAKE @@ -226,7 +237,7 @@ function lazy_build { build $host $depName done - build_${name} $host + ${name}_build $host printMsg "$name: build OK" mark_as_built $host $name @@ -267,6 +278,7 @@ function autoconf_build { popDir fi + rm -rf $name/build/$host mkdir -p $name/build/$host pushDir $name/build/$host ../../configure \ @@ -408,7 +420,7 @@ function checkForCommonBuildTools { echo "apt-get install make" exit 1 fi - + if isMissing "cmake"; then echo "make not installed. Please install with:" echo "pacman -S mingw-cmake" @@ -462,7 +474,7 @@ function checkForCommonBuildTools { echo "apt-get install git" exit 1 fi - + if isMissing "hg" ; then echo "git not installed. Please install with:" echo "pacman -S msys/mercurial" @@ -470,7 +482,7 @@ function checkForCommonBuildTools { echo "apt-get install mercurial" exit 1 fi - + if isMissing "gperf" ; then echo "gperf not installed. Please install with:" echo "pacman -S msys/gperf"