Date: Sun, 21 Sep 2014 13:10:40 GMT From: svn-freebsd-gecko@chruetertee.ch To: freebsd-gecko@freebsd.org Subject: [SVN-Commit] r1701 - in trunk/www/linux-c6-freshplayerplugin: . files Message-ID: <201409211310.s8LDAekp055816@trillian.chruetertee.ch>
next in thread | raw e-mail | index | archive | help
Author: jbeich Date: Sun Sep 21 13:10:40 2014 New Revision: 1701 Log: Add a prototype port for PepperFlash wrapper, use with www/linux-firefox Depends on: sysutils/rinse from bug 193493 linux-c6-* infra ports linux libEGL.so.1 from nvidia-driver Added: trunk/www/linux-c6-freshplayerplugin/ trunk/www/linux-c6-freshplayerplugin/Makefile trunk/www/linux-c6-freshplayerplugin/distinfo trunk/www/linux-c6-freshplayerplugin/files/ trunk/www/linux-c6-freshplayerplugin/files/patch-src__pp_resource.h trunk/www/linux-c6-freshplayerplugin/files/patch-src__ppb_flash_menu.c trunk/www/linux-c6-freshplayerplugin/pkg-descr Added: trunk/www/linux-c6-freshplayerplugin/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/www/linux-c6-freshplayerplugin/Makefile Sun Sep 21 13:10:40 2014 (r1701) @@ -0,0 +1,152 @@ +# $FreeBSD$ + +PORTNAME= freshplayerplugin +PORTVERSION= 0.2.0 +CATEGORIES= www linux emulators +PKGNAMEPREFIX= linux-c6- + +MAINTAINER= gecko@FreeBSD.org +COMMENT= PPAPI-host NPAPI-plugin adapter (Linux CentOS 6) + +LICENSE= MIT # excluding EXTRA_LIBS + +BUILD_DEPENDS= rinse:${PORTSDIR}/sysutils/rinse +RUN_DEPENDS= ${LINUXBASE}/usr/lib/libEGL.so.1:${PORTSDIR}/x11/nvidia-driver + +USE_GITHUB= yes +GH_ACCOUNT= i-rinat +GH_TAGNAME= v${DISTVERSION} +GH_COMMIT= e2c21b9 + +USES= cmake webplugin:linux +USE_LINUX= c6 +USE_LINUX_APPS= atk fontconfig gtk2 pango \ + alsalib alsa-plugins-oss +BUILD_WRKSRC= ${WRKDIR}/centos6 +WEBPLUGIN_FILES=libfreshwrapper-pepperflash.so +PLIST_FILES= %%WEBPLUGIN_DIR%%/libfreshwrapper-pepperflash.so \ + ${EXTRA_LIBS:S,^,${LINUXBASE},} +PLIST_DIRSTRY= lib/browser_plugins +EXTRA_LIBS= /usr/lib/libconfig.so.8 \ + /usr/lib/libevent-2.0.so.5 \ + /usr/lib/libevent_pthreads-2.0.so.5 \ + /usr/lib/liburiparser.so.1 + +YUM_INSTALL= ${CHROOT} ${BUILD_WRKSRC} /usr/bin/yum -y install + +.if defined(WRKDIRPREFIX) +# Keep mount path short to avoid ENAMETOOLONG +WRKDIR= ${WRKDIRPREFIX}/${UNIQUENAME} +.endif + +post-patch: + ${REINPLACE_CMD} -e 's,/usr/lib,${LOCALBASE}/lib,' \ + ${WRKSRC}/src/config_nacl.c \ + ${WRKSRC}/src/config_pepperflash.c + +pre-configure: + @if [ ${UID} != 0 ]; then \ + ${ECHO_MSG} "Requires root permissions for chroot(8)."; \ + exit 1; \ + fi + +do-configure: + rinse --arch i386 --distribution centos-6 \ + --directory ${BUILD_WRKSRC} + + ${MOUNT} -t devfs none ${BUILD_WRKSRC}/dev + ${MOUNT} -t linprocfs none ${BUILD_WRKSRC}/proc + ${MOUNT} -t nullfs ${WRKSRC} ${BUILD_WRKSRC}/root + + ${MKDIR} /var/cache/yum + ${MOUNT} -t nullfs /var/cache/yum \ + ${BUILD_WRKSRC}/var/cache/yum + +post-configure: + ${REINPLACE_CMD} -e '/keepcache/s/=0/=1/' \ + ${BUILD_WRKSRC}/etc/yum.conf + ${BRANDELF} -t Linux ${BUILD_WRKSRC}/lib/ld-linux.so.2 + ${CP} ${BUILD_WRKSRC}/usr/lib/locale/locale-archive.tmpl \ + ${BUILD_WRKSRC}/usr/lib/locale/locale-archive + +pre-build: + ${YUM_INSTALL} epel-release \ + http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm \ + http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm \ + http://rpms.famillecollet.com/enterprise/6/remi/i386/remi-release-6.5-1.el6.remi.noarch.rpm + + # use http:// to skip upgrade + ${REINPLACE_CMD} 's/https/http/' ${BUILD_WRKSRC}/etc/yum.repos.d/epel*.repo + + # fix broken depends + ${YUM_INSTALL} gamin shared-mime-info + + ${YUM_INSTALL} \ + cmake28 \ + make \ + gcc-c++ \ + alsa-lib-devel \ + gtk2-devel \ + libconfig-devel + + ${YUM_INSTALL} --enablerepo=rpmforge uriparser-devel + ${YUM_INSTALL} --enablerepo=remi libevent-last-devel + ${YUM_INSTALL} --enablerepo=elrepo-extras mesa-libGLES-devel + +do-build: + ${CHROOT} ${BUILD_WRKSRC} \ + /bin/sh -c "cd /root && cmake28 . \ + ${CMAKE_ARGS:M*FLAGS*} ${CMAKE_ARGS:M*BUILD_TYPE*}" + ${CHROOT} ${BUILD_WRKSRC} \ + /usr/bin/make ${_MAKE_JOBS} -C /root + +do-install: + @${MKDIR} ${STAGEDIR}${WEBPLUGIN_DIR} ${STAGEDIR}${LINUXBASE}/usr/lib + ${INSTALL_LIB} ${WRKSRC}/libfreshwrapper-pepperflash.so \ + ${STAGEDIR}${WEBPLUGIN_DIR} +.for f in ${EXTRA_LIBS} + ${INSTALL_LIB} ${BUILD_WRKSRC}${f} \ + ${STAGEDIR}${LINUXBASE}${f:H} +.endfor + +pre-clean: test-clean + @${UMOUNT} ${BUILD_WRKSRC}/dev 2>/dev/null || ${TRUE} + @${UMOUNT} ${BUILD_WRKSRC}/proc 2>/dev/null || ${TRUE} + @${UMOUNT} ${BUILD_WRKSRC}/root 2>/dev/null || ${TRUE} + @${UMOUNT} ${BUILD_WRKSRC}/var/cache/yum 2>/dev/null || ${TRUE} + +pre-test: build + -${CP} ${LOCALBASE}/etc/asound.conf ${BUILD_WRKSRC}/etc + ${YUM_INSTALL} \ + ncurses-base \ + alsa-plugins-oss \ + firefox + + -${CHROOT} ${BUILD_WRKSRC} /usr/sbin/useradd -u 1001 -m foo + -${INSTALL} -o 1001 -g 1001 -m 600 \ + ~/.Xauthority ${BUILD_WRKSRC}/home/foo + ${ECHO_CMD} 'export DISPLAY=$${DISPLAY-:0}' \ + >>${BUILD_WRKSRC}/home/foo/.bashrc + ${INSTALL} -d -o 1001 -g 1001 \ + ${BUILD_WRKSRC}/home/foo/.mozilla + ${INSTALL} -d -o 1001 -g 1001 \ + ${BUILD_WRKSRC}/home/foo/.mozilla/plugins + ${LN} -sf /root/libfreshwrapper-pepperflash.so \ + ${BUILD_WRKSRC}/home/foo/.mozilla/plugins + + ${MOUNT} -t nullfs /tmp ${BUILD_WRKSRC}/tmp + ${MKDIR} ${BUILD_WRKSRC}${LOCALBASE}/lib/PepperFlash + ${MOUNT} -t nullfs ${LOCALBASE}/lib/PepperFlash \ + ${BUILD_WRKSRC}${LOCALBASE}/lib/PepperFlash + +test: pre-test + ${SETENV} -u XAUTHORITY ${CHROOT} ${BUILD_WRKSRC} /bin/su foo -c \ + "firefox -no-remote" + +test-clean: + @${UMOUNT} ${BUILD_WRKSRC}/tmp 2>/dev/null || ${TRUE} + @${UMOUNT} ${BUILD_WRKSRC}${LOCALBASE}/lib/PepperFlash 2>/dev/null || ${TRUE} + +.PHONY: pre-test test test-clean + +.include <bsd.port.mk> Added: trunk/www/linux-c6-freshplayerplugin/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/www/linux-c6-freshplayerplugin/distinfo Sun Sep 21 13:10:40 2014 (r1701) @@ -0,0 +1,2 @@ +SHA256 (freshplayerplugin-0.2.0.tar.gz) = 04fb5fa5257c37215c86e67139ece3a992757fc2fca7db552f189b2faca4072e +SIZE (freshplayerplugin-0.2.0.tar.gz) = 258233 Added: trunk/www/linux-c6-freshplayerplugin/files/patch-src__pp_resource.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/www/linux-c6-freshplayerplugin/files/patch-src__pp_resource.h Sun Sep 21 13:10:40 2014 (r1701) @@ -0,0 +1,41 @@ +--- src/pp_resource.h~ ++++ src/pp_resource.h +@@ -47,6 +47,38 @@ + #include <cairo.h> + #include <asoundlib.h> + #include <gtk/gtk.h> ++#include <pthread.h> ++ ++#if !GLIB_CHECK_VERSION(2, 31, 0) ++static inline ++GThread * ++g_thread_new(const gchar *unused, GThreadFunc func, gpointer data) ++{ ++ GThread *thread = g_thread_create(func, data, TRUE, NULL); ++ if (!thread) { ++ g_error("g_thread_create failed"); ++ } ++ return thread; ++} ++ ++static inline ++void ++g_hash_table_add(GHashTable *table, gpointer key) ++{ ++ g_hash_table_replace(table, key, key); ++} ++ ++static inline ++gpointer ++g_async_queue_timeout_pop(GAsyncQueue *queue, guint64 timeout) ++{ ++ GTimeVal end_time; ++ ++ g_get_current_time(&end_time); ++ g_time_val_add(&end_time, timeout); ++ return g_async_queue_timed_pop(queue, &end_time); ++} ++#endif + + + #define free_and_nullify(obj, field) \ Added: trunk/www/linux-c6-freshplayerplugin/files/patch-src__ppb_flash_menu.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/www/linux-c6-freshplayerplugin/files/patch-src__ppb_flash_menu.c Sun Sep 21 13:10:40 2014 (r1701) @@ -0,0 +1,11 @@ +--- src/ppb_flash_menu.c~ ++++ src/ppb_flash_menu.c +@@ -136,7 +136,7 @@ static + void + _destroy_flash_menu_ptac(void *param) + { +- GMenu *menu = param; ++ void *menu = param; + g_object_unref(menu); + } + Added: trunk/www/linux-c6-freshplayerplugin/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/www/linux-c6-freshplayerplugin/pkg-descr Sun Sep 21 13:10:40 2014 (r1701) @@ -0,0 +1,6 @@ +The main goal of this project is to get PPAPI (Pepper) Flash player +working in Firefox. A wrapper is implemented, some kind of adapter +which will look like browser to PPAPI plugin and look like NPAPI +plugin for browser. + +WWW: https://github.com/i-rinat/freshplayerplugin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409211310.s8LDAekp055816>