網頁

2022年7月27日 星期三

Build VideoLAN 3.0.16 on Ubuntu 18.04

參考 三 VideoLAN Compile 成熟篇

下載時要指定版本
$ cd ~/Data/VLC
$ git clone https://code.videolan.org/videolan/vlc.git vlc-3.0
$ cd vlc-3.0
$ git branch -a
$ git log --tags --simplify-by-decoration --pretty="format:%ai %d"
$ git checkout tags/3.0.16
$ git describe --tags
// 完整地回復到最後版本,並且刪除不必要的檔案
$ git reset --hard
$ git clean -f -d

利用 Docker 以利之後的重新建立
$ docker pull ubuntu:18.04
$ docker run --name=vlc -it -v ~/Data/VLC/vlc-3.0:/root/vlc-3.0 -v ~/Data/VLC/build_vlc:/root/build_vlc ubuntu:18.04 /bin/bash
# <ctrl+p><ctrl+q>
$ docker attach vlc
# <ctrl+p><ctrl+q>
$ docker stop vlc
$ docker start vlc
$ docker attach vlc
$ docker ps -a
$ docker container rm vlc
$ docker image ls
$ docker image rm <image_id>


若按照說明,不指定 mingw-w64 工具的版本,在 build 64 位元 VLC 時會產生下列問題
/usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/libstdc++.a(cow-stdexcept.o):
(.text$_ZGTtNSt11logic_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x36) 
relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_ITM_RU8'
解決需要指定 mingw-w64 工具的版本
# cd /root/vlc-3.0/
# apt-get update
# apt install software-properties-common
# add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse"
# apt-get update
# apt-cache showpkg gcc-mingw-w64-base
# apt-get install gcc-mingw-w64-base=5.3.1-8ubuntu3+17
# apt-get install gcc-mingw-w64-x86-64=5.3.1-8ubuntu3+17
# apt-get install g++-mingw-w64-x86-64=5.3.1-8ubuntu3+17
# apt-get install gcc-mingw-w64-i686=5.3.1-8ubuntu3+17
# apt-get install g++-mingw-w64-i686=5.3.1-8ubuntu3+17
# apt-get install mingw-w64-tools=5.0.3-1


其他工具
# apt-get install lua5.2 libtool automake autoconf autopoint make gettext pkg-config
# apt-get install qt4-dev-tools qt5-default git subversion cmake cvs 
# apt-get install wine64-development-tools libwine-dev zip p7zip nsis bzip2
# apt-get install yasm ragel ant default-jdk protobuf-compiler dos2unix
# apt-get install subversion yasm cvs cmake ragel autopoint


以下的 HOST-TRIPLET 在 win32 時換成 i686-w64-mingw32, 在 win64 時換成 x86_64-w64-mingw32
build vlc contrib
# cd /root/vlc-3.0/
# mkdir -p contrib/win32
# cd contrib/win32
# ../bootstrap --host=HOST-TRIPLET
# make fetch
//問題 (改 mingw-w64 版本後,沒問題)
../bootstrap: 393: ../bootstrap: python3: not found
//解決
# apt-get install python3
# make
//問題
env: 'meson': No such file or directory
../src/fribidi/rules.mak:22: recipe for target '.fribidi' failed
make: *** [.fribidi] Error 127
//解決
# apt-get install meson
//問題
/root/vlc-3.0/contrib/win32/fontconfig/missing: line 81: gperf: command not found
WARNING: 'gperf' is missing on your system.
//解決
# apt-get install gperf
//問題
configure: error: Package requirements (fribidi >= 0.19.0) were not met:
No package 'fribidi' found
//解決
# apt-get install python3-pip
# python3 -m pip install meson
//問題
[javac] /root/vlc-3.0/contrib/win32/bluray/src/libbluray/bdj/java-j2se/java/io/BDFileSystemImpl.java:21: error: BDFileSystemImpl is not abstract and does not override abstract method isInvalid(File) in FileSystem
//解決
# apt-get install openjdk-8-jdk
# update-alternatives --config java
//問題
meson.build:388:4: ERROR: Program 'nasm' not found or not executable
//解決
# apt-get install wget
# wget https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.gz
# tar xvf nasm-2.14.02.tar.gz
# cd nasm-2.14.02/
# ./configure
# make
# make install
文件上說明 build i686-w64-mingw32 時,要移除 moc, uic, rcc,但是不能刪
# cd /root/vlc-3/contrib/i686-w64-mingw32/bin
# mv moc moc.bak
# mv uic uic.bak
# mv rcc rcc.bak
# rm -f i686-w64-mingw32/bin/moc i686-w64-mingw32/bin/uic i686-w64-mingw32/bin/rcc


build vlc
# cd /root/vlc-3.0
# ./bootstrap
//問題
../../extras/package/win32/../../../autotools/ylwrap: line 176: yacc: command not found
//解決
# apt-get install flex
# apt-get install bison
//問題
ERROR: flex is not installed.
//解決
# apt-get install flex
//問題
ERROR: GNU bison is not installed.
//解決
# apt-get install bison
# mkdir win32 && cd win32
# export PKG_CONFIG_LIBDIR=/root/vlc-3.0/contrib/HOST-TRIPLET/lib/pkgconfig 
# ../extras/package/win32/configure.sh --host=HOST-TRIPLET --build=x86_64-pc-linux-gnu
# make
//問題
stream_out/chromecast/cast_channel.pb.h:17:2: error:
#error This file was generated by an older version of protoc which is
//解決
# git clone https://github.com/protocolbuffers/protobuf.git
# cd protobuf
# git checkout tags/v3.1.0
# ./autogen.sh
# ./configure
# make
# make check
# make install
# ldconfig # refresh shared library cache.
//問題
libprotoc.so.11: cannot open shared object file: No such file or directory
//解決
# export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
//問題
/bin/bash: wget: command not found
Makefile:1043: recipe for target 'npapi-sdk' failed
make[4]: *** [npapi-sdk] Error 127
//解決
# apt-get install wget
//問題
gui/qt/main_interface.moc.cpp:22:1: error: 'QT_WARNING_DISABLE_DEPRECATED' 
does not name a type; did you mean 'QT_WARNING_DISABLE_INTEL'?
QT_WARNING_DISABLE_DEPRECATED
//解決
# qmake -v
# qtchooser -install qt5.6.3 /root/vlc-3.0/contrib/win32/qt/bin/qmake
# qtchooser -l
# export QT_SELECT=qt5.6.3
# qmake -v
# make package-win-common
# ls vlc-3.0.16/
# make package-win32-zip
# ls vlc-3.0.16-win32.zip 
//成功

沒有留言:

張貼留言