Advertisement
Guest User

tvh-rpi3-build

a guest
Feb 18th, 2022
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.47 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. # Name: build.sh
  4. # Thanks to Russell Tobin for original script
  5. #
  6. # Usage:
  7. #    sudo -i
  8. #    ln -s /usr /opt/vc
  9. #    ln -s /usr/bin/python2 /usr/bin/python
  10. #    cd /usr/local/src
  11. #    ./build.sh
  12.  
  13. #
  14. # Note: the "ln" about is because some raspberry userspace packages are compiled from source during build,
  15. # the files are installed in their "proper" locations in /usr.
  16. # But some third-party scripts expect e.g. /opt/vc/bin/vcgencmd;
  17. # Thus the hack
  18. #    ln -s /usr /opt/vc
  19. #
  20.  
  21. #
  22. # Also the following needs to be put into /boot/firmware/config.txt
  23. #
  24. #gpu_mem=128
  25. #dtoverlay=vc4-fkms-v3d,cma-128
  26.  
  27. BASE=$(dirname "$0")
  28.  
  29. if [ ! -x /usr/bin/python ] ; then
  30.    echo "/usr/bin/python must exist for this to compile"
  31.    exit 1
  32. fi
  33. if [ ! -d /opt/vc ] ; then
  34.    echo "/opt/vc must exist and be linked to /usr for tvheadend to compile"
  35.    exit 1
  36. fi
  37.  
  38. (
  39.   if [ -d "$BASE/tvheadend" ]; then
  40.     cd "$BASE/tvheadend"
  41.     make distclean
  42.     git pull
  43.   else
  44.     apt-get update
  45.     apt install -y \
  46.         build-essential \
  47.         cmake \
  48.         pkg-config \
  49.         git \
  50.         ccache \
  51.         bzip2 \
  52.         wget \
  53.         gettext \
  54.         debhelper \
  55.         python3 \
  56.         python3-dev \
  57.         python3-pip \
  58.         python3-rpi.gpio \
  59.         python2-minimal \
  60.         python-rpi.gpio \
  61.         dvb-apps \
  62.         libraspberrypi-dev \
  63.         libraspberrypi-bin \
  64.         libraspberrypi0 \
  65.         libssl-dev \
  66.         libavahi-client-dev \
  67.         zlib1g-dev \
  68.         libavcodec-dev \
  69.         libavcodec-extra \
  70.         libavfilter-dev \
  71.         libavfilter-extra \
  72.         libavformat-dev \
  73.         libavutil-dev \
  74.         libfdk-aac-dev \
  75.         libfdk-aac1 \
  76.         libswscale-dev \
  77.         libdvbcsa-dev \
  78.         libavresample-dev \
  79.         libiconv-hook-dev \
  80.         libkqueue-dev \
  81.         liburiparser-dev \
  82.         libcurl4-gnutls-dev \
  83.         libpcre2-dev \
  84.         libpcre3-dev \
  85.         libva-dev \
  86.         libva-drm2 \
  87.         libva-x11-2 \
  88.         libsystemd-dev \
  89.         libomxil-bellagio-dev \
  90.         libprotobuf-dev \
  91.         libtcmalloc-minimal4 \
  92.         libgoogle-perftools-dev
  93.  
  94.     snap install rpi-userland --edge
  95.  
  96.     cd "$BASE"
  97.     git clone -v https://github.com/tvheadend/tvheadend.git tvheadend # --depth=5 (need version tag workaround else 0.0.0 version)
  98.     cd "$BASE/tvheadend"
  99.   fi
  100.   echo "AUTOBUILD_CONFIGURE_EXTRA=\"\${AUTOBUILD_CONFIGURE_EXTRA:-} --arch=armhf\"" > Autobuild/focal-armhf.sh
  101.   echo "DEBDIST=focal" >> Autobuild/focal-armhf.sh
  102.   echo "source Autobuild/debian.sh" >> Autobuild/focal-armhf.sh
  103.  
  104.   echo "AUTOBUILD_CONFIGURE_EXTRA=\"\${AUTOBUILD_CONFIGURE_EXTRA:-} --arch=arm64\"" > Autobuild/focal-arm64.sh
  105.   echo "DEBDIST=focal" >> Autobuild/focal-arm64.sh
  106.   echo "source Autobuild/debian.sh" >> Autobuild/focal-arm64.sh
  107.  
  108.   time (
  109.       AUTOBUILD_CONFIGURE_EXTRA=""
  110.     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"
  111.     AUTOBUILD_CONFIGURE_EXTRA="$AUTOBUILD_CONFIGURE_EXTRA --disable-libvpx_static --disable-libvpx"  
  112.     export AUTOBUILD_CONFIGURE_EXTRA
  113.     ./Autobuild.sh -j$(nproc)
  114.   )
  115. ) 2>&1 | tee "$BASE/build.log"
  116.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement