forked from Genymobile/scrcpy
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to release a macOS static binary
Provide a prebuilt binary for macOS. Co-authored-by: Muvaffak Onus <[email protected]>
- Loading branch information
Showing
5 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters