From dd7cdaefc00181d1e17c8fa226066386fb18bdf1 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Tue, 25 Feb 2025 13:24:46 +0100 Subject: [PATCH 1/6] [scripts] add bash format script Add a script to format all bash scripts in the repo --- scripts/bash-format.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 scripts/bash-format.sh diff --git a/scripts/bash-format.sh b/scripts/bash-format.sh new file mode 100755 index 000000000..3e8a6312c --- /dev/null +++ b/scripts/bash-format.sh @@ -0,0 +1,33 @@ +#!/bin/bash -e +# + +SCRIPT_PATH=$(dirname "${BASH_SOURCE[0]}") +SCRIPT_PATH=$(realpath "$SCRIPT_PATH") +SRC_PATH="${SCRIPT_PATH}/.." + +if [ $# -ne 0 ]; then + if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then + echo "usage: $0 [options]" + echo "\t--check.-c ... run format check only, no files changed (default)" + echo "\t--format,-f ... format files in place" + echo "\t--help,-h ... print this help" + + exit 1 + fi + + if [ "$1" = "--check" ] || [ "$1" = "-c" ]; then + FORMAT_ARG="" + REST_ARGS="${@:2}" + fi + if [ "$1" = "--format" ] || [ "$1" = "-f" ]; then + FORMAT_ARG="-w" + REST_ARGS="${@:2}" + fi +fi + + +SCRIPTS=$(find ${SRC_PATH} -name "*.sh" -not -path "${SRC_PATH}/.git/*") +for script in $SCRIPTS; do + echo $script + shfmt -i 2 $FORMAT_ARG $script +done From e0ccda667ecdde0306aee03d05061bc353f85dab Mon Sep 17 00:00:00 2001 From: akallabeth Date: Tue, 25 Feb 2025 13:30:43 +0100 Subject: [PATCH 2/6] [ci] add workflows for bash and cmake formatters --- .github/workflows/bash-format.yml | 26 ++++++++++++++++++++++++++ .github/workflows/cmake-format.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 .github/workflows/bash-format.yml create mode 100644 .github/workflows/cmake-format.sh diff --git a/.github/workflows/bash-format.yml b/.github/workflows/bash-format.yml new file mode 100644 index 000000000..6a204e66f --- /dev/null +++ b/.github/workflows/bash-format.yml @@ -0,0 +1,26 @@ +name: bash-format +on: + workflow_dispatch: + branches: [ master, stable* ] + pull_request: + branches: [ master, stable* ] + schedule: + - cron: '30 4 * * SUN' + +jobs: + build: + runs-on: ubuntu-latest + name: "bash-format" + steps: + - name: "Check out source" + uses: actions/checkout@v4 + + - name: "Prepare environment" + run: | + sudo apt-get update -q -y + sudo apt-get install -q -y \ + shfmt + + - name: "Run shfmt..." + run: | + ./scripts/bash-format.sh diff --git a/.github/workflows/cmake-format.sh b/.github/workflows/cmake-format.sh new file mode 100644 index 000000000..1322e0439 --- /dev/null +++ b/.github/workflows/cmake-format.sh @@ -0,0 +1,26 @@ +name: cmake-format +on: + workflow_dispatch: + branches: [ master, stable* ] + pull_request: + branches: [ master, stable* ] + schedule: + - cron: '30 4 * * SUN' + +jobs: + build: + runs-on: ubuntu-latest + name: "cmake-format" + steps: + - name: "Check out source" + uses: actions/checkout@v4 + + - name: "Prepare environment" + run: | + sudo apt-get update -q -y + sudo apt-get install -q -y \ + cmake-format + + - name: "Run shfmt..." + run: | + ./scripts/cmake-format.sh From 418d228d4b494e8a563666d08462496b7e37a136 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Tue, 25 Feb 2025 09:28:16 +0100 Subject: [PATCH 3/6] [ci,mingw] update build scripts * update dependency versions * replace SDL2 with SDL3 client * update documentation * add option to do fully static builds * format script with shfmt -i 2 w scripts/mingw.sh --- docs/README.mingw | 6 + scripts/mingw.sh | 344 +++++++++++++++++++++++++--------------------- 2 files changed, 194 insertions(+), 156 deletions(-) diff --git a/docs/README.mingw b/docs/README.mingw index 4c4c55b74..d7c647d0d 100644 --- a/docs/README.mingw +++ b/docs/README.mingw @@ -3,6 +3,12 @@ Overview More documentation might be found at https://github.com/FreeRDP/FreeRDP/wiki/Compilation +A sample build script is part of the repository at scripts/mingw.sh +It is periodically run as part of the https://github.com/FreeRDP/FreeRDP/actions/workflows/mingw.yml workflow. + +If you want to do your own build, check the script and the dependency versions checked out (we only use it for the ci builder, +so updates are not always done in a timely fashion) + FreeRDP can be built for Windows using llvm-mingw (https://github.com/mstorsjo/llvm-mingw) with both msvcrt and ucrt. MinGW builds are not actively maintained at the moment and every once in a while the build process may stop working. Pull requests to maintain MinGW support are always welcome. diff --git a/scripts/mingw.sh b/scripts/mingw.sh index c6abb3f05..24fe97ad3 100755 --- a/scripts/mingw.sh +++ b/scripts/mingw.sh @@ -1,10 +1,10 @@ #!/bin/bash -xe # -# mingw build script +# mingw build script # # TODO: Replace with CMake FetchContent # https://cmake.org/cmake/help/latest/module/FetchContent.html -# +# SCRIPT_PATH=$(dirname "${BASH_SOURCE[0]}") SCRIPT_PATH=$(realpath "$SCRIPT_PATH") @@ -16,193 +16,225 @@ CLONE=1 DEPS=1 BUILD=1 FFMPEG=0 +OPENH264=0 -for i in "$@" -do -case $i in - -b|--no-build) +ARG_SHARED=1 +CMAKE_DEFAULT_FLAGS="" +ARG_SHARED_MESON="-Ddefault_library=shared" +ARG_SHARED_FFMPEG="--disable-static --enable-shared" +for i in "$@"; do + case $i in + -b | --no-build) BUILD=0 ;; - -d|--no-deps) - DEPS=0 - ;; - -c|--no-clone) + -c | --no-clone) CLONE=0 ;; - -f|--with-ffmpeg) + -d | --no-deps) + DEPS=0 + ;; + -f | --with-ffmpeg) FFMPEG=1 ;; - *) - # unknown option - echo "unknown option, quit" - echo "$0 [-d|--no-deps] [-c|--no-clone]" - exit 1 + -o | --with-openh264) + OPENH264=1 ;; -esac + -s | --static) + ARG_SHARED=0 + CMAKE_DEFAULT_FLAGS="-static -static-libgcc -static-libstdc++" + ARG_SHARED_MESON="-Ddefault_library=static" + ARG_SHARED_FFMPEG="" + ;; + *) + # unknown option + echo "unknown option '$i', quit" + echo "usage:\n\t$0 [-b|--no-build] [-c|--no-clone] [-d|--no-deps] [-f|--with-ffmpeg] [-o|--with-openh264] [-s|--static]" + exit 1 + ;; + esac done -function do_clone { - version=$1 - url=$2 - dir=$3 +ARG_COMPILED_RES=1 +if [ $ARG_SHARED -ne 0 ]; then + ARG_COMPILED_RES=0 +fi - if [ -d "$dir" ]; - then - ( - cd "$dir" - git fetch --all - git clean -xdf - git reset --hard $version - git checkout $version - git submodule update --init --recursive - ) - else - git clone --depth 1 --shallow-submodules --recurse-submodules -b $version $url $dir - fi +function do_clone { + version=$1 + url=$2 + dir=$3 + + if [ -d "$dir" ]; then + ( + cd "$dir" + git fetch --all + git clean -xdf + git reset --hard $version + git checkout $version + git submodule update --init --recursive + ) + else + git clone --depth 1 --shallow-submodules --recurse-submodules -b $version $url $dir + fi } function do_cmake_build { - cmake \ - -GNinja \ - -DCMAKE_TOOLCHAIN_FILE="$SCRIPT_PATH/mingw64.cmake" \ - -DCMAKE_PREFIX_PATH="$INSTALL_BASE/lib/cmake;$INSTALL_BASE/lib;$INSTALL_BASE" \ - -DCMAKE_MODULE_PATH="$INSTALL_BASE/lib/cmake;$INSTALL_BASE/lib;$INSTALL_BASE" \ - -DCMAKE_INSTALL_PREFIX="$INSTALL_BASE" \ - -B "$1" \ - ${@:2} - cmake --build "$1" - cmake --install "$1" + cmake \ + -GNinja \ + -DCMAKE_TOOLCHAIN_FILE="$SCRIPT_PATH/mingw64.cmake" \ + -DCMAKE_PREFIX_PATH="$INSTALL_BASE/lib/cmake;$INSTALL_BASE/lib;$INSTALL_BASE" \ + -DCMAKE_MODULE_PATH="$INSTALL_BASE/lib/cmake;$INSTALL_BASE/lib;$INSTALL_BASE" \ + -DCMAKE_INSTALL_PREFIX="$INSTALL_BASE" \ + -DBUILD_SHARED_LIBS=$ARG_SHARED \ + -DCMAKE_INTERPROZEDURAL_OPTIMIZATION=OFF \ + -DCMAKE_EXE_LINKER_FLAGS="$CMAKE_DEFAULT_FLAGS" \ + -B "$1" \ + ${@:2} + cmake --build "$1" + cmake --install "$1" } mkdir -p "$SRC_BASE" mkdir -p "$BUILD_BASE" cd "$SRC_BASE" -if [ $CLONE -ne 0 ]; -then - do_clone v1.3.1 https://github.com/madler/zlib.git zlib - do_clone uriparser-0.9.7 https://github.com/uriparser/uriparser.git uriparser - do_clone v1.7.17 https://github.com/DaveGamble/cJSON.git cJSON - do_clone release-2.30.0 https://github.com/libsdl-org/SDL.git SDL - if [ $FFMPEG -ne 0 ]; - then - do_clone n6.1.1 https://github.com/FFmpeg/FFmpeg.git FFmpeg - fi - do_clone v2.4.1 https://github.com/cisco/openh264.git openh264 - do_clone v1.0.27 https://github.com/libusb/libusb-cmake.git libusb-cmake - do_clone release-2.8.2 https://github.com/libsdl-org/SDL_image.git SDL_image - do_clone release-2.22.0 https://github.com/libsdl-org/SDL_ttf.git SDL_ttf - do_clone v3.8.2 https://github.com/libressl/portable.git libressl - ( - cd libressl - ./update.sh - ) +if [ $CLONE -ne 0 ]; then + do_clone v1.3.1 https://github.com/madler/zlib.git zlib + do_clone uriparser-0.9.8 https://github.com/uriparser/uriparser.git uriparser + do_clone v1.7.18 https://github.com/DaveGamble/cJSON.git cJSON + do_clone release-3.2.4 https://github.com/libsdl-org/SDL.git SDL + if [ $FFMPEG -ne 0 ]; then + do_clone n7.1 https://github.com/FFmpeg/FFmpeg.git FFmpeg + fi + if [ $OPENH264 -ne 0 ]; then + do_clone v2.6.0 https://github.com/cisco/openh264.git openh264 + fi + do_clone v1.0.27-1 https://github.com/libusb/libusb-cmake.git libusb-cmake + do_clone release-3.2.0 https://github.com/libsdl-org/SDL_image.git SDL_image + do_clone prerelease-3.1.2 https://github.com/libsdl-org/SDL_ttf.git SDL_ttf + do_clone v3.9.2 https://github.com/libressl/portable.git libressl + ( + cd libressl + ./update.sh + ) fi -if [ $BUILD -eq 0 ]; -then - exit 0 +if [ $BUILD -eq 0 ]; then + exit 0 fi -if [ $DEPS -ne 0 ]; -then - do_cmake_build \ - "$BUILD_BASE/libressl" \ - -S libressl \ - -DLIBRESSL_APPS=OFF \ - -DLIBRESSL_TESTS=OFF +if [ $DEPS -ne 0 ]; then + do_cmake_build \ + "$BUILD_BASE/libressl" \ + -S libressl \ + -DLIBRESSL_APPS=OFF \ + -DLIBRESSL_TESTS=OFF - do_cmake_build \ - "$BUILD_BASE/zlib" \ - -S zlib + do_cmake_build \ + "$BUILD_BASE/zlib" \ + -S zlib \ + -DZLIB_BUILD_EXAMPLES=OFF - do_cmake_build \ - "$BUILD_BASE/uriparser" \ - -S uriparser \ - -DURIPARSER_BUILD_DOCS=OFF \ - -DURIPARSER_BUILD_TESTS=OFF + do_cmake_build \ + "$BUILD_BASE/uriparser" \ + -S uriparser \ + -DURIPARSER_BUILD_TOOLS=OFF \ + -DURIPARSER_BUILD_DOCS=OFF \ + -DURIPARSER_BUILD_TESTS=OFF - do_cmake_build \ - "$BUILD_BASE/cJSON" \ - -S cJSON \ - -DENABLE_CJSON_TEST=OFF \ - -DBUILD_SHARED_AND_STATIC_LIBS=ON + do_cmake_build \ + "$BUILD_BASE/cJSON" \ + -S cJSON \ + -DENABLE_CJSON_TEST=OFF \ + -DENABLE_CUSTOM_COMPILER_FLAGS=OFF \ + -DENABLE_HIDDEN_SYMBOLS=ON \ + -DBUILD_SHARED_AND_STATIC_LIBS=OFF \ + -DCJSON_BUILD_SHARED_LIBS=$ARG_SHARED - do_cmake_build \ - "$BUILD_BASE/SDL" \ - -S SDL \ - -DSDL_TEST=OFF \ - -DSDL_TESTS=OFF \ - -DSDL_STATIC_PIC=ON + do_cmake_build \ + "$BUILD_BASE/SDL" \ + -S SDL \ + -DSDL_TEST=OFF \ + -DSDL_TESTS=OFF \ + -DSDL_STATIC_PIC=ON - do_cmake_build \ - "$BUILD_BASE/SDL_ttf" \ - -S SDL_ttf \ - -DSDL2TTF_HARFBUZZ=ON \ - -DSDL2TTF_FREETYPE=ON \ - -DSDL2TTF_VENDORED=ON \ - -DFT_DISABLE_ZLIB=OFF \ - -DSDL2TTF_SAMPLES=OFF + do_cmake_build \ + "$BUILD_BASE/SDL_ttf" \ + -S SDL_ttf \ + -DSDLTTF_HARFBUZZ=ON \ + -DSDLTTF_FREETYPE=ON \ + -DSDLTTF_VENDORED=ON \ + -DFT_DISABLE_ZLIB=OFF \ + -DSDLTTF_SAMPLES=OFF \ + -DSDLTTF_PLUTOSVG=OFF - do_cmake_build \ - "$BUILD_BASE/SDL_image" \ - -S SDL_image \ - -DSDL2IMAGE_SAMPLES=OFF \ - -DSDL2IMAGE_DEPS_SHARED=OFF + do_cmake_build \ + "$BUILD_BASE/SDL_image" \ + -S SDL_image \ + -DSDLIMAGE_SAMPLES=OFF \ + -DSDLIMAGE_DEPS_SHARED=OFF - do_cmake_build \ - "$BUILD_BASE/libusb-cmake" \ - -S libusb-cmake \ - -DLIBUSB_BUILD_EXAMPLES=OFF \ - -DLIBUSB_BUILD_TESTING=OFF \ - -DLIBUSB_ENABLE_DEBUG_LOGGING=OFF + do_cmake_build \ + "$BUILD_BASE/libusb-cmake" \ + -S libusb-cmake \ + -DLIBUSB_BUILD_EXAMPLES=OFF \ + -DLIBUSB_BUILD_TESTING=OFF \ + -DLIBUSB_ENABLE_DEBUG_LOGGING=OFF - # TODO: This takes ages to compile, disable - if [ $FFMPEG -ne 0 ]; - then - ( - cd "$BUILD_BASE" - mkdir -p FFmpeg - cd FFmpeg - "$SRC_BASE/FFmpeg/configure" \ - --arch=x86_64 \ - --target-os=mingw64 \ - --cross-prefix=x86_64-w64-mingw32- \ - --prefix="$INSTALL_BASE" - make -j - make -j install - ) - fi + # TODO: This takes ages to compile, disable + if [ $FFMPEG -ne 0 ]; then + ( + cd "$BUILD_BASE" + mkdir -p FFmpeg + cd FFmpeg + "$SRC_BASE/FFmpeg/configure" \ + --arch=x86_64 \ + --target-os=mingw64 \ + --cross-prefix=x86_64-w64-mingw32- \ + --disable-programs \ + --disable-doc \ + --prefix="$INSTALL_BASE" $ARG_SHARED_FFMPEG + make -j + make -j install + ) + fi - meson setup --cross-file "$SCRIPT_PATH/mingw-meson.conf" \ - -Dprefix="$INSTALL_BASE" \ - -Db_pie=true \ - -Db_lto=true \ - -Dbuildtype=release \ - -Dtests=disabled \ - -Ddefault_library=both \ - "$BUILD_BASE/openh264" \ - openh264 - ninja -C "$BUILD_BASE/openh264" - ninja -C "$BUILD_BASE/openh264" install + if [ $OPENH264 -ne 0 ]; then + ( + meson setup --cross-file "$SCRIPT_PATH/mingw-meson.conf" \ + -Dprefix="$INSTALL_BASE" \ + -Db_pie=true \ + -Db_lto=true \ + -Dbuildtype=release \ + -Dtests=disabled \ + $ARG_SHARED_MESON \ + -Dcpp_link_args="$CMAKE_DEFAULT_FLAGS" \ + -Dcpp_args="$CMAKE_DEFAULT_FLAGS" \ + "$BUILD_BASE/openh264" \ + openh264 + ninja -C "$BUILD_BASE/openh264" + ninja -C "$BUILD_BASE/openh264" install + ) + fi fi do_cmake_build \ - "$BUILD_BASE/freerdp" \ - -S "$SCRIPT_PATH/.." \ - -DWITH_SERVER=ON \ - -DWITH_SHADOW=OFF \ - -DWITH_PLATFORM_SERVER=OFF \ - -DWITH_SAMPLE=ON \ - -DWITH_PLATFORM_SERVER=OFF \ - -DUSE_UNWIND=OFF \ - -DSDL_USE_COMPILED_RESOURCES=OFF \ - -DWITH_SWSCALE=OFF \ - -DWITH_FFMPEG=OFF \ - -DWITH_SIMD=ON \ - -DWITH_OPENH264=ON \ - -DWITH_WEBVIEW=OFF \ - -DWITH_LIBRESSL=ON \ - -DWITH_MANPAGES=OFF \ - -DZLIB_INCLUDE_DIR="$INSTALL_BASE/include" \ - -DZLIB_LIBRARY="$INSTALL_BASE/lib/libzlibstatic.a" + "$BUILD_BASE/freerdp" \ + -S "$SCRIPT_PATH/.." \ + -DWITH_SERVER=ON \ + -DWITH_SHADOW=OFF \ + -DWITH_PLATFORM_SERVER=OFF \ + -DWITH_SAMPLE=ON \ + -DWITH_PLATFORM_SERVER=OFF \ + -DUSE_UNWIND=OFF \ + -DSDL_USE_COMPILED_RESOURCES=$ARG_COMPILED_RES \ + -DWITH_SDL_IMAGE_DIALOGS=ON \ + -DWITH_SDL_LINK_SHARED=$ARG_SHARED \ + -DWITH_CLIENT_SDL2=OFF \ + -DWITH_SWSCALE=$FFMPEG \ + -DWITH_FFMPEG=$FFMPEG \ + -DWITH_SIMD=ON \ + -DWITH_OPENH264=$OPENH264 \ + -DWITH_WEBVIEW=OFF \ + -DWITH_LIBRESSL=ON \ + -DWITH_MANPAGES=OFF From 2adca10b3c30703b3c9cc161f9ac53336dd0890e Mon Sep 17 00:00:00 2001 From: akallabeth Date: Tue, 25 Feb 2025 13:31:20 +0100 Subject: [PATCH 4/6] [scripts,bash] reformat bash scripts --- docs/mingw-example/_build.sh | 2 +- docs/mingw-example/build_arm64.sh | 4 +- docs/mingw-example/build_x64.sh | 4 +- packaging/flatpak/build-bundle.sh | 21 +- packaging/flatpak/freerdp.sh | 55 +-- packaging/scripts/create_deb.sh | 9 +- .../scripts/prepare_deb_freerdp-nightly.sh | 4 +- .../scripts/prepare_rpm_freerdp-nightly.sh | 2 +- scripts/android-build-cjson.sh | 27 +- scripts/android-build-common.sh | 449 +++++++++--------- scripts/android-build-ffmpeg.sh | 346 +++++++------- scripts/android-build-freerdp.sh | 296 ++++++------ scripts/android-build-openh264.sh | 82 ++-- scripts/android-build-openssl.sh | 96 ++-- scripts/bundle-mac-os.sh | 271 +++++------ scripts/cmake-format.sh | 50 +- scripts/codespell.sh | 8 +- scripts/create_release_tarball.sh | 75 ++- scripts/xcode.sh | 84 ++-- 19 files changed, 901 insertions(+), 984 deletions(-) diff --git a/docs/mingw-example/_build.sh b/docs/mingw-example/_build.sh index 7a74819d1..d0a45a643 100644 --- a/docs/mingw-example/_build.sh +++ b/docs/mingw-example/_build.sh @@ -3,4 +3,4 @@ rm -rf $(pwd)/build/$TARGET_ARCH mkdir -p $(pwd)/build/$TARGET_ARCH docker build -t win32-builder --build-arg ARCH . -docker compose up dist-builder \ No newline at end of file +docker compose up dist-builder diff --git a/docs/mingw-example/build_arm64.sh b/docs/mingw-example/build_arm64.sh index ae63a6852..09b0db6c6 100644 --- a/docs/mingw-example/build_arm64.sh +++ b/docs/mingw-example/build_arm64.sh @@ -1,4 +1,4 @@ #!/bin/sh -export ARCH=aarch64 -. ./_build.sh \ No newline at end of file +export ARCH=aarch64 +. ./_build.sh diff --git a/docs/mingw-example/build_x64.sh b/docs/mingw-example/build_x64.sh index e9918690c..34b0359dc 100644 --- a/docs/mingw-example/build_x64.sh +++ b/docs/mingw-example/build_x64.sh @@ -1,4 +1,4 @@ #!/bin/sh -export ARCH=x86_64 -. ./_build.sh \ No newline at end of file +export ARCH=x86_64 +. ./_build.sh diff --git a/packaging/flatpak/build-bundle.sh b/packaging/flatpak/build-bundle.sh index ed4b5a8aa..6e87af897 100755 --- a/packaging/flatpak/build-bundle.sh +++ b/packaging/flatpak/build-bundle.sh @@ -1,12 +1,11 @@ #!/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 BUILD_BASE=$(mktemp -d) -if [ $# -gt 0 ]; -then - BUILD_BASE=$1 +if [ $# -gt 0 ]; then + BUILD_BASE=$1 fi echo "Using $BUILD_BASE as temporary build directory" @@ -15,17 +14,15 @@ BUILD=$BUILD_BASE/build STATE=$BUILD_BASE/state BUILDER=$(which flatpak-builder) -if [ ! -x "$BUILDER" ]; -then - echo "command 'flatpak-builder' could not be found, please install and add to PATH" - exit 1 +if [ ! -x "$BUILDER" ]; then + echo "command 'flatpak-builder' could not be found, please install and add to PATH" + exit 1 fi FLATPAK=$(which flatpak) -if [ ! -x "$FLATPAK" ]; -then - echo "command 'flatpak' could not be found, please install and add to PATH" - exit 1 +if [ ! -x "$FLATPAK" ]; then + echo "command 'flatpak' could not be found, please install and add to PATH" + exit 1 fi flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo --user diff --git a/packaging/flatpak/freerdp.sh b/packaging/flatpak/freerdp.sh index 5b6a7dbe9..bf94dc5a3 100755 --- a/packaging/flatpak/freerdp.sh +++ b/packaging/flatpak/freerdp.sh @@ -1,34 +1,29 @@ #!/bin/sh -if [ -z ${FREERDP_SDL_OFF} ]; -then - echo "SDL $(which sdl-freerdp)" - sdl-freerdp $@ - exit $rc +if [ -z ${FREERDP_SDL_OFF} ]; then + echo "SDL $(which sdl-freerdp)" + sdl-freerdp $@ + exit $rc else - if [ -z $XDG_SESSION_TYPE ]; - then - echo "XDG_SESSION_TYPE undefined" - exit -1 - elif [ "$XDG_SESSION_TYPE" = "wayland" ]; - then - if [ -z $FREERDP_WAYLAND_OFF ]; - then - echo "wayland $(which wlfreerdp)" - wlfreerdp $@ - exit $rc - else - echo "X11 $(which xfreerdp)" - xfreerdp $@ - exit $rc - fi - elif [ "$XDG_SESSION_TYPE" = "x11" ]; - then - echo "X11 $(which xfreerdp)" - xfreerdp $@ - exit $rc - else - echo "XDG_SESSION_TYPE $XDG_SESSION_TYPE not handled" - exit -1 - fi + if [ -z $XDG_SESSION_TYPE ]; then + echo "XDG_SESSION_TYPE undefined" + exit -1 + elif [ "$XDG_SESSION_TYPE" = "wayland" ]; then + if [ -z $FREERDP_WAYLAND_OFF ]; then + echo "wayland $(which wlfreerdp)" + wlfreerdp $@ + exit $rc + else + echo "X11 $(which xfreerdp)" + xfreerdp $@ + exit $rc + fi + elif [ "$XDG_SESSION_TYPE" = "x11" ]; then + echo "X11 $(which xfreerdp)" + xfreerdp $@ + exit $rc + else + echo "XDG_SESSION_TYPE $XDG_SESSION_TYPE not handled" + exit -1 + fi fi diff --git a/packaging/scripts/create_deb.sh b/packaging/scripts/create_deb.sh index 8d9dfb929..ff600c67c 100755 --- a/packaging/scripts/create_deb.sh +++ b/packaging/scripts/create_deb.sh @@ -6,11 +6,10 @@ SCRIPT_PATH=$(realpath "$SCRIPT_PATH") BUILD_DEPS=$(/usr/bin/which dpkg-checkbuilddeps) BUILD_PKG=$(/usr/bin/which dpkg-buildpackage) -if [ -z "$BUILD_DEPS" ] || [ -z "$BUILD_PKG" ]; -then - echo "dpkg-buildpackage [$BUILD_PKG] and dpkg-checkbuilddeps [$BUILD_DEPS] required" - echo "Install with 'sudo apt install dpkg-dev'" - exit 1 +if [ -z "$BUILD_DEPS" ] || [ -z "$BUILD_PKG" ]; then + echo "dpkg-buildpackage [$BUILD_PKG] and dpkg-checkbuilddeps [$BUILD_DEPS] required" + echo "Install with 'sudo apt install dpkg-dev'" + exit 1 fi # First create a link to the debian/control folder diff --git a/packaging/scripts/prepare_deb_freerdp-nightly.sh b/packaging/scripts/prepare_deb_freerdp-nightly.sh index a4654914a..12e074562 100755 --- a/packaging/scripts/prepare_deb_freerdp-nightly.sh +++ b/packaging/scripts/prepare_deb_freerdp-nightly.sh @@ -1,4 +1,4 @@ #!/bin/sh -ln -s packaging/deb/freerdp-nightly debian -git rev-parse --short HEAD > .source_version +ln -s packaging/deb/freerdp-nightly debian +git rev-parse --short HEAD >.source_version diff --git a/packaging/scripts/prepare_rpm_freerdp-nightly.sh b/packaging/scripts/prepare_rpm_freerdp-nightly.sh index 5401a8186..a658b8dcd 100755 --- a/packaging/scripts/prepare_rpm_freerdp-nightly.sh +++ b/packaging/scripts/prepare_rpm_freerdp-nightly.sh @@ -1,3 +1,3 @@ #!/bin/bash -git rev-parse --short HEAD > source_version +git rev-parse --short HEAD >source_version diff --git a/scripts/android-build-cjson.sh b/scripts/android-build-cjson.sh index d79fa9a6f..249e001e2 100755 --- a/scripts/android-build-cjson.sh +++ b/scripts/android-build-cjson.sh @@ -22,20 +22,19 @@ CMAKE_CMD_ARGS="-DANDROID_NDK=$ANDROID_NDK \ -DCMAKE_MAKE_PROGRAM=make" BASE=$(pwd) -for ARCH in $BUILD_ARCH -do - common_run cd $BASE - common_run mkdir -p $BUILD_SRC/cJSON-build/$ARCH - common_run cd $BUILD_SRC/cJSON-build/$ARCH - common_run export ANDROID_NDK=$ANDROID_NDK - common_run $CMAKE_PROGRAM $CMAKE_CMD_ARGS \ - -DANDROID_ABI=$ARCH \ - -DCMAKE_INSTALL_PREFIX=$BUILD_DST/$ARCH \ - -DCMAKE_INSTALL_LIBDIR=. \ - -B . \ - -S $BUILD_SRC - echo $(pwd) - common_run $CMAKE_PROGRAM --build . --target install +for ARCH in $BUILD_ARCH; do + common_run cd $BASE + common_run mkdir -p $BUILD_SRC/cJSON-build/$ARCH + common_run cd $BUILD_SRC/cJSON-build/$ARCH + common_run export ANDROID_NDK=$ANDROID_NDK + common_run $CMAKE_PROGRAM $CMAKE_CMD_ARGS \ + -DANDROID_ABI=$ARCH \ + -DCMAKE_INSTALL_PREFIX=$BUILD_DST/$ARCH \ + -DCMAKE_INSTALL_LIBDIR=. \ + -B . \ + -S $BUILD_SRC + echo $(pwd) + common_run $CMAKE_PROGRAM --build . --target install done echo "Successfully build library for architectures $BUILD_ARCH" diff --git a/scripts/android-build-common.sh b/scripts/android-build-common.sh index 9430da3d7..3beb0d1ed 100644 --- a/scripts/android-build-common.sh +++ b/scripts/android-build-common.sh @@ -1,332 +1,309 @@ #!/bin/bash -x +SCRIPT_NAME="${BASH_SOURCE[0]}" SCRIPT_PATH=$(dirname "${BASH_SOURCE[0]}") SCRIPT_PATH=$(realpath "$SCRIPT_PATH") FIND_ARGS="-type f -print -quit" case "$(uname -s)" in - Darwin) - FIND_ARGS="-perm +111 $FIND_ARGS" - ;; +Darwin) + FIND_ARGS="-perm +111 $FIND_ARGS" + ;; - *) - FIND_ARGS="-executable $FIND_ARGS" - ;; +*) + FIND_ARGS="-executable $FIND_ARGS" + ;; esac if [ -z $BUILD_ARCH ]; then - BUILD_ARCH="armeabi-v7a x86 x86_64 arm64-v8a" + BUILD_ARCH="armeabi-v7a x86 x86_64 arm64-v8a" fi if [ -z $NDK_TARGET ]; then - NDK_TARGET=21 + NDK_TARGET=21 fi if [ -z $CMAKE_PROGRAM ]; then - CMAKE_PROGRAM="cmake-missing" + CMAKE_PROGRAM="cmake-missing" fi if [ -z $CCACHE ]; then - CCACHE=$(which ccache) + CCACHE=$(which ccache) fi if [ -z $ANDROID_NDK ]; then - ANDROID_NDK="ndk-missing" + ANDROID_NDK="ndk-missing" fi if [ -z $ANDROID_SDK ]; then - ANDROID_SDK="sdk-missing" + ANDROID_SDK="sdk-missing" fi if [ -z $BUILD_DST ]; then - BUILD_DST=$(pwd)/libs + BUILD_DST=$(pwd)/libs fi if [ -z $BUILD_SRC ]; then - BUILD_SRC=$(pwd)/src + BUILD_SRC=$(pwd)/src fi if [ -z $SCM_URL ]; then - SCM_URL="missing" + SCM_URL="missing" fi if [ -z $SCM_TAG ]; then - SCM_TAG=master + SCM_TAG=master fi if [ -z $SCM_HASH ]; then - SCM_HASH="missing" + SCM_HASH="missing" fi CLEAN_BUILD_DIR=0 function common_help { - echo "$(BASHSOURCE[0]) supports the following arguments:" - echo " --ndk The base directory of your android NDK defa" - echo " ANDROID_NDK=$ANDROID_NDK" - echo " --sdk The base directory of your android SDK defa" - echo " ANDROID_SDK=$ANDROID_SDK" - echo " --arch A list of architectures to build" - echo " BUILD_ARCH=$BUILD_ARCH" - echo " --dst The destination directory for include and library files" - echo " BUILD_DST=$BUILD_DST" - echo " --src The source directory for SCM checkout" - echo " BUILD_SRC=$BUILD_SRC" - echo " --url The SCM source url" - echo " SCM_URL=$SCM_URL" - echo " --tag The SCM branch or tag to check out" - echo " SCM_TAG=$SCM_TAG" - echo " --hash The SCM commit or hash to check out" - echo " SCM_HASH=$SCM_HASH" - echo " --clean Clean the destination before build" - echo " --help Display this help" - exit 0 + echo "$SCRIPT_NAME supports the following arguments:" + echo " --ndk The base directory of your android NDK defa" + echo " ANDROID_NDK=$ANDROID_NDK" + echo " --sdk The base directory of your android SDK defa" + echo " ANDROID_SDK=$ANDROID_SDK" + echo " --arch A list of architectures to build" + echo " BUILD_ARCH=$BUILD_ARCH" + echo " --dst The destination directory for include and library files" + echo " BUILD_DST=$BUILD_DST" + echo " --src The source directory for SCM checkout" + echo " BUILD_SRC=$BUILD_SRC" + echo " --url The SCM source url" + echo " SCM_URL=$SCM_URL" + echo " --tag The SCM branch or tag to check out" + echo " SCM_TAG=$SCM_TAG" + echo " --hash The SCM commit or hash to check out" + echo " SCM_HASH=$SCM_HASH" + echo " --clean Clean the destination before build" + echo " --help Display this help" + exit 0 } function common_run { - echo "[RUN] $@" - "$@" - RES=$? - if [[ $RES -ne 0 ]]; - then - echo "[ERROR] $@ returned $RES" - exit 1 - fi + echo "[RUN] $@" + "$@" + RES=$? + if [[ $RES -ne 0 ]]; then + echo "[ERROR] $@ returned $RES" + exit 1 + fi } function common_check_requirements { - if [[ ! -d $ANDROID_NDK ]]; - then - echo "export ANDROID_NDK to point to your NDK location." - exit 1 - fi + if [[ ! -d $ANDROID_NDK ]]; then + echo "export ANDROID_NDK to point to your NDK location." + exit 1 + fi - if [[ ! -d $ANDROID_SDK ]]; - then - echo "export ANDROID_SDK to point to your SDK location." - exit 1 - fi - if [[ -z $BUILD_DST ]]; - then - echo "Destination directory not valid" - exit 1 - fi + if [[ ! -d $ANDROID_SDK ]]; then + echo "export ANDROID_SDK to point to your SDK location." + exit 1 + fi + if [[ -z $BUILD_DST ]]; then + echo "Destination directory not valid" + exit 1 + fi - if [[ -z $BUILD_SRC ]]; - then - echo "Source directory not valid" - exit 1 - fi + if [[ -z $BUILD_SRC ]]; then + echo "Source directory not valid" + exit 1 + fi - if [[ -z $SCM_URL ]]; - then - echo "Source URL not defined! Define SCM_URL" - exit 1 - fi + if [[ -z $SCM_URL ]]; then + echo "Source URL not defined! Define SCM_URL" + exit 1 + fi - if [[ -z $SCM_TAG ]]; - then - echo "SCM_TAG / BRANCH not defined! Define SCM_TAG" - exit 1 - fi + if [[ -z $SCM_TAG ]]; then + echo "SCM_TAG / BRANCH not defined! Define SCM_TAG" + exit 1 + fi - if [[ -z $SCM_HASH ]]; - then - echo "SCM_HASH not defined! Define SCM_HASH" - exit 1 - fi + if [[ -z $SCM_HASH ]]; then + echo "SCM_HASH not defined! Define SCM_HASH" + exit 1 + fi - if [[ -z $NDK_TARGET ]]; - then - echo "Android platform NDK_TARGET not defined" - exit 1 - fi + if [[ -z $NDK_TARGET ]]; then + echo "Android platform NDK_TARGET not defined" + exit 1 + fi - if [ -z $CMAKE_PROGRAM ] || [ "$CMAKE_PROGRAM" == "cmake-missing" ]; then - CMAKE_PROGRAM=$(find $ANDROID_SDK/cmake -name cmake $FIND_ARGS) - if [ -z $CMAKE_PROGRAM ]; then - echo "CMake not found in $ANDROID_SDK, install CMake from the android SDK!" - exit 1 - fi - fi + if [ -z $CMAKE_PROGRAM ] || [ "$CMAKE_PROGRAM" == "cmake-missing" ]; then + CMAKE_PROGRAM=$(find $ANDROID_SDK/cmake -name cmake $FIND_ARGS) + if [ -z $CMAKE_PROGRAM ]; then + echo "CMake not found in $ANDROID_SDK, install CMake from the android SDK!" + exit 1 + fi + fi - for CMD in make git $CMAKE_PROGRAM - do - if ! type $CMD >/dev/null; then - echo "Command $CMD not found. Install and add it to the PATH." - exit 1 - fi - done + for CMD in make git $CMAKE_PROGRAM; do + if ! type $CMD >/dev/null; then + echo "Command $CMD not found. Install and add it to the PATH." + exit 1 + fi + done - if [ "${BUILD_SRC:0:1}" != "/" ]; - then - BUILD_SRC=$(pwd)/$BUILD_SRC - fi - if [ "${BUILD_DST:0:1}" != "/" ]; - then - BUILD_DST=$(pwd)/$BUILD_DST - fi + if [ "${BUILD_SRC:0:1}" != "/" ]; then + BUILD_SRC=$(pwd)/$BUILD_SRC + fi + if [ "${BUILD_DST:0:1}" != "/" ]; then + BUILD_DST=$(pwd)/$BUILD_DST + fi } function common_parse_arguments { - while [[ $# > 0 ]] - do - key="$1" - case $key in - --conf) - source "$2" || exit 1 - shift - ;; + while [[ $# > 0 ]]; do + key="$1" + case $key in + --conf) + source "$2" || exit 1 + shift + ;; - --target) - NDK_TARGET="$2" - shift - ;; + --target) + NDK_TARGET="$2" + shift + ;; - --ndk) - ANDROID_NDK="$2" - shift - ;; + --ndk) + ANDROID_NDK="$2" + shift + ;; - --sdk) - ANDROID_SDK="$2" - shift - ;; + --sdk) + ANDROID_SDK="$2" + shift + ;; - --arch) - BUILD_ARCH="$2" - shift - ;; + --arch) + BUILD_ARCH="$2" + shift + ;; - --dst) - BUILD_DST="$2" - shift - ;; + --dst) + BUILD_DST="$2" + shift + ;; - --src) - BUILD_SRC="$2" - shift - ;; + --src) + BUILD_SRC="$2" + shift + ;; - --url) - SCM_URL="$2" - shift - ;; + --url) + SCM_URL="$2" + shift + ;; - --tag) - SCM_TAG="$2" - shift - ;; + --tag) + SCM_TAG="$2" + shift + ;; - --hash) - SCM_HASH="$2" - shift - ;; + --hash) + SCM_HASH="$2" + shift + ;; - --clean) - CLEAN_BUILD_DIR=1 - shift - ;; + --clean) + CLEAN_BUILD_DIR=1 + shift + ;; - --help) - common_help - shift - ;; + --help) + common_help + shift + ;; - *) # Unknown - ;; - esac - shift - done + *) # Unknown + ;; + esac + shift + done - common_check_requirements + common_check_requirements } function common_update { - if [ $# -ne 4 ]; - then - echo "Invalid arguments to update function $@" - exit 1 - fi - SCM_URL=$1 - SCM_TAG=$2 - BUILD_SRC=$3 - SCM_HASH=$4 + if [ $# -ne 4 ]; then + echo "Invalid arguments to update function $@" + exit 1 + fi + SCM_URL=$1 + SCM_TAG=$2 + BUILD_SRC=$3 + SCM_HASH=$4 - echo "Preparing checkout..." - BASE=$(pwd) - CACHE=$(realpath $SCRIPT_PATH/../cache) - common_run mkdir -p $CACHE - TARFILE="$CACHE/$SCM_TAG.tar.gz" + echo "Preparing checkout..." + BASE=$(pwd) + CACHE=$(realpath $SCRIPT_PATH/../cache) + common_run mkdir -p $CACHE + TARFILE="$CACHE/$SCM_TAG.tar.gz" - if [[ ! -f "$TARFILE" ]]; - then - WGET=$(which wget) - CURL=$(which curl) - if [ -x "$CURL" ]; - then - common_run $CURL -L -o "$TARFILE" "$SCM_URL/$SCM_TAG.tar.gz" - elif [ -x "$WGET" ]; - then - common_run $WGET -O "$TARFILE" "$SCM_URL/$SCM_TAG.tar.gz" - else - echo "Neither wget nor curl installed, aborting" - exit -1 - fi - fi + if [[ ! -f "$TARFILE" ]]; then + WGET=$(which wget) + CURL=$(which curl) + if [ -x "$CURL" ]; then + common_run $CURL -L -o "$TARFILE" "$SCM_URL/$SCM_TAG.tar.gz" + elif [ -x "$WGET" ]; then + common_run $WGET -O "$TARFILE" "$SCM_URL/$SCM_TAG.tar.gz" + else + echo "Neither wget nor curl installed, aborting" + exit -1 + fi + fi - echo "$SCM_HASH $TARFILE" > $TARFILE.sha256sum - common_run sha256sum -c $TARFILE.sha256sum + echo "$SCM_HASH $TARFILE" >$TARFILE.sha256sum + common_run sha256sum -c $TARFILE.sha256sum - if [[ -d $BUILD_SRC ]]; - then - common_run rm -rf $BUILD_SRC - fi - common_run mkdir -p $BUILD_SRC - common_run cd $BUILD_SRC - common_run tar zxf "$TARFILE" --strip 1 - common_run cd $BASE + if [[ -d $BUILD_SRC ]]; then + common_run rm -rf $BUILD_SRC + fi + common_run mkdir -p $BUILD_SRC + common_run cd $BUILD_SRC + common_run tar zxf "$TARFILE" --strip 1 + common_run cd $BASE } function common_clean { - if [ $CLEAN_BUILD_DIR -ne 1 ]; - then - return - fi + if [ $CLEAN_BUILD_DIR -ne 1 ]; then + return + fi - if [ $# -ne 1 ]; - then - echo "Invalid arguments to clean function $@" - exit 1 - fi + if [ $# -ne 1 ]; then + echo "Invalid arguments to clean function $@" + exit 1 + fi - echo "Cleaning up $1..." - common_run rm -rf $1 + echo "Cleaning up $1..." + common_run rm -rf $1 } function common_copy { - if [ $# -ne 2 ]; - then - echo "Invalid arguments to copy function $@" - exit 1 - fi - if [ ! -d $1 ] || [ ! -d $1/include ] || [ ! -d $1/libs ]; - then - echo "Invalid source $1" - exit 1 - fi - if [ -z $2 ]; - then - echo "Invalid destination $2" - exit 1 - fi + if [ $# -ne 2 ]; then + echo "Invalid arguments to copy function $@" + exit 1 + fi + if [ ! -d $1 ] || [ ! -d $1/include ] || [ ! -d $1/libs ]; then + echo "Invalid source $1" + exit 1 + fi + if [ -z $2 ]; then + echo "Invalid destination $2" + exit 1 + fi - if [ ! -d $2 ]; - then - common_run mkdir -p $2 - fi - common_run cp -L -r $1/include $2 - common_run cp -L -r $1/libs/* $2 + if [ ! -d $2 ]; then + common_run mkdir -p $2 + fi + common_run cp -L -r $1/include $2 + common_run cp -L -r $1/libs/* $2 } diff --git a/scripts/android-build-ffmpeg.sh b/scripts/android-build-ffmpeg.sh index e851696fe..e6b9a13fa 100755 --- a/scripts/android-build-ffmpeg.sh +++ b/scripts/android-build-ffmpeg.sh @@ -8,212 +8,210 @@ OLD_PATH=$PATH source $(dirname "${BASH_SOURCE[0]}")/android-build-common.sh function get_toolchain() { - HOST_OS=$(uname -s) - case ${HOST_OS} in - Darwin) HOST_OS=darwin;; - Linux) HOST_OS=linux;; - FreeBsd) HOST_OS=freebsd;; - CYGWIN*|*_NT-*) HOST_OS=cygwin;; - esac + HOST_OS=$(uname -s) + case ${HOST_OS} in + Darwin) HOST_OS=darwin ;; + Linux) HOST_OS=linux ;; + FreeBsd) HOST_OS=freebsd ;; + CYGWIN* | *_NT-*) HOST_OS=cygwin ;; + esac - HOST_ARCH=$(uname -m) - case ${HOST_ARCH} in - i?86) HOST_ARCH=x86;; - x86_64|amd64) HOST_ARCH=x86_64;; - esac + HOST_ARCH=$(uname -m) + case ${HOST_ARCH} in + i?86) HOST_ARCH=x86 ;; + x86_64 | amd64) HOST_ARCH=x86_64 ;; + esac - echo "${HOST_OS}-${HOST_ARCH}" + echo "${HOST_OS}-${HOST_ARCH}" } function get_build_host() { - case ${ARCH} in - armeabi-v7a) - echo "arm-linux-androideabi" - ;; - arm64-v8a) - echo "aarch64-linux-android" - ;; - x86) - echo "i686-linux-android" - ;; - x86_64) - echo "x86_64-linux-android" - ;; - esac + case ${ARCH} in + armeabi-v7a) + echo "arm-linux-androideabi" + ;; + arm64-v8a) + echo "aarch64-linux-android" + ;; + x86) + echo "i686-linux-android" + ;; + x86_64) + echo "x86_64-linux-android" + ;; + esac } function get_clang_target_host() { - case ${ARCH} in - armeabi-v7a) - echo "armv7a-linux-androideabi${NDK_TARGET}" - ;; - arm64-v8a) - echo "aarch64-linux-android${NDK_TARGET}" - ;; - x86) - echo "i686-linux-android${NDK_TARGET}" - ;; - x86_64) - echo "x86_64-linux-android${NDK_TARGET}" - ;; - esac + case ${ARCH} in + armeabi-v7a) + echo "armv7a-linux-androideabi${NDK_TARGET}" + ;; + arm64-v8a) + echo "aarch64-linux-android${NDK_TARGET}" + ;; + x86) + echo "i686-linux-android${NDK_TARGET}" + ;; + x86_64) + echo "x86_64-linux-android${NDK_TARGET}" + ;; + esac } function get_arch_specific_ldflags() { - case ${ARCH} in - armeabi-v7a) - echo "-march=armv7-a -mfpu=neon -mfloat-abi=softfp -Wl,--fix-cortex-a8" - ;; - arm64-v8a) - echo "-march=armv8-a" - ;; - x86) - echo "-march=i686" - ;; - x86_64) - echo "-march=x86-64" - ;; - esac + case ${ARCH} in + armeabi-v7a) + echo "-march=armv7-a -mfpu=neon -mfloat-abi=softfp -Wl,--fix-cortex-a8" + ;; + arm64-v8a) + echo "-march=armv8-a" + ;; + x86) + echo "-march=i686" + ;; + x86_64) + echo "-march=x86-64" + ;; + esac } function set_toolchain_clang_paths { - TOOLCHAIN=$(get_toolchain) + TOOLCHAIN=$(get_toolchain) - common_run export PATH=$PATH:${ANDROID_NDK}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin - AR=llvm-ar - NM=llvm-nm - RANLIB=llvm-ranlib - STRIP=llvm-strip - CC=$(get_clang_target_host)-clang - CXX=$(get_clang_target_host)-clang++ + common_run export PATH=$PATH:${ANDROID_NDK}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin + AR=llvm-ar + NM=llvm-nm + RANLIB=llvm-ranlib + STRIP=llvm-strip + CC=$(get_clang_target_host)-clang + CXX=$(get_clang_target_host)-clang++ - case ${ARCH} in - arm64-v8a) - common_run export ac_cv_c_bigendian=no - ;; - esac + case ${ARCH} in + arm64-v8a) + common_run export ac_cv_c_bigendian=no + ;; + esac } function build { - echo "Building FFmpeg architecture $1..." - BASE=$(pwd) - common_run cd $BUILD_SRC + echo "Building FFmpeg architecture $1..." + BASE=$(pwd) + common_run cd $BUILD_SRC - BUILD_HOST=$(get_build_host) - set_toolchain_clang_paths - LDFLAGS=$(get_arch_specific_ldflags) + BUILD_HOST=$(get_build_host) + set_toolchain_clang_paths + LDFLAGS=$(get_arch_specific_ldflags) - CARCH=$TARGET_ARCH - if [ "$CARCH" == "x86_64" ]; then - CARCH="x86-64" - fi - PATH=$ANDROID_NDK:$PATH - common_run ./configure \ - --cross-prefix="${BUILD_HOST}-" \ - --sysroot="${ANDROID_NDK}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \ - --arch="${CARCH}" \ - --cpu="${TARGET_CPU}" \ - --cc="${CC}" \ - --cxx="${CXX}" \ - --ar="${AR}" \ - --nm="${NM}" \ - --ranlib="${RANLIB}" \ - --strip="${STRIP}" \ - --extra-ldflags="${LDFLAGS}" \ - --prefix="${BUILD_DST}/${ARCH}" \ - --pkg-config="${HOST_PKG_CONFIG_PATH}" \ - --target-os=android \ - ${ARCH_OPTIONS} \ - --enable-cross-compile \ - --enable-pic \ - --enable-lto \ - --enable-jni \ - --enable-mediacodec \ - --enable-shared \ - --disable-vulkan \ - --disable-stripping \ - --disable-programs \ - --disable-doc \ - --disable-avdevice \ - --disable-avfilter \ - --disable-avformat \ - --disable-everything \ - --enable-encoder=aac \ - --enable-encoder=libfdk_aac \ - --enable-encoder=libgsm \ - --enable-encoder=libgsm_ms \ - --enable-encoder=libopenh264 \ - --enable-encoder=libopus \ - --enable-encoder=pcm_alaw \ - --enable-encoder=pcm_mulaw \ - --enable-encoder=pcm_s16le \ - --enable-encoder=pcm_u16le \ - --enable-encoder=h264 \ - --enable-encoder=h264_omx \ - --enable-encoder=h264_mediacodec \ - --enable-encoder=h264_vulkan \ - --enable-decoder=aac \ - --enable-decoder=aac_mediacodec \ - --enable-decoder=adpcm_g722 \ - --enable-decoder=adpcm_g726 \ - --enable-decoder=adpcm_g726le \ - --enable-decoder=gsm \ - --enable-decoder=gsm_ms \ - --enable-decoder=mp3 \ - --enable-decoder=mp3_mediacodec \ - --enable-decoder=h264 \ - --enable-decoder=h264_mediacodec \ - --enable-decoder=libopus \ - --enable-decoder=pcm_alaw \ - --enable-decoder=pcm_mulaw \ - --enable-decoder=pcm_s16le \ - --enable-decoder=pcm_u16le + CARCH=$TARGET_ARCH + if [ "$CARCH" == "x86_64" ]; then + CARCH="x86-64" + fi + PATH=$ANDROID_NDK:$PATH + common_run ./configure \ + --cross-prefix="${BUILD_HOST}-" \ + --sysroot="${ANDROID_NDK}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot" \ + --arch="${CARCH}" \ + --cpu="${TARGET_CPU}" \ + --cc="${CC}" \ + --cxx="${CXX}" \ + --ar="${AR}" \ + --nm="${NM}" \ + --ranlib="${RANLIB}" \ + --strip="${STRIP}" \ + --extra-ldflags="${LDFLAGS}" \ + --prefix="${BUILD_DST}/${ARCH}" \ + --pkg-config="${HOST_PKG_CONFIG_PATH}" \ + --target-os=android \ + ${ARCH_OPTIONS} \ + --enable-cross-compile \ + --enable-pic \ + --enable-lto \ + --enable-jni \ + --enable-mediacodec \ + --enable-shared \ + --disable-vulkan \ + --disable-stripping \ + --disable-programs \ + --disable-doc \ + --disable-avdevice \ + --disable-avfilter \ + --disable-avformat \ + --disable-everything \ + --enable-encoder=aac \ + --enable-encoder=libfdk_aac \ + --enable-encoder=libgsm \ + --enable-encoder=libgsm_ms \ + --enable-encoder=libopenh264 \ + --enable-encoder=libopus \ + --enable-encoder=pcm_alaw \ + --enable-encoder=pcm_mulaw \ + --enable-encoder=pcm_s16le \ + --enable-encoder=pcm_u16le \ + --enable-encoder=h264 \ + --enable-encoder=h264_omx \ + --enable-encoder=h264_mediacodec \ + --enable-encoder=h264_vulkan \ + --enable-decoder=aac \ + --enable-decoder=aac_mediacodec \ + --enable-decoder=adpcm_g722 \ + --enable-decoder=adpcm_g726 \ + --enable-decoder=adpcm_g726le \ + --enable-decoder=gsm \ + --enable-decoder=gsm_ms \ + --enable-decoder=mp3 \ + --enable-decoder=mp3_mediacodec \ + --enable-decoder=h264 \ + --enable-decoder=h264_mediacodec \ + --enable-decoder=libopus \ + --enable-decoder=pcm_alaw \ + --enable-decoder=pcm_mulaw \ + --enable-decoder=pcm_s16le \ + --enable-decoder=pcm_u16le - common_run make clean - common_run make -j - common_run make install + common_run make clean + common_run make -j + common_run make install } # Run the main program. common_parse_arguments $@ 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 - echo "(*) pkg-config command not found\n" - exit 1 + echo "(*) pkg-config command not found\n" + exit 1 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 -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" + # asm disabled due to this ticker https://trac.ffmpeg.org/ticket/4928 + ARCH_OPTIONS=" --disable-neon --disable-asm --disable-inline-asm" + ;; + x86_64) + TARGET_CPU="x86_64" + TARGET_ARCH="x86_64" + ARCH_OPTIONS=" --disable-neon --enable-asm --enable-inline-asm" + ;; + esac - # asm disabled due to this ticker https://trac.ffmpeg.org/ticket/4928 - ARCH_OPTIONS=" --disable-neon --disable-asm --disable-inline-asm" - ;; - x86_64) - TARGET_CPU="x86_64" - TARGET_ARCH="x86_64" - ARCH_OPTIONS=" --disable-neon --enable-asm --enable-inline-asm" - ;; - esac + build + common_run cp -L $BUILD_DST/$ARCH/lib/*.so $BUILD_DST/$ARCH/ - build - common_run cp -L $BUILD_DST/$ARCH/lib/*.so $BUILD_DST/$ARCH/ - - common_run export PATH=$OLD_PATH + common_run export PATH=$OLD_PATH done diff --git a/scripts/android-build-freerdp.sh b/scripts/android-build-freerdp.sh index 18c1b992e..69874999e 100755 --- a/scripts/android-build-freerdp.sh +++ b/scripts/android-build-freerdp.sh @@ -28,74 +28,70 @@ source $SCRIPT_PATH/android-build.conf # Parse arguments. REMAINING="" -while [[ $# > 0 ]] -do - key="$1" - case $key in - --freerdp-src) - SRC_DIR="$2" - shift - ;; - --openh264) - WITH_OPENH264=1 - shift - ;; - --openh264-ndk) - shift - ANDROID_NDK_OPENH264=$1 - shift - ;; - --ffmpeg) - WITH_FFMPEG=1 - shift - ;; - --cjson) - WITH_AAD=1 - shift - ;; - --openssl) - WITH_OPENSSL=1 - shift - ;; - --debug) - CMAKE_BUILD_TYPE=Debug - shift - ;; - --release) - CMAKE_BUILD_TYPE=Release - shift - ;; - --relWithDebug) - CMAKE_BUILD_TYPE=RelWithDebug - shift - ;; - --build-deps) - BUILD_DEPS=1 - shift - ;; - *) - REMAINING="$REMAINING $key" - shift - ;; - esac +while [[ $# > 0 ]]; do + key="$1" + case $key in + --freerdp-src) + SRC_DIR="$2" + shift + ;; + --openh264) + WITH_OPENH264=1 + shift + ;; + --openh264-ndk) + shift + ANDROID_NDK_OPENH264=$1 + shift + ;; + --ffmpeg) + WITH_FFMPEG=1 + shift + ;; + --cjson) + WITH_AAD=1 + shift + ;; + --openssl) + WITH_OPENSSL=1 + shift + ;; + --debug) + CMAKE_BUILD_TYPE=Debug + shift + ;; + --release) + CMAKE_BUILD_TYPE=Release + shift + ;; + --relWithDebug) + CMAKE_BUILD_TYPE=RelWithDebug + shift + ;; + --build-deps) + BUILD_DEPS=1 + shift + ;; + *) + REMAINING="$REMAINING $key" + shift + ;; + esac done common_parse_arguments $REMAINING -if [ -z ${WITH_MEDIACODEC+x} ]; -then - common_run echo "WITH_MEDIACODEC unset, defining WITH_MEDIACODEC=1" - WITH_MEDIACODEC=1 +if [ -z ${WITH_MEDIACODEC+x} ]; then + common_run echo "WITH_MEDIACODEC unset, defining WITH_MEDIACODEC=1" + WITH_MEDIACODEC=1 fi # clean up top -if [ -d $BUILD_SRC ]; -then - common_clean $BUILD_SRC +if [ -d $BUILD_SRC ]; then + common_clean $BUILD_SRC fi -if [ -d $BUILD_DST ]; -then - common_run mkdir -p $BUILD_DST +if [ -d $BUILD_DST ]; then + common_run mkdir -p $BUILD_DST fi # Prepare the environment @@ -115,105 +111,93 @@ CMAKE_CMD_ARGS="-DANDROID_NDK=$ANDROID_NDK \ -DCMAKE_MAKE_PROGRAM=make" BASE=$(pwd) -for ARCH in $BUILD_ARCH -do - # build dependencies. - if [ $WITH_OPENH264 -ne 0 ]; - then - if [ -z "$ANDROID_NDK_OPENH264" ] - then - echo - echo "Warning: Missing openh264-ndk, using $ANDROID_NDK" >&2 - echo - ANDROID_NDK_OPENH264=$ANDROID_NDK - fi - if [ $BUILD_DEPS -ne 0 ]; - then - common_run bash $SCRIPT_PATH/android-build-openh264.sh \ - --src $BUILD_SRC/openh264 --dst $BUILD_DST \ - --sdk "$ANDROID_SDK" \ - --ndk "$ANDROID_NDK_OPENH264" \ - --arch $ARCH \ - --target $NDK_TARGET \ - --tag $OPENH264_TAG \ - --hash $OPENH264_HASH - fi - CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_OPENH264=ON" - else - CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_OPENH264=OFF" - fi +for ARCH in $BUILD_ARCH; do + # build dependencies. + if [ $WITH_OPENH264 -ne 0 ]; then + if [ -z "$ANDROID_NDK_OPENH264" ]; then + echo + echo "Warning: Missing openh264-ndk, using $ANDROID_NDK" >&2 + echo + ANDROID_NDK_OPENH264=$ANDROID_NDK + fi + if [ $BUILD_DEPS -ne 0 ]; then + common_run bash $SCRIPT_PATH/android-build-openh264.sh \ + --src $BUILD_SRC/openh264 --dst $BUILD_DST \ + --sdk "$ANDROID_SDK" \ + --ndk "$ANDROID_NDK_OPENH264" \ + --arch $ARCH \ + --target $NDK_TARGET \ + --tag $OPENH264_TAG \ + --hash $OPENH264_HASH + 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 ]; - then - CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_MEDIACODEC=ON" - else - CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_MEDIACODEC=OFF" - fi + if [ $WITH_MEDIACODEC -ne 0 ]; then + CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_MEDIACODEC=ON" + else + CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_MEDIACODEC=OFF" + fi - if [ $WITH_FFMPEG -ne 0 ]; - then - if [ $BUILD_DEPS -ne 0 ]; - then - common_run bash $SCRIPT_PATH/android-build-ffmpeg.sh \ - --src $BUILD_SRC/ffmpeg --dst $BUILD_DST \ - --sdk "$ANDROID_SDK" \ - --ndk "$ANDROID_NDK" \ - --arch $ARCH \ - --target $NDK_TARGET \ - --tag $FFMPEG_TAG \ - --hash $FFMPEG_HASH - fi - CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_FFMPEG=ON -DWITH_SWCALE=ON" - else - CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_FFMPEG=OFF -DWITH_SWSCALE=OFF" - fi - if [ $WITH_AAD -ne 0 ]; - then - if [ $BUILD_DEPS -ne 0 ]; - then - common_run bash $SCRIPT_PATH/android-build-cjson.sh \ - --src $BUILD_SRC/cjson --dst $BUILD_DST \ - --sdk "$ANDROID_SDK" \ - --ndk "$ANDROID_NDK" \ - --arch $ARCH \ - --target $NDK_TARGET \ - --tag $CJSON_TAG \ - --hash $CJSON_HASH - fi - fi - if [ $WITH_OPENSSL -ne 0 ]; - then - if [ $BUILD_DEPS -ne 0 ]; - then - common_run bash $SCRIPT_PATH/android-build-openssl.sh \ - --src $BUILD_SRC/openssl --dst $BUILD_DST \ - --sdk "$ANDROID_SDK" \ - --ndk $ANDROID_NDK \ - --arch $ARCH \ - --target $NDK_TARGET \ - --tag $OPENSSL_TAG \ - --hash $OPENSSL_HASH - fi - fi + if [ $WITH_FFMPEG -ne 0 ]; then + if [ $BUILD_DEPS -ne 0 ]; then + common_run bash $SCRIPT_PATH/android-build-ffmpeg.sh \ + --src $BUILD_SRC/ffmpeg --dst $BUILD_DST \ + --sdk "$ANDROID_SDK" \ + --ndk "$ANDROID_NDK" \ + --arch $ARCH \ + --target $NDK_TARGET \ + --tag $FFMPEG_TAG \ + --hash $FFMPEG_HASH + fi + CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_FFMPEG=ON -DWITH_SWCALE=ON" + else + CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_FFMPEG=OFF -DWITH_SWSCALE=OFF" + fi + if [ $WITH_AAD -ne 0 ]; then + if [ $BUILD_DEPS -ne 0 ]; then + common_run bash $SCRIPT_PATH/android-build-cjson.sh \ + --src $BUILD_SRC/cjson --dst $BUILD_DST \ + --sdk "$ANDROID_SDK" \ + --ndk "$ANDROID_NDK" \ + --arch $ARCH \ + --target $NDK_TARGET \ + --tag $CJSON_TAG \ + --hash $CJSON_HASH + fi + fi + if [ $WITH_OPENSSL -ne 0 ]; then + if [ $BUILD_DEPS -ne 0 ]; then + common_run bash $SCRIPT_PATH/android-build-openssl.sh \ + --src $BUILD_SRC/openssl --dst $BUILD_DST \ + --sdk "$ANDROID_SDK" \ + --ndk $ANDROID_NDK \ + --arch $ARCH \ + --target $NDK_TARGET \ + --tag $OPENSSL_TAG \ + --hash $OPENSSL_HASH + fi + fi - # Build and install the library. - if [ $DEPS_ONLY -eq 0 ]; - then - common_run cd $BASE - common_run mkdir -p $BUILD_SRC/freerdp-build/$ARCH - common_run cd $BUILD_SRC/freerdp-build/$ARCH - common_run export ANDROID_NDK=$ANDROID_NDK - common_run $CMAKE_PROGRAM $CMAKE_CMD_ARGS \ - -DANDROID_ABI=$ARCH \ - -DCMAKE_INSTALL_PREFIX=$BUILD_DST/$ARCH \ - -DCMAKE_INSTALL_LIBDIR=. \ - -DCMAKE_PREFIX_PATH=$BUILD_DST/$ARCH \ - -DCMAKE_SHARED_LINKER_FLAGS="-L$BUILD_DST/$ARCH" \ - -DcJSON_DIR=$BUILD_DST/$ARCH/cmake/cJSON \ - $SRC_DIR - echo $(pwd) - common_run $CMAKE_PROGRAM --build . --target install - fi + # Build and install the library. + if [ $DEPS_ONLY -eq 0 ]; then + common_run cd $BASE + common_run mkdir -p $BUILD_SRC/freerdp-build/$ARCH + common_run cd $BUILD_SRC/freerdp-build/$ARCH + common_run export ANDROID_NDK=$ANDROID_NDK + common_run $CMAKE_PROGRAM $CMAKE_CMD_ARGS \ + -DANDROID_ABI=$ARCH \ + -DCMAKE_INSTALL_PREFIX=$BUILD_DST/$ARCH \ + -DCMAKE_INSTALL_LIBDIR=. \ + -DCMAKE_PREFIX_PATH=$BUILD_DST/$ARCH \ + -DCMAKE_SHARED_LINKER_FLAGS="-L$BUILD_DST/$ARCH" \ + -DcJSON_DIR=$BUILD_DST/$ARCH/cmake/cJSON \ + $SRC_DIR + echo $(pwd) + common_run $CMAKE_PROGRAM --build . --target install + fi done echo "Successfully build library for architectures $BUILD_ARCH" diff --git a/scripts/android-build-openh264.sh b/scripts/android-build-openh264.sh index 19f580eef..4808b52bd 100755 --- a/scripts/android-build-openh264.sh +++ b/scripts/android-build-openh264.sh @@ -6,59 +6,55 @@ SCM_HASH=94c8ca364db990047ec4ec3481b04ce0d791e62561ef5601443011bdc00825e3 source $(dirname "${BASH_SOURCE[0]}")/android-build-common.sh function build { - echo "Building architecture $1..." - BASE=$(pwd) - common_run cd $BUILD_SRC - 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" + echo "Building architecture $1..." + BASE=$(pwd) + common_run cd $BUILD_SRC + 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" - common_run export QUIET_AR="$CCACHE " - common_run export QUIET_ASM="$CCACHE " - common_run export QUIET_CC="$CCACHE " - common_run export QUIET_CCAR="$CCACHE " - common_run export QUIET_CXX="$CCACHE " + common_run export QUIET_AR="$CCACHE " + common_run export QUIET_ASM="$CCACHE " + common_run export QUIET_CC="$CCACHE " + common_run export QUIET_CCAR="$CCACHE " + common_run export QUIET_CXX="$CCACHE " - common_run $MAKE - # Install creates a non optimal directory layout, fix that - common_run $MAKE PREFIX=$BUILD_SRC/libs/$1 install - common_run cd $BASE + common_run $MAKE + # Install creates a non optimal directory layout, fix that + common_run $MAKE PREFIX=$BUILD_SRC/libs/$1 install + common_run cd $BASE } # Run the main program. common_parse_arguments $@ 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 -do - case $ARCH in - "armeabi") - OARCH="arm" - ;; - "armeabi-v7a") - OARCH="arm" - ;; - "arm64-v8a") - OARCH="arm64" - ;; - *) - OARCH=$ARCH - ;; - esac + echo "$ARCH=$OARCH" - 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 ]; - then - common_run mkdir -p $BUILD_DST/$ARCH/include - fi - - 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/ + 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 diff --git a/scripts/android-build-openssl.sh b/scripts/android-build-openssl.sh index 99e163fb3..b5179b891 100755 --- a/scripts/android-build-openssl.sh +++ b/scripts/android-build-openssl.sh @@ -9,36 +9,34 @@ COMPILER=4.9 source $(dirname "${BASH_SOURCE[0]}")/android-build-common.sh function build { - if [ $# -ne 2 ]; - then - echo "Invalid arguments $@" - exit 1 - fi + if [ $# -ne 2 ]; then + echo "Invalid arguments $@" + exit 1 + fi - CONFIG=$1 - DST_PREFIX=$2 + CONFIG=$1 + DST_PREFIX=$2 - common_run export CC=clang - common_run export PATH=$(${SCRIPT_PATH}/toolchains_path.py --ndk ${ANDROID_NDK}):$ORG_PATH - common_run export ANDROID_NDK + common_run export CC=clang + common_run export PATH=$(${SCRIPT_PATH}/toolchains_path.py --ndk ${ANDROID_NDK}):$ORG_PATH + common_run export ANDROID_NDK - echo "CONFIG=$CONFIG" - echo "DST_PREFIX=$DST_PREFIX" - echo "PATH=$PATH" + echo "CONFIG=$CONFIG" + echo "DST_PREFIX=$DST_PREFIX" + echo "PATH=$PATH" - BASE=$(pwd) - DST_DIR=$BUILD_DST/$DST_PREFIX - common_run cd $BUILD_SRC - common_run ./Configure ${CONFIG} -D__ANDROID_API__=$NDK_TARGET - common_run make SHLIB_EXT=.so -j build_libs + BASE=$(pwd) + DST_DIR=$BUILD_DST/$DST_PREFIX + common_run cd $BUILD_SRC + common_run ./Configure ${CONFIG} -D__ANDROID_API__=$NDK_TARGET + common_run make SHLIB_EXT=.so -j build_libs - if [ ! -d $DST_DIR ]; - then - common_run mkdir -p $DST_DIR - fi + if [ ! -d $DST_DIR ]; then + common_run mkdir -p $DST_DIR + fi - common_run cp *.so $DST_DIR/ - common_run cd $BASE + common_run cp *.so $DST_DIR/ + common_run cd $BASE } # Run the main program. @@ -48,38 +46,36 @@ SCM_MOD_TAG=$SCM_TAG # Workaround for naming of OpenSSL releases changing with every major version case $SCM_TAG in OpenSSL_*) - SCM_MOD_TAG=${SCM_TAG//OpenSSL_/openssl-} - SCM_MOD_TAG=${SCM_MOD_TAG//_/.} + SCM_MOD_TAG=${SCM_TAG//OpenSSL_/openssl-} + SCM_MOD_TAG=${SCM_MOD_TAG//_/.} + ;; esac common_update "$SCM_URL/$SCM_TAG" $SCM_MOD_TAG $BUILD_SRC $SCM_HASH ORG_PATH=$PATH -for ARCH in $BUILD_ARCH -do +for ARCH in $BUILD_ARCH; do - case $ARCH in - "armeabi-v7a") - build "android-arm" "armeabi-v7a" - ;; - "x86") - build "android-x86" "x86" - ;; - "arm64-v8a") - build "android-arm64" "arm64-v8a" - ;; - "x86_64") - build "android-x86_64" "x86_64" - ;; - *) - echo "[WARNING] Skipping unsupported architecture $ARCH" - continue - ;; - esac + case $ARCH in + "armeabi-v7a") + build "android-arm" "armeabi-v7a" + ;; + "x86") + build "android-x86" "x86" + ;; + "arm64-v8a") + build "android-arm64" "arm64-v8a" + ;; + "x86_64") + build "android-x86_64" "x86_64" + ;; + *) + echo "[WARNING] Skipping unsupported architecture $ARCH" + continue + ;; + esac done -if [ ! -d $BUILD_DST/$ARCH/include ]; -then - common_run mkdir -p $BUILD_DST/$ARCH/include +if [ ! -d $BUILD_DST/$ARCH/include ]; then + common_run mkdir -p $BUILD_DST/$ARCH/include fi common_run cp -L -R $BUILD_SRC/include/openssl $BUILD_DST/$ARCH/include/ - diff --git a/scripts/bundle-mac-os.sh b/scripts/bundle-mac-os.sh index c4e720076..2e0722094 100755 --- a/scripts/bundle-mac-os.sh +++ b/scripts/bundle-mac-os.sh @@ -1,5 +1,5 @@ #!/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 BASE=$(pwd) @@ -14,7 +14,7 @@ DATADIR=Resources DEPLOYMENT_ARCH='arm64 x86_64' DEPLOYMENT_TARGET=12 -usage () { +usage() { echo "${BASH_SOURCE[0]} [-a|--arch 'arch1 arch2 ...'] [-t|--target target][-h|--help]" echo "" echo "default options:" @@ -23,100 +23,90 @@ usage () { } 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; - do - set +e - TOOL_PATH=$(which "$TOOL") - set -e - echo "$TOOL: $TOOL_PATH" + 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 + set +e + TOOL_PATH=$(which "$TOOL") + set -e + echo "$TOOL: $TOOL_PATH" - if [ ! -f "$TOOL_PATH" ]; - then - echo "Missing $TOOL! please install and add to PATH." - exit 1 - fi - done + if [ ! -f "$TOOL_PATH" ]; then + echo "Missing $TOOL! please install and add to PATH." + exit 1 + fi + done } while [[ $# -gt 0 ]]; do case $1 in - -a|--arch) - DEPLOYMENT_ARCH="$2" - shift # past argument - shift # past value - ;; - -t|--target) - DEPLOYMENT_TARGET="$2" - shift # past argument - shift # past value - ;; - -t|--target) - usage - exit 0 - ;; - -*|--*) - usage - exit 1 - ;; - *) - usage - exit 1 - ;; + -a | --arch) + DEPLOYMENT_ARCH="$2" + shift # past argument + shift # past value + ;; + -t | --target) + DEPLOYMENT_TARGET="$2" + shift # past argument + shift # past value + ;; + -t | --target) + usage + exit 0 + ;; + -* | --*) + usage + exit 1 + ;; + *) + usage + exit 1 + ;; esac done check_tools fix_rpath() { - SEARCH_PATH=$1 - FIX_PATH=$1 - EXT=".dylib" - if [ "$#" -gt 1 ]; - then - FIX_PATH=$2 - fi - if [ "$#" -gt 2 ]; - then - EXT=$3 - fi + SEARCH_PATH=$1 + FIX_PATH=$1 + EXT=".dylib" + if [ "$#" -gt 1 ]; then + FIX_PATH=$2 + fi + if [ "$#" -gt 2 ]; then + EXT=$3 + fi # some build systems do not handle @rpath on mac os correctly. # do check that and fix it. DYLIB_ABS_NAMES=$(find $SEARCH_PATH -type f -name "*$EXT") - for DYLIB_ABS in $DYLIB_ABS_NAMES; - do - DYLIB_NAME=$(basename $DYLIB_ABS) - install_name_tool -id @rpath/$DYLIB_NAME $DYLIB_ABS + for DYLIB_ABS in $DYLIB_ABS_NAMES; do + DYLIB_NAME=$(basename $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); - do - if [[ $DYLIB_DEP == $DYLIB_ABS ]]; - then - continue - elif [[ $DYLIB_DEP == $FIX_PATH/* ]]; - then - DEP_BASE=$(basename $DYLIB_DEP) - install_name_tool -change $DYLIB_DEP @rpath/$DEP_BASE $DYLIB_ABS - fi - done + for DYLIB_DEP in $(otool -L $DYLIB_ABS | grep "$FIX_PATH" | cut -d' ' -f1); do + if [[ $DYLIB_DEP == $DYLIB_ABS ]]; then + continue + elif [[ $DYLIB_DEP == $FIX_PATH/* ]]; then + DEP_BASE=$(basename $DYLIB_DEP) + install_name_tool -change $DYLIB_DEP @rpath/$DEP_BASE $DYLIB_ABS + fi + done done } replace_rpath() { - FILE=$1 - for PTH in $(otool -l $FILE | grep -A2 LC_RPATH | grep path | xargs -J ' ' | cut -d ' ' -f2); - do - install_name_tool -delete_rpath $PTH $FILE - done - install_name_tool -add_rpath @loader_path/../$LIBDIR $FILE + FILE=$1 + for PTH in $(otool -l $FILE | grep -A2 LC_RPATH | grep path | xargs -J ' ' | cut -d ' ' -f2); do + install_name_tool -delete_rpath $PTH $FILE + done + install_name_tool -add_rpath @loader_path/../$LIBDIR $FILE } CMAKE_ARCHS= OSSL_FLAGS="-mmacosx-version-min=$DEPLOYMENT_TARGET -I$INSTALL/include -L$INSTALL/lib" -for ARCH in $DEPLOYMENT_ARCH; -do - OSSL_FLAGS="$OSSL_FLAGS -arch $ARCH" - CMAKE_ARCHS="$ARCH;$CMAKE_ARCHS" +for ARCH in $DEPLOYMENT_ARCH; do + OSSL_FLAGS="$OSSL_FLAGS -arch $ARCH" + CMAKE_ARCHS="$ARCH;$CMAKE_ARCHS" done 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' " -if [ ! -d $SRC ]; -then - mkdir -p $SRC - cd $SRC - 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 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 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.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 -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 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 1.18.0 https://gitlab.freedesktop.org/cairo/cairo.git - git clone --depth 1 -b 1_30 https://github.com/knik0/faac.git - cd faac - ./bootstrap +if [ ! -d $SRC ]; then + mkdir -p $SRC + cd $SRC + 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 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 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.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 -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 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 1.18.0 https://gitlab.freedesktop.org/cairo/cairo.git + git clone --depth 1 -b 1_30 https://github.com/knik0/faac.git + cd faac + ./bootstrap fi -if [ -d $INSTALL ]; -then - rm -rf $INSTALL +if [ -d $INSTALL ]; then + rm -rf $INSTALL fi -if [ -d $BUILD ]; -then - rm -rf $BUILD +if [ -d $BUILD ]; then + rm -rf $BUILD fi mkdir -p $BUILD @@ -180,7 +167,7 @@ cmake --build zlib cmake --install zlib 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 --install uriparser @@ -201,7 +188,7 @@ cmake --build SDL cmake --install SDL 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 --install SDL_ttf @@ -210,7 +197,7 @@ cmake --build SDL_image cmake --install SDL_image 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 --install libusb-cmake @@ -226,29 +213,28 @@ mkdir -p faac cd faac # undefine __SSE2__, symbol clashes with universal build 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 install cd $BUILD 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 \ - -Dlibdir=lib openh264 $SRC/openh264 + -Dcpp_args="$OSSL_FLAGS" -Dcpp_link_args="$OSSL_FLAGS" -Dpkgconfig.relocatable=true -Dtests=disabled \ + -Dlibdir=lib openh264 $SRC/openh264 ninja -C openh264 install -for ARCH in $DEPLOYMENT_ARCH; -do - mkdir -p $BUILD/FFmpeg/$ARCH - cd $BUILD/FFmpeg/$ARCH - FFCFLAGS="-arch $ARCH -mmacosx-version-min=$DEPLOYMENT_TARGET" - FINSTPATH=$BUILD/FFmpeg/install/$ARCH - CFLAGS=$FFCFLAGS LDFLAGS=$FFCFLAGS $SRC/FFmpeg/configure --prefix=$FINSTPATH --disable-all \ - --enable-shared --disable-static --enable-swscale --disable-asm --disable-libxcb \ - --disable-securetransport --disable-xlib --enable-cross-compile - CFLAGS=$FFCFLAGS LDFLAGS=$FFCFLAGS make -j - CFLAGS=$FFCFLAGS LDFLAGS=$FFCFLAGS make -j install - fix_rpath "$FINSTPATH/lib" +for ARCH in $DEPLOYMENT_ARCH; do + mkdir -p $BUILD/FFmpeg/$ARCH + cd $BUILD/FFmpeg/$ARCH + FFCFLAGS="-arch $ARCH -mmacosx-version-min=$DEPLOYMENT_TARGET" + FINSTPATH=$BUILD/FFmpeg/install/$ARCH + CFLAGS=$FFCFLAGS LDFLAGS=$FFCFLAGS $SRC/FFmpeg/configure --prefix=$FINSTPATH --disable-all \ + --enable-shared --disable-static --enable-swscale --disable-asm --disable-libxcb \ + --disable-securetransport --disable-xlib --enable-cross-compile + CFLAGS=$FFCFLAGS LDFLAGS=$FFCFLAGS make -j + CFLAGS=$FFCFLAGS LDFLAGS=$FFCFLAGS make -j install + fix_rpath "$FINSTPATH/lib" done 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 {} \;) cd $BUILD/FFmpeg/install -for LIB in $BASE_LIBS; -do - LIBS=$(find . -name $LIB) - lipo $LIBS -output $INSTALL/lib/$LIB -create +for LIB in $BASE_LIBS; do + LIBS=$(find . -name $LIB) + lipo $LIBS -output $INSTALL/lib/$LIB -create done cd $BUILD cmake -GNinja -Bfreerdp -S"$SCRIPT_PATH/.." \ - $CMAKE_ARGS \ - -DWITH_PLATFORM_SERVER=OFF \ - -DWITH_SIMD=ON \ - -DWITH_FFMPEG=OFF \ - -DWITH_VERBOSE_WINPR_ASSERT=OFF \ - -DWITH_OPENH264=ON \ - -DWITH_SWSCALE=ON \ - -DWITH_OPUS=ON \ - -DWITH_WEBVIEW=OFF \ - -DWITH_FAAD2=ON \ - -DWITH_FAAC=ON \ - -DWITH_INTERNAL_RC4=ON \ - -DWITH_INTERNAL_MD4=ON \ - -DWITH_INTERNAL_MD5=ON \ - -DCHANNEL_RDPEAR=OFF \ - -DWITH_CJSON_REQUIRED=ON + $CMAKE_ARGS \ + -DWITH_PLATFORM_SERVER=OFF \ + -DWITH_SIMD=ON \ + -DWITH_FFMPEG=OFF \ + -DWITH_VERBOSE_WINPR_ASSERT=OFF \ + -DWITH_OPENH264=ON \ + -DWITH_SWSCALE=ON \ + -DWITH_OPUS=ON \ + -DWITH_WEBVIEW=OFF \ + -DWITH_FAAD2=ON \ + -DWITH_FAAC=ON \ + -DWITH_INTERNAL_RC4=ON \ + -DWITH_INTERNAL_MD4=ON \ + -DWITH_INTERNAL_MD5=ON \ + -DCHANNEL_RDPEAR=OFF \ + -DWITH_CJSON_REQUIRED=ON cmake --build freerdp cmake --install freerdp # remove unused stuff from bin -find "$INSTALL" -name "*.a" -exec rm -f {} \; -find "$INSTALL" -name "*.la" -exec rm -f {} \; +find "$INSTALL" -name "*.a" -exec rm -f {} \; +find "$INSTALL" -name "*.la" -exec rm -f {} \; find "$INSTALL" -name sdl2-config -exec rm -f {} \; fix_rpath "$INSTALL/lib" @@ -301,14 +286,12 @@ mv lib $LIBDIR mv bin $BINDIR # update RPATH -for LIB in $(find $LIBDIR -type f -name "*.dylib"); -do - replace_rpath $LIB +for LIB in $(find $LIBDIR -type f -name "*.dylib"); do + replace_rpath $LIB done -for BIN in $(find $BINDIR -type f); -do - replace_rpath $BIN +for BIN in $(find $BINDIR -type f); do + replace_rpath $BIN done # clean up unused data diff --git a/scripts/cmake-format.sh b/scripts/cmake-format.sh index b6e997ea6..bec889bc8 100755 --- a/scripts/cmake-format.sh +++ b/scripts/cmake-format.sh @@ -6,38 +6,32 @@ SRC_PATH="${SCRIPT_PATH}/.." FORMAT_ARG="--check" REST_ARGS=$@ -if [ $# -ne 0 ] -then - if [ "$1" = "--help" ] || [ "$1" = "-h" ]; - then - echo "usage: $0 [options] [file, file, ...]" - echo "\t--check.-c ... run format check only, no files changed (default)" - echo "\t--format,-f ... format files in place" - echo "\t--help,-h ... print this help" +if [ $# -ne 0 ]; then + if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then + echo "usage: $0 [options] [file, file, ...]" + echo "\t--check.-c ... run format check only, no files changed (default)" + echo "\t--format,-f ... format files in place" + echo "\t--help,-h ... print this help" - exit 1 - fi + exit 1 + fi - if [ "$1" = "--check" ] || [ "$1" = "-c" ]; - then - FORMAT_ARG="--check" - REST_ARGS="${@:2}" - fi - if [ "$1" = "--format" ] || [ "$1" = "-f" ]; - then - FORMAT_ARG="-i" - REST_ARGS="${@:2}" - fi + if [ "$1" = "--check" ] || [ "$1" = "-c" ]; then + FORMAT_ARG="--check" + REST_ARGS="${@:2}" + fi + if [ "$1" = "--format" ] || [ "$1" = "-f" ]; then + FORMAT_ARG="-i" + REST_ARGS="${@:2}" + fi fi -if [ ! -n "$REST_ARGS" ]; -then - CMAKE_FILES=$(find ${SRC_PATH} -name "*.cmake" -o -name "CMakeLists.txt") - CMAKE_CI_FILES=$(find ${SRC_PATH}/ci -name "*.txt") +if [ ! -n "$REST_ARGS" ]; then + CMAKE_FILES=$(find ${SRC_PATH} -name "*.cmake" -o -name "CMakeLists.txt") + CMAKE_CI_FILES=$(find ${SRC_PATH}/ci -name "*.txt") fi -for FILE in $CMAKE_FILES $CMAKE_CI_FILES $REST_ARGS; -do - echo "processing file $FILE..." - cmake-format -c "$SCRIPT_PATH/cmake-format.yml" $FORMAT_ARG $FILE +for FILE in $CMAKE_FILES $CMAKE_CI_FILES $REST_ARGS; do + echo "processing file $FILE..." + cmake-format -c "$SCRIPT_PATH/cmake-format.yml" $FORMAT_ARG $FILE done diff --git a/scripts/codespell.sh b/scripts/codespell.sh index 0e72b96a3..3fcf78753 100755 --- a/scripts/codespell.sh +++ b/scripts/codespell.sh @@ -10,7 +10,7 @@ SCRIPT_PATH=$(realpath "$SCRIPT_PATH") # 3. Every word prefixed by e.g. '\tSome text', e.g. format string escapes codespell --version codespell \ - -I "$SCRIPT_PATH/codespell.ignore" \ - -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].*" \ - --count $SCRIPT_PATH/.. + -I "$SCRIPT_PATH/codespell.ignore" \ + -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].*" \ + --count $SCRIPT_PATH/.. diff --git a/scripts/create_release_tarball.sh b/scripts/create_release_tarball.sh index fffe954c7..13994984d 100755 --- a/scripts/create_release_tarball.sh +++ b/scripts/create_release_tarball.sh @@ -1,55 +1,56 @@ #!/bin/bash -e function run { - "$@" - RES=$? - if [[ $RES -ne 0 ]]; - then - echo "[ERROR] $@ returned $RES" >&2 - exit 1 - fi + "$@" + RES=$? + if [[ $RES -ne 0 ]]; then + echo "[ERROR] $@ returned $RES" >&2 + exit 1 + fi } -if [ -z ${TAG:-} ];then - echo "No TAG set - trying to detect" - TAG=$(git describe --tags) - echo "Is the TAG ${TAG} ok (YES|NO)?" - read answ - case "$answ" in - YES): - ;; - *) - echo 'stopping here' - exit 1 - esac +if [ -z ${TAG:-} ]; then + echo "No TAG set - trying to detect" + TAG=$(git describe --tags) + echo "Is the TAG ${TAG} ok (YES|NO)?" + read answ + case "$answ" in + YES) + : + ;; + *) + echo 'stopping here' + exit 1 + ;; + esac fi function create_hash { - NAME=$1 - run md5sum ${NAME} > ${NAME}.md5 - run sha1sum ${NAME} > ${NAME}.sha1 - run sha256sum ${NAME} > ${NAME}.sha256 - run sha512sum ${NAME} > ${NAME}.sha512 + NAME=$1 + run md5sum ${NAME} >${NAME}.md5 + run sha1sum ${NAME} >${NAME}.sha1 + run sha256sum ${NAME} >${NAME}.sha256 + run sha512sum ${NAME} >${NAME}.sha512 } function create_tar { - ARGS=$1 - EXT=$2 - TAG=$3 + ARGS=$1 + EXT=$2 + TAG=$3 - NAME=freerdp-${TAG}${EXT} - run tar $ARGS ${NAME} freerdp-${TAG} - create_hash ${NAME} + NAME=freerdp-${TAG}${EXT} + run tar $ARGS ${NAME} freerdp-${TAG} + create_hash ${NAME} } TMPDIR=$(mktemp -d -t release-${TAG}-XXXXXXXXXX) 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 echo ${TAG} > ${TMPDIR}/freerdp-${TAG}/.source_version +run echo ${TAG} >${TMPDIR}/freerdp-${TAG}/.source_version pushd . -cd $TMPDIR +cd $TMPDIR create_tar czf .tar.gz ${TAG} create_tar cvjSf .tar.bz2 ${TAG} create_tar cfJ .tar.xz ${TAG} @@ -60,9 +61,8 @@ create_hash ${ZIPNAME} popd # Sign the release tarballs -for EXT in tar.gz tar.bz2 tar.xz zip; -do - run gpg --local-user 0xA49454A3FC909FD5 --sign --armor --output ${TMPDIR}/freerdp-${TAG}.${EXT}.asc --detach-sig ${TMPDIR}/freerdp-${TAG}.${EXT} +for EXT in tar.gz tar.bz2 tar.xz zip; do + run gpg --local-user 0xA49454A3FC909FD5 --sign --armor --output ${TMPDIR}/freerdp-${TAG}.${EXT}.asc --detach-sig ${TMPDIR}/freerdp-${TAG}.${EXT} done run mv ${TMPDIR}/freerdp-${TAG}.tar* . @@ -70,9 +70,8 @@ run mv ${TMPDIR}/freerdp-${TAG}.zip* . run rm -rf ${TMPDIR} # Verify the release tarball signatures -for EXT in tar.gz tar.bz2 tar.xz zip; -do - run gpg --verify freerdp-${TAG}.${EXT}.asc +for EXT in tar.gz tar.bz2 tar.xz zip; do + run gpg --verify freerdp-${TAG}.${EXT}.asc done exit 0 diff --git a/scripts/xcode.sh b/scripts/xcode.sh index f86faa95a..9c94f8a31 100755 --- a/scripts/xcode.sh +++ b/scripts/xcode.sh @@ -16,59 +16,59 @@ BUILDTYPE=-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:Debug}" MANPAGES=-DWITH_MANPAGES="${WITHMANPAGES:NO}" # 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} cmake ${BUILDTYPE} -G "$GEN" ${ARCH} ../ 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} cmake ${BUILDTYPE} -G "$GEN" ${ARCH} ../ popd # Check for errors; otherwise, ask for compile. if [ "$?" -ne 0 ]; then - echo "CMake failed. Please check error messages" - popd > /dev/null - exit + echo "CMake failed. Please check error messages" + popd >/dev/null + exit else - popd - while true - do - echo -n "Compile FreeRDP? (y or n) - (y recommended for MacFreeRDP compilation):" - read CONFIRM - case $CONFIRM in - y|Y|YES|yes|Yes) - pushd ./${XCODE_PROJ_DIR} - xcodebuild - popd - break ;; - n|N|no|NO|No) - echo OK - you entered $CONFIRM - break - ;; - *) echo Please enter only y or n - esac - 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 + popd + while true; do + echo -n "Compile FreeRDP? (y or n) - (y recommended for MacFreeRDP compilation):" + read CONFIRM + case $CONFIRM in + y | Y | YES | yes | Yes) + pushd ./${XCODE_PROJ_DIR} + xcodebuild + popd + break + ;; + n | N | no | NO | No) + echo OK - you entered $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. " fi From c6bdf3a02e414609681a0fa3a723e318dfaed12d Mon Sep 17 00:00:00 2001 From: akallabeth Date: Tue, 25 Feb 2025 13:38:50 +0100 Subject: [PATCH 5/6] [ci,cmake] add workflow for cmake-format --- .github/workflows/{cmake-format.sh => cmake-format.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{cmake-format.sh => cmake-format.yml} (100%) diff --git a/.github/workflows/cmake-format.sh b/.github/workflows/cmake-format.yml similarity index 100% rename from .github/workflows/cmake-format.sh rename to .github/workflows/cmake-format.yml From feb88adcb8c5a44a12b43efd289e208d59fa50e0 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Tue, 25 Feb 2025 15:50:41 +0100 Subject: [PATCH 6/6] [packaging,flatpak] update dependencies --- packaging/flatpak/com.freerdp.FreeRDP.json | 59 ++++++++++---------- packaging/flatpak/modules/SDL2_image.json | 33 +++++++++++ packaging/flatpak/modules/SDL2_ttf.json | 33 +++++++++++ packaging/flatpak/modules/SDL3.json | 33 +++++++++++ packaging/flatpak/modules/SDL3_image.json | 33 +++++++++++ packaging/flatpak/modules/SDL3_ttf.json | 33 +++++++++++ packaging/flatpak/modules/cJSON.json | 20 +++++-- packaging/flatpak/modules/krb5.json | 17 ++++-- packaging/flatpak/modules/libusb.json | 22 ++++---- packaging/flatpak/modules/opensc.json | 20 +++++-- packaging/flatpak/modules/openssl.json | 9 +-- packaging/flatpak/modules/pcsc.json | 26 +++++---- packaging/flatpak/modules/pcsc.json.orig | 39 +++++++++++++ packaging/flatpak/modules/pkcs11-helper.json | 26 +++++++++ packaging/flatpak/modules/uriparser.json | 47 +++++++++------- packaging/flatpak/modules/xprop.json | 23 +++++--- 16 files changed, 374 insertions(+), 99 deletions(-) create mode 100644 packaging/flatpak/modules/SDL2_image.json create mode 100644 packaging/flatpak/modules/SDL2_ttf.json create mode 100644 packaging/flatpak/modules/SDL3.json create mode 100644 packaging/flatpak/modules/SDL3_image.json create mode 100644 packaging/flatpak/modules/SDL3_ttf.json create mode 100644 packaging/flatpak/modules/pcsc.json.orig create mode 100644 packaging/flatpak/modules/pkcs11-helper.json diff --git a/packaging/flatpak/com.freerdp.FreeRDP.json b/packaging/flatpak/com.freerdp.FreeRDP.json index 5151aeb85..d9d1e7f98 100644 --- a/packaging/flatpak/com.freerdp.FreeRDP.json +++ b/packaging/flatpak/com.freerdp.FreeRDP.json @@ -1,13 +1,21 @@ { + "add-build-extensions": { + "org.freedesktop.Platform.ffmpeg-full": { + "add-ld-path": ".", + "directory": "lib/ffmpeg", + "version": "24.08" + }, + "org.freedesktop.Platform.openh264": { + "add-ld-path": ".", + "directory": "lib/openh264", + "version": "2.5.0" + } + }, "app-id": "com.freerdp.FreeRDP", - "runtime": "org.freedesktop.Platform", - "runtime-version": "23.08", - "sdk": "org.freedesktop.Sdk", "build-options": { "cflags": "-O3", "cxxflags": "-O3" }, - "command": "freerdp.sh", "cleanup": [ "*.a", "*.la", @@ -19,33 +27,17 @@ "/share/examples", "/share/man" ], + "command": "freerdp.sh", "finish-args": [ "--device=dri", - /* X11 + XShm access */ "--share=ipc", "--socket=x11", - /* Needs to talk to the network */ "--share=network", - /* Play sounds redirected from guests */ "--socket=pulseaudio", "--socket=cups", - /* Wayland access */ "--socket=wayland", - /* Allow rw access to download folder */ "--filesystem=xdg-download" ], - "add-build-extensions": { - "org.freedesktop.Platform.ffmpeg-full": { - "directory": "lib/ffmpeg", - "version": "23.08", - "add-ld-path": "." - }, - "org.freedesktop.Platform.openh264": { - "directory": "lib/openh264", - "version": "2.4.1", - "add-ld-path": "." - } - }, "modules": [ "modules/openssl.json", "modules/libusb.json", @@ -55,10 +47,13 @@ "modules/pcsc.json", "modules/krb5.json", "modules/opensc.json", + "modules/pkcs11-helper.json", + "modules/SDL3.json", + "modules/SDL3_image.json", + "modules/SDL3_ttf.json", { - "name": "freerdp", - "buildsystem": "cmake-ninja", "builddir": true, + "buildsystem": "cmake-ninja", "cleanup": [], "config-opts": [ "-DCMAKE_VERBOSE_MAKEFILE=ON", @@ -92,27 +87,31 @@ "-DWITH_WEBVIEW:BOOL=OFF", "-DWITH_PULSE:BOOL=ON" ], + "name": "freerdp", "sources": [ { - "type": "dir", - "path": "../.." + "path": "../..", + "type": "dir" } ] }, { - "name": "wrapper", - "buildsystem": "simple", "build-commands": [ "install -D freerdp.sh /app/bin/freerdp.sh", "mkdir -p /app/lib/ffmpeg", "mkdir -p /app/lib/openh264" ], + "buildsystem": "simple", + "name": "wrapper", "sources": [ { - "type": "file", - "path": "freerdp.sh" + "path": "freerdp.sh", + "type": "file" } ] } - ] + ], + "runtime": "org.freedesktop.Platform", + "runtime-version": "24.08", + "sdk": "org.freedesktop.Sdk" } diff --git a/packaging/flatpak/modules/SDL2_image.json b/packaging/flatpak/modules/SDL2_image.json new file mode 100644 index 000000000..0dfb9bc1a --- /dev/null +++ b/packaging/flatpak/modules/SDL2_image.json @@ -0,0 +1,33 @@ +{ + "builddir": true, + "buildsystem": "cmake-ninja", + "cleanup": [ + "/include", + "/lib/*.la", + "/lib/*.a", + "/lib/cmake", + "/share/aclocal", + "/lib/pkgconfig" + ], + "config-opts": [ + "-DCMAKE_VERBOSE_MAKEFILE=ON", + "-DCMAKE_BUILD_TYPE:STRING=Release", + "-DCMAKE_INSTALL_LIBDIR:PATH=lib" + ], + "name": "SDL2_image", + "sources": [ + { + "sha256": "f7c06a8783952cfe960adccdd3d8472b63ab31475b4390d10cfdcc1aea61238f", + "type": "archive", + "url": + "https://github.com/libsdl-org/SDL_image/releases/download/release-2.8.4/SDL2_image-2.8.4.tar.gz", + "x-checker-data": { + "project-id": 4781, + "stable-only": true, + "type": "anitya", + "url-template": + "https://github.com/libsdl-org/SDL_image/releases/download/release-${version0}.${version1}.${version2}/SDL2_image-${version0}.${version1}.${version2}.tar.gz" + } + } + ] +} diff --git a/packaging/flatpak/modules/SDL2_ttf.json b/packaging/flatpak/modules/SDL2_ttf.json new file mode 100644 index 000000000..3568d732e --- /dev/null +++ b/packaging/flatpak/modules/SDL2_ttf.json @@ -0,0 +1,33 @@ +{ + "builddir": true, + "buildsystem": "cmake-ninja", + "cleanup": [ + "/include", + "/lib/*.la", + "/lib/*.a", + "/lib/cmake", + "/share/aclocal", + "/lib/pkgconfig" + ], + "config-opts": [ + "-DCMAKE_VERBOSE_MAKEFILE=ON", + "-DCMAKE_BUILD_TYPE:STRING=Release", + "-DCMAKE_INSTALL_LIBDIR:PATH=lib" + ], + "name": "SDL2_ttf", + "sources": [ + { + "sha256": "0b2bf1e7b6568adbdbc9bb924643f79d9dedafe061fa1ed687d1d9ac4e453bfd", + "type": "archive", + "url": + "https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.24.0/SDL2_ttf-2.24.0.tar.gz", + "x-checker-data": { + "project-id": 4784, + "stable-only": true, + "type": "anitya", + "url-template": + "https://github.com/libsdl-org/SDL_ttf/releases/download/release-${version0}.${version1}.${version2}/SDL2_ttf-${version0}.${version1}.${version2}.tar.gz" + } + } + ] +} diff --git a/packaging/flatpak/modules/SDL3.json b/packaging/flatpak/modules/SDL3.json new file mode 100644 index 000000000..1470eb3ef --- /dev/null +++ b/packaging/flatpak/modules/SDL3.json @@ -0,0 +1,33 @@ +{ + "builddir": true, + "buildsystem": "cmake-ninja", + "cleanup": [ + "/include", + "/lib/*.la", + "/lib/*.a", + "/lib/cmake", + "/share/aclocal", + "/lib/pkgconfig" + ], + "config-opts": [ + "-DCMAKE_VERBOSE_MAKEFILE=ON", + "-DCMAKE_BUILD_TYPE:STRING=Release", + "-DCMAKE_INSTALL_LIBDIR:PATH=lib" + ], + "name": "SDL3", + "sources": [ + { + "sha256": "2938328317301dfbe30176d79c251733aa5e7ec5c436c800b99ed4da7adcb0f0", + "type": "archive", + "url": + "https://github.com/libsdl-org/SDL/releases/download/release-3.2.4/SDL3-3.2.4.tar.gz", + "x-checker-data": { + "project-id": 4781, + "stable-only": true, + "type": "anitya", + "url-template": + "https://github.com/libsdl-org/SDL_image/releases/download/release-${version0}.${version1}.${version2}/SDL3-${version0}.${version1}.${version2}.tar.gz" + } + } + ] +} diff --git a/packaging/flatpak/modules/SDL3_image.json b/packaging/flatpak/modules/SDL3_image.json new file mode 100644 index 000000000..a68cb7616 --- /dev/null +++ b/packaging/flatpak/modules/SDL3_image.json @@ -0,0 +1,33 @@ +{ + "builddir": true, + "buildsystem": "cmake-ninja", + "cleanup": [ + "/include", + "/lib/*.la", + "/lib/*.a", + "/lib/cmake", + "/share/aclocal", + "/lib/pkgconfig" + ], + "config-opts": [ + "-DCMAKE_VERBOSE_MAKEFILE=ON", + "-DCMAKE_BUILD_TYPE:STRING=Release", + "-DCMAKE_INSTALL_LIBDIR:PATH=lib" + ], + "name": "SDL3_image", + "sources": [ + { + "sha256": "1690baea71b2b4ded9895126cddbc03a1000b027d099a4fb4669c4d23d73b19f", + "type": "archive", + "url": + "https://github.com/libsdl-org/SDL_image/releases/download/release-3.2.0/SDL3_image-3.2.0.tar.gz", + "x-checker-data": { + "project-id": 4781, + "stable-only": true, + "type": "anitya", + "url-template": + "https://github.com/libsdl-org/SDL_image/releases/download/release-${version0}.${version1}.${version2}/SDL3_image-${version0}.${version1}.${version2}.tar.gz" + } + } + ] +} diff --git a/packaging/flatpak/modules/SDL3_ttf.json b/packaging/flatpak/modules/SDL3_ttf.json new file mode 100644 index 000000000..b9eed39cc --- /dev/null +++ b/packaging/flatpak/modules/SDL3_ttf.json @@ -0,0 +1,33 @@ +{ + "builddir": true, + "buildsystem": "cmake-ninja", + "cleanup": [ + "/include", + "/lib/*.la", + "/lib/*.a", + "/lib/cmake", + "/share/aclocal", + "/lib/pkgconfig" + ], + "config-opts": [ + "-DCMAKE_VERBOSE_MAKEFILE=ON", + "-DCMAKE_BUILD_TYPE:STRING=Release", + "-DCMAKE_INSTALL_LIBDIR:PATH=lib" + ], + "name": "SDL3_ttf", + "sources": [ + { + "sha256": "0ac7c23d9a037d3e3922ea1027fd8e923f03b0840042a49cca7652d2b49989a6", + "type": "archive", + "url": + "https://github.com/libsdl-org/SDL_ttf/releases/download/prerelease-3.1.2/SDL3_ttf-3.1.2.tar.gz", + "x-checker-data": { + "project-id": 4784, + "stable-only": true, + "type": "anitya", + "url-template": + "https://github.com/libsdl-org/SDL_ttf/releases/download/release-${version0}.${version1}.${version2}/SDL3_ttf-${version0}.${version1}.${version2}.tar.gz" + } + } + ] +} diff --git a/packaging/flatpak/modules/cJSON.json b/packaging/flatpak/modules/cJSON.json index 603071751..ef7cf860b 100644 --- a/packaging/flatpak/modules/cJSON.json +++ b/packaging/flatpak/modules/cJSON.json @@ -1,18 +1,26 @@ { - "name": "cjson", + "builddir": true, "buildsystem": "cmake-ninja", "cleanup": [], "config-opts": [ "-DCMAKE_VERBOSE_MAKEFILE=ON", "-DCMAKE_BUILD_TYPE:STRING=Release", - "-DCMAKE_INSTALL_LIBDIR:PATH=lib" + "-DCMAKE_INSTALL_LIBDIR:PATH=lib", + "-DWITH_PULSE:BOOL=ON" ], + "name": "cjson", "sources": [ { - "type": "git", - "url": "https://github.com/DaveGamble/cJSON.git", - "tag": "v1.7.17", - "commit": "87d8f0961a01bf09bef98ff89bae9fdec42181ee" + "sha256": "3aa806844a03442c00769b83e99970be70fbef03735ff898f4811dd03b9f5ee5", + "type": "archive", + "url": "https://github.com/DaveGamble/cJSON/archive/refs/tags/v1.7.18.tar.gz", + "x-checker-data": { + "project-id": 21330, + "stable-only": true, + "type": "anitya", + "url-template": + "https://github.com/DaveGamble/cJSON/archive/refs/tags/v${version0}.${version1}.${version2}.tar.gz" + } } ] } diff --git a/packaging/flatpak/modules/krb5.json b/packaging/flatpak/modules/krb5.json index d60632862..84fe0a67f 100644 --- a/packaging/flatpak/modules/krb5.json +++ b/packaging/flatpak/modules/krb5.json @@ -1,12 +1,19 @@ { - "name": "krb5", "buildsystem": "autotools", - "subdir": "src", + "name": "krb5", "sources": [ { + "sha256": "b7a4cd5ead67fb08b980b21abd150ff7217e85ea320c9ed0c6dadd304840ad35", "type": "archive", - "url": "https://kerberos.org/dist/krb5/1.21/krb5-1.21.2.tar.gz", - "sha256": "9560941a9d843c0243a71b17a7ac6fe31c7cebb5bce3983db79e52ae7e850491" + "url": "https://kerberos.org/dist/krb5/1.21/krb5-1.21.3.tar.gz", + "x-checker-data": { + "project-id": 13287, + "stable-only": true, + "type": "anitya", + "url-template": + "https://kerberos.org/dist/krb5/${version0}.${version1}/krb5-${version0}.${version1}.${version2}.tar.gz" + } } - ] + ], + "subdir": "src" } diff --git a/packaging/flatpak/modules/libusb.json b/packaging/flatpak/modules/libusb.json index f0fffe7e2..5338987d6 100644 --- a/packaging/flatpak/modules/libusb.json +++ b/packaging/flatpak/modules/libusb.json @@ -1,22 +1,22 @@ { - "name": "libusb", - "config-opts": [ - "--disable-static" - ], "cleanup": [ "/lib/*.la", "/lib/pkgconfig", "/include" ], - "sources": [ - { - "type": "archive", - "url": - "https://github.com/libusb/libusb/releases/download/v1.0.27/libusb-1.0.27.tar.bz2", - "sha256": "ffaa41d741a8a3bee244ac8e54a72ea05bf2879663c098c82fc5757853441575" - } + "config-opts": [ + "--disable-static" ], + "name": "libusb", "post-install": [ "install -Dm644 COPYING /app/share/licenses/libusb/COPYING" + ], + "sources": [ + { + "sha256": "ffaa41d741a8a3bee244ac8e54a72ea05bf2879663c098c82fc5757853441575", + "type": "archive", + "url": + "https://github.com/libusb/libusb/releases/download/v1.0.27/libusb-1.0.27.tar.bz2" + } ] } diff --git a/packaging/flatpak/modules/opensc.json b/packaging/flatpak/modules/opensc.json index fc39e77f0..9a0d50f9f 100644 --- a/packaging/flatpak/modules/opensc.json +++ b/packaging/flatpak/modules/opensc.json @@ -1,13 +1,25 @@ { - "name": "opensc", "buildsystem": "autotools", "cleanup": [], - "config-opts": [], + "config-opts": [ + "--disable-assert", + "--disable-fuzzing", + "--disable-man", + "--disable-strict" + ], + "name": "opensc", "sources": [ { + "sha256": "f16291a031d86e570394762e9f35eaf2fcbc2337a49910f3feae42d54e1688cb", "type": "archive", - "url": "https://github.com/OpenSC/OpenSC/releases/download/0.25.0/opensc-0.25.0.tar.gz", - "sha256": "e6d7b66e2a508a377ac9d67aa463025d3c54277227be10bd08872e3407d6622f" + "url": "https://github.com/OpenSC/OpenSC/releases/download/0.26.1/opensc-0.26.1.tar.gz", + "x-checker-data": { + "project-id": 13287, + "stable-only": true, + "type": "anitya", + "url-template": + "https://github.com/OpenSC/OpenSC/tags/${version0}.${version1}.${version2}" + } } ] } diff --git a/packaging/flatpak/modules/openssl.json b/packaging/flatpak/modules/openssl.json index cb82474e5..b458aa94d 100644 --- a/packaging/flatpak/modules/openssl.json +++ b/packaging/flatpak/modules/openssl.json @@ -1,17 +1,18 @@ { - "name": "openssl", - "buildsystem": "simple", "build-commands": [ "./config --prefix=/app --openssldir=/app --libdir=lib shared", "make -j build_sw", "make -j install_sw" ], + "buildsystem": "simple", "cleanup": [], + "name": "openssl", "sources": [ { + "sha256": "002a2d6b30b58bf4bea46c43bdd96365aaf8daa6c428782aa4feee06da197df3", "type": "archive", - "url": "https://openssl.org/source/openssl-3.1.5.tar.gz", - "sha256": "6ae015467dabf0469b139ada93319327be24b98251ffaeceda0221848dc09262" + "url": + "https://github.com/openssl/openssl/releases/download/openssl-3.4.1/openssl-3.4.1.tar.gz" } ] } diff --git a/packaging/flatpak/modules/pcsc.json b/packaging/flatpak/modules/pcsc.json index f5181b235..884fb1c1d 100644 --- a/packaging/flatpak/modules/pcsc.json +++ b/packaging/flatpak/modules/pcsc.json @@ -1,23 +1,29 @@ { - "name": "pcsc", + "cleanup": [ + "/share/doc", + "/share/man" + ], "config-opts": [ "--disable-libsystemd", "--enable-pic", "--disable-libusb", - "--disable-polkit", "--enable-shared", + "--disable-polkit", "--with-systemdsystemunitdir=/app/lib/systemd/" ], + "name": "pcsc", "sources": [ { - "type": "git", - "url": "https://github.com/LudovicRousseau/PCSC.git", - "tag": "2.0.3", - "commit": "c4e7f6f9c6fe56fafd3f13c31fcc4f670ad6d022" + "sha256": "7fcb59f66a323f63cf1ab492579a57d899806835c52ba377af9ac57df68bf39b", + "type": "archive", + "url": "https://github.com/LudovicRousseau/PCSC/archive/refs/tags/2.3.1.tar.gz", + "x-checker-data": { + "project-id": 2611, + "stable-only": true, + "type": "anitya", + "url-template": + "https://github.com/LudovicRousseau/PCSC/tags/${version0}.${version1}.${version2}" + } } - ], - "cleanup": [ - "/share/doc", - "/share/man" ] } diff --git a/packaging/flatpak/modules/pcsc.json.orig b/packaging/flatpak/modules/pcsc.json.orig new file mode 100644 index 000000000..7136843ef --- /dev/null +++ b/packaging/flatpak/modules/pcsc.json.orig @@ -0,0 +1,39 @@ +{ + "name": "pcsc", + "config-opts": [ + "--disable-libsystemd", + "--enable-pic", + "--disable-libusb", + "--enable-shared", +<<<<<<< HEAD +======= + "--disable-polkit", +>>>>>>> beta + "--with-systemdsystemunitdir=/app/lib/systemd/" + ], + "sources": [ + { +<<<<<<< HEAD + "type": "git", + "url": "https://github.com/LudovicRousseau/PCSC.git", + "tag": "2.0.0", + "commit": "549922c1355fdd1e85eb0a952fefda7bb96e286a" +======= + "type": "git", + "url": "https://github.com/LudovicRousseau/PCSC.git", + "tag": "2.3.0", + "commit": "a2c25c5fa25b5e2400fe6a002ea2263069ebd94f", + "x-checker-data": { + "type": "anitya", + "project-id": 2611, + "stable-only": true, + "url-template": "https://github.com/LudovicRousseau/PCSC/tags/${version0}.${version1}.${version2}" + } +>>>>>>> beta + } + ], + "cleanup": [ + "/share/doc", + "/share/man" + ] +} diff --git a/packaging/flatpak/modules/pkcs11-helper.json b/packaging/flatpak/modules/pkcs11-helper.json new file mode 100644 index 000000000..4190da67b --- /dev/null +++ b/packaging/flatpak/modules/pkcs11-helper.json @@ -0,0 +1,26 @@ +{ + "buildsystem": "autotools", + "name": "pkcs11-helper", + "sources": [ + { + "sha256": "076c9f664812a45f2da25efc157338b0b8bb1949117f0144050fec176b6fdf78", + "type": "archive", + "url": + "https://github.com/OpenSC/pkcs11-helper/archive/refs/tags/pkcs11-helper-1.30.0.tar.gz", + "x-checker-data": { + "project-id": 91990, + "stable-only": true, + "type": "anitya", + "url-template": + "https://github.com/OpenSC/pkcs11-helper/archive/refs/tags/pkcs11-helper-$version.tar.gz" + } + }, + { + "commands": [ + "autoreconf -vfi" + ], + "dest-filename": "autogen.sh", + "type": "script" + } + ] +} diff --git a/packaging/flatpak/modules/uriparser.json b/packaging/flatpak/modules/uriparser.json index db5ac9b2b..58783dc1e 100644 --- a/packaging/flatpak/modules/uriparser.json +++ b/packaging/flatpak/modules/uriparser.json @@ -1,23 +1,28 @@ { - "name": "uriparser", - "buildsystem": "cmake-ninja", - "cleanup": [ - ], - "config-opts": [ - "-DCMAKE_VERBOSE_MAKEFILE=ON", - "-DCMAKE_BUILD_TYPE:STRING=Release", - "-DCMAKE_INSTALL_LIBDIR:PATH=lib", - "-DURIPARSER_BUILD_TESTS:BOOL=OFF", - "-DURIPARSER_BUILD_DOCS:BOOL=OFF", - "-DURIPARSER_BUILD_TOOLS:BOOL=OFF", - "-DURIPARSER_BUILD_WCHAR_T:BOOL=OFF" - ], - "sources": [ - { - "type": "git", - "url": "https://github.com/uriparser/uriparser.git", - "tag": "uriparser-0.9.7", - "commit": "634b678fa858abf1d1ebc0634e96e9e29596e92a" - } - ] + "builddir": true, + "buildsystem": "cmake-ninja", + "cleanup": [], + "config-opts": [ + "-DCMAKE_VERBOSE_MAKEFILE=ON", + "-DCMAKE_BUILD_TYPE:STRING=Release", + "-DCMAKE_INSTALL_LIBDIR:PATH=lib", + "-DURIPARSER_BUILD_DOCS:BOOL=OFF", + "-DURIPARSER_BUILD_TESTS:BOOL=OFF" + ], + "name": "urlparser", + "sources": [ + { + "sha256": "1d71c054837ea32a31e462bce5a1af272379ecf511e33448e88100b87ff73b2e", + "type": "archive", + "url": + "https://github.com/uriparser/uriparser/releases/download/uriparser-0.9.8/uriparser-0.9.8.tar.xz", + "x-checker-data": { + "project-id": 10160, + "stable-only": true, + "type": "anitya", + "url-template": + "https://github.com/uriparser/uriparser/releases/download/uriparser-${version0}.${version1}.${version2}/uriparser-${version0}.${version1}.${version2}.tar.xz" + } + } + ] } diff --git a/packaging/flatpak/modules/xprop.json b/packaging/flatpak/modules/xprop.json index c84451a61..2a9003f58 100644 --- a/packaging/flatpak/modules/xprop.json +++ b/packaging/flatpak/modules/xprop.json @@ -1,14 +1,21 @@ { - "name": "xprop", - "sources": [ - { - "type": "archive", - "url": "https://xorg.freedesktop.org/releases/individual/app/xprop-1.2.7.tar.xz", - "sha256": "4436e3148bb91a162406230d9f736a49ca8b50b74790015dc15d78d6ce8e825f" - } - ], "cleanup": [ "/share/doc", "/share/man" + ], + "name": "xprop", + "sources": [ + { + "sha256": "d689e2adb7ef7b439f6469b51cda8a7daefc83243854c2a3b8f84d0f029d67ee", + "type": "archive", + "url": "https://xorg.freedesktop.org/releases/individual/app/xprop-1.2.8.tar.xz", + "x-checker-data": { + "project-id": 14958, + "stable-only": true, + "type": "anitya", + "url-template": + "https://xorg.freedesktop.org/releases/individual/app/xprop-${version0}.${version1}.${version2}.tar.xz" + } + } ] }