From ba02da0dc49a22bf976af14a382a628b413eb00b Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Sat, 29 Mar 2025 23:39:19 +0800 Subject: [PATCH 1/2] scrcpy: 3.1 -> 3.2 --- pkgs/by-name/sc/scrcpy/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/sc/scrcpy/package.nix b/pkgs/by-name/sc/scrcpy/package.nix index b89b106458cc..3d12fef4f19a 100644 --- a/pkgs/by-name/sc/scrcpy/package.nix +++ b/pkgs/by-name/sc/scrcpy/package.nix @@ -16,12 +16,12 @@ }: let - version = "3.1"; + version = "3.2"; prebuilt_server = fetchurl { name = "scrcpy-server"; inherit version; url = "https://github.com/Genymobile/scrcpy/releases/download/v${version}/scrcpy-server-v${version}"; - hash = "sha256-lY8JRKYvI7HzOhbp6xSETBoEuILKF1pzjBbSPLIrhsA="; + hash = "sha256-uSDg6gGTa/JIL0ui+phcIsE8YhmZ49M7RbqlrPweo9A="; }; in stdenv.mkDerivation rec { @@ -32,7 +32,7 @@ stdenv.mkDerivation rec { owner = "Genymobile"; repo = "scrcpy"; tag = "v${version}"; - hash = "sha256-XxvlwF3vqtkew+P1yuIwBJxYetD+D+v8OKaETU3qVkk="; + hash = "sha256-k53iyCD/f4bsntqqEdmcgHL963BL17vidkgB6AcXkeE="; }; # display.c: When run without a hardware accelerator, this allows the command to continue working rather than failing unexpectedly. From 291dd0356ba968d3a1565d7130209d88ad388294 Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Sat, 29 Mar 2025 23:39:29 +0800 Subject: [PATCH 2/2] scrcpy: nixfmt --- pkgs/by-name/sc/scrcpy/package.nix | 68 ++++++++++++++++++------------ 1 file changed, 42 insertions(+), 26 deletions(-) diff --git a/pkgs/by-name/sc/scrcpy/package.nix b/pkgs/by-name/sc/scrcpy/package.nix index 3d12fef4f19a..2b7630f248f4 100644 --- a/pkgs/by-name/sc/scrcpy/package.nix +++ b/pkgs/by-name/sc/scrcpy/package.nix @@ -1,18 +1,19 @@ -{ lib -, stdenv -, fetchurl -, fetchFromGitHub -, makeWrapper -, meson -, ninja -, pkg-config -, runtimeShell -, installShellFiles +{ + lib, + stdenv, + fetchurl, + fetchFromGitHub, + makeWrapper, + meson, + ninja, + pkg-config, + runtimeShell, + installShellFiles, -, android-tools -, ffmpeg -, libusb1 -, SDL2 + android-tools, + ffmpeg, + libusb1, + SDL2, }: let @@ -43,25 +44,37 @@ stdenv.mkDerivation rec { --replace "SDL_RENDERER_ACCELERATED" "SDL_RENDERER_ACCELERATED || SDL_RENDERER_SOFTWARE" ''; - nativeBuildInputs = [ makeWrapper meson ninja pkg-config installShellFiles ]; + nativeBuildInputs = [ + makeWrapper + meson + ninja + pkg-config + installShellFiles + ]; - buildInputs = [ ffmpeg SDL2 libusb1 ]; + buildInputs = [ + ffmpeg + SDL2 + libusb1 + ]; # Manually install the server jar to prevent Meson from "fixing" it preConfigure = '' echo -n > server/meson.build ''; - postInstall = '' - mkdir -p "$out/share/scrcpy" - ln -s "${prebuilt_server}" "$out/share/scrcpy/scrcpy-server" + postInstall = + '' + mkdir -p "$out/share/scrcpy" + ln -s "${prebuilt_server}" "$out/share/scrcpy/scrcpy-server" - # runtime dep on `adb` to push the server - wrapProgram "$out/bin/scrcpy" --prefix PATH : "${android-tools}/bin" - '' + lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace $out/share/applications/scrcpy-console.desktop \ - --replace "/bin/bash" "${runtimeShell}" - ''; + # runtime dep on `adb` to push the server + wrapProgram "$out/bin/scrcpy" --prefix PATH : "${android-tools}/bin" + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace $out/share/applications/scrcpy-console.desktop \ + --replace "/bin/bash" "${runtimeShell}" + ''; meta = { description = "Display and control Android devices over USB or TCP/IP"; @@ -73,7 +86,10 @@ stdenv.mkDerivation rec { ]; license = lib.licenses.asl20; platforms = lib.platforms.unix; - maintainers = with lib.maintainers; [ deltaevo ryand56 ]; + maintainers = with lib.maintainers; [ + deltaevo + ryand56 + ]; mainProgram = "scrcpy"; }; }