Skip to content

Instantly share code, notes, and snippets.

@zecakeh zecakeh/PKGBUILD Secret
Last active Feb 22, 2019

Embed
What would you like to do?
kodi-devel PKGBUILD
# vim:set ts=2 sw=2 et:
# Maintainer: Marcin (CTRL) Wieczorek <marcin@marcin.co>
# Maintainer graysky <graysky AT archlinux DOT us>
# Contributor: M-Reimer <manuel.reimer AT gmx DOT de>
# Contributor: Arthur Borsboom <arthurborsboom@gmail.com>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: BlackIkeEagle < ike DOT devolder AT gmail DOT com >
# Contributor: DonVla <donvla@users.sourceforge.net>
# Contributor: Ulf Winkelvos <ulf [at] winkelvos [dot] de>
# Contributor: Ralf Barth <archlinux dot org at haggy dot org>
# Contributor: B & monty - Thanks for your hints :)
# Contributor: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: marzoul
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Brad Fanella <bradfanella@archlinux.us>
# Contributor: [vEX] <niechift.dot.vex.at.gmail.dot.com>
# Contributor: Zeqadious <zeqadious.at.gmail.dot.com>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: dhead666 <myfoolishgames@gmail.com>
#
# Original credits go to Edgar Hucek <gimli at dark-green dot com>
# for his xbmc-vdpau-vdr PKGBUILD at https://archvdr.svn.sourceforge.net/svnroot/archvdr/trunk/archvdr/xbmc-vdpau-vdr/PKGBUILD
pkgbase=kodi-devel
pkgname=('kodi-devel' 'kodi-devel-eventclients' 'kodi-devel-tools-texturepacker' 'kodi-devel-dev')
pkgver=18.2rc1pre3
_major=18.1
pkgrel=1
_codename=Leia
_tag="$_major-$_codename"
# Found on their respective github release pages. One can check them against
# what is pulled down when not specifying them in the cmake step.
# $CHROOT/build/kodi-devel/src/kodi-build/build/download
#
# https://github.com/xbmc/FFmpeg/tags
# https://github.com/xbmc/libdvdcss/tags
# https://github.com/xbmc/libdvdnav/tags
# https://github.com/xbmc/libdvdread/tags
#
# fmt and crossguid can be found http://mirrors.kodi.tv/build-deps/sources/
#
_ffmpeg_version="4.0.3-$_codename-RC5"
_libdvdcss_version="1.4.2-$_codename-Beta-5"
_libdvdnav_version="6.0.0-$_codename-Alpha-3"
_libdvdread_version="6.0.0-$_codename-Alpha-3"
_fmt_version="5.1.0"
_crossguid_version="8f399e8bd4"
_fstrcmp_version="0.7.D001"
_flatbuffers_version="1.9.0"
arch=('x86_64')
url="http://kodi.tv"
license=('GPL2')
makedepends=(
'afpfs-ng' 'bluez-libs' 'cmake' 'curl' 'doxygen' 'glew' 'git'
'gperf' 'hicolor-icon-theme' 'jasper' 'java-runtime' 'libaacs' 'libass'
'libbluray' 'libcdio' 'libcec' 'libgl' 'mariadb-libs' 'libmicrohttpd'
'libmodplug' 'libmpeg2' 'libnfs' 'libplist' 'libpulse' 'libssh' 'libva'
'libvdpau' 'libxrandr' 'libxslt' 'lirc' 'lzo' 'mesa' 'nasm' 'nss-mdns'
'python2-pillow' 'python2-pybluez' 'python2-simplejson' 'rtmpdump'
'shairplay' 'smbclient' 'speex' 'swig' 'taglib' 'tinyxml' 'unzip' 'upower'
'yajl' 'zip' 'git' 'giflib' 'rapidjson' 'ghostscript'
)
source=(
"${pkgbase%%-*}-$_tag.tar.gz::https://github.com/xbmc/xbmc/archive/$_tag.tar.gz"
"ffmpeg-$_ffmpeg_version.tar.gz::https://github.com/xbmc/FFmpeg/archive/$_ffmpeg_version.tar.gz"
"libdvdcss-$_libdvdcss_version.tar.gz::https://github.com/xbmc/libdvdcss/archive/$_libdvdcss_version.tar.gz"
"libdvdnav-$_libdvdnav_version.tar.gz::https://github.com/xbmc/libdvdnav/archive/$_libdvdnav_version.tar.gz"
"libdvdread-$_libdvdread_version.tar.gz::https://github.com/xbmc/libdvdread/archive/$_libdvdread_version.tar.gz"
"http://mirrors.kodi.tv/build-deps/sources/fmt-$_fmt_version.tar.gz"
"http://mirrors.kodi.tv/build-deps/sources/crossguid-$_crossguid_version.tar.gz"
"http://mirrors.kodi.tv/build-deps/sources/fstrcmp-$_fstrcmp_version.tar.gz"
"http://mirrors.kodi.tv/build-deps/sources/flatbuffers-$_flatbuffers_version.tar.gz"
'cpuinfo'
'00-fix.building.with.mariadb.patch::https://github.com/wsnipex/xbmc/commit/cd20c8eb8a0394db1f028b118c4ca9b91b7e746a.patch'
# closed milestone patches go here | https://github.com/xbmc/xbmc/milestones
'01-PR15483.patch::https://patch-diff.githubusercontent.com/raw/xbmc/xbmc/pull/15483.patch'
'02-PR15521.patch::https://patch-diff.githubusercontent.com/raw/xbmc/xbmc/pull/15521.patch'
'03-PR15535.patch::https://patch-diff.githubusercontent.com/raw/xbmc/xbmc/pull/15535.patch'
'04-PR15434.patch::https://patch-diff.githubusercontent.com/raw/xbmc/xbmc/pull/15434.patch'
'05-PR15479.patch::https://patch-diff.githubusercontent.com/raw/xbmc/xbmc/pull/15479.patch'
'06-PR15489.patch::https://patch-diff.githubusercontent.com/raw/xbmc/xbmc/pull/15489.patch'
'07-PR15480.patch::https://patch-diff.githubusercontent.com/raw/xbmc/xbmc/pull/15480.patch'
'08-PR15516.patch::https://patch-diff.githubusercontent.com/raw/xbmc/xbmc/pull/15516.patch'
'09-PR15556.patch::https://patch-diff.githubusercontent.com/raw/xbmc/xbmc/pull/15556.patch'
'10-PR15553.patch::https://patch-diff.githubusercontent.com/raw/xbmc/xbmc/pull/15553.patch'
)
noextract=(
"libdvdcss-$_libdvdcss_version.tar.gz"
"libdvdnav-$_libdvdnav_version.tar.gz"
"libdvdread-$_libdvdread_version.tar.gz"
"ffmpeg-$_ffmpeg_version.tar.gz"
"fmt-$_fmt_version.tar.gz"
"crossguid-$_crossguid_version.tar.gz"
"fstrcmp-$_fstrcmp_version.tar.gz"
"flatbuffers-$_flatbuffers_version.tar.gz"
)
sha256sums=('bc1ef0e271d0b6ce2e1be7546ad4f7d330930d7631cc19a9bbc5f75ddc586166'
'9a971662e44353c120f2ccf87655571998956e699a2dd800ec708b8b928a53c8'
'38816f8373e243bc5950449b4f3b18938c4e1c59348e3411e23f31db4072e40d'
'071e414e61b795f2ff9015b21a85fc009dde967f27780d23092643916538a57a'
'a30b6aa0aad0f2c505bc77948af2d5531a80b6e68112addb4c123fca24d5d3bf'
'73d4cab4fa8a3482643d8703de4d9522d7a56981c938eca42d929106ff474b44'
'3d77d09a5df0de510aeeb940df4cb534787ddff3bb1828779753f5dfa1229d10'
'e4018e850f80700acee8da296e56e15b1eef711ab15157e542e7d7e1237c3476'
'5ca5491e4260cacae30f1a5786d109230db3f3a6e5a0eb45d0d0608293d247e3'
'27387e49043127f09c5ef0a931fffb864f5730e79629100a6e210b68a1b9f2c1'
'849daf1d5b081ef6d0e428bbc7d448799fc43a8ac9e79cd7513de0eb5a91b0bb'
'60c44e53614754578ffe6450d6b1fdb7cebd36f832aeca821a03c922d3e016ad'
'01d667ac126a48c936fd93926c83588807372ebebb5e32c8305b91b1ff00e6f0'
'87071bad4fcfa3d8286fe78d01893788c6701d0f520bcbd1a72038da7de4dbc3'
'1e3140f71720a61a8d1f511424800f0a9a15fa44487c9be0d3e4a5b21db74187'
'4ae349a7f327874b50a246ce0d30f9f6682e82e49365e38f692b1be8e22f11f8'
'7102e4043838335879bed7213fdbbbc8206aefb26a4ef6847fd465b25a48ff3b'
'f97223899b2d0b553c8a2a2c53abfa9283716e778ebe8ed10286ba2c4256ede3'
'dce042e46078ea8eed548851018224594342981bdd7eaf357980c34bf72be5e5'
'5876bdb064bab4f93cd2627ad275ca098607188d1cb578eeac4b5a8fae8ea70c'
'ce007a14539d07f7ef7a03c9c4756f3b49dd609db4eb421887b8d91d93401217')
prepare() {
[[ -d kodi-build ]] && rm -rf kodi-build
mkdir kodi-build
cd ..
local dir="src/xbmc-$_tag"
# detect if building in arch chroot using $pkgname rather than hard coding it into a patch
if [[ "$srcdir" =~ ^\/build.* ]]; then
local _find="exec_program(cat ARGS \"/proc/cpuinfo\" OUTPUT_VARIABLE CPUINFO)"
local _replace="exec_program(cat ARGS \"/build/$pkgname/src/cpuinfo\" OUTPUT_VARIABLE CPUINFO)"
sed -i s"|$_find|$_replace|" "$dir/cmake/modules/FindSSE.cmake"
fi
local src
for src in "${source[@]}"; do
src="${src%%::*}"
src="${src##*/}"
# only patch subset of patches that begin with 0-9
[[ $src == [0-9]*.patch ]] || continue
msg2 "Applying patch $src..."
# patch will fail if binary diffs are present so use git apply first and only
# if it fails try patch
if ! git apply --verbose --directory="$dir" -p1 < "src/$src"; then
patch --directory="$dir" -Np1 < "src/$src"
fi
done
}
build() {
cd kodi-build
### Optionally uncomment and setup to your liking
# export CFLAGS+=" -march=native"
# export CXXFLAGS="${CFLAGS}"
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=/usr/lib \
-DENABLE_EVENTCLIENTS=ON \
-DENABLE_INTERNAL_FFMPEG=ON \
-DENABLE_INTERNAL_FMT=ON \
-DENABLE_INTERNAL_CROSSGUID=ON \
-DENABLE_INTERNAL_FSTRCMP=ON \
-DENABLE_INTERNAL_FLATBUFFERS=ON \
-Dlibdvdcss_URL="$srcdir/libdvdcss-$_libdvdcss_version.tar.gz" \
-Dlibdvdnav_URL="$srcdir/libdvdnav-$_libdvdnav_version.tar.gz" \
-Dlibdvdread_URL="$srcdir/libdvdread-$_libdvdread_version.tar.gz" \
-DFFMPEG_URL="$srcdir/ffmpeg-$_ffmpeg_version.tar.gz" \
-DFMT_URL="$srcdir/fmt-$_fmt_version.tar.gz" \
-DCROSSGUID_URL="$srcdir/crossguid-$_crossguid_version.tar.gz" \
-DFSTRCMP_URL="$srcdir/fstrcmp-$_fstrcmp_version.tar.gz" \
-DFLATBUFFERS_URL="$srcdir/flatbuffers-$_flatbuffers_version.tar.gz" \
../"xbmc-$_tag"
make
make preinstall
}
# kodi
# components: kodi, kodi-bin
package_kodi-devel() {
pkgdesc="Alpha, Beta, or RC versions of the software media player and entertainment hub for digital media"
depends=(
'bluez-libs' 'curl' 'desktop-file-utils' 'freetype2' 'fribidi'
'hicolor-icon-theme' 'libass' 'libcdio' 'libjpeg-turbo' 'mariadb-libs'
'libmicrohttpd' 'libpulse' 'libssh' 'libva' 'libvdpau' 'libxrandr' 'libcec' 'libnfs'
'libxslt' 'lirc' 'lzo' 'mesa' 'python2-pillow' 'python2-simplejson' 'smbclient'
'speex' 'taglib' 'tinyxml' 'xorg-xdpyinfo' 'yajl' 'libbluray'
)
optdepends=(
'afpfs-ng: Apple shares support'
'bluez: Blutooth support'
'python2-pybluez: Bluetooth support'
'libplist: AirPlay support'
'lsb-release: log distro information in crashlog'
'pulseaudio: PulseAudio support'
'shairplay: AirPlay support'
'unrar: Archives support'
'unzip: Archives support'
'upower: Display battery level'
)
provides=("kodi=${pkgver}")
conflicts=('kodi')
replaces=('kodi-pre-release')
_components=(
'kodi'
'kodi-bin'
)
cd kodi-build
# install eventclients
for _cmp in ${_components[@]}; do
DESTDIR="$pkgdir" /usr/bin/cmake \
-DCMAKE_INSTALL_COMPONENT="$_cmp" \
-P cmake_install.cmake
done
# python2 is being used
cd "$pkgdir"
grep -lR '#!.*python' * | while read file; do sed -s 's/\(#!.*python\)/\12/g' -i "$file"; done
}
# kodi-eventclients
# components: kodi-eventclients-common kodi-eventclients-ps3 kodi-eventclients-wiiremote kodi-eventclients-kodi-send
package_kodi-devel-eventclients() {
pkgdesc="Kodi Event Clients"
provides=("kodi-eventclients=${pkgver}")
conflicts=('kodi-eventclients')
replaces=('kodi-pre-release-eventclients')
optdepends=('python2: most eventclients are implemented in python2')
_components=(
'kodi-eventclients-common'
'kodi-eventclients-ps3'
'kodi-eventclients-kodi-send'
)
cd kodi-build
# install eventclients
for _cmp in ${_components[@]}; do
DESTDIR="$pkgdir" /usr/bin/cmake \
-DCMAKE_INSTALL_COMPONENT="$_cmp" \
-P cmake_install.cmake
done
# python2 is being used
cd "$pkgdir"
grep -lR '#!.*python' * | while read file; do sed -s 's/\(#!.*python\)/\12/g' -i "$file"; done
}
# kodi-tools-texturepacker
# components: kodi-tools-texturepacker
package_kodi-devel-tools-texturepacker() {
pkgdesc="Kodi Texturepacker tool"
provides=("kodi-tools-texturepacker=${pkgver}")
conflicts=('kodi-tools-texturepacker')
replaces=('kodi-pre-release-tools-texturepacker')
depends=('libpng' 'giflib' 'libjpeg-turbo' 'lzo')
_components=(
'kodi-tools-texturepacker'
)
cd kodi-build
# install eventclients
for _cmp in ${_components[@]}; do
DESTDIR="$pkgdir" /usr/bin/cmake \
-DCMAKE_INSTALL_COMPONENT="$_cmp" \
-P cmake_install.cmake
done
}
# kodi-dev
# components: kodi-addon-dev kodi-audio-dev kodi-eventclients-dev kodi-game-dev kodi-inputstream-dev kodi-peripheral-dev kodi-pvr-dev kodi-screensaver-dev kodi-visualization-dev
package_kodi-devel-dev() {
pkgdesc="Kodi dev files"
provides=("kodi-dev=${pkgver}")
conflicts=('kodi-dev' 'kodi-pre-release-dev')
replaces=('kodi-pre-release-dev')
depends=('kodi-devel')
_components=(
'kodi-addon-dev'
'kodi-audio-dev'
'kodi-eventclients-dev'
'kodi-game-dev'
'kodi-inputstream-dev'
'kodi-peripheral-dev'
'kodi-pvr-dev'
'kodi-screensaver-dev'
'kodi-visualization-dev'
)
cd kodi-build
# install eventclients
for _cmp in ${_components[@]}; do
DESTDIR="$pkgdir" /usr/bin/cmake \
-DCMAKE_INSTALL_COMPONENT="$_cmp" \
-P cmake_install.cmake
done
# python2 is being used
cd "$pkgdir"
grep -lR '#!.*python' * | while read file; do sed -s 's/\(#!.*python\)/\12/g' -i "$file"; done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.