From 717f07a18115de8015738718cd0ec83b969b98db Mon Sep 17 00:00:00 2001
From: Britney Fransen <brfransen@gmail.com>
Date: Thu, 7 Jul 2016 21:49:29 +0000
Subject: openpht: update to 1.6.2.123

---
 abs/extra/openpht/PKGBUILD                 | 59 +++++++++++++++---------------
 abs/extra/openpht/__changelog              |  1 +
 abs/extra/openpht/fribidi.patch            | 50 +++++++++++++++++++++++++
 abs/extra/openpht/plex-ffmpeg-compat.patch | 29 ---------------
 abs/extra/openpht/plexhometheater.desktop  | 10 +++++
 abs/extra/openpht/plexhometheater.sh       |  2 +-
 6 files changed, 92 insertions(+), 59 deletions(-)
 mode change 100755 => 100644 abs/extra/openpht/PKGBUILD
 create mode 100644 abs/extra/openpht/fribidi.patch
 delete mode 100755 abs/extra/openpht/plex-ffmpeg-compat.patch
 create mode 100644 abs/extra/openpht/plexhometheater.desktop

diff --git a/abs/extra/openpht/PKGBUILD b/abs/extra/openpht/PKGBUILD
old mode 100755
new mode 100644
index 45c52f7..6ccd7e9
--- a/abs/extra/openpht/PKGBUILD
+++ b/abs/extra/openpht/PKGBUILD
@@ -1,33 +1,38 @@
+# Maintainer: Jeff Keyte <jeff@keyte.me>
+# Contributor: Maxime Gauduin <alucryd@archlinux.org>
+# Contributor: Daniel Wallace <daniel.wallace@gatech.edu>
+
 pkgname=openpht
-pkgver=1.5.2.514
-_pkghash=310d4f7e
-pkgrel=2
-pkgdesc='OpenPHT a community driven fork of Plex Home Theater'
+pkgver=1.6.2.123
+_pkghash=e23a7eef
+pkgrel=5
+pkgdesc='OpenPHT is a community driven fork of Plex Home Theater'
 arch=('i686' 'x86_64')
-url='https://github.com/RasPlex/OpenPHT'
+url='https://github.com/RasPlex/OpenPHT/'
 license=('GPL2')
 install="${pkgname}.install"
 provides=('plex-home-theater')
 #conflicts=('plex-home-theater')
 replaces=('plex-home-theater')
