diff --git a/docker-builder-data/build/script/common/manager.sh b/docker-builder-data/build/script/common/manager.sh index 525c26c..14aae38 100755 --- a/docker-builder-data/build/script/common/manager.sh +++ b/docker-builder-data/build/script/common/manager.sh @@ -34,6 +34,13 @@ if [ ! -z $PACKET_BUILD_DIR ]; then export PACKET_DIR=$PACKET_BUILD_DIR/$PLATFORM fi +# toolchain + +if [ -f "$COMMON_SCRIPT_DIR/toolchain-$PLATFORM.sh" ]; then + echo "use toolchain $PLATFORM" + source "$COMMON_SCRIPT_DIR/toolchain-$PLATFORM.sh" || exit 1 +fi + # vars INITIAL_LD_LIBRARY_PATH=$LD_LIBRARY_PATH diff --git a/docker-builder-data/build/script/common/toolchain-win-64.sh b/docker-builder-data/build/script/common/toolchain-win-64.sh new file mode 100755 index 0000000..e423313 --- /dev/null +++ b/docker-builder-data/build/script/common/toolchain-win-64.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +export TOOLCHAIN_HOST="x86_64-w64-mingw32" +export HOST="$TOOLCHAIN_HOST" + +export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig:/usr/${TOOLCHAIN_HOST}/sys-root/mingw/lib/pkgconfig/ +export PKG_CONFIG_LIBDIR=${PREFIX}/lib/pkgconfig +export PATH=/usr/${TOOLCHAIN_HOST}/bin:/usr/${TOOLCHAIN_HOST}/sys-root/mingw/bin:${PREFIX}/bin:$PATH +export LD_LIBRARY_PATH=${PREFIX}/lib:/usr/${TOOLCHAIN_HOST}/sys-root/mingw/lib:$LD_LIBRARY_PATH + +export CC=/usr/bin/${TOOLCHAIN_HOST}-gcc +export CXX=/usr/bin/${TOOLCHAIN_HOST}-g++ +export CFLAGS=" -I/usr/${TOOLCHAIN_HOST}/sys-root/mingw/include $CFLAGS" +export CPPFLAGS=" -I/usr/${TOOLCHAIN_HOST}/sys-root/mingw/include $CPPFLAGS" +export CXXFLAGS=" -I/usr/${TOOLCHAIN_HOST}/sys-root/mingw/include $CPPFLAGS" +export LDFLAGS=" -L/usr/${TOOLCHAIN_HOST}/sys-root/mingw/lib $LDFLAGS" diff --git a/docker-builder-data/build/script/include/inc-pkall-none.sh b/docker-builder-data/build/script/include/inc-pkall-none.sh index 0fd00b3..6b0eae9 100644 --- a/docker-builder-data/build/script/include/inc-pkall-none.sh +++ b/docker-builder-data/build/script/include/inc-pkall-none.sh @@ -9,7 +9,16 @@ PK_CFLAGS= PK_CPPFLAGS= PK_GIT_OPTIONS= +PK_CONFIGURE_OPTIONS_DEFAULT= + +if [ ! -z "$HOST" ]; then + PK_CONFIGURE_OPTIONS_DEFAULT=" \ + $PK_CONFIGURE_OPTIONS_DEFAULT \ + --host=$HOST " +fi + PK_CONFIGURE_OPTIONS_DEFAULT=" \ + $PK_CONFIGURE_OPTIONS_DEFAULT \ --prefix=$INSTALL_PACKET_DIR \ --disable-static \ --enable-shared " diff --git a/docker-builder-data/build/script/packet/imagemagick-6.8.7.sh b/docker-builder-data/build/script/packet/imagemagick-6.8.7.sh new file mode 100644 index 0000000..8a5fccf --- /dev/null +++ b/docker-builder-data/build/script/packet/imagemagick-6.8.7.sh @@ -0,0 +1,14 @@ +DEPS="jpeg-9b png-1.6.26 tiff-4.0.6 xml-2.9.4 fftw-3.3.5" + +PK_DIRNAME="ImageMagick-6.8.7-10" +PK_ARCHIVE="$PK_DIRNAME.tar.xz" +PK_URL="http://www.imagemagick.org/download/releases/$PK_ARCHIVE" + +PK_CONFIGURE_OPTIONS=" \ + --with-modules \ + --without-perl \ + --without-x \ + --with-threads \ + --with-magick_plus_plus" + +source $INCLUDE_SCRIPT_DIR/inc-pkall-default.sh diff --git a/docker-builder-data/build/script/packet/imagemagick-6.9.5.sh b/docker-builder-data/build/script/packet/imagemagick-6.9.5.sh index aee1a21..289248f 100644 --- a/docker-builder-data/build/script/packet/imagemagick-6.9.5.sh +++ b/docker-builder-data/build/script/packet/imagemagick-6.9.5.sh @@ -1,7 +1,7 @@ DEPS="jpeg-9b png-1.6.26 tiff-4.0.6 xml-2.9.4 fftw-3.3.5" PK_DIRNAME="ImageMagick-6.9.5-10" -PK_ARCHIVE="$PK_DIRNAME.tar.gz" +PK_ARCHIVE="$PK_DIRNAME.tar.xz" PK_URL="http://www.imagemagick.org/download/releases/$PK_ARCHIVE" PK_CONFIGURE_OPTIONS=" \ diff --git a/docker-builder-data/build/script/packet/synfigcore-master.sh b/docker-builder-data/build/script/packet/synfigcore-master.sh index 205a0b9..f18285d 100644 --- a/docker-builder-data/build/script/packet/synfigcore-master.sh +++ b/docker-builder-data/build/script/packet/synfigcore-master.sh @@ -60,10 +60,16 @@ DEPS=" \ synfigetl-master \ - jpeg-9b tiff-4.0.6 fftw-3.3.5 imagemagick-6.9.5 \ - jack-0.125.0 ffmpeg-3.1.5 mlt-6.2.0 \ + jpeg-9b tiff-4.0.6 fftw-3.3.5 imagemagick-6.8.7 \ + ffmpeg-3.1.5 mlt-6.2.0 \ boost-1.61.0 cairo-1.14.6 pango-1.40.3 glibmm-2.41.4 xmlpp-2.22.0" +LINUX_DEPS="jack-0.125.0" + +if [ "$PLATFORM" -eq "linux-32" ] || [ "$PLATFORM" -eq "linux-64" ]; then + DEPS="$DEPS $LINUX_DEPS" +fi + PK_DIRNAME="synfig" PK_URL="https://github.com/synfig/$PK_DIRNAME.git" PK_GIT_OPTIONS="--branch testing" diff --git a/docker-builder-data/build/script/packet/synfigetl-master.sh b/docker-builder-data/build/script/packet/synfigetl-master.sh index 18c2bfa..764959c 100644 --- a/docker-builder-data/build/script/packet/synfigetl-master.sh +++ b/docker-builder-data/build/script/packet/synfigetl-master.sh @@ -12,6 +12,7 @@ pkbuild() { if ! check_packet_function $NAME build.configure; then autoreconf --install --force || return 1 ./configure \ + --host=$HOST \ --prefix=$INSTALL_PACKET_DIR \ --sysconfdir=$INSTALL_PACKET_DIR/etc \ || return 1 diff --git a/docker-builder-data/build/script/packet/xml-2.9.4.sh b/docker-builder-data/build/script/packet/xml-2.9.4.sh index cd110ec..fa688da 100644 --- a/docker-builder-data/build/script/packet/xml-2.9.4.sh +++ b/docker-builder-data/build/script/packet/xml-2.9.4.sh @@ -11,7 +11,7 @@ source $INCLUDE_SCRIPT_DIR/inc-pkinstall_release-default.sh pkbuild() { cd "$BUILD_PACKET_DIR/$PK_DIRNAME" || return 1 if ! check_packet_function $NAME build.cunfigure; then - ./autogen.sh --prefix=$INSTALL_PACKET_DIR --without-python || return 1 + ./autogen.sh --host=$HOST --prefix=$INSTALL_PACKET_DIR --without-python || return 1 set_done $NAME build.cunfigure fi diff --git a/docker/fedora-cross-win/Dockerfile b/docker/fedora-cross-win/Dockerfile index 2fe55e6..f224b41 100644 --- a/docker/fedora-cross-win/Dockerfile +++ b/docker/fedora-cross-win/Dockerfile @@ -1,40 +1,43 @@ -FROM fedora:21 +FROM fedora:22 MAINTAINER Konstantin Dmitriev #VOLUME /synfig-buildroot -#RUN yum -y update +#RUN dnf -y update -RUN yum -y install git sudo +RUN dnf -y install git sudo -RUN yum -y install intltool autoconf automake libtool libtool-ltdl-devel +RUN dnf -y install intltool autoconf automake libtool libtool-ltdl-devel -RUN yum -y install mingw32-gcc-c++ mingw32-cpp +RUN dnf -y install mingw32-gcc-c++ mingw32-cpp -RUN yum -y install mingw32-adwaita-icon-theme mingw32-hicolor-icon-theme mingw32-libxml++ mingw32-cairo mingw32-pango mingw32-boost mingw32-libjpeg-turbo mingw32-gtkmm30 mingw32-glibmm24 mingw32-libltdl mingw32-dlfcn mingw32-SDL mingw32-fftw +RUN dnf -y install mingw32-adwaita-icon-theme mingw32-hicolor-icon-theme mingw32-libxml++ mingw32-cairo mingw32-pango mingw32-boost mingw32-libjpeg-turbo mingw32-gtkmm30 mingw32-glibmm24 mingw32-libltdl mingw32-dlfcn mingw32-SDL mingw32-fftw -RUN yum -y install mingw64-gcc-c++ mingw64-cpp +RUN dnf -y install mingw64-gcc-c++ mingw64-cpp -RUN yum -y install mingw64-adwaita-icon-theme mingw64-hicolor-icon-theme mingw64-libxml++ mingw64-cairo mingw64-pango mingw64-boost mingw64-libjpeg-turbo mingw64-gtkmm30 mingw64-glibmm24 mingw64-libltdl mingw64-dlfcn mingw64-SDL mingw64-fftw +RUN dnf -y install mingw64-adwaita-icon-theme mingw64-hicolor-icon-theme mingw64-libxml++ mingw64-cairo mingw64-pango mingw64-boost mingw64-libjpeg-turbo mingw64-gtkmm30 mingw64-glibmm24 mingw64-libltdl mingw64-dlfcn mingw64-SDL mingw64-fftw -RUN yum -y install mingw32-nsis +RUN dnf -y install mingw32-nsis -RUN yum -y install p7zip ImageMagick +RUN dnf -y install p7zip ImageMagick -RUN yum -y install make wget xz which +RUN dnf -y install make wget xz which -#RUN yum -y install synfig +#RUN dnf -y install synfig RUN cd /opt && git clone https://gitlab.com/morevnaproject-builds/synfig-linux64 COPY files/synfig /usr/local/bin/synfig RUN chmod +x /usr/local/bin/synfig -RUN yum -y install unzip zip +RUN dnf -y install unzip zip -RUN yum -y install dejavu-sans-fonts dejavu-sans-mono-fonts dejavu-serif-fonts +RUN dnf -y install dejavu-sans-fonts dejavu-sans-mono-fonts dejavu-serif-fonts # deps for synfig appimage -RUN yum -y install fuse fuse-libs bzip2 bzip2-libs libXdmcp +RUN dnf -y install fuse fuse-libs bzip2 bzip2-libs libXdmcp + +# additional deps for win-builds +RUN dnf -y install mingw64-zlib #RUN groupadd -g 1111 konstantin && useradd -u 1111 -g konstantin konstantin diff --git a/docker/fedora-cross-win/run.sh b/docker/fedora-cross-win/run.sh new file mode 100755 index 0000000..a8d0a7b --- /dev/null +++ b/docker/fedora-cross-win/run.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +SCRIPT_DIR=$(cd `dirname "$0"`; pwd) +BASE_DIR=`dirname "$SCRIPT_DIR"` +BASE_DIR=`dirname "$BASE_DIR"` +DATA_DIR="$BASE_DIR/docker-builder-data" +BUILD_DIR=$DATA_DIR/build +CONFIG_FILE="$BASE_DIR/config.sh" +PACKET_BUILD_DIR="$BUILD_DIR/packet" +SCRIPT_BUILD_DIR="$BUILD_DIR/script" +if [ -f $CONFIG_FILE ]; then + source $CONFIG_FILE +fi +mkdir -p $PACKET_BUILD_DIR + +docker stop "builder" || true +docker rm "builder" || true + +if [ -z "$ARCH" ];then + export ARCH=64 +fi + +if [ -z "$PLATFORM" ];then + export PLATFORM=win-$ARCH +fi + + +docker run -it \ + --name "builder" \ + --privileged=true \ + $DOCKER_RUN_OPTIONS \ + -v "$PACKET_BUILD_DIR:/build/packet" \ + -v "$SCRIPT_BUILD_DIR:/build/script" \ + -e ARCH="$ARCH" \ + -e PLATFORM="$PLATFORM" \ + morevna/build-fedora-cross-win \ + /build/script/common/manager.sh "$@" + diff --git a/docker/fedora-cross-win/run32.sh b/docker/fedora-cross-win/run32.sh new file mode 100755 index 0000000..4818e79 --- /dev/null +++ b/docker/fedora-cross-win/run32.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +ARCH=32 $(cd `dirname "$0"`; pwd)/run.sh "$@" diff --git a/docker/fedora-cross-win/run64.sh b/docker/fedora-cross-win/run64.sh new file mode 100755 index 0000000..bf895b2 --- /dev/null +++ b/docker/fedora-cross-win/run64.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +ARCH=64 $(cd `dirname "$0"`; pwd)/run.sh "$@"