Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- # Name: build.sh
- # Thanks to Russell Tobin for original script
- #
- # Usage:
- # sudo -i
- # ln -s /usr /opt/vc
- # ln -s /usr/bin/python2 /usr/bin/python
- # cd /usr/local/src
- # ./build.sh
- #
- # Note: the "ln" about is because some raspberry userspace packages are compiled from source during build,
- # the files are installed in their "proper" locations in /usr.
- # But some third-party scripts expect e.g. /opt/vc/bin/vcgencmd;
- # Thus the hack
- # ln -s /usr /opt/vc
- #
- #
- # Also the following needs to be put into /boot/firmware/config.txt
- #
- #gpu_mem=128
- #dtoverlay=vc4-fkms-v3d,cma-128
- BASE=$(dirname "$0")
- if [ ! -x /usr/bin/python ] ; then
- echo "/usr/bin/python must exist for this to compile"
- exit 1
- fi
- if [ ! -d /opt/vc ] ; then
- echo "/opt/vc must exist and be linked to /usr for tvheadend to compile"
- exit 1
- fi
- (
- if [ -d "$BASE/tvheadend" ]; then
- cd "$BASE/tvheadend"
- make distclean
- git pull
- else
- apt-get update
- apt install -y \
- build-essential \
- cmake \
- pkg-config \
- git \
- ccache \
- bzip2 \
- wget \
- gettext \
- debhelper \
- python3 \
- python3-dev \
- python3-pip \
- python3-rpi.gpio \
- python2-minimal \
- python-rpi.gpio \
- dvb-apps \
- libraspberrypi-dev \
- libraspberrypi-bin \
- libraspberrypi0 \
- libssl-dev \
- libavahi-client-dev \
- zlib1g-dev \
- libavcodec-dev \
- libavcodec-extra \
- libavfilter-dev \
- libavfilter-extra \
- libavformat-dev \
- libavutil-dev \
- libfdk-aac-dev \
- libfdk-aac1 \
- libswscale-dev \
- libdvbcsa-dev \
- libavresample-dev \
- libiconv-hook-dev \
- libkqueue-dev \
- liburiparser-dev \
- libcurl4-gnutls-dev \
- libpcre2-dev \
- libpcre3-dev \
- libva-dev \
- libva-drm2 \
- libva-x11-2 \
- libsystemd-dev \
- libomxil-bellagio-dev \
- libprotobuf-dev \
- libtcmalloc-minimal4 \
- libgoogle-perftools-dev
- snap install rpi-userland --edge
- cd "$BASE"
- git clone -v https://github.com/tvheadend/tvheadend.git tvheadend # --depth=5 (need version tag workaround else 0.0.0 version)
- cd "$BASE/tvheadend"
- fi
- echo "AUTOBUILD_CONFIGURE_EXTRA=\"\${AUTOBUILD_CONFIGURE_EXTRA:-} --arch=armhf\"" > Autobuild/focal-armhf.sh
- echo "DEBDIST=focal" >> Autobuild/focal-armhf.sh
- echo "source Autobuild/debian.sh" >> Autobuild/focal-armhf.sh
- echo "AUTOBUILD_CONFIGURE_EXTRA=\"\${AUTOBUILD_CONFIGURE_EXTRA:-} --arch=arm64\"" > Autobuild/focal-arm64.sh
- echo "DEBDIST=focal" >> Autobuild/focal-arm64.sh
- echo "source Autobuild/debian.sh" >> Autobuild/focal-arm64.sh
- time (
- AUTOBUILD_CONFIGURE_EXTRA=""
- AUTOBUILD_CONFIGURE_EXTRA="$AUTOBUILD_CONFIGURE_EXTRA --disable-android --enable-pie --enable-avahi --enable-libsystemd_daemon --disable-bintray_cache --enable-libav --enable-libopus --enable-libtheora --enable-libvorbis --enable-libfdkaac --enable-omx --enable-mmal --enable-vaapi --enable-drm --enable-nonfree --disable-hdhomerun_client --disable-hdhomerun_static --enable-omx-rpi"
- AUTOBUILD_CONFIGURE_EXTRA="$AUTOBUILD_CONFIGURE_EXTRA --disable-libvpx_static --disable-libvpx"
- export AUTOBUILD_CONFIGURE_EXTRA
- ./Autobuild.sh -j$(nproc)
- )
- ) 2>&1 | tee "$BASE/build.log"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement