2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
2021-06-28 23:13:55 +00:00
|
|
|
, ffmpeg, libjpeg_turbo, gtk3, alsa-lib, speex, libusbmuxd, libappindicator-gtk3
|
2021-01-09 10:05:03 +00:00
|
|
|
, pkg-config
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "droidcam";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "2.1.3";
|
2021-01-09 10:05:03 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "aramg";
|
|
|
|
repo = "droidcam";
|
|
|
|
rev = "v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
sha256 = "sha256-Pwq7PDj+MH1wzrUyfva2F2+oELm4Sb1EJPUUCsHYb7k=";
|
2021-01-09 10:05:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
ffmpeg
|
|
|
|
libjpeg_turbo
|
|
|
|
gtk3
|
2021-06-28 23:13:55 +00:00
|
|
|
alsa-lib
|
2021-01-09 10:05:03 +00:00
|
|
|
speex
|
|
|
|
libusbmuxd
|
|
|
|
libappindicator-gtk3
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
2021-01-15 22:18:51 +00:00
|
|
|
substituteInPlace src/droidcam.c \
|
2022-02-21 08:47:16 +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-09 10:05:03 +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-21 08:47:16 +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-09 10:05:03 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-01-09 10:05:03 +00:00
|
|
|
description = "Linux client for DroidCam app";
|
|
|
|
homepage = "https://github.com/aramg/droidcam";
|
|
|
|
license = licenses.gpl2Only;
|
|
|
|
maintainers = [ maintainers.suhr ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|