Project

General

Profile

[MANUAL] Building .DEB packages on clean Ubuntu or other Debian distros

Added by saen acro almost 8 years ago

Manual debugging step by step

There is a manual in WIKI with says there is a some needed packages dependency
https://tvheadend.org/projects/tvheadend/wiki/Building

Following this manual (from wiki) there is no chance to make any package

So here is how to solve this:
(Ubuntu 14.04LTS x86_64 used but possible to be used on newer, even "x86" version)

There is a lot of packages with need to install

First packages from wiki

sudo apt install build-essential git pkg-config libssl-dev bzip2 wget libavahi-client-dev zlib1g-dev libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libavresample-dev

so let see is this correct by running

./configure

and result is

surprise nothing happens

so we need package gettext

sudo apt install gettext

again configure command

Again missing essential part

sudo apt install cmake

Again configure

And success, there is a chance to build .DEB, but is it so simple are we miss some?

  checking for cc libiconv ...                      fail
  checking for cc libdvben50221 ...                 fail
  checking for pkg liburiparser  ...                fail (detected <none>)

those maby not 100% needed but lets install it:


libiconv
there is some strange with this library in newer version it is build in in in other library

sudo apt install libiconv-hook-dev

/// this will not solve dependency error message, maby error in configure script


libdvben50221
this is DVB-CI support for hardware CAM module on some devices
solved by instaling dvb-apps

sudo apt install dvb-apps


liburiparser

sudo apt install liburiparser-dev

Let's see with configure

Some will ask about

  checking for cc nvEncodeAPI.h ...                 fail

this is NVENC (nVidia hardware accelerator for transcoding)
I don't use nVidia can't help, there is a separate topic

So let's continue with bulding of .DEB packages.

Next step is to use Autobuild.sh, with will make all automatically. or not.


Again something missing
sudo apt install debhelper libcurl4-gnutls-dev

Crossing fingers an run again Autobuild.sh

If everything is OK,
compilation of FFMPEG X264/5 OGG AAC and some other codecs will be compiled before TVHeadend and finally .DEB files.

If there is no critical errors at the end there is show something as this

dpkg-buildpackage: binary only upload (no source included)
doozer-versioned-artifact:/opt/tvheadend/../tvheadend_4.1-2398~gc38af4c_amd64.deb:deb:application/x-deb:tvheadend_4.1-2398~gc38af4c_amd64.deb
doozer-versioned-artifact:/opt/tvheadend/../tvheadend-dbg_4.1-2398~gc38af4c_amd64.deb:deb:application/x-deb:tvheadend-dbg_4.1-2398~gc38af4c_amd64.deb
doozer-versioned-artifact:/opt/tvheadend/../tvheadend_4.1-2398~gc38af4c_amd64.changes:changes:text/plain:tvheadend_4.1-2398~gc38af4c_amd64.changes


/opt/tvheadend/../

this mean that I'm using /opt/tvheadend/ (source from git)
and files are generated in ../ (upper level) in this case /opt
installation can be done by command
sudo  dpkg -i tvheadend_4.1-2398~gc38af4c_amd64.deb


=====
Edit new dependency libpcre /Perl 5 Compatible Regular Expression Library/
to install it add

Sudo apt instal libpcre2-dev

Warning library is not accessible to all OS versions then use libpcre3-dev


GPU VA hardware acceleration aka Transcoding

  checking for pkg libva >=0.38.0 ...               ok (detected 0.39.0)
  checking for pkg libva-x11 >=0.38.0 ...           ok (detected 0.39.0)
  checking for pkg libva-drm >=0.38.0 ...           ok (detected 0.39.0)

libva-dev
libva-drm1 (libva-drm2)
libva-x11-1 (libva-x11-1)
i965-va-driver-shaders
(Latest Debian probably Ubuntu 20.04 for Intel GPU)

to work hardware need to support VA-API version minimum 0.39.0
ex.

there is a situation when Intel drivers are very buggy but work also
ex:


Short version of all needed packages

sudo apt install build-essential git ccache libpcre2-dev pkg-config libssl-dev bzip2 \
wget libavahi-client-dev zlib1g-dev libavcodec-dev libavutil-dev libavformat-dev \
libswscale-dev libavresample-dev gettext cmake libiconv-hook-dev liburiparser-dev \
debhelper libcurl4-gnutls-dev python-minimal libdvbcsa-dev python-requests

If libpcre2-dev not found use libpcre3-dev

Optional packages for optional features ;)

sudo apt install dvb-apps libva-dev libva-drm1 libva-x11-1

If used Ubuntu 18.04+ libva-drm2 libva-x11-2

To enable SYSTEMD service --enable-libsystemd_daemon on Ubuntu 18.04 and upper, install libsystemd-dev

Keep in mind, this will install ~400+Mb packages.
Some packages will install other packages to satisfy its dependencies


How to clone Github repo to local folder

Usually regular command to clone repo is

git clone https://github.com/tvheadend/tvheadend.git

This will download latest source code (unstable) ready for compilation
but if need stable or other
use command
git clone -b release/4.2 https://github.com/tvheadend/tvheadend.git

command explained
git clone -b <branch> <remote_repo>

branch list can be seen at https://github.com/tvheadend/tvheadend


ARM OpenMax support

Use only on ARM boards

apt install libomxil-bellagio-dev

do not forget to add option
--enable-omx

Python

Autobuild script search for python but it was replaced by python3
solution:

--python=/usr/bin/python3


Automated build script

Currently just clone only latest repo source code and compile it

#!/bin/bash

BASE=$(dirname "$0")
(
  if [ -d "$BASE/tvheadend" ]; then
    cd "$BASE/tvheadend" 
    git pull
  else
    cd "$BASE" 
    git clone https://github.com/tvheadend/tvheadend.git tvheadend # --depth=5 (need version tag workaround else 0.0.0 version)
    cd "$BASE/tvheadend" 
  fi
  time AUTOBUILD_CONFIGURE_EXTRA="--disable-bintray_cache --enable-vaapi --enable-nvenc --disable-hdhomerun_client --disable-hdhomerun_static " ./Autobuild.sh -j$(nproc) # edit only betwin "quotation marks" 
) | tee "$BASE/build.log" 

Use command

./configure --help

to see possible options.


Replies (92)

RE: [MANUAL] Building .DEB packages on clean Ubuntu or other Debian distros - Added by Adrian A about 4 years ago

If I want to compile with raspberry pi 4, I do get the errors:

