ctucx.git: nixfiles

ctucx' nixfiles

commit 7d4b98f13c5ace8466c4817319455035b8a693a1
parent 5534940a28e1944c416d3ed65468f1e8f2576d77
Author: Leah (ctucx) <leah@ctu.cx>
Date: Thu, 30 Jun 2022 09:52:42 +0200

pkgs: add AirSane
2 files changed, 50 insertions(+), 0 deletions(-)
A
pkgs/AirSane/default.nix
|
19
+++++++++++++++++++
A
pkgs/AirSane/remove-systemd-service-install.patch
|
31
+++++++++++++++++++++++++++++++
diff --git a/pkgs/AirSane/default.nix b/pkgs/AirSane/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchFromGitHub, cmake, sane-backends, libjpeg, libpng, libusb, avahi }:
+
+stdenv.mkDerivation rec {
+  pname = "AirSane";
+  version = "0.3.4";
+
+  src = fetchFromGitHub {
+    owner  = "SimulPiscator";
+    repo   = "AirSane";
+    rev    = "v${version}";
+    sha256 = "sha256-9k+dauewYsWqy8Bfgka90pLuz/48Rk90E2L4BhpmxvM=";
+  };
+
+  patches = [
+    ./remove-systemd-service-install.patch
+  ];
+
+  buildInputs = [ cmake sane-backends libjpeg libpng libusb avahi ];
+}
diff --git a/pkgs/AirSane/remove-systemd-service-install.patch b/pkgs/AirSane/remove-systemd-service-install.patch
@@ -0,0 +1,31 @@
+--- a/CMakeLists.txt	2022-03-31 21:13:41.000000000 +0200
++++ b/CMakeLists.txt	2022-06-27 20:21:37.477248465 +0200
+@@ -152,28 +152,5 @@
+ install(TARGETS ${PROJECT_NAME}
+     RUNTIME DESTINATION bin
+ )
+-install(FILES systemd/airsaned.service
+-    DESTINATION /lib/systemd/system
+-)
+-install(FILES systemd/airsaned.default
+-    DESTINATION /etc/default
+-    RENAME airsane
+-)
+-
+-install(CODE "
+-    if(NOT EXISTS /etc/airsane/ignore.conf)
+-        file(INSTALL ${CMAKE_SOURCE_DIR}/etc/ignore.conf DESTINATION /etc/airsane)
+-    endif()
+-")
+-install(CODE "
+-    if(NOT EXISTS /etc/airsane/options.conf)
+-        file(INSTALL ${CMAKE_SOURCE_DIR}/etc/options.conf DESTINATION /etc/airsane)
+-    endif()
+-")
+-install(CODE "
+-    if(NOT EXISTS /etc/airsane/Gnome-scanner.png)
+-        file(INSTALL ${CMAKE_SOURCE_DIR}/etc/Gnome-scanner.png DESTINATION /etc/airsane)
+-    endif()
+-")
+ 
+ endif()