From 089378926b09252c111be15e336177c7f9fc652c Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Fri, 16 Feb 2018 15:19:35 +0100 Subject: [PATCH] Rename SCRCPY_SERVER_JAR to SCRCPY_SERVER_PATH The server is currently a JAR, but it may ba an APK or a DEX, so the variable name should not contain the type. Rename the environment variable, the Meson options and the C definitions. --- Makefile | 2 +- app/meson.build | 12 ++++++------ app/src/server.c | 10 +++++----- meson_options.txt | 2 +- run | 2 +- scripts/run-scrcpy.sh | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index ffc6653c..bb67ca32 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ build-portable: [ -d "$(PORTABLE_BUILD_DIR)" ] || ( mkdir "$(PORTABLE_BUILD_DIR)" && \ meson "$(PORTABLE_BUILD_DIR)" \ --buildtype release --strip -Db_lto=true \ - -Doverride_server_jar=scrcpy-server.jar ) + -Doverride_server_path=scrcpy-server.jar ) ninja -C "$(PORTABLE_BUILD_DIR)" release-portable: clean dist-portable-zip sums diff --git a/app/meson.build b/app/meson.build index e574a835..c817b7f1 100644 --- a/app/meson.build +++ b/app/meson.build @@ -48,19 +48,19 @@ conf.set_quoted('SCRCPY_VERSION', '0.1') conf.set_quoted('PREFIX', get_option('prefix')) # the path of the server, which will be appended to the prefix -# ignored if OVERRIDE_SERVER_JAR if defined +# ignored if OVERRIDE_SERVER_PATH if defined # must be consistent with the install_dir in server/meson.build -conf.set_quoted('PREFIXED_SERVER_JAR', '/share/scrcpy/scrcpy-server.jar') +conf.set_quoted('PREFIXED_SERVER_PATH', '/share/scrcpy/scrcpy-server.jar') # the path of the server to be used "as is" # this is useful for building a "portable" version (with the server in the same # directory as the client) -override_server_jar = get_option('override_server_jar') -if override_server_jar != '' - conf.set_quoted('OVERRIDE_SERVER_JAR', override_server_jar) +override_server_path = get_option('override_server_path') +if override_server_path != '' + conf.set_quoted('OVERRIDE_SERVER_PATH', override_server_path) else # undefine it - conf.set('OVERRIDE_SERVER_JAR', false) + conf.set('OVERRIDE_SERVER_PATH', false) endif # the default client TCP port for the "adb reverse" tunnel diff --git a/app/src/server.c b/app/src/server.c index a4cba260..18388a93 100644 --- a/app/src/server.c +++ b/app/src/server.c @@ -11,16 +11,16 @@ #define SOCKET_NAME "scrcpy" -#ifdef OVERRIDE_SERVER_JAR -# define DEFAULT_SERVER_JAR OVERRIDE_SERVER_JAR +#ifdef OVERRIDE_SERVER_PATH +# define DEFAULT_SERVER_PATH OVERRIDE_SERVER_PATH #else -# define DEFAULT_SERVER_JAR PREFIX PREFIXED_SERVER_JAR +# define DEFAULT_SERVER_PATH PREFIX PREFIXED_SERVER_PATH #endif static const char *get_server_path(void) { - const char *server_path = getenv("SCRCPY_SERVER_JAR"); + const char *server_path = getenv("SCRCPY_SERVER_PATH"); if (!server_path) { - server_path = DEFAULT_SERVER_JAR; + server_path = DEFAULT_SERVER_PATH; } return server_path; } diff --git a/meson_options.txt b/meson_options.txt index 7900a82b..ce3fdb49 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,5 +1,5 @@ option('build_app', type: 'boolean', value: true, description: 'Build the client') option('build_server', type: 'boolean', value: true, description: 'Build the server') option('prebuilt_server', type: 'string', description: 'Path of the prebuilt server') -option('override_server_jar', type: 'string', description: 'Hardcoded path to find the server at runtime') +option('override_server_path', type: 'string', description: 'Hardcoded path to find the server at runtime') option('skip_frames', type: 'boolean', value: true, description: 'Always display the most recent frame') diff --git a/run b/run index b7a97d25..7abeca05 100755 --- a/run +++ b/run @@ -20,4 +20,4 @@ then exit 1 fi -SCRCPY_SERVER_JAR="$BUILDDIR/server/scrcpy-server.jar" "$BUILDDIR/app/scrcpy" "$@" +SCRCPY_SERVER_PATH="$BUILDDIR/server/scrcpy-server.jar" "$BUILDDIR/app/scrcpy" "$@" diff --git a/scripts/run-scrcpy.sh b/scripts/run-scrcpy.sh index 62ff9b95..fa6d7c8f 100755 --- a/scripts/run-scrcpy.sh +++ b/scripts/run-scrcpy.sh @@ -1,2 +1,2 @@ #!/bin/bash -SCRCPY_SERVER_JAR="$MESON_BUILD_ROOT/server/scrcpy-server.jar" "$MESON_BUILD_ROOT/app/scrcpy" +SCRCPY_SERVER_PATH="$MESON_BUILD_ROOT/server/scrcpy-server.jar" "$MESON_BUILD_ROOT/app/scrcpy"