mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 20:25:32 +03:00
scrcpy: nixfmt
This commit is contained in:
parent
ba02da0dc4
commit
291dd0356b
1 changed files with 42 additions and 26 deletions
|
@ -1,18 +1,19 @@
|
||||||
{ lib
|
{
|
||||||
, stdenv
|
lib,
|
||||||
, fetchurl
|
stdenv,
|
||||||
, fetchFromGitHub
|
fetchurl,
|
||||||
, makeWrapper
|
fetchFromGitHub,
|
||||||
, meson
|
makeWrapper,
|
||||||
, ninja
|
meson,
|
||||||
, pkg-config
|
ninja,
|
||||||
, runtimeShell
|
pkg-config,
|
||||||
, installShellFiles
|
runtimeShell,
|
||||||
|
installShellFiles,
|
||||||
|
|
||||||
, android-tools
|
android-tools,
|
||||||
, ffmpeg
|
ffmpeg,
|
||||||
, libusb1
|
libusb1,
|
||||||
, SDL2
|
SDL2,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
@ -43,25 +44,37 @@ stdenv.mkDerivation rec {
|
||||||
--replace "SDL_RENDERER_ACCELERATED" "SDL_RENDERER_ACCELERATED || SDL_RENDERER_SOFTWARE"
|
--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
|
# Manually install the server jar to prevent Meson from "fixing" it
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
echo -n > server/meson.build
|
echo -n > server/meson.build
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postInstall = ''
|
postInstall =
|
||||||
mkdir -p "$out/share/scrcpy"
|
''
|
||||||
ln -s "${prebuilt_server}" "$out/share/scrcpy/scrcpy-server"
|
mkdir -p "$out/share/scrcpy"
|
||||||
|
ln -s "${prebuilt_server}" "$out/share/scrcpy/scrcpy-server"
|
||||||
|
|
||||||
# runtime dep on `adb` to push the server
|
# runtime dep on `adb` to push the server
|
||||||
wrapProgram "$out/bin/scrcpy" --prefix PATH : "${android-tools}/bin"
|
wrapProgram "$out/bin/scrcpy" --prefix PATH : "${android-tools}/bin"
|
||||||
'' + lib.optionalString stdenv.hostPlatform.isLinux ''
|
''
|
||||||
substituteInPlace $out/share/applications/scrcpy-console.desktop \
|
+ lib.optionalString stdenv.hostPlatform.isLinux ''
|
||||||
--replace "/bin/bash" "${runtimeShell}"
|
substituteInPlace $out/share/applications/scrcpy-console.desktop \
|
||||||
'';
|
--replace "/bin/bash" "${runtimeShell}"
|
||||||
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Display and control Android devices over USB or TCP/IP";
|
description = "Display and control Android devices over USB or TCP/IP";
|
||||||
|
@ -73,7 +86,10 @@ stdenv.mkDerivation rec {
|
||||||
];
|
];
|
||||||
license = lib.licenses.asl20;
|
license = lib.licenses.asl20;
|
||||||
platforms = lib.platforms.unix;
|
platforms = lib.platforms.unix;
|
||||||
maintainers = with lib.maintainers; [ deltaevo ryand56 ];
|
maintainers = with lib.maintainers; [
|
||||||
|
deltaevo
|
||||||
|
ryand56
|
||||||
|
];
|
||||||
mainProgram = "scrcpy";
|
mainProgram = "scrcpy";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue