4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
79 lines
1.5 KiB
Nix
79 lines
1.5 KiB
Nix
{ config
|
|
, lib, stdenv
|
|
, fetchurl
|
|
, intltool
|
|
, pkgconfig
|
|
, portaudio
|
|
, SDL2
|
|
, ffmpeg
|
|
, udev
|
|
, libusb1
|
|
, libv4l
|
|
, alsaLib
|
|
, gsl
|
|
, libpng
|
|
, sfml
|
|
, pulseaudioSupport ? config.pulseaudio or stdenv.isLinux
|
|
, libpulseaudio ? null
|
|
, useQt ? false
|
|
, qtbase ? null
|
|
, wrapQtAppsHook ? null
|
|
# can be turned off if used as a library
|
|
, useGtk ? true
|
|
, gtk3 ? null
|
|
, wrapGAppsHook ? null
|
|
}:
|
|
|
|
assert pulseaudioSupport -> libpulseaudio != null;
|
|
|
|
stdenv.mkDerivation rec {
|
|
version = "2.0.6";
|
|
pname = "guvcview";
|
|
|
|
src = fetchurl {
|
|
url = "mirror://sourceforge/project/guvcview/source/guvcview-src-${version}.tar.gz";
|
|
sha256 = "11byyfpkcik7wvf2qic77zjamfr2rhji97dpj1gy2fg1bvpiqf4m";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
intltool
|
|
pkgconfig
|
|
]
|
|
++ stdenv.lib.optionals (useGtk) [ wrapGAppsHook ]
|
|
++ stdenv.lib.optionals (useQt) [ wrapQtAppsHook ]
|
|
;
|
|
|
|
buildInputs = [
|
|
SDL2
|
|
alsaLib
|
|
ffmpeg
|
|
libusb1
|
|
libv4l
|
|
portaudio
|
|
udev
|
|
gsl
|
|
libpng
|
|
sfml
|
|
]
|
|
++ stdenv.lib.optionals (pulseaudioSupport) [ libpulseaudio ]
|
|
++ stdenv.lib.optionals (useGtk) [ gtk3 ]
|
|
++ stdenv.lib.optionals (useQt) [
|
|
qtbase
|
|
]
|
|
;
|
|
configureFlags = [
|
|
"--enable-sfml"
|
|
]
|
|
++ stdenv.lib.optionals (useGtk) [ "--enable-gtk3" ]
|
|
++ stdenv.lib.optionals (useQt) [ "--enable-qt5" ]
|
|
;
|
|
|
|
meta = with lib; {
|
|
description = "A simple interface for devices supported by the linux UVC driver";
|
|
homepage = "http://guvcview.sourceforge.net";
|
|
maintainers = [ maintainers.coconnor ];
|
|
license = licenses.gpl3;
|
|
platforms = platforms.linux;
|
|
};
|
|
}
|