diff --git a/hosts/skycam/default.nix b/hosts/skycam/default.nix index 4dec8fa..d552216 100644 --- a/hosts/skycam/default.nix +++ b/hosts/skycam/default.nix @@ -68,10 +68,6 @@ SUBSYSTEM=="dma_heap", GROUP="video", MODE="0660" ''; - nixpkgs.overlays = [ - (import ./../../overlays/libcamera.nix) - ]; - networking = { hostId = "731d1660"; firewall = { @@ -104,7 +100,6 @@ }; environment.systemPackages = with pkgs; [ - camera-streamer git neovim libcamera diff --git a/overlays/0001-Ignore-IPA-signing.patch b/overlays/0001-Ignore-IPA-signing.patch deleted file mode 100644 index bb78031..0000000 --- a/overlays/0001-Ignore-IPA-signing.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 625939e594ce255afa3fab3a40c3e524460e1f8b Mon Sep 17 00:00:00 2001 -From: Jordan Holt -Date: Sat, 10 Aug 2024 18:28:08 +0100 -Subject: [PATCH] Ignore IPA signing - ---- - src/libcamera/ipa_manager.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp -index 6d5bbd05..43004175 100644 ---- a/src/libcamera/ipa_manager.cpp -+++ b/src/libcamera/ipa_manager.cpp -@@ -295,7 +295,7 @@ bool IPAManager::isSignatureValid([[maybe_unused]] IPAModule *ipa) const - if (data.empty()) - return false; - -- bool valid = pubKey_.verify(data, ipa->signature()); -+ bool valid = true; - - LOG(IPAManager, Debug) - << "IPA module " << ipa->path() << " signature is " --- -2.44.1 diff --git a/overlays/0001-Remove-relative-config-lookups.patch b/overlays/0001-Remove-relative-config-lookups.patch deleted file mode 100644 index ace53cc..0000000 --- a/overlays/0001-Remove-relative-config-lookups.patch +++ /dev/null @@ -1,141 +0,0 @@ -From 57128bb78f56cadf9e2dcca5ba4d710c3bd478a7 Mon Sep 17 00:00:00 2001 -From: Jordan Holt -Date: Mon, 5 Aug 2024 21:53:09 +0100 -Subject: [PATCH] Remove relative config lookups - ---- - src/libcamera/ipa_manager.cpp | 16 ---------- - src/libcamera/ipa_proxy.cpp | 48 ++---------------------------- - src/libcamera/pipeline_handler.cpp | 21 ++----------- - 3 files changed, 4 insertions(+), 81 deletions(-) - -diff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp -index f4e0b633..6d5bbd05 100644 ---- a/src/libcamera/ipa_manager.cpp -+++ b/src/libcamera/ipa_manager.cpp -@@ -131,22 +131,6 @@ IPAManager::IPAManager() - << "No IPA found in '" << modulePaths << "'"; - } - -- /* -- * When libcamera is used before it is installed, load IPAs from the -- * same build directory as the libcamera library itself. -- */ -- std::string root = utils::libcameraBuildPath(); -- if (!root.empty()) { -- std::string ipaBuildPath = root + "src/ipa"; -- constexpr int maxDepth = 2; -- -- LOG(IPAManager, Info) -- << "libcamera is not installed. Adding '" -- << ipaBuildPath << "' to the IPA search path"; -- -- ipaCount += addDir(ipaBuildPath.c_str(), maxDepth); -- } -- - /* Finally try to load IPAs from the installed system path. */ - ipaCount += addDir(IPA_MODULE_DIR); - -diff --git a/src/libcamera/ipa_proxy.cpp b/src/libcamera/ipa_proxy.cpp -index 69975d8f..cd9284a3 100644 ---- a/src/libcamera/ipa_proxy.cpp -+++ b/src/libcamera/ipa_proxy.cpp -@@ -122,33 +122,11 @@ std::string IPAProxy::configurationFile(const std::string &name, - } - } - -- std::string root = utils::libcameraSourcePath(); -- if (!root.empty()) { -- /* -- * When libcamera is used before it is installed, load -- * configuration files from the source directory. The -- * configuration files are then located in the 'data' -- * subdirectory of the corresponding IPA module. -- */ -- std::string ipaConfDir = root + "src/ipa/" + ipaName + "/data"; -- -- LOG(IPAProxy, Info) -- << "libcamera is not installed. Loading IPA configuration from '" -- << ipaConfDir << "'"; -- -- std::string confPath = ipaConfDir + "/" + name; -+ for (const auto &dir : utils::split(IPA_CONFIG_DIR, ":")) { -+ std::string confPath = dir + "/" + ipaName + "/" + name; - ret = stat(confPath.c_str(), &statbuf); - if (ret == 0 && (statbuf.st_mode & S_IFMT) == S_IFREG) - return confPath; -- -- } else { -- /* Else look in the system locations. */ -- for (const auto &dir : utils::split(IPA_CONFIG_DIR, ":")) { -- std::string confPath = dir + "/" + ipaName + "/" + name; -- ret = stat(confPath.c_str(), &statbuf); -- if (ret == 0 && (statbuf.st_mode & S_IFMT) == S_IFREG) -- return confPath; -- } - } - - if (fallbackName.empty()) { -@@ -197,28 +175,6 @@ std::string IPAProxy::resolvePath(const std::string &file) const - } - } - -- /* -- * When libcamera is used before it is installed, load proxy workers -- * from the same build directory as the libcamera directory itself. -- * This requires identifying the path of the libcamera.so, and -- * referencing a relative path for the proxy workers from that point. -- */ -- std::string root = utils::libcameraBuildPath(); -- if (!root.empty()) { -- std::string ipaProxyDir = root + "src/libcamera/proxy/worker"; -- -- LOG(IPAProxy, Info) -- << "libcamera is not installed. Loading proxy workers from '" -- << ipaProxyDir << "'"; -- -- std::string proxyPath = ipaProxyDir + proxyFile; -- if (!access(proxyPath.c_str(), X_OK)) -- return proxyPath; -- -- return std::string(); -- } -- -- /* Else try finding the exec target from the install directory. */ - std::string proxyPath = std::string(IPA_PROXY_DIR) + proxyFile; - if (!access(proxyPath.c_str(), X_OK)) - return proxyPath; -diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp -index 5ea2ca78..fd8555ca 100644 ---- a/src/libcamera/pipeline_handler.cpp -+++ b/src/libcamera/pipeline_handler.cpp -@@ -561,25 +561,8 @@ std::string PipelineHandler::configurationFile(const std::string &subdir, - struct stat statbuf; - int ret; - -- std::string root = utils::libcameraSourcePath(); -- if (!root.empty()) { -- /* -- * When libcamera is used before it is installed, load -- * configuration files from the source directory. The -- * configuration files are then located in the 'data' -- * subdirectory of the corresponding pipeline handler. -- */ -- std::string confDir = root + "src/libcamera/pipeline/"; -- confPath = confDir + subdir + "/data/" + name; -- -- LOG(Pipeline, Info) -- << "libcamera is not installed. Loading platform configuration file from '" -- << confPath << "'"; -- } else { -- /* Else look in the system locations. */ -- confPath = std::string(LIBCAMERA_DATA_DIR) -- + "/pipeline/" + subdir + '/' + name; -- } -+ confPath = std::string(LIBCAMERA_DATA_DIR) -+ + "/pipeline/" + subdir + '/' + name; - - ret = stat(confPath.c_str(), &statbuf); - if (ret == 0 && (statbuf.st_mode & S_IFMT) == S_IFREG) --- -2.44.1 diff --git a/overlays/libcamera.nix b/overlays/libcamera.nix deleted file mode 100644 index 9636566..0000000 --- a/overlays/libcamera.nix +++ /dev/null @@ -1,65 +0,0 @@ -final: prev: { - libpisp = final.stdenv.mkDerivation { - name = "libpisp"; - version = "1.0.5"; - src = final.fetchFromGitHub { - owner = "raspberrypi"; - repo = "libpisp"; - rev = "v1.0.5"; - hash = "sha256-CHd44CH5dBcZuK+5fZtONZ8HE/lwGKwK5U0BYUK8gG4="; - }; - - nativeBuildInputs = with final; [ - pkg-config - meson - ninja - ]; - - buildInputs = with final; [ - nlohmann_json - boost - ]; - - BOOST_INCLUDEDIR = "${prev.lib.getDev final.boost}/include"; - BOOST_LIBRARYDIR = "${prev.lib.getLib final.boost}/lib"; - }; - - libcamera = prev.libcamera.overrideAttrs (old: { - src = final.fetchFromGitHub { - owner = "raspberrypi"; - repo = "libcamera"; - rev = "eb00c13d7c9f937732305d47af5b8ccf895e700f"; - hash = "sha256-p0/inkHPRUkxSIsTmj7VI7sIaX7OXdqjMGZ31W7cnt4="; - }; - - postPatch = '' - patchShebangs utils/ src/py/ - ''; - - patches = [ - ./0001-Remove-relative-config-lookups.patch - ./0001-Ignore-IPA-signing.patch - ]; - - buildInputs = - old.buildInputs - ++ (with final; [ - libpisp - libglibutil - ]); - - mesonFlags = old.mesonFlags ++ [ - "--buildtype=release" - "-Dpipelines=rpi/vc4,rpi/pisp" - "-Dipas=rpi/vc4,rpi/pisp" - "-Dgstreamer=enabled" - "-Dtest=false" - "-Dcam=enabled" - "-Dpycamera=disabled" - ]; - }); - - camera-streamer = prev.callPackage ../pkgs/camera-streamer/package.nix { - libcamera = final.libcamera; - }; -} diff --git a/pkgs/camera-streamer/0001-Disable-libdatachannel.patch b/pkgs/camera-streamer/0001-Disable-libdatachannel.patch deleted file mode 100644 index 4bf1a50..0000000 --- a/pkgs/camera-streamer/0001-Disable-libdatachannel.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0f17bb86772afe9495891e420a809a0b3c071caf Mon Sep 17 00:00:00 2001 -From: Jordan Holt -Date: Sat, 10 Aug 2024 15:37:15 +0100 -Subject: [PATCH] Disable libdatachannel - ---- - Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile b/Makefile -index d5029bd..e50ba1a 100644 ---- a/Makefile -+++ b/Makefile -@@ -23,7 +23,7 @@ USE_HW_H264 ?= 1 - USE_FFMPEG ?= $(shell pkg-config libavutil libavformat libavcodec && echo 1) - USE_LIBCAMERA ?= $(shell pkg-config libcamera && echo 1) - USE_RTSP ?= $(shell pkg-config live555 && echo 1) --USE_LIBDATACHANNEL ?= $(shell [ -e $(LIBDATACHANNEL_PATH)/CMakeLists.txt ] && echo 1) -+USE_LIBDATACHANNEL ?= 0 - - ifeq (1,$(DEBUG)) - CFLAGS += -g --- -2.44.1 diff --git a/pkgs/camera-streamer/package.nix b/pkgs/camera-streamer/package.nix deleted file mode 100644 index 6cdb140..0000000 --- a/pkgs/camera-streamer/package.nix +++ /dev/null @@ -1,82 +0,0 @@ -{ - stdenv, - fetchFromGitHub, - - cmake, - gnumake, - pkg-config, - xxd, - - v4l-utils, - nlohmann_json, - ffmpegSupport ? true, - ffmpeg, - libcameraSupport ? true, - libcamera, - rtspSupport ? false, - live555, - webrtcSupport ? false, - openssl, - - lib, -}: - -stdenv.mkDerivation (finalAttrs: { - pname = "camera-streamer"; - version = "0.2.8"; - - src = fetchFromGitHub { - owner = "ayufan"; - repo = "camera-streamer"; - rev = "refs/tags/v${finalAttrs.version}"; - hash = "sha256-8vV8BMFoDeh22I1/qxk6zttJROaD/lrThBxXHZSPpT4="; - fetchSubmodules = true; - }; - - patches = [ - ./0001-Disable-libdatachannel.patch - ]; - - # Second replacement fixes literal newline in generated version.h. - postPatch = '' - substituteInPlace Makefile \ - --replace '/usr/local/bin' '/bin' \ - --replace 'echo "#define' 'echo -e "#define' - ''; - - env.NIX_CFLAGS_COMPILE = builtins.toString [ - "-Wno-error=stringop-overflow" - "-Wno-error=format" - "-Wno-format" - "-Wno-format-security" - "-Wno-error=unused-result" - ]; - - nativeBuildInputs = [ - cmake - gnumake - pkg-config - xxd - ]; - - dontUseCmakeConfigure = true; - - buildInputs = - [ - nlohmann_json - v4l-utils - ] - ++ (lib.optional ffmpegSupport ffmpeg) - ++ (lib.optional libcameraSupport libcamera) - ++ (lib.optional rtspSupport live555) - ++ (lib.optional webrtcSupport openssl); - - installFlags = [ "DESTDIR=${builtins.placeholder "out"}" ]; - preInstall = "mkdir -p $out/bin"; - - meta = with lib; { - description = "High-performance low-latency camera streamer for Raspberry Pi's"; - website = "https://github.com/ayufan/camera-streamer"; - license = licenses.gpl3Only; - }; -}) diff --git a/pkgs/rpicam-apps/package.nix b/pkgs/rpicam-apps/package.nix deleted file mode 100644 index 61d97bc..0000000 --- a/pkgs/rpicam-apps/package.nix +++ /dev/null @@ -1,58 +0,0 @@ -{ - stdenv, - fetchFromGitHub, - meson, - ninja, - pkg-config, - boost, - ffmpeg, - libcamera, - libdrm, - libexif, - libjpeg, - libpng, - libtiff, - lib, -}: - -stdenv.mkDerivation (finalAttrs: { - pname = "rpicam-apps"; - version = "1.4.1"; - - src = fetchFromGitHub { - owner = "raspberrypi"; - repo = "rpicam-apps"; - rev = "v" + finalAttrs.version; - hash = "sha256-3NG2ZE/Ub3lTbfne0LCXuDgLGTPaAAADRdElEbZwvls="; - }; - - nativeBuildInputs = [ - meson - ninja - pkg-config - ]; - - buildInputs = [ - boost - ffmpeg - libcamera - libdrm - libexif - libjpeg - libpng - libtiff - ]; - - # Meson is no longer able to pick up Boost automatically: - # https://github.com/NixOS/nixpkgs/issues/86131 - BOOST_INCLUDEDIR = "${lib.getDev boost}/include"; - BOOST_LIBRARYDIR = "${lib.getLib boost}/lib"; - - meta = with lib; { - description = '' - libcamera-based applications to drive the cameras on a Raspberry Pi platform - ''; - homepage = "https://github.com/raspberrypi/rpicam-apps"; - license = licenses.bsd2; - }; -})