From 9a1f60994b2c627a9fd2f2b810c3a80fd5343243 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 2 Sep 2020 03:50:40 +0200 Subject: [PATCH] tiscamera: clean up - use pkg-config instead of pkgconfig alias - use placeholders for cmakeFlags - do not skip build rpath - udev replacements no longer apply https://github.com/TheImagingSource/tiscamera/commit/47d4fb246b5f82763f87ad57c7d1ed3420655e96 There are some misplaced dependencies like gobject-introspection and orc that should probably go to nativeBuildInputs but upstream detects them incorrectly. --- pkgs/os-specific/linux/tiscamera/default.nix | 40 ++++++-------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/pkgs/os-specific/linux/tiscamera/default.nix b/pkgs/os-specific/linux/tiscamera/default.nix index 07fbdb606ce..f9196fc1686 100644 --- a/pkgs/os-specific/linux/tiscamera/default.nix +++ b/pkgs/os-specific/linux/tiscamera/default.nix @@ -2,7 +2,7 @@ , stdenv , fetchFromGitHub , cmake -, pkgconfig +, pkg-config , pcre , tinyxml , libusb1 @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake - pkgconfig + pkg-config ]; buildInputs = [ @@ -51,47 +51,31 @@ stdenv.mkDerivation rec { libuuid ]; - 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" + "-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" + # 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" ]; postPatch = '' - substituteInPlace ./data/udev/80-theimagingsource-cameras.rules.in \ - --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 = '' - export LD_LIBRARY_PATH=$PWD/src''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH - ''; - meta = with lib; { description = "The Linux sources and UVC firmwares for The Imaging Source cameras"; homepage = "https://github.com/TheImagingSource/tiscamera";