nixpkgs/pkgs/by-name/dr/droidcam/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

62 lines
1.5 KiB
Nix

{ lib, stdenv, fetchFromGitHub
, ffmpeg, libjpeg_turbo, gtk3, alsa-lib, speex, libusbmuxd, libappindicator-gtk3
, pkg-config
}:
stdenv.mkDerivation rec {
pname = "droidcam";
version = "2.1.3";
src = fetchFromGitHub {
owner = "aramg";
repo = "droidcam";
rev = "v${version}";
sha256 = "sha256-Pwq7PDj+MH1wzrUyfva2F2+oELm4Sb1EJPUUCsHYb7k=";
};
nativeBuildInputs = [
pkg-config
];
buildInputs = [
ffmpeg
libjpeg_turbo
gtk3
alsa-lib
speex
libusbmuxd
libappindicator-gtk3
];
postPatch = ''
substituteInPlace src/droidcam.c \
--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"
'';
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
install -D icon2.png $out/share/icons/hicolor/96x96/apps/droidcam.png
install -D droidcam.desktop $out/share/applications/droidcam.desktop
runHook postInstall
'';
meta = with lib; {
description = "Linux client for DroidCam app";
homepage = "https://github.com/aramg/droidcam";
license = licenses.gpl2Only;
maintainers = [ maintainers.suhr ];
platforms = platforms.linux;
};
}