summary refs log tree commit diff
path: root/pkgs/applications/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/graphics')
-rw-r--r--pkgs/applications/graphics/djv/default.nix152
-rw-r--r--pkgs/applications/graphics/renderdoc/default.nix15
-rw-r--r--pkgs/applications/graphics/sane/backends/default.nix13
-rw-r--r--pkgs/applications/graphics/sane/drivers.nix13
-rw-r--r--pkgs/applications/graphics/scantailor/default.nix2
5 files changed, 187 insertions, 8 deletions
diff --git a/pkgs/applications/graphics/djv/default.nix b/pkgs/applications/graphics/djv/default.nix
new file mode 100644
index 00000000000..95a29f243e4
--- /dev/null
+++ b/pkgs/applications/graphics/djv/default.nix
@@ -0,0 +1,152 @@
+{ stdenv
+, cmake
+, fetchFromGitHub
+, lib
+, alsa-lib
+, libGL
+, libX11
+, libXinerama
+, libXi
+, zlib
+, rtaudio
+, rapidjson
+, ilmbase
+, glm
+, glfw3
+, libpng
+, opencolorio_1
+, freetype
+}:
+
+let
+
+  # The way third-party dependencies are packaged has changed
+  # significantly from the 2.0.8 release. This means any packaging
+  # effort for the 2.0.8 release would have to be redone for the next
+  # release. Hence we package the git version for now and can easily
+  # jump onto the next release once it's available.
+  djvVersion = "2.0.8-unstable-2021-07-31";
+
+  djvSrc = fetchFromGitHub {
+    owner = "darbyjohnston";
+    repo = "djv";
+    rev = "ae31712c4f2802a874217ac194bde26287993934";
+    sha256 = "1qgia6vqb6fhyfj8w925xl6k6zidrp2gj5f32bpi94lwwhi6p9pd";
+  };
+
+  # DJV's build system tries to automatically pull in FSeq, another
+  # library by the DJV author.
+  #
+  # When updating, check the following file in the DJV source:
+  # etc/SuperBuild/cmake/Modules/BuildFSeq.cmake
+  #
+  # If there is revision or tag specified, DJV wants to use the most
+  # recent master version
+  fseqSrc = fetchFromGitHub {
+    owner = "darbyjohnston";
+    repo = "fseq";
+    rev = "545fac6018100f7fca474b8ee4f1efa7cbf6bf45";
+    sha256 = "0qfhbrzji05hh5kwgd1wvq2lbf81ylbi7v7aqk28aws27f8d2hk0";
+  };
+
+  djv-deps = stdenv.mkDerivation rec {
+    pname = "djv-dependencies";
+    version = djvVersion;
+
+    src = djvSrc;
+
+    sourceRoot = "source/etc/SuperBuild";
+
+    nativeBuildInputs = [ cmake ];
+    buildInputs = [
+      libGL
+    ];
+
+    postPatch = ''
+      chmod -R +w .
+
+      sed -i 's,GIT_REPOSITORY https://github.com/darbyjohnston/FSeq.git,SOURCE_DIR ${fseqSrc},' \
+          cmake/Modules/BuildFSeq.cmake
+
+      # We pull these projects in as normal Nix dependencies. No need
+      # to build them again here.
+
+      sed -i CMakeLists.txt \
+          -e '/list(APPEND DJV_THIRD_PARTY_DEPS RapidJSON)/d' \
+          -e '/list(APPEND DJV_THIRD_PARTY_DEPS RtAudio)/d' \
+          -e '/list(APPEND DJV_THIRD_PARTY_DEPS IlmBase)/d' \
+          -e '/list(APPEND DJV_THIRD_PARTY_DEPS GLM)/d' \
+          -e '/list(APPEND DJV_THIRD_PARTY_DEPS GLFW)/d' \
+          -e '/list(APPEND DJV_THIRD_PARTY_DEPS ZLIB)/d' \
+          -e '/list(APPEND DJV_THIRD_PARTY_DEPS PNG)/d' \
+          -e '/list(APPEND DJV_THIRD_PARTY_DEPS FreeType)/d' \
+          -e '/list(APPEND DJV_THIRD_PARTY_DEPS OCIO)/d'
+
+      # The "SuperBuild" wants to build DJV right here. This is
+      # inconvenient, because then the `make install` target is not generated
+      # by CMake. We build DJV in its own derivation below. This also makes
+      # the build a bit more modular.
+
+      sed -i '/include(BuildDJV)/d' \
+          CMakeLists.txt
+    '';
+
+    cmakeFlags = [
+      "-DDJV_THIRD_PARTY_OpenEXR:BOOL=False"
+      "-DDJV_THIRD_PARTY_JPEG:BOOL=False"
+      "-DDJV_THIRD_PARTY_TIFF:BOOL=False"
+    ];
+
+    dontInstall = true;
+    doCheck = true;
+  };
+
+in
+stdenv.mkDerivation rec {
+  pname = "djv";
+  version = djvVersion;
+
+  src = djvSrc;
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [
+    alsa-lib
+    libGL
+    libX11
+    libXinerama
+    libXi
+    rapidjson
+    rtaudio
+    ilmbase
+    glm
+    glfw3
+    zlib.dev
+    libpng
+    freetype
+    opencolorio_1
+    djv-deps
+  ];
+
+  postPatch = ''
+    chmod -R +w .
+
+    # When linking opencolorio statically this results in failing to
+    # pull in opencolorio's dependencies (tixml and yaml libraries). Avoid
+    # this by linking it statically instead.
+
+    sed -i cmake/Modules/FindOCIO.cmake \
+        -e 's/PATH_SUFFIXES static//' \
+        -e '/OpenColorIO_STATIC/d'
+  '';
+
+  # GLFW requires a working X11 session.
+  doCheck = false;
+
+  meta = with lib; {
+    description = "A professional review software for VFX, animation, and film production";
+    homepage = "https://darbyjohnston.github.io/DJV/";
+    platforms = platforms.linux;
+    maintainers = [ maintainers.blitz ];
+    license = licenses.bsd3;
+  };
+}
diff --git a/pkgs/applications/graphics/renderdoc/default.nix b/pkgs/applications/graphics/renderdoc/default.nix
index d6a2658d862..771a32d5a73 100644
--- a/pkgs/applications/graphics/renderdoc/default.nix
+++ b/pkgs/applications/graphics/renderdoc/default.nix
@@ -2,6 +2,7 @@
 , qtbase, qtx11extras, qtsvg, makeWrapper
 , vulkan-loader, libglvnd, xorg, python3, python3Packages
 , bison, pcre, automake, autoconf, addOpenGLRunpath
