nixpkgs/pkgs/applications/video/droidcam/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

62 lines
1.5 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub
, ffmpeg, libjpeg_turbo, gtk3, alsa-lib, speex, libusbmuxd, libappindicator-gtk3
2021-01-03 20:26:43 +00:00
, pkg-config
}:
stdenv.mkDerivation rec {
pname = "droidcam";
2022-02-14 14:52:12 +00:00
version = "1.8.2";
2021-01-03 20:26:43 +00:00
src = fetchFromGitHub {
owner = "aramg";
repo = "droidcam";
rev = "v${version}";
2022-02-14 14:52:12 +00:00
sha256 = "sha256-AxJBpoiBnb+5Pq/h4giOYAeLlvOtAJT5sCwzPEKo7w4=";
2021-01-03 20:26:43 +00:00
};
nativeBuildInputs = [
pkg-config
];
buildInputs = [
ffmpeg
libjpeg_turbo
gtk3
alsa-lib
2021-01-03 20:26:43 +00:00
speex
libusbmuxd
libappindicator-gtk3
];
postPatch = ''
2021-01-13 11:03:29 +00:00
substituteInPlace src/droidcam.c \
2022-02-18 17:03:11 +00:00
--replace "/opt/droidcam-icon.png" "$out/share/icons/hicolor/96x96/apps/droidcam.png"
substituteInPlace droidcam.desktop \
--replace "/opt/droidcam-icon.png" "droidcam" \
--replace "/usr/local/bin/droidcam" "droidcam"
2021-01-03 20:26:43 +00:00
'';
preBuild = ''
makeFlagsArray+=("JPEG=$(pkg-config --libs --cflags libturbojpeg)")
makeFlagsArray+=("USBMUXD=$(pkg-config --libs --cflags libusbmuxd-2.0)")
'';
installPhase = ''
runHook preInstall
install -Dt $out/bin droidcam droidcam-cli
2022-02-18 17:03:11 +00:00
install -D icon2.png $out/share/icons/hicolor/96x96/apps/droidcam.png
install -D droidcam.desktop $out/share/applications/droidcam.desktop
2021-01-03 20:26:43 +00:00
runHook postInstall
'';
meta = with lib; {
2021-01-03 20:26:43 +00:00
description = "Linux client for DroidCam app";
homepage = "https://github.com/aramg/droidcam";
license = licenses.gpl2Only;
maintainers = [ maintainers.suhr ];
platforms = platforms.linux;
};
}