2019-07-08 07:00 PM

Build and install the linphone desktop packages for Ubuntu18.04. Although Belledonne Communications offers also the Fratpak packages of Linphone, but here build linphone desktop latest version from source codes. Avoiding the errors related to the dependence of the other packages, adopted the docker container for linphone-sdk.

Source Codes

GitLab

https://gitlab.linphone.org/BC/public/linphone-desktop

Github

https://github.com/BelledonneCommunications/linphone-desktop

Build and Install Environment

Linux 4.15.0-55-generic/Ubuntu18.04

Prepare

You need to prepare the following package.

Docker CE(linphone-sdk)

Please refer to the following.

https://docs.docker.com/install/linux/docker-ce/ubuntu/

Build and Install process

  1. Making the project folder
  2. Make the docker container image for linphone-sdk and run the container of it
  3. Download source codes(git clone)
  4. Making cmake scripts by prepare.py
  5. Build by make command
  6. Install deb packages
  7. Setting the path for binary and library
  8. Start Linphone and check to work correctry

1.Making the project folder

Make the working directry and move to it

$ mkdir ~/build_project
$ cd build_project

2.Make the docker container image for linphone-sdk and run the container of it

Download the docker image and run the container of linphone-sdk, then move into the container shell.

$ docker run --name linphone_desktop -v $PWD:/home/bc -it gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-ubuntu:18.04

bc@container_id:~$

Please refer to the docker file for each, the following.

https://gitlab.linphone.org/BC/public/linphone-sdk/tree/feature/ubuntu_18.04_runner/docker-files

You can check the running containers on another terminal.

$ docker container ls

CONTAINER ID        IMAGE                                                                 COMMAND             CREATED             STATUS                      PORTS               NAMES
xxxxxxxxxxx        gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-ubuntu:18.04   "/bin/sh -c bash"   15 hours ago        Exited (0) 5 hours ago                          linphone-desktop

Following the process of No.3,4 and 5 are implemented in the container.

3.Download source codes(git clone)

Implement the following command in the container

$ cd /home/your_user_name/build_project

$ git clone https://gitlab.linphone.org/BC/public/linphone-desktop.git

$ cd linphone-desktop

4.Making cmake scripts by prepare.py

Making cmake scripts by prepare.py

$ ./prepare.py desktop-rpm -DENABLE_DOC=OFF

Made desktop-rpm folder in linphone-desktop/WORK

But errors will occur if as it is to make.

Error1

"%cmake error"

https://github.com/BelledonneCommunications/flexisip/issues/64

Download the following package, and copy the files in it to docker:/usr/lib/rpm directory. Implement these from another terminal(not implement in the container) .

https://rpmfind.net/linux/rpm2html/search.php?query=cmake-rpm-macros

https://rpmfind.net/linux/mageia/distrib/cauldron/x86_64/media/core/release/cmake-rpm-macros-3.15.0-0.rc3.1.mga8.x86_64.rpm

$ docker cp cmake.prov container_name:/usr/lib/rpm/cmake.prov
$ docker cp cmake.req container_name:/usr/lib/rpm/cmake.req
$ docker cp cmake.attr container_name:/usr/lib/rpm/fileattrs/cmake.attr
$ docker cp macros.cmake container_name:/usr/lib/rpm/macros.d/macros.cmake

Error2

"empty error: linphone-minizip-2.2.7/debugfiles.list"

Add the line into the all shell files related to the rpm build in cmake folder

Refference

https://wiki.mageia.org/en/Packaging_problems_and_solutions#debug_packages

List all files need to modify

linphone-desktop/WORK/desktop-rpm/cmake/EP_XXXXX_build_rpm.sh

Add to the following line

--define '_enable_debug_packages %{nil}' --define 'debug_package %{nil}' \

Result

rpmbuild -ta --clean --rmsource --define "_topdir $RPM_TOPDIR" \
	--define='_localstatedir /var/opt/belledonne-communications' \
        --define '_mandir %{_prefix}' --nodeps --define 'dist .deb' --define '_lib lib' --define '_libdir %{_prefix}/%{_lib}' --define '_buildshell /bin/bash' \
        --define '_enable_debug_packages %{nil}' --define 'debug_package %{nil}' \
         \
	--rmspec /home/bc/WORK/desktop-rpm/Build/bctoolbox/*.tar.gz \
        $VERBOSE 

5.Build by make command

Implement make command in the container

$ make

6.Install deb packages

Exit from the container and install deb packages.

$ exit

Made the deb packages in linphone-desktop/WORK/desktop-rpm/rpmbuild/DEBS folder.

In DEBS folder, install the packages.

$ cd WORK/desktop-rpm/rpmbuild/DEBS
$ sudo dpkg -i linphone-*.deb

7.Setting the path for binary and library

Binary Path: /opt/com.belledonne-communications/linphone/bin

Library Path: /opt/com.belledonne-communications/linphone/lib

Export binary path

Add the following line at the tail in .bashrc under home folder.

export PATH=$PATH:/opt/com.belledonne-communications/linphone/bin

Export library path

$ sudo nano /etc/ld.so.conf.d/linphone.conf

/opt/com.belledonne-communications/linphone/lib

Activate library path

$ sudo ldconfig

Temporary

$ export PATH=$PATH:/opt/com.belledonne-communications/linphone/bin
$ export LD_LIBRARY_PATH=/opt/com.belledonne-communications/linphone/lib

8.Start Linphone and check to work correctry

Run Linphone

$ linphone

Check the functions in the terminal window.

Linphone Main View

Setting Menu(select ALSA)

Next, build and install SIP server flexisip.