+, waylandSupport ? false, wayland
 }:
 let
   custom_swig = fetchFromGitHub {
@@ -10,23 +11,24 @@ let
     rev = "renderdoc-modified-7";
     sha256 = "15r2m5kcs0id64pa2fsw58qll3jyh71jzc04wy20pgsh2326zis6";
   };
-  pythonPackages = python3Packages;
+  cmakeBool = b: if b then "ON" else "OFF";
 in
 mkDerivation rec {
-  version = "1.14";
   pname = "renderdoc";
+  version = "1.15";
 
   src = fetchFromGitHub {
     owner = "baldurk";
     repo = "renderdoc";
     rev = "v${version}";
-    sha256 = "VO7pOLodXI0J7O4Y9b7YSl5BdtsIxmalFG5mqfuiJEw=";
+    sha256 = "HSWl3FC5YDIADO3h6oHxHdwsrFQKKj2zTtH2e3cc5iI=";
   };
 
   buildInputs = [
     qtbase qtsvg xorg.libpthreadstubs xorg.libXdmcp qtx11extras vulkan-loader python3
-  ]; # ++ (with pythonPackages; [pyside2 pyside2-tools shiboken2]);
+  ] # ++ (with python3Packages; [pyside2 pyside2-tools shiboken2])
   # TODO: figure out how to make cmake recognise pyside2
+  ++ lib.optional waylandSupport wayland;
 
   nativeBuildInputs = [ cmake makeWrapper pkg-config bison pcre automake autoconf addOpenGLRunpath ];
 
