From patchwork Tue Aug 10 08:01:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: phodina X-Patchwork-Id: 31973 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id C3BD127BC78; Tue, 10 Aug 2021 09:02:15 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id EAF4227BC82 for ; Tue, 10 Aug 2021 09:02:14 +0100 (BST) Received: from localhost ([::1]:44074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDMiD-0005wT-Pz for patchwork@mira.cbaines.net; Tue, 10 Aug 2021 04:02:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDMi2-0005wG-T3 for guix-patches@gnu.org; Tue, 10 Aug 2021 04:02:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46841) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mDMi2-0002lh-Kj for guix-patches@gnu.org; Tue, 10 Aug 2021 04:02:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mDMi2-0004j5-IX for guix-patches@gnu.org; Tue, 10 Aug 2021 04:02:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49970] [PATCH v2] gnu: Add librealsense. References: In-Reply-To: Resent-From: phodina Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 10 Aug 2021 08:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49970 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: "49970@debbugs.gnu.org" <49970@debbugs.gnu.org> Received: via spool by 49970-submit@debbugs.gnu.org id=B49970.162858248418114 (code B ref 49970); Tue, 10 Aug 2021 08:02:02 +0000 Received: (at 49970) by debbugs.gnu.org; 10 Aug 2021 08:01:24 +0000 Received: from localhost ([127.0.0.1]:58386 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDMhP-0004i6-TJ for submit@debbugs.gnu.org; Tue, 10 Aug 2021 04:01:24 -0400 Received: from mail-4316.protonmail.ch ([185.70.43.16]:51627) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDMhO-0004ht-6e for 49970@debbugs.gnu.org; Tue, 10 Aug 2021 04:01:23 -0400 Date: Tue, 10 Aug 2021 08:01:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1628582474; bh=f4BTwpjzaUfdTQ/ZEn+BOC3v3mAKlVqMdPWgap8GUmc=; h=Date:To:From:Reply-To:Subject:From; b=ptIyT8W7dKkltSk1F1zY0p+kYTY10WkgGF9Fva0LxxY7IvPNAeRW8oaVb2S7RykwC wMWYA7BBi2TMhwC9vaxtbPn3MDJkhFt/KJheqMJa3XPl1ujkWiVvNGDZ/FEXhTMPV2 MGOk1ltwuDUF58zaeizMfQkx4PLfDErSg9ztvk+s= Message-ID: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: phodina X-ACL-Warn: , phodina via Guix-patches X-Patchwork-Original-From: phodina via Guix-patches via From: phodina X-getmail-retrieved-from-mailbox: Patches * gnu/packages/video.scm (librealsense): New variable. * gnu/packages/patches/librealsense-remove-network-connectivity.patch: New file. --- 2.32.0 diff --git a/gnu/packages/patches/librealsense-remove-network-connectivity.patch b/gnu/packages/patches/librealsense-remove-network-connectivity.patch new file mode 100644 index 0000000000..73926587ff --- /dev/null +++ b/gnu/packages/patches/librealsense-remove-network-connectivity.patch @@ -0,0 +1,68 @@ +From cfc87289d7636f439e2b91d88e35430949b29c0f Mon Sep 17 00:00:00 2001 +From: Petr Hodina +Date: Sat, 31 Jul 2021 05:58:40 +0200 +Subject: [PATCH] Remove network connectivity + + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0c15d9510..a4d891444 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 3.1.0) + project(librealsense2 LANGUAGES CXX C) + + include(CMake/lrs_options.cmake) +-include(CMake/connectivity_check.cmake) + + #Deprecation message, should be removed in future releases + if(${FORCE_LIBUVC} OR ${FORCE_WINUSB_UVC} OR ${ANDROID_USB_HOST_UVC}) +@@ -12,14 +11,12 @@ if(${FORCE_LIBUVC} OR ${FORCE_WINUSB_UVC} OR ${ANDROID_USB_HOST_UVC}) + endif() + + # Checking Internet connection, as TM2 needs to download the FW from amazon cloud +-if(BUILD_WITH_TM2 AND NOT INTERNET_CONNECTION) +- message(WARNING "No internet connection, disabling BUILD_WITH_TM2") ++if(BUILD_WITH_TM2) + set(BUILD_WITH_TM2 OFF) + endif() + + # Checking Internet connection, as DEPTH CAM needs to download the FW from amazon cloud +-if(IMPORT_DEPTH_CAM_FW AND NOT INTERNET_CONNECTION) +- message(WARNING "No internet connection, disabling IMPORT_DEPTH_CAM_FW") ++if(IMPORT_DEPTH_CAM_FW) + set(IMPORT_DEPTH_CAM_FW OFF) + endif() + +diff --git a/common/fw/CMakeLists.txt b/common/fw/CMakeLists.txt +index 32b1dd29a..9961e4d1d 100644 +--- a/common/fw/CMakeLists.txt ++++ b/common/fw/CMakeLists.txt +@@ -6,8 +6,6 @@ project(fw) + + file(READ "firmware-version.h" ver) + +-message(STATUS "Fetching recommended firmwares:") +- + set(REALSENSE_FIRMWARE_URL "https://librealsense.intel.com" CACHE STRING + "URL to download firmware binaries from") + +@@ -51,16 +49,6 @@ set_target_properties (${PROJECT_NAME} PROPERTIES FOLDER Resources) + + function(target_binary url version sha1 symbol ext) + set(binary "${CMAKE_CURRENT_BINARY_DIR}/${symbol}-${version}${ext}") +- message(STATUS "${url}/${symbol}-${version}${ext}") +- file(DOWNLOAD "${url}/${symbol}-${version}${ext}" "${binary}" +- EXPECTED_HASH SHA1=${sha1} +- STATUS status) +- list(GET status 0 error_code) +- if (NOT ${error_code} EQUAL 0) +- message(FATAL_ERROR "Download firmwnare (${status}) - ${url}") +- else() +- message(STATUS "Download firmware ${status} for ${symbol}-${version}${ext}") +- endif() + string(TOUPPER ${symbol} SYMBOL) + string(REPLACE "." "," version_commas ${version}) + string(REPLACE "\\" "\\\\" binary_escaped "${binary}") +-- +2.32.0 + diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index 399327741f..73009e97d5 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -53,6 +53,7 @@ ;;; Copyright © 2021 Maxim Cournoyer ;;; Copyright © 2020 Hartmut Goebel ;;; Copyright © 2021 Raghav Gururajan +;;; Copyright © 2021 Petr Hodina ;;; ;;; This file is part of GNU Guix. ;;; @@ -145,6 +146,7 @@ #:use-module (gnu packages mp3) #:use-module (gnu packages ncurses) #:use-module (gnu packages networking) + #:use-module (gnu packages ninja) #:use-module (gnu packages ocr) #:use-module (gnu packages pcre) #:use-module (gnu packages perl) @@ -577,6 +579,54 @@ other software.") ;; Library. license:lgpl3+)))) +(define-public librealsense + (package + (name "librealsense") + (version "2.47.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/IntelRealSense/librealsense") + (commit (string-append "v" version)))) + (patches + (search-patches "librealsense-remove-network-connectivity.patch")) + (file-name (git-file-name name version)) + (modules '((guix build utils))) + (sha256 + (base32 + "1jshhcnvbaa3xm5jr1s5m6z62wn1cspb7wkfdc1w88kp9j02ss8w")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f ; no tests + #:configure-flags (list "-DBUILD_EXAMPLES=ON" + "-DBUILD_GRAPHICAL_EXAMPLES=ON" + "-DINTERNET_CONNECTION=OFF" + "-DCHECK_FOR_UPDATES=OFF") + #:phases + (modify-phases %standard-phases + ;; more convenient than manually invoking setup_udev_rules.sh + ;; and substituting the path in the script + (add-after 'unpack 'copy-udev-rules + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (string-append (assoc-ref outputs "out") + "/etc/udev/rules.d"))) + (mkdir-p (string-append out)) + (copy-file "config/99-realsense-libusb.rules" + (string-append out + "/99-realsense-libusb.rules")))))))) + (native-inputs `(("pkg-config" ,pkg-config) + ("ninja" ,ninja))) + (inputs `(("glfw" ,glfw) + ("gtk+" ,gtk+) + ("libusb" ,libusb) + ("glu" ,glu))) + (synopsis "Intel RealSense SDK") + (description "Intel RealSense SDK 2.0 is a cross-platform library for +Intel RealSense depth cameras (D400 & L500 series and the SR300) and the +T265 tracking camera.") + (home-page "https://github.com/IntelRealSense/librealsense") + (license license:gpl3))) + (define-public tslib (package (name "tslib")