blob: 1e946b1da1c7cf60437c11cfe75bbe882f6128ea (
plain)
1 # Description: Open source home theater software, running in a gbm buffer
2 # URL: https://kodi.tv/
3 # Maintainer: Tim Biermann, tbier at posteo dot de
4 # Depends on: dbus flatbuffers fstrcmp libass libcdio libdvdread libinput libmicrohttpd libxkbcommon mesa openjdk17-jdk rapidjson rtmpdump spdlog swig taglib tinyxml
5 # Optional: alsa-lib avahi bluez dav1d libmicrohttpd libnfs libnghttp2 libva libva-vdpau-driver libxslt mariadb mysql pipewire pulseaudio
6
7 name=kodi-gbm
8 version=19.5
9 release=1
10
11 # version variables {{{
12 _codename=Matrix
13 _ffmpeg_version="4.3-kodi-dav1d-1.0"
14 _crossguid_version="8f399e8bd4"
15 _fmt_version="6.1.2"
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/BlackIkeEagle/kodi-FFmpeg/archive/refs/heads/fix/$_ffmpeg_version.tar.gz
23 https://sources.archlinux.org/other/community/kodi/kodi-ffmpeg-$_ffmpeg_version.tar.gz
24 #https://github.com/xbmc/FFmpeg/archive/$_ffmpeg_version.tar.gz
25 #http://mirrors.kodi.tv/build-deps/sources/fmt-$_fmt_version.tar.gz
26 http://mirrors.kodi.tv/build-deps/sources/crossguid-$_crossguid_version.tar.gz
27 https://github.com/xbmc/libdvdcss/archive/$_libdvdcss_version/${name/-gbm/}-libdvdcss-$_libdvdcss_version.tar.gz
28 https://github.com/xbmc/libdvdnav/archive/$_libdvdnav_version/${name/-gbm/}-libdvdnav-$_libdvdnav_version.tar.gz
29 https://github.com/xbmc/libdvdread/archive/$_libdvdread_version/${name/-gbm}-libdvdread-$_libdvdread_version.tar.gz)
30 # }}}
31 # unpack_source() {{{
32 unpack_source() {
33 for file in ${source[@]}; do
34 case ${file##*/} in
35 xbmc-$version-$_codename.tar.gz)
36 bsdtar -p -o -C $SRC -xf $(get_filename $file) ;;
37 *)
38 cp $(get_filename $file) $SRC ;;
39 esac
40 done
41 }
42 # }}}
43
44 build() {
45 # clang? {{{
46 if [[ $PKGMK_KODI_USE_CLANG == on ]]; then
47 [[ -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' || echo "Please install clang first"
48 fi
49 # }}}
50 unset PATH
51 export PATH="/usr/lib/java/openjdk17-jdk/bin:/usr/bin:/bin:/usr/sbin:/sbin"
52
53 # optionals {{{
54 prt-get isinst alsa-lib && KODI_EXTRA+=' -D ENABLE_ALSA=ON' || KODI_EXTRA+=' -D ENABLE_ALSA=OFF'
55 prt-get isinst avahi && KODI_EXTRA+=' -D ENABLE_AVAHI=ON' || KODI_EXTRA+=' -D ENABLE_AVAHI=OFF'
56 prt-get isinst bluez sbc && KODI_EXTRA+=' -D ENABLE_BLUETOOTH=ON' || KODI_EXTRA+=' -D ENABLE_BLUETOOTH=OFF'
57 prt-get isinst dav1d && KODI_EXTRA+=' -D ENABLE_INTERNAL_DAV1D=OFF' || KODI_EXTRA+=' -D ENABLE_INTERNAL_DAV1D=ON'
58 prt-get isinst libmicrohttpd && KODI_EXTRA+=' -D ENABLE_MICROHTTPD=ON' || KODI_EXTRA+=' -D ENABLE_MICROHTTPD=OFF'
59 prt-get isinst libnfs && KODI_EXTRA+=' -D ENABLE_NFS=ON' || KODI_EXTRA+=' -D ENABLE_NFS=OFF'
60 prt-get isinst libva && KODI_EXTRA+=' -D ENABLE_VAAPI=ON' || KODI_EXTRA+=' -D ENABLE_VAAPI=OFF'
61 prt-get isinst libva-vdpau-driver && KODI_EXTRA+=' -D ENABLE_VDPAU=ON' || KODI_EXTRA+=' -D ENABLE_VDPAU=OFF'
62 prt-get isinst libxslt && KODI_EXTRA+=' -D ENABLE_XSLT=ON' || KODI_EXTRA+=' -D ENABLE_XSLT=OFF'
63 prt-get isinst mysql && KODI_EXTRA+=' -D ENABLE_MYSQLCLIENT=ON'
64 prt-get isinst mariadb && KODI_EXTRA+=' -D ENABLE_MARIADBCLIENT=ON'
65 prt-get isinst pulseaudio && KODI_EXTRA+=' -D ENABLE_PULSEAUDIO=ON' || KODI_EXTRA+=' -D ENABLE_PULSEAUDIO=OFF'
66
67 prt-get isinst ccache && PATH="$(echo ${PATH} | awk -v RS=: -v ORS=: '/ccache/ {next} {print}' | sed 's/:*$//')"
68 # }}}
69
70 # grabbed off from gentoo
71 #for i in xbmc-$version-$_codename/tools/depends/native/TexturePacker/src xbmc-$version-$_codename/tools/depends/native/JsonSchemaBuilder/src; do
72 for i in xbmc-$version-$_codename/tools/depends/native/{TexturePacker,JsonSchemaBuilder}/src; do
73 pushd $i;
74 autoreconf -vfi;
75 popd
76 done
77
78 sed -e 's/autoreconf -vif/echo "autoreconf already done"/' -i \
79 xbmc-$version-$_codename/tools/depends/native/TexturePacker/src/autogen.sh \
80 xbmc-$version-$_codename/tools/depends/native/JsonSchemaBuilder/src/autogen.sh
81
82 cmake -S xbmc-$version-$_codename -B build -G Ninja $KODI_EXTRA \
83 -D CMAKE_INSTALL_PREFIX=/usr \
84 -D CMAKE_INSTALL_LIBDIR=lib \
85 -D CMAKE_BUILD_TYPE=Release \
86 -D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS -Wno-error=restrict" \
87 -D CMAKE_C_FLAGS_RELEASE="$CFLAGS" \
88 -D CORE_PLATFORM_NAME=gbm \
89 -D APP_RENDER_SYSTEM=gles \
90 -D ENABLE_DBUS=ON \
91 -D ENABLE_DVDCSS=ON \
92 -D ENABLE_EVENTCLIENTS=ON \
93 -D ENABLE_UDEV=ON \
94 -D ENABLE_PYTHON=ON \
95 -D fmt_DIR=/usr/lib/cmake/fmt \
96 -D spdlog_DIR=/usr/lib/cmake/spdlog \
97 -D ENABLE_ISO9660PP=OFF \
98 -D ENABLE_LDGOLD=OFF \
99 -D ENABLE_OPTICAL=OFF \
100 -D ENABLE_TESTING=OFF \
101 -D VERBOSE=OFF \
102 -D ENABLE_INTERNAL_FFMPEG=ON \
103 -D FFMPEG_URL="$SRC/kodi-ffmpeg-$_ffmpeg_version.tar.gz" \
104 -D ENABLE_INTERNAL_CROSSGUID=ON \
105 -D CROSSGUID_URL="$SRC/crossguid-$_crossguid_version.tar.gz" \
106 -D LIBDVDCSS_URL="$SRC/${name/-gbm/}-libdvdcss-$_libdvdcss_version.tar.gz" \
107 -D LIBDVDNAV_URL="$SRC/${name/-gbm/}-libdvdnav-$_libdvdnav_version.tar.gz" \
108 -D LIBDVDREAD_URL="$SRC/${name/-gbm/}-libdvdread-$_libdvdread_version.tar.gz" \
109 -D ENABLE_INTERNAL_FMT=OFF \
110 -D ENABLE_INTERNAL_FSTRCMP=OFF \
111 -D ENABLE_INTERNAL_FLATBUFFERS=OFF \
112 -D ENABLE_INTERNAL_GTEST=OFF \
113 -D ENABLE_INTERNAL_RapidJSON=OFF \
114 -Wno-dev
115 cmake --build build
116 DESTDIR=$PKG cmake --build build --target install
117
118 export PYTHONHASHSEED=0
119 /usr/bin/python3 -m compileall -d / $PKG/usr/lib
120 /usr/bin/python3 -O -m compileall -d / $PKG/usr/lib
121
122 rm -r $PKG/usr/{lib/firewalld,share/doc}
123 }
124
125 # vim: foldmethod=marker foldlevelstart=1
|