diff options
author | Timo Teräs <timo.teras@iki.fi> | 2012-01-28 18:49:05 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2012-01-28 18:53:32 +0200 |
commit | eb8f81e80242e9359ef9e188a595912822505413 (patch) | |
tree | 1fc5c49fca8a79e0918031730cae306030f072df | |
parent | 328d84a74324de66100c5d26db38646437dede52 (diff) | |
download | aports-eb8f81e80242e9359ef9e188a595912822505413.tar.bz2 aports-eb8f81e80242e9359ef9e188a595912822505413.tar.xz |
testing/vlc: copied form main and upgraded to 2.0.0-rc1
* qt4 and skins2 gui interfaces are also enabled (to subpkg vlc-xorg)
-rw-r--r-- | testing/vlc/APKBUILD | 204 | ||||
-rw-r--r-- | testing/vlc/uclibc-inhibit-spawn.patch | 76 | ||||
-rw-r--r-- | testing/vlc/uclibc-no-xscreensaver.patch | 18 | ||||
-rw-r--r-- | testing/vlc/uclibc3.patch | 38 | ||||
-rw-r--r-- | testing/vlc/vlc-1.1.7-disable-cache-gen.patch | 12 | ||||
-rw-r--r-- | testing/vlc/vlc-daemon.pre-install | 13 | ||||
-rw-r--r-- | testing/vlc/vlc.confd | 11 | ||||
-rwxr-xr-x | testing/vlc/vlc.initd | 22 | ||||
-rw-r--r-- | testing/vlc/vlc.trigger | 4 |
9 files changed, 398 insertions, 0 deletions
diff --git a/testing/vlc/APKBUILD b/testing/vlc/APKBUILD new file mode 100644 index 000000000..450d6f8a8 --- /dev/null +++ b/testing/vlc/APKBUILD @@ -0,0 +1,204 @@ +# Contributor: Leonardo Arena <rnalrd@alpinelinux.org> +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> +pkgname=vlc +pkgver=2.0.0_rc1 +_pkgver=${pkgver/_/-} +pkgrel=0 +pkgdesc="A multi-platform MPEG, VCD/DVD, and DivX player" +pkgusers="vlc" +pkggroups="vlc" +url="http://www.videolan.org/vlc/" +arch="all" +license="GPL-2" +triggers="$pkgname.trigger=/usr/lib/vlc/plugins" +subpackages="$pkgname-dev $pkgname-doc $pkgname-xorg $pkgname-daemon" +#depends="fluidsynth zvbi lirc-utils libdca +# libproxy libdvdnav>=4.1.3 libcddb smbclient +# libmatroska libmpcdec +# qt libmodplug ttf-dejavu" +depends="ttf-dejavu" +makedepends=" + a52dec-dev + alsa-lib-dev + automake + autoconf + avahi-dev + libtool + dbus-dev + faad2-dev + ffmpeg-dev + flac-dev + freetype-dev + fribidi-dev + gtk+-dev + libdc1394-dev + libdvbpsi-dev + libgcrypt-dev + libice-dev + libiconv-dev + libmad-dev + libmpeg2-dev + libnotify-dev + libogg-dev + libraw1394-dev + libshout-dev + libsm-dev + libtheora-dev + libvorbis-dev + libx11-dev + libxext-dev + libxinerama-dev + libxpm-dev + libxv-dev + live-media-dev + lua-dev + ncurses-dev + mesa-dev + pkgconfig + qt-dev + sdl-dev + speex-dev + sysfsutils-dev + taglib-dev + v4l-utils-dev + x264-dev + xcb-util-renderutil-dev + xcb-util-keysyms-dev + " +source="http://download.videolan.org/pub/videolan/testing/$pkgname-$_pkgver/$pkgname-$_pkgver.tar.xz + uclibc-inhibit-spawn.patch + uclibc-no-xscreensaver.patch + uclibc3.patch + vlc.trigger + " +# uclibc-libcompat.patch +# vlc-1.1.7-disable-cache-gen.patch + +_builddir="$srcdir"/$pkgname-$_pkgver +prepare() { + cd "$_builddir" + for i in $source; do + case $i in + *.patch) + msg "Applying $i" + patch -p1 -i "$srcdir"/$i || return 1 + ;; + esac; + done + sed -i -e "/^libxscreensaver_plugin_la_SOURCES/s/^/#/" modules/misc/Modules.am + ./bootstrap +} + +build () +{ + cd "$_builddir" + sed -i -e 's:/usr/share/fonts/truetype/freefont/FreeSerifBold.ttf:/usr/share/fonts/TTF/DejaVuSerif-Bold.ttf:' modules/misc/freetype.c + + export CFLAGS="$CFLAGS -D_GNU_SOURCE" + + ./configure --prefix=/usr \ + --disable-mmx \ + --disable-nls \ + --disable-optimizations \ + --disable-rpath \ + --enable-a52 \ + --enable-avcodec \ + --enable-avformat \ + --enable-dbus \ + --enable-dbus-control \ + --enable-dc1394 \ + --enable-dvbpsi \ + --enable-faad \ + --enable-flac \ + --enable-httpd \ + --enable-live555 \ + --enable-merge-ffmpeg \ + --enable-ncurses \ + --enable-qt4 \ + --enable-realrtsp \ + --enable-sdl \ + --enable-shout \ + --enable-skins2 \ + --enable-speex \ + --enable-sout \ + --enable-taglib \ + --enable-theora \ + --enable-v4l2 \ + --enable-vlm \ + --enable-vorbis \ + --enable-wma-fixed \ + --enable-xvideo \ + || return 1 + +# --enable-dvdread \ +# --enable-dvdnav \ +# --enable-dvb \ +# --enable-snapshot \ +# --enable-hal \ +# --enable-lirc \ +# --enable-pvr \ + + make || return 1 +} + +package() { + cd "$_builddir" + make DESTDIR="$pkgdir" install || return 1 +# for res in 16 32 48 128; do +# install -D -m644 share/vlc${res}x${res}.png \ +# "$pkgdir"/usr/share/icons/hicolor/${res}x${res}/apps/vlc.png || return 1 +# done + # delete cache as it's autocreated by trigger + rm -rf "$pkgdir"/usr/lib/vlc/plugins/plugins.dat + # delete unneeded mozilla and kde support files + rm -rf "$pkgdir"/usr/lib/mozilla + rm -rf "$pkgdir"/usr/share/kde4 + find "$pkgdir" -name '*.la' -delete +} + +_mv() { + local dir=${1%/*} + mkdir -p "$subpkgdir"/$dir + mv "$1" "$subpkgdir"/$dir/ +} + +xorg() { + pkgdesc="Video LAN X.org support" + depends="xdg-utils vlc>=2.0.0_rc1-r0" + + # scan for elf files that directly or indirectly depends on + # libX* libraries + cd "$pkgdir" + for i in $(find -type f ); do + if ldd $i 2>/dev/null | grep -E -q "libX|x11|libxcb"; then + echo $i | grep libavcodec_plugin.so || _mv "$i" || return 1 + fi + done + + mkdir -p "$subpkgdir"/usr/share/vlc + mv "$pkgdir"/usr/share/applications \ + "$pkgdir"/usr/share/icons \ + "$subpkgdir"/usr/share/ + + mv "$pkgdir"/usr/share/vlc/skins2 \ + "$subpkgdir"/usr/share/vlc +} + +daemon() { + pkgdesc="Support for running VLC as a daemon" + install="vlc-daemon.pre-install" + arch="noarch" + depends="vlc>=2.0.0_rc1-r0" + + mkdir -p "$subpkgdir" + cd "$pkgdir" + install -D -m755 ../../vlc.initd $subpkgdir/etc/init.d/vlc + install -D -m664 ../../vlc.confd $subpkgdir/etc/conf.d/vlc + install -d -o vlc -g vlc "$subpkgdir"/var/log/vlc +} + +md5sums="8c4bfbc5e79ff0bdfff572d53b03a92a vlc-2.0.0-rc1.tar.xz +28349b8239fdd6987fbe0ca2c758517f uclibc-inhibit-spawn.patch +b84c5a9121440b6a1dcf28792d783eb8 uclibc-no-xscreensaver.patch +94f11ec8394775018222781a0c875444 uclibc3.patch +ddbd40bd72fedc1449be45588aea5d66 vlc.trigger" diff --git a/testing/vlc/uclibc-inhibit-spawn.patch b/testing/vlc/uclibc-inhibit-spawn.patch new file mode 100644 index 000000000..c34ebe0f7 --- /dev/null +++ b/testing/vlc/uclibc-inhibit-spawn.patch @@ -0,0 +1,76 @@ +diff --git a/modules/misc/inhibit/xdg.c b/modules/misc/inhibit/xdg.c +index 3f297c6..e16a21e 100644 +--- a/modules/misc/inhibit/xdg.c ++++ b/modules/misc/inhibit/xdg.c +@@ -27,7 +27,11 @@ + #include <vlc_inhibit.h> + #include <assert.h> + #include <signal.h> +-#include <spawn.h> ++#if !defined(_POSIX_SPAWN) ++# define _POSIX_SPAWN -1 ++#else ++# include <spawn.h> ++#endif + #include <sys/wait.h> + + static int Open (vlc_object_t *); +@@ -47,7 +51,9 @@ struct vlc_inhibit_sys + vlc_thread_t thread; + vlc_cond_t update, inactive; + vlc_mutex_t lock; ++#if (_POSIX_SPAWN >= 0) + posix_spawnattr_t attr; ++#endif + bool suspend, suspended; + }; + +@@ -67,17 +73,19 @@ static int Open (vlc_object_t *obj) + vlc_mutex_init (&p_sys->lock); + vlc_cond_init (&p_sys->update); + vlc_cond_init (&p_sys->inactive); +- posix_spawnattr_init (&p_sys->attr); + /* Reset signal handlers to default and clear mask in the child process */ + { + sigset_t set; + + sigemptyset (&set); +- posix_spawnattr_setsigmask (&p_sys->attr, &set); + sigaddset (&set, SIGPIPE); ++#if (_POSIX_SPAWN >= 0) ++ posix_spawnattr_init (&p_sys->attr); ++ posix_spawnattr_setsigmask (&p_sys->attr, &set); + posix_spawnattr_setsigdefault (&p_sys->attr, &set); + posix_spawnattr_setflags (&p_sys->attr, POSIX_SPAWN_SETSIGDEF + | POSIX_SPAWN_SETSIGMASK); ++#endif + } + p_sys->suspend = false; + p_sys->suspended = false; +@@ -106,7 +114,9 @@ static void Close (vlc_object_t *obj) + + vlc_cancel (p_sys->thread); + vlc_join (p_sys->thread, NULL); ++#if (_POSIX_SPAWN >= 0) + posix_spawnattr_destroy (&p_sys->attr); ++#endif + vlc_cond_destroy (&p_sys->inactive); + vlc_cond_destroy (&p_sys->update); + vlc_mutex_destroy (&p_sys->lock); +@@ -153,8 +163,16 @@ static void *Thread (void *data) + pid_t pid; + + vlc_mutex_unlock (&p_sys->lock); ++#if (_POSIX_SPAWN >= 0) + if (!posix_spawnp (&pid, "xdg-screensaver", NULL, &p_sys->attr, + argv, environ)) ++#else ++ pid = fork(); ++ if (pid == 0) { ++ execvp("xdg-screensaver", argv); ++ exit(1); ++ } else if (pid > 0) ++#endif + { + int status; + diff --git a/testing/vlc/uclibc-no-xscreensaver.patch b/testing/vlc/uclibc-no-xscreensaver.patch new file mode 100644 index 000000000..b4e1acef6 --- /dev/null +++ b/testing/vlc/uclibc-no-xscreensaver.patch @@ -0,0 +1,18 @@ +--- vlc-2.0.0-rc1.orig/modules/misc/Modules.am ++++ vlc-2.0.0-rc1/modules/misc/Modules.am +@@ -26,14 +26,9 @@ + libxdg_screensaver_plugin_la_CFLAGS = $(AM_CFLAGS) + libxdg_screensaver_plugin_la_LIBADD = $(AM_LIBADD) + libxdg_screensaver_plugin_la_DEPENDENCIES = +-libxscreensaver_plugin_la_SOURCES = inhibit/xscreensaver.c +-libxscreensaver_plugin_la_CFLAGS = $(AM_CFLAGS) +-libxscreensaver_plugin_la_LIBADD = $(AM_LIBADD) +-libxscreensaver_plugin_la_DEPENDENCIES = + if HAVE_XCB + libvlc_LTLIBRARIES += \ +- libxdg_screensaver_plugin.la \ +- libxscreensaver_plugin.la ++ libxdg_screensaver_plugin.la + endif + + libmce_plugin_la_SOURCES = inhibit/mce.c diff --git a/testing/vlc/uclibc3.patch b/testing/vlc/uclibc3.patch new file mode 100644 index 000000000..e57d6dd5f --- /dev/null +++ b/testing/vlc/uclibc3.patch @@ -0,0 +1,38 @@ +--- vlc-2.0.0-rc1.orig/src/posix/linux_specific.c ++++ vlc-2.0.0-rc1/src/posix/linux_specific.c +@@ -83,14 +83,14 @@ + unsigned refs; + } once = { VLC_STATIC_MUTEX, 0 }; + +-#ifdef __GLIBC__ ++#if defined(__GLIBC__) && !defined(__UCLIBC__) + # include <gnu/libc-version.h> + # include <stdlib.h> + #endif + + void system_Init (void) + { +-#ifdef __GLIBC__ ++#if defined(__GLIBC__) && !defined(__UCLIBC__) + const char *glcv = gnu_get_libc_version (); + + /* gettext in glibc 2.5-2.7 is not thread-safe. LibVLC keeps crashing, +--- vlc-2.0.0-rc1.orig/src/posix/thread.c ++++ vlc-2.0.0-rc1/src/posix/thread.c +@@ -1165,6 +1165,16 @@ + return vlc_atomic_swap (&timer->overruns, 0); + } + ++#if defined(HAVE_SCHED_GETAFFINITY) && !defined(CPU_COUNT) ++static unsigned CPU_COUNT(cpu_set_t *cpu) ++{ ++ unsigned i, count = 0; ++ for (i = 0; i < CPU_SETSIZE; i++) ++ if (CPU_ISSET(i, cpu)) ++ count++; ++ return count; ++} ++#endif + + /** + * Count CPUs. diff --git a/testing/vlc/vlc-1.1.7-disable-cache-gen.patch b/testing/vlc/vlc-1.1.7-disable-cache-gen.patch new file mode 100644 index 000000000..b8a3dd955 --- /dev/null +++ b/testing/vlc/vlc-1.1.7-disable-cache-gen.patch @@ -0,0 +1,12 @@ +--- a/modules/Makefile.am ++++ b/modules/Makefile.am +@@ -63,7 +63,8 @@ + + stamp-cache: + $(AM_V_GEN)if test "$(build)" = "$(host)"; then \ +- ../bin/vlc-cache-gen$(EXEEXT) . ; \ ++ # ../bin/vlc-cache-gen$(EXEEXT) . ; \ ++ echo "FIXME: vlc-cache-gen" ; \ + else \ + echo "Cross-compilation: cache generation skipped!" ; \ + fi diff --git a/testing/vlc/vlc-daemon.pre-install b/testing/vlc/vlc-daemon.pre-install new file mode 100644 index 000000000..72ee1b7ff --- /dev/null +++ b/testing/vlc/vlc-daemon.pre-install @@ -0,0 +1,13 @@ +#!/bin/sh + +groups="vlc audio video" +for group in $groups; do + addgroup -S $group 2>/dev/null +done +adduser -S -h /home/vlc -s /bin/sh -G vlc -D vlc 2>/dev/null + +# make sure vlc are in all groups +for group in $groups; do + addgroup vlc $group 2>/dev/null +done +exit 0 diff --git a/testing/vlc/vlc.confd b/testing/vlc/vlc.confd new file mode 100644 index 000000000..c42344b60 --- /dev/null +++ b/testing/vlc/vlc.confd @@ -0,0 +1,11 @@ +# Sample vlc params suitable for running as a daemon + +## --daemon detach from prompt +## --file-logging enable file logging +## --logfile logfile name/path +## -vvv verbose logging +## -I dummy disable X11 interface +## --sout PARAMS encoding parameters +## Do NOT quote 'PARAMS' otherwise shell expansions will broke vlc + +VLC_OPTS="-vvv -I dummy alsa://hw:0,0 --daemon --file-logging --logfile /var/log/vlc/vlc.log --sout #transcode{acodec=mp3,ab=48,channels=1,samplerate=22050}:std{access=http,mux=ogg,dst=:8080}" diff --git a/testing/vlc/vlc.initd b/testing/vlc/vlc.initd new file mode 100755 index 000000000..11567dcd8 --- /dev/null +++ b/testing/vlc/vlc.initd @@ -0,0 +1,22 @@ +#!/sbin/runscript + +depend() { + need net +} + +start() { + ebegin "Starting VLC" + start-stop-daemon --start \ + --user vlc \ + --exec /usr/bin/vlc -- ${VLC_OPTS} + eend $? +} + +stop () { + ebegin "Stopping VLC" + start-stop-daemon --stop \ + --signal KILL \ + --exec /usr/bin/vlc + eend $? +} + diff --git a/testing/vlc/vlc.trigger b/testing/vlc/vlc.trigger new file mode 100644 index 000000000..def39b951 --- /dev/null +++ b/testing/vlc/vlc.trigger @@ -0,0 +1,4 @@ +#!/bin/sh + +exec /usr/lib/vlc/vlc-cache-gen + |