2021-11-29 08:50:42 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildPackages
|
|
|
|
, autoreconfHook
|
|
|
|
, pkg-config
|
|
|
|
, gettext
|
2020-11-16 21:40:29 +00:00
|
|
|
, libusb1
|
|
|
|
, libtool
|
|
|
|
, libexif
|
2021-11-09 21:07:02 +00:00
|
|
|
, libgphoto2
|
2020-11-16 21:40:29 +00:00
|
|
|
, libjpeg
|
2021-11-29 08:50:42 +00:00
|
|
|
, curl
|
|
|
|
, libxml2
|
|
|
|
, gd
|
2020-11-16 21:40:29 +00:00
|
|
|
}:
|
2005-03-11 11:08:38 +00:00
|
|
|
|
2007-11-16 17:28:17 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-11-16 21:40:29 +00:00
|
|
|
pname = "libgphoto2";
|
2022-07-24 10:11:56 +00:00
|
|
|
version = "2.5.30";
|
2005-03-11 11:08:38 +00:00
|
|
|
|
2016-11-06 14:05:08 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gphoto";
|
|
|
|
repo = "libgphoto2";
|
2020-11-16 21:40:29 +00:00
|
|
|
rev = "libgphoto2-${builtins.replaceStrings [ "." ] [ "_" ] version}-release";
|
2022-07-24 10:11:56 +00:00
|
|
|
sha256 = "sha256-4UwD283mKhZwC7setBU0BLRLsyfjD/6m/InSedrqgAU=";
|
2005-03-11 11:08:38 +00:00
|
|
|
};
|
2014-11-14 10:23:25 +00:00
|
|
|
|
2021-11-09 21:07:02 +00:00
|
|
|
depsBuildBuild = [ pkg-config ];
|
2016-07-09 17:18:05 +00:00
|
|
|
|
2020-11-16 21:40:29 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
|
|
|
gettext
|
|
|
|
libtool
|
2021-11-29 08:50:42 +00:00
|
|
|
pkg-config
|
2020-11-16 21:40:29 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libjpeg
|
2021-11-09 21:07:02 +00:00
|
|
|
libtool # for libltdl
|
2020-11-16 21:40:29 +00:00
|
|
|
libusb1
|
2021-11-29 08:50:42 +00:00
|
|
|
curl
|
|
|
|
libxml2
|
|
|
|
gd
|
2020-11-16 21:40:29 +00:00
|
|
|
];
|
2009-04-23 11:12:25 +00:00
|
|
|
|
|
|
|
# These are mentioned in the Requires line of libgphoto's pkg-config file.
|
2014-11-14 10:23:25 +00:00
|
|
|
propagatedBuildInputs = [ libexif ];
|
2006-07-06 21:11:59 +00:00
|
|
|
|
2016-02-26 17:38:15 +00:00
|
|
|
hardeningDisable = [ "format" ];
|
2015-12-23 01:59:47 +00:00
|
|
|
|
2021-11-29 08:50:42 +00:00
|
|
|
postInstall =
|
|
|
|
let
|
|
|
|
executablePrefix =
|
|
|
|
if stdenv.buildPlatform == stdenv.hostPlatform then
|
|
|
|
"$out"
|
|
|
|
else
|
|
|
|
buildPackages.libgphoto2;
|
|
|
|
in
|
|
|
|
''
|
|
|
|
mkdir -p $out/lib/udev/rules.d
|
|
|
|
${executablePrefix}/lib/libgphoto2/print-camera-list \
|
|
|
|
udev-rules version 175 group camera \
|
|
|
|
>$out/lib/udev/rules.d/40-gphoto2.rules
|
|
|
|
'';
|
2016-12-27 18:39:53 +00:00
|
|
|
|
2007-11-16 17:28:17 +00:00
|
|
|
meta = {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://www.gphoto.org/proj/libgphoto2/";
|
2009-04-15 09:54:55 +00:00
|
|
|
description = "A library for accessing digital cameras";
|
2012-10-21 04:59:25 +00:00
|
|
|
longDescription = ''
|
|
|
|
This is the library backend for gphoto2. It contains the code for PTP,
|
|
|
|
MTP, and other vendor specific protocols for controlling and transferring data
|
2014-11-14 10:23:25 +00:00
|
|
|
from digital cameras.
|
2012-10-21 04:59:25 +00:00
|
|
|
'';
|
2012-10-21 10:15:13 +00:00
|
|
|
# XXX: the homepage claims LGPL, but several src files are lgpl21Plus
|
2021-01-21 17:00:13 +00:00
|
|
|
license = lib.licenses.lgpl21Plus;
|
|
|
|
platforms = with lib.platforms; unix;
|
|
|
|
maintainers = with lib.maintainers; [ jcumming ];
|
2007-11-16 17:28:17 +00:00
|
|
|
};
|
2005-03-11 11:08:38 +00:00
|
|
|
}
|