Skip to content

Commit

Permalink
refactor: removed boost dependency (synfig#2792)
Browse files Browse the repository at this point in the history
  • Loading branch information
ice0 authored Aug 31, 2022
2 parents dd55c0f + 1298235 commit 18b9d2b
Show file tree
Hide file tree
Showing 27 changed files with 144 additions and 833 deletions.
2 changes: 1 addition & 1 deletion 1-install-vcpkg.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
set VCPKG_DEFAULT_TRIPLET=x64-windows
.\vcpkg.exe install boost-odeint boost-ublas fftw3 freetype gettext glibmm gtkmm libjpeg-turbo libpng libxmlpp libsigcpp pango sdl2-mixer zlib
.\vcpkg.exe install fftw3 freetype gettext glibmm gtkmm libjpeg-turbo libpng libxmlpp libsigcpp pango sdl2-mixer zlib
8 changes: 2 additions & 6 deletions 1-setup-linux-native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# glibmm (platform depended functions)
# mlt++ imagemagick openexr libmng libpng libjpeg (various formats reading functions)
# libxml++ libxml2 libxslt (.sif XML reading)
# boost cairo fftw pango (image transformation and rendering functions)
# cairo fftw pango (image transformation and rendering functions)
# gtkmm3 (Synfig Studio GUI)
# libsig++ (GUI signals and events)
# sdl2 sdl2_mixer jack (audio output and synchronization)
Expand Down Expand Up @@ -83,7 +83,6 @@ if ([ "$ID_LIKE" == "fedora" ] && [ VERSION_ID > 22 ]); then
automake \
libtool \
libtool-ltdl-devel \
boost-devel \
shared-mime-info \
OpenEXR-devel \
libmng-devel \
Expand Down Expand Up @@ -129,7 +128,6 @@ elif ([ "$ID_LIKE" == "fedora" ] && [ VERSION_ID <= 22]); then
automake \
libtool \
libtool-ltdl-devel \
boost-devel \
shared-mime-info \
OpenEXR-devel \
libmng-devel \
Expand All @@ -150,7 +148,7 @@ elif ([ "$ID_LIKE" == "fedora" ] && [ VERSION_ID <= 22]); then
fi

elif [ "$ID_LIKE" == "suse opensuse" ]; then
PKG_LIST="git libpng-devel libjpeg-devel freetype-devel fontconfig-devel atk-devel pango-devel cairo-devel gtk3-devel gettext-devel libxml2-devel libxml++-devel gcc-c++ autoconf automake libtool libtool-ltdl-devel boost-devel shared-mime-info"
PKG_LIST="git libpng-devel libjpeg-devel freetype-devel fontconfig-devel atk-devel pango-devel cairo-devel gtk3-devel gettext-devel libxml2-devel libxml++-devel gcc-c++ autoconf automake libtool libtool-ltdl-devel shared-mime-info"
PKG_LIST="${PKG_LIST} OpenEXR-devel libmng-devel ImageMagick-c++-devel gtkmm3-devel glibmm2-devel"

if ! ( rpm -qv $PKG_LIST ); then
Expand All @@ -167,7 +165,6 @@ elif [ "$ID_LIKE" == "suse opensuse" ]; then
elif [ "$ID_LIKE" == "arch" ]; then
PKG_LIST="git \
automake autoconf \
boost \
cairo \
freetype2 \
fftw \
Expand Down Expand Up @@ -230,7 +227,6 @@ elif [ "$ID_LIKE" == "debian" ] || [ "$ID_LIKE" == "ubuntu" ] || [ "$ID_LIKE" ==
libglibmm-2.4-dev \
libsigc++-2.0-dev \
libxml++2.6-dev \
libboost-system-dev \
libmagick++-dev \
libxslt-dev python-dev python3-lxml"
else
Expand Down
1 change: 0 additions & 1 deletion 1-setup-osx-brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ PACKAGES="\
adwaita-icon-theme \
autoconf \
automake \
boost \
ccache \
cmake \
fftw \
Expand Down
1 change: 0 additions & 1 deletion 1-setup-windows-msys2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ libtool \
make \
patch \
tar \
$MINGW_PACKAGE_PREFIX-boost \
$MINGW_PACKAGE_PREFIX-ccache \
$MINGW_PACKAGE_PREFIX-cmake \
$MINGW_PACKAGE_PREFIX-dlfcn \
Expand Down
9 changes: 0 additions & 9 deletions autobuild/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,6 @@ cd synfig-core
pushd "${REPO_DIR}/synfig-core/" >/dev/null
/bin/bash "${REPO_DIR}/synfig-core/bootstrap.sh"
popd >/dev/null
if [ -e /etc/debian_version ] && [ -z "$BOOST_CONFIGURE_OPTIONS" ]; then
# Debian/Ubuntu multiarch
MULTIARCH_LIBDIR="/usr/lib/`uname -m`-linux-gnu/"
if [ -e "${MULTIARCH_LIBDIR}/libboost_program_options.so" ]; then
export BOOST_CONFIGURE_OPTIONS="--with-boost-libdir=$MULTIARCH_LIBDIR"
fi
fi
if [[ `uname -o` == "Msys" ]]; then
# Currently there is an error when building with Magick++ on MSYS2
export CONFIGURE_OPTIONS="--without-magickpp"
Expand All @@ -237,14 +230,12 @@ if [[ `uname` == "Darwin" ]]; then
# Currently there is an error when building with imagemack on OSX >= High Sierra
export CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS --without-imagemagick --without-magickpp"
fi
export BOOST_CONFIGURE_OPTIONS="--with-boost=$(brew --prefix boost)"
fi
/bin/bash "${REPO_DIR}/synfig-core/configure" --prefix="${PREFIX}" \
--includedir="${PREFIX}/include" \
--disable-static --enable-shared \
--without-libavcodec \
--without-included-ltdl \
$BOOST_CONFIGURE_OPTIONS \
$CONFIGURE_OPTIONS \
$DEBUG
cd ..
Expand Down
6 changes: 2 additions & 4 deletions autobuild/default-nixpkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,12 @@ let
src = ../synfig-core;

configureFlags = [
"--with-boost=${boost.dev}"
"--with-boost-libdir=${boost.out}/lib"
];

nativeBuildInputs = [ pkgconfig autoreconfHook gettext ];

buildInputs = [
ETL boost cairo fftw glibmm intltool libjpeg libsigcxx libxmlxx
ETL cairo fftw glibmm intltool libjpeg libsigcxx libxmlxx
mlt imagemagick pango which
];

Expand All @@ -66,7 +64,7 @@ stdenv.mkDerivation rec {

nativeBuildInputs = [ pkgconfig autoreconfHook gettext ];
buildInputs = [
ETL boost cairo fftw glibmm gnome3.defaultIconTheme gtk3 gtkmm3
ETL cairo fftw glibmm gnome3.defaultIconTheme gtk3 gtkmm3
imagemagick intltool libjack2 libsigcxx libxmlxx makeWrapper mlt
synfig which
];
Expand Down
3 changes: 1 addition & 2 deletions autobuild/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,14 @@ stdenv.mkDerivation rec {

nativeBuildInputs = [ pkgconfig autoreconfHook gettext gnumake makeWrapper ];
buildInputs = [
boost cairo ffmpeg fftw intltool glibmm gnome3.defaultIconTheme gtk3 gtkmm3
cairo ffmpeg fftw intltool glibmm gnome3.defaultIconTheme gtk3 gtkmm3
imagemagick intltool libjpeg libjack2 libsigcxx libxmlxx mlt
pango which
];

preConfigure = "";
configureScript = "";

BOOST_CONFIGURE_OPTIONS = " --with-boost=${boost.dev} --with-boost-libdir=${boost.out}/lib ";
ADWAITA_PATH = "${gnome3.adwaita-icon-theme.out}";
MAKE_WRAPPER_PATH = "${makeWrapper.out}";

Expand Down
30 changes: 0 additions & 30 deletions autobuild/fedora-crosscompile-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ GTKGLEXTMM_VERSION=1.2.0
LIBXMLPP_VERSION=2.22.0
GLIBMM_VERSION=2.42.0
CAIRO_VERSION=1.12.18
BOOST_VERSION=1_53_0
ATK_VERSION=2.14.0
AT_SPI2_VERSION=2.10.2
AT_SPI2_ATK_VERSION=2.10.2
Expand Down Expand Up @@ -1425,33 +1424,6 @@ if [ ! -f ${PREFIX}/../${PKG_NAME}-${PKG_VERSION}.done ]; then
fi
}

mkboost()
{
PKG_NAME=boost
PKG_VERSION="${BOOST_VERSION}"
TAREXT=bz2
if ! cat ${PREFIX}/include/boost/version.hpp |egrep "BOOST_LIB_VERSION \"${PKG_VERSION%_*}\""; then
#PATH_BAK=$PATH
#PATH="${DEPSPREFIX}/bin-gcc/:$PATH"
#rm -rf ${DEPSPREFIX}/lib/libboost_program_options* || true
#rm -rf ${PREFIX}/lib/libboost_program_options* || true
rsync -av ${SOURCES_URL}/${PKG_NAME}_${PKG_VERSION}.tar.${TAREXT} ${WORKSPACE}/cache/${PKG_NAME}_${PKG_VERSION}.tar.${TAREXT}
pushd ${SRCPREFIX}
[ ! -d ${PKG_NAME}_${PKG_VERSION} ] && tar -xjf ${WORKSPACE}/cache/${PKG_NAME}_${PKG_VERSION}.tar.${TAREXT}
cd ${PKG_NAME}_${PKG_VERSION}
./bootstrap.sh --prefix=${PREFIX} \
--libdir=${PREFIX}/lib \
--exec-prefix=${PREFIX} \
--with-libraries=program_options,filesystem,system,chrono
./b2
./b2 install || true
cd ..
popd
#PATH="$PATH_BAK"
fi
#cp ${DEPSPREFIX}/lib/libboost_program_options.so.*.0 ${PREFIX}/lib/
}

mklibdrm()
{
PKG_NAME=libdrm
Expand Down Expand Up @@ -1842,7 +1814,6 @@ make clean || true
--sysconfdir=${PREFIX}/etc \
--disable-static --enable-shared \
--with-magickpp --without-libavcodec \
--with-boost=${PREFIX}/ \
--enable-warnings=minimum \
$DEBUG_OPT
make -j${THREADS}
Expand Down Expand Up @@ -2334,7 +2305,6 @@ mkall()
#fi
mkmlt
mkimagemagick
mkboost
mkfftw

# synfig-studio deps
Expand Down
7 changes: 1 addition & 6 deletions autobuild/fedora-crosscompile-win.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ if [ ! -z $DEPS ]; then
${TOOLCHAIN}-libxml++ \
${TOOLCHAIN}-cairo \
${TOOLCHAIN}-pango \
${TOOLCHAIN}-boost \
${TOOLCHAIN}-libjpeg-turbo \
${TOOLCHAIN}-gtkmm30 \
${TOOLCHAIN}-glibmm24 \
Expand Down Expand Up @@ -123,10 +122,6 @@ for file in \
iconv.dll \
libatk-\*.dll \
libatkmm-1.6-1.dll \
libboost_chrono\*.dll \
libboost_filesystem\*.dll \
libboost_program_options\*.dll \
libboost_system\*.dll \
libbz2\*.dll \
libcairo\*.dll \
libdl.dll \
Expand Down Expand Up @@ -611,7 +606,7 @@ ${TOOLCHAIN}-configure \
--sysconfdir=${PREFIX}/etc \
--datarootdir=${PREFIX}/share \
--enable-optimization=3 \
--disable-static --enable-shared --with-magickpp --without-libavcodec --with-boost=/usr/${TOOLCHAIN_HOST}/sys-root/mingw/ --enable-warnings=minimum $DEBUG
--disable-static --enable-shared --with-magickpp --without-libavcodec --enable-warnings=minimum $DEBUG
make install -j$THREADS
}

Expand Down
1 change: 0 additions & 1 deletion autobuild/snap-stable/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ parts:
- libmlt-dev
- libmlt++-dev
- libmlt-data
- libboost-system-dev
- libmng-dev
- git
stage-packages:
Expand Down
7 changes: 1 addition & 6 deletions autobuild/synfigstudio-cygwin-mingw-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,6 @@ rpm -Uhv --force --ignoreos --nodeps yum-utils-1.1.31-18.fc20.noarch.rpm
fedora-mingw-install mingw${ARCH}-libxml++
fedora-mingw-install mingw${ARCH}-cairo
fedora-mingw-install mingw${ARCH}-pango
fedora-mingw-install mingw${ARCH}-boost
fedora-mingw-install mingw${ARCH}-libjpeg-turbo
fedora-mingw-install mingw${ARCH}-gtkmm30
fedora-mingw-install mingw${ARCH}-SDL
Expand Down Expand Up @@ -1010,7 +1009,7 @@ cd $SRCPREFIX/synfig-core
--build=i686-pc-cygwin --host=${TOOLCHAIN_HOST} \
--enable-shared --disable-static \
--with-libiconv-prefix=no --with-libintl-prefix=no \
--with-magickpp=yes --with-boost=${MINGWPREFIX} \
--with-magickpp=yes \
--enable-maintainer-mode $DEBUG
make -j$THREADS
make install
Expand Down Expand Up @@ -1088,10 +1087,6 @@ for file in \
iconv.dll \
libatk-\*.dll \
libatkmm-1.6-1.dll \
libboost_chrono\*.dll \
libboost_filesystem\*.dll \
libboost_program_options\*.dll \
libboost_system\*.dll \
libbz2\*.dll \
libcairo\*.dll \
libdl.dll \
Expand Down
4 changes: 1 addition & 3 deletions autobuild/synfigstudio-cygwin-native-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ $CYGWIN_SETUP \
-P pkg-config \
-P libcairo-devel \
-P libpango1.0-devel \
-P libboost-devel \
-P libboost1.50 \
-P libjpeg-devel \
-P libpng-devel \
-P p7zip \
Expand All @@ -41,4 +39,4 @@ cd $SRCPREFIX/synfig-core
./bootstrap.sh
./configure --prefix=/usr
make -j4
make install
make install
3 changes: 1 addition & 2 deletions autobuild/synfigstudio-osx-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ mkdeps()
openexr \
pkgconfig \
ffmpeg \
boost \
cairo \
libtool \
libsdl2 \
Expand Down Expand Up @@ -308,7 +307,7 @@ mksynfig()
if [[ ! $UNIVERSAL == 0 ]]; then
export DEPTRACK="--disable-dependency-tracking"
fi
/bin/sh ./configure ${DEPTRACK} --prefix=${SYNFIG_PREFIX} --includedir=${SYNFIG_PREFIX}/include --disable-static --enable-shared --with-magickpp --without-libavcodec --with-boost=${MACPORTS} ${DEBUG}
/bin/sh ./configure ${DEPTRACK} --prefix=${SYNFIG_PREFIX} --includedir=${SYNFIG_PREFIX}/include --disable-static --enable-shared --with-magickpp --without-libavcodec ${DEBUG}
make -j$JOBS install
popd
}
Expand Down
8 changes: 0 additions & 8 deletions autobuild/synfigstudio-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@ YLW='\033[1;33m'
GRN='\033[0;32m'
NC='\033[0m' # No Color

if [ -e /etc/debian_version ] && [ -z $with_boost_libdir ]; then
# Debian/Ubuntu multiarch
MULTIARCH_LIBDIR="/usr/lib/`uname -m`-linux-gnu/"
if [ -e "${MULTIARCH_LIBDIR}/libboost_program_options.so" ]; then
export with_boost_libdir=$MULTIARCH_LIBDIR
fi
fi

if [[ `uname` == "MINGW"* ]]; then # MacOS doesn't support `uname -o` flag
PATH="${MINGW_PREFIX}/lib/ccache/bin:${PATH}"
PKG_CONFIG_PATH="/opt/mlt-7.2.0/lib/pkgconfig:${PKG_CONFIG_PATH}"
Expand Down
1 change: 0 additions & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ parts:
- libmlt-dev
- libmlt++-dev
- libmlt-data
- libboost-system-dev
- libmng-dev
- git
- libxml2-utils # to extract version from appdata file
Expand Down
15 changes: 1 addition & 14 deletions synfig-core/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -417,16 +417,6 @@ PKG_CHECK_MODULES(MLTPP, mlt++-7,[
])
])

