mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2025-06-03 00:00:20 +00:00
[scripts,bash] reformat bash scripts
This commit is contained in:
parent
418d228d4b
commit
2adca10b3c
@ -3,4 +3,4 @@
|
|||||||
rm -rf $(pwd)/build/$TARGET_ARCH
|
rm -rf $(pwd)/build/$TARGET_ARCH
|
||||||
mkdir -p $(pwd)/build/$TARGET_ARCH
|
mkdir -p $(pwd)/build/$TARGET_ARCH
|
||||||
docker build -t win32-builder --build-arg ARCH .
|
docker build -t win32-builder --build-arg ARCH .
|
||||||
docker compose up dist-builder
|
docker compose up dist-builder
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
export ARCH=aarch64
|
export ARCH=aarch64
|
||||||
. ./_build.sh
|
. ./_build.sh
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
export ARCH=x86_64
|
export ARCH=x86_64
|
||||||
. ./_build.sh
|
. ./_build.sh
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
#!/bin/bash -xe
|
#!/bin/bash -xe
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||||
|
|
||||||
MANIFEST=com.freerdp.FreeRDP
|
MANIFEST=com.freerdp.FreeRDP
|
||||||
|
|
||||||
BUILD_BASE=$(mktemp -d)
|
BUILD_BASE=$(mktemp -d)
|
||||||
if [ $# -gt 0 ];
|
if [ $# -gt 0 ]; then
|
||||||
then
|
BUILD_BASE=$1
|
||||||
BUILD_BASE=$1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Using $BUILD_BASE as temporary build directory"
|
echo "Using $BUILD_BASE as temporary build directory"
|
||||||
@ -15,17 +14,15 @@ BUILD=$BUILD_BASE/build
|
|||||||
STATE=$BUILD_BASE/state
|
STATE=$BUILD_BASE/state
|
||||||
|
|
||||||
BUILDER=$(which flatpak-builder)
|
BUILDER=$(which flatpak-builder)
|
||||||
if [ ! -x "$BUILDER" ];
|
if [ ! -x "$BUILDER" ]; then
|
||||||
then
|
echo "command 'flatpak-builder' could not be found, please install and add to PATH"
|
||||||
echo "command 'flatpak-builder' could not be found, please install and add to PATH"
|
exit 1
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FLATPAK=$(which flatpak)
|
FLATPAK=$(which flatpak)
|
||||||
if [ ! -x "$FLATPAK" ];
|
if [ ! -x "$FLATPAK" ]; then
|
||||||
then
|
echo "command 'flatpak' could not be found, please install and add to PATH"
|
||||||
echo "command 'flatpak' could not be found, please install and add to PATH"
|
exit 1
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo --user
|
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo --user
|
||||||
|
@ -1,34 +1,29 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
if [ -z ${FREERDP_SDL_OFF} ];
|
if [ -z ${FREERDP_SDL_OFF} ]; then
|
||||||
then
|
echo "SDL $(which sdl-freerdp)"
|
||||||
echo "SDL $(which sdl-freerdp)"
|
sdl-freerdp $@
|
||||||
sdl-freerdp $@
|
exit $rc
|
||||||
exit $rc
|
|
||||||
else
|
else
|
||||||
if [ -z $XDG_SESSION_TYPE ];
|
if [ -z $XDG_SESSION_TYPE ]; then
|
||||||
then
|
echo "XDG_SESSION_TYPE undefined"
|
||||||
echo "XDG_SESSION_TYPE undefined"
|
exit -1
|
||||||
exit -1
|
elif [ "$XDG_SESSION_TYPE" = "wayland" ]; then
|
||||||
elif [ "$XDG_SESSION_TYPE" = "wayland" ];
|
if [ -z $FREERDP_WAYLAND_OFF ]; then
|
||||||
then
|
echo "wayland $(which wlfreerdp)"
|
||||||
if [ -z $FREERDP_WAYLAND_OFF ];
|
wlfreerdp $@
|
||||||
then
|
exit $rc
|
||||||
echo "wayland $(which wlfreerdp)"
|
else
|
||||||
wlfreerdp $@
|
echo "X11 $(which xfreerdp)"
|
||||||
exit $rc
|
xfreerdp $@
|
||||||
else
|
exit $rc
|
||||||
echo "X11 $(which xfreerdp)"
|
fi
|
||||||
xfreerdp $@
|
elif [ "$XDG_SESSION_TYPE" = "x11" ]; then
|
||||||
exit $rc
|
echo "X11 $(which xfreerdp)"
|
||||||
fi
|
xfreerdp $@
|
||||||
elif [ "$XDG_SESSION_TYPE" = "x11" ];
|
exit $rc
|
||||||
then
|
else
|
||||||
echo "X11 $(which xfreerdp)"
|
echo "XDG_SESSION_TYPE $XDG_SESSION_TYPE not handled"
|
||||||
xfreerdp $@
|
exit -1
|
||||||
exit $rc
|
fi
|
||||||
else
|
|
||||||
echo "XDG_SESSION_TYPE $XDG_SESSION_TYPE not handled"
|
|
||||||
exit -1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
@ -6,11 +6,10 @@ SCRIPT_PATH=$(realpath "$SCRIPT_PATH")
|
|||||||
BUILD_DEPS=$(/usr/bin/which dpkg-checkbuilddeps)
|
BUILD_DEPS=$(/usr/bin/which dpkg-checkbuilddeps)
|
||||||
BUILD_PKG=$(/usr/bin/which dpkg-buildpackage)
|
BUILD_PKG=$(/usr/bin/which dpkg-buildpackage)
|
||||||
|
|
||||||
if [ -z "$BUILD_DEPS" ] || [ -z "$BUILD_PKG" ];
|
if [ -z "$BUILD_DEPS" ] || [ -z "$BUILD_PKG" ]; then
|
||||||
then
|
echo "dpkg-buildpackage [$BUILD_PKG] and dpkg-checkbuilddeps [$BUILD_DEPS] required"
|
||||||
echo "dpkg-buildpackage [$BUILD_PKG] and dpkg-checkbuilddeps [$BUILD_DEPS] required"
|
echo "Install with 'sudo apt install dpkg-dev'"
|
||||||
echo "Install with 'sudo apt install dpkg-dev'"
|
exit 1
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# First create a link to the debian/control folder
|
# First create a link to the debian/control folder
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
ln -s packaging/deb/freerdp-nightly debian
|
ln -s packaging/deb/freerdp-nightly debian
|
||||||
git rev-parse --short HEAD > .source_version
|
git rev-parse --short HEAD >.source_version
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
git rev-parse --short HEAD > source_version
|
git rev-parse --short HEAD >source_version
|
||||||
|
@ -22,20 +22,19 @@ CMAKE_CMD_ARGS="-DANDROID_NDK=$ANDROID_NDK \
|
|||||||
-DCMAKE_MAKE_PROGRAM=make"
|
-DCMAKE_MAKE_PROGRAM=make"
|
||||||
|
|
||||||
BASE=$(pwd)
|
BASE=$(pwd)
|
||||||
for ARCH in $BUILD_ARCH
|
for ARCH in $BUILD_ARCH; do
|
||||||
do
|
common_run cd $BASE
|
||||||
common_run cd $BASE
|
common_run mkdir -p $BUILD_SRC/cJSON-build/$ARCH
|
||||||
common_run mkdir -p $BUILD_SRC/cJSON-build/$ARCH
|
common_run cd $BUILD_SRC/cJSON-build/$ARCH
|
||||||
common_run cd $BUILD_SRC/cJSON-build/$ARCH
|
common_run export ANDROID_NDK=$ANDROID_NDK
|
||||||
common_run export ANDROID_NDK=$ANDROID_NDK
|
common_run $CMAKE_PROGRAM $CMAKE_CMD_ARGS \
|
||||||
common_run $CMAKE_PROGRAM $CMAKE_CMD_ARGS \
|
-DANDROID_ABI=$ARCH \
|
||||||
-DANDROID_ABI=$ARCH \
|
-DCMAKE_INSTALL_PREFIX=$BUILD_DST/$ARCH \
|
||||||
-DCMAKE_INSTALL_PREFIX=$BUILD_DST/$ARCH \
|
-DCMAKE_INSTALL_LIBDIR=. \
|
||||||
-DCMAKE_INSTALL_LIBDIR=. \
|
-B . \
|
||||||
-B . \
|
-S $BUILD_SRC
|
||||||
-S $BUILD_SRC
|
echo $(pwd)
|
||||||
echo $(pwd)
|
common_run $CMAKE_PROGRAM --build . --target install
|
||||||
common_run $CMAKE_PROGRAM --build . --target install
|
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Successfully build library for architectures $BUILD_ARCH"
|
echo "Successfully build library for architectures $BUILD_ARCH"
|
||||||
|
@ -1,332 +1,309 @@
|
|||||||
#!/bin/bash -x
|
#!/bin/bash -x
|
||||||
|
|
||||||
|
SCRIPT_NAME="${BASH_SOURCE[0]}"
|
||||||
SCRIPT_PATH=$(dirname "${BASH_SOURCE[0]}")
|
SCRIPT_PATH=$(dirname "${BASH_SOURCE[0]}")
|
||||||
SCRIPT_PATH=$(realpath "$SCRIPT_PATH")
|
SCRIPT_PATH=$(realpath "$SCRIPT_PATH")
|
||||||
|
|
||||||
FIND_ARGS="-type f -print -quit"
|
FIND_ARGS="-type f -print -quit"
|
||||||
case "$(uname -s)" in
|
case "$(uname -s)" in
|
||||||
|
|
||||||
Darwin)
|
Darwin)
|
||||||
FIND_ARGS="-perm +111 $FIND_ARGS"
|
FIND_ARGS="-perm +111 $FIND_ARGS"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
FIND_ARGS="-executable $FIND_ARGS"
|
FIND_ARGS="-executable $FIND_ARGS"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ -z $BUILD_ARCH ]; then
|
if [ -z $BUILD_ARCH ]; then
|
||||||
BUILD_ARCH="armeabi-v7a x86 x86_64 arm64-v8a"
|
BUILD_ARCH="armeabi-v7a x86 x86_64 arm64-v8a"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z $NDK_TARGET ]; then
|
if [ -z $NDK_TARGET ]; then
|
||||||
NDK_TARGET=21
|
NDK_TARGET=21
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z $CMAKE_PROGRAM ]; then
|
if [ -z $CMAKE_PROGRAM ]; then
|
||||||
CMAKE_PROGRAM="cmake-missing"
|
CMAKE_PROGRAM="cmake-missing"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z $CCACHE ]; then
|
if [ -z $CCACHE ]; then
|
||||||
CCACHE=$(which ccache)
|
CCACHE=$(which ccache)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z $ANDROID_NDK ]; then
|
if [ -z $ANDROID_NDK ]; then
|
||||||
ANDROID_NDK="ndk-missing"
|
ANDROID_NDK="ndk-missing"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z $ANDROID_SDK ]; then
|
if [ -z $ANDROID_SDK ]; then
|
||||||
ANDROID_SDK="sdk-missing"
|
ANDROID_SDK="sdk-missing"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z $BUILD_DST ]; then
|
if [ -z $BUILD_DST ]; then
|
||||||
BUILD_DST=$(pwd)/libs
|
BUILD_DST=$(pwd)/libs
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z $BUILD_SRC ]; then
|
if [ -z $BUILD_SRC ]; then
|
||||||
BUILD_SRC=$(pwd)/src
|
BUILD_SRC=$(pwd)/src
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z $SCM_URL ]; then
|
if [ -z $SCM_URL ]; then
|
||||||
SCM_URL="missing"
|
SCM_URL="missing"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z $SCM_TAG ]; then
|
if [ -z $SCM_TAG ]; then
|
||||||
SCM_TAG=master
|
SCM_TAG=master
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z $SCM_HASH ]; then
|
if [ -z $SCM_HASH ]; then
|
||||||
SCM_HASH="missing"
|
SCM_HASH="missing"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CLEAN_BUILD_DIR=0
|
CLEAN_BUILD_DIR=0
|
||||||
|
|
||||||
function common_help {
|
function common_help {
|
||||||
echo "$(BASHSOURCE[0]) supports the following arguments:"
|
echo "$SCRIPT_NAME supports the following arguments:"
|
||||||
echo " --ndk The base directory of your android NDK defa"
|
echo " --ndk The base directory of your android NDK defa"
|
||||||
echo " ANDROID_NDK=$ANDROID_NDK"
|
echo " ANDROID_NDK=$ANDROID_NDK"
|
||||||
echo " --sdk The base directory of your android SDK defa"
|
echo " --sdk The base directory of your android SDK defa"
|
||||||
echo " ANDROID_SDK=$ANDROID_SDK"
|
echo " ANDROID_SDK=$ANDROID_SDK"
|
||||||
echo " --arch A list of architectures to build"
|
echo " --arch A list of architectures to build"
|
||||||
echo " BUILD_ARCH=$BUILD_ARCH"
|
echo " BUILD_ARCH=$BUILD_ARCH"
|
||||||
echo " --dst The destination directory for include and library files"
|
echo " --dst The destination directory for include and library files"
|
||||||
echo " BUILD_DST=$BUILD_DST"
|
echo " BUILD_DST=$BUILD_DST"
|
||||||
echo " --src The source directory for SCM checkout"
|
echo " --src The source directory for SCM checkout"
|
||||||
echo " BUILD_SRC=$BUILD_SRC"
|
echo " BUILD_SRC=$BUILD_SRC"
|
||||||
echo " --url The SCM source url"
|
echo " --url The SCM source url"
|
||||||
echo " SCM_URL=$SCM_URL"
|
echo " SCM_URL=$SCM_URL"
|
||||||
echo " --tag The SCM branch or tag to check out"
|
echo " --tag The SCM branch or tag to check out"
|
||||||
echo " SCM_TAG=$SCM_TAG"
|
echo " SCM_TAG=$SCM_TAG"
|
||||||
echo " --hash The SCM commit or hash to check out"
|
echo " --hash The SCM commit or hash to check out"
|
||||||
echo " SCM_HASH=$SCM_HASH"
|
echo " SCM_HASH=$SCM_HASH"
|
||||||
echo " --clean Clean the destination before build"
|
echo " --clean Clean the destination before build"
|
||||||
echo " --help Display this help"
|
echo " --help Display this help"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
function common_run {
|
function common_run {
|
||||||
echo "[RUN] $@"
|
echo "[RUN] $@"
|
||||||
"$@"
|
"$@"
|
||||||
RES=$?
|
RES=$?
|
||||||
if [[ $RES -ne 0 ]];
|
if [[ $RES -ne 0 ]]; then
|
||||||
then
|
echo "[ERROR] $@ returned $RES"
|
||||||
echo "[ERROR] $@ returned $RES"
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function common_check_requirements {
|
function common_check_requirements {
|
||||||
if [[ ! -d $ANDROID_NDK ]];
|
if [[ ! -d $ANDROID_NDK ]]; then
|
||||||
then
|
echo "export ANDROID_NDK to point to your NDK location."
|
||||||
echo "export ANDROID_NDK to point to your NDK location."
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -d $ANDROID_SDK ]];
|
if [[ ! -d $ANDROID_SDK ]]; then
|
||||||
then
|
echo "export ANDROID_SDK to point to your SDK location."
|
||||||
echo "export ANDROID_SDK to point to your SDK location."
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
if [[ -z $BUILD_DST ]]; then
|
||||||
if [[ -z $BUILD_DST ]];
|
echo "Destination directory not valid"
|
||||||
then
|
exit 1
|
||||||
echo "Destination directory not valid"
|
fi
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z $BUILD_SRC ]];
|
if [[ -z $BUILD_SRC ]]; then
|
||||||
then
|
echo "Source directory not valid"
|
||||||
echo "Source directory not valid"
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z $SCM_URL ]];
|
if [[ -z $SCM_URL ]]; then
|
||||||
then
|
echo "Source URL not defined! Define SCM_URL"
|
||||||
echo "Source URL not defined! Define SCM_URL"
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z $SCM_TAG ]];
|
if [[ -z $SCM_TAG ]]; then
|
||||||
then
|
echo "SCM_TAG / BRANCH not defined! Define SCM_TAG"
|
||||||
echo "SCM_TAG / BRANCH not defined! Define SCM_TAG"
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z $SCM_HASH ]];
|
if [[ -z $SCM_HASH ]]; then
|
||||||
then
|
echo "SCM_HASH not defined! Define SCM_HASH"
|
||||||
echo "SCM_HASH not defined! Define SCM_HASH"
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z $NDK_TARGET ]];
|
if [[ -z $NDK_TARGET ]]; then
|
||||||
then
|
echo "Android platform NDK_TARGET not defined"
|
||||||
echo "Android platform NDK_TARGET not defined"
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z $CMAKE_PROGRAM ] || [ "$CMAKE_PROGRAM" == "cmake-missing" ]; then
|
if [ -z $CMAKE_PROGRAM ] || [ "$CMAKE_PROGRAM" == "cmake-missing" ]; then
|
||||||
CMAKE_PROGRAM=$(find $ANDROID_SDK/cmake -name cmake $FIND_ARGS)
|
CMAKE_PROGRAM=$(find $ANDROID_SDK/cmake -name cmake $FIND_ARGS)
|
||||||
if [ -z $CMAKE_PROGRAM ]; then
|
if [ -z $CMAKE_PROGRAM ]; then
|
||||||
echo "CMake not found in $ANDROID_SDK, install CMake from the android SDK!"
|
echo "CMake not found in $ANDROID_SDK, install CMake from the android SDK!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for CMD in make git $CMAKE_PROGRAM
|
for CMD in make git $CMAKE_PROGRAM; do
|
||||||
do
|
if ! type $CMD >/dev/null; then
|
||||||
if ! type $CMD >/dev/null; then
|
echo "Command $CMD not found. Install and add it to the PATH."
|
||||||
echo "Command $CMD not found. Install and add it to the PATH."
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
done
|
||||||
done
|
|
||||||
|
|
||||||
if [ "${BUILD_SRC:0:1}" != "/" ];
|
if [ "${BUILD_SRC:0:1}" != "/" ]; then
|
||||||
then
|
BUILD_SRC=$(pwd)/$BUILD_SRC
|
||||||
BUILD_SRC=$(pwd)/$BUILD_SRC
|
fi
|
||||||
fi
|
if [ "${BUILD_DST:0:1}" != "/" ]; then
|
||||||
if [ "${BUILD_DST:0:1}" != "/" ];
|
BUILD_DST=$(pwd)/$BUILD_DST
|
||||||
then
|
fi
|
||||||
BUILD_DST=$(pwd)/$BUILD_DST
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function common_parse_arguments {
|
function common_parse_arguments {
|
||||||
while [[ $# > 0 ]]
|
while [[ $# > 0 ]]; do
|
||||||
do
|
key="$1"
|
||||||
key="$1"
|
case $key in
|
||||||
case $key in
|
--conf)
|
||||||
--conf)
|
source "$2" || exit 1
|
||||||
source "$2" || exit 1
|
shift
|
||||||
shift
|
;;
|
||||||
;;
|
|
||||||
|
|
||||||
--target)
|
--target)
|
||||||
NDK_TARGET="$2"
|
NDK_TARGET="$2"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--ndk)
|
--ndk)
|
||||||
ANDROID_NDK="$2"
|
ANDROID_NDK="$2"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--sdk)
|
--sdk)
|
||||||
ANDROID_SDK="$2"
|
ANDROID_SDK="$2"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--arch)
|
--arch)
|
||||||
BUILD_ARCH="$2"
|
BUILD_ARCH="$2"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--dst)
|
--dst)
|
||||||
BUILD_DST="$2"
|
BUILD_DST="$2"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--src)
|
--src)
|
||||||
BUILD_SRC="$2"
|
BUILD_SRC="$2"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--url)
|
--url)
|
||||||
SCM_URL="$2"
|
SCM_URL="$2"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--tag)
|
--tag)
|
||||||
SCM_TAG="$2"
|
SCM_TAG="$2"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--hash)
|
--hash)
|
||||||
SCM_HASH="$2"
|
SCM_HASH="$2"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--clean)
|
--clean)
|
||||||
CLEAN_BUILD_DIR=1
|
CLEAN_BUILD_DIR=1
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--help)
|
--help)
|
||||||
common_help
|
common_help
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*) # Unknown
|
*) # Unknown
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
common_check_requirements
|
common_check_requirements
|
||||||
}
|
}
|
||||||
|
|
||||||
function common_update {
|
function common_update {
|
||||||
if [ $# -ne 4 ];
|
if [ $# -ne 4 ]; then
|
||||||
then
|
echo "Invalid arguments to update function $@"
|
||||||
echo "Invalid arguments to update function $@"
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
SCM_URL=$1
|
||||||
SCM_URL=$1
|
SCM_TAG=$2
|
||||||
SCM_TAG=$2
|
BUILD_SRC=$3
|
||||||
BUILD_SRC=$3
|
SCM_HASH=$4
|
||||||
SCM_HASH=$4
|
|
||||||
|
|
||||||
echo "Preparing checkout..."
|
echo "Preparing checkout..."
|
||||||
BASE=$(pwd)
|
BASE=$(pwd)
|
||||||
CACHE=$(realpath $SCRIPT_PATH/../cache)
|
CACHE=$(realpath $SCRIPT_PATH/../cache)
|
||||||
common_run mkdir -p $CACHE
|
common_run mkdir -p $CACHE
|
||||||
TARFILE="$CACHE/$SCM_TAG.tar.gz"
|
TARFILE="$CACHE/$SCM_TAG.tar.gz"
|
||||||
|
|
||||||
if [[ ! -f "$TARFILE" ]];
|
if [[ ! -f "$TARFILE" ]]; then
|
||||||
then
|
WGET=$(which wget)
|
||||||
WGET=$(which wget)
|
CURL=$(which curl)
|
||||||
CURL=$(which curl)
|
if [ -x "$CURL" ]; then
|
||||||
if [ -x "$CURL" ];
|
common_run $CURL -L -o "$TARFILE" "$SCM_URL/$SCM_TAG.tar.gz"
|
||||||
then
|
elif [ -x "$WGET" ]; then
|
||||||
common_run $CURL -L -o "$TARFILE" "$SCM_URL/$SCM_TAG.tar.gz"
|
common_run $WGET -O "$TARFILE" "$SCM_URL/$SCM_TAG.tar.gz"
|
||||||
elif [ -x "$WGET" ];
|
else
|
||||||
then
|
echo "Neither wget nor curl installed, aborting"
|
||||||
common_run $WGET -O "$TARFILE" "$SCM_URL/$SCM_TAG.tar.gz"
|
exit -1
|
||||||
else
|
fi
|
||||||
echo "Neither wget nor curl installed, aborting"
|
fi
|
||||||
exit -1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "$SCM_HASH $TARFILE" > $TARFILE.sha256sum
|
echo "$SCM_HASH $TARFILE" >$TARFILE.sha256sum
|
||||||
common_run sha256sum -c $TARFILE.sha256sum
|
common_run sha256sum -c $TARFILE.sha256sum
|
||||||
|
|
||||||
if [[ -d $BUILD_SRC ]];
|
if [[ -d $BUILD_SRC ]]; then
|
||||||
then
|
common_run rm -rf $BUILD_SRC
|
||||||
common_run rm -rf $BUILD_SRC
|
fi
|
||||||
fi
|
common_run mkdir -p $BUILD_SRC
|
||||||
common_run mkdir -p $BUILD_SRC
|
common_run cd $BUILD_SRC
|
||||||
common_run cd $BUILD_SRC
|
common_run tar zxf "$TARFILE" --strip 1
|
||||||
common_run tar zxf "$TARFILE" --strip 1
|
common_run cd $BASE
|
||||||
common_run cd $BASE
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function common_clean {
|
function common_clean {
|
||||||
if [ $CLEAN_BUILD_DIR -ne 1 ];
|
if [ $CLEAN_BUILD_DIR -ne 1 ]; then
|
||||||
then
|
return
|
||||||
return
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $# -ne 1 ];
|
if [ $# -ne 1 ]; then
|
||||||
then
|
echo "Invalid arguments to clean function $@"
|
||||||
echo "Invalid arguments to clean function $@"
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Cleaning up $1..."
|
echo "Cleaning up $1..."
|
||||||
common_run rm -rf $1
|
common_run rm -rf $1
|
||||||
}
|
}
|
||||||
|
|
||||||
function common_copy {
|
function common_copy {
|
||||||
if [ $# -ne 2 ];
|
if [ $# -ne 2 ]; then
|
||||||
then
|
echo "Invalid arguments to copy function $@"
|
||||||
echo "Invalid arguments to copy function $@"
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
if [ ! -d $1 ] || [ ! -d $1/include ] || [ ! -d $1/libs ]; then
|
||||||
if [ ! -d $1 ] || [ ! -d $1/include ] || [ ! -d $1/libs ];
|
echo "Invalid source $1"
|
||||||
then
|
exit 1
|
||||||
echo "Invalid source $1"
|
fi
|
||||||
exit 1
|
if [ -z $2 ]; then
|
||||||
fi
|
echo "Invalid destination $2"
|
||||||
if [ -z $2 ];
|
exit 1
|
||||||
then
|
fi
|
||||||
echo "Invalid destination $2"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -d $2 ];
|
if [ ! -d $2 ]; then
|
||||||
then
|
common_run mkdir -p $2
|
||||||
common_run mkdir -p $2
|
fi
|
||||||
fi
|
common_run cp -L -r $1/include $2
|
||||||
common_run cp -L -r $1/include $2
|
common_run cp -L -r $1/libs/* $2
|
||||||
common_run cp -L -r $1/libs/* $2
|
|
||||||
}
|
}
|
||||||
|
@ -8,212 +8,210 @@ OLD_PATH=$PATH
|
|||||||
source $(dirname "${BASH_SOURCE[0]}")/android-build-common.sh
|
source $(dirname "${BASH_SOURCE[0]}")/android-build-common.sh
|
||||||
|
|
||||||
function get_toolchain() {
|
function get_toolchain() {
|
||||||
HOST_OS=$(uname -s)
|
HOST_OS=$(uname -s)
|
||||||
case ${HOST_OS} in
|
case ${HOST_OS} in
|
||||||
Darwin) HOST_OS=darwin;;
|
Darwin) HOST_OS=darwin ;;
|
||||||
Linux) HOST_OS=linux;;
|
Linux) HOST_OS=linux ;;
|
||||||
FreeBsd) HOST_OS=freebsd;;
|
FreeBsd) HOST_OS=freebsd ;;
|
||||||
CYGWIN*|*_NT-*) HOST_OS=cygwin;;
|
CYGWIN* | *_NT-*) HOST_OS=cygwin ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
HOST_ARCH=$(uname -m)
|
HOST_ARCH=$(uname -m)
|
||||||
case ${HOST_ARCH} in
|
case ${HOST_ARCH} in
|
||||||
i?86) HOST_ARCH=x86;;
|
i?86) HOST_ARCH=x86 ;;
|
||||||
x86_64|amd64) HOST_ARCH=x86_64;;
|
x86_64 | amd64) HOST_ARCH=x86_64 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo "${HOST_OS}-${HOST_ARCH}"
|
echo "${HOST_OS}-${HOST_ARCH}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_build_host() {
|
function get_build_host() {
|
||||||
case ${ARCH} in
|
case ${ARCH} in
|
||||||
armeabi-v7a)
|
armeabi-v7a)
|
||||||
echo "arm-linux-androideabi"
|
echo "arm-linux-androideabi"
|
||||||
;;
|
;;
|
||||||
arm64-v8a)
|
arm64-v8a)
|
||||||
echo "aarch64-linux-android"
|
echo "aarch64-linux-android"
|
||||||
;;
|
;;
|
||||||
x86)
|
x86)
|
||||||
echo "i686-linux-android"
|
echo "i686-linux-android"
|
||||||
;;
|
;;
|
||||||
x86_64)
|
x86_64)
|
||||||
echo "x86_64-linux-android"
|
echo "x86_64-linux-android"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_clang_target_host() {
|
function get_clang_target_host() {
|
||||||
case ${ARCH} in
|
case ${ARCH} in
|
||||||
armeabi-v7a)
|
armeabi-v7a)
|
||||||
echo "armv7a-linux-androideabi${NDK_TARGET}"
|
echo "armv7a-linux-androideabi${NDK_TARGET}"
|
||||||
;;
|
;;
|
||||||
arm64-v8a)
|
arm64-v8a)
|
||||||
echo "aarch64-linux-android${NDK_TARGET}"
|
echo "aarch64-linux-android${NDK_TARGET}"
|
||||||
;;
|
;;
|
||||||
x86)
|
x86)
|
||||||
echo "i686-linux-android${NDK_TARGET}"
|
echo "i686-linux-android${NDK_TARGET}"
|
||||||
;;
|
;;
|
||||||
x86_64)
|
x86_64)
|
||||||
echo "x86_64-linux-android${NDK_TARGET}"
|
echo "x86_64-linux-android${NDK_TARGET}"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_arch_specific_ldflags() {
|
function get_arch_specific_ldflags() {
|
||||||
case ${ARCH} in
|
case ${ARCH} in
|
||||||
armeabi-v7a)
|
armeabi-v7a)
|
||||||
echo "-march=armv7-a -mfpu=neon -mfloat-abi=softfp -Wl,--fix-cortex-a8"
|
echo "-march=armv7-a -mfpu=neon -mfloat-abi=softfp -Wl,--fix-cortex-a8"
|
||||||
;;
|
;;
|
||||||
arm64-v8a)
|
arm64-v8a)
|
||||||
echo "-march=armv8-a"
|
echo "-march=armv8-a"
|
||||||
;;
|
;;
|
||||||
x86)
|
x86)
|
||||||
echo "-march=i686"
|
echo "-march=i686"
|
||||||
;;
|
;;
|
||||||
x86_64)
|
x86_64)
|
||||||
echo "-march=x86-64"
|
echo "-march=x86-64"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_toolchain_clang_paths {
|
function set_toolchain_clang_paths {
|
||||||
TOOLCHAIN=$(get_toolchain)
|
TOOLCHAIN=$(get_toolchain)
|
||||||
|
|
||||||
common_run export PATH=$PATH:${ANDROID_NDK}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin
|
common_run export PATH=$PATH:${ANDROID_NDK}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin
|
||||||
AR=llvm-ar
|
AR=llvm-ar
|
||||||
NM=llvm-nm
|
NM=llvm-nm
|
||||||
RANLIB=llvm-ranlib
|
RANLIB=llvm-ranlib
|
||||||
STRIP=llvm-strip
|
STRIP=llvm-strip
|
||||||
CC=$(get_clang_target_host)-clang
|
CC=$(get_clang_target_host)-clang
|
||||||
CXX=$(get_clang_target_host)-clang++
|
CXX=$(get_clang_target_host)-clang++
|
||||||
|
|
||||||
case ${ARCH} in
|
case ${ARCH} in
|
||||||
arm64-v8a)
|
arm64-v8a)
|
||||||
common_run export ac_cv_c_bigendian=no
|
common_run export ac_cv_c_bigendian=no
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
function build {
|
function build {
|
||||||
echo "Building FFmpeg architecture $1..."
|
echo "Building FFmpeg architecture $1..."
|
||||||
BASE=$(pwd)
|
BASE=$(pwd)
|
||||||
common_run cd $BUILD_SRC
|
common_run cd $BUILD_SRC
|
||||||
|
|
||||||
BUILD_HOST=$(get_build_host)
|
BUILD_HOST=$(get_build_host)
|
||||||
set_toolchain_clang_paths
|
set_toolchain_clang_paths
|
||||||
LDFLAGS=$(get_arch_specific_ldflags)
|
LDFLAGS=$(get_arch_specific_ldflags)
|
||||||
|
|
||||||
CARCH=$TARGET_ARCH
|
CARCH=$TARGET_ARCH
|
||||||
if [ "$CARCH" == "x86_64" ]; then
|
if [ "$CARCH" == "x86_64" ]; then
|
||||||
CARCH="x86-64"
|
CARCH="x86-64"
|
||||||
fi
|
fi
|
||||||
PATH=$ANDROID_NDK:$PATH
|
PATH=$ANDROID_NDK:$PATH
|
||||||
common_run ./configure \
|
common_run ./configure \
|
||||||
--cross-prefix="${BUILD_HOST}-" \
|
--cross-prefix="${BUILD_HOST}-" \
|
||||||
--sysroot="${ANDROID_NDK}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
|
--sysroot="${ANDROID_NDK}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \
|
||||||
--arch="${CARCH}" \
|
--arch="${CARCH}" \
|
||||||
--cpu="${TARGET_CPU}" \
|
--cpu="${TARGET_CPU}" \
|
||||||
--cc="${CC}" \
|
--cc="${CC}" \
|
||||||
--cxx="${CXX}" \
|
--cxx="${CXX}" \
|
||||||
--ar="${AR}" \
|
--ar="${AR}" \
|
||||||
--nm="${NM}" \
|
--nm="${NM}" \
|
||||||
--ranlib="${RANLIB}" \
|
--ranlib="${RANLIB}" \
|
||||||
--strip="${STRIP}" \
|
--strip="${STRIP}" \
|
||||||
--extra-ldflags="${LDFLAGS}" \
|
--extra-ldflags="${LDFLAGS}" \
|
||||||
--prefix="${BUILD_DST}/${ARCH}" \
|
--prefix="${BUILD_DST}/${ARCH}" \
|
||||||
--pkg-config="${HOST_PKG_CONFIG_PATH}" \
|
--pkg-config="${HOST_PKG_CONFIG_PATH}" \
|
||||||
--target-os=android \
|
--target-os=android \
|
||||||
${ARCH_OPTIONS} \
|
${ARCH_OPTIONS} \
|
||||||
--enable-cross-compile \
|
--enable-cross-compile \
|
||||||
--enable-pic \
|
--enable-pic \
|
||||||
--enable-lto \
|
--enable-lto \
|
||||||
--enable-jni \
|
--enable-jni \
|
||||||
--enable-mediacodec \
|
--enable-mediacodec \
|
||||||
--enable-shared \
|
--enable-shared \
|
||||||
--disable-vulkan \
|
--disable-vulkan \
|
||||||
--disable-stripping \
|
--disable-stripping \
|
||||||
--disable-programs \
|
--disable-programs \
|
||||||
--disable-doc \
|
--disable-doc \
|
||||||
--disable-avdevice \
|
--disable-avdevice \
|
||||||
--disable-avfilter \
|
--disable-avfilter \
|
||||||
--disable-avformat \
|
--disable-avformat \
|
||||||
--disable-everything \
|
--disable-everything \
|
||||||
--enable-encoder=aac \
|
--enable-encoder=aac \
|
||||||
--enable-encoder=libfdk_aac \
|
--enable-encoder=libfdk_aac \
|
||||||
--enable-encoder=libgsm \
|
--enable-encoder=libgsm \
|
||||||
--enable-encoder=libgsm_ms \
|
--enable-encoder=libgsm_ms \
|
||||||
--enable-encoder=libopenh264 \
|
--enable-encoder=libopenh264 \
|
||||||
--enable-encoder=libopus \
|
--enable-encoder=libopus \
|
||||||
--enable-encoder=pcm_alaw \
|
--enable-encoder=pcm_alaw \
|
||||||
--enable-encoder=pcm_mulaw \
|
--enable-encoder=pcm_mulaw \
|
||||||
--enable-encoder=pcm_s16le \
|
--enable-encoder=pcm_s16le \
|
||||||
--enable-encoder=pcm_u16le \
|
--enable-encoder=pcm_u16le \
|
||||||
--enable-encoder=h264 \
|
--enable-encoder=h264 \
|
||||||
--enable-encoder=h264_omx \
|
--enable-encoder=h264_omx \
|
||||||
--enable-encoder=h264_mediacodec \
|
--enable-encoder=h264_mediacodec \
|
||||||
--enable-encoder=h264_vulkan \
|
--enable-encoder=h264_vulkan \
|
||||||
--enable-decoder=aac \
|
--enable-decoder=aac \
|
||||||
--enable-decoder=aac_mediacodec \
|
--enable-decoder=aac_mediacodec \
|
||||||
--enable-decoder=adpcm_g722 \
|
--enable-decoder=adpcm_g722 \
|
||||||
--enable-decoder=adpcm_g726 \
|
--enable-decoder=adpcm_g726 \
|
||||||
--enable-decoder=adpcm_g726le \
|
--enable-decoder=adpcm_g726le \
|
||||||
--enable-decoder=gsm \
|
--enable-decoder=gsm \
|
||||||
--enable-decoder=gsm_ms \
|
--enable-decoder=gsm_ms \
|
||||||
--enable-decoder=mp3 \
|
--enable-decoder=mp3 \
|
||||||
--enable-decoder=mp3_mediacodec \
|
--enable-decoder=mp3_mediacodec \
|
||||||
--enable-decoder=h264 \
|
--enable-decoder=h264 \
|
||||||
--enable-decoder=h264_mediacodec \
|
--enable-decoder=h264_mediacodec \
|
||||||
--enable-decoder=libopus \
|
--enable-decoder=libopus \
|
||||||
--enable-decoder=pcm_alaw \
|
--enable-decoder=pcm_alaw \
|
||||||
--enable-decoder=pcm_mulaw \
|
--enable-decoder=pcm_mulaw \
|
||||||
--enable-decoder=pcm_s16le \
|
--enable-decoder=pcm_s16le \
|
||||||
--enable-decoder=pcm_u16le
|
--enable-decoder=pcm_u16le
|
||||||
|
|
||||||
common_run make clean
|
common_run make clean
|
||||||
common_run make -j
|
common_run make -j
|
||||||
common_run make install
|
common_run make install
|
||||||
}
|
}
|
||||||
|
|
||||||
# Run the main program.
|
# Run the main program.
|
||||||
common_parse_arguments $@
|
common_parse_arguments $@
|
||||||
common_update $SCM_URL $SCM_TAG $BUILD_SRC $SCM_HASH
|
common_update $SCM_URL $SCM_TAG $BUILD_SRC $SCM_HASH
|
||||||
|
|
||||||
HOST_PKG_CONFIG_PATH=`command -v pkg-config`
|
HOST_PKG_CONFIG_PATH=$(command -v pkg-config)
|
||||||
if [ -z ${HOST_PKG_CONFIG_PATH} ]; then
|
if [ -z ${HOST_PKG_CONFIG_PATH} ]; then
|
||||||
echo "(*) pkg-config command not found\n"
|
echo "(*) pkg-config command not found\n"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
for ARCH in $BUILD_ARCH; do
|
||||||
|
case ${ARCH} in
|
||||||
|
armeabi-v7a)
|
||||||
|
TARGET_CPU="armv7-a"
|
||||||
|
TARGET_ARCH="armv7-a"
|
||||||
|
ARCH_OPTIONS=" --enable-neon --enable-asm --enable-inline-asm"
|
||||||
|
;;
|
||||||
|
arm64-v8a)
|
||||||
|
TARGET_CPU="armv8-a"
|
||||||
|
TARGET_ARCH="aarch64"
|
||||||
|
ARCH_OPTIONS=" --enable-neon --enable-asm --enable-inline-asm"
|
||||||
|
;;
|
||||||
|
x86)
|
||||||
|
TARGET_CPU="i686"
|
||||||
|
TARGET_ARCH="i686"
|
||||||
|
|
||||||
for ARCH in $BUILD_ARCH
|
# asm disabled due to this ticker https://trac.ffmpeg.org/ticket/4928
|
||||||
do
|
ARCH_OPTIONS=" --disable-neon --disable-asm --disable-inline-asm"
|
||||||
case ${ARCH} in
|
;;
|
||||||
armeabi-v7a)
|
x86_64)
|
||||||
TARGET_CPU="armv7-a"
|
TARGET_CPU="x86_64"
|
||||||
TARGET_ARCH="armv7-a"
|
TARGET_ARCH="x86_64"
|
||||||
ARCH_OPTIONS=" --enable-neon --enable-asm --enable-inline-asm"
|
ARCH_OPTIONS=" --disable-neon --enable-asm --enable-inline-asm"
|
||||||
;;
|
;;
|
||||||
arm64-v8a)
|
esac
|
||||||
TARGET_CPU="armv8-a"
|
|
||||||
TARGET_ARCH="aarch64"
|
|
||||||
ARCH_OPTIONS=" --enable-neon --enable-asm --enable-inline-asm"
|
|
||||||
;;
|
|
||||||
x86)
|
|
||||||
TARGET_CPU="i686"
|
|
||||||
TARGET_ARCH="i686"
|
|
||||||
|
|
||||||
# asm disabled due to this ticker https://trac.ffmpeg.org/ticket/4928
|
build
|
||||||
ARCH_OPTIONS=" --disable-neon --disable-asm --disable-inline-asm"
|
common_run cp -L $BUILD_DST/$ARCH/lib/*.so $BUILD_DST/$ARCH/
|
||||||
;;
|
|
||||||
x86_64)
|
|
||||||
TARGET_CPU="x86_64"
|
|
||||||
TARGET_ARCH="x86_64"
|
|
||||||
ARCH_OPTIONS=" --disable-neon --enable-asm --enable-inline-asm"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
build
|
common_run export PATH=$OLD_PATH
|
||||||
common_run cp -L $BUILD_DST/$ARCH/lib/*.so $BUILD_DST/$ARCH/
|
|
||||||
|
|
||||||
common_run export PATH=$OLD_PATH
|
|
||||||
done
|
done
|
||||||
|
@ -28,74 +28,70 @@ source $SCRIPT_PATH/android-build.conf
|
|||||||
|
|
||||||
# Parse arguments.
|
# Parse arguments.
|
||||||
REMAINING=""
|
REMAINING=""
|
||||||
while [[ $# > 0 ]]
|
while [[ $# > 0 ]]; do
|
||||||
do
|
key="$1"
|
||||||
key="$1"
|
case $key in
|
||||||
case $key in
|
--freerdp-src)
|
||||||
--freerdp-src)
|
SRC_DIR="$2"
|
||||||
SRC_DIR="$2"
|
shift
|
||||||
shift
|
;;
|
||||||
;;
|
--openh264)
|
||||||
--openh264)
|
WITH_OPENH264=1
|
||||||
WITH_OPENH264=1
|
shift
|
||||||
shift
|
;;
|
||||||
;;
|
--openh264-ndk)
|
||||||
--openh264-ndk)
|
shift
|
||||||
shift
|
ANDROID_NDK_OPENH264=$1
|
||||||
ANDROID_NDK_OPENH264=$1
|
shift
|
||||||
shift
|
;;
|
||||||
;;
|
--ffmpeg)
|
||||||
--ffmpeg)
|
WITH_FFMPEG=1
|
||||||
WITH_FFMPEG=1
|
shift
|
||||||
shift
|
;;
|
||||||
;;
|
--cjson)
|
||||||
--cjson)
|
WITH_AAD=1
|
||||||
WITH_AAD=1
|
shift
|
||||||
shift
|
;;
|
||||||
;;
|
--openssl)
|
||||||
--openssl)
|
WITH_OPENSSL=1
|
||||||
WITH_OPENSSL=1
|
shift
|
||||||
shift
|
;;
|
||||||
;;
|
--debug)
|
||||||
--debug)
|
CMAKE_BUILD_TYPE=Debug
|
||||||
CMAKE_BUILD_TYPE=Debug
|
shift
|
||||||
shift
|
;;
|
||||||
;;
|
--release)
|
||||||
--release)
|
CMAKE_BUILD_TYPE=Release
|
||||||
CMAKE_BUILD_TYPE=Release
|
shift
|
||||||
shift
|
;;
|
||||||
;;
|
--relWithDebug)
|
||||||
--relWithDebug)
|
CMAKE_BUILD_TYPE=RelWithDebug
|
||||||
CMAKE_BUILD_TYPE=RelWithDebug
|
shift
|
||||||
shift
|
;;
|
||||||
;;
|
--build-deps)
|
||||||
--build-deps)
|
BUILD_DEPS=1
|
||||||
BUILD_DEPS=1
|
shift
|
||||||
shift
|
;;
|
||||||
;;
|
*)
|
||||||
*)
|
REMAINING="$REMAINING $key"
|
||||||
REMAINING="$REMAINING $key"
|
shift
|
||||||
shift
|
;;
|
||||||
;;
|
esac
|
||||||
esac
|
|
||||||
done
|
done
|
||||||
common_parse_arguments $REMAINING
|
common_parse_arguments $REMAINING
|
||||||
|
|
||||||
if [ -z ${WITH_MEDIACODEC+x} ];
|
if [ -z ${WITH_MEDIACODEC+x} ]; then
|
||||||
then
|
common_run echo "WITH_MEDIACODEC unset, defining WITH_MEDIACODEC=1"
|
||||||
common_run echo "WITH_MEDIACODEC unset, defining WITH_MEDIACODEC=1"
|
WITH_MEDIACODEC=1
|
||||||
WITH_MEDIACODEC=1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# clean up top
|
# clean up top
|
||||||
if [ -d $BUILD_SRC ];
|
if [ -d $BUILD_SRC ]; then
|
||||||
then
|
common_clean $BUILD_SRC
|
||||||
common_clean $BUILD_SRC
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d $BUILD_DST ];
|
if [ -d $BUILD_DST ]; then
|
||||||
then
|
common_run mkdir -p $BUILD_DST
|
||||||
common_run mkdir -p $BUILD_DST
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Prepare the environment
|
# Prepare the environment
|
||||||
@ -115,105 +111,93 @@ CMAKE_CMD_ARGS="-DANDROID_NDK=$ANDROID_NDK \
|
|||||||
-DCMAKE_MAKE_PROGRAM=make"
|
-DCMAKE_MAKE_PROGRAM=make"
|
||||||
|
|
||||||
BASE=$(pwd)
|
BASE=$(pwd)
|
||||||
for ARCH in $BUILD_ARCH
|
for ARCH in $BUILD_ARCH; do
|
||||||
do
|
# build dependencies.
|
||||||
# build dependencies.
|
if [ $WITH_OPENH264 -ne 0 ]; then
|
||||||
if [ $WITH_OPENH264 -ne 0 ];
|
if [ -z "$ANDROID_NDK_OPENH264" ]; then
|
||||||
then
|
echo
|
||||||
if [ -z "$ANDROID_NDK_OPENH264" ]
|
echo "Warning: Missing openh264-ndk, using $ANDROID_NDK" >&2
|
||||||
then
|
echo
|
||||||
echo
|
ANDROID_NDK_OPENH264=$ANDROID_NDK
|
||||||
echo "Warning: Missing openh264-ndk, using $ANDROID_NDK" >&2
|
fi
|
||||||
echo
|
if [ $BUILD_DEPS -ne 0 ]; then
|
||||||
ANDROID_NDK_OPENH264=$ANDROID_NDK
|
common_run bash $SCRIPT_PATH/android-build-openh264.sh \
|
||||||
fi
|
--src $BUILD_SRC/openh264 --dst $BUILD_DST \
|
||||||
if [ $BUILD_DEPS -ne 0 ];
|
--sdk "$ANDROID_SDK" \
|
||||||
then
|
--ndk "$ANDROID_NDK_OPENH264" \
|
||||||
common_run bash $SCRIPT_PATH/android-build-openh264.sh \
|
--arch $ARCH \
|
||||||
--src $BUILD_SRC/openh264 --dst $BUILD_DST \
|
--target $NDK_TARGET \
|
||||||
--sdk "$ANDROID_SDK" \
|
--tag $OPENH264_TAG \
|
||||||
--ndk "$ANDROID_NDK_OPENH264" \
|
--hash $OPENH264_HASH
|
||||||
--arch $ARCH \
|
fi
|
||||||
--target $NDK_TARGET \
|
CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_OPENH264=ON"
|
||||||
--tag $OPENH264_TAG \
|
else
|
||||||
--hash $OPENH264_HASH
|
CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_OPENH264=OFF"
|
||||||
fi
|
fi
|
||||||
CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_OPENH264=ON"
|
|
||||||
else
|
|
||||||
CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_OPENH264=OFF"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $WITH_MEDIACODEC -ne 0 ];
|
if [ $WITH_MEDIACODEC -ne 0 ]; then
|
||||||
then
|
CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_MEDIACODEC=ON"
|
||||||
CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_MEDIACODEC=ON"
|
else
|
||||||
else
|
CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_MEDIACODEC=OFF"
|
||||||
CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_MEDIACODEC=OFF"
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $WITH_FFMPEG -ne 0 ];
|
if [ $WITH_FFMPEG -ne 0 ]; then
|
||||||
then
|
if [ $BUILD_DEPS -ne 0 ]; then
|
||||||
if [ $BUILD_DEPS -ne 0 ];
|
common_run bash $SCRIPT_PATH/android-build-ffmpeg.sh \
|
||||||
then
|
--src $BUILD_SRC/ffmpeg --dst $BUILD_DST \
|
||||||
common_run bash $SCRIPT_PATH/android-build-ffmpeg.sh \
|
--sdk "$ANDROID_SDK" \
|
||||||
--src $BUILD_SRC/ffmpeg --dst $BUILD_DST \
|
--ndk "$ANDROID_NDK" \
|
||||||
--sdk "$ANDROID_SDK" \
|
--arch $ARCH \
|
||||||
--ndk "$ANDROID_NDK" \
|
--target $NDK_TARGET \
|
||||||
--arch $ARCH \
|
--tag $FFMPEG_TAG \
|
||||||
--target $NDK_TARGET \
|
--hash $FFMPEG_HASH
|
||||||
--tag $FFMPEG_TAG \
|
fi
|
||||||
--hash $FFMPEG_HASH
|
CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_FFMPEG=ON -DWITH_SWCALE=ON"
|
||||||
fi
|
else
|
||||||
CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_FFMPEG=ON -DWITH_SWCALE=ON"
|
CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_FFMPEG=OFF -DWITH_SWSCALE=OFF"
|
||||||
else
|
fi
|
||||||
CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_FFMPEG=OFF -DWITH_SWSCALE=OFF"
|
if [ $WITH_AAD -ne 0 ]; then
|
||||||
fi
|
if [ $BUILD_DEPS -ne 0 ]; then
|
||||||
if [ $WITH_AAD -ne 0 ];
|
common_run bash $SCRIPT_PATH/android-build-cjson.sh \
|
||||||
then
|
--src $BUILD_SRC/cjson --dst $BUILD_DST \
|
||||||
if [ $BUILD_DEPS -ne 0 ];
|
--sdk "$ANDROID_SDK" \
|
||||||
then
|
--ndk "$ANDROID_NDK" \
|
||||||
common_run bash $SCRIPT_PATH/android-build-cjson.sh \
|
--arch $ARCH \
|
||||||
--src $BUILD_SRC/cjson --dst $BUILD_DST \
|
--target $NDK_TARGET \
|
||||||
--sdk "$ANDROID_SDK" \
|
--tag $CJSON_TAG \
|
||||||
--ndk "$ANDROID_NDK" \
|
--hash $CJSON_HASH
|
||||||
--arch $ARCH \
|
fi
|
||||||
--target $NDK_TARGET \
|
fi
|
||||||
--tag $CJSON_TAG \
|
if [ $WITH_OPENSSL -ne 0 ]; then
|
||||||
--hash $CJSON_HASH
|
if [ $BUILD_DEPS -ne 0 ]; then
|
||||||
fi
|
common_run bash $SCRIPT_PATH/android-build-openssl.sh \
|
||||||
fi
|
--src $BUILD_SRC/openssl --dst $BUILD_DST \
|
||||||
if [ $WITH_OPENSSL -ne 0 ];
|
--sdk "$ANDROID_SDK" \
|
||||||
then
|
--ndk $ANDROID_NDK \
|
||||||
if [ $BUILD_DEPS -ne 0 ];
|
--arch $ARCH \
|
||||||
then
|
--target $NDK_TARGET \
|
||||||
common_run bash $SCRIPT_PATH/android-build-openssl.sh \
|
--tag $OPENSSL_TAG \
|
||||||
--src $BUILD_SRC/openssl --dst $BUILD_DST \
|
--hash $OPENSSL_HASH
|
||||||
--sdk "$ANDROID_SDK" \
|
fi
|
||||||
--ndk $ANDROID_NDK \
|
fi
|
||||||
--arch $ARCH \
|
|
||||||
--target $NDK_TARGET \
|
|
||||||
--tag $OPENSSL_TAG \
|
|
||||||
--hash $OPENSSL_HASH
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Build and install the library.
|
# Build and install the library.
|
||||||
if [ $DEPS_ONLY -eq 0 ];
|
if [ $DEPS_ONLY -eq 0 ]; then
|
||||||
then
|
common_run cd $BASE
|
||||||
common_run cd $BASE
|
common_run mkdir -p $BUILD_SRC/freerdp-build/$ARCH
|
||||||
common_run mkdir -p $BUILD_SRC/freerdp-build/$ARCH
|
common_run cd $BUILD_SRC/freerdp-build/$ARCH
|
||||||
common_run cd $BUILD_SRC/freerdp-build/$ARCH
|
common_run export ANDROID_NDK=$ANDROID_NDK
|
||||||
common_run export ANDROID_NDK=$ANDROID_NDK
|
common_run $CMAKE_PROGRAM $CMAKE_CMD_ARGS \
|
||||||
common_run $CMAKE_PROGRAM $CMAKE_CMD_ARGS \
|
-DANDROID_ABI=$ARCH \
|
||||||
-DANDROID_ABI=$ARCH \
|
-DCMAKE_INSTALL_PREFIX=$BUILD_DST/$ARCH \
|
||||||
-DCMAKE_INSTALL_PREFIX=$BUILD_DST/$ARCH \
|
-DCMAKE_INSTALL_LIBDIR=. \
|
||||||
-DCMAKE_INSTALL_LIBDIR=. \
|
-DCMAKE_PREFIX_PATH=$BUILD_DST/$ARCH \
|
||||||
-DCMAKE_PREFIX_PATH=$BUILD_DST/$ARCH \
|
-DCMAKE_SHARED_LINKER_FLAGS="-L$BUILD_DST/$ARCH" \
|
||||||
-DCMAKE_SHARED_LINKER_FLAGS="-L$BUILD_DST/$ARCH" \
|
-DcJSON_DIR=$BUILD_DST/$ARCH/cmake/cJSON \
|
||||||
-DcJSON_DIR=$BUILD_DST/$ARCH/cmake/cJSON \
|
$SRC_DIR
|
||||||
$SRC_DIR
|
echo $(pwd)
|
||||||
echo $(pwd)
|
common_run $CMAKE_PROGRAM --build . --target install
|
||||||
common_run $CMAKE_PROGRAM --build . --target install
|
fi
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Successfully build library for architectures $BUILD_ARCH"
|
echo "Successfully build library for architectures $BUILD_ARCH"
|
||||||
|
@ -6,59 +6,55 @@ SCM_HASH=94c8ca364db990047ec4ec3481b04ce0d791e62561ef5601443011bdc00825e3
|
|||||||
source $(dirname "${BASH_SOURCE[0]}")/android-build-common.sh
|
source $(dirname "${BASH_SOURCE[0]}")/android-build-common.sh
|
||||||
|
|
||||||
function build {
|
function build {
|
||||||
echo "Building architecture $1..."
|
echo "Building architecture $1..."
|
||||||
BASE=$(pwd)
|
BASE=$(pwd)
|
||||||
common_run cd $BUILD_SRC
|
common_run cd $BUILD_SRC
|
||||||
PATH=$ANDROID_NDK:$PATH
|
PATH=$ANDROID_NDK:$PATH
|
||||||
MAKE="make LDFLAGS=-static-libstdc++ PATH=$PATH ENABLEPIC=Yes OS=android NDKROOT=$ANDROID_NDK NDK_TOOLCHAIN_VERSION=clang TARGET=android-$2 NDKLEVEL=$2 ARCH=$1 -j libraries"
|
MAKE="make LDFLAGS=-static-libstdc++ PATH=$PATH ENABLEPIC=Yes OS=android NDKROOT=$ANDROID_NDK NDK_TOOLCHAIN_VERSION=clang TARGET=android-$2 NDKLEVEL=$2 ARCH=$1 -j libraries"
|
||||||
|
|
||||||
common_run export QUIET_AR="$CCACHE "
|
common_run export QUIET_AR="$CCACHE "
|
||||||
common_run export QUIET_ASM="$CCACHE "
|
common_run export QUIET_ASM="$CCACHE "
|
||||||
common_run export QUIET_CC="$CCACHE "
|
common_run export QUIET_CC="$CCACHE "
|
||||||
common_run export QUIET_CCAR="$CCACHE "
|
common_run export QUIET_CCAR="$CCACHE "
|
||||||
common_run export QUIET_CXX="$CCACHE "
|
common_run export QUIET_CXX="$CCACHE "
|
||||||
|
|
||||||
common_run $MAKE
|
common_run $MAKE
|
||||||
# Install creates a non optimal directory layout, fix that
|
# Install creates a non optimal directory layout, fix that
|
||||||
common_run $MAKE PREFIX=$BUILD_SRC/libs/$1 install
|
common_run $MAKE PREFIX=$BUILD_SRC/libs/$1 install
|
||||||
common_run cd $BASE
|
common_run cd $BASE
|
||||||
}
|
}
|
||||||
|
|
||||||
# Run the main program.
|
# Run the main program.
|
||||||
common_parse_arguments $@
|
common_parse_arguments $@
|
||||||
common_update $SCM_URL $SCM_TAG $BUILD_SRC $SCM_HASH
|
common_update $SCM_URL $SCM_TAG $BUILD_SRC $SCM_HASH
|
||||||
|
|
||||||
|
for ARCH in $BUILD_ARCH; do
|
||||||
|
case $ARCH in
|
||||||
|
"armeabi")
|
||||||
|
OARCH="arm"
|
||||||
|
;;
|
||||||
|
"armeabi-v7a")
|
||||||
|
OARCH="arm"
|
||||||
|
;;
|
||||||
|
"arm64-v8a")
|
||||||
|
OARCH="arm64"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
OARCH=$ARCH
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
for ARCH in $BUILD_ARCH
|
echo "$ARCH=$OARCH"
|
||||||
do
|
|
||||||
case $ARCH in
|
|
||||||
"armeabi")
|
|
||||||
OARCH="arm"
|
|
||||||
;;
|
|
||||||
"armeabi-v7a")
|
|
||||||
OARCH="arm"
|
|
||||||
;;
|
|
||||||
"arm64-v8a")
|
|
||||||
OARCH="arm64"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
OARCH=$ARCH
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
echo "$ARCH=$OARCH"
|
build $OARCH $NDK_TARGET
|
||||||
|
|
||||||
build $OARCH $NDK_TARGET
|
if [ ! -d $BUILD_DST/$ARCH/include ]; then
|
||||||
|
common_run mkdir -p $BUILD_DST/$ARCH/include
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -d $BUILD_DST/$ARCH/include ];
|
common_run cp -L -r $BUILD_SRC/libs/$OARCH/include/ $BUILD_DST/$ARCH/
|
||||||
then
|
if [ ! -d $BUILD_DST/$ARCH ]; then
|
||||||
common_run mkdir -p $BUILD_DST/$ARCH/include
|
common_run mkdir -p $BUILD_DST/$ARCH
|
||||||
fi
|
fi
|
||||||
|
common_run cp -L $BUILD_SRC/libs/$OARCH/lib/*.so $BUILD_DST/$ARCH/
|
||||||
common_run cp -L -r $BUILD_SRC/libs/$OARCH/include/ $BUILD_DST/$ARCH/
|
|
||||||
if [ ! -d $BUILD_DST/$ARCH ];
|
|
||||||
then
|
|
||||||
common_run mkdir -p $BUILD_DST/$ARCH
|
|
||||||
fi
|
|
||||||
common_run cp -L $BUILD_SRC/libs/$OARCH/lib/*.so $BUILD_DST/$ARCH/
|
|
||||||
done
|
done
|
||||||
|
@ -9,36 +9,34 @@ COMPILER=4.9
|
|||||||
source $(dirname "${BASH_SOURCE[0]}")/android-build-common.sh
|
source $(dirname "${BASH_SOURCE[0]}")/android-build-common.sh
|
||||||
|
|
||||||
function build {
|
function build {
|
||||||
if [ $# -ne 2 ];
|
if [ $# -ne 2 ]; then
|
||||||
then
|
echo "Invalid arguments $@"
|
||||||
echo "Invalid arguments $@"
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
CONFIG=$1
|
CONFIG=$1
|
||||||
DST_PREFIX=$2
|
DST_PREFIX=$2
|
||||||
|
|
||||||
common_run export CC=clang
|
common_run export CC=clang
|
||||||
common_run export PATH=$(${SCRIPT_PATH}/toolchains_path.py --ndk ${ANDROID_NDK}):$ORG_PATH
|
common_run export PATH=$(${SCRIPT_PATH}/toolchains_path.py --ndk ${ANDROID_NDK}):$ORG_PATH
|
||||||
common_run export ANDROID_NDK
|
common_run export ANDROID_NDK
|
||||||
|
|
||||||
echo "CONFIG=$CONFIG"
|
echo "CONFIG=$CONFIG"
|
||||||
echo "DST_PREFIX=$DST_PREFIX"
|
echo "DST_PREFIX=$DST_PREFIX"
|
||||||
echo "PATH=$PATH"
|
echo "PATH=$PATH"
|
||||||
|
|
||||||
BASE=$(pwd)
|
BASE=$(pwd)
|
||||||
DST_DIR=$BUILD_DST/$DST_PREFIX
|
DST_DIR=$BUILD_DST/$DST_PREFIX
|
||||||
common_run cd $BUILD_SRC
|
common_run cd $BUILD_SRC
|
||||||
common_run ./Configure ${CONFIG} -D__ANDROID_API__=$NDK_TARGET
|
common_run ./Configure ${CONFIG} -D__ANDROID_API__=$NDK_TARGET
|
||||||
common_run make SHLIB_EXT=.so -j build_libs
|
common_run make SHLIB_EXT=.so -j build_libs
|
||||||
|
|
||||||
if [ ! -d $DST_DIR ];
|
if [ ! -d $DST_DIR ]; then
|
||||||
then
|
common_run mkdir -p $DST_DIR
|
||||||
common_run mkdir -p $DST_DIR
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
common_run cp *.so $DST_DIR/
|
common_run cp *.so $DST_DIR/
|
||||||
common_run cd $BASE
|
common_run cd $BASE
|
||||||
}
|
}
|
||||||
|
|
||||||
# Run the main program.
|
# Run the main program.
|
||||||
@ -48,38 +46,36 @@ SCM_MOD_TAG=$SCM_TAG
|
|||||||
|
|
||||||
# Workaround for naming of OpenSSL releases changing with every major version
|
# Workaround for naming of OpenSSL releases changing with every major version
|
||||||
case $SCM_TAG in OpenSSL_*)
|
case $SCM_TAG in OpenSSL_*)
|
||||||
SCM_MOD_TAG=${SCM_TAG//OpenSSL_/openssl-}
|
SCM_MOD_TAG=${SCM_TAG//OpenSSL_/openssl-}
|
||||||
SCM_MOD_TAG=${SCM_MOD_TAG//_/.}
|
SCM_MOD_TAG=${SCM_MOD_TAG//_/.}
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
common_update "$SCM_URL/$SCM_TAG" $SCM_MOD_TAG $BUILD_SRC $SCM_HASH
|
common_update "$SCM_URL/$SCM_TAG" $SCM_MOD_TAG $BUILD_SRC $SCM_HASH
|
||||||
|
|
||||||
ORG_PATH=$PATH
|
ORG_PATH=$PATH
|
||||||
for ARCH in $BUILD_ARCH
|
for ARCH in $BUILD_ARCH; do
|
||||||
do
|
|
||||||
|
|
||||||
case $ARCH in
|
case $ARCH in
|
||||||
"armeabi-v7a")
|
"armeabi-v7a")
|
||||||
build "android-arm" "armeabi-v7a"
|
build "android-arm" "armeabi-v7a"
|
||||||
;;
|
;;
|
||||||
"x86")
|
"x86")
|
||||||
build "android-x86" "x86"
|
build "android-x86" "x86"
|
||||||
;;
|
;;
|
||||||
"arm64-v8a")
|
"arm64-v8a")
|
||||||
build "android-arm64" "arm64-v8a"
|
build "android-arm64" "arm64-v8a"
|
||||||
;;
|
;;
|
||||||
"x86_64")
|
"x86_64")
|
||||||
build "android-x86_64" "x86_64"
|
build "android-x86_64" "x86_64"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "[WARNING] Skipping unsupported architecture $ARCH"
|
echo "[WARNING] Skipping unsupported architecture $ARCH"
|
||||||
continue
|
continue
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ ! -d $BUILD_DST/$ARCH/include ];
|
if [ ! -d $BUILD_DST/$ARCH/include ]; then
|
||||||
then
|
common_run mkdir -p $BUILD_DST/$ARCH/include
|
||||||
common_run mkdir -p $BUILD_DST/$ARCH/include
|
|
||||||
fi
|
fi
|
||||||
common_run cp -L -R $BUILD_SRC/include/openssl $BUILD_DST/$ARCH/include/
|
common_run cp -L -R $BUILD_SRC/include/openssl $BUILD_DST/$ARCH/include/
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash -xe
|
#!/bin/bash -xe
|
||||||
SCRIPT_PATH="$(dirname -- "${BASH_SOURCE[0]}")" # relative
|
SCRIPT_PATH="$(dirname -- "${BASH_SOURCE[0]}")" # relative
|
||||||
SCRIPT_PATH="$(cd -- "$SCRIPT_PATH" && pwd)" # absolutized and normalized
|
SCRIPT_PATH="$(cd -- "$SCRIPT_PATH" && pwd)" # absolutized and normalized
|
||||||
|
|
||||||
BASE=$(pwd)
|
BASE=$(pwd)
|
||||||
@ -14,7 +14,7 @@ DATADIR=Resources
|
|||||||
DEPLOYMENT_ARCH='arm64 x86_64'
|
DEPLOYMENT_ARCH='arm64 x86_64'
|
||||||
DEPLOYMENT_TARGET=12
|
DEPLOYMENT_TARGET=12
|
||||||
|
|
||||||
usage () {
|
usage() {
|
||||||
echo "${BASH_SOURCE[0]} [-a|--arch 'arch1 arch2 ...'] [-t|--target target][-h|--help]"
|
echo "${BASH_SOURCE[0]} [-a|--arch 'arch1 arch2 ...'] [-t|--target target][-h|--help]"
|
||||||
echo ""
|
echo ""
|
||||||
echo "default options:"
|
echo "default options:"
|
||||||
@ -23,100 +23,90 @@ usage () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
check_tools() {
|
check_tools() {
|
||||||
for TOOL in mkdir rm mv git dirname pwd find cut basename grep xargs cmake ninja autoconf automake aclocal autoheader glibtoolize lipo otool install_name_tool;
|
for TOOL in mkdir rm mv git dirname pwd find cut basename grep xargs cmake ninja autoconf automake aclocal autoheader glibtoolize lipo otool install_name_tool; do
|
||||||
do
|
set +e
|
||||||
set +e
|
TOOL_PATH=$(which "$TOOL")
|
||||||
TOOL_PATH=$(which "$TOOL")
|
set -e
|
||||||
set -e
|
echo "$TOOL: $TOOL_PATH"
|
||||||
echo "$TOOL: $TOOL_PATH"
|
|
||||||
|
|
||||||
if [ ! -f "$TOOL_PATH" ];
|
if [ ! -f "$TOOL_PATH" ]; then
|
||||||
then
|
echo "Missing $TOOL! please install and add to PATH."
|
||||||
echo "Missing $TOOL! please install and add to PATH."
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
done
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
-a|--arch)
|
-a | --arch)
|
||||||
DEPLOYMENT_ARCH="$2"
|
DEPLOYMENT_ARCH="$2"
|
||||||
shift # past argument
|
shift # past argument
|
||||||
shift # past value
|
shift # past value
|
||||||
;;
|
;;
|
||||||
-t|--target)
|
-t | --target)
|
||||||
DEPLOYMENT_TARGET="$2"
|
DEPLOYMENT_TARGET="$2"
|
||||||
shift # past argument
|
shift # past argument
|
||||||
shift # past value
|
shift # past value
|
||||||
;;
|
;;
|
||||||
-t|--target)
|
-t | --target)
|
||||||
usage
|
usage
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
-*|--*)
|
-* | --*)
|
||||||
usage
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
usage
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
check_tools
|
check_tools
|
||||||
|
|
||||||
fix_rpath() {
|
fix_rpath() {
|
||||||
SEARCH_PATH=$1
|
SEARCH_PATH=$1
|
||||||
FIX_PATH=$1
|
FIX_PATH=$1
|
||||||
EXT=".dylib"
|
EXT=".dylib"
|
||||||
if [ "$#" -gt 1 ];
|
if [ "$#" -gt 1 ]; then
|
||||||
then
|
FIX_PATH=$2
|
||||||
FIX_PATH=$2
|
fi
|
||||||
fi
|
if [ "$#" -gt 2 ]; then
|
||||||
if [ "$#" -gt 2 ];
|
EXT=$3
|
||||||
then
|
fi
|
||||||
EXT=$3
|
|
||||||
fi
|
|
||||||
|
|
||||||
# some build systems do not handle @rpath on mac os correctly.
|
# some build systems do not handle @rpath on mac os correctly.
|
||||||
# do check that and fix it.
|
# do check that and fix it.
|
||||||
DYLIB_ABS_NAMES=$(find $SEARCH_PATH -type f -name "*$EXT")
|
DYLIB_ABS_NAMES=$(find $SEARCH_PATH -type f -name "*$EXT")
|
||||||
for DYLIB_ABS in $DYLIB_ABS_NAMES;
|
for DYLIB_ABS in $DYLIB_ABS_NAMES; do
|
||||||
do
|
DYLIB_NAME=$(basename $DYLIB_ABS)
|
||||||
DYLIB_NAME=$(basename $DYLIB_ABS)
|
install_name_tool -id @rpath/$DYLIB_NAME $DYLIB_ABS
|
||||||
install_name_tool -id @rpath/$DYLIB_NAME $DYLIB_ABS
|
|
||||||
|
|
||||||
for DYLIB_DEP in $(otool -L $DYLIB_ABS | grep "$FIX_PATH" | cut -d' ' -f1);
|
for DYLIB_DEP in $(otool -L $DYLIB_ABS | grep "$FIX_PATH" | cut -d' ' -f1); do
|
||||||
do
|
if [[ $DYLIB_DEP == $DYLIB_ABS ]]; then
|
||||||
if [[ $DYLIB_DEP == $DYLIB_ABS ]];
|
continue
|
||||||
then
|
elif [[ $DYLIB_DEP == $FIX_PATH/* ]]; then
|
||||||
continue
|
DEP_BASE=$(basename $DYLIB_DEP)
|
||||||
elif [[ $DYLIB_DEP == $FIX_PATH/* ]];
|
install_name_tool -change $DYLIB_DEP @rpath/$DEP_BASE $DYLIB_ABS
|
||||||
then
|
fi
|
||||||
DEP_BASE=$(basename $DYLIB_DEP)
|
done
|
||||||
install_name_tool -change $DYLIB_DEP @rpath/$DEP_BASE $DYLIB_ABS
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
replace_rpath() {
|
replace_rpath() {
|
||||||
FILE=$1
|
FILE=$1
|
||||||
for PTH in $(otool -l $FILE | grep -A2 LC_RPATH | grep path | xargs -J ' ' | cut -d ' ' -f2);
|
for PTH in $(otool -l $FILE | grep -A2 LC_RPATH | grep path | xargs -J ' ' | cut -d ' ' -f2); do
|
||||||
do
|
install_name_tool -delete_rpath $PTH $FILE
|
||||||
install_name_tool -delete_rpath $PTH $FILE
|
done
|
||||||
done
|
install_name_tool -add_rpath @loader_path/../$LIBDIR $FILE
|
||||||
install_name_tool -add_rpath @loader_path/../$LIBDIR $FILE
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CMAKE_ARCHS=
|
CMAKE_ARCHS=
|
||||||
OSSL_FLAGS="-mmacosx-version-min=$DEPLOYMENT_TARGET -I$INSTALL/include -L$INSTALL/lib"
|
OSSL_FLAGS="-mmacosx-version-min=$DEPLOYMENT_TARGET -I$INSTALL/include -L$INSTALL/lib"
|
||||||
for ARCH in $DEPLOYMENT_ARCH;
|
for ARCH in $DEPLOYMENT_ARCH; do
|
||||||
do
|
OSSL_FLAGS="$OSSL_FLAGS -arch $ARCH"
|
||||||
OSSL_FLAGS="$OSSL_FLAGS -arch $ARCH"
|
CMAKE_ARCHS="$ARCH;$CMAKE_ARCHS"
|
||||||
CMAKE_ARCHS="$ARCH;$CMAKE_ARCHS"
|
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "build arch [$DEPLOYMENT_ARCH]"
|
echo "build arch [$DEPLOYMENT_ARCH]"
|
||||||
@ -140,36 +130,33 @@ CMAKE_ARGS="-DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON \
|
|||||||
-DCMAKE_IGNORE_PREFIX_PATH='/opt/local;/usr/local;/opt/homebrew;/Library;~/Library'
|
-DCMAKE_IGNORE_PREFIX_PATH='/opt/local;/usr/local;/opt/homebrew;/Library;~/Library'
|
||||||
"
|
"
|
||||||
|
|
||||||
if [ ! -d $SRC ];
|
if [ ! -d $SRC ]; then
|
||||||
then
|
mkdir -p $SRC
|
||||||
mkdir -p $SRC
|
cd $SRC
|
||||||
cd $SRC
|
git clone --depth 1 -b openssl-3.3.1 https://github.com/openssl/openssl.git
|
||||||
git clone --depth 1 -b openssl-3.3.1 https://github.com/openssl/openssl.git
|
git clone --depth 1 -b v1.3.1 https://github.com/madler/zlib.git
|
||||||
git clone --depth 1 -b v1.3.1 https://github.com/madler/zlib.git
|
git clone --depth 1 -b uriparser-0.9.8 https://github.com/uriparser/uriparser.git
|
||||||
git clone --depth 1 -b uriparser-0.9.8 https://github.com/uriparser/uriparser.git
|
git clone --depth 1 -b v1.7.18 https://github.com/DaveGamble/cJSON.git
|
||||||
git clone --depth 1 -b v1.7.18 https://github.com/DaveGamble/cJSON.git
|
git clone --depth 1 -b release-2.30.4 https://github.com/libsdl-org/SDL.git
|
||||||
git clone --depth 1 -b release-2.30.4 https://github.com/libsdl-org/SDL.git
|
git clone --depth 1 --shallow-submodules --recurse-submodules -b release-2.22.0 https://github.com/libsdl-org/SDL_ttf.git
|
||||||
git clone --depth 1 --shallow-submodules --recurse-submodules -b release-2.22.0 https://github.com/libsdl-org/SDL_ttf.git
|
git clone --depth 1 --shallow-submodules --recurse-submodules -b release-2.8.2 https://github.com/libsdl-org/SDL_image.git
|
||||||
git clone --depth 1 --shallow-submodules --recurse-submodules -b release-2.8.2 https://github.com/libsdl-org/SDL_image.git
|
git clone --depth 1 --shallow-submodules --recurse-submodules -b v1.0.27-1 https://github.com/libusb/libusb-cmake.git
|
||||||
git clone --depth 1 --shallow-submodules --recurse-submodules -b v1.0.27-1 https://github.com/libusb/libusb-cmake.git
|
git clone --depth 1 -b n7.0.1 https://github.com/FFmpeg/FFmpeg.git
|
||||||
git clone --depth 1 -b n7.0.1 https://github.com/FFmpeg/FFmpeg.git
|
git clone --depth 1 -b v2.4.1 https://github.com/cisco/openh264.git
|
||||||
git clone --depth 1 -b v2.4.1 https://github.com/cisco/openh264.git
|
git clone --depth 1 -b v1.5.2 https://gitlab.xiph.org/xiph/opus.git
|
||||||
git clone --depth 1 -b v1.5.2 https://gitlab.xiph.org/xiph/opus.git
|
git clone --depth 1 -b 2.11.1 https://github.com/knik0/faad2.git
|
||||||
git clone --depth 1 -b 2.11.1 https://github.com/knik0/faad2.git
|
git clone --depth 1 -b 1.18.0 https://gitlab.freedesktop.org/cairo/cairo.git
|
||||||
git clone --depth 1 -b 1.18.0 https://gitlab.freedesktop.org/cairo/cairo.git
|
git clone --depth 1 -b 1_30 https://github.com/knik0/faac.git
|
||||||
git clone --depth 1 -b 1_30 https://github.com/knik0/faac.git
|
cd faac
|
||||||
cd faac
|
./bootstrap
|
||||||
./bootstrap
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d $INSTALL ];
|
if [ -d $INSTALL ]; then
|
||||||
then
|
rm -rf $INSTALL
|
||||||
rm -rf $INSTALL
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d $BUILD ];
|
if [ -d $BUILD ]; then
|
||||||
then
|
rm -rf $BUILD
|
||||||
rm -rf $BUILD
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p $BUILD
|
mkdir -p $BUILD
|
||||||
@ -180,7 +167,7 @@ cmake --build zlib
|
|||||||
cmake --install zlib
|
cmake --install zlib
|
||||||
|
|
||||||
cmake -GNinja -Buriparser -S$SRC/uriparser $CMAKE_ARGS -DURIPARSER_BUILD_DOCS=OFF -DURIPARSER_BUILD_TESTS=OFF \
|
cmake -GNinja -Buriparser -S$SRC/uriparser $CMAKE_ARGS -DURIPARSER_BUILD_DOCS=OFF -DURIPARSER_BUILD_TESTS=OFF \
|
||||||
-DURIPARSER_BUILD_TOOLS=OFF
|
-DURIPARSER_BUILD_TOOLS=OFF
|
||||||
cmake --build uriparser
|
cmake --build uriparser
|
||||||
cmake --install uriparser
|
cmake --install uriparser
|
||||||
|
|
||||||
@ -201,7 +188,7 @@ cmake --build SDL
|
|||||||
cmake --install SDL
|
cmake --install SDL
|
||||||
|
|
||||||
cmake -GNinja -BSDL_ttf -S$SRC/SDL_ttf $CMAKE_ARGS -DSDL2TTF_HARFBUZZ=ON -DSDL2TTF_FREETYPE=ON -DSDL2TTF_VENDORED=ON \
|
cmake -GNinja -BSDL_ttf -S$SRC/SDL_ttf $CMAKE_ARGS -DSDL2TTF_HARFBUZZ=ON -DSDL2TTF_FREETYPE=ON -DSDL2TTF_VENDORED=ON \
|
||||||
-DFT_DISABLE_ZLIB=OFF -DSDL2TTF_SAMPLES=OFF
|
-DFT_DISABLE_ZLIB=OFF -DSDL2TTF_SAMPLES=OFF
|
||||||
cmake --build SDL_ttf
|
cmake --build SDL_ttf
|
||||||
cmake --install SDL_ttf
|
cmake --install SDL_ttf
|
||||||
|
|
||||||
@ -210,7 +197,7 @@ cmake --build SDL_image
|
|||||||
cmake --install SDL_image
|
cmake --install SDL_image
|
||||||
|
|
||||||
cmake -GNinja -Blibusb-cmake -S$SRC/libusb-cmake $CMAKE_ARGS -DLIBUSB_BUILD_EXAMPLES=OFF -DLIBUSB_BUILD_TESTING=OFF \
|
cmake -GNinja -Blibusb-cmake -S$SRC/libusb-cmake $CMAKE_ARGS -DLIBUSB_BUILD_EXAMPLES=OFF -DLIBUSB_BUILD_TESTING=OFF \
|
||||||
-DLIBUSB_ENABLE_DEBUG_LOGGING=OFF -DLIBUSB_BUILD_SHARED_LIBS=ON
|
-DLIBUSB_ENABLE_DEBUG_LOGGING=OFF -DLIBUSB_BUILD_SHARED_LIBS=ON
|
||||||
cmake --build libusb-cmake
|
cmake --build libusb-cmake
|
||||||
cmake --install libusb-cmake
|
cmake --install libusb-cmake
|
||||||
|
|
||||||
@ -226,29 +213,28 @@ mkdir -p faac
|
|||||||
cd faac
|
cd faac
|
||||||
# undefine __SSE2__, symbol clashes with universal build
|
# undefine __SSE2__, symbol clashes with universal build
|
||||||
CFLAGS="$OSSL_FLAGS -U__SSE2__" LDFLAGS=$OSSL_FLAGS $SRC/faac/configure --prefix=$INSTALL --libdir="$INSTALL/lib" \
|
CFLAGS="$OSSL_FLAGS -U__SSE2__" LDFLAGS=$OSSL_FLAGS $SRC/faac/configure --prefix=$INSTALL --libdir="$INSTALL/lib" \
|
||||||
--enable-shared --disable-static
|
--enable-shared --disable-static
|
||||||
CFLAGS="$OSSL_FLAGS -U__SSE2__" LDFLAGS=$OSSL_FLAGS make -j
|
CFLAGS="$OSSL_FLAGS -U__SSE2__" LDFLAGS=$OSSL_FLAGS make -j
|
||||||
CFLAGS="$OSSL_FLAGS -U__SSE2__" LDFLAGS=$OSSL_FLAGS make -j install
|
CFLAGS="$OSSL_FLAGS -U__SSE2__" LDFLAGS=$OSSL_FLAGS make -j install
|
||||||
|
|
||||||
cd $BUILD
|
cd $BUILD
|
||||||
|
|
||||||
meson setup --prefix="$INSTALL" -Doptimization=3 -Db_lto=true -Db_pie=true -Dc_args="$OSSL_FLAGS" -Dc_link_args="$OSSL_FLAGS" \
|
meson setup --prefix="$INSTALL" -Doptimization=3 -Db_lto=true -Db_pie=true -Dc_args="$OSSL_FLAGS" -Dc_link_args="$OSSL_FLAGS" \
|
||||||
-Dcpp_args="$OSSL_FLAGS" -Dcpp_link_args="$OSSL_FLAGS" -Dpkgconfig.relocatable=true -Dtests=disabled \
|
-Dcpp_args="$OSSL_FLAGS" -Dcpp_link_args="$OSSL_FLAGS" -Dpkgconfig.relocatable=true -Dtests=disabled \
|
||||||
-Dlibdir=lib openh264 $SRC/openh264
|
-Dlibdir=lib openh264 $SRC/openh264
|
||||||
ninja -C openh264 install
|
ninja -C openh264 install
|
||||||
|
|
||||||
for ARCH in $DEPLOYMENT_ARCH;
|
for ARCH in $DEPLOYMENT_ARCH; do
|
||||||
do
|
mkdir -p $BUILD/FFmpeg/$ARCH
|
||||||
mkdir -p $BUILD/FFmpeg/$ARCH
|
cd $BUILD/FFmpeg/$ARCH
|
||||||
cd $BUILD/FFmpeg/$ARCH
|
FFCFLAGS="-arch $ARCH -mmacosx-version-min=$DEPLOYMENT_TARGET"
|
||||||
FFCFLAGS="-arch $ARCH -mmacosx-version-min=$DEPLOYMENT_TARGET"
|
FINSTPATH=$BUILD/FFmpeg/install/$ARCH
|
||||||
FINSTPATH=$BUILD/FFmpeg/install/$ARCH
|
CFLAGS=$FFCFLAGS LDFLAGS=$FFCFLAGS $SRC/FFmpeg/configure --prefix=$FINSTPATH --disable-all \
|
||||||
CFLAGS=$FFCFLAGS LDFLAGS=$FFCFLAGS $SRC/FFmpeg/configure --prefix=$FINSTPATH --disable-all \
|
--enable-shared --disable-static --enable-swscale --disable-asm --disable-libxcb \
|
||||||
--enable-shared --disable-static --enable-swscale --disable-asm --disable-libxcb \
|
--disable-securetransport --disable-xlib --enable-cross-compile
|
||||||
--disable-securetransport --disable-xlib --enable-cross-compile
|
CFLAGS=$FFCFLAGS LDFLAGS=$FFCFLAGS make -j
|
||||||
CFLAGS=$FFCFLAGS LDFLAGS=$FFCFLAGS make -j
|
CFLAGS=$FFCFLAGS LDFLAGS=$FFCFLAGS make -j install
|
||||||
CFLAGS=$FFCFLAGS LDFLAGS=$FFCFLAGS make -j install
|
fix_rpath "$FINSTPATH/lib"
|
||||||
fix_rpath "$FINSTPATH/lib"
|
|
||||||
done
|
done
|
||||||
|
|
||||||
BASE_ARCH="${DEPLOYMENT_ARCH%% *}"
|
BASE_ARCH="${DEPLOYMENT_ARCH%% *}"
|
||||||
@ -259,37 +245,36 @@ find lib -type l -exec cp -P {} $INSTALL/lib/ \;
|
|||||||
BASE_LIBS=$(find lib -type f -name "*.dylib" -exec basename {} \;)
|
BASE_LIBS=$(find lib -type f -name "*.dylib" -exec basename {} \;)
|
||||||
|
|
||||||
cd $BUILD/FFmpeg/install
|
cd $BUILD/FFmpeg/install
|
||||||
for LIB in $BASE_LIBS;
|
for LIB in $BASE_LIBS; do
|
||||||
do
|
LIBS=$(find . -name $LIB)
|
||||||
LIBS=$(find . -name $LIB)
|
lipo $LIBS -output $INSTALL/lib/$LIB -create
|
||||||
lipo $LIBS -output $INSTALL/lib/$LIB -create
|
|
||||||
done
|
done
|
||||||
|
|
||||||
cd $BUILD
|
cd $BUILD
|
||||||
cmake -GNinja -Bfreerdp -S"$SCRIPT_PATH/.." \
|
cmake -GNinja -Bfreerdp -S"$SCRIPT_PATH/.." \
|
||||||
$CMAKE_ARGS \
|
$CMAKE_ARGS \
|
||||||
-DWITH_PLATFORM_SERVER=OFF \
|
-DWITH_PLATFORM_SERVER=OFF \
|
||||||
-DWITH_SIMD=ON \
|
-DWITH_SIMD=ON \
|
||||||
-DWITH_FFMPEG=OFF \
|
-DWITH_FFMPEG=OFF \
|
||||||
-DWITH_VERBOSE_WINPR_ASSERT=OFF \
|
-DWITH_VERBOSE_WINPR_ASSERT=OFF \
|
||||||
-DWITH_OPENH264=ON \
|
-DWITH_OPENH264=ON \
|
||||||
-DWITH_SWSCALE=ON \
|
-DWITH_SWSCALE=ON \
|
||||||
-DWITH_OPUS=ON \
|
-DWITH_OPUS=ON \
|
||||||
-DWITH_WEBVIEW=OFF \
|
-DWITH_WEBVIEW=OFF \
|
||||||
-DWITH_FAAD2=ON \
|
-DWITH_FAAD2=ON \
|
||||||
-DWITH_FAAC=ON \
|
-DWITH_FAAC=ON \
|
||||||
-DWITH_INTERNAL_RC4=ON \
|
-DWITH_INTERNAL_RC4=ON \
|
||||||
-DWITH_INTERNAL_MD4=ON \
|
-DWITH_INTERNAL_MD4=ON \
|
||||||
-DWITH_INTERNAL_MD5=ON \
|
-DWITH_INTERNAL_MD5=ON \
|
||||||
-DCHANNEL_RDPEAR=OFF \
|
-DCHANNEL_RDPEAR=OFF \
|
||||||
-DWITH_CJSON_REQUIRED=ON
|
-DWITH_CJSON_REQUIRED=ON
|
||||||
|
|
||||||
cmake --build freerdp
|
cmake --build freerdp
|
||||||
cmake --install freerdp
|
cmake --install freerdp
|
||||||
|
|
||||||
# remove unused stuff from bin
|
# remove unused stuff from bin
|
||||||
find "$INSTALL" -name "*.a" -exec rm -f {} \;
|
find "$INSTALL" -name "*.a" -exec rm -f {} \;
|
||||||
find "$INSTALL" -name "*.la" -exec rm -f {} \;
|
find "$INSTALL" -name "*.la" -exec rm -f {} \;
|
||||||
find "$INSTALL" -name sdl2-config -exec rm -f {} \;
|
find "$INSTALL" -name sdl2-config -exec rm -f {} \;
|
||||||
|
|
||||||
fix_rpath "$INSTALL/lib"
|
fix_rpath "$INSTALL/lib"
|
||||||
@ -301,14 +286,12 @@ mv lib $LIBDIR
|
|||||||
mv bin $BINDIR
|
mv bin $BINDIR
|
||||||
|
|
||||||
# update RPATH
|
# update RPATH
|
||||||
for LIB in $(find $LIBDIR -type f -name "*.dylib");
|
for LIB in $(find $LIBDIR -type f -name "*.dylib"); do
|
||||||
do
|
replace_rpath $LIB
|
||||||
replace_rpath $LIB
|
|
||||||
done
|
done
|
||||||
|
|
||||||
for BIN in $(find $BINDIR -type f);
|
for BIN in $(find $BINDIR -type f); do
|
||||||
do
|
replace_rpath $BIN
|
||||||
replace_rpath $BIN
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# clean up unused data
|
# clean up unused data
|
||||||
|
@ -6,38 +6,32 @@ SRC_PATH="${SCRIPT_PATH}/.."
|
|||||||
|
|
||||||
FORMAT_ARG="--check"
|
FORMAT_ARG="--check"
|
||||||
REST_ARGS=$@
|
REST_ARGS=$@
|
||||||
if [ $# -ne 0 ]
|
if [ $# -ne 0 ]; then
|
||||||
then
|
if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
|
||||||
if [ "$1" = "--help" ] || [ "$1" = "-h" ];
|
echo "usage: $0 [options] [file, file, ...]"
|
||||||
then
|
echo "\t--check.-c ... run format check only, no files changed (default)"
|
||||||
echo "usage: $0 [options] [file, file, ...]"
|
echo "\t--format,-f ... format files in place"
|
||||||
echo "\t--check.-c ... run format check only, no files changed (default)"
|
echo "\t--help,-h ... print this help"
|
||||||
echo "\t--format,-f ... format files in place"
|
|
||||||
echo "\t--help,-h ... print this help"
|
|
||||||
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$1" = "--check" ] || [ "$1" = "-c" ];
|
if [ "$1" = "--check" ] || [ "$1" = "-c" ]; then
|
||||||
then
|
FORMAT_ARG="--check"
|
||||||
FORMAT_ARG="--check"
|
REST_ARGS="${@:2}"
|
||||||
REST_ARGS="${@:2}"
|
fi
|
||||||
fi
|
if [ "$1" = "--format" ] || [ "$1" = "-f" ]; then
|
||||||
if [ "$1" = "--format" ] || [ "$1" = "-f" ];
|
FORMAT_ARG="-i"
|
||||||
then
|
REST_ARGS="${@:2}"
|
||||||
FORMAT_ARG="-i"
|
fi
|
||||||
REST_ARGS="${@:2}"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -n "$REST_ARGS" ];
|
if [ ! -n "$REST_ARGS" ]; then
|
||||||
then
|
CMAKE_FILES=$(find ${SRC_PATH} -name "*.cmake" -o -name "CMakeLists.txt")
|
||||||
CMAKE_FILES=$(find ${SRC_PATH} -name "*.cmake" -o -name "CMakeLists.txt")
|
CMAKE_CI_FILES=$(find ${SRC_PATH}/ci -name "*.txt")
|
||||||
CMAKE_CI_FILES=$(find ${SRC_PATH}/ci -name "*.txt")
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for FILE in $CMAKE_FILES $CMAKE_CI_FILES $REST_ARGS;
|
for FILE in $CMAKE_FILES $CMAKE_CI_FILES $REST_ARGS; do
|
||||||
do
|
echo "processing file $FILE..."
|
||||||
echo "processing file $FILE..."
|
cmake-format -c "$SCRIPT_PATH/cmake-format.yml" $FORMAT_ARG $FILE
|
||||||
cmake-format -c "$SCRIPT_PATH/cmake-format.yml" $FORMAT_ARG $FILE
|
|
||||||
done
|
done
|
||||||
|
@ -10,7 +10,7 @@ SCRIPT_PATH=$(realpath "$SCRIPT_PATH")
|
|||||||
# 3. Every word prefixed by e.g. '\tSome text', e.g. format string escapes
|
# 3. Every word prefixed by e.g. '\tSome text', e.g. format string escapes
|
||||||
codespell --version
|
codespell --version
|
||||||
codespell \
|
codespell \
|
||||||
-I "$SCRIPT_PATH/codespell.ignore" \
|
-I "$SCRIPT_PATH/codespell.ignore" \
|
||||||
-S ".git,*.ai,*.svg,*.rtf,*/assets/de_*,*/res/values-*,*/protocols/xdg*,*/test/*" \
|
-S ".git,*.ai,*.svg,*.rtf,*/assets/de_*,*/res/values-*,*/protocols/xdg*,*/test/*" \
|
||||||
--ignore-regex "\b[a-zA-Z][a-zA-Z]\b|\bp[A-Z].*|\\\\[a-z][a-zA-Z].*" \
|
--ignore-regex "\b[a-zA-Z][a-zA-Z]\b|\bp[A-Z].*|\\\\[a-z][a-zA-Z].*" \
|
||||||
--count $SCRIPT_PATH/..
|
--count $SCRIPT_PATH/..
|
||||||
|
@ -1,55 +1,56 @@
|
|||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
function run {
|
function run {
|
||||||
"$@"
|
"$@"
|
||||||
RES=$?
|
RES=$?
|
||||||
if [[ $RES -ne 0 ]];
|
if [[ $RES -ne 0 ]]; then
|
||||||
then
|
echo "[ERROR] $@ returned $RES" >&2
|
||||||
echo "[ERROR] $@ returned $RES" >&2
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -z ${TAG:-} ];then
|
if [ -z ${TAG:-} ]; then
|
||||||
echo "No TAG set - trying to detect"
|
echo "No TAG set - trying to detect"
|
||||||
TAG=$(git describe --tags)
|
TAG=$(git describe --tags)
|
||||||
echo "Is the TAG ${TAG} ok (YES|NO)?"
|
echo "Is the TAG ${TAG} ok (YES|NO)?"
|
||||||
read answ
|
read answ
|
||||||
case "$answ" in
|
case "$answ" in
|
||||||
YES):
|
YES)
|
||||||
;;
|
:
|
||||||
*)
|
;;
|
||||||
echo 'stopping here'
|
*)
|
||||||
exit 1
|
echo 'stopping here'
|
||||||
esac
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
function create_hash {
|
function create_hash {
|
||||||
NAME=$1
|
NAME=$1
|
||||||
run md5sum ${NAME} > ${NAME}.md5
|
run md5sum ${NAME} >${NAME}.md5
|
||||||
run sha1sum ${NAME} > ${NAME}.sha1
|
run sha1sum ${NAME} >${NAME}.sha1
|
||||||
run sha256sum ${NAME} > ${NAME}.sha256
|
run sha256sum ${NAME} >${NAME}.sha256
|
||||||
run sha512sum ${NAME} > ${NAME}.sha512
|
run sha512sum ${NAME} >${NAME}.sha512
|
||||||
}
|
}
|
||||||
|
|
||||||
function create_tar {
|
function create_tar {
|
||||||
ARGS=$1
|
ARGS=$1
|
||||||
EXT=$2
|
EXT=$2
|
||||||
TAG=$3
|
TAG=$3
|
||||||
|
|
||||||
NAME=freerdp-${TAG}${EXT}
|
NAME=freerdp-${TAG}${EXT}
|
||||||
run tar $ARGS ${NAME} freerdp-${TAG}
|
run tar $ARGS ${NAME} freerdp-${TAG}
|
||||||
create_hash ${NAME}
|
create_hash ${NAME}
|
||||||
}
|
}
|
||||||
|
|
||||||
TMPDIR=$(mktemp -d -t release-${TAG}-XXXXXXXXXX)
|
TMPDIR=$(mktemp -d -t release-${TAG}-XXXXXXXXXX)
|
||||||
|
|
||||||
run git archive --prefix=freerdp-${TAG}/ --format=tar.gz -o ${TMPDIR}/freerdp-${TAG}.tar.gz ${TAG}
|
run git archive --prefix=freerdp-${TAG}/ --format=tar.gz -o ${TMPDIR}/freerdp-${TAG}.tar.gz ${TAG}
|
||||||
run tar xzvf ${TMPDIR}/freerdp-${TAG}.tar.gz -C ${TMPDIR}
|
run tar xzvf ${TMPDIR}/freerdp-${TAG}.tar.gz -C ${TMPDIR}
|
||||||
run echo ${TAG} > ${TMPDIR}/freerdp-${TAG}/.source_version
|
run echo ${TAG} >${TMPDIR}/freerdp-${TAG}/.source_version
|
||||||
|
|
||||||
pushd .
|
pushd .
|
||||||
cd $TMPDIR
|
cd $TMPDIR
|
||||||
create_tar czf .tar.gz ${TAG}
|
create_tar czf .tar.gz ${TAG}
|
||||||
create_tar cvjSf .tar.bz2 ${TAG}
|
create_tar cvjSf .tar.bz2 ${TAG}
|
||||||
create_tar cfJ .tar.xz ${TAG}
|
create_tar cfJ .tar.xz ${TAG}
|
||||||
@ -60,9 +61,8 @@ create_hash ${ZIPNAME}
|
|||||||
popd
|
popd
|
||||||
|
|
||||||
# Sign the release tarballs
|
# Sign the release tarballs
|
||||||
for EXT in tar.gz tar.bz2 tar.xz zip;
|
for EXT in tar.gz tar.bz2 tar.xz zip; do
|
||||||
do
|
run gpg --local-user 0xA49454A3FC909FD5 --sign --armor --output ${TMPDIR}/freerdp-${TAG}.${EXT}.asc --detach-sig ${TMPDIR}/freerdp-${TAG}.${EXT}
|
||||||
run gpg --local-user 0xA49454A3FC909FD5 --sign --armor --output ${TMPDIR}/freerdp-${TAG}.${EXT}.asc --detach-sig ${TMPDIR}/freerdp-${TAG}.${EXT}
|
|
||||||
done
|
done
|
||||||
|
|
||||||
run mv ${TMPDIR}/freerdp-${TAG}.tar* .
|
run mv ${TMPDIR}/freerdp-${TAG}.tar* .
|
||||||
@ -70,9 +70,8 @@ run mv ${TMPDIR}/freerdp-${TAG}.zip* .
|
|||||||
run rm -rf ${TMPDIR}
|
run rm -rf ${TMPDIR}
|
||||||
|
|
||||||
# Verify the release tarball signatures
|
# Verify the release tarball signatures
|
||||||
for EXT in tar.gz tar.bz2 tar.xz zip;
|
for EXT in tar.gz tar.bz2 tar.xz zip; do
|
||||||
do
|
run gpg --verify freerdp-${TAG}.${EXT}.asc
|
||||||
run gpg --verify freerdp-${TAG}.${EXT}.asc
|
|
||||||
done
|
done
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -16,59 +16,59 @@ BUILDTYPE=-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:Debug}"
|
|||||||
MANPAGES=-DWITH_MANPAGES="${WITHMANPAGES:NO}"
|
MANPAGES=-DWITH_MANPAGES="${WITHMANPAGES:NO}"
|
||||||
|
|
||||||
# Run cmake for FreeRDP and MacFreeRDP
|
# Run cmake for FreeRDP and MacFreeRDP
|
||||||
mkdir ${XCODE_PROJ_DIR} >/dev/null 2>&1
|
mkdir ${XCODE_PROJ_DIR} >/dev/null 2>&1
|
||||||
pushd ${XCODE_PROJ_DIR}
|
pushd ${XCODE_PROJ_DIR}
|
||||||
cmake ${BUILDTYPE} -G "$GEN" ${ARCH} ../
|
cmake ${BUILDTYPE} -G "$GEN" ${ARCH} ../
|
||||||
popd
|
popd
|
||||||
mkdir ${CLIENT_MAC_DIR}/${XCODE_PROJ_DIR} >/dev/null 2>&1
|
mkdir ${CLIENT_MAC_DIR}/${XCODE_PROJ_DIR} >/dev/null 2>&1
|
||||||
pushd ${CLIENT_MAC_DIR}/${XCODE_PROJ_DIR}
|
pushd ${CLIENT_MAC_DIR}/${XCODE_PROJ_DIR}
|
||||||
cmake ${BUILDTYPE} -G "$GEN" ${ARCH} ../
|
cmake ${BUILDTYPE} -G "$GEN" ${ARCH} ../
|
||||||
popd
|
popd
|
||||||
|
|
||||||
# Check for errors; otherwise, ask for compile.
|
# Check for errors; otherwise, ask for compile.
|
||||||
if [ "$?" -ne 0 ]; then
|
if [ "$?" -ne 0 ]; then
|
||||||
echo "CMake failed. Please check error messages"
|
echo "CMake failed. Please check error messages"
|
||||||
popd > /dev/null
|
popd >/dev/null
|
||||||
exit
|
exit
|
||||||
else
|
else
|
||||||
popd
|
popd
|
||||||
while true
|
while true; do
|
||||||
do
|
echo -n "Compile FreeRDP? (y or n) - (y recommended for MacFreeRDP compilation):"
|
||||||
echo -n "Compile FreeRDP? (y or n) - (y recommended for MacFreeRDP compilation):"
|
read CONFIRM
|
||||||
read CONFIRM
|
case $CONFIRM in
|
||||||
case $CONFIRM in
|
y | Y | YES | yes | Yes)
|
||||||
y|Y|YES|yes|Yes)
|
pushd ./${XCODE_PROJ_DIR}
|
||||||
pushd ./${XCODE_PROJ_DIR}
|
xcodebuild
|
||||||
xcodebuild
|
popd
|
||||||
popd
|
break
|
||||||
break ;;
|
;;
|
||||||
n|N|no|NO|No)
|
n | N | no | NO | No)
|
||||||
echo OK - you entered $CONFIRM
|
echo OK - you entered $CONFIRM
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
*) echo Please enter only y or n
|
*) echo Please enter only y or n ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "SUCCESS!"
|
|
||||||
while true
|
|
||||||
do
|
|
||||||
echo -n "Open Xcode projects now? (y or n):"
|
|
||||||
read CONFIRM
|
|
||||||
case $CONFIRM in
|
|
||||||
y|Y|YES|yes|Yes)
|
|
||||||
open ${CLIENT_MAC_DIR}/${XCODE_PROJ_DIR}/MacFreeRDP.xcodeproj
|
|
||||||
open ./${XCODE_PROJ_DIR}/FreeRDP.xcodeproj
|
|
||||||
break ;;
|
|
||||||
n|N|no|NO|No)
|
|
||||||
echo OK - $CONFIRM
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
*) echo Please enter only y or n
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
echo -n "NOTE: Dragging FreeRDP project from finder onto the MacFreeRDP project in Xcode
|
echo "SUCCESS!"
|
||||||
|
while true; do
|
||||||
|
echo -n "Open Xcode projects now? (y or n):"
|
||||||
|
read CONFIRM
|
||||||
|
case $CONFIRM in
|
||||||
|
y | Y | YES | yes | Yes)
|
||||||
|
open ${CLIENT_MAC_DIR}/${XCODE_PROJ_DIR}/MacFreeRDP.xcodeproj
|
||||||
|
open ./${XCODE_PROJ_DIR}/FreeRDP.xcodeproj
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
n | N | no | NO | No)
|
||||||
|
echo OK - $CONFIRM
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
*) echo Please enter only y or n ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
echo -n "NOTE: Dragging FreeRDP project from finder onto the MacFreeRDP project in Xcode
|
||||||
will enable code stepping from MacFreeRDP into FreeRDP.
|
will enable code stepping from MacFreeRDP into FreeRDP.
|
||||||
"
|
"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user