@@ -42,6 +44,7 @@ mkDerivation rec {
     "-DBUILD_VERSION_DIST_VER=${version}"
     "-DBUILD_VERSION_DIST_CONTACT=https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/graphics/renderdoc"
     "-DBUILD_VERSION_STABLE=ON"
+    "-DENABLE_WAYLAND=${cmakeBool waylandSupport}"
   ];
 
   # TODO: define these in the above array via placeholders, once those are widely supported
@@ -71,7 +74,7 @@ mkDerivation rec {
       of any application using Vulkan, D3D11, OpenGL or D3D12 across
       Windows 7 - 10, Linux or Android.
     '';
-    maintainers = [maintainers.jansol];
-    platforms = ["i686-linux" "x86_64-linux"];
+    maintainers = [ maintainers.jansol ];
+    platforms = [ "i686-linux" "x86_64-linux" ];
   };
 }
diff --git a/pkgs/applications/graphics/sane/backends/default.nix b/pkgs/applications/graphics/sane/backends/default.nix
index 821a97e3587..3d3c752dcde 100644
--- a/pkgs/applications/graphics/sane/backends/default.nix
+++ b/pkgs/applications/graphics/sane/backends/default.nix
@@ -2,12 +2,16 @@
 , gettext, pkg-config, python3
 , avahi, libgphoto2, libieee1284, libjpeg, libpng, libtiff, libusb1, libv4l, net-snmp
 , curl, systemd, libxml2, poppler
+, sane-drivers
 
 # List of { src name backend } attibute sets - see installFirmware below:
 , extraFirmware ? []
 
 # For backwards compatibility with older setups; use extraFirmware instead:
 , gt68xxFirmware ? null, snapscanFirmware ? null
+
+# Not included by default, scan snap drivers require fetching of unfree binaries.
+, scanSnapDriversUnfree ? false, scanSnapDriversPackage ? sane-drivers.epjitsu
 }:
 
 stdenv.mkDerivation {
@@ -88,7 +92,14 @@ stdenv.mkDerivation {
 
     # net.conf conflicts with the file generated by the nixos module
     rm $out/etc/sane.d/net.conf
-  '' + lib.concatStrings (builtins.map installFirmware compatFirmware);
+
+  ''
+  + lib.optionalString scanSnapDriversUnfree ''
+    # the ScanSnap drivers live under the epjitsu subdirectory, which was already created by the build but is empty.
+    rmdir $out/share/sane/epjitsu
+    ln -svT ${scanSnapDriversPackage} $out/share/sane/epjitsu
+  ''
+  + lib.concatStrings (builtins.map installFirmware compatFirmware);
 
   meta = with lib; {
     description = "SANE (Scanner Access Now Easy) backends";
diff --git a/pkgs/applications/graphics/sane/drivers.nix b/pkgs/applications/graphics/sane/drivers.nix
new file mode 100644
index 00000000000..9f1a644f4fa
--- /dev/null
+++ b/pkgs/applications/graphics/sane/drivers.nix
@@ -0,0 +1,13 @@
+{ lib, fetchFromGitHub }:
+
+{
+  # Fujitsu ScanSnap
+  epjitsu = fetchFromGitHub {
+    name = "scansnap-firmware";
+    owner = "stevleibelt";
+    repo = "scansnap-firmware";
+    rev = "96c3a8b2a4e4f1ccc4e5827c5eb5598084fd17c8";
+    sha256 = "1inchnvaqyw9d0skpg8hp5rpn27c09q58lsr42by4bahpbx5qday";
+    meta.license = lib.licenses.unfree;
+  };
+}
diff --git a/pkgs/applications/graphics/scantailor/default.nix b/pkgs/applications/graphics/scantailor/default.nix
index 291825770ac..898cc3336a5 100644
--- a/pkgs/applications/graphics/scantailor/default.nix
+++ b/pkgs/applications/graphics/scantailor/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
   buildInputs = [ qt4 libjpeg libtiff boost ];
 
   meta = {
-    homepage = "http://scantailor.org/";
+    homepage = "https://scantailor.org/";
     description = "Interactive post-processing tool for scanned pages";
 
     license = lib.licenses.gpl3Plus;