AX_BOOST_BASE([1.53.0],,AC_MSG_ERROR([ ** You need to install Boost >= 1.53.0]))
#AX_BOOST_SYSTEM
#if test "x$ax_cv_boost_system" != "xyes" ; then
# AC_MSG_ERROR([ ** You need to install Boost system library])
#fi
# Boost program options and system libraries are just dependencies
# of the synfig cli and therefore
# not required to link against the synfig library.


TARGET_PNG="yes"
TARGET_MNG="yes"

Expand Down Expand Up @@ -520,7 +510,7 @@ AC_SUBST(CONFIG_DEPS)
AC_SUBST(ETL_CFLAGS)

SYNFIG_LIBS="$VIMAGE_LIBS $LIBZ_LIBS $GLIBMM_LIBS $GIOMM_LIBS $LIBXMLPP_LIBS $LIBGL_LIBS $LIBCL_LIBS $LIBFFTW_LIBS $MLTPP_LIBS $ETL_LIBS $LIBSIGC_LIBS $LTLIBINTL"
SYNFIG_CFLAGS="$BOOST_CPPFLAGS $LIBZ_CFLAGS $GLIBMM_CFLAGS $GIOMM_CFLAGS $LIBXMLPP_CFLAGS $LIBGL_CFLAGS $LIBCL_CFLAGS $LIBFFTW_CFLAGS $MLTPP_CFLAGS $ETL_CFLAGS $LIBSIGC_CFLAGS $CONFIG_CFLAGS -DSYNFIG_NO_DEPRECATED -DLOCALEDIR=\\\"$localedir\\\""
SYNFIG_CFLAGS="$LIBZ_CFLAGS $GLIBMM_CFLAGS $GIOMM_CFLAGS $LIBXMLPP_CFLAGS $LIBGL_CFLAGS $LIBCL_CFLAGS $LIBFFTW_CFLAGS $MLTPP_CFLAGS $ETL_CFLAGS $LIBSIGC_CFLAGS $CONFIG_CFLAGS -DSYNFIG_NO_DEPRECATED -DLOCALEDIR=\\\"$localedir\\\""

CONFIG_CFLAGS="`echo $CONFIG_CFLAGS | sed s/-mno-cygwin//g | sed s/-mwindows//g`"
SYNFIG_CFLAGS="`echo $SYNFIG_CFLAGS | sed s/-mno-cygwin//g | sed s/-mwindows//g`"
Expand Down Expand Up @@ -617,7 +607,4 @@ OpenEXR --------------------------> $with_openexr
"'$'"ETL_LIBS ------------------------> '$ETL_LIBS'
"'$'"LIBSIGC_LIBS --------------------> '$LIBSIGC_LIBS'
"'$'"SYNFIG_CFLAGS -------------------> '$SYNFIG_CFLAGS'
"'$'"BOOST_CPPFLAGS ------------------> '$BOOST_CPPFLAGS'
"'$'"BOOST_LDFLAGS -------------------> '$BOOST_LDFLAGS'
"'$'"BOOST_SYSTEM_LIB ----------------> '$BOOST_SYSTEM_LIB'
"
Loading

0 comments on commit 18b9d2b

Please sign in to comment.