-depends=('boost-libs' 'curl' 'ffmpeg-compat' 'glew' 'libcdio' 'libmad'
-         'libmicrohttpd' 'libmpeg2' 'libsamplerate' 'libssh' 'libusb-compat'
-         'libvdpau' 'libxrandr' 'lzo' 'sdl_image' 'sdl_mixer' 'smbclient'
-         'taglib' 'tinyxml' 'yajl')
-makedepends=('boost' 'cmake' 'doxygen' 'git' 'java-environment' 'libcec'
-             'libplist' 'libshairport' 'nasm' 'swig' 'unzip' 'zip')
+depends=('alsa-lib' 'avahi' 'boost-libs' 'curl' 'expat' 'ffmpeg2.8' 'freetype2' 'fribidi'
+         'gcc-libs' 'glew' 'glibc' 'glu' 'libcdio' 'libgl' 'libjpeg' 'libmad'
+         'libmicrohttpd' 'libmpeg2' 'libpng' 'libsamplerate' 'llvm-libs'
+         'libssh' 'libtiff' 'libusb-compat' 'libva' 'libvdpau' 'libx11'
+         'libxext' 'libxrandr' 'lzo' 'pcre' 'python2' 'sdl' 'sdl_image'
+         'sdl_mixer' 'sqlite' 'smbclient' 'taglib' 'tinyxml' 'yajl' 'zlib' 'rtmpdump')
+makedepends=('boost' 'cmake' 'doxygen' 'git' 'java-environment' 'shairplay'
+             'libcec' 'libplist' 'nasm' 'swig' 'unzip' 'zip')
 optdepends=('libplist: AirPlay support'
-            'libshairport: AirPlay support'
-            'libcec: Pulse-Eight USB-CEC adapter support')
+            'libcec: Pulse-Eight USB-CEC adapter support'
+            'shairplay: Shairplay Support')
 source=("https://github.com/RasPlex/OpenPHT/archive/v${pkgver}-${_pkghash}.tar.gz"
-        'plex-ffmpeg-compat.patch'
+        'plexhometheater.sh'
         'plex_lib.conf'
-        'plexhometheater.sh')
-
+        'fribidi.patch'
+        'plexhometheater.desktop')
 prepare() {
   cd OpenPHT-${pkgver}-${_pkghash}
-
-  patch -Np1 -i ../plex-ffmpeg-compat.patch
+  patch -Np1 <../fribidi.patch
 }
 
 build() {
@@ -38,12 +43,9 @@ build() {
   fi
   mkdir build && cd build
 
+  CMAKE_PREFIX_PATH=/usr/lib/ffmpeg2.8:/usr/include/ffmpeg2.8 \
   cmake .. \
     -DCMAKE_INSTALL_PREFIX='/usr' \
-    -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include" \
-    -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include" \
-    -DCREATE_BUNDLE='FALSE' \
-    -DDUMP_SYMBOLS='FALSE' \
     -DENABLE_AUTOUPDATE='FALSE' \
     -DENABLE_PYTHON='TRUE' \
     -DPYTHON_EXEC='/usr/bin/python2' \
@@ -60,16 +62,15 @@ package() {
   mv "${pkgdir}"/usr/share/XBMC "${pkgdir}"/usr/share/plexhometheater
   rm -rf "${pkgdir}"/usr/bin/*.so
   install -Dm 755 "${srcdir}"/plexhometheater.sh "${pkgdir}"/usr/LH/bin/plexhometheater.sh
-  install -m 644 ../plex/Resources/plexhometheater.desktop "${pkgdir}"/usr/share/applications/
+  install -m 644 "${srcdir}"/plexhometheater.desktop "${pkgdir}"/usr/share/applications/
   install -m 644 ../plex/Resources/plex-icon-256.png "${pkgdir}"/usr/share/pixmaps/plexhometheater.png
 
   # LinHES stuff
-  #add in plex_lib.conf
+  # add in plex_lib.conf
   install -D -m0744 ${srcdir}/plex_lib.conf ${pkgdir}/etc/gen_lib_xml.d/plex_lib.conf
 }
-
-# vim: ts=2 sw=2 et:
-md5sums=('4cefcfc40b4c5bb890cd74e62ca0e1ac'
-         '6704244166497db7fa6b3ddd43a0e53b'
+md5sums=('075d697793b32d34c9ac57b94ae14821'
+         'ad57396d98692dbe8c8d6f2fab707a94'
          'c1eedd9f89ee727230833db9ef1e5d29'
-         '4ceae60ed2f9e4304eda4f80d407e799')
+         'a5980579c1b6341a6d06e80d9da2a924'
+         'e530e2b4d8333863ba1c87862c291ba1')
diff --git a/abs/extra/openpht/__changelog b/abs/extra/openpht/__changelog
index 42c86d8..6daae7f 100644
--- a/abs/extra/openpht/__changelog
+++ b/abs/extra/openpht/__changelog
@@ -1,5 +1,6 @@
 copied plex-home-theater to openpht
 PKGBUILD - Remove opt dep pulseaudio
+PKGBUILD - Add dep ffmpeg2.8
 PKGBUILD - Added plex_lib.conf, this file goes in /etc/gen_lib_xml.d/
 PKGBUILD - Install plexhometheater.sh to /usr/LH/bin
 openpht.install - add gen_lib_xml.py to post_install and post_remove and post_update
diff --git a/abs/extra/openpht/fribidi.patch b/abs/extra/openpht/fribidi.patch
new file mode 100644
index 0000000..8c939df
--- /dev/null
+++ b/abs/extra/openpht/fribidi.patch
@@ -0,0 +1,50 @@
+diff --git a/plex/CMakeModules/FindFriBiDi.cmake b/plex/CMakeModules/FindFriBiDi.cmake
+--- a/plex/CMakeModules/FindFriBiDi.cmake
++++ b/plex/CMakeModules/FindFriBiDi.cmake
+@@ -9,44 +9,8 @@
+ # also defined, but not for general use are
+ #  FRIBIDI_LIBRARY, where to find the FriBiDi library.
+ 
+-include(CheckSymbolExists)
+-
+-SET(FRIBIDI_FOUND "NO")
+-
+-# Set variable in temp var, otherwise FIND_PATH might fail
+-# unset isn't present in the required version of cmake.
+-FIND_PATH(xFRIBIDI_INCLUDE_DIR fribidi.h
+-  PATHS /usr/local/include
+-  	/usr/include
+-  PATH_SUFFIXES fribidi
+-  )
+-set(FRIBIDI_INCLUDE_DIR ${xFRIBIDI_INCLUDE_DIR})
+-
+-SET(FRIBIDI_NAMES ${FRIBIDI_NAMES} fribidi libfribidi)
+-FIND_LIBRARY(FRIBIDI_LIBRARY
+-  NAMES ${FRIBIDI_NAMES}
+-  PATHS /usr/lib /usr/local/lib
+-  )
+-
+-IF (FRIBIDI_LIBRARY AND FRIBIDI_INCLUDE_DIR)
+-  SET(CMAKE_REQUIRED_INCLUDES ${FRIBIDI_INCLUDE_DIR})
+-  SET(CMAKE_REQUIRED_LIBRARIES ${FRIBIDI_LIBRARY})
+-  CHECK_SYMBOL_EXISTS(fribidi_utf8_to_unicode fribidi.h FOUND_fribidi_utf8_to_unicode)
+-  CHECK_SYMBOL_EXISTS(fribidi_charset_to_unicode fribidi.h FOUND_fribidi_charset_to_unicode)
+-  if(FOUND_fribidi_charset_to_unicode)
+-    SET(FRIBIDI_LIBRARIES ${FRIBIDI_LIBRARY})
+-    SET(FRIBIDI_FOUND "YES")
+-  elseif(FOUND_fribidi_utf8_to_unicode)
+-    SET(FRIBIDI_LIBRARIES ${FRIBIDI_LIBRARY})
+-    SET(FRIBIDI_FOUND "YES")
+-    add_definitions(-DOLD_FRIBIDI)
+-    MESSAGE(STATUS "Legacy FriBiDi: ${FRIBIDI_LIBRARY}")
+-  else()
+-    SET(FRIBIDI_LIBRARIES "NOTFOUND")
+-    SET(FRIBIDI_INCLUDE_DIR "NOTFOUND")
+-    SET(FRIBIDI_FOUND "NO")
+-  endif()
+-ENDIF (FRIBIDI_LIBRARY AND FRIBIDI_INCLUDE_DIR)
++include(FindPkgConfig)
++pkg_check_modules(FRIBIDI fribidi)
+ 
+ IF (FRIBIDI_FOUND)
+ 
diff --git a/abs/extra/openpht/plex-ffmpeg-compat.patch b/abs/extra/openpht/plex-ffmpeg-compat.patch
deleted file mode 100755
index 1601500..0000000
--- a/abs/extra/openpht/plex-ffmpeg-compat.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-diff -rupN plex-home-theater.orig/plex/CMakeModules/FindFFmpeg.cmake plex-home-theater/plex/CMakeModules/FindFFmpeg.cmake
---- plex-home-theater.orig/plex/CMakeModules/FindFFmpeg.cmake	2014-09-15 11:46:21.751638700 +0200
-+++ plex-home-theater/plex/CMakeModules/FindFFmpeg.cmake	2014-09-15 11:43:25.678039000 +0200
-@@ -41,7 +41,7 @@ MACRO(FFMPEG_FIND varname shortname head
-         /opt/csw/include # Blastwave
-         /opt/include
-         /usr/freeware/include
--        PATH_SUFFIXES ffmpeg
-+        PATH_SUFFIXES ffmpeg-compat
-         DOC "Location of FFMPEG Headers"
-     )
- 
-@@ -62,7 +62,7 @@ MACRO(FFMPEG_FIND varname shortname head
-             /opt/csw/include # Blastwave
-             /opt/include
-             /usr/freeware/include
--            PATH_SUFFIXES ffmpeg
-+            PATH_SUFFIXES ffmpeg-compat
-             DOC "Location of FFMPEG Headers"
-         )
-     ENDIF(NOT FFMPEG_${varname}_INCLUDE_DIRS)
-@@ -85,6 +85,7 @@ MACRO(FFMPEG_FIND varname shortname head
-         /opt/csw/lib
-         /opt/lib
-         /usr/freeware/lib64
-+        PATH_SUFFIXES ffmpeg-compat
-         DOC "Location of FFMPEG Libraries"
-     )
- 
diff --git a/abs/extra/openpht/plexhometheater.desktop b/abs/extra/openpht/plexhometheater.desktop
new file mode 100644
index 0000000..3bae57f
--- /dev/null
+++ b/abs/extra/openpht/plexhometheater.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Application
+Name=OpenPHT
+Name[en_US]=OpenPHT
+Exec=/usr/bin/plexhometheater.sh
+Icon=plexhometheater
+Comment[en_US]=OpenPHT
+StartupNotify=true
+Categories=AudioVideo
diff --git a/abs/extra/openpht/plexhometheater.sh b/abs/extra/openpht/plexhometheater.sh
index 579bed6..16da77d 100755
--- a/abs/extra/openpht/plexhometheater.sh
+++ b/abs/extra/openpht/plexhometheater.sh
@@ -5,7 +5,7 @@ stop_xss.sh &
 #Launch plex
 export XBMC_BIN_HOME='/usr/lib/plexhometheater'
 export XBMC_HOME='/usr/share/plexhometheater'
-plexhometheater
+exec plexhometheater
 
 #Start Xscreensaver again
 killall stop_xss.sh
-- 
cgit v0.12

