2019年12月4日 星期三

vlc-android 編譯環境

1:ubuntu 16.04安裝完
sudo apt-get update
sudo apt-get upgrade

2:
https://code.videolan.org/videolan/docker-images 可以參考不同的ubuntu

sudo apt-get install automake ant autopoint cmake libtool libtool-bin patch pkg-config protobuf-compiler ragel subversion unzip git

sudo apt-get install vim vim-gtk build-essential autogen autoconf flex gawk protobuf-c-compiler curl wget python gnulib openjdk-8-jre openjdk-8-jdk libproxy-dev clang

sudo apt-get install --no-install-suggests --no-install-recommends -y \
      ant autoconf automake autopoint bison build-essential cmake flex g++ gettext \
      git git-core libasound2-dev libavahi-client-dev libcdio-dev libdbus-1-dev \
      libdirectfb-dev libegl1-mesa-dev libfreerdp-dev libfreetype6-dev libfribidi-dev \
      libgles2-mesa-dev libgnutls28-dev libgtk2.0-dev libidn11-dev libjack-dev \
      liblircclient-dev libltdl-dev liblua5.2-dev libmtp-dev libncursesw5-dev \
      libpng-dev libpulse-dev libqt5svg5-dev libqt5x11extras5-dev librsvg2-dev \
      libsecret-1-dev libtool libtool-bin libudev-dev libupnp-dev libv4l-dev \
      libva-dev libvdpau-dev libx11-dev libxcb-composite0-dev libxcb-keysyms1-dev \
      libxcb-randr0-dev libxcb-shm0-dev libxcb-xfixes0-dev libxcb-xv0-dev libxcb1-dev \
      libxext-dev libxi-dev libxinerama-dev libxml2-dev libxpm-dev libzvbi-dev \
      locales lua5.2 make pkg-config qtbase5-dev qtbase5-private-dev ragel snapcraft \
      vim xz-utils yasm zlib1g-dev libxkbcommon-x11-dev meson libvulkan-dev

sudo apt-get build-dep vlc

sudo apt-get install build-essential autoconf libtool pkg-config  libtasn1-3-bin libbsd-dev

3:
https://github.com/protocolbuffers/protobuf/releases
protobuf-all-3.11.1.tar.gz
protoc --version

4:
git config --global user.name "jimmy.chen"
git config --global user.email jimmy.chen@hotmail.com.tw

5: 不一定要做, openjdk8也ok
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt install openjdk-11-jre openjdk-11-jdk

update-alternatives --config java
update-alternatives --config javac

6:
#!/bin/bash
export ANDROID_SDK=/home/zinwell/Android/Sdk
export ANDROID_NDK=/home/zinwell/android-ndk-r18b
export PATH=$PATH:$ANDROID_SDK/platform-tools:$ANDROID_SDK/tools:$ANDROID_NDK


7:
vim build.gradle
minSdkVersion = 25
targetSdkVersion = 28
compileSdkVersion = 28


8: 參考網址
https://wiki.videolan.org/AndroidCompile/

git clone https://code.videolan.org/videolan/vlc-android.git







遇到的問題
1: configure.ac:38: error: required file './config.rpath' not found
到libdsm資料夾下達
autoreconf -fiv -I/home/jimmy/work/vlc-android/vlc/contrib/arm-linux-androideabi/share/aclocal
會發現同樣的問題出現, autoreconfig -I指的是多加一個搜尋路徑,
到arm-linux-androideabi/share/aclocal 做grep config.rpath 會發現是lib-link.m4問題. 但是其變數
ac_aux_dir是出現在gettext source code.

將vlc-android/vlc/contrib/contrib-android-arm-linux-androideabi/gettext/build-aux/config.rpath
copy 到
vlc-android/vlc/contrib/contrib-android-arm-linux-androideabi/libdsm

或者直接在libdsm下產生config.rpath空檔, 因為參考其他的config.rpath似乎是shell, 如果亂寫一通, 一樣可以編譯過關. 所以產生一個空檔案也可以.



這個是因為使用到最新的source code, 如果切到舊的
git branch haha 4eb4b1bf6864711ed62是可以的
git branch 3.2.3  eaf34547


錯誤: Execution failed for task ':medialibrary:compileDevJavaWithJavac'.
echo "org.gradle.java.home=/usr/lib/jvm/java-8-openjdk-amd64" >> ~/.gradle/gradle.properties
這個已經驗證過可以解決

沒有留言:

張貼留言