Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #58490 from dywedir/scrcpy
Browse files Browse the repository at this point in the history
scrcpy: 1.5 -> 1.8
  • Loading branch information
dywedir committed Apr 4, 2019
2 parents c07783f + 1f68bc4 commit 7bff738
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions pkgs/misc/scrcpy/default.nix
Expand Up @@ -9,33 +9,30 @@
}:

let
version = "1.5";
version = "1.8";
prebuilt_server = fetchurl {
url = "https://github.com/Genymobile/scrcpy/releases/download/v${version}-fixversion/scrcpy-server-v${version}.jar";
sha256 = "1pi47khfrs9pygs32l9rj8l927z0sdm8bhkrzzkk6ki9c1psnynr";
url = "https://github.com/Genymobile/scrcpy/releases/download/v${version}/scrcpy-server-v${version}.jar";
sha256 = "1h755k5xpchlm7wq2yk5mlwjnh7y4yhviffixacby0srj3pmb443";
};
in
stdenv.mkDerivation rec {
name = "scrcpy-${version}";
pname = "scrcpy";
inherit version;

src = fetchFromGitHub {
owner = "Genymobile";
repo = "scrcpy";
rev = "v${version}-fixversion";
sha256 = "0magmc44pahw1f4jhzkhjlfc31mk3qq43hzn9513idcl4kh4sb8i";
repo = pname;
rev = "v${version}";
sha256 = "1cx7y3w699s3i8s53l1mb7lkrnbix457hf17liwh00jzb0i7aga7";
};

# postPatch:
# screen.c: When run without a hardware accelerator, this allows the command to continue working rather than failing unexpectedly.
# This can happen when running on non-NixOS because then scrcpy seems to have a hard time using the host OpenGL-supporting hardware.
# It would be better to fix the OpenGL problem, but that seems much more intrusive.
#
# command.c: When copying over the prebuilt binary to mobile, it also copies the permissions of the nix store, and thus it cannot delete normally.
postPatch = ''
substituteInPlace app/src/screen.c \
--replace "SDL_RENDERER_ACCELERATED" "SDL_RENDERER_ACCELERATED || SDL_RENDERER_SOFTWARE"
substituteInPlace app/src/command.c \
--replace 'const char *const adb_cmd[] = {"shell", "rm", path};' 'const char *const adb_cmd[] = {"shell", "rm", "-f", path};'
'';

nativeBuildInputs = [ makeWrapper meson ninja pkgconfig ];
Expand Down

0 comments on commit 7bff738

Please sign in to comment.