2018-06-10 23:57:42 +02:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
2020-09-02 03:50:40 +02:00
|
|
|
, pkg-config
|
2018-06-10 23:57:42 +02:00
|
|
|
, 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
|
|
|
|
, elfutils
|
|
|
|
, orc
|
2021-05-10 20:26:47 +02:00
|
|
|
, python3Packages
|
2020-01-28 14:44:33 +01:00
|
|
|
, libuuid
|
2021-05-10 20:26:47 +02:00
|
|
|
, wrapGAppsHook
|
2018-06-10 23:57:42 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "tiscamera";
|
2021-05-10 20:26:47 +02:00
|
|
|
version = "0.13.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}";
|
2021-05-10 20:26:47 +02:00
|
|
|
sha256 = "0hpy9yhc4mn6w8gvzwif703smmcys0j2jqbz2xfghqxcyb0ykplj";
|
2018-06-10 23:57:42 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2020-09-02 03:50:40 +02:00
|
|
|
pkg-config
|
2021-05-10 20:26:47 +02:00
|
|
|
python3Packages.wrapPython
|
|
|
|
wrapGAppsHook
|
2018-06-10 23:57:42 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
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
|
|
|
|
elfutils
|
|
|
|
orc
|
|
|
|
libuuid
|
2021-05-10 20:26:47 +02:00
|
|
|
python3Packages.python
|
|
|
|
python3Packages.pyqt5
|
2018-06-10 23:57:42 +02:00
|
|
|
];
|
|
|
|
|
2021-05-10 20:26:47 +02:00
|
|
|
pythonPath = with python3Packages; [ pyqt5 pygobject3 ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = pythonPath;
|
|
|
|
|
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"
|
2021-05-10 20:26:47 +02:00
|
|
|
"-DBUILD_TESTS=ON"
|
2020-09-02 03:50:40 +02:00
|
|
|
"-DTCAM_INSTALL_UDEV=${placeholder "out"}/lib/udev/rules.d"
|
|
|
|
"-DTCAM_INSTALL_UVCDYNCTRL=${placeholder "out"}/share/uvcdynctrl/data/199e"
|
|
|
|
"-DTCAM_INSTALL_GST_1_0=${placeholder "out"}/lib/gstreamer-1.0"
|
|
|
|
"-DTCAM_INSTALL_GIR=${placeholder "out"}/share/gir-1.0"
|
|
|
|
"-DTCAM_INSTALL_TYPELIB=${placeholder "out"}/lib/girepository-1.0"
|
|
|
|
"-DTCAM_INSTALL_SYSTEMD=${placeholder "out"}/etc/systemd/system"
|
2021-05-10 20:26:47 +02:00
|
|
|
"-DTCAM_INSTALL_PYTHON3_MODULES=${placeholder "out"}/lib/${python3Packages.python.libPrefix}/site-packages"
|
|
|
|
"-DGSTREAMER_1.0_INCLUDEDIR=${placeholder "out"}/include/gstreamer-1.0"
|
2020-09-02 03:50:40 +02:00
|
|
|
# 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.
|
|
|
|
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
|
2018-06-10 23:57:42 +02:00
|
|
|
];
|
|
|
|
|
2021-05-10 20:26:47 +02:00
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
# gstreamer tests requires, besides gst-plugins-bad, plugins installed by this expression.
|
|
|
|
checkPhase = "ctest --force-new-ctest-process -E gstreamer";
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
wrapPythonPrograms "$out $pythonPath"
|
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
|
|
|
}
|