From 9c8de43f3c04a18e0ace5a6cbbc5c026f2e2302c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=B0=D1=80=D0=B8=D0=BA?= <65870+suhr@users.noreply.github.com> Date: Sun, 3 Jan 2021 23:26:43 +0300 Subject: [PATCH] droidcam: init at 1.6 --- pkgs/applications/video/droidcam/default.nix | 58 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 60 insertions(+) create mode 100644 pkgs/applications/video/droidcam/default.nix diff --git a/pkgs/applications/video/droidcam/default.nix b/pkgs/applications/video/droidcam/default.nix new file mode 100644 index 000000000000..dc6c0d330eb2 --- /dev/null +++ b/pkgs/applications/video/droidcam/default.nix @@ -0,0 +1,58 @@ +{ stdenv, fetchFromGitHub +, ffmpeg, libjpeg_turbo, gtk3, alsaLib, speex, libusbmuxd, libappindicator-gtk3 +, pkg-config +}: + +stdenv.mkDerivation rec { + pname = "droidcam"; + version = "1.6"; + + src = fetchFromGitHub { + owner = "aramg"; + repo = "droidcam"; + rev = "v${version}"; + sha256 = "sha256-3RmEmLNUbwIh+yr7vtYZnMwbzfmtW3mz5u4Ohau9OLU="; + }; + + nativeBuildInputs = [ + pkg-config + ]; + + buildInputs = [ + ffmpeg + libjpeg_turbo + gtk3 + alsaLib + speex + libusbmuxd + libappindicator-gtk3 + ]; + + postPatch = '' + substituteInPlace linux/src/droidcam.c \ + --replace "/opt/droidcam-icon.png" "$out/share/icons/hicolor/droidcam.png" + ''; + + preBuild = '' + cd linux + 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 + install -D icon2.png $out/share/icons/hicolor/droidcam.png + + runHook postInstall + ''; + + meta = with stdenv.lib; { + description = "Linux client for DroidCam app"; + homepage = "https://github.com/aramg/droidcam"; + license = licenses.gpl2Only; + maintainers = [ maintainers.suhr ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 898eb4c7bf46..d8376046f531 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1173,6 +1173,8 @@ in doona = callPackage ../tools/security/doona { }; + droidcam = callPackage ../applications/video/droidcam { }; + ecdsautils = callPackage ../tools/security/ecdsautils { }; sedutil = callPackage ../tools/security/sedutil { };