Compare commits
15 Commits
master
...
macos_buil
Author | SHA1 | Date | |
---|---|---|---|
|
bf3f1d557f | ||
|
c0a49e2e40 | ||
|
fa293d4a79 | ||
|
81f658a34d | ||
|
79e79cc765 | ||
|
d2e8f93a73 | ||
|
e5f480f707 | ||
|
1569de761b | ||
|
efea97a026 | ||
|
39acd9a316 | ||
|
2fe45b58ef | ||
|
0c840829b8 | ||
|
eb0246baae | ||
|
901d4ee3e1 | ||
|
6af81e10ba |
292
.github/workflows/release.yml
vendored
292
.github/workflows/release.yml
vendored
@ -6,11 +6,15 @@ on:
|
|||||||
name:
|
name:
|
||||||
description: 'Version name (default is ref name)'
|
description: 'Version name (default is ref name)'
|
||||||
|
|
||||||
|
env:
|
||||||
|
# $VERSION is used by release scripts
|
||||||
|
VERSION: ${{ github.event.inputs.name || github.ref_name }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-scrcpy-server:
|
test-scrcpy-server:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
GRADLE: gradle # use native gradle instead of ./gradlew in release.mk
|
GRADLE: gradle # use native gradle instead of ./gradlew in scripts
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@ -22,16 +26,30 @@ jobs:
|
|||||||
java-version: '17'
|
java-version: '17'
|
||||||
|
|
||||||
- name: Test scrcpy-server
|
- name: Test scrcpy-server
|
||||||
run: make -f release.mk test-server
|
run: release/test_server.sh
|
||||||
|
|
||||||
|
build-scrcpy-server:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
GRADLE: gradle # use native gradle instead of ./gradlew in scripts
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup JDK
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: 'zulu'
|
||||||
|
java-version: '17'
|
||||||
|
|
||||||
- name: Build scrcpy-server
|
- name: Build scrcpy-server
|
||||||
run: make -f release.mk build-server
|
run: release/build_server.sh
|
||||||
|
|
||||||
- name: Upload scrcpy-server artifact
|
- name: Upload scrcpy-server artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: scrcpy-server
|
name: scrcpy-server
|
||||||
path: build-server/server/scrcpy-server
|
path: release/work/build-server/server/scrcpy-server
|
||||||
|
|
||||||
test-client:
|
test-client:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -46,13 +64,36 @@ jobs:
|
|||||||
libsdl2-dev libavcodec-dev libavdevice-dev libavformat-dev \
|
libsdl2-dev libavcodec-dev libavdevice-dev libavformat-dev \
|
||||||
libavutil-dev libswresample-dev libusb-1.0-0 libusb-1.0-0-dev
|
libavutil-dev libswresample-dev libusb-1.0-0 libusb-1.0-0-dev
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
meson setup d -Db_sanitize=address,undefined
|
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
|
run: release/test_client.sh
|
||||||
|
|
||||||
|
build-linux:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
meson test -Cd
|
sudo apt update
|
||||||
|
sudo apt install -y meson ninja-build nasm libudev-dev
|
||||||
|
|
||||||
|
- name: Build linux
|
||||||
|
run: release/build_linux.sh
|
||||||
|
|
||||||
|
# upload-artifact does not preserve permissions
|
||||||
|
- name: Tar
|
||||||
|
run: |
|
||||||
|
cd release/work/build-linux
|
||||||
|
mkdir dist-tar
|
||||||
|
cd dist-tar
|
||||||
|
tar -C .. -cvf dist.tar.gz dist/
|
||||||
|
|
||||||
|
- name: Upload build-linux artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: build-linux-intermediate
|
||||||
|
path: release/work/build-linux/dist-tar/
|
||||||
|
|
||||||
build-win32:
|
build-win32:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -71,14 +112,22 @@ jobs:
|
|||||||
- name: Workaround for old meson version run by Github Actions
|
- name: Workaround for old meson version run by Github Actions
|
||||||
run: sed -i 's/^pkg-config/pkgconfig/' cross_win32.txt
|
run: sed -i 's/^pkg-config/pkgconfig/' cross_win32.txt
|
||||||
|
|
||||||
- name: Build scrcpy win32
|
- name: Build win32
|
||||||
run: make -f release.mk build-win32
|
run: release/build_windows.sh 32
|
||||||
|
|
||||||
|
# upload-artifact does not preserve permissions
|
||||||
|
- name: Tar
|
||||||
|
run: |
|
||||||
|
cd release/work/build-win32
|
||||||
|
mkdir dist-tar
|
||||||
|
cd dist-tar
|
||||||
|
tar -C .. -cvf dist.tar.gz dist/
|
||||||
|
|
||||||
- name: Upload build-win32 artifact
|
- name: Upload build-win32 artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: build-win32-intermediate
|
name: build-win32-intermediate
|
||||||
path: build-win32/dist/
|
path: release/work/build-win32/dist-tar/
|
||||||
|
|
||||||
build-win64:
|
build-win64:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -97,24 +146,56 @@ jobs:
|
|||||||
- name: Workaround for old meson version run by Github Actions
|
- name: Workaround for old meson version run by Github Actions
|
||||||
run: sed -i 's/^pkg-config/pkgconfig/' cross_win64.txt
|
run: sed -i 's/^pkg-config/pkgconfig/' cross_win64.txt
|
||||||
|
|
||||||
- name: Build scrcpy win64
|
- name: Build win64
|
||||||
run: make -f release.mk build-win64
|
run: release/build_windows.sh 64
|
||||||
|
|
||||||
|
# upload-artifact does not preserve permissions
|
||||||
|
- name: Tar
|
||||||
|
run: |
|
||||||
|
cd release/work/build-win64
|
||||||
|
mkdir dist-tar
|
||||||
|
cd dist-tar
|
||||||
|
tar -C .. -cvf dist.tar.gz dist/
|
||||||
|
|
||||||
- name: Upload build-win64 artifact
|
- name: Upload build-win64 artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: build-win64-intermediate
|
name: build-win64-intermediate
|
||||||
path: build-win64/dist/
|
path: release/work/build-win64/dist-tar/
|
||||||
|
|
||||||
package:
|
build-macos:
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
brew install meson ninja nasm libiconv zlib automake autoconf \
|
||||||
|
libtool
|
||||||
|
|
||||||
|
- name: Build macOS
|
||||||
|
run: release/build_macos.sh
|
||||||
|
|
||||||
|
# upload-artifact does not preserve permissions
|
||||||
|
- name: Tar
|
||||||
|
run: |
|
||||||
|
cd release/work/build-macos
|
||||||
|
mkdir dist-tar
|
||||||
|
cd dist-tar
|
||||||
|
tar -C .. -cvf dist.tar.gz dist/
|
||||||
|
|
||||||
|
- name: Upload build-macos artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: build-macos-intermediate
|
||||||
|
path: release/work/build-macos/dist-tar/
|
||||||
|
|
||||||
|
package-linux:
|
||||||
needs:
|
needs:
|
||||||
- build-scrcpy-server
|
- build-scrcpy-server
|
||||||
- build-win32
|
- build-linux
|
||||||
- build-win64
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
|
||||||
# $VERSION is used by release.mk
|
|
||||||
VERSION: ${{ github.event.inputs.name || github.ref_name }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@ -123,25 +204,180 @@ jobs:
|
|||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: scrcpy-server
|
name: scrcpy-server
|
||||||
path: build-server/server/
|
path: release/work/build-server/server/
|
||||||
|
|
||||||
|
- name: Download build-linux
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: build-linux-intermediate
|
||||||
|
path: release/work/build-linux/dist-tar/
|
||||||
|
|
||||||
|
# upload-artifact does not preserve permissions
|
||||||
|
- name: Detar
|
||||||
|
run: |
|
||||||
|
cd release/work/build-linux
|
||||||
|
tar xf dist-tar/dist.tar.gz
|
||||||
|
|
||||||
|
- name: Package linux
|
||||||
|
run: release/package_client.sh linux tar.gz
|
||||||
|
|
||||||
|
- name: Upload linux release
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: release-linux
|
||||||
|
path: release/output/
|
||||||
|
|
||||||
|
package-win32:
|
||||||
|
needs:
|
||||||
|
- build-scrcpy-server
|
||||||
|
- build-win32
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Download scrcpy-server
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: scrcpy-server
|
||||||
|
path: release/work/build-server/server/
|
||||||
|
|
||||||
- name: Download build-win32
|
- name: Download build-win32
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: build-win32-intermediate
|
name: build-win32-intermediate
|
||||||
path: build-win32/dist/
|
path: release/work/build-win32/dist-tar/
|
||||||
|
|
||||||
|
# upload-artifact does not preserve permissions
|
||||||
|
- name: Detar
|
||||||
|
run: |
|
||||||
|
cd release/work/build-win32
|
||||||
|
tar xf dist-tar/dist.tar.gz
|
||||||
|
|
||||||
|
- name: Package win32
|
||||||
|
run: release/package_client.sh win32 zip
|
||||||
|
|
||||||
|
- name: Upload win32 release
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: release-win32
|
||||||
|
path: release/output/
|
||||||
|
|
||||||
|
package-win64:
|
||||||
|
needs:
|
||||||
|
- build-scrcpy-server
|
||||||
|
- build-win64
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Download scrcpy-server
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: scrcpy-server
|
||||||
|
path: release/work/build-server/server/
|
||||||
|
|
||||||
- name: Download build-win64
|
- name: Download build-win64
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: build-win64-intermediate
|
name: build-win64-intermediate
|
||||||
path: build-win64/dist/
|
path: release/work/build-win64/dist-tar/
|
||||||
|
|
||||||
- name: Package
|
# upload-artifact does not preserve permissions
|
||||||
run: make -f release.mk package
|
- name: Detar
|
||||||
|
run: |
|
||||||
|
cd release/work/build-win64
|
||||||
|
tar xf dist-tar/dist.tar.gz
|
||||||
|
|
||||||
|
- name: Package win64
|
||||||
|
run: release/package_client.sh win64 zip
|
||||||
|
|
||||||
|
- name: Upload win64 release
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: release-win64
|
||||||
|
path: release/output
|
||||||
|
|
||||||
|
package-macos:
|
||||||
|
needs:
|
||||||
|
- build-scrcpy-server
|
||||||
|
- build-macos
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Download scrcpy-server
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: scrcpy-server
|
||||||
|
path: release/work/build-server/server/
|
||||||
|
|
||||||
|
- name: Download build-macos
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: build-macos-intermediate
|
||||||
|
path: release/work/build-macos/dist-tar/
|
||||||
|
|
||||||
|
# upload-artifact does not preserve permissions
|
||||||
|
- name: Detar
|
||||||
|
run: |
|
||||||
|
cd release/work/build-macos
|
||||||
|
tar xf dist-tar/dist.tar.gz
|
||||||
|
|
||||||
|
- name: Package macos
|
||||||
|
run: release/package_client.sh macos tar.gz
|
||||||
|
|
||||||
|
- name: Upload macos release
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: release-macos
|
||||||
|
path: release/output/
|
||||||
|
|
||||||
|
release:
|
||||||
|
needs:
|
||||||
|
- build-scrcpy-server
|
||||||
|
- build-linux
|
||||||
|
- package-win32
|
||||||
|
- package-win64
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Download scrcpy-server
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: scrcpy-server
|
||||||
|
path: release/work/build-server/server/
|
||||||
|
|
||||||
|
- name: Download release-linux
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: release-linux
|
||||||
|
path: release/output/
|
||||||
|
|
||||||
|
- name: Download release-win32
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: release-win32
|
||||||
|
path: release/output/
|
||||||
|
|
||||||
|
- name: Download release-win64
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: release-win64
|
||||||
|
path: release/output/
|
||||||
|
|
||||||
|
- name: Package server
|
||||||
|
run: release/package_server.sh
|
||||||
|
|
||||||
|
- name: Generate checksums
|
||||||
|
run: release/generate_checksums.sh
|
||||||
|
|
||||||
- name: Upload release artifact
|
- name: Upload release artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: scrcpy-release-${{ env.VERSION }}
|
name: scrcpy-release-${{ env.VERSION }}
|
||||||
path: release-${{ env.VERSION }}
|
path: release/output
|
||||||
|
6
app/data/scrcpy_static_wrapper.sh
Executable file
6
app/data/scrcpy_static_wrapper.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
cd "$(dirname ${BASH_SOURCE[0]})"
|
||||||
|
export ADB=./adb
|
||||||
|
export SCRCPY_SERVER_PATH=./scrcpy-server
|
||||||
|
export ICON=./icon.png
|
||||||
|
scrcpy "$@"
|
29
app/deps/adb_linux.sh
Executable file
29
app/deps/adb_linux.sh
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -ex
|
||||||
|
DEPS_DIR=$(dirname ${BASH_SOURCE[0]})
|
||||||
|
cd "$DEPS_DIR"
|
||||||
|
. common
|
||||||
|
|
||||||
|
VERSION=35.0.2
|
||||||
|
FILENAME=platform-tools_r$VERSION-linux.zip
|
||||||
|
PROJECT_DIR=platform-tools-$VERSION-linux
|
||||||
|
SHA256SUM=acfdcccb123a8718c46c46c059b2f621140194e5ec1ac9d81715be3d6ab6cd0a
|
||||||
|
|
||||||
|
cd "$SOURCES_DIR"
|
||||||
|
|
||||||
|
if [[ -d "$PROJECT_DIR" ]]
|
||||||
|
then
|
||||||
|
echo "$PWD/$PROJECT_DIR" found
|
||||||
|
else
|
||||||
|
get_file "https://dl.google.com/android/repository/$FILENAME" "$FILENAME" "$SHA256SUM"
|
||||||
|
mkdir -p "$PROJECT_DIR"
|
||||||
|
cd "$PROJECT_DIR"
|
||||||
|
ZIP_PREFIX=platform-tools
|
||||||
|
unzip "../$FILENAME" "$ZIP_PREFIX"/adb
|
||||||
|
mv "$ZIP_PREFIX"/* .
|
||||||
|
rmdir "$ZIP_PREFIX"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "$INSTALL_DIR/adb-linux"
|
||||||
|
cd "$INSTALL_DIR/adb-linux"
|
||||||
|
cp -r "$SOURCES_DIR/$PROJECT_DIR"/. "$INSTALL_DIR/adb-linux/"
|
29
app/deps/adb_macos.sh
Executable file
29
app/deps/adb_macos.sh
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -ex
|
||||||
|
DEPS_DIR=$(dirname ${BASH_SOURCE[0]})
|
||||||
|
cd "$DEPS_DIR"
|
||||||
|
. common
|
||||||
|
|
||||||
|
VERSION=35.0.2
|
||||||
|
FILENAME=platform-tools_r$VERSION-darwin.zip
|
||||||
|
PROJECT_DIR=platform-tools-$VERSION-darwin
|
||||||
|
SHA256SUM=1820078db90bf21628d257ff052528af1c61bb48f754b3555648f5652fa35d78
|
||||||
|
|
||||||
|
cd "$SOURCES_DIR"
|
||||||
|
|
||||||
|
if [[ -d "$PROJECT_DIR" ]]
|
||||||
|
then
|
||||||
|
echo "$PWD/$PROJECT_DIR" found
|
||||||
|
else
|
||||||
|
get_file "https://dl.google.com/android/repository/$FILENAME" "$FILENAME" "$SHA256SUM"
|
||||||
|
mkdir -p "$PROJECT_DIR"
|
||||||
|
cd "$PROJECT_DIR"
|
||||||
|
ZIP_PREFIX=platform-tools
|
||||||
|
unzip "../$FILENAME" "$ZIP_PREFIX"/adb
|
||||||
|
mv "$ZIP_PREFIX"/* .
|
||||||
|
rmdir "$ZIP_PREFIX"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "$INSTALL_DIR/adb-macos"
|
||||||
|
cd "$INSTALL_DIR/adb-macos"
|
||||||
|
cp -r "$SOURCES_DIR/$PROJECT_DIR"/. "$INSTALL_DIR/adb-macos/"
|
@ -6,7 +6,7 @@ cd "$DEPS_DIR"
|
|||||||
|
|
||||||
VERSION=35.0.2
|
VERSION=35.0.2
|
||||||
FILENAME=platform-tools_r$VERSION-win.zip
|
FILENAME=platform-tools_r$VERSION-win.zip
|
||||||
PROJECT_DIR=platform-tools-$VERSION
|
PROJECT_DIR=platform-tools-$VERSION-windows
|
||||||
SHA256SUM=2975a3eac0b19182748d64195375ad056986561d994fffbdc64332a516300bb9
|
SHA256SUM=2975a3eac0b19182748d64195375ad056986561d994fffbdc64332a516300bb9
|
||||||
|
|
||||||
cd "$SOURCES_DIR"
|
cd "$SOURCES_DIR"
|
||||||
@ -27,6 +27,6 @@ else
|
|||||||
rmdir "$ZIP_PREFIX"
|
rmdir "$ZIP_PREFIX"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p "$INSTALL_DIR/$HOST/bin"
|
mkdir -p "$INSTALL_DIR/adb-windows"
|
||||||
cd "$INSTALL_DIR/$HOST/bin"
|
cd "$INSTALL_DIR/adb-windows"
|
||||||
cp -r "$SOURCES_DIR/$PROJECT_DIR"/. "$INSTALL_DIR/$HOST/bin/"
|
cp -r "$SOURCES_DIR/$PROJECT_DIR"/. "$INSTALL_DIR/adb-windows/"
|
@ -1,25 +1,47 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# This file is intended to be sourced by other scripts, not executed
|
# This file is intended to be sourced by other scripts, not executed
|
||||||
|
|
||||||
if [[ $# != 1 ]]
|
process_args() {
|
||||||
then
|
if [[ $# != 3 ]]
|
||||||
# <host>: win32 or win64
|
then
|
||||||
echo "Syntax: $0 <host>" >&2
|
# <host>: win32 or win64
|
||||||
exit 1
|
# <build_type>: native or cross
|
||||||
fi
|
# <link_type>: static or shared
|
||||||
|
echo "Syntax: $0 <host> <build_type> <link_type>" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
HOST="$1"
|
HOST="$1"
|
||||||
|
BUILD_TYPE="$2" # native or cross
|
||||||
|
LINK_TYPE="$3" # static or shared
|
||||||
|
DIRNAME="$HOST-$BUILD_TYPE-$LINK_TYPE"
|
||||||
|
|
||||||
if [[ "$HOST" = win32 ]]
|
if [[ "$BUILD_TYPE" != native && "$BUILD_TYPE" != cross ]]
|
||||||
then
|
then
|
||||||
HOST_TRIPLET=i686-w64-mingw32
|
echo "Unsupported build type (expected native or cross): $BUILD_TYPE" >&2
|
||||||
elif [[ "$HOST" = win64 ]]
|
exit 1
|
||||||
then
|
fi
|
||||||
HOST_TRIPLET=x86_64-w64-mingw32
|
|
||||||
else
|
if [[ "$LINK_TYPE" != static && "$LINK_TYPE" != shared ]]
|
||||||
echo "Unsupported host: $HOST" >&2
|
then
|
||||||
exit 1
|
echo "Unsupported link type (expected static or shared): $LINK_TYPE" >&2
|
||||||
fi
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$BUILD_TYPE" == cross ]]
|
||||||
|
then
|
||||||
|
if [[ "$HOST" = win32 ]]
|
||||||
|
then
|
||||||
|
HOST_TRIPLET=i686-w64-mingw32
|
||||||
|
elif [[ "$HOST" = win64 ]]
|
||||||
|
then
|
||||||
|
HOST_TRIPLET=x86_64-w64-mingw32
|
||||||
|
else
|
||||||
|
echo "Unsupported cross-build to host: $HOST" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
DEPS_DIR=$(dirname ${BASH_SOURCE[0]})
|
DEPS_DIR=$(dirname ${BASH_SOURCE[0]})
|
||||||
cd "$DEPS_DIR"
|
cd "$DEPS_DIR"
|
||||||
@ -37,7 +59,7 @@ checksum() {
|
|||||||
local file="$1"
|
local file="$1"
|
||||||
local sum="$2"
|
local sum="$2"
|
||||||
echo "$file: verifying checksum..."
|
echo "$file: verifying checksum..."
|
||||||
echo "$sum $file" | sha256sum -c
|
echo "$sum $file" | shasum -a256 -c
|
||||||
}
|
}
|
||||||
|
|
||||||
get_file() {
|
get_file() {
|
||||||
|
@ -3,6 +3,7 @@ set -ex
|
|||||||
DEPS_DIR=$(dirname ${BASH_SOURCE[0]})
|
DEPS_DIR=$(dirname ${BASH_SOURCE[0]})
|
||||||
cd "$DEPS_DIR"
|
cd "$DEPS_DIR"
|
||||||
. common
|
. common
|
||||||
|
process_args "$@"
|
||||||
|
|
||||||
VERSION=7.1
|
VERSION=7.1
|
||||||
FILENAME=ffmpeg-$VERSION.tar.xz
|
FILENAME=ffmpeg-$VERSION.tar.xz
|
||||||
@ -22,68 +23,107 @@ fi
|
|||||||
mkdir -p "$BUILD_DIR/$PROJECT_DIR"
|
mkdir -p "$BUILD_DIR/$PROJECT_DIR"
|
||||||
cd "$BUILD_DIR/$PROJECT_DIR"
|
cd "$BUILD_DIR/$PROJECT_DIR"
|
||||||
|
|
||||||
if [[ "$HOST" = win32 ]]
|
if [[ -d "$DIRNAME" ]]
|
||||||
then
|
then
|
||||||
ARCH=x86
|
echo "'$PWD/$DIRNAME' already exists, not reconfigured"
|
||||||
elif [[ "$HOST" = win64 ]]
|
cd "$DIRNAME"
|
||||||
then
|
|
||||||
ARCH=x86_64
|
|
||||||
else
|
else
|
||||||
echo "Unsupported host: $HOST" >&2
|
mkdir "$DIRNAME"
|
||||||
exit 1
|
cd "$DIRNAME"
|
||||||
fi
|
|
||||||
|
|
||||||
# -static-libgcc to avoid missing libgcc_s_dw2-1.dll
|
if [[ "$HOST" == win* ]]
|
||||||
# -static to avoid dynamic dependency to zlib
|
then
|
||||||
export CFLAGS='-static-libgcc -static'
|
# -static-libgcc to avoid missing libgcc_s_dw2-1.dll
|
||||||
export CXXFLAGS="$CFLAGS"
|
# -static to avoid dynamic dependency to zlib
|
||||||
export LDFLAGS='-static-libgcc -static'
|
export CFLAGS='-static-libgcc -static'
|
||||||
|
export CXXFLAGS="$CFLAGS"
|
||||||
|
export LDFLAGS='-static-libgcc -static'
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -d "$HOST" ]]
|
conf=(
|
||||||
then
|
--prefix="$INSTALL_DIR/$DIRNAME"
|
||||||
echo "'$PWD/$HOST' already exists, not reconfigured"
|
--extra-cflags="-O2 -fPIC"
|
||||||
cd "$HOST"
|
--disable-programs
|
||||||
else
|
--disable-doc
|
||||||
mkdir "$HOST"
|
--disable-swscale
|
||||||
cd "$HOST"
|
--disable-postproc
|
||||||
|
--disable-avfilter
|
||||||
"$SOURCES_DIR/$PROJECT_DIR"/configure \
|
--disable-network
|
||||||
--prefix="$INSTALL_DIR/$HOST" \
|
--disable-everything
|
||||||
--enable-cross-compile \
|
|
||||||
--target-os=mingw32 \
|
|
||||||
--arch="$ARCH" \
|
|
||||||
--cross-prefix="${HOST_TRIPLET}-" \
|
|
||||||
--cc="${HOST_TRIPLET}-gcc" \
|
|
||||||
--extra-cflags="-O2 -fPIC" \
|
|
||||||
--enable-shared \
|
|
||||||
--disable-static \
|
|
||||||
--disable-programs \
|
|
||||||
--disable-doc \
|
|
||||||
--disable-swscale \
|
|
||||||
--disable-postproc \
|
|
||||||
--disable-avfilter \
|
|
||||||
--disable-avdevice \
|
|
||||||
--disable-network \
|
|
||||||
--disable-everything \
|
|
||||||
--enable-swresample \
|
|
||||||
--enable-decoder=h264 \
|
|
||||||
--enable-decoder=hevc \
|
|
||||||
--enable-decoder=av1 \
|
|
||||||
--enable-decoder=pcm_s16le \
|
|
||||||
--enable-decoder=opus \
|
|
||||||
--enable-decoder=aac \
|
|
||||||
--enable-decoder=flac \
|
|
||||||
--enable-decoder=png \
|
|
||||||
--enable-protocol=file \
|
|
||||||
--enable-demuxer=image2 \
|
|
||||||
--enable-parser=png \
|
|
||||||
--enable-zlib \
|
|
||||||
--enable-muxer=matroska \
|
|
||||||
--enable-muxer=mp4 \
|
|
||||||
--enable-muxer=opus \
|
|
||||||
--enable-muxer=flac \
|
|
||||||
--enable-muxer=wav \
|
|
||||||
--disable-vulkan
|
--disable-vulkan
|
||||||
|
--disable-vaapi
|
||||||
|
--disable-vdpau
|
||||||
|
--enable-swresample
|
||||||
|
--enable-decoder=h264
|
||||||
|
--enable-decoder=hevc
|
||||||
|
--enable-decoder=av1
|
||||||
|
--enable-decoder=pcm_s16le
|
||||||
|
--enable-decoder=opus
|
||||||
|
--enable-decoder=aac
|
||||||
|
--enable-decoder=flac
|
||||||
|
--enable-decoder=png
|
||||||
|
--enable-protocol=file
|
||||||
|
--enable-demuxer=image2
|
||||||
|
--enable-parser=png
|
||||||
|
--enable-zlib
|
||||||
|
--enable-muxer=matroska
|
||||||
|
--enable-muxer=mp4
|
||||||
|
--enable-muxer=opus
|
||||||
|
--enable-muxer=flac
|
||||||
|
--enable-muxer=wav
|
||||||
|
)
|
||||||
|
|
||||||
|
if [[ "$HOST" != linux ]]
|
||||||
|
then
|
||||||
|
# libavdevice is only used for V4L2 on Linux
|
||||||
|
conf+=(
|
||||||
|
--disable-avdevice
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$LINK_TYPE" == static ]]
|
||||||
|
then
|
||||||
|
conf+=(
|
||||||
|
--enable-static
|
||||||
|
--disable-shared
|
||||||
|
)
|
||||||
|
else
|
||||||
|
conf+=(
|
||||||
|
--disable-static
|
||||||
|
--enable-shared
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$BUILD_TYPE" == cross ]]
|
||||||
|
then
|
||||||
|
conf+=(
|
||||||
|
--enable-cross-compile
|
||||||
|
--cross-prefix="${HOST_TRIPLET}-"
|
||||||
|
--cc="${HOST_TRIPLET}-gcc"
|
||||||
|
)
|
||||||
|
|
||||||
|
case "$HOST" in
|
||||||
|
win32)
|
||||||
|
conf+=(
|
||||||
|
--target-os=mingw32
|
||||||
|
--arch=x86
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
|
||||||
|
win64)
|
||||||
|
conf+=(
|
||||||
|
--target-os=mingw32
|
||||||
|
--arch=x86_64
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo "Unsupported host: $HOST" >&2
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
"$SOURCES_DIR/$PROJECT_DIR"/configure "${conf[@]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
make -j
|
make -j
|
||||||
|
@ -3,6 +3,7 @@ set -ex
|
|||||||
DEPS_DIR=$(dirname ${BASH_SOURCE[0]})
|
DEPS_DIR=$(dirname ${BASH_SOURCE[0]})
|
||||||
cd "$DEPS_DIR"
|
cd "$DEPS_DIR"
|
||||||
. common
|
. common
|
||||||
|
process_args "$@"
|
||||||
|
|
||||||
VERSION=1.0.27
|
VERSION=1.0.27
|
||||||
FILENAME=libusb-$VERSION.tar.gz
|
FILENAME=libusb-$VERSION.tar.gz
|
||||||
@ -25,20 +26,40 @@ cd "$BUILD_DIR/$PROJECT_DIR"
|
|||||||
export CFLAGS='-O2'
|
export CFLAGS='-O2'
|
||||||
export CXXFLAGS="$CFLAGS"
|
export CXXFLAGS="$CFLAGS"
|
||||||
|
|
||||||
if [[ -d "$HOST" ]]
|
if [[ -d "$DIRNAME" ]]
|
||||||
then
|
then
|
||||||
echo "'$PWD/$HOST' already exists, not reconfigured"
|
echo "'$PWD/$DIRNAME' already exists, not reconfigured"
|
||||||
cd "$HOST"
|
cd "$DIRNAME"
|
||||||
else
|
else
|
||||||
mkdir "$HOST"
|
mkdir "$DIRNAME"
|
||||||
cd "$HOST"
|
cd "$DIRNAME"
|
||||||
|
|
||||||
|
conf=(
|
||||||
|
--prefix="$INSTALL_DIR/$DIRNAME"
|
||||||
|
)
|
||||||
|
|
||||||
|
if [[ "$LINK_TYPE" == static ]]
|
||||||
|
then
|
||||||
|
conf+=(
|
||||||
|
--enable-static
|
||||||
|
--disable-shared
|
||||||
|
)
|
||||||
|
else
|
||||||
|
conf+=(
|
||||||
|
--disable-static
|
||||||
|
--enable-shared
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$BUILD_TYPE" == cross ]]
|
||||||
|
then
|
||||||
|
conf+=(
|
||||||
|
--host="$HOST_TRIPLET"
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
"$SOURCES_DIR/$PROJECT_DIR"/bootstrap.sh
|
"$SOURCES_DIR/$PROJECT_DIR"/bootstrap.sh
|
||||||
"$SOURCES_DIR/$PROJECT_DIR"/configure \
|
"$SOURCES_DIR/$PROJECT_DIR"/configure "${conf[@]}"
|
||||||
--prefix="$INSTALL_DIR/$HOST" \
|
|
||||||
--host="$HOST_TRIPLET" \
|
|
||||||
--enable-shared \
|
|
||||||
--disable-static
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
make -j
|
make -j
|
||||||
|
@ -3,6 +3,7 @@ set -ex
|
|||||||
DEPS_DIR=$(dirname ${BASH_SOURCE[0]})
|
DEPS_DIR=$(dirname ${BASH_SOURCE[0]})
|
||||||
cd "$DEPS_DIR"
|
cd "$DEPS_DIR"
|
||||||
. common
|
. common
|
||||||
|
process_args "$@"
|
||||||
|
|
||||||
VERSION=2.30.9
|
VERSION=2.30.9
|
||||||
FILENAME=SDL-$VERSION.tar.gz
|
FILENAME=SDL-$VERSION.tar.gz
|
||||||
@ -25,23 +26,54 @@ cd "$BUILD_DIR/$PROJECT_DIR"
|
|||||||
export CFLAGS='-O2'
|
export CFLAGS='-O2'
|
||||||
export CXXFLAGS="$CFLAGS"
|
export CXXFLAGS="$CFLAGS"
|
||||||
|
|
||||||
if [[ -d "$HOST" ]]
|
if [[ -d "$DIRNAME" ]]
|
||||||
then
|
then
|
||||||
echo "'$PWD/$HOST' already exists, not reconfigured"
|
echo "'$PWD/$HDIRNAME' already exists, not reconfigured"
|
||||||
cd "$HOST"
|
cd "$DIRNAME"
|
||||||
else
|
else
|
||||||
mkdir "$HOST"
|
mkdir "$DIRNAME"
|
||||||
cd "$HOST"
|
cd "$DIRNAME"
|
||||||
|
|
||||||
"$SOURCES_DIR/$PROJECT_DIR"/configure \
|
conf=(
|
||||||
--prefix="$INSTALL_DIR/$HOST" \
|
--prefix="$INSTALL_DIR/$DIRNAME"
|
||||||
--host="$HOST_TRIPLET" \
|
)
|
||||||
--enable-shared \
|
|
||||||
--disable-static
|
if [[ "$HOST" == linux ]]
|
||||||
|
then
|
||||||
|
conf+=(
|
||||||
|
--enable-video-wayland
|
||||||
|
--enable-video-x11
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$LINK_TYPE" == static ]]
|
||||||
|
then
|
||||||
|
conf+=(
|
||||||
|
--enable-static
|
||||||
|
--disable-shared
|
||||||
|
)
|
||||||
|
else
|
||||||
|
conf+=(
|
||||||
|
--disable-static
|
||||||
|
--enable-shared
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$BUILD_TYPE" == cross ]]
|
||||||
|
then
|
||||||
|
conf+=(
|
||||||
|
--host="$HOST_TRIPLET"
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
"$SOURCES_DIR/$PROJECT_DIR"/configure "${conf[@]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
make -j
|
make -j
|
||||||
# There is no "make install-strip"
|
# There is no "make install-strip"
|
||||||
make install
|
make install
|
||||||
# Strip manually
|
# Strip manually
|
||||||
${HOST_TRIPLET}-strip "$INSTALL_DIR/$HOST/bin/SDL2.dll"
|
if [[ "$LINK_TYPE" == shared && "$HOST" == win* ]]
|
||||||
|
then
|
||||||
|
${HOST_TRIPLET}-strip "$INSTALL_DIR/$DIRNAME/bin/SDL2.dll"
|
||||||
|
fi
|
||||||
|
@ -109,20 +109,22 @@ endif
|
|||||||
|
|
||||||
cc = meson.get_compiler('c')
|
cc = meson.get_compiler('c')
|
||||||
|
|
||||||
|
static = get_option('static')
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
dependency('libavformat', version: '>= 57.33'),
|
dependency('libavformat', version: '>= 57.33', static: static),
|
||||||
dependency('libavcodec', version: '>= 57.37'),
|
dependency('libavcodec', version: '>= 57.37', static: static),
|
||||||
dependency('libavutil'),
|
dependency('libavutil', static: static),
|
||||||
dependency('libswresample'),
|
dependency('libswresample', static: static),
|
||||||
dependency('sdl2', version: '>= 2.0.5'),
|
dependency('sdl2', version: '>= 2.0.5', static: static),
|
||||||
]
|
]
|
||||||
|
|
||||||
if v4l2_support
|
if v4l2_support
|
||||||
dependencies += dependency('libavdevice')
|
dependencies += dependency('libavdevice', static: static)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if usb_support
|
if usb_support
|
||||||
dependencies += dependency('libusb-1.0')
|
dependencies += dependency('libusb-1.0', static: static)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if host_machine.system() == 'windows'
|
if host_machine.system() == 'windows'
|
||||||
|
@ -2,6 +2,7 @@ option('compile_app', type: 'boolean', value: true, description: 'Build the clie
|
|||||||
option('compile_server', type: 'boolean', value: true, description: 'Build the server')
|
option('compile_server', type: 'boolean', value: true, description: 'Build the server')
|
||||||
option('prebuilt_server', type: 'string', description: 'Path of the prebuilt server')
|
option('prebuilt_server', type: 'string', description: 'Path of the prebuilt server')
|
||||||
option('portable', type: 'boolean', value: false, description: 'Use scrcpy-server from the same directory as the scrcpy executable')
|
option('portable', type: 'boolean', value: false, description: 'Use scrcpy-server from the same directory as the scrcpy executable')
|
||||||
|
option('static', type: 'boolean', value: false, description: 'Use static dependencies')
|
||||||
option('server_debugger', type: 'boolean', value: false, description: 'Run a server debugger and wait for a client to be attached')
|
option('server_debugger', type: 'boolean', value: false, description: 'Run a server debugger and wait for a client to be attached')
|
||||||
option('server_debugger_method', type: 'combo', choices: ['old', 'new'], value: 'new', description: 'Select the debugger method (Android < 9: "old", Android >= 9: "new")')
|
option('server_debugger_method', type: 'combo', choices: ['old', 'new'], value: 'new', description: 'Select the debugger method (Android < 9: "old", Android >= 9: "new")')
|
||||||
option('v4l2', type: 'boolean', value: true, description: 'Enable V4L2 feature when supported')
|
option('v4l2', type: 'boolean', value: true, description: 'Enable V4L2 feature when supported')
|
||||||
|
141
release.mk
141
release.mk
@ -1,141 +0,0 @@
|
|||||||
# This makefile provides recipes to build a "portable" version of scrcpy for
|
|
||||||
# Windows.
|
|
||||||
#
|
|
||||||
# Here, "portable" means that the client and server binaries are expected to be
|
|
||||||
# anywhere, but in the same directory, instead of well-defined separate
|
|
||||||
# locations (e.g. /usr/bin/scrcpy and /usr/share/scrcpy/scrcpy-server).
|
|
||||||
#
|
|
||||||
# In particular, this implies to change the location from where the client push
|
|
||||||
# the server to the device.
|
|
||||||
|
|
||||||
.PHONY: default clean \
|
|
||||||
test test-client test-server \
|
|
||||||
build-server \
|
|
||||||
prepare-deps-win32 prepare-deps-win64 \
|
|
||||||
build-win32 build-win64 \
|
|
||||||
zip-win32 zip-win64 \
|
|
||||||
package release
|
|
||||||
|
|
||||||
GRADLE ?= ./gradlew
|
|
||||||
|
|
||||||
TEST_BUILD_DIR := build-test
|
|
||||||
SERVER_BUILD_DIR := build-server
|
|
||||||
WIN32_BUILD_DIR := build-win32
|
|
||||||
WIN64_BUILD_DIR := build-win64
|
|
||||||
|
|
||||||
VERSION ?= $(shell git describe --tags --exclude='*install-release' --always)
|
|
||||||
|
|
||||||
ZIP := zip
|
|
||||||
WIN32_TARGET_DIR := scrcpy-win32-$(VERSION)
|
|
||||||
WIN64_TARGET_DIR := scrcpy-win64-$(VERSION)
|
|
||||||
WIN32_TARGET := $(WIN32_TARGET_DIR).zip
|
|
||||||
WIN64_TARGET := $(WIN64_TARGET_DIR).zip
|
|
||||||
|
|
||||||
RELEASE_DIR := release-$(VERSION)
|
|
||||||
|
|
||||||
release: clean test build-server build-win32 build-win64 package
|
|
||||||
|
|
||||||
clean:
|
|
||||||
$(GRADLE) clean
|
|
||||||
rm -rf "$(ZIP)" "$(TEST_BUILD_DIR)" "$(SERVER_BUILD_DIR)" \
|
|
||||||
"$(WIN32_BUILD_DIR)" "$(WIN64_BUILD_DIR)"
|
|
||||||
|
|
||||||
test-client:
|
|
||||||
[ -d "$(TEST_BUILD_DIR)" ] || ( mkdir "$(TEST_BUILD_DIR)" && \
|
|
||||||
meson setup "$(TEST_BUILD_DIR)" -Db_sanitize=address )
|
|
||||||
ninja -C "$(TEST_BUILD_DIR)"
|
|
||||||
|
|
||||||
test-server:
|
|
||||||
$(GRADLE) -p server check
|
|
||||||
|
|
||||||
test: test-client test-server
|
|
||||||
|
|
||||||
build-server:
|
|
||||||
$(GRADLE) -p server assembleRelease
|
|
||||||
mkdir -p "$(SERVER_BUILD_DIR)/server"
|
|
||||||
cp server/build/outputs/apk/release/server-release-unsigned.apk \
|
|
||||||
"$(SERVER_BUILD_DIR)/server/scrcpy-server"
|
|
||||||
|
|
||||||
prepare-deps-win32:
|
|
||||||
@app/deps/adb.sh win32
|
|
||||||
@app/deps/sdl.sh win32
|
|
||||||
@app/deps/ffmpeg.sh win32
|
|
||||||
@app/deps/libusb.sh win32
|
|
||||||
|
|
||||||
prepare-deps-win64:
|
|
||||||
@app/deps/adb.sh win64
|
|
||||||
@app/deps/sdl.sh win64
|
|
||||||
@app/deps/ffmpeg.sh win64
|
|
||||||
@app/deps/libusb.sh win64
|
|
||||||
|
|
||||||
build-win32: prepare-deps-win32
|
|
||||||
rm -rf "$(WIN32_BUILD_DIR)"
|
|
||||||
mkdir -p "$(WIN32_BUILD_DIR)/local"
|
|
||||||
meson setup "$(WIN32_BUILD_DIR)" \
|
|
||||||
--pkg-config-path="app/deps/work/install/win32/lib/pkgconfig" \
|
|
||||||
-Dc_args="-I$(PWD)/app/deps/work/install/win32/include" \
|
|
||||||
-Dc_link_args="-L$(PWD)/app/deps/work/install/win32/lib" \
|
|
||||||
--cross-file=cross_win32.txt \
|
|
||||||
--buildtype=release --strip -Db_lto=true \
|
|
||||||
-Dcompile_server=false \
|
|
||||||
-Dportable=true
|
|
||||||
ninja -C "$(WIN32_BUILD_DIR)"
|
|
||||||
# Group intermediate outputs into a 'dist' directory
|
|
||||||
mkdir -p "$(WIN32_BUILD_DIR)/dist"
|
|
||||||
cp "$(WIN32_BUILD_DIR)"/app/scrcpy.exe "$(WIN32_BUILD_DIR)/dist/"
|
|
||||||
cp app/data/scrcpy-console.bat "$(WIN32_BUILD_DIR)/dist/"
|
|
||||||
cp app/data/scrcpy-noconsole.vbs "$(WIN32_BUILD_DIR)/dist/"
|
|
||||||
cp app/data/icon.png "$(WIN32_BUILD_DIR)/dist/"
|
|
||||||
cp app/data/open_a_terminal_here.bat "$(WIN32_BUILD_DIR)/dist/"
|
|
||||||
cp app/deps/work/install/win32/bin/*.dll "$(WIN32_BUILD_DIR)/dist/"
|
|
||||||
cp app/deps/work/install/win32/bin/adb.exe "$(WIN32_BUILD_DIR)/dist/"
|
|
||||||
|
|
||||||
build-win64: prepare-deps-win64
|
|
||||||
rm -rf "$(WIN64_BUILD_DIR)"
|
|
||||||
mkdir -p "$(WIN64_BUILD_DIR)/local"
|
|
||||||
meson setup "$(WIN64_BUILD_DIR)" \
|
|
||||||
--pkg-config-path="app/deps/work/install/win64/lib/pkgconfig" \
|
|
||||||
-Dc_args="-I$(PWD)/app/deps/work/install/win64/include" \
|
|
||||||
-Dc_link_args="-L$(PWD)/app/deps/work/install/win64/lib" \
|
|
||||||
--cross-file=cross_win64.txt \
|
|
||||||
--buildtype=release --strip -Db_lto=true \
|
|
||||||
-Dcompile_server=false \
|
|
||||||
-Dportable=true
|
|
||||||
ninja -C "$(WIN64_BUILD_DIR)"
|
|
||||||
# Group intermediate outputs into a 'dist' directory
|
|
||||||
mkdir -p "$(WIN64_BUILD_DIR)/dist"
|
|
||||||
cp "$(WIN64_BUILD_DIR)"/app/scrcpy.exe "$(WIN64_BUILD_DIR)/dist/"
|
|
||||||
cp app/data/scrcpy-console.bat "$(WIN64_BUILD_DIR)/dist/"
|
|
||||||
cp app/data/scrcpy-noconsole.vbs "$(WIN64_BUILD_DIR)/dist/"
|
|
||||||
cp app/data/icon.png "$(WIN64_BUILD_DIR)/dist/"
|
|
||||||
cp app/data/open_a_terminal_here.bat "$(WIN64_BUILD_DIR)/dist/"
|
|
||||||
cp app/deps/work/install/win64/bin/*.dll "$(WIN64_BUILD_DIR)/dist/"
|
|
||||||
cp app/deps/work/install/win64/bin/adb.exe "$(WIN64_BUILD_DIR)/dist/"
|
|
||||||
|
|
||||||
zip-win32:
|
|
||||||
mkdir -p "$(ZIP)/$(WIN32_TARGET_DIR)"
|
|
||||||
cp -r "$(WIN32_BUILD_DIR)/dist/." "$(ZIP)/$(WIN32_TARGET_DIR)/"
|
|
||||||
cp "$(SERVER_BUILD_DIR)"/server/scrcpy-server "$(ZIP)/$(WIN32_TARGET_DIR)/"
|
|
||||||
cd "$(ZIP)"; \
|
|
||||||
zip -r "$(WIN32_TARGET)" "$(WIN32_TARGET_DIR)"
|
|
||||||
rm -rf "$(ZIP)/$(WIN32_TARGET_DIR)"
|
|
||||||
|
|
||||||
zip-win64:
|
|
||||||
mkdir -p "$(ZIP)/$(WIN64_TARGET_DIR)"
|
|
||||||
cp -r "$(WIN64_BUILD_DIR)/dist/." "$(ZIP)/$(WIN64_TARGET_DIR)/"
|
|
||||||
cp "$(SERVER_BUILD_DIR)"/server/scrcpy-server "$(ZIP)/$(WIN64_TARGET_DIR)/"
|
|
||||||
cd "$(ZIP)"; \
|
|
||||||
zip -r "$(WIN64_TARGET)" "$(WIN64_TARGET_DIR)"
|
|
||||||
rm -rf "$(ZIP)/$(WIN64_TARGET_DIR)"
|
|
||||||
|
|
||||||
package: zip-win32 zip-win64
|
|
||||||
mkdir -p "$(RELEASE_DIR)"
|
|
||||||
cp "$(SERVER_BUILD_DIR)/server/scrcpy-server" \
|
|
||||||
"$(RELEASE_DIR)/scrcpy-server-$(VERSION)"
|
|
||||||
cp "$(ZIP)/$(WIN32_TARGET)" "$(RELEASE_DIR)"
|
|
||||||
cp "$(ZIP)/$(WIN64_TARGET)" "$(RELEASE_DIR)"
|
|
||||||
cd "$(RELEASE_DIR)" && \
|
|
||||||
sha256sum "scrcpy-server-$(VERSION)" \
|
|
||||||
"scrcpy-win32-$(VERSION).zip" \
|
|
||||||
"scrcpy-win64-$(VERSION).zip" > SHA256SUMS.txt
|
|
||||||
@echo "Release generated in $(RELEASE_DIR)/"
|
|
@ -1,2 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
make -f release.mk
|
|
2
release/.gitignore
vendored
Normal file
2
release/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/work
|
||||||
|
/output
|
5
release/build_common
Normal file
5
release/build_common
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# This file must be sourced from the release scripts directory
|
||||||
|
WORK_DIR="$PWD/work"
|
||||||
|
OUTPUT_DIR="$PWD/output"
|
||||||
|
|
||||||
|
VERSION="${VERSION:-$(git describe --tags --always)}"
|
35
release/build_linux.sh
Executable file
35
release/build_linux.sh
Executable file
@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -ex
|
||||||
|
cd "$(dirname ${BASH_SOURCE[0]})"
|
||||||
|
. build_common
|
||||||
|
cd .. # root project dir
|
||||||
|
|
||||||
|
LINUX_BUILD_DIR="$WORK_DIR/build-linux"
|
||||||
|
|
||||||
|
app/deps/adb_linux.sh
|
||||||
|
app/deps/sdl.sh linux native static
|
||||||
|
app/deps/ffmpeg.sh linux native static
|
||||||
|
app/deps/libusb.sh linux native static
|
||||||
|
|
||||||
|
DEPS_INSTALL_DIR="$PWD/app/deps/work/install/linux-native-static"
|
||||||
|
ADB_INSTALL_DIR="$PWD/app/deps/work/install/adb-linux"
|
||||||
|
|
||||||
|
rm -rf "$LINUX_BUILD_DIR"
|
||||||
|
meson setup "$LINUX_BUILD_DIR" \
|
||||||
|
--pkg-config-path="$DEPS_INSTALL_DIR/lib/pkgconfig" \
|
||||||
|
-Dc_args="-I$DEPS_INSTALL_DIR/include" \
|
||||||
|
-Dc_link_args="-L$DEPS_INSTALL_DIR/lib" \
|
||||||
|
--buildtype=release \
|
||||||
|
--strip \
|
||||||
|
-Db_lto=true \
|
||||||
|
-Dcompile_server=false \
|
||||||
|
-Dportable=true \
|
||||||
|
-Dstatic=true
|
||||||
|
ninja -C "$LINUX_BUILD_DIR"
|
||||||
|
|
||||||
|
# Group intermediate outputs into a 'dist' directory
|
||||||
|
mkdir -p "$LINUX_BUILD_DIR/dist"
|
||||||
|
cp "$LINUX_BUILD_DIR"/app/scrcpy "$LINUX_BUILD_DIR/dist/scrcpy_bin"
|
||||||
|
cp app/data/icon.png "$LINUX_BUILD_DIR/dist/"
|
||||||
|
cp app/data/scrcpy_static_wrapper.sh "$LINUX_BUILD_DIR/dist/scrcpy"
|
||||||
|
cp -r "$ADB_INSTALL_DIR"/. "$LINUX_BUILD_DIR/dist/"
|
35
release/build_macos.sh
Executable file
35
release/build_macos.sh
Executable file
@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -ex
|
||||||
|
cd "$(dirname ${BASH_SOURCE[0]})"
|
||||||
|
. build_common
|
||||||
|
cd .. # root project dir
|
||||||
|
|
||||||
|
MACOS_BUILD_DIR="$WORK_DIR/build-macos"
|
||||||
|
|
||||||
|
app/deps/adb_macos.sh
|
||||||
|
app/deps/sdl.sh macos native static
|
||||||
|
app/deps/ffmpeg.sh macos native static
|
||||||
|
app/deps/libusb.sh macos native static
|
||||||
|
|
||||||
|
DEPS_INSTALL_DIR="$PWD/app/deps/work/install/macos-native-static"
|
||||||
|
ADB_INSTALL_DIR="$PWD/app/deps/work/install/adb-macos"
|
||||||
|
|
||||||
|
rm -rf "$MACOS_BUILD_DIR"
|
||||||
|
meson setup "$MACOS_BUILD_DIR" \
|
||||||
|
--pkg-config-path="$DEPS_INSTALL_DIR/lib/pkgconfig" \
|
||||||
|
-Dc_args="-I$DEPS_INSTALL_DIR/include" \
|
||||||
|
-Dc_link_args="-L$DEPS_INSTALL_DIR/lib" \
|
||||||
|
--buildtype=release \
|
||||||
|
--strip \
|
||||||
|
-Db_lto=true \
|
||||||
|
-Dcompile_server=false \
|
||||||
|
-Dportable=true \
|
||||||
|
-Dstatic=true
|
||||||
|
ninja -C "$MACOS_BUILD_DIR"
|
||||||
|
|
||||||
|
# Group intermediate outputs into a 'dist' directory
|
||||||
|
mkdir -p "$MACOS_BUILD_DIR/dist"
|
||||||
|
cp "$MACOS_BUILD_DIR"/app/scrcpy "$MACOS_BUILD_DIR/dist/scrcpy_bin"
|
||||||
|
cp app/data/icon.png "$MACOS_BUILD_DIR/dist/"
|
||||||
|
cp app/data/scrcpy_static_wrapper.sh "$MACOS_BUILD_DIR/dist/scrcpy"
|
||||||
|
cp -r "$ADB_INSTALL_DIR"/. "$MACOS_BUILD_DIR/dist/"
|
14
release/build_server.sh
Executable file
14
release/build_server.sh
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -ex
|
||||||
|
cd "$(dirname ${BASH_SOURCE[0]})"
|
||||||
|
. build_common
|
||||||
|
cd .. # root project dir
|
||||||
|
|
||||||
|
GRADLE="${GRADLE:-./gradlew}"
|
||||||
|
SERVER_BUILD_DIR="$WORK_DIR/build-server"
|
||||||
|
|
||||||
|
rm -rf "$SERVER_BUILD_DIR"
|
||||||
|
"$GRADLE" -p server assembleRelease
|
||||||
|
mkdir -p "$SERVER_BUILD_DIR/server"
|
||||||
|
cp server/build/outputs/apk/release/server-release-unsigned.apk \
|
||||||
|
"$SERVER_BUILD_DIR/server/scrcpy-server"
|
51
release/build_windows.sh
Executable file
51
release/build_windows.sh
Executable file
@ -0,0 +1,51 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
32)
|
||||||
|
WINXX=win32
|
||||||
|
;;
|
||||||
|
64)
|
||||||
|
WINXX=win64
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "ERROR: $0 must be called with one argument: 32 or 64" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
cd "$(dirname ${BASH_SOURCE[0]})"
|
||||||
|
. build_common
|
||||||
|
cd .. # root project dir
|
||||||
|
|
||||||
|
WINXX_BUILD_DIR="$WORK_DIR/build-$WINXX"
|
||||||
|
|
||||||
|
app/deps/adb_windows.sh
|
||||||
|
app/deps/sdl.sh $WINXX cross shared
|
||||||
|
app/deps/ffmpeg.sh $WINXX cross shared
|
||||||
|
app/deps/libusb.sh $WINXX cross shared
|
||||||
|
|
||||||
|
DEPS_INSTALL_DIR="$PWD/app/deps/work/install/$WINXX-cross-shared"
|
||||||
|
ADB_INSTALL_DIR="$PWD/app/deps/work/install/adb-windows"
|
||||||
|
|
||||||
|
rm -rf "$WINXX_BUILD_DIR"
|
||||||
|
meson setup "$WINXX_BUILD_DIR" \
|
||||||
|
--pkg-config-path="$DEPS_INSTALL_DIR/lib/pkgconfig" \
|
||||||
|
-Dc_args="-I$DEPS_INSTALL_DIR/include" \
|
||||||
|
-Dc_link_args="-L$DEPS_INSTALL_DIR/lib" \
|
||||||
|
--cross-file=cross_$WINXX.txt \
|
||||||
|
--buildtype=release \
|
||||||
|
--strip \
|
||||||
|
-Db_lto=true \
|
||||||
|
-Dcompile_server=false \
|
||||||
|
-Dportable=true
|
||||||
|
ninja -C "$WINXX_BUILD_DIR"
|
||||||
|
|
||||||
|
# Group intermediate outputs into a 'dist' directory
|
||||||
|
mkdir -p "$WINXX_BUILD_DIR/dist"
|
||||||
|
cp "$WINXX_BUILD_DIR"/app/scrcpy.exe "$WINXX_BUILD_DIR/dist/"
|
||||||
|
cp app/data/scrcpy-console.bat "$WINXX_BUILD_DIR/dist/"
|
||||||
|
cp app/data/scrcpy-noconsole.vbs "$WINXX_BUILD_DIR/dist/"
|
||||||
|
cp app/data/icon.png "$WINXX_BUILD_DIR/dist/"
|
||||||
|
cp app/data/open_a_terminal_here.bat "$WINXX_BUILD_DIR/dist/"
|
||||||
|
cp -r "$ADB_INSTALL_DIR"/. "$WINXX_BUILD_DIR/dist/"
|
13
release/generate_checksums.sh
Executable file
13
release/generate_checksums.sh
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -ex
|
||||||
|
cd "$(dirname ${BASH_SOURCE[0]})"
|
||||||
|
. build_common
|
||||||
|
|
||||||
|
cd "$OUTPUT_DIR"
|
||||||
|
sha256sum "scrcpy-server-$VERSION" \
|
||||||
|
"scrcpy-linux-$VERSION.zip" \
|
||||||
|
"scrcpy-win32-$VERSION.zip" \
|
||||||
|
"scrcpy-win64-$VERSION.zip" \
|
||||||
|
"scrcpy-macos-$VERSION.zip" \
|
||||||
|
| tee SHA256SUMS.txt
|
||||||
|
echo "Release checksums generated in $PWD/SHA256SUMS.txt"
|
52
release/package_client.sh
Executable file
52
release/package_client.sh
Executable file
@ -0,0 +1,52 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -ex
|
||||||
|
cd "$(dirname ${BASH_SOURCE[0]})"
|
||||||
|
. build_common
|
||||||
|
cd .. # root project dir
|
||||||
|
|
||||||
|
if [[ $# != 2 ]]
|
||||||
|
then
|
||||||
|
# <target_name>: for example win64
|
||||||
|
# <format>: zip or tar.gz
|
||||||
|
echo "Syntax: $0 <target> <format>" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
FORMAT=$2
|
||||||
|
|
||||||
|
if [[ "$2" != zip && "$2" != tar.gz ]]
|
||||||
|
then
|
||||||
|
echo "Invalid format (expected zip or tar.gz): $2" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
BUILD_DIR="$WORK_DIR/build-$1"
|
||||||
|
ARCHIVE_DIR="$BUILD_DIR/release-archive"
|
||||||
|
TARGET="scrcpy-$1-$VERSION"
|
||||||
|
|
||||||
|
rm -rf "$ARCHIVE_DIR/$TARGET"
|
||||||
|
mkdir -p "$ARCHIVE_DIR/$TARGET"
|
||||||
|
|
||||||
|
cp -r "$BUILD_DIR/dist/." "$ARCHIVE_DIR/$TARGET/"
|
||||||
|
cp "$WORK_DIR/build-server/server/scrcpy-server" "$ARCHIVE_DIR/$TARGET/"
|
||||||
|
|
||||||
|
mkdir -p "$OUTPUT_DIR"
|
||||||
|
|
||||||
|
cd "$ARCHIVE_DIR"
|
||||||
|
rm -f "$OUTPUT_DIR/$TARGET.$FORMAT"
|
||||||
|
|
||||||
|
case "$FORMAT" in
|
||||||
|
zip)
|
||||||
|
zip -r "$OUTPUT_DIR/$TARGET.zip" "$TARGET"
|
||||||
|
;;
|
||||||
|
tar.gz)
|
||||||
|
tar cvf "$OUTPUT_DIR/$TARGET.tar.gz" "$TARGET"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Invalid format (expected zip or tar.gz): $FORMAT" >&2
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
|
||||||
|
rm -rf "$TARGET"
|
||||||
|
cd -
|
||||||
|
echo "Generated '$OUTPUT_DIR/$TARGET.$FORMAT'"
|
10
release/package_server.sh
Executable file
10
release/package_server.sh
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -ex
|
||||||
|
cd "$(dirname ${BASH_SOURCE[0]})"
|
||||||
|
OUTPUT_DIR="$PWD/output"
|
||||||
|
. build_common
|
||||||
|
cd .. # root project dir
|
||||||
|
|
||||||
|
mkdir -p "$OUTPUT_DIR"
|
||||||
|
cp "$WORK_DIR/build-server/server/scrcpy-server" "$OUTPUT_DIR/scrcpy-server-$VERSION"
|
||||||
|
echo "Generated '$OUTPUT_DIR/scrcpy-server-$VERSION'"
|
24
release/release.sh
Executable file
24
release/release.sh
Executable file
@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# To customize the version name:
|
||||||
|
# VERSION=myversion ./release.sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
cd "$(dirname ${BASH_SOURCE[0]})"
|
||||||
|
rm -rf output
|
||||||
|
|
||||||
|
./test_server.sh
|
||||||
|
./test_client.sh
|
||||||
|
|
||||||
|
./build_server.sh
|
||||||
|
./build_windows.sh 32
|
||||||
|
./build_windows.sh 64
|
||||||
|
./build_linux.sh
|
||||||
|
|
||||||
|
./package_server.sh
|
||||||
|
./package_client.sh win32 zip
|
||||||
|
./package_client.sh win64 zip
|
||||||
|
./package_client.sh linux tar.gz
|
||||||
|
|
||||||
|
./generate_checksums.sh
|
||||||
|
|
||||||
|
echo "Release generated in $PWD/output"
|
12
release/test_client.sh
Executable file
12
release/test_client.sh
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -ex
|
||||||
|
cd "$(dirname ${BASH_SOURCE[0]})"
|
||||||
|
. build_common
|
||||||
|
cd .. # root project dir
|
||||||
|
|
||||||
|
TEST_BUILD_DIR="$WORK_DIR/build-test"
|
||||||
|
|
||||||
|
rm -rf "$TEST_BUILD_DIR"
|
||||||
|
meson setup "$TEST_BUILD_DIR" -Dcompile_server=false \
|
||||||
|
-Db_sanitize=address,undefined
|
||||||
|
ninja -C "$TEST_BUILD_DIR" test
|
9
release/test_server.sh
Executable file
9
release/test_server.sh
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -ex
|
||||||
|
cd "$(dirname ${BASH_SOURCE[0]})"
|
||||||
|
. build_common
|
||||||
|
cd .. # root project dir
|
||||||
|
|
||||||
|
GRADLE="${GRADLE:-./gradlew}"
|
||||||
|
|
||||||
|
"$GRADLE" -p server check
|
Loading…
x
Reference in New Issue
Block a user