Skip to content

Instantly share code, notes, and snippets.

@sputnikus
Last active August 29, 2015 13:59
Show Gist options
  • Save sputnikus/10910934 to your computer and use it in GitHub Desktop.
Save sputnikus/10910934 to your computer and use it in GitHub Desktop.
Popcorn Time 0.2.9 PKGBUILD
# Maintainer: Attila Bukor <r1pp3rj4ck [at] w4it [dot] eu>
# Contributor: Eric Engestrom <aur [at] engestrom [dot] ch>
# Contributor: Iwan Timmer <[email protected]>
# Contributor: Ricardo Band <me [at] xengi [dot] de>
# Contributor: Martin Putniorz <mputniorz [at] gmail [dot] com>
pkgname=popcorntime
pkgver=0.2.9
pkgrel=1
pkgdesc="Stream movies from torrents. Skip the downloads. Launch, click, watch."
arch=('x86_64' 'i686')
url="http://get-popcorn.com/"
license=('GPL3')
makedepends=('nodejs' 'nodejs-grunt-cli' 'ruby-compass-alpha')
depends=('ttf-ms-fonts')
conflicts=('popcorntime-beta' 'popcorntime-git')
options=('!strip')
install="popcorntime.install"
_gitname=popcorn-app
md5sums=('9fb7040254499712491f21f511f34d82'
'5725b4c466ca3726e7a6df52730dacd2'
'efe872f41ed74a706308b4015e4fd82f'
'9608f35f4cc083a0c36b0f4ef275ab10')
if [ "$CARCH" = 'i686' ]; then
_platform=linux32
elif [ "$CARCH" = 'x86_64' ]; then
_platform=linux64
fi
source=("https://github.com/popcorn-official/popcorn-app/archive/v${pkgver}.tar.gz"
"https://raw.githubusercontent.com/popcorn-official/popcorn-app/master/images/icon.png"
"popcorntime.install"
"popcorntime.desktop")
build() {
cd "${srcdir}/${_gitname}-${pkgver}"
npm install
# Get dependencies
msg2 "Getting dependencies"
npm install
# Copy local node-webkit (will be used if grunt wants the same version)
if [ -d /usr/lib/node-webkit/ ]
then
_nwver=$(pacman -Q node-webkit | cut -d" " -f 2 | cut -d- -f1)
install -d "${srcdir}/${_gitname}-${pkgver}/build/cache/${_platform}/${_nwver}"
install /usr/lib/node-webkit/* "${srcdir}/${_gitname}-${pkgver}/build/cache/${_platform}/${_nwver}"
fi
# Build
msg2 "Building"
grunt build
# Thanks to Revelation60 for pointing it out
# https://github.com/rogerwang/node-webkit/wiki/The-solution-of-lacking-libudev.so.0
msg2 "Patching program to fix libudev.so.0 problem"
cd "${srcdir}/${_gitname}-${pkgver}/build/releases/Popcorn-Time/${_platform}/Popcorn-Time"
sed -i 's/\x75\x64\x65\x76\x2E\x73\x6F\x2E\x30/\x75\x64\x65\x76\x2E\x73\x6F\x2E\x31/g' Popcorn-Time
}
package() {
cd "${srcdir}"
_bpath="${srcdir}/${_gitname}-${pkgver}/build/releases/Popcorn-Time/${_platform}/Popcorn-Time"
install -dm755 "${pkgdir}/usr/share/${pkgname}"
install -dm755 "${pkgdir}/usr/bin"
# Program
install -Dm755 "${_bpath}/Popcorn-Time" "${pkgdir}/usr/share/${pkgname}/"
install -Dm644 "${_bpath}/nw.pak" "${pkgdir}/usr/share/${pkgname}/"
install -Dm644 "${_bpath}/libffmpegsumo.so" "${pkgdir}/usr/share/${pkgname}/"
# Link to program
mkdir -p "${pkgdir}/usr/bin"
ln -s "/usr/share/${pkgname}/Popcorn-Time" "${pkgdir}/usr/bin/${pkgname}"
# Desktop file
install -Dm644 "${srcdir}/popcorntime.desktop" "${pkgdir}/usr/share/applications/popcorntime.desktop"
# Icon
install -Dm644 "${srcdir}/icon.png" "${pkgdir}/usr/share/pixmaps/popcorntime.png"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment