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";
|
2023-09-09 23:29:13 +00:00
|
|
|
version = "2.5.31";
|
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";
|
2023-09-09 23:29:13 +00:00
|
|
|
sha256 = "sha256-UmyDKEaPP9VJqi8f+y6JZcTlQomhMTN+/C//ODYx6/w=";
|
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
|
|
|
|
2024-09-08 03:54:41 +00:00
|
|
|
env = lib.optionalAttrs stdenv.cc.isGNU {
|
|
|
|
NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
|
|
|
|
};
|
|
|
|
|
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
|
|
|
|
''
|
2023-04-19 18:26:27 +00:00
|
|
|
mkdir -p $out/lib/udev/{rules.d,hwdb.d}
|
2021-11-29 08:50:42 +00:00
|
|
|
${executablePrefix}/lib/libgphoto2/print-camera-list \
|
2023-04-19 18:26:27 +00:00
|
|
|
udev-rules version 201 group camera \
|
|
|
|
>$out/lib/udev/rules.d/40-libgphoto2.rules
|
|
|
|
${executablePrefix}/lib/libgphoto2/print-camera-list \
|
|
|
|
hwdb version 201 group camera \
|
|
|
|
>$out/lib/udev/hwdb.d/20-gphoto.hwdb
|
2021-11-29 08:50:42 +00:00
|
|
|
'';
|
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 = "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
|
|
|
}
|