about summary refs log tree commit diff
path: root/pkgs/applications/graphics/sane
diff options
context:
space:
mode:
authorThomas Tuegel <ttuegel@gmail.com>2014-05-11 13:30:33 -0500
committerThomas Tuegel <ttuegel@gmail.com>2014-05-11 14:01:07 -0500
commitb4c89810648cce7c2c55b06443d9f5373e9d7230 (patch)
treea1cf945b9869cd848903566a0b6b7bf73e6e3c9a /pkgs/applications/graphics/sane
parent56994ce2ebfac75f0e4bcc06e43b47bdbb51790a (diff)
downloadnixlib-b4c89810648cce7c2c55b06443d9f5373e9d7230.tar
nixlib-b4c89810648cce7c2c55b06443d9f5373e9d7230.tar.gz
nixlib-b4c89810648cce7c2c55b06443d9f5373e9d7230.tar.bz2
nixlib-b4c89810648cce7c2c55b06443d9f5373e9d7230.tar.lz
nixlib-b4c89810648cce7c2c55b06443d9f5373e9d7230.tar.xz
nixlib-b4c89810648cce7c2c55b06443d9f5373e9d7230.tar.zst
nixlib-b4c89810648cce7c2c55b06443d9f5373e9d7230.zip
sane: add mkSaneConfig
Diffstat (limited to 'pkgs/applications/graphics/sane')
-rw-r--r--pkgs/applications/graphics/sane/config.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/pkgs/applications/graphics/sane/config.nix b/pkgs/applications/graphics/sane/config.nix
new file mode 100644
index 000000000000..fc1cd81ebc6e
--- /dev/null
+++ b/pkgs/applications/graphics/sane/config.nix
@@ -0,0 +1,27 @@
+{ stdenv }:
+
+{ paths }:
+
+with stdenv.lib;
+let installSanePath = path: ''
+      find "${path}/lib/sane" -not -type d -maxdepth 1 | while read backend; do
+        ln -s $backend $out/lib/sane/$(basename $backend)
+      done
+
+      find "${path}/etc/sane.d" -not -type d -maxdepth 1 | while read conf; do
+        ln -s $conf $out/etc/sane.d/$(basename $conf)
+      done
+
+      find "${path}/etc/sane.d/dll.d" -not -type d -maxdepth 1 | while read conf; do
+        ln -s $conf $out/etc/sane.d/dll.d/$(basename $conf)
+      done
+    '';
+in
+stdenv.mkDerivation {
+  name = "sane-config";
+  phases = "installPhase";
+
+  installPhase = ''
+    mkdir -p $out/etc/sane.d $out/etc/sane.d/dll.d $out/lib/sane
+  '' + concatMapStrings installSanePath paths;
+}