make[6]: Nothing to be done for 'install-exec-am'.
/bin/bash ./mkinstalldirs /home/pi/tvheadend/build.linux/ffmpeg/build/ffmpeg/lib/pkgconfig
/usr/bin/install -c -m 644 theora.pc /home/pi/tvheadend/build.linux/ffmpeg/build/ffmpeg/lib/pkgconfig/theora.pc
/usr/bin/install -c -m 644 theoradec.pc /home/pi/tvheadend/build.linux/ffmpeg/build/ffmpeg/lib/pkgconfig/theoradec.pc
/usr/bin/install -c -m 644 theoraenc.pc /home/pi/tvheadend/build.linux/ffmpeg/build/ffmpeg/lib/pkgconfig/theoraenc.pc
make[6]: Leaving directory '/home/pi/tvheadend/build.linux/ffmpeg/libtheora-1.1.1'
make[5]: Leaving directory '/home/pi/tvheadend/build.linux/ffmpeg/libtheora-1.1.1'
make[4]: Leaving directory '/home/pi/tvheadend/build.linux/ffmpeg/libtheora-1.1.1'
[ 27%] Building CXX object encoder/CMakeFiles/encoder.dir/weightPrediction.cpp.o
make[6]: Leaving directory '/home/pi/tvheadend/build.linux/ffmpeg/x265_3.2/build/linux'
[ 27%] Built target encoder
make[5]: Leaving directory '/home/pi/tvheadend/build.linux/ffmpeg/x265_3.2/build/linux'
make[4]: *** [Makefile:130: all] Error 2
make[4]: Leaving directory '/home/pi/tvheadend/build.linux/ffmpeg/x265_3.2/build/linux'
make[3]: *** [Makefile.ffmpeg:277: /home/pi/tvheadend/build.linux/ffmpeg/x265_3.2/.tvh_build] Error 2
make[3]: Leaving directory '/home/pi/tvheadend'
make[2]: *** [Makefile:853: /home/pi/tvheadend/build.linux/ffmpeg/build/ffmpeg/lib/libavcodec.a] Error 2
make[2]: Leaving directory '/home/pi/tvheadend'
make[1]: *** [debian/rules:15: override_dh_auto_build] Error 2
make[1]: Leaving directory '/home/pi/tvheadend'
make: *** [debian/rules:6: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2

Any help is appreciated

RE: [MANUAL] Building .DEB packages on clean Ubuntu or other Debian distros - Added by saen acro about 4 years ago

Adrian A wrote:

If I want to compile with raspberry pi 4, I do get the errors:

make[6]: Nothing to be done for 'install-exec-am'.
/bin/bash ./mkinstalldirs /home/pi/tvheadend/build.linux/ffmpeg/build/ffmpeg/lib/pkgconfig
/usr/bin/install -c -m 644 theora.pc /home/pi/tvheadend/build.linux/ffmpeg/build/ffmpeg/lib/pkgconfig/theora.pc
/usr/bin/install -c -m 644 theoradec.pc /home/pi/tvheadend/build.linux/ffmpeg/build/ffmpeg/lib/pkgconfig/theoradec.pc
/usr/bin/install -c -m 644 theoraenc.pc /home/pi/tvheadend/build.linux/ffmpeg/build/ffmpeg/lib/pkgconfig/theoraenc.pc
make[6]: Leaving directory '/home/pi/tvheadend/build.linux/ffmpeg/libtheora-1.1.1'
make[5]: Leaving directory '/home/pi/tvheadend/build.linux/ffmpeg/libtheora-1.1.1'
make[4]: Leaving directory '/home/pi/tvheadend/build.linux/ffmpeg/libtheora-1.1.1'
[ 27%] Building CXX object encoder/CMakeFiles/encoder.dir/weightPrediction.cpp.o
make[6]: Leaving directory '/home/pi/tvheadend/build.linux/ffmpeg/x265_3.2/build/linux'
[ 27%] Built target encoder
make[5]: Leaving directory '/home/pi/tvheadend/build.linux/ffmpeg/x265_3.2/build/linux'
make[4]: *** [Makefile:130: all] Error 2
make[4]: Leaving directory '/home/pi/tvheadend/build.linux/ffmpeg/x265_3.2/build/linux'
make[3]: *** [Makefile.ffmpeg:277: /home/pi/tvheadend/build.linux/ffmpeg/x265_3.2/.tvh_build] Error 2
make[3]: Leaving directory '/home/pi/tvheadend'
make[2]: *** [Makefile:853: /home/pi/tvheadend/build.linux/ffmpeg/build/ffmpeg/lib/libavcodec.a] Error 2
make[2]: Leaving directory '/home/pi/tvheadend'
make[1]: *** [debian/rules:15: override_dh_auto_build] Error 2
make[1]: Leaving directory '/home/pi/tvheadend'
make: *** [debian/rules:6: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2

Any help is appreciated

--disable-libx265_static
also rest "static"

RE: [MANUAL] Building .DEB packages on clean Ubuntu or other Debian distros - Added by Adrian A about 4 years ago

okay, I compiled my own ffmpeg, but now I encountered the error:

/usr/bin/ld: /usr/local/lib/libvpx.a(decodemv.c.o): in function `vp8_decode_mode_mvs':
(.text+0x2400): dangerous relocation: unsupported relocation
/usr/bin/ld: (.text+0x2404): dangerous relocation: unsupported relocation
/usr/bin/ld: (.text+0x2408): dangerous relocation: unsupported relocation
/usr/bin/ld: (.text+0x240c): dangerous relocation: unsupported relocation
/usr/bin/ld: (.text+0x2430): dangerous relocation: unsupported relocation
/usr/bin/ld: (.text+0x2434): dangerous relocation: unsupported relocation
/usr/bin/ld: (.text+0x2438): dangerous relocation: unsupported relocation
/usr/bin/ld: (.text+0x243c): dangerous relocation: unsupported relocation
/usr/bin/ld: (.text+0x28e8): dangerous relocation: unsupported relocation
/usr/bin/ld: (.text+0x28ec): dangerous relocation: unsupported relocation
/usr/bin/ld: (.text+0x28f0): dangerous relocation: unsupported relocation
/usr/bin/ld: (.text+0x28f4): dangerous relocation: unsupported relocation
/usr/bin/ld: BFD (GNU Binutils for Raspbian) 2.31.1 internal error, aborting at ../../bfd/elf32-arm.c:9459 in elf32_arm_add_dynreloc

/usr/bin/ld: Please report this bug.

collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:712: /home/pi/tvheadend/build.linux/tvheadend] Error 1
make[2]: Leaving directory '/home/pi/tvheadend'
make[1]: *** [debian/rules:15: override_dh_auto_build] Error 2
make[1]: Leaving directory '/home/pi/tvheadend'
make: *** [debian/rules:6: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2

real    1m35.397s
user    4m18.573s
sys     0m39.690s

any help?

RE: [MANUAL] Building .DEB packages on clean Ubuntu or other Debian distros - Added by Adrian A about 4 years ago

Okay, but some libs still make problems

/usr/bin/ld: /usr/local/lib/libvpx.a(decodemv.c.o): in function `vp8_decode_mode_mvs':
(.text+0x2400): dangerous relocation: unsupported relocation
/usr/bin/ld: (.text+0x2404): dangerous relocation: unsupported relocation
/usr/bin/ld: (.text+0x2408): dangerous relocation: unsupported relocation
/usr/bin/ld: (.text+0x240c): dangerous relocation: unsupported relocation
/usr/bin/ld: (.text+0x2430): dangerous relocation: unsupported relocation
/usr/bin/ld: (.text+0x2434): dangerous relocation: unsupported relocation
/usr/bin/ld: (.text+0x2438): dangerous relocation: unsupported relocation
/usr/bin/ld: (.text+0x243c): dangerous relocation: unsupported relocation
/usr/bin/ld: (.text+0x28e8): dangerous relocation: unsupported relocation
/usr/bin/ld: (.text+0x28ec): dangerous relocation: unsupported relocation
/usr/bin/ld: (.text+0x28f0): dangerous relocation: unsupported relocation
/usr/bin/ld: (.text+0x28f4): dangerous relocation: unsupported relocation
/usr/bin/ld: /usr/local/lib/libx264.a(base.o)(.text+0xc): unresolvable R_ARM_MOVW_ABS_NC relocation against symbol `stderr@@GLIBC_2.4'
/usr/bin/ld: final link failed: symbol needs debug section which does not exist
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:712: /home/pi/tvheadend/build.linux/tvheadend] Error 1
make[2]: Leaving directory '/home/pi/tvheadend'
make[1]: *** [debian/rules:15: override_dh_auto_build] Error 2
make[1]: Leaving directory '/home/pi/tvheadend'
make: *** [debian/rules:6: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2

real    1m40.534s
user    4m20.814s
sys     0m38.719s

RE: [MANUAL] Building .DEB packages on clean Ubuntu or other Debian distros - Added by saen acro about 4 years ago

Adrian A wrote:

Okay, but some libs still make problems

[...]

What is a command line?

RE: [MANUAL] Building .DEB packages on clean Ubuntu or other Debian distros - Added by Bapak Ireng about 4 years ago

Hi, this is my output of ./configure:
serv03@root /home/tvheadend/tvheadend-master: ./configure
Checking support/features
checking for cc execinfo.h ... ok
checking for cc -mmmx ... ok
checking for cc -msse2 ... ok
checking for cc -Wunused-result ... ok
checking for cc -fstack-protector ... ok
checking for cc -fstack-protector-strong ... ok
checking for cc -fstack-check ... ok
checking for cc -fPIE ... ok
checking for cc strlcat ... fail
checking for cc strlcpy ... fail
checking for cc fdatasync ... ok
checking for cc getloadavg ... ok
checking for cc atomic32 ... ok
checking for cc atomic64 ... ok
checking for cc atomic_time_t ... ok
checking for cc atomic_ptr ... ok
checking for cc bitops64 ... ok
checking for cc lockowner ... ok
checking for cc qsort_r ... ok
checking for cc stime ... ok
checking for cc gmtoff ... ok
checking for cc recvmmsg ... ok
checking for cc sendmmsg ... ok
checking for cc libiconv ... fail
^ using build-in glibc iconv routines
checking for cc ifnames ... ok
checking for cc cclang_threadsan ... fail
checking for py module gzip ... ok
checking for pkg-config ... ok
checking for xgettext ... ok
checking for msgmerge ... ok
checking for gzip ... ok
checking for bzip2 ... ok
checking for pkg openssl ... ok (detected 1.1.1d)
checking for cc linux/dvb/version.h ... ok
checking for pkg zlib ... ok (detected 1.2.11)
checking for pkg libpcre2-8 ... ok (detected 10.32)
checking for pkg liburiparser ... ok (detected 0.9.1)
checking for pkg avahi-client ... ok (detected 0.7)
checking for cmake ... ok
checking for cc -lstdc++ ... ok
checking for pkg libva >=0.38.0 ... ok (detected 1.4.0)
checking for pkg libva-x11 >=0.38.0 ... ok (detected 1.4.0)
checking for pkg libva-drm >=0.38.0 ... ok (detected 1.4.0)
checking for cc sys/inotify.h ... ok
checking for cc inotify_init1 ... ok
checking for cc dvbcsa/dvbcsa.h ... ok
checking for cc -ldvbcsa ... ok
fetching dvb-scan files ... ok
checking for cc epoll_create1 ... ok
checking for pkg dbus-1 ... ok (detected 1.12.20)

Compiler:
Using C compiler: cc
Using LD flags: -ldvbcsa
Build for arch: x86_64

Binaries:
Using PYTHON: python
Using GZIP: gzip
Using BZIP2: bzip2

Options:
pie yes
ccdebug no
cardclient yes
cwc yes
cccam yes
capmt yes
constcw yes
linuxdvb yes
satip_server yes
satip_client yes
hdhomerun_client yes
hdhomerun_static yes
iptv yes
tsfile yes
dvbscan yes
timeshift yes
trace yes
avahi yes
zlib yes
libav yes
ffmpeg_static yes
libx264 yes
libx264_static yes
libx265 yes
libx265_static yes
libvpx yes
libvpx_static yes
libtheora yes
libtheora_static yes
libvorbis yes
libvorbis_static yes
libfdkaac no
libfdkaac_static no
libopus yes
libopus_static yes
nvenc no
vaapi yes
mmal no
omx no
inotify yes
epoll yes
pcre no
pcre2 yes
uriparser yes
ccache no
tvhcsa yes
bundle no
pngquant no
kqueue no
dbus_1 yes
android no
gtimer_check no
slow_memoryinfo no
libsystemd_daemon no
pcloud_cache yes
ddci yes
cclang_threadsan no
gperftools no
execinfo yes
mmx yes
sse2 yes
W_unused_result yes
f_stack_protector yes
f_stack_protector_strong yes
f_stack_check yes
f_PIE yes
fdatasync yes
getloadavg yes
atomic32 yes
atomic64 yes
atomic_time_t yes
atomic_ptr yes
bitops64 yes
lockowner yes
qsort_r yes
stime yes
gmtoff yes
recvmmsg yes
sendmmsg yes
ifnames yes
py_gzip yes
bin_pkg_config yes
bin_xgettext yes
bin_msgmerge yes
bin_gzip yes
bin_bzip2 yes
ssl yes
linuxdvbapi yes
linuxdvb_ca yes
upnp yes
bin_cmake yes
stdcpp yes
libogg_static yes
hwaccels yes
inotify_h yes
inotify_init1 yes
dvbcsa yes
epoll_create1 yes
mpegts yes
mpegts_dvb yes

Packages:
openssl 1.1.1d
zlib 1.2.11
libpcre2-8 10.32
liburiparser 0.9.1
avahi-client 0.7
libva 1.4.0
libva-x11 1.4.0
libva-drm 1.4.0
dbus-1 1.12.20

Installation paths:
Prefix: /usr/local
Binaries: ${prefix}/bin
Libraries: ${prefix}/lib
Data files: ${prefix}/share
Man pages: ${datadir}/man

Final Binary:
/home/tvheadend/tvheadend-master/build.linux/tvheadend

Tvheadend Data Directory:
/usr/local/share/tvheadend

ownloading the sources.

git clone https://github.com/tvheadend/tvheadend.git
Klone nach 'tvheadend' ...
remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 84157 (delta 0), reused 0 (delta 0), pack-reused 84156
Empfange Objekte: 100% (84157/84157), 58.11 MiB | 11.51 MiB/s, Fertig.
Löse Unterschiede auf: 100% (63496/63496), Fertig.

Output of ./Autobuild.sh

./Autobuild.sh -t debian
fatal: Kein Git-Repository (oder irgendein Elternverzeichnis bis zum Einhängepunkt /)
Stoppe bei Dateisystemgrenze (GIT_DISCOVERY_ACROSS_FILESYSTEM nicht gesetzt).

What went wrong ? What is the error ? How to resolve the issue !
Many Thanks in advance for your help !

best regards, ireng4450

RE: [MANUAL] Building .DEB packages on clean Ubuntu or other Debian distros - Added by Bapak Ireng about 4 years ago

Ok, in the meantime eveything worked out, the .deb package is installed and tvheadend is up and running! Now it's time to configure the system.....

RE: [MANUAL] Building .DEB packages on clean Ubuntu or other Debian distros - Added by saen acro about 4 years ago

Added ccache
For those who often compile packages.

RE: [MANUAL] Building .DEB packages on clean Ubuntu or other Debian distros - Added by saen acro about 4 years ago

for more advansed building

sudo apt install libprotobuf-dev libtcmalloc-minimal4 libgoogle-perftools-dev libkqueue-dev

now options

--enable-cclang_threadsan --enable-gperftools --enable-kqueue --enable-ccdebug --enable-gtimer_check --enable-slow_memoryinfo

are possible

RE: [MANUAL] Building .DEB packages on clean Ubuntu or other Debian distros - Added by Russell Tobin over 3 years ago

Hi,

Build script for tvheadend on Ubuntu 20.04 32 bit on Raspberry Pi 4 with 8Gb

My build script:


#!/bin/bash
#
# Name: build.sh
#
# Description: Build script for tvheadend on Ubuntu 20.04 32bit on Raspberry 4 with 4Gb or 8Gb
# Note: Only a couple of miniro changes as noted below to make this build on 64bit 
# 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
#[pi4]
#dtoverlay=vc4-fkms-v3d,cma-128
#max_framebuffers=2

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 \
        fdkacc \
        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 

# The following my not existing Ubuntu 20.04 64bit (arm64) remove from above as required
#        libkqueue-dev
#        fdkacc
#        libfdk-aac-dev
#        libfdk-aac1

# Cant' find the following for armhf or arm64
#i965-va-driver-shaders

# 
# Install rpi-userland libraries / binaries
#
    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)
    #git clone -b -v release/4.2 https://github.com/tvheadend/tvheadend.git
    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" 
    AUTOBUILD_CONFIGURE_EXTRA="$AUTOBUILD_CONFIGURE_EXTRA --disable-libvpx_static --disable-libvpx" 
    AUTOBUILD_CONFIGURE_EXTRA="$AUTOBUILD_CONFIGURE_EXTRA --enable-gtimer_check --enable-slow_memoryinfo --enable-cclang_threadsan --enable-gperftools --enable-ccdebug" 
    export AUTOBUILD_CONFIGURE_EXTRA
    ./Autobuild.sh -j$(nproc) -t focal-armhf
  )
) 2>&1 | tee "$BASE/build.log" 

In case you need it, the output of ./configure:

Checking support/features
  checking for cc execinfo.h ...                    ok
  checking for cc -mmmx ...                         fail
  checking for cc -msse2 ...                        fail
  checking for cc -Wunused-result ...               ok
  checking for cc -fstack-protector ...             ok
  checking for cc -fstack-protector-strong ...      ok
  checking for cc -fstack-check ...                 ok
  checking for cc -fPIE ...                         ok
  checking for cc strlcat ...                       fail
  checking for cc strlcpy ...                       fail
  checking for cc fdatasync ...                     ok
  checking for cc getloadavg ...                    ok
  checking for cc atomic32 ...                      ok
  checking for cc atomic64 ...                      ok
  checking for cc atomic_time_t ...                 ok
  checking for cc atomic_ptr ...                    ok
  checking for cc bitops64 ...                      ok
  checking for cc lockowner ...                     ok
  checking for cc qsort_r ...                       ok
  checking for cc stime ...                         fail
  checking for cc gmtoff ...                        ok
  checking for cc recvmmsg ...                      ok
  checking for cc sendmmsg ...                      ok
  checking for cc libiconv ...                      fail
    ^ using build-in glibc iconv routines
  checking for cc ifnames ...                       ok
  checking for cc cclang_threadsan ...              fail
  checking for py module gzip ...                   ok
  checking for pkg-config ...                       ok
  checking for xgettext ...                         ok
  checking for msgmerge ...                         ok
  checking for gzip ...  hecking support/features
  checking for cc execinfo.h ...                    ok
  checking for cc -mmmx ...                         fail
  checking for cc -msse2 ...                        fail
  checking for cc -Wunused-result ...               ok
  checking for cc -fstack-protector ...             ok
  checking for cc -fstack-protector-strong ...      ok
  checking for cc -fstack-check ...                 ok
  checking for cc -fPIE ...                         ok
  checking for cc strlcat ...                       fail
  checking for cc strlcpy ...                       fail
  checking for cc fdatasync ...                     ok
  checking for cc getloadavg ...                    ok
  checking for cc atomic32 ...                      ok
  checking for cc atomic64 ...                      ok
  checking for cc atomic_time_t ...                 ok
  checking for cc atomic_ptr ...                    ok
  checking for cc bitops64 ...                      ok
  checking for cc lockowner ...                     ok
  checking for cc qsort_r ...                       ok
  checking for cc stime ...                         fail
  checking for cc gmtoff ...                        ok
  checking for cc recvmmsg ...                      ok
  checking for cc sendmmsg ...                      ok
  checking for cc libiconv ...                      fail
    ^ using build-in glibc iconv routines
  checking for cc ifnames ...                       ok
  checking for cc cclang_threadsan ...              fail
  checking for py module gzip ...                   ok
  checking for pkg-config ...                       ok
  checking for xgettext ...                         ok
  checking for msgmerge ...                         ok
  checking for gzip ...                             ok
  checking for bzip2 ...                            ok
  checking for pkg openssl  ...                     ok (detected 1.1.1f)
  checking for cc linux/dvb/version.h ...           ok
  checking for pkg zlib  ...                        ok (detected 1.2.11)
  checking for pkg libpcre2-8  ...                  ok (detected 10.34)
  checking for pkg liburiparser  ...                ok (detected 0.9.3)
  checking for pkg avahi-client  ...                ok (detected 0.7)
  checking for cmake ...                            ok
  checking for cc -lstdc++ ...                      ok
  checking for pkg libva >=0.38.0 ...               ok (detected 1.7.0)
  checking for pkg libva-drm >=0.38.0 ...           ok (detected 1.7.0)
  checking for cc sys/inotify.h ...                 ok
  checking for cc inotify_init1 ...                 ok
  checking for cc dvbcsa/dvbcsa.h ...               ok
  checking for cc -ldvbcsa ...                      ok
  fetching dvb-scan files ...                       ok
  checking for cc epoll_create1 ...                 ok
  checking for pkg dbus-1  ...                      ok (detected 1.12.16)

Compiler:
  Using C compiler:                        ccache cc
  Using LD flags:                           -ldvbcsa
  Build for arch:                          arm

Binaries:
  Using PYTHON:                            python
  Using GZIP:                              gzip
  Using BZIP2:                             bzip2

Options:
  pie                                      yes
  ccdebug                                  no
  cardclient                               yes
  cwc                                      yes
  cccam                                    yes
  capmt                                    yes
  constcw                                  yes
  linuxdvb                                 yes
  satip_server                             yes
  satip_client                             yes
  hdhomerun_client                         yes
  hdhomerun_static                         yes
  iptv                                     yes
  tsfile                                   yes
  dvbscan                                  yes
  timeshift                                yes
  trace                                    yes
  avahi                                    yes
  zlib                                     yes
  libav                                    yes
  ffmpeg_static                            yes
  libx264                                  yes
  libx264_static                           yes
  libx265                                  yes
  libx265_static                           yes
  libvpx                                   yes
  libvpx_static                            yes
  libtheora                                yes
  libtheora_static                         yes
  libvorbis                                yes
  libvorbis_static                         yes
  libfdkaac                                no
  libfdkaac_static                         no
  libopus                                  yes
  libopus_static                           yes
  nvenc                                    no
  vaapi                                    yes
  mmal                                     no
  omx                                      no
  inotify                                  yes
  epoll                                    yes
  pcre                                     no
  pcre2                                    yes
  uriparser                                yes
  ccache                                   yes
  tvhcsa                                   yes
  bundle                                   no
  pngquant                                 no
  kqueue                                   no
  dbus_1                                   yes
  android                                  no
  gtimer_check                             no
  slow_memoryinfo                          no
  libsystemd_daemon                        no
  pcloud_cache                             yes
  ddci                                     yes
  cclang_threadsan                         no
  gperftools                               no
  execinfo                                 yes
  W_unused_result                          yes
  f_stack_protector                        yes
  f_stack_protector_strong                 yes
  f_stack_check                            yes
  f_PIE                                    yes
  fdatasync                                yes
  getloadavg                               yes
  atomic32                                 yes
  atomic64                                 yes
  atomic_time_t                            yes
  atomic_ptr                               yes
  bitops64                                 yes
  lockowner                                yes
  qsort_r                                  yes
  gmtoff                                   yes
  recvmmsg                                 yes
  sendmmsg                                 yes
  ifnames                                  yes
  py_gzip                                  yes
  bin_pkg_config                           yes
  bin_xgettext                             yes
  bin_msgmerge                             yes
  bin_gzip                                 yes
  bin_bzip2                                yes
  ssl                                      yes
  linuxdvbapi                              yes
  linuxdvb_ca                              yes
  upnp                                     yes
  bin_cmake                                yes
  stdcpp                                   yes
  libogg_static                            yes
  hwaccels                                 yes
  inotify_h                                yes
  inotify_init1                            yes
  dvbcsa                                   yes
  epoll_create1                            yes
  mpegts                                   yes
  mpegts_dvb                               yes

Packages:
  openssl                                  1.1.1f
  zlib                                     1.2.11
  libpcre2-8                               10.34
  liburiparser                             0.9.3
  avahi-client                             0.7
  libva                                    1.7.0
  libva-drm                                1.7.0
  dbus-1                                   1.12.16

Installation paths:
  Prefix:                                  /usr/local
  Binaries:                                ${prefix}/bin
  Libraries:                               ${prefix}/lib
  Data files:                              ${prefix}/share
  Man pages:                               ${datadir}/man

Final Binary:
  /usr/local/src/tvheadend/build.linux/tvheadend

Tvheadend Data Directory:
  /usr/local/share/tvheadend
                           ok
  checking for bzip2 ...                            ok
  checking for pkg openssl  ...                     ok (detected 1.1.1f)
  checking for cc linux/dvb/version.h ...           ok
  checking for pkg zlib  ...                        ok (detected 1.2.11)
  checking for pkg libpcre2-8  ...                  ok (detected 10.34)
  checking for pkg liburiparser  ...                ok (detected 0.9.3)
  checking for pkg avahi-client  ...                ok (detected 0.7)
  checking for cmake ...                            ok
  checking for cc -lstdc++ ...                      ok
  checking for pkg libva >=0.38.0 ...               ok (detected 1.7.0)
  checking for pkg libva-drm >=0.38.0 ...           ok (detected 1.7.0)
  checking for cc sys/inotify.h ...                 ok
  checking for cc inotify_init1 ...                 ok
  checking for cc dvbcsa/dvbcsa.h ...               ok
  checking for cc -ldvbcsa ...                      ok
  fetching dvb-scan files ...                       ok
  checking for cc epoll_create1 ...                 ok
  checking for pkg dbus-1  ...                      ok (detected 1.12.16)

Compiler:
  Using C compiler:                        ccache cc
  Using LD flags:                           -ldvbcsa
  Build for arch:                          arm

Binaries:
  Using PYTHON:                            python
  Using GZIP:                              gzip
  Using BZIP2:                             bzip2

Options:
  pie                                      yes
  ccdebug                                  no
  cardclient                               yes
  cwc                                      yes
  cccam                                    yes
  capmt                                    yes
  constcw                                  yes
  linuxdvb                                 yes
  satip_server                             yes
  satip_client                             yes
  hdhomerun_client                         yes
  hdhomerun_static                         yes
  iptv                                     yes
  tsfile                                   yes
  dvbscan                                  yes
  timeshift                                yes
  trace                                    yes
  avahi                                    yes
  zlib                                     yes
  libav                                    yes
  ffmpeg_static                            yes
  libx264                                  yes
  libx264_static                           yes
  libx265                                  yes
  libx265_static                           yes
  libvpx                                   yes
  libvpx_static                            yes
  libtheora                                yes
  libtheora_static                         yes
  libvorbis                                yes
  libvorbis_static                         yes
  libfdkaac                                no
  libfdkaac_static                         no
  libopus                                  yes
  libopus_static                           yes
  nvenc                                    no
  vaapi                                    yes
  mmal                                     no
  omx                                      no
  inotify                                  yes
  epoll                                    yes
  pcre                                     no
  pcre2                                    yes
  uriparser                                yes
  ccache                                   yes
  tvhcsa                                   yes
  bundle                                   no
  pngquant                                 no
  kqueue                                   no
  dbus_1                                   yes
  android                                  no
  gtimer_check                             no
  slow_memoryinfo                          no
  libsystemd_daemon                        no
  pcloud_cache                             yes
  ddci                                     yes
  cclang_threadsan                         no
  gperftools                               no
  execinfo                                 yes
  W_unused_result                          yes
  f_stack_protector                        yes
  f_stack_protector_strong                 yes
  f_stack_check                            yes
  f_PIE                                    yes
  fdatasync                                yes
  getloadavg                               yes
  atomic32                                 yes
  atomic64                                 yes
  atomic_time_t                            yes
  atomic_ptr                               yes
  bitops64                                 yes
  lockowner                                yes
  qsort_r                                  yes
  gmtoff                                   yes
  recvmmsg                                 yes
  sendmmsg                                 yes
  ifnames                                  yes
  py_gzip                                  yes
  bin_pkg_config                           yes
  bin_xgettext                             yes
  bin_msgmerge                             yes
  bin_gzip                                 yes
  bin_bzip2                                yes
  ssl                                      yes
  linuxdvbapi                              yes
  linuxdvb_ca                              yes
  upnp                                     yes
  bin_cmake                                yes
  stdcpp                                   yes
  libogg_static                            yes
  hwaccels                                 yes
  inotify_h                                yes
  inotify_init1                            yes
  dvbcsa                                   yes
  epoll_create1                            yes
  mpegts                                   yes
  mpegts_dvb                               yes

Packages:
  openssl                                  1.1.1f
  zlib                                     1.2.11
  libpcre2-8                               10.34
  liburiparser                             0.9.3
  avahi-client                             0.7
  libva                                    1.7.0
  libva-drm                                1.7.0
  dbus-1                                   1.12.16

Installation paths:
  Prefix:                                  /usr/local
  Binaries:                                ${prefix}/bin
  Libraries:                               ${prefix}/lib
  Data files:                              ${prefix}/share
  Man pages:                               ${datadir}/man

Final Binary:
  /usr/local/src/tvheadend/build.linux/tvheadend

Tvheadend Data Directory:
  /usr/local/share/tvheadend

RE: [MANUAL] Building .DEB packages on clean Ubuntu or other Debian distros - Added by saen acro over 3 years ago

Use pre buton to format quoted text in your post's.

What happens when do

make distclean

before start building?

RE: [MANUAL] Building .DEB packages on clean Ubuntu or other Debian distros - Added by Russell Tobin over 3 years ago

Hi,

Have updated post with final build script that completes the build.
Most of the issues had to do with missing libraries and missing symbolic links - see script for details.

Now getting a Sig fault 11.
Will get a debug/trace log after getting some sleep.

From syslog


Apr 19 12:32:50 ubuntu systemd[1]: Starting Tvheadend - a TV streaming server and DVR...
Apr 19 12:32:50 ubuntu systemd[1]: anacron.service: Succeeded.
Apr 19 12:32:50 ubuntu tvheadend[19379]: main: Log started
Apr 19 12:32:50 ubuntu tvheadend[19379]: tcp: No systemd socket: creating a new one
Apr 19 12:32:50 ubuntu tvheadend[19379]: http: Starting HTTP server 0.0.0.0:9981
Apr 19 12:32:50 ubuntu tvheadend[19379]: tcp: No systemd socket: creating a new one
Apr 19 12:32:50 ubuntu tvheadend[19379]: htsp: Starting HTSP server 0.0.0.0:9982
Apr 19 12:32:50 ubuntu tvheadend[19379]: config: loaded
Apr 19 12:32:50 ubuntu systemd[1]: Started Tvheadend - a TV streaming server and DVR.
Apr 19 12:32:50 ubuntu tvheadend[19379]: config: scanfile (re)initialization with path <none>
Apr 19 12:32:50 ubuntu tvheadend[19379]: transcode: 'video' context type registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: transcode: 'audio' context type registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: transcode: '&TVHH264Decoder' decoder helper registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: transcode: '&TVHTHEORADecoder' decoder helper registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: transcode: '&TVHAACDecoder' decoder helper registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: transcode: '&TVHVORBISDecoder' decoder helper registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: transcode: '&TVHOPUSDecoder' decoder helper registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: transcode: '&TVHMPEG2VIDEOEncoder' encoder helper registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: transcode: '&TVHH264Encoder' encoder helper registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: transcode: '&TVHHEVCEncoder' encoder helper registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: transcode: '&TVHAACEncoder' encoder helper registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: codec: 'mpeg2video' encoder registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: codec: 'mp2' encoder registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: codec: 'aac' encoder registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: codec: 'vorbis' encoder registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: codec: 'flac' encoder registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: codec: 'libx264' encoder registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: codec: 'libx265' encoder registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: codec: 'libtheora' encoder registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: codec: 'libvorbis' encoder registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: codec: 'libfdk_aac' encoder registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: codec: 'libopus' encoder registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: codec: 'h264_vaapi' encoder registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: codec: 'hevc_vaapi' encoder registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: codec: 'vp8_vaapi' encoder registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: codec: 'vp9_vaapi' encoder registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: codec: 'h264_omx' encoder registered
Apr 19 12:32:50 ubuntu tvheadend[19379]: codec: 'webtv-vorbis' codec profile created
Apr 19 12:32:50 ubuntu tvheadend[19379]: codec: 'webtv-h264' codec profile created
Apr 19 12:32:50 ubuntu tvheadend[19379]: codec: 'webtv-aac' codec profile created
Apr 19 12:32:50 ubuntu tvheadend[19379]: codec: codec 'libvpx' not found
Apr 19 12:32:50 ubuntu tvheadend[19379]: codec: unable to create codec profile from config tree: 'webtv-vp8'
Apr 19 12:32:50 ubuntu tvheadend[19379]: descrambler: adding CAID 2600/FFFF as ConstCW interval 10000ms pc 20 ep default (BISS)
Apr 19 12:32:50 ubuntu tvheadend[19379]: descrambler: adding CAID 0E00/FFFF as MultiPID interval 1000ms pc 2 ep default (PowerVu)
Apr 19 12:32:50 ubuntu tvheadend[19379]: iptv: Using 2 input thread(s)
Apr 19 12:32:50 ubuntu tvheadend[19379]: dvr: Creating new configuration ''
Apr 19 12:32:50 ubuntu tvheadend[19379]: access: No access entries loaded
Apr 19 12:32:50 ubuntu tvheadend[19379]: epggrab: module uk_freesat created
Apr 19 12:32:50 ubuntu tvheadend[19379]: epggrab: module uk_freesat_eit created
Apr 19 12:32:50 ubuntu tvheadend[19379]: epggrab: module uk_freeview created
Apr 19 12:32:50 ubuntu tvheadend[19379]: epggrab: module nz_freeview2 created
Apr 19 12:32:50 ubuntu tvheadend[19379]: epggrab: module nz_freeview1 created
Apr 19 12:32:50 ubuntu tvheadend[19379]: epggrab: module viasat_baltic created
Apr 19 12:32:50 ubuntu tvheadend[19379]: epggrab: module Bulsatcom_39E created
Apr 19 12:32:50 ubuntu tvheadend[19379]: epggrab: module uk_cable_virgin created
Apr 19 12:32:50 ubuntu tvheadend[19379]: epggrab: module eit created
Apr 19 12:32:50 ubuntu tvheadend[19379]: epggrab: module psip created
Apr 19 12:32:50 ubuntu tvheadend[19379]: epggrab: module opentv-skyit created
Apr 19 12:32:50 ubuntu tvheadend[19379]: epggrab: module opentv-skynz created
Apr 19 12:32:50 ubuntu tvheadend[19379]: epggrab: module opentv-skyuk created
Apr 19 12:32:50 ubuntu tvheadend[19379]: epggrab: module opentv-ausat created
Apr 19 12:32:50 ubuntu tvheadend[19379]: epggrab: module xmltv created
Apr 19 12:32:50 ubuntu tvheadend[19379]: tbl-eit: module eit - scraper disabled by config
Apr 19 12:32:50 ubuntu tvheadend[19379]: dvr: Purging obsolete autorec entries for current schedule
Apr 19 12:32:50 ubuntu tvheadend[19379]: START: HTS Tvheadend version 4.3-1950~g98a7c6cfd started, running as PID:19379 UID:129 GID:44, CWD:/ CNF:/home/hts/.hts/tvheadend
Apr 19 12:32:50 ubuntu tvheadend[19379]: scanfile: DVB-S - loaded 1 regions with 115 networks
Apr 19 12:32:50 ubuntu tvheadend[19379]: scanfile: DVB-T - loaded 44 regions with 1124 networks
Apr 19 12:32:50 ubuntu tvheadend[19379]: scanfile: DVB-C - loaded 19 regions with 64 networks
Apr 19 12:32:50 ubuntu tvheadend[19379]: scanfile: ATSC-T - loaded 2 regions with 12 networks
Apr 19 12:32:50 ubuntu tvheadend[19379]: scanfile: ATSC-C - loaded 1 regions with 5 networks
Apr 19 12:32:50 ubuntu tvheadend[19379]: scanfile: ISDB-T - loaded 2 regions with 1297 networks
Apr 19 12:32:51 ubuntu tvheadend[19379]: avahi: Service 'Tvheadend' successfully established.
Apr 19 12:33:40 ubuntu systemd[1]: tvheadend.service: Main process exited, code=killed, status=11/SEGV
Apr 19 12:33:40 ubuntu systemd[1]: tvheadend.service: Failed with result 'signal'.

Thanks,
Neeto

RE: [MANUAL] Building .DEB packages on clean Ubuntu or other Debian distros - Added by Noone Toknow over 3 years ago

With Ubuntu 20.04 LTS on my Pi 4 I had to adjust the following:

  1. New packages
    sudo apt install build-essential git ccache libpcre2-dev pkg-config libssl-dev bzip2 wget libavahi-client-dev zlib1g-dev libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libavresample-dev gettext cmake libiconv-hook-dev liburiparser-dev debhelper libcurl4-gnutls-dev python-minimal libdvbcsa-dev python-requests
    Package python-minimal is now named python2-minimal
    Package python-requests is now named python3-requests
    Thus new command is
    sudo apt install build-essential git ccache libpcre2-dev pkg-config libssl-dev bzip2 wget libavahi-client-dev zlib1g-dev libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libavresample-dev gettext cmake libiconv-hook-dev liburiparser-dev debhelper libcurl4-gnutls-dev python2-minimal libdvbcsa-dev python3-requests

    As well as said the following needed to be changed
    sudo apt install dvb-apps libva-dev libva-drm1 libva-x11-1

    changed to
    sudo apt install dvb-apps libva-dev libva-drm2 libva-x11-2
  1. Afterwards changed to /usr/src/ and cloned the current git repo:
    git clone -b release/4.2 https://github.com/tvheadend/tvheadend.git
  1. next I saved the build script of Russell Tobin (see post above from 2021-04-12) to /usr/src/build.sh (sudo touch build.sh + sudo nano build.sh) and made it executable (sudo chmod 777 build.sh).
  1. next I removed the four packages he mentioned are not available for 64 bit Ubuntu (libkqueue-dev / fdkacc / libfdk-aac-dev / libfdk-aac1)
  1. afterwards created the two symbolic links needed
    ln -s /usr/bin/python /usr/bin/python3
    (as I am running python3)
    ln -s /opt/vc /usr
  1. finally kicked of the build script with
    sudo ./build.sh

==> FAILED with:

libtool: install: chmod 644 /usr/src/tvheadend/tvheadend/build.linux/ffmpeg/build/ffmpeg/lib/libopus.a
libtool: install: ranlib /usr/src/tvheadend/tvheadend/build.linux/ffmpeg/build/ffmpeg/lib/libopus.a
libtool: warning: remember to run 'libtool --finish /ffmpeg/lib'
make[7]: Leaving directory '/usr/src/tvheadend/tvheadend/build.linux/ffmpeg/opus-1.3.1'
make[6]: Leaving directory '/usr/src/tvheadend/tvheadend/build.linux/ffmpeg/opus-1.3.1'
make[5]: Leaving directory '/usr/src/tvheadend/tvheadend/build.linux/ffmpeg/opus-1.3.1'
make[4]: Leaving directory '/usr/src/tvheadend/tvheadend/build.linux/ffmpeg/opus-1.3.1'
make[3]: Leaving directory '/usr/src/tvheadend/tvheadend'
make[2]: *** [Makefile:853: /usr/src/tvheadend/tvheadend/build.linux/ffmpeg/build/ffmpeg/lib/libavcodec.a] Error 2
make[2]: Leaving directory '/usr/src/tvheadend/tvheadend'
make[1]: *** [debian/rules:15: override_dh_auto_build] Error 2
make[1]: Leaving directory '/usr/src/tvheadend/tvheadend'
make: *** [debian/rules:6: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2

real    8m21.523s
user    19m38.323s
sys     5m40.348s

afterwards tried the build script of saen acro from the original post.
FAILED with:

make[6]: Entering directory '/usr/src/tvheadend/tvheadend/build.linux/ffmpeg/libtheora-1.2.0alpha1'
make[6]: Nothing to be done for 'install-exec-am'.
test -z "/ffmpeg/lib/pkgconfig" || /usr/bin/mkdir -p "/usr/src/tvheadend/tvheadend/build.linux/ffmpeg/build/ffmpeg/lib/pkgconfig" 
 /usr/bin/install -c -m 644 theora.pc theoradec.pc theoraenc.pc '/usr/src/tvheadend/tvheadend/build.linux/ffmpeg/build/ffmpeg/lib/pkgconfig'
make[6]: Leaving directory '/usr/src/tvheadend/tvheadend/build.linux/ffmpeg/libtheora-1.2.0alpha1'
make[5]: Leaving directory '/usr/src/tvheadend/tvheadend/build.linux/ffmpeg/libtheora-1.2.0alpha1'
make[4]: Leaving directory '/usr/src/tvheadend/tvheadend/build.linux/ffmpeg/libtheora-1.2.0alpha1'
make[3]: Leaving directory '/usr/src/tvheadend/tvheadend'
make[2]: *** [Makefile:853: /usr/src/tvheadend/tvheadend/build.linux/ffmpeg/build/ffmpeg/lib/libavcodec.a] Error 2
make[2]: Leaving directory '/usr/src/tvheadend/tvheadend'
make[1]: *** [debian/rules:15: override_dh_auto_build] Error 2
make[1]: Leaving directory '/usr/src/tvheadend/tvheadend'
make: *** [debian/rules:6: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2

real    0m43.407s
user    0m52.995s
sys     0m22.510s

Any ideas?

// Edit

Forgot to append my ./configure output, sorry:

Checking support/features
  checking for cc execinfo.h ...                    ok
  checking for cc -mmmx ...                         fail
  checking for cc -msse2 ...                        fail
  checking for cc -Wunused-result ...               ok
  checking for cc strlcat ...                       fail
  checking for cc strlcpy ...                       fail
  checking for cc fdatasync ...                     ok
  checking for cc getloadavg ...                    ok
  checking for cc atomic32 ...                      ok
  checking for cc atomic64 ...                      ok
  checking for cc atomic_time_t ...                 ok
  checking for cc bitops64 ...                      ok
  checking for cc lockowner ...                     ok
  checking for cc qsort_r ...                       ok
  checking for cc stime ...                         fail
  checking for cc gmtoff ...                        ok
  checking for cc recvmmsg ...                      ok
  checking for cc sendmmsg ...                      ok
  checking for cc libiconv ...                      fail
    ^ using build-in glibc iconv routines
  checking for cc libdvben50221 ...                 ok
  checking for cc ifnames ...                       ok
  checking for py module gzip ...                   ok
  checking for pkg-config ...                       ok
  checking for xgettext ...                         ok
  checking for msgmerge ...                         ok
  checking for gzip ...                             ok
  checking for bzip2 ...                            ok
  checking for pkg openssl  ...                     ok (detected 1.1.1f)
  checking for cc linux/dvb/version.h ...           ok
  checking for pkg zlib  ...                        ok (detected 1.2.11)
  checking for pkg liburiparser  ...                ok (detected 0.9.3)
  checking for pkg avahi-client  ...                ok (detected 0.7)
  checking for cmake ...                            ok
  checking for cc -lstdc++ ...                      ok
  checking for cc sys/inotify.h ...                 ok
  checking for cc inotify_init1 ...                 ok
  fetching dvb-scan files ...                       ok
  checking for cc epoll_create1 ...                 ok
  checking for pkg dbus-1  ...                      ok (detected 1.12.16)

Compiler:
  Using C compiler:                        ccache cc
  Using LD flags:                           -ldvben50221 -ldvbapi -lucsi
  Build for arch:                          aarch64

Binaries:
  Using PYTHON:                            python
  Using GZIP:                              gzip
  Using BZIP2:                             bzip2

Options:
  pie                                      yes
  ccdebug                                  no
  cwc                                      yes
  capmt                                    yes
  constcw                                  yes
  linuxdvb                                 yes
  satip_server                             yes
  satip_client                             yes
  hdhomerun_client                         yes
  hdhomerun_static                         yes
  iptv                                     yes
  tsfile                                   yes
  dvbscan                                  yes
  timeshift                                yes
  trace                                    yes
  imagecache                               yes
  avahi                                    yes
  zlib                                     yes
  libav                                    yes
  ffmpeg_static                            yes
  libx264                                  yes
  libx264_static                           yes
  libx265                                  yes
  libx265_static                           yes
  libvpx                                   yes
  libvpx_static                            yes
  libtheora                                yes
  libtheora_static                         yes
  libvorbis                                yes
  libvorbis_static                         yes
  libfdkaac                                yes
  libfdkaac_static                         yes
  nvenc                                    yes
  qsv                                      no
  libmfx_static                            no
  inotify                                  yes
  epoll                                    yes
  uriparser                                yes
  ccache                                   yes
  tvhcsa                                   yes
  bundle                                   no
  pngquant                                 no
  dvbcsa                                   no
  dvben50221                               yes
  kqueue                                   no
  dbus_1                                   yes
  android                                  no
  tsdebug                                  no
  gtimer_check                             no
  slow_memoryinfo                          no
  libsystemd_daemon                        no
  pcloud_cache                             yes
  execinfo                                 yes
  W_unused_result                          yes
  fdatasync                                yes
  getloadavg                               yes
  atomic32                                 yes
  atomic64                                 yes
  atomic_time_t                            yes
  bitops64                                 yes
  lockowner                                yes
  qsort_r                                  yes
  gmtoff                                   yes
  recvmmsg                                 yes
  sendmmsg                                 yes
  libdvben50221                            yes
  ifnames                                  yes
  py_gzip                                  yes
  bin_pkg_config                           yes
  bin_xgettext                             yes
  bin_msgmerge                             yes
  bin_gzip                                 yes
  bin_bzip2                                yes
  ssl                                      yes
  linuxdvbapi                              yes
  upnp                                     yes
  bin_cmake                                yes
  stdcpp                                   yes
  libogg_static                            yes
  inotify_h                                yes
  inotify_init1                            yes
  linuxdvb_ca                              yes
  epoll_create1                            yes
  mpegts                                   yes
  mpegts_dvb                               yes

Packages:
  openssl                                  1.1.1f
  zlib                                     1.2.11
  liburiparser                             0.9.3
  avahi-client                             0.7
  dbus-1                                   1.12.16

Installation paths:
  Prefix:                                  /usr/local
  Binaries:                                ${prefix}/bin
  Libraries:                               ${prefix}/lib
  Data files:                              ${prefix}/share
  Man pages:                               ${datadir}/man

Final Binary:
  /usr/src/tvheadend/build.linux/tvheadend

Tvheadend Data Directory:
  /usr/local/share/tvheadend

Ran the build script from OP again, second time it fails with:

make[1]: Leaving directory '/usr/src/tvheadend/tvheadend'
   debian/rules override_dh_auto_build
make[1]: Entering directory '/usr/src/tvheadend/tvheadend'
make -j4
make[2]: Entering directory '/usr/src/tvheadend/tvheadend'
make -f Makefile.ffmpeg libcacheget
make[3]: Entering directory '/usr/src/tvheadend/tvheadend'
make[3]: Leaving directory '/usr/src/tvheadend/tvheadend'
make -f Makefile.ffmpeg build
make[3]: Entering directory '/usr/src/tvheadend/tvheadend'
cd /usr/src/tvheadend/tvheadend/build.linux/ffmpeg/libvpx-1.9.0 && \
        ASFLAGS="-DENABLE_PIC=1 -DPIC=1" FFMPEG_PREFIX=/usr/src/tvheadend/tvheadend/build.linux/ffmpeg/build/ffmpeg PKG_CONFIG=/usr/src/tvheadend/tvheadend/support/pkg-config.ffmpeg ./configure --prefix=/ffmpeg --enable-static --disable-shared \
        --extra-cflags="-fPIE" \
        --disable-examples \
        --disable-docs \
        --disable-unit-tests \

/bin/sh: 2: ./configure: not found
make[3]: *** [Makefile.ffmpeg:330: /usr/src/tvheadend/tvheadend/build.linux/ffmpeg/libvpx-1.9.0/.tvh_build] Error 127
make[3]: Leaving directory '/usr/src/tvheadend/tvheadend'
make[2]: *** [Makefile:853: /usr/src/tvheadend/tvheadend/build.linux/ffmpeg/build/ffmpeg/lib/libavcodec.a] Error 2
make[2]: Leaving directory '/usr/src/tvheadend/tvheadend'
make[1]: *** [debian/rules:15: override_dh_auto_build] Error 2
make[1]: Leaving directory '/usr/src/tvheadend/tvheadend'
make: *** [debian/rules:6: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2

real    0m14.553s
user    0m6.670s
sys     0m7.325s

RE: [MANUAL] Building .DEB packages on clean Ubuntu or other Debian distros - Added by saen acro over 3 years ago

Build 4.3 aka main not that old version, lot of missing features.
just disable theora codec

--disable-libtheora_static

RE: [MANUAL] Building .DEB packages on clean Ubuntu or other Debian distros - Added by Noone Toknow over 3 years ago

Ok I got it working now!

The script of Russell Tobin really did the magic! He has included all the steps needed to make the symbolic links and which packages are not available for Ubunut 20.04 64bit. I just had to add

--disable-libtheora_static --disable-libtheora
to the list of arguments.

Thanks @ both :)

RE: [MANUAL] Building .DEB packages on clean Ubuntu or other Debian distros - Added by saen acro over 3 years ago

@ Russell Tobin
your bash script is unlogical on x86-64
Its good to be updated depend on arhitecture.

# Cant' find the following for armhf or arm64
#i965-va-driver-shaders

Intel gpu driver its hard to be find on this dev boards. ;)

RE: [MANUAL] Building .DEB packages on clean Ubuntu or other Debian distros - Added by Anonymous over 3 years ago

I don't get tvheadend to run on my pi 4. I get some errors while configuring it.

root@raspberrypi:/usr/src/tvheadend# ./configure --enable-bundle --enable-ffmpeg_static --enable-libffmpeg_static --enable-libx264 --enable-libx265 --enable-vaapi --extra-libs=-lpthread
Checking support/features
  checking for cc execinfo.h ...                    ok
  checking for cc -mmmx ...                         fail
  checking for cc -msse2 ...                        fail
  checking for cc -Wunused-result ...               ok
  checking for cc -fstack-protector ...             ok
  checking for cc -fstack-protector-strong ...      ok
  checking for cc -fstack-check ...                 ok
  checking for cc -fPIE ...                         ok
  checking for cc strlcat ...                       fail
  checking for cc strlcpy ...                       fail
  checking for cc fdatasync ...                     ok
  checking for cc getloadavg ...                    ok
  checking for cc atomic32 ...                      ok
  checking for cc atomic64 ...                      ok
  checking for cc atomic_time_t ...                 ok
  checking for cc atomic_ptr ...                    ok
  checking for cc bitops64 ...                      ok
  checking for cc lockowner ...                     ok
  checking for cc qsort_r ...                       ok
  checking for cc stime ...                         ok
  checking for cc gmtoff ...                        ok
  checking for cc recvmmsg ...                      ok
  checking for cc sendmmsg ...                      ok
  checking for cc libiconv ...                      fail
    ^ using build-in glibc iconv routines
  checking for cc ifnames ...                       ok
  checking for cc cclang_threadsan ...              fail
  checking for py module gzip ...                   ok
  checking for pkg-config ...                       ok
  checking for xgettext ...                         ok
  checking for msgmerge ...                         ok
  checking for gzip ...                             ok
  checking for bzip2 ...                            ok
  checking for pkg openssl  ...                     ok (detected 1.1.1d)
  checking for cc linux/dvb/version.h ...           ok
  checking for pkg zlib  ...                        ok (detected 1.2.11)
  checking for pkg libpcre2-8  ...                  fail (detected <none>)
  checking for pkg libpcre  ...                     ok (detected 8.39)
  checking for pkg liburiparser  ...                ok (detected 0.9.1)
  checking for pkg avahi-client  ...                ok (detected 0.7)
  checking for cmake ...                            ok
  checking for cc -lstdc++ ...                      ok
  checking for pkg libva >=0.38.0 ...               ok (detected 1.4.0)
  checking for pkg libva-drm >=0.38.0 ...           ok (detected 1.4.0)
  checking for cc sys/inotify.h ...                 ok
  checking for cc inotify_init1 ...                 ok
  checking for cc dvbcsa/dvbcsa.h ...               ok
  checking for cc -ldvbcsa ...                      ok
  fetching dvb-scan files ...                       ok
  checking for cc epoll_create1 ...                 ok
  checking for pkg dbus-1  ...                      ok (detected 1.12.20)

Compiler:
  Using C compiler:                        cc
  Using LD flags:                           -ldvbcsa
  Build for arch:                          arm

Binaries:
  Using PYTHON:                            python
  Using GZIP:                              gzip
  Using BZIP2:                             bzip2

Options:
  pie                                      yes
  ccdebug                                  no
  cardclient                               yes
  cwc                                      yes
  cccam                                    yes
  capmt                                    yes
  constcw                                  yes
  linuxdvb                                 yes
  satip_server                             yes
  satip_client                             yes
  hdhomerun_client                         yes
  hdhomerun_static                         yes
  iptv                                     yes
  tsfile                                   yes
  dvbscan                                  yes
  timeshift                                yes
  trace                                    yes
  avahi                                    yes
  zlib                                     yes
  libav                                    yes
  ffmpeg_static                            yes
  libx264                                  yes
  libx264_static                           yes
  libx265                                  yes
  libx265_static                           yes
  libvpx                                   yes
  libvpx_static                            yes
  libtheora                                yes
  libtheora_static                         yes
  libvorbis                                yes
  libvorbis_static                         yes
  libfdkaac                                no
  libfdkaac_static                         no
  libopus                                  yes
  libopus_static                           yes
  nvenc                                    no
  vaapi                                    yes
  mmal                                     no
  omx                                      no
  inotify                                  yes
  epoll                                    yes
  pcre                                     yes
  pcre2                                    no
  uriparser                                yes
  ccache                                   no
  tvhcsa                                   yes
  bundle                                   yes
  pngquant                                 no
  kqueue                                   no
  dbus_1                                   yes
  android                                  no
  gtimer_check                             no
  slow_memoryinfo                          no
  libsystemd_daemon                        no
  pcloud_cache                             yes
  ddci                                     yes
  cclang_threadsan                         no
  gperftools                               no
  execinfo                                 yes
  W_unused_result                          yes
  f_stack_protector                        yes
  f_stack_protector_strong                 yes
  f_stack_check                            yes
  f_PIE                                    yes
  fdatasync                                yes
  getloadavg                               yes
  atomic32                                 yes
  atomic64                                 yes
  atomic_time_t                            yes
  atomic_ptr                               yes
  bitops64                                 yes
  lockowner                                yes
  qsort_r                                  yes
  stime                                    yes
  gmtoff                                   yes
  recvmmsg                                 yes
  sendmmsg                                 yes
  ifnames                                  yes
  py_gzip                                  yes
  bin_pkg_config                           yes
  bin_xgettext                             yes
  bin_msgmerge                             yes
  bin_gzip                                 yes
  bin_bzip2                                yes
  ssl                                      yes
  linuxdvbapi                              yes
  linuxdvb_ca                              yes
  upnp                                     yes
  bin_cmake                                yes
  stdcpp                                   yes
  libogg_static                            yes
  hwaccels                                 yes
  inotify_h                                yes
  inotify_init1                            yes
  dvbcsa                                   yes
  epoll_create1                            yes
  mpegts                                   yes
  mpegts_dvb                               yes

Packages:
  openssl                                  1.1.1d
  zlib                                     1.2.11
  libpcre                                  8.39
  liburiparser                             0.9.1
  avahi-client                             0.7
  libva                                    1.4.0
  libva-drm                                1.4.0
  dbus-1                                   1.12.20

Installation paths:
  Prefix:                                  /usr/local
  Binaries:                                ${prefix}/bin
  Libraries:                               ${prefix}/lib
  Data files:                              ${prefix}/share
  Man pages:                               ${datadir}/man

Final Binary:
  /usr/src/tvheadend/build.linux/tvheadend

Tvheadend Data Directory:
  /usr/local/share/tvheadend


Unfortunately I have no plan what to do.

RE: [MANUAL] Building .DEB packages on clean Ubuntu or other Debian distros - Added by saen acro over 3 years ago

You configuration PASS need to make package

make -j$(nproc)

RE: [MANUAL] Building .DEB packages on clean Ubuntu or other Debian distros - Added by Kae TuuN almost 3 years ago

Quick Guide to Autobuild.sh on a fresh installed Ubuntu 20.04 headless Server (Focal Fossa)

# become root
sudo -s

# install all needed dependencies
apt install build-essential bzip2 ccache cmake debhelper gettext git libavahi-client-dev libavcodec-dev libavformat-dev libavresample-dev libavutil-dev libcurl4-gnutls-dev libdvbcsa-dev libiconv-hook-dev libpcre2-dev libssl-dev libswscale-dev liburiparser-dev pkg-config python2-minimal wget zlib1g-dev

# Install optional dependencies

# Needed for Video Accelaration (VA)
apt install libva-dev libva-drm2 libva-x11-2
# Old Intel Graphics:
apt install i965-va-driver-shaders
# Actual Intel Graphics:
apt install intel-media-va-driver-non-free
# AMD Graphics:
apt install mesa-va-drivers
# nvidia:
# I don't really now. I think there propritary Driver should do the work

# DVB-CI support (Just needed, if you want to use a CI Card)
apt install dvb-apps

#Just to make sure everything works as intended
reboot

# login

mkdir git && cd git
git clone https://github.com/tvheadend/tvheadend
cd tvheadend
sudo -s
./Autobuild.sh -t focal-amd64

# after building the .DEB Package should belocated ~/git/<PackageName>.deb

Greetings KaeTuuN

RE: [MANUAL] Building .DEB packages on clean Ubuntu or other Debian distros - Added by saen acro almost 3 years ago

./Autobuild.sh -t focal-amd64

this part is useless

-t focal-amd64

there is few scriprs with make this if read all post's.

in your script zero GPU support, no matter instaled dependencies.
also contain useless lines
example

mkdir git && cd git
git clone https://github.com/tvheadend/tvheadend
cd tvheadend

why not just
git clone https://github.com/tvheadend/tvheadend git/tvheadend
cd ./git/tvheadend

I agree that there is need systematized build script,
with will solve dependencies and ask about enabled/disabled features.
no matter OS architecture.

RE: [MANUAL] Building .DEB packages on clean Ubuntu or other Debian distros - Added by Sean Warner about 2 years ago

Hello,

I am trying to build tvheadend on a Pi 4 running Ubuntu server 22.04 (Jammy) 64-bit arm64.
I am following the build script of Russel Tobin above... https://tvheadend.org/boards/4/topics/24116?r=44265#message-44265

My system details:

ubuntu@ubuntu:~/build/tvheadend/master$ uname -a
Linux ubuntu 5.15.0-1015-raspi #17-Ubuntu SMP PREEMPT Mon Sep 12 13:14:51 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
ubuntu@ubuntu:~/build/tvheadend/master$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS" 

I saved the build script in /usr/local/src/buildTVH.sh

I also made the symlinks:

sudo -i 
ln -s /usr /opt/vc
ln -s /usr/bin/python3 /usr/bin/python

And additions to /boot/firmware/config.txt

gpu_mem=128
[pi4]
dtoverlay=vc4-fkms-v3d,cma-128
max_framebuffers=2

Then I run it like this:

cd /usr/local/src 
./buildTVH.sh

This is the build script I am using... it's Russel Tobins script from above.
So far the only modification I made was @saen acros advice to add in:
--disable-libtheora_static --disable-libtheora

##!/bin/bash
#
# Name: build.sh
#
# Description: Build script for tvheadend on Ubuntu 20.04 32bit on Raspberry 4 with 4Gb or 8Gb
# Note: Only a couple of miniro changes as noted below to make this build on 64bit 
# 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
#[pi4]
#dtoverlay=vc4-fkms-v3d,cma-128
#max_framebuffers=2

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 \
        fdkacc \
        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 

# The following my not existing Ubuntu 20.04 64bit (arm64) remove from above as required
#        libkqueue-dev
#        fdkacc
#        libfdk-aac-dev
#        libfdk-aac1

# Cant' find the following for armhf or arm64
#i965-va-driver-shaders

# 
# Install rpi-userland libraries / binaries
#
    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)
    #git clone -b -v release/4.2 https://github.com/tvheadend/tvheadend.git
    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" 
    AUTOBUILD_CONFIGURE_EXTRA="$AUTOBUILD_CONFIGURE_EXTRA --disable-libvpx_static --disable-libvpx --disable-libtheora_static --disable-libtheora" 
    AUTOBUILD_CONFIGURE_EXTRA="$AUTOBUILD_CONFIGURE_EXTRA --enable-gtimer_check --enable-slow_memoryinfo --enable-cclang_threadsan --enable-gperftools --enable-ccdebug" 
    export AUTOBUILD_CONFIGURE_EXTRA
    ./Autobuild.sh -j$(nproc) -t focal-armhf
  )
) 2>&1 | tee "$BASE/build.log" 

The build fails and this is the output I get...

root@ubuntu:/usr/local/src# ./buildTVH.sh 
Makefile:755: /support/.mk: No such file or directory
make: *** No rule to make target '/support/.mk'.  Stop.
Already up to date.
On branch master
Your branch is up to date with 'origin/master'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        Autobuild/focal-arm64.sh
        Autobuild/focal-armhf.sh

nothing added to commit but untracked files present (use "git add" to track)
dpkg-buildpackage: info: source package tvheadend
dpkg-buildpackage: info: source version 4.3-2034~g8f8877430~focal
dpkg-buildpackage: info: source distribution focal
dpkg-buildpackage: info: source changed by Andreas Öman <[email protected]>
 dpkg-source --before-build .
dpkg-buildpackage: info: host architecture arm64
 debian/rules clean
dh clean --with-systemd
dh: warning: Compatibility levels before 10 are deprecated (level 7 in use)
   dh_clean -O--with-systemd
        rm -f debian/debhelper-build-stamp
        rm -rf debian/.debhelper/
dh_clean: warning: Compatibility levels before 10 are deprecated (level 7 in use)
        rm -f debian/tvheadend-dbg.debhelper.log debian/tvheadend.debhelper.log
        rm -f -- debian/tvheadend.substvars debian/tvheadend-dbg.substvars debian/files
        rm -fr -- debian/tvheadend/ debian/tmp/ debian/tvheadend-dbg/
        find .  \( \( \
                \( -path .\*/.git -o -path .\*/.svn -o -path .\*/.bzr -o -path .\*/.hg -o -path .\*/CVS -o -path .\*/.pc -o -path .\*/_darcs \) -prune -o -type f -a \
                \( -name '#*#' -o -name '.*~' -o -name '*~' -o -name DEADJOE \
                 -o -name '*.orig' -o -name '*.rej' -o -name '*.bak' \
                 -o -name '.*.orig' -o -name .*.rej -o -name '.SUMS' \
                 -o -name TAGS -o \( -path '*/.deps/*' -a -name '*.P' \) \
                \) -exec rm -f {} + \) -o \
                \( -type d -a -name autom4te.cache -prune -exec rm -rf {} + \) \)
 debian/rules build
dh build --with-systemd
dh: warning: Compatibility levels before 10 are deprecated (level 7 in use)
   dh_update_autotools_config -O--with-systemd
   debian/rules override_dh_auto_configure
make[1]: Entering directory '/usr/local/src/tvheadend'
dh_auto_configure --  --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 --disable-libvpx_static --disable-libvpx --disable-libtheora_static --disable-libtheora --enable-gtimer_check --enable-slow_memoryinfo --enable-cclang_threadsan --enable-gperftools --enable-ccdebug --arch=arm64 --jobs=4
dh_auto_configure: warning: Compatibility levels before 10 are deprecated (level 7 in use)
        ./configure --build=aarch64-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-option-checking --disable-silent-rules --libexecdir=\${prefix}/lib/tvheadend --disable-maintainer-mode --disable-dependency-tracking --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 --disable-libvpx_static --disable-libvpx --disable-libtheora_static --disable-libtheora --enable-gtimer_check --enable-slow_memoryinfo --enable-cclang_threadsan --enable-gperftools --enable-ccdebug --arch=arm64 --jobs=4
Checking support/features
  checking for cc execinfo.h ...                    ok
  checking for cc -mmmx ...                         fail
  checking for cc -msse2 ...                        fail
  checking for cc -Wunused-result ...               ok
  checking for cc -fstack-protector ...             ok
  checking for cc -fstack-protector-strong ...      ok
  checking for cc -fstack-check ...                 ok
  checking for cc -fPIE ...                         ok
  checking for cc strlcat ...                       fail
  checking for cc strlcpy ...                       fail
  checking for cc fdatasync ...                     ok
  checking for cc getloadavg ...                    ok
  checking for cc atomic32 ...                      ok
  checking for cc atomic64 ...                      ok
  checking for cc atomic_time_t ...                 ok
  checking for cc atomic_ptr ...                    ok
  checking for cc bitops64 ...                      ok
  checking for cc lockowner ...                     ok
  checking for cc qsort_r ...                       ok
  checking for cc stime ...                         fail
  checking for cc gmtoff ...                        ok
  checking for cc recvmmsg ...                      ok
  checking for cc sendmmsg ...                      ok
  checking for cc libiconv ...                      fail
    ^ using build-in glibc iconv routines
  checking for cc ifnames ...                       ok
  checking for cc cclang_threadsan ...              fail
  checking for py module gzip ...                   ok
  checking for pkg-config ...                       ok
  checking for xgettext ...                         ok
  checking for msgmerge ...                         ok
  checking for gzip ...                             ok
  checking for bzip2 ...                            ok
  checking for pkg openssl  ...                     ok (detected 3.0.2)
  checking for cc linux/dvb/version.h ...           ok
  checking for pkg zlib  ...                        ok (detected 1.2.11)
  checking for pkg libpcre2-8  ...                  ok (detected 10.39)
  checking for pkg liburiparser  ...                ok (detected 0.9.6)
  checking for pkg avahi-client  ...                ok (detected 0.8)
  checking for cmake ...                            ok
  checking for cc -lstdc++ ...                      ok
  checking for cc bcm_host.h ...                    fail
  checking for cc OMX_Core.h ...                    ok
  checking for pkg libva >=0.38.0 ...               fail (detected <none>)
ERROR: vaapi (Video Acceleration (VA) API for Linux) not found
dh_auto_configure: error: ./configure --build=aarch64-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-option-checking --disable-silent-rules --libexecdir=\${prefix}/lib/tvheadend --disable-maintainer-mode --disable-dependency-tracking --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 --disable-libvpx_static --disable-libvpx --disable-libtheora_static --disable-libtheora --enable-gtimer_check --enable-slow_memoryinfo --enable-cclang_threadsan --enable-gperftools --enable-ccdebug --arch=arm64 --jobs=4 returned exit code 1
make[1]: *** [debian/rules:12: override_dh_auto_configure] Error 2
make[1]: Leaving directory '/usr/local/src/tvheadend'
make: *** [debian/rules:6: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2

real    0m9.461s
user    0m4.974s
sys     0m4.806s

Can I please get some help about what I am doing wrong?
@saen acro above mentioned:

You configuration PASS need to make package
make -j$(nproc)

What's that about, do I need it and where do I put that?

What do these errors mean?

make: *** No rule to make target '/support/.mk'.  Stop.
dh: warning: Compatibility levels before 10 are deprecated (level 7 in use)

For this error:

ERROR: vaapi (Video Acceleration (VA) API for Linux) not found

I tried..
sudo apt install dvb-apps libva-dev libva-drm1 libva-x11-1
It didn't find: libva-drm1 libva-x11-1
So I tried...
sudo apt install dvb-apps libva-drm2 libva-x11-2
That installed those three.
But I still get the same error.

For ARM OpenMax support I also did:
sudo apt install libomxil-bellagio-dev
And have included: --enable-omx in the build script.

Probably I am doing other things wrong too.

Any advice much appreciated.

Cheers,

Flex

RE: [MANUAL] Building .DEB packages on clean Ubuntu or other Debian distros - Added by saen acro about 2 years ago

no need to do nothing with python and simlink
just add

--python=python3

VA (intel GPU) is not available on ARM platform

--diable-libva

Use OpenMAX if want to transcode with hardware.

https://tvheadend.org/boards/4/topics/24116?r=48005#ARM-OpenMax-support

RE: [MANUAL] Building .DEB packages on clean Ubuntu or other Debian distros - Added by Sean Warner about 2 years ago

Thanks a lot @saen acro.

Where am I supposed to put..

--python=python3

Do you mean --disable-libav ? I don't see an option for --disable-libva .

I think I am almost there now but right at the end (I think) I am getting this output:

...
.....
.......
Markdown: docs/wizard/network.md
Markdown: docs/wizard/status.md
CC              src/docs.o
CC              tvheadend
/usr/bin/ld: cannot find -lprofiler: No such file or directory
/usr/bin/ld: cannot find -ltcmalloc: No such file or directory
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:712: /usr/local/src/tvheadend/build.linux/tvheadend] Error 1
make[3]: Leaving directory '/usr/local/src/tvheadend'
make[2]: *** [Makefile:110: ffmpeg_all] Error 2
make[2]: Leaving directory '/usr/local/src/tvheadend'
make[1]: *** [debian/rules:15: override_dh_auto_build] Error 2
make[1]: Leaving directory '/usr/local/src/tvheadend'
make: *** [debian/rules:6: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2

real    14m7.932s
user    36m1.737s
sys     8m52.513s

Once again, I don't really know what I'm doing but after some googling I tried searching for -lprofiler and -ltcmalloc:

ubuntu@ubuntu:~$ ls -l /usr/lib | grep profiler
ubuntu@ubuntu:~$ ls -l /usr/lib | grep malloc  
ubuntu@ubuntu:~$ ls -l /opt/vc/lib | grep profiler
ubuntu@ubuntu:~$ ls -l /opt/vc/lib | grep malloc  
ubuntu@ubuntu:~$

Are these rpi-userland things? I do run this command in the build script:
snap install rpi-userland --edge

But I think the rpi-userland stuff is not getting installed with snap:

ubuntu@ubuntu:~$ sudo snap install rpi-userland --edge
error: snap "rpi-userland" is not available on edge for this architecture (arm64) but exists on
       other architectures (amd64, armhf).

I tried building an rpi-userland using this script but it didn't work on my system:
https://gist.github.com/satmandu/c462ab301cbe09bd6e7cf4db7f626727

Looks like there is a raspberrypi-userland source package in Jammy here...
https://launchpad.net/ubuntu/jammy/+source/raspberrypi-userland
But I don't know what to do with it??

Is there another way to install the rpi-userland things? I'll keep searching anyway.

Any help much appreciated!

Flex

RE: [MANUAL] Building .DEB packages on clean Ubuntu or other Debian distros - Added by saen acro about 2 years ago

./configure --help
--disable-libav

it is typo error ;)

Use build script from first post

/usr/bin/ld: cannot find -lprofiler: No such file or directory
/usr/bin/ld: cannot find -ltcmalloc: No such file or directory

install gperftools libgoogle-perftools-dev
(26-50/92)