2018-06-10 21:57:42 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
2020-09-02 01:50:40 +00:00
|
|
|
, pkg-config
|
2022-06-15 20:20:59 +00:00
|
|
|
, runtimeShell
|
|
|
|
, catch2
|
|
|
|
, elfutils
|
|
|
|
, libselinux
|
|
|
|
, libsepol
|
|
|
|
, libunwind
|
2018-06-10 21:57:42 +00:00
|
|
|
, libusb1
|
2022-06-15 20:20:59 +00:00
|
|
|
, libuuid
|
2018-06-10 21:57:42 +00:00
|
|
|
, libzip
|
2022-06-15 20:20:59 +00:00
|
|
|
, orc
|
|
|
|
, pcre
|
|
|
|
, zstd
|
2018-06-10 21:57:42 +00:00
|
|
|
, glib
|
2018-12-02 11:41:15 +00:00
|
|
|
, gobject-introspection
|
2018-06-10 21:57:42 +00:00
|
|
|
, gst_all_1
|
2021-05-10 18:26:47 +00:00
|
|
|
, wrapGAppsHook
|
2022-06-15 20:20:59 +00:00
|
|
|
, withDoc ? true
|
|
|
|
, sphinx
|
|
|
|
, graphviz
|
|
|
|
, withAravis ? true
|
|
|
|
, aravis
|
|
|
|
, meson
|
|
|
|
, withAravisUsbVision ? withAravis
|
|
|
|
, withGui ? true
|
|
|
|
, qt5
|
2018-06-10 21:57:42 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "tiscamera";
|
2022-06-15 20:20:59 +00:00
|
|
|
version = "1.0.0";
|
2018-06-10 21:57:42 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "TheImagingSource";
|
|
|
|
repo = pname;
|
2019-08-15 12:41:18 +00:00
|
|
|
rev = "v-${pname}-${version}";
|
2022-06-15 20:20:59 +00:00
|
|
|
sha256 = "0msz33wvqrji11kszdswcvljqnjflmjpk0aqzmsv6i855y8xn6cd";
|
2018-06-10 21:57:42 +00:00
|
|
|
};
|
|
|
|
|
2022-06-15 20:20:59 +00:00
|
|
|
patches = [
|
|
|
|
./0001-tcamconvert-tcamsrc-add-missing-include-lib-dirs.patch
|
|
|
|
./0001-udev-rules-fix-install-location.patch
|
|
|
|
./0001-cmake-find-aravis-fix-pkg-cfg-include-dirs.patch
|
|
|
|
];
|
|
|
|
|
2021-10-31 13:09:41 +00:00
|
|
|
postPatch = ''
|
|
|
|
cp ${catch2}/include/catch2/catch.hpp external/catch/catch.hpp
|
2022-06-15 20:20:59 +00:00
|
|
|
|
|
|
|
substituteInPlace ./data/udev/80-theimagingsource-cameras.rules.in \
|
|
|
|
--replace "/bin/sh" "${runtimeShell}/bin/sh" \
|
|
|
|
--replace "typically /usr/bin/" "" \
|
|
|
|
--replace "typically /usr/share/theimagingsource/tiscamera/uvc-extension/" ""
|
2021-10-31 13:09:41 +00:00
|
|
|
'';
|
|
|
|
|
2018-06-10 21:57:42 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2020-09-02 01:50:40 +00:00
|
|
|
pkg-config
|
2021-05-10 18:26:47 +00:00
|
|
|
wrapGAppsHook
|
2023-06-22 11:49:31 +00:00
|
|
|
gobject-introspection
|
2022-06-15 20:20:59 +00:00
|
|
|
] ++ lib.optionals withDoc [
|
|
|
|
sphinx
|
|
|
|
graphviz
|
|
|
|
] ++ lib.optionals withAravis [
|
|
|
|
meson
|
|
|
|
] ++ lib.optionals withGui [
|
|
|
|
qt5.wrapQtAppsHook
|
2018-06-10 21:57:42 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2022-06-15 20:20:59 +00:00
|
|
|
elfutils
|
|
|
|
libselinux
|
|
|
|
libsepol
|
|
|
|
libunwind
|
2018-06-10 21:57:42 +00:00
|
|
|
libusb1
|
2022-06-15 20:20:59 +00:00
|
|
|
libuuid
|
2018-06-10 21:57:42 +00:00
|
|
|
libzip
|
2022-06-15 20:20:59 +00:00
|
|
|
orc
|
|
|
|
pcre
|
|
|
|
zstd
|
2018-06-10 21:57:42 +00:00
|
|
|
glib
|
|
|
|
gst_all_1.gstreamer
|
|
|
|
gst_all_1.gst-plugins-base
|
2022-06-15 20:20:59 +00:00
|
|
|
gst_all_1.gst-plugins-good
|
|
|
|
gst_all_1.gst-plugins-bad
|
|
|
|
gst_all_1.gst-plugins-ugly
|
|
|
|
] ++ lib.optionals withAravis [
|
|
|
|
aravis
|
|
|
|
] ++ lib.optionals withGui [
|
|
|
|
qt5.qtbase
|
2018-06-10 21:57:42 +00:00
|
|
|
];
|
|
|
|
|
2022-06-15 20:20:59 +00:00
|
|
|
hardeningDisable = [ "format" ];
|
2021-05-10 18:26:47 +00:00
|
|
|
|
2018-06-10 21:57:42 +00:00
|
|
|
cmakeFlags = [
|
2022-06-15 20:20:59 +00:00
|
|
|
"-DTCAM_BUILD_GST_1_0=ON"
|
|
|
|
"-DTCAM_BUILD_TOOLS=ON"
|
|
|
|
"-DTCAM_BUILD_V4L2=ON"
|
|
|
|
"-DTCAM_BUILD_LIBUSB=ON"
|
|
|
|
"-DTCAM_BUILD_TESTS=ON"
|
|
|
|
"-DTCAM_BUILD_ARAVIS=${if withAravis then "ON" else "OFF"}"
|
|
|
|
"-DTCAM_BUILD_DOCUMENTATION=${if withDoc then "ON" else "OFF"}"
|
|
|
|
"-DTCAM_BUILD_WITH_GUI=${if withGui then "ON" else "OFF"}"
|
|
|
|
"-DTCAM_DOWNLOAD_MESON=OFF"
|
|
|
|
"-DTCAM_INTERNAL_ARAVIS=OFF"
|
|
|
|
"-DTCAM_ARAVIS_USB_VISION=${if withAravis && withAravisUsbVision then "ON" else "OFF"}"
|
|
|
|
"-DTCAM_INSTALL_FORCE_PREFIX=ON"
|
2018-06-10 21:57:42 +00:00
|
|
|
];
|
|
|
|
|
2021-05-10 18:26:47 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
# gstreamer tests requires, besides gst-plugins-bad, plugins installed by this expression.
|
|
|
|
checkPhase = "ctest --force-new-ctest-process -E gstreamer";
|
|
|
|
|
2022-06-15 20:20:59 +00:00
|
|
|
# wrapGAppsHook: make sure we add ourselves to the introspection
|
|
|
|
# and gstreamer paths.
|
|
|
|
GI_TYPELIB_PATH = "${placeholder "out"}/lib/girepository-1.0";
|
|
|
|
GST_PLUGIN_SYSTEM_PATH_1_0 = "${placeholder "out"}/lib/gstreamer-1.0";
|
|
|
|
|
|
|
|
QT_PLUGIN_PATH = lib.optionalString withGui "${qt5.qtbase.bin}/${qt5.qtbase.qtPluginPrefix}";
|
|
|
|
|
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
gappsWrapperArgs+=("''${qtWrapperArgs[@]}")
|
2018-06-10 21:57:42 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "The Linux sources and UVC firmwares for The Imaging Source cameras";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/TheImagingSource/tiscamera";
|
2018-06-10 21:57:42 +00:00
|
|
|
license = with licenses; [ asl20 ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ jraygauthier ];
|
|
|
|
};
|
2020-01-28 13:44:33 +00:00
|
|
|
}
|