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: Build .DEB packages on clean Ubuntu - Added by Detlev Hoffmann almost 8 years ago

Thanks a lot.

That helped me building and installing it on Ubuntu 16.10 server on my ASRock J3455-ITX.
One item i had to add:
sudo apt-get install curl
before the autobuild.sh run.

RE: Build .DEB packages on clean Ubuntu - Added by saen acro almost 8 years ago

I'm glad to help you

topic need to be pinned on top

RE: Build .DEB packages on clean Ubuntu - Added by Njuskalo Njusko over 7 years ago

Perfect ! Thanks a lot !

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

Perfect ! Five Stars Manual to be able to compile on DEBIAN 9 as well!

RE: [MANUAL] Building .DEB packages on clean Ubuntu or other Debian distros - Added by Giuseppe Sicilia about 7 years ago

Thanks a lot. Very nice. This should be added in wiki...(/)

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

Added python-minimal

is anyone can found dependences of

checking for cc cclang_threadsan ...              fail

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

Wesley Rodrigues wrote:

What is login and password?

during install will be ask to set credentials

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

added dependency python-requests

if during install get message about

systemctl: error while loading shared libraries: libjson-c.so.3: cannot open shared object file: No such file or directory

it mean that libjson-c2 / libjson-c3 is not installed.

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

hi,

I am trying to compile on a raspberry pi 3B+ (raspbian stretch, with kernel 4.14.98) with transcoding using:

AUTOBUILD_CONFIGURE_EXTRA=--disable-libvpx\ --disable-libx265\ --disable-libtheora\ --disable-libvorbis\ --disable-hdhomerun_client\ --disable-hdhomerun_static\ --disable-bintray_cache\ --enable-libffmpeg_static\ --enable-omx\ --enable-mmal\ --disable-libopus ./Autobuild.sh

tried adding new *.conf under /etc/ld.so.conf.d/ that contained /opt/vc/lib, ran sudo ldconfig and tried compiling again, but still the same error.
any suggestions greatly appreciated!

compile fails with the following:

Markdown: docs/wizard/status.md
CC              src/docs.o
CC              build.o
CC              timestamp.o
CC              tvheadend
/usr/bin/ld: cannot find -lmmal_core
/usr/bin/ld: cannot find -lmmal_util
/usr/bin/ld: cannot find -lmmal_vc_client
/usr/bin/ld: cannot find -lbcm_host
collect2: error: ld returned 1 exit status
Makefile:709: recipe for target '/home/pi/app_sources/tvheadend/build.linux/tvheadend' failed
make[3]: *** [/home/pi/app_sources/tvheadend/build.linux/tvheadend] Error 1
make[3]: Leaving directory '/home/pi/app_sources/tvheadend'
Makefile:107: recipe for target 'ffmpeg_all' failed
make[2]: *** [ffmpeg_all] Error 2
make[2]: Leaving directory '/home/pi/app_sources/tvheadend'
debian/rules:15: recipe for target 'override_dh_auto_build' failed
make[1]: *** [override_dh_auto_build] Error 2
make[1]: Leaving directory '/home/pi/app_sources/tvheadend'
debian/rules:6: recipe for target 'build' failed
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2

libraries exist:

ls -l /opt/vc/lib/ | grep mmal
-rw-r--r-- 1 root root  68884 Apr  3 23:54 libmmal_components.so
-rw-r--r-- 1 root root  82168 Apr  3 23:54 libmmal_core.so
-rw-r--r-- 1 root root  15368 Apr  3 23:54 libmmal.so
-rw-r--r-- 1 root root  91040 Apr  3 23:54 libmmal_util.so
-rw-r--r-- 1 root root  44424 Apr  3 23:54 libmmal_vc_client.so

ls -l /opt/vc/lib/ | grep bcm
-rw-r--r-- 1 root root  99516 Apr  3 23:54 libbcm_host.so

ld doesn't seem to look in /opt/vc/lib

ld -lmmal_core --verbose:

GNU ld (GNU Binutils for Raspbian) 2.28
  Supported emulations:
   armelf_linux_eabi
   armelfb_linux_eabi
using internal linker script:
==================================================
/* Script for -z combreloc: combine and sort reloc sections */
/* Copyright (C) 2014-2017 Free Software Foundation, Inc.
   Copying and distribution of this script, with or without modification,
   are permitted in any medium without royalty provided the copyright
   notice and this notice are preserved.  */
OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm",
          "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SEARCH_DIR("=/usr/local/lib/arm-linux-gnueabihf"); SEARCH_DIR("=/lib/arm-linux-gnueabihf"); SEARCH_DIR("=/usr/lib/arm-linux-gnueabihf"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); SEARCH_DIR("=/usr/arm-linux-gnueabihf/lib");
SECTIONS
{
  /* Read-only sections, merged into text segment: */
  PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x00010000)); . = SEGMENT_START("text-segment", 0x00010000) + SIZEOF_HEADERS;
  .interp         : { *(.interp) }
  .note.gnu.build-id : { *(.note.gnu.build-id) }
  .hash           : { *(.hash) }
  .gnu.hash       : { *(.gnu.hash) }
  .dynsym         : { *(.dynsym) }
  .dynstr         : { *(.dynstr) }
  .gnu.version    : { *(.gnu.version) }
  .gnu.version_d  : { *(.gnu.version_d) }
  .gnu.version_r  : { *(.gnu.version_r) }
  .rel.dyn        :
    {
      *(.rel.init)
      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
      *(.rel.fini)
      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
      *(.rel.data.rel.ro .rel.data.rel.ro.* .rel.gnu.linkonce.d.rel.ro.*)
      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
      *(.rel.ctors)
      *(.rel.dtors)
      *(.rel.got)
      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
      PROVIDE_HIDDEN (__rel_iplt_start = .);
      *(.rel.iplt)
      PROVIDE_HIDDEN (__rel_iplt_end = .);
    }
  .rela.dyn       :
    {
      *(.rela.init)
      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
      *(.rela.fini)
      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
      *(.rela.ctors)
      *(.rela.dtors)
      *(.rela.got)
      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
      PROVIDE_HIDDEN (__rela_iplt_start = .);
      *(.rela.iplt)
      PROVIDE_HIDDEN (__rela_iplt_end = .);
    }
  .rel.plt        :
    {
      *(.rel.plt)
    }
  .rela.plt       :
    {
      *(.rela.plt)
    }
  .init           :
  {
    KEEP (*(SORT_NONE(.init)))
  }
  .plt            : { *(.plt) }
  .iplt           : { *(.iplt) }
  .text           :
  {
    *(.text.unlikely .text.*_unlikely .text.unlikely.*)
    *(.text.exit .text.exit.*)
    *(.text.startup .text.startup.*)
    *(.text.hot .text.hot.*)
    *(.text .stub .text.* .gnu.linkonce.t.*)
    /* .gnu.warning sections are handled specially by elf32.em.  */
    *(.gnu.warning)
    *(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)
  }
  .fini           :
  {
    KEEP (*(SORT_NONE(.fini)))
  }
  PROVIDE (__etext = .);
  PROVIDE (_etext = .);
  PROVIDE (etext = .);
  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  .rodata1        : { *(.rodata1) }
  .ARM.extab   : { *(.ARM.extab* .gnu.linkonce.armextab.*) }
   PROVIDE_HIDDEN (__exidx_start = .);
  .ARM.exidx   : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) }
   PROVIDE_HIDDEN (__exidx_end = .);
  .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) }
  .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) }
  .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table
  .gcc_except_table.*) }
  .gnu_extab   : ONLY_IF_RO { *(.gnu_extab*) }
  /* These sections are generated by the Sun/Oracle C++ compiler.  */
  .exception_ranges   : ONLY_IF_RO { *(.exception_ranges
  .exception_ranges*) }
  /* Adjust the address for the data segment.  We want to adjust up to
     the same address within the page on the next page up.  */
  . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
  /* Exception handling  */
  .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) *(.eh_frame.*) }
  .gnu_extab      : ONLY_IF_RW { *(.gnu_extab) }
  .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
  .exception_ranges   : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }
  /* Thread Local Storage sections  */
  .tdata      : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
  .tbss          : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  .preinit_array     :
  {
    PROVIDE_HIDDEN (__preinit_array_start = .);
    KEEP (*(.preinit_array))
    PROVIDE_HIDDEN (__preinit_array_end = .);
  }
  .init_array     :
  {
    PROVIDE_HIDDEN (__init_array_start = .);
    KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
    KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
    PROVIDE_HIDDEN (__init_array_end = .);
  }
  .fini_array     :
  {
    PROVIDE_HIDDEN (__fini_array_start = .);
    KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
    KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
    PROVIDE_HIDDEN (__fini_array_end = .);
  }
  .ctors          :
  {
    /* gcc uses crtbegin.o to find the start of
       the constructors, so we make sure it is
       first.  Because this is a wildcard, it
       doesn't matter if the user does not
       actually link against crtbegin.o; the
       linker won't look for a file to match a
       wildcard.  The wildcard also means that it
       doesn't matter which directory crtbegin.o
       is in.  */
    KEEP (*crtbegin.o(.ctors))
    KEEP (*crtbegin?.o(.ctors))
    /* We don't want to include the .ctor section from
       the crtend.o file until after the sorted ctors.
       The .ctor section from the crtend file contains the
       end of ctors marker and it must be last */
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
    KEEP (*(SORT(.ctors.*)))
    KEEP (*(.ctors))
  }
  .dtors          :
  {
    KEEP (*crtbegin.o(.dtors))
    KEEP (*crtbegin?.o(.dtors))
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
    KEEP (*(SORT(.dtors.*)))
    KEEP (*(.dtors))
  }
  .jcr            : { KEEP (*(.jcr)) }
  .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
  .dynamic        : { *(.dynamic) }
  . = DATA_SEGMENT_RELRO_END (0, .);
  .got            : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) }
  .data           :
  {
    PROVIDE (__data_start = .);
    *(.data .data.* .gnu.linkonce.d.*)
    SORT(CONSTRUCTORS)
  }
  .data1          : { *(.data1) }
  _edata = .; PROVIDE (edata = .);
  . = .;
  __bss_start = .;
  __bss_start__ = .;
  .bss            :
  {
   *(.dynbss)
   *(.bss .bss.* .gnu.linkonce.b.*)
   *(COMMON)
   /* Align here to ensure that the .bss section occupies space up to
      _end.  Align after .bss to ensure correct alignment even if the
      .bss section disappears because there are no input sections.
      FIXME: Why do we need it? When there is no .bss section, we don't
      pad the .data section.  */
   . = ALIGN(. != 0 ? 32 / 8 : 1);
  }
  _bss_end__ = . ; __bss_end__ = . ;
  . = ALIGN(32 / 8);
  . = SEGMENT_START("ldata-segment", .);
  . = ALIGN(32 / 8);
  __end__ = . ;
  _end = .; PROVIDE (end = .);
  . = DATA_SEGMENT_END (.);
  /* Stabs debugging sections.  */
  .stab          0 : { *(.stab) }
  .stabstr       0 : { *(.stabstr) }
  .stab.excl     0 : { *(.stab.excl) }
  .stab.exclstr  0 : { *(.stab.exclstr) }
  .stab.index    0 : { *(.stab.index) }
  .stab.indexstr 0 : { *(.stab.indexstr) }
  .comment       0 : { *(.comment) }
  /* DWARF debug sections.
     Symbols in the DWARF debugging sections are relative to the beginning
     of the section so we begin them at 0.  */
  /* DWARF 1 */
  .debug          0 : { *(.debug) }
  .line           0 : { *(.line) }
  /* GNU DWARF 1 extensions */
  .debug_srcinfo  0 : { *(.debug_srcinfo) }
  .debug_sfnames  0 : { *(.debug_sfnames) }
  /* DWARF 1.1 and DWARF 2 */
  .debug_aranges  0 : { *(.debug_aranges) }
  .debug_pubnames 0 : { *(.debug_pubnames) }
  /* DWARF 2 */
  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
  .debug_abbrev   0 : { *(.debug_abbrev) }
  .debug_line     0 : { *(.debug_line .debug_line.* .debug_line_end ) }
  .debug_frame    0 : { *(.debug_frame) }
  .debug_str      0 : { *(.debug_str) }
  .debug_loc      0 : { *(.debug_loc) }
  .debug_macinfo  0 : { *(.debug_macinfo) }
  /* SGI/MIPS DWARF 2 extensions */
  .debug_weaknames 0 : { *(.debug_weaknames) }
  .debug_funcnames 0 : { *(.debug_funcnames) }
  .debug_typenames 0 : { *(.debug_typenames) }
  .debug_varnames  0 : { *(.debug_varnames) }
  /* DWARF 3 */
  .debug_pubtypes 0 : { *(.debug_pubtypes) }
  .debug_ranges   0 : { *(.debug_ranges) }
  /* DWARF Extension.  */
  .debug_macro    0 : { *(.debug_macro) }
  .debug_addr     0 : { *(.debug_addr) }
  .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
  /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
}

