2018-06-10 23:57:42 +02:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, pkgconfig
|
|
|
|
, pcre
|
|
|
|
, tinyxml
|
|
|
|
, libusb1
|
|
|
|
, libzip
|
|
|
|
, glib
|
2018-12-02 12:41:15 +01:00
|
|
|
, gobject-introspection
|
2018-06-10 23:57:42 +02:00
|
|
|
, gst_all_1
|
|
|
|
, libwebcam
|
2020-01-28 14:44:33 +01:00
|
|
|
, libunwind
|
|
|
|
, gstreamer
|
|
|
|
, elfutils
|
|
|
|
, orc
|
|
|
|
, python3
|
|
|
|
, libuuid
|
2018-06-10 23:57:42 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "tiscamera";
|
2020-01-28 14:44:33 +01:00
|
|
|
version = "0.11.1";
|
2018-06-10 23:57:42 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "TheImagingSource";
|
|
|
|
repo = pname;
|
2019-08-15 14:41:18 +02:00
|
|
|
rev = "v-${pname}-${version}";
|
2020-01-28 14:44:33 +01:00
|
|
|
sha256 = "07vp6khgl6qd3a4519dmx1s5bfw7pld793p50pjn29fqh91fm93g";
|
2018-06-10 23:57:42 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkgconfig
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
pcre
|
|
|
|
tinyxml
|
|
|
|
libusb1
|
|
|
|
libzip
|
|
|
|
glib
|
2018-12-02 12:41:15 +01:00
|
|
|
gobject-introspection
|
2018-06-10 23:57:42 +02:00
|
|
|
gst_all_1.gstreamer
|
|
|
|
gst_all_1.gst-plugins-base
|
|
|
|
libwebcam
|
2020-01-28 14:44:33 +01:00
|
|
|
libunwind
|
|
|
|
gstreamer
|
|
|
|
elfutils
|
|
|
|
orc
|
|
|
|
python3
|
|
|
|
libuuid
|
2018-06-10 23:57:42 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DBUILD_ARAVIS=OFF" # For GigE support. Won't need it as our camera is usb.
|
|
|
|
"-DBUILD_GST_1_0=ON"
|
|
|
|
"-DBUILD_TOOLS=ON"
|
|
|
|
"-DBUILD_V4L2=ON"
|
|
|
|
"-DBUILD_LIBUSB=ON"
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
2020-01-28 14:44:33 +01:00
|
|
|
substituteInPlace ./data/udev/80-theimagingsource-cameras.rules.in \
|
2018-06-10 23:57:42 +02:00
|
|
|
--replace "/usr/bin/uvcdynctrl" "${libwebcam}/bin/uvcdynctrl" \
|
|
|
|
--replace "/path/to/tiscamera/uvc-extensions" "$out/share/uvcdynctrl/data/199e"
|
|
|
|
|
|
|
|
substituteInPlace ./src/BackendLoader.cpp \
|
|
|
|
--replace '"libtcam-v4l2.so"' "\"$out/lib/tcam-0/libtcam-v4l2.so\"" \
|
|
|
|
--replace '"libtcam-aravis.so"' "\"$out/lib/tcam-0/libtcam-aravis.so\"" \
|
|
|
|
--replace '"libtcam-libusb.so"' "\"$out/lib/tcam-0/libtcam-libusb.so\""
|
|
|
|
'';
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
cmakeFlagsArray=(
|
|
|
|
$cmakeFlagsArray
|
|
|
|
"-DCMAKE_INSTALL_PREFIX=$out"
|
|
|
|
"-DTCAM_INSTALL_UDEV=$out/lib/udev/rules.d"
|
|
|
|
"-DTCAM_INSTALL_UVCDYNCTRL=$out/share/uvcdynctrl/data/199e"
|
|
|
|
"-DTCAM_INSTALL_GST_1_0=$out/lib/gstreamer-1.0"
|
|
|
|
"-DTCAM_INSTALL_GIR=$out/share/gir-1.0"
|
|
|
|
"-DTCAM_INSTALL_TYPELIB=$out/lib/girepository-1.0"
|
|
|
|
"-DTCAM_INSTALL_SYSTEMD=$out/etc/systemd/system"
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
|
|
# There are gobject introspection commands launched as part of the build. Those have a runtime
|
|
|
|
# dependency on `libtcam` (which itself is built as part of this build). In order to allow
|
|
|
|
# that, we set the dynamic linker's path to point on the build time location of the library.
|
|
|
|
preBuild = ''
|
2020-01-02 01:29:34 +01:00
|
|
|
export LD_LIBRARY_PATH=$PWD/src''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
|
2018-06-10 23:57:42 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "The Linux sources and UVC firmwares for The Imaging Source cameras";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/TheImagingSource/tiscamera";
|
2018-06-10 23:57:42 +02:00
|
|
|
license = with licenses; [ asl20 ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ jraygauthier ];
|
|
|
|
};
|
2020-01-28 14:44:33 +01:00
|
|
|
}
|