18 stdenv.mkDerivation rec {
22 src = fetchFromGitHub {
25 rev = "libgphoto2-${builtins.replaceStrings [ "." ] [ "_" ] version}-release";
26 sha256 = "sha256-UmyDKEaPP9VJqi8f+y6JZcTlQomhMTN+/C//ODYx6/w=";
29 depsBuildBuild = [ pkg-config ];
47 # These are mentioned in the Requires line of libgphoto's pkg-config file.
48 propagatedBuildInputs = [ libexif ];
50 env = lib.optionalAttrs stdenv.cc.isGNU {
51 NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
54 hardeningDisable = [ "format" ];
59 if stdenv.buildPlatform == stdenv.hostPlatform then
62 buildPackages.libgphoto2;
65 mkdir -p $out/lib/udev/{rules.d,hwdb.d}
66 ${executablePrefix}/lib/libgphoto2/print-camera-list \
67 udev-rules version 201 group camera \
68 >$out/lib/udev/rules.d/40-libgphoto2.rules
69 ${executablePrefix}/lib/libgphoto2/print-camera-list \
70 hwdb version 201 group camera \
71 >$out/lib/udev/hwdb.d/20-gphoto.hwdb
75 homepage = "http://www.gphoto.org/proj/libgphoto2/";
76 description = "Library for accessing digital cameras";
78 This is the library backend for gphoto2. It contains the code for PTP,
79 MTP, and other vendor specific protocols for controlling and transferring data
82 # XXX: the homepage claims LGPL, but several src files are lgpl21Plus
83 license = lib.licenses.lgpl21Plus;
84 platforms = with lib.platforms; unix;
85 maintainers = with lib.maintainers; [ jcumming ];