From 38c085d04677559b5232b1ac7ae5469f6bb77e4d Mon Sep 17 00:00:00 2001 From: waker Date: Sat, 20 Nov 2010 16:36:31 +0100 Subject: portable-0.4.4-r1 --- PORTABLE_BUILD | 2 +- PORTABLE_VERSION | 2 +- configure.ac | 52 +++++++++++++++++++------------- deadbeef.h | 5 ++-- main.c | 59 ++++++++++++++++++++++++------------- plugins/gtkui/Makefile.am | 4 +-- scripts/portable_build.sh | 4 +-- scripts/portable_package.sh | 2 +- scripts/portable_package_partial.sh | 36 ++++++++++++++++++++++ threading_pthread.c | 2 +- 10 files changed, 117 insertions(+), 51 deletions(-) create mode 100755 scripts/portable_package_partial.sh diff --git a/PORTABLE_BUILD b/PORTABLE_BUILD index 00750edc..d00491fd 100644 --- a/PORTABLE_BUILD +++ b/PORTABLE_BUILD @@ -1 +1 @@ -3 +1 diff --git a/PORTABLE_VERSION b/PORTABLE_VERSION index 17b2ccd9..6f2743d6 100644 --- a/PORTABLE_VERSION +++ b/PORTABLE_VERSION @@ -1 +1 @@ -0.4.3 +0.4.4 diff --git a/configure.ac b/configure.ac index 2a364423..36f5b1b1 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([deadbeef], [0.4.3]) +AC_INIT([deadbeef], [0.4.4]) AC_CONFIG_HEADER(config.h) @@ -94,12 +94,25 @@ AC_ARG_ENABLE(aac, [AS_HELP_STRING([--disable-aac ], [disable AAC decod AC_ARG_ENABLE(mms, [AS_HELP_STRING([--disable-mms ], [disable MMS streaming vfs plugin (default: enabled)])], [enable_mms=$enableval], [enable_mms=yes]) AC_ARG_ENABLE(shn, [AS_HELP_STRING([--disable-shn ], [disable shorten plugin (default: enabled)])], [enable_shn=$enableval], [enable_shn=yes]) AC_ARG_ENABLE(ao, [AS_HELP_STRING([--disable-ao ], [disable audio overload plugin (default: enabled)])], [enable_ao=$enableval], [enable_ao=yes]) -AC_ARG_ENABLE(mpris, [ --enable-mpris enable Ubuntu Sound Menu plugin (default: disabled)], [enable_mpris=$enableval], [enable_mpris=no]) -AC_ARG_ENABLE(portable, [ --enable-portable make portable static build (default: disabled)], [enable_portable=$enableval], [enable_portable=no]) +AC_ARG_ENABLE(mpris, [AS_HELP_STRING([ --enable-mpris enable Ubuntu Sound Menu plugin (default: disabled)])], [enable_mpris=$enableval], [enable_mpris=no]) +AC_ARG_ENABLE(staticlink, [AS_HELP_STRING([ --enable-staticlink link everything statically (default: disabled)])], [enable_staticlink=$enableval], [enable_staticlink=no]) +AC_ARG_ENABLE(portable, [AS_HELP_STRING([ --enable-portable make portable build (default: disabled, opts: yes,no,full)])], [enable_portable=$enableval], [enable_portable=no]) -if test "x$enable_portable" != "xno" ; then +if test "x$enable_staticlink" != "xno" ; then + AC_DEFINE_UNQUOTED([STATICLINK], [1], [Define if building static version]) + STATICLINK=yes +fi + +if test "x$enable_portable" != "xno" && test "x$enable_staticlink" != "xno" ; then AC_DEFINE_UNQUOTED([PORTABLE], [1], [Define if building portable version]) PORTABLE=yes + + + if test "x$enable_portable" == "xfull" ; then + AC_DEFINE_UNQUOTED([PORTABLE_FULL], [1], [Define if portable version should keep configs in app folder]) + PORTABLE_FULL=yes + fi + PREFIXFLAGS="-DPREFIX=donotuse -DLIBDIR=donotuse -DDOCDIR=donotuse -I./include -I../../include" else PREFIXFLAGS=" -DLIBDIR=\\\"$libdir\\\" -DPREFIX=\\\"$prefix\\\" -DDOCDIR=\\\"$docdir\\\"" @@ -109,7 +122,7 @@ CXXFLAGS="$CXXFLAGS $INSANE_CXXFLAGS -D_GNU_SOURCE $PREFIXFLAGS" CFLAGS="$CFLAGS $INSANE_CFLAGS -D_GNU_SOURCE $PREFIXFLAGS" PKG_CHECK_MODULES(DEPS, samplerate) -if test "x$enable_portable" != "xno" ; then +if test "x$enable_staticlink" != "xno" ; then DEPS_LIBS="$LIB/libsamplerate.a -lpthread -ldl" AC_SUBST(DEPS_LIBS) else @@ -131,7 +144,7 @@ if test "x$enable_alsa" != "xno" ; then fi if test "x$enable_ffmpeg" != "xno" ; then -if test "x$enable_portable" != "xno" ; then +if test "x$enable_staticlink" != "xno" ; then FFMPEG_DEPS_LIBS="../../$LIB/libavcodec.a -lpthread ../../$LIB/libavformat.a ../../$LIB/libavcodec.a ../../$LIB/libavutil.a ../../$LIB/libavcore.a -lm ../../$LIB/libz.a " AC_SUBST(FFMPEG_DEPS_LIBS) HAVE_FFMPEG=yes @@ -144,9 +157,6 @@ if test "x$enable_pulse" != "xno" ; then PKG_CHECK_MODULES(PULSE_DEPS, libpulse-simple, HAVE_PULSE=yes, HAVE_PULSE=no) fi -dnl AC_CHECK_LIB([pthread], [main]) -dnl AC_CHECK_LIB([dl], [main]) - AC_CHECK_HEADER([iconv.h],[],[iconv.h not found.]) AC_CHECK_LIB([iconv], [main], [have_iconv=yes], [have_iconv=no]) @@ -162,7 +172,7 @@ if test ${HAVE_SSE2}; then fi dnl curl lib -if test "x$enable_portable" != "xno" ; then +if test "x$enable_staticlink" != "xno" ; then HAVE_CURL=yes CURL_LIBS="../../$LIB/libcurl.a -lrt" AC_SUBST(CURL_LIBS) @@ -172,7 +182,7 @@ else AC_SUBST(CURL_LIBS) fi -if test "x$enable_portable" != "xno" ; then +if test "x$enable_staticlink" != "xno" ; then HAVE_DBUS=yes DBUS_DEPS_LIBS="../../$LIB/libdbus-1.a ../../$LIB/libexpat.a -lrt" DBUS_DEPS_CFLAGS="-I../../include/dbus-1" @@ -184,7 +194,7 @@ fi dnl mpgmad plugin if test "x$enable_mpgmad" != "xno" ; then -if test "x$enable_portable" != "xno" ; then +if test "x$enable_staticlink" != "xno" ; then HAVE_MPGMAD=yes MAD_LIBS="../../$LIB/libmad.a" AC_SUBST(MAD_LIBS) @@ -200,7 +210,7 @@ fi dnl vorbis plugin if test "x$enable_vorbis" != "xno" ; then -if test "x$enable_portable" != "xno" ; then +if test "x$enable_staticlink" != "xno" ; then HAVE_VORBISPLUGIN=yes VORBIS_LIBS="../../$LIB/libogg.a ../../$LIB/libvorbis.a ../../$LIB/libvorbisenc.a ../../$LIB/libvorbisfile.a" AC_SUBST(VORBIS_LIBS) @@ -217,7 +227,7 @@ fi dnl flac plugin if test "x$enable_flac" != "xno" ; then -if test "x$enable_portable" != "xno" ; then +if test "x$enable_staticlink" != "xno" ; then HAVE_FLACPLUGIN=yes FLAC_LIBS="../../$LIB/libFLAC.a ../../$LIB/libogg.a" AC_SUBST(FLAC_LIBS) @@ -233,7 +243,7 @@ fi dnl wavpack plugin if test "x$enable_wavpack" != "xno" ; then -if test "x$enable_portable" != "xno" ; then +if test "x$enable_staticlink" != "xno" ; then HAVE_WAVPACKPLUGIN=yes WAVPACK_LIBS="../../$LIB/libwavpack.a" AC_SUBST(WAVPACK_LIBS) @@ -249,7 +259,7 @@ fi dnl libsndfile plugin if test "x$enable_sndfile" != "xno" ; then -if test "x$enable_portable" != "xno" ; then +if test "x$enable_staticlink" != "xno" ; then HAVE_SNDFILEPLUGIN=yes SNDFILE_LIBS="../../$LIB/libsndfile.a" AC_SUBST(SNDFILE_LIBS) @@ -274,7 +284,7 @@ fi dnl cdda plugin if test "x$enable_cdda" != "xno" ; then -if test "x$enable_portable" != "xno" ; then +if test "x$enable_staticlink" != "xno" ; then HAVE_CDDAPLUGIN=yes CDDA_LIBS="../../$LIB/libcdio.a ../../$LIB/libudf.a ../../$LIB/libiso9660.a ../../$LIB/libcddb.a" AC_SUBST(CDDA_LIBS) @@ -303,7 +313,7 @@ if test "x$enable_alsa" != "xno" ; then fi if test "x$enable_ffmpeg" != "xno" ; then -if test "x$enable_portable" = "xno" ; then +if test "x$enable_staticlink" = "xno" ; then if test "x$HAVE_FFMPEG" = "xyes" ; then HAVE_FFMPEGPLUGIN=yes AC_CHECK_HEADER([ffmpeg/avformat.h], FFMPEG_DEPS_CFLAGS="$FFMPEG_DEPS_CFLAGS -D FFMPEG_OLD") @@ -442,7 +452,7 @@ if test "x$enable_dca" != "xno" ; then fi if test "x$enable_aac" != "xno" ; then -if test "x$enable_portable" != "xno" ; then +if test "x$enable_staticlink" != "xno" ; then FAAD2_LIBS="../../$LIB/libfaad.a" AC_SUBST(FAAD2_LIBS) HAVE_AAC=yes @@ -467,7 +477,7 @@ if test "x$enable_shn" != "xno" ; then fi if test "x$enable_ao" != "xno" ; then -if test "x$enable_portable" != "xno" ; then +if test "x$enable_staticlink" != "xno" ; then HAVE_ZLIB=yes ZLIB_LIBS="../../$LIB/libz.a" else @@ -520,7 +530,9 @@ AM_CONDITIONAL(HAVE_MMS, test "x$HAVE_MMS" = "xyes") AM_CONDITIONAL(HAVE_SHN, test "x$HAVE_SHN" = "xyes") AM_CONDITIONAL(HAVE_AO, test "x$HAVE_AO" = "xyes") AM_CONDITIONAL(HAVE_MPRIS, test "x$HAVE_MPRIS" = "xyes") +AM_CONDITIONAL(STATICLINK, test "x$STATICLINK" = "xyes") AM_CONDITIONAL(PORTABLE, test "x$PORTABLE" = "xyes") +AM_CONDITIONAL(PORTABLE_FULL, test "x$PORTABLE_FULL" = "xyes") AC_SUBST(PLUGINS_DIRS) diff --git a/deadbeef.h b/deadbeef.h index 30b09ef2..2826502e 100644 --- a/deadbeef.h +++ b/deadbeef.h @@ -2,7 +2,7 @@ deadbeef.h -- plugin API of the DeaDBeeF audio player http://deadbeef.sourceforge.net - Copyright (C) 2009 Alexey Yakovenko + Copyright (C) 2009-2010 Alexey Yakovenko This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -55,6 +55,7 @@ extern "C" { // api version history: // 9.9 -- devel +// 0.10 -- deadbeef-0.4.4-portable-r1 // 0.9 -- deadbeef-0.4.3-portable-build3 // 0.8 -- deadbeef-0.4.2 // 0.7 -- deabdeef-0.4.0 @@ -66,7 +67,7 @@ extern "C" { // 0.1 -- deadbeef-0.2.0 #define DB_API_VERSION_MAJOR 0 -#define DB_API_VERSION_MINOR 9 +#define DB_API_VERSION_MINOR 10 #define DB_PLUGIN_SET_API_VERSION\ .plugin.api_vmajor = DB_API_VERSION_MAJOR,\ diff --git a/main.c b/main.c index 9e9bb6b7..b71f456f 100644 --- a/main.c +++ b/main.c @@ -534,8 +534,18 @@ main (int argc, char *argv[]) { bindtextdomain (PACKAGE, LOCALEDIR); bind_textdomain_codeset (PACKAGE, "UTF-8"); textdomain (PACKAGE); -#endif - fprintf (stderr, "starting deadbeef " VERSION "%s\n", PORTABLE ? " [portable build]" : ""); +#endif + + int staticlink = 0; + int portable = 0; +#if STATICLINK + staticlink = 1; +#endif +#if PORTABLE + portable = 1; +#endif + + fprintf (stderr, "starting deadbeef " VERSION "%s%s\n", staticlink ? " [static]" : "", portable ? " [portable]" : ""); srand (time (NULL)); #ifdef __linux__ prctl (PR_SET_NAME, "deadbeef-main", 0, 0, 0, 0); @@ -548,31 +558,15 @@ main (int argc, char *argv[]) { e--; } *e = 0; +#endif + +#if PORTABLE_FULL if (snprintf (confdir, sizeof (confdir), "%s/config", dbinstalldir) > sizeof (confdir)) { fprintf (stderr, "fatal: too long install path %s\n", dbinstalldir); return -1; } strcpy (dbconfdir, confdir); - - if (snprintf (dbdocdir, sizeof (dbdocdir), "%s/doc", dbinstalldir) > sizeof (dbdocdir)) { - fprintf (stderr, "fatal: too long install path %s\n", dbinstalldir); - return -1; - } - if (snprintf (dbplugindir, sizeof (dbplugindir), "%s/plugins", dbinstalldir) > sizeof (dbplugindir)) { - fprintf (stderr, "fatal: too long install path %s\n", dbinstalldir); - return -1; - } - if (snprintf (dbpixmapdir, sizeof (dbpixmapdir), "%s/pixmaps", dbinstalldir) > sizeof (dbpixmapdir)) { - fprintf (stderr, "fatal: too long install path %s\n", dbinstalldir); - return -1; - } - trace ("installdir: %s\n", dbinstalldir); - trace ("confdir: %s\n", confdir); - trace ("docdir: %s\n", dbdocdir); - trace ("plugindir: %s\n", dbplugindir); - mkdir (dbplugindir, 0755); - trace ("pixmapdir: %s\n", dbpixmapdir); #else char *homedir = getenv ("HOME"); if (!homedir) { @@ -598,6 +592,24 @@ main (int argc, char *argv[]) { return -1; } mkdir (confdir, 0755); +#endif + + +#if PORTABLE + if (snprintf (dbdocdir, sizeof (dbdocdir), "%s/doc", dbinstalldir) > sizeof (dbdocdir)) { + fprintf (stderr, "fatal: too long install path %s\n", dbinstalldir); + return -1; + } + if (snprintf (dbplugindir, sizeof (dbplugindir), "%s/plugins", dbinstalldir) > sizeof (dbplugindir)) { + fprintf (stderr, "fatal: too long install path %s\n", dbinstalldir); + return -1; + } + if (snprintf (dbpixmapdir, sizeof (dbpixmapdir), "%s/pixmaps", dbinstalldir) > sizeof (dbpixmapdir)) { + fprintf (stderr, "fatal: too long install path %s\n", dbinstalldir); + return -1; + } + mkdir (dbplugindir, 0755); +#else if (snprintf (dbdocdir, sizeof (dbdocdir), "%s", DOCDIR) > sizeof (dbdocdir)) { fprintf (stderr, "fatal: too long install path %s\n", dbinstalldir); return -1; @@ -611,6 +623,11 @@ main (int argc, char *argv[]) { return -1; } #endif + trace ("installdir: %s\n", dbinstalldir); + trace ("confdir: %s\n", confdir); + trace ("docdir: %s\n", dbdocdir); + trace ("plugindir: %s\n", dbplugindir); + trace ("pixmapdir: %s\n", dbpixmapdir); mkdir (dbconfdir, 0755); diff --git a/plugins/gtkui/Makefile.am b/plugins/gtkui/Makefile.am index 55557ad8..cea8e94dc 100644 --- a/plugins/gtkui/Makefile.am +++ b/plugins/gtkui/Makefile.am @@ -36,7 +36,7 @@ GTKUI_SOURCES = gtkui.c gtkui.h\ EXTRA_DIST = $(gtkui_VALASOURCES) deadbeef.glade -if PORTABLE +if STATICLINK pkglib_LTLIBRARIES = gtkui.la gtkui.fallback.la else pkglib_LTLIBRARIES = gtkui.la @@ -49,7 +49,7 @@ gtkui_la_LIBADD = $(LDADD) $(GTKUI_DEPS_LIBS) gtkui_la_CFLAGS = -std=c99 $(GTKUI_DEPS_CFLAGS) # fallback lib -if PORTABLE +if STATICLINK GTK_ROOT=../../../deadbeef-deps/gtk-debian/usr gtkui_fallback_la_SOURCES = $(gtkui_VALABUILTSOURCES) $(GTKUI_SOURCES) diff --git a/scripts/portable_build.sh b/scripts/portable_build.sh index e973993b..4259c845 100755 --- a/scripts/portable_build.sh +++ b/scripts/portable_build.sh @@ -3,7 +3,7 @@ VERSION=`cat PORTABLE_VERSION | perl -ne 'chomp and print'` ORIGIN=`pwd | perl -ne 'chomp and print'` export APBUILD_STATIC_LIBGCC=1 -CC=$ORIGIN/tools/apbuild/apgcc CXX=$ORIGIN/tools/apbuild/apgcc ./configure --enable-portable --disable-pulse --disable-mpris --enable-maintainer-mode --disable-nls +CC=$ORIGIN/tools/apbuild/apgcc CXX=$ORIGIN/tools/apbuild/apgcc ./configure --enable-staticlink --enable-portable=yes --disable-pulse --disable-mpris --enable-maintainer-mode --disable-nls sed -i 's/-lstdc++ -lm -lgcc_s -lc -lgcc_s/-lm -lc/g' libtool make clean make -j9 @@ -13,5 +13,5 @@ cd tools/pluginfo make cd ../../ -./portable_postbuild.sh +./scripts/portable_postbuild.sh diff --git a/scripts/portable_package.sh b/scripts/portable_package.sh index bf292789..fc6e09b6 100755 --- a/scripts/portable_package.sh +++ b/scripts/portable_package.sh @@ -14,7 +14,7 @@ mkdir -p portable_out/build 2>/dev/null rm portable_out/* 2>/dev/null rm portable_out/build/* 2>/dev/null -tar jcvf portable_out/build/deadbeef-$VERSION-portable-build$BUILD.tar.bz2\ +tar jcvf portable_out/build/deadbeef-$VERSION-portable-r$BUILD.tar.bz2\ $SRCDIR/deadbeef\ $SRCDIR/deadbeef.png\ $DOCDIR\ diff --git a/scripts/portable_package_partial.sh b/scripts/portable_package_partial.sh new file mode 100755 index 00000000..d3d63396 --- /dev/null +++ b/scripts/portable_package_partial.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +# package for distribution +VERSION=`cat PORTABLE_VERSION | perl -ne 'chomp and print'` +BUILD=`cat PORTABLE_BUILD | perl -ne 'chomp and print'` + +# main distro +SRCDIR=deadbeef-$VERSION-portable +PLUGDIR=$SRCDIR/plugins +DOCDIR=$SRCDIR/doc +PIXMAPDIR=$SRCDIR/pixmaps + +tar jcvf portable_out/build/deadbeef-$VERSION-portable-partial-r$BUILD.tar.bz2\ + $SRCDIR/deadbeef\ + $SRCDIR/deadbeef.png\ + $DOCDIR\ + $PLUGDIR/alsa.so\ + $PLUGDIR/oss.so\ + $PLUGDIR/vfs_curl.so\ + $PLUGDIR/artwork.so\ + $PLUGDIR/gtkui.so\ + $PLUGDIR/gtkui.fallback.so\ + $PLUGDIR/hotkeys.so\ + $PLUGDIR/cdda.so\ + $PLUGDIR/mpgmad.so\ + $PLUGDIR/vorbis.so\ + $PLUGDIR/wavpack.so\ + $PLUGDIR/flac.so\ + $PLUGDIR/ffap.so\ + $PLUGDIR/musepack.so\ + $PLUGDIR/notify.so\ + $PLUGDIR/sndfile.so\ + $PLUGDIR/supereq.so\ + $PLUGDIR/tta.so\ + $PIXMAPDIR + diff --git a/threading_pthread.c b/threading_pthread.c index 0705128c..cb80fcb1 100644 --- a/threading_pthread.c +++ b/threading_pthread.c @@ -72,7 +72,7 @@ thread_start_low_priority (void (*fn)(void *ctx), void *ctx) { fprintf (stderr, "pthread_create failed: %s\n", strerror (s)); return 0; } -#if !PORTABLE +#if !STATICLINK s = pthread_setschedprio (tid, minprio); if (s != 0) { fprintf (stderr, "pthread_setschedprio failed: %s\n", strerror (s)); -- cgit v1.2.3