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.

Revisions

  1. sputnikus revised this gist Apr 16, 2014. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions PKGBUILD
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,9 @@
    # 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
  2. sputnikus created this gist Apr 16, 2014.
    78 changes: 78 additions & 0 deletions PKGBUILD
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,78 @@
    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"
    }