==================================================
attempt to open //usr/local/lib/arm-linux-gnueabihf/libmmal_core.so failed
attempt to open //usr/local/lib/arm-linux-gnueabihf/libmmal_core.a failed
attempt to open //lib/arm-linux-gnueabihf/libmmal_core.so failed
attempt to open //lib/arm-linux-gnueabihf/libmmal_core.a failed
attempt to open //usr/lib/arm-linux-gnueabihf/libmmal_core.so failed
attempt to open //usr/lib/arm-linux-gnueabihf/libmmal_core.a failed
attempt to open //usr/local/lib/libmmal_core.so failed
attempt to open //usr/local/lib/libmmal_core.a failed
attempt to open //lib/libmmal_core.so failed
attempt to open //lib/libmmal_core.a failed
attempt to open //usr/lib/libmmal_core.so failed
attempt to open //usr/lib/libmmal_core.a failed
attempt to open //usr/arm-linux-gnueabihf/lib/libmmal_core.so failed
attempt to open //usr/arm-linux-gnueabihf/lib/libmmal_core.a failed
ld: cannot find -lmmal_core

contents of /etc/ld.so.conf:

include /etc/ld.so.conf.d/*.conf

contents of /etc/ld.so.conf.d:

/etc/ld.so.conf.d/00-vmcs.conf
/etc/ld.so.conf.d/arm-linux-gnueabihf.conf
/etc/ld.so.conf.d/fakeroot-arm-linux-gnueabihf.conf
/etc/ld.so.conf.d/libc.conf

contents of /etc/ld.so.conf.d/00-vmcs.conf:

/opt/vc/lib

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

/usr/bin/ld: cannot find -lbcm_host

is Broadcom stuff missing,

are you crosscompile or make it on dev board itself?

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

compiling on the dev board itself.

the bcm_host exists under the same location as the mmal libs:

ls -l /opt/vc/lib/ | grep bcm
-rw-r--r-- 1 root root  99516 Apr  3 23:54 libbcm_host.so

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

AUTOBUILD_CONFIGURE_EXTRA='--prefix=/usr --includedir=${prefix}/include \
--mandir=${prefix}/share/man \
--infodir=${prefix}/share/info \
--sysconfdir=/etc --localstatedir=/var \
--disable-silent-rules --libexecdir=${prefix}/lib/tvheadend \
--disable-maintainer-mode \
--disable-dependency-tracking \
--enable-libffmpeg_static --enable-hdhomerun_static \
--enable-dvbcsa --enable-bundle' ./Autobuild.sh

is this work

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

saen acro wrote:

[...]
is this work

it fails when compiling libopus, but I don't use/need it. I only need x264 transcoding, hence the --enable-mmal and --enable-omx and all other codecs disabled in my auto build config.

CC              src/transcoding/codec/codecs/libs/libopus.o
src/transcoding/codec/codecs/libs/libopus.c:23:31: fatal error: opus/opus_defines.h: No such file or directory
 #include <opus/opus_defines.h>
                               ^
compilation terminated.
Makefile:713: recipe for target '/home/pi/app_sources/tvheadend/build.linux/src/transcoding/codec/codecs/libs/libopus.o' failed
make[2]: *** [/home/pi/app_sources/tvheadend/build.linux/src/transcoding/codec/codecs/libs/libopus.o] Error 1
make[2]: Leaving directory '/home/pi/app_sources/tvheadend'
debian/rules:15: recipe for target 'override_dh_auto_build' failed
make[1]: *** [override_dh_auto_build] Error 2
make[1]: Leaving directory '/home/pi/app_sources/tvheadend'
debian/rules:6: recipe for target 'build' failed
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2

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

./configure --disable-libvpx --disable-libx265 --disable-libtheora --disable-libvorbis --disable-hdhomerun_client --disable-hdhomerun_static --disable-bintray_cache --enable-libffmpeg_static --enable-omx --enable-mmal --disable-libopus
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.0j)
  checking for cc linux/dvb/version.h ...           ok
  checking for pkg zlib  ...                        ok (detected 1.2.8)
  checking for pkg libpcre2-8  ...                  ok (detected 10.22)
  checking for pkg liburiparser  ...                ok (detected 0.8.4)
  checking for pkg avahi-client  ...                ok (detected 0.6.32)
  checking for cc bcm_host.h ...                    ok
  checking for cc OMX_Core.h ...                    ok
  checking for pkg libva >=0.38.0 ...               ok (detected 0.39.4)
  checking for pkg libva-x11 >=0.38.0 ...           ok (detected 0.39.4)
  checking for pkg libva-drm >=0.38.0 ...           ok (detected 0.39.4)
  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.10.26)

Compiler:
  Using C compiler:                        cc
  Using C flags:                           -I/opt/vc/include/IL 
  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                         no
  hdhomerun_static                         no
  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                                  no
  libx265_static                           no
  libvpx                                   no
  libvpx_static                            no
  libtheora                                no
  libtheora_static                         no
  libvorbis                                no
  libvorbis_static                         no
  libfdkaac                                no
  libfdkaac_static                         no
  libopus                                  no
  libopus_static                           no
  nvenc                                    no
  vaapi                                    yes
  mmal                                     yes
  omx                                      yes
  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
  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
  omx_rpi                                  yes
  hwaccels                                 yes
  inotify_h                                yes
  inotify_init1                            yes
  dvbcsa                                   yes
  epoll_create1                            yes
  mpegts                                   yes
  mpegts_dvb                               yes

Packages:
  openssl                                  1.1.0j
  zlib                                     1.2.8
  libpcre2-8                               10.22
  liburiparser                             0.8.4
  avahi-client                             0.6.32
  libva                                    0.39.4
  libva-x11                                0.39.4
  libva-drm                                0.39.4
  dbus-1                                   1.10.26

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

Final Binary:
  /home/pi/app_sources/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 5 years ago

Output with your settings

./configure --disable-libvpx --disable-libx265 --disable-libtheora --disable-libvorbis --disable-hdhomerun_client --disable-hdhomerun_static --disable-bintray_cache --enable-libffmpeg_static --enable-omx --enable-mmal --disable-libopus

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

saen acro wrote:

Output with your settings
[...]

updated post above with my settings

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

when just

make -j$(nproc)

is there same errors?

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

saen acro wrote:

when just
[...]
is there same errors?

yes, its the same errors:

make -j$(nproc)
make -f Makefile.webui LANGUAGES="ach ady ar bg cs da de en_US en_GB es et fa fi fr he hr hu it ko lv lt nl no pl pt ro ru sl sk sq sv tr uk zh zh-Hans" all
make[1]: Entering directory '/home/pi/app_sources/tvheadend'
make -f Makefile.webui WEBUI=std   compile-std
make[2]: Entering directory '/home/pi/app_sources/tvheadend'
WEBUI std finished
make[2]: Leaving directory '/home/pi/app_sources/tvheadend'
make -f Makefile.webui WEBUI=debug compile-debug
make[2]: Entering directory '/home/pi/app_sources/tvheadend'
WEBUI debug finished
make[2]: Leaving directory '/home/pi/app_sources/tvheadend'
make[1]: Leaving directory '/home/pi/app_sources/tvheadend'
CC              timestamp.o
CC              tvheadend
/usr/bin/ld: cannot find -lmmal_core
/usr/bin/ld: cannot find -lmmal_util
/usr/bin/ld: cannot find -lmmal_vc_client
/usr/bin/ld: cannot find -lbcm_host
collect2: error: ld returned 1 exit status
Makefile:709: recipe for target '/home/pi/app_sources/tvheadend/build.linux/tvheadend' failed
make: *** [/home/pi/app_sources/tvheadend/build.linux/tvheadend] Error 1

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

saen acro wrote:

Read this
https://stackoverflow.com/questions/16710047/usr-bin-ld-cannot-find-lnameofthelibrary

the solution that worked was to create symlinks to /usr/lib for the "missing" lib files:

sudo ln -s /opt/vc/lib/libmmal_core.so /usr/lib/libmmal_core.so
sudo ln -s /opt/vc/lib/libmmal_util.so /usr/lib/libmmal_util.so
sudo ln -s /opt/vc/lib/libmmal_vc_client.so /usr/lib/libmmal_vc_client.so
sudo ln -s /opt/vc/lib/libbcm_host.so /usr/lib/libbcm_host.so

thanks for your time and suggestions!

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

Added OpenMax library dependency for ARM Developer boards

If some one know how to install mmal on clean armbian /no gui/ will add it to manual.

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

Many thanks for your build script!

Just to add, if "--enable-libsystemd_daemon" is desired, on Ubuntu 18.04 at least, libsystemd-dev needs to be installed

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

thermionic valve wrote:

Many thanks for your build script!

Just to add, if "--enable-libsystemd_daemon" is desired, on Ubuntu 18.04 at least, libsystemd-dev needs to be installed

10х

(1-25/92)