blob: 6881ccf86f0a9fc1835bdce118078d454372c72b (
plain)
1 # Description: Open source home theater software, wayland native version
2 # URL: https://kodi.tv/
3 # Maintainer: Tim Biermann, tbier at posteo dot de
4 # Depends on: dbus flatbuffers fstrcmp glu libass libcdio libxkbcommon openjdk17-jdk python rapidjson rtmpdump spdlog swig taglib tinyxml waylandpp
5 # Optional: alsa-lib avahi bluez dav1d libmicrohttpd libnfs libva libva-vdpau-driver libxslt mariadb mysql pulseaudio
6
7 name=kodi-wayland
8 version=19.3
9 release=1
10
11 # version variables {{{
12 _codename=Matrix
13 _ffmpeg_version="4.3.1-$_codename-Beta1"
14 _crossguid_version="8f399e8bd4"
15 _fmt_version="5.1.0"
16 _libdvdcss_version="1.4.2-Leia-Beta-5"
17 _libdvdnav_version="6.0.0-Leia-Alpha-3"
18 _libdvdread_version="6.0.0-Leia-Alpha-3"
19 # }}}
20 # source {{{
21 source=(https://github.com/xbmc/xbmc/archive/$version-$_codename/xbmc-$version-$_codename.tar.gz
22 https://github.com/xbmc/FFmpeg/archive/$_ffmpeg_version.tar.gz
23 http://mirrors.kodi.tv/build-deps/sources/fmt-$_fmt_version.tar.gz
24 http://mirrors.kodi.tv/build-deps/sources/crossguid-$_crossguid_version.tar.gz
25 https://github.com/xbmc/libdvdcss/archive/$_libdvdcss_version/${name/-wayland/}-libdvdcss-$_libdvdcss_version.tar.gz
26 https://github.com/xbmc/libdvdnav/archive/$_libdvdnav_version/${name/-wayland/}-libdvdnav-$_libdvdnav_version.tar.gz
27 https://github.com/xbmc/libdvdread/archive/$_libdvdread_version/${name/-wayland}-libdvdread-$_libdvdread_version.tar.gz)
28 # }}}
29 # unpack_source() {{{
30 unpack_source() {
31 for file in ${source[@]}; do
32 case ${file##*/} in
33 xbmc-$version-$_codename.tar.gz)
34 bsdtar -p -o -C $SRC -xf $(get_filename $file) ;;
35 *)
36 cp $(get_filename $file) $SRC ;;
37 esac
38 done
39 }
40 # }}}
41
42 build() {
43 # clang? {{{
44 [[ -e /usr/bin/clang && -e /usr/bin/clang++ && -e /usr/bin/lld ]] && export CC=clang CXX=clang++ AR=llvm-ar NM=llvm-nm RANLIB=llvm-ranlib LDFLAGS+=' -fuse-ld=lld' && KODI_EXTRA+=' -D CMAKE_CXX_COMPILER_AR=/usr/bin/llvm-ar -D CMAKE_CXX_COMPILER_RANLIB=/usr/bin/llvm-ranlib -D CMAKE_NM=/usr/bin/llvm-nm -D ENABLE_LLD=ON -D USE_LTO=8'
45 # }}}
46 unset PATH
47 export PATH="/usr/lib/java/openjdk17-jdk/bin:/usr/bin:/bin:/usr/sbin:/sbin"
48
49 # optionals {{{
50 prt-get isinst alsa-lib && KODI_EXTRA+=' -D ENABLE_ALSA=ON' || KODI_EXTRA+=' -D ENABLE_ALSA=OFF'
51 prt-get isinst avahi && KODI_EXTRA+=' -D ENABLE_AVAHI=ON' || KODI_EXTRA+=' -D ENABLE_AVAHI=OFF'
52 prt-get isinst bluez sbc && KODI_EXTRA+=' -D ENABLE_BLUETOOTH=ON' || KODI_EXTRA+=' -D ENABLE_BLUETOOTH=OFF'
53 prt-get isinst dav1d && KODI_EXTRA+=' -D ENABLE_INTERNAL_DAV1D=OFF' || KODI_EXTRA+=' -D ENABLE_INTERNAL_DAV1D=ON'
54 prt-get isinst libmicrohttpd && KODI_EXTRA+=' -D ENABLE_MICROHTTPD=ON' || KODI_EXTRA+=' -D ENABLE_MICROHTTPD=OFF'
55 prt-get isinst libnfs && KODI_EXTRA+=' -D ENABLE_NFS=ON' || KODI_EXTRA+=' -D ENABLE_NFS=OFF'
56 prt-get isinst libva && KODI_EXTRA+=' -D ENABLE_VAAPI=ON' || KODI_EXTRA+=' -D ENABLE_VAAPI=OFF'
57 prt-get isinst libva-vdpau-driver && KODI_EXTRA+=' -D ENABLE_VDPAU=ON' || KODI_EXTRA+=' -D ENABLE_VDPAU=OFF'
58 prt-get isinst libxslt && KODI_EXTRA+=' -D ENABLE_XSLT=ON' || KODI_EXTRA+=' -D ENABLE_XSLT=OFF'
59 prt-get isinst mysql && KODI_EXTRA+=' -D ENABLE_MYSQLCLIENT=OFF'
60 prt-get isinst mariadb && KODI_EXTRA+=' -D ENABLE_MARIADBCLIENT=OFF'
61 prt-get isinst pulseaudio && KODI_EXTRA+=' -D ENABLE_PULSEAUDIO=ON' || KODI_EXTRA+=' -D ENABLE_PULSEAUDIO=OFF'
62
63 prt-get isinst ccache && PATH="$(echo ${PATH} | awk -v RS=: -v ORS=: '/ccache/ {next} {print}' | sed 's/:*$//')"
64 # }}}
65
66 cmake -S xbmc-$version-$_codename -B build -G Ninja $KODI_EXTRA \
67 -D CMAKE_INSTALL_PREFIX=/usr \
68 -D CMAKE_INSTALL_LIBDIR=lib \
69 -D CMAKE_BUILD_TYPE=Release \
70 -D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \
71 -D CMAKE_C_FLAGS_RELEASE="$CFLAGS" \
72 -D CORE_PLATFORM_NAME=wayland \
73 -D APP_RENDER_SYSTEM=gl \
74 -D ENABLE_DBUS=ON \
75 -D ENABLE_EVENTCLIENTS=ON \
76 -D ENABLE_OPTICAL=OFF \
77 -D ENABLE_UDEV=ON \
78 -D ENABLE_PYTHON=ON \
79 -D VERBOSE=OFF \
80 -D ENABLE_DVDCSS=OFF \
81 -D ENABLE_LDGOLD=OFF \
82 -D ENABLE_TESTING=OFF \
83 -D ENABLE_ISO9660PP=OFF \
84 -D ENABLE_INTERNAL_FFMPEG=ON \
85 -D FFMPEG_URL="$SRC/$_ffmpeg_version.tar.gz" \
86 -D ENABLE_INTERNAL_CROSSGUID=ON \
87 -D CROSSGUID_URL="$SRC/crossguid-$_crossguid_version.tar.gz" \
88 -D LIBDVDCSS_URL="$SRC/${name/-wayland/}-libdvdcss-$_libdvdcss_version.tar.gz" \
89 -D LIBDVDNAV_URL="$SRC/${name/-wayland/}-libdvdnav-$_libdvdnav_version.tar.gz" \
90 -D LIBDVDREAD_URL="$SRC/${name/-wayland/}-libdvdread-$_libdvdread_version.tar.gz" \
91 -D ENABLE_INTERNAL_FMT=OFF \
92 -D ENABLE_INTERNAL_FSTRCMP=OFF \
93 -D ENABLE_INTERNAL_FLATBUFFERS=OFF \
94 -D ENABLE_INTERNAL_GTEST=OFF \
95 -D ENABLE_INTERNAL_RapidJSON=OFF \
96 -Wno-dev
97 cmake --build build
98 DESTDIR=$PKG cmake --build build --target install
99 }
100
101 # vim: foldmethod=marker foldlevelstart=1
|