about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/graphics')
-rw-r--r--nixpkgs/pkgs/applications/graphics/ImageMagick/6.x.nix89
-rw-r--r--nixpkgs/pkgs/applications/graphics/ImageMagick/7.0.nix99
-rw-r--r--nixpkgs/pkgs/applications/graphics/ahoviewer/default.nix53
-rw-r--r--nixpkgs/pkgs/applications/graphics/akira/default.nix75
-rw-r--r--nixpkgs/pkgs/applications/graphics/alchemy/default.nix40
-rw-r--r--nixpkgs/pkgs/applications/graphics/animbar/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/graphics/antimony/default.nix74
-rw-r--r--nixpkgs/pkgs/applications/graphics/antimony/mimetype.xml7
-rw-r--r--nixpkgs/pkgs/applications/graphics/antimony/paths-fix.patch21
-rw-r--r--nixpkgs/pkgs/applications/graphics/apitrace/default.nix67
-rw-r--r--nixpkgs/pkgs/applications/graphics/apngasm/2.nix35
-rw-r--r--nixpkgs/pkgs/applications/graphics/apngasm/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/graphics/autopanosiftc/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/graphics/autotrace/autofig.nix10
-rw-r--r--nixpkgs/pkgs/applications/graphics/autotrace/default.nix125
-rw-r--r--nixpkgs/pkgs/applications/graphics/avocode/default.nix106
-rw-r--r--nixpkgs/pkgs/applications/graphics/awesomebump/default.nix63
-rw-r--r--nixpkgs/pkgs/applications/graphics/awesomebump/qtnproperty-parallel-building.patch9
-rw-r--r--nixpkgs/pkgs/applications/graphics/azpainter/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/graphics/batik/default.nix23
-rw-r--r--nixpkgs/pkgs/applications/graphics/blockbench-electron/default.nix48
-rw-r--r--nixpkgs/pkgs/applications/graphics/c3d/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/graphics/cloudcompare/default.nix92
-rw-r--r--nixpkgs/pkgs/applications/graphics/comical/default.nix23
-rw-r--r--nixpkgs/pkgs/applications/graphics/comical/wxgtk-2.8.patch36
-rw-r--r--nixpkgs/pkgs/applications/graphics/coreimage/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/graphics/cq-editor/default.nix63
-rw-r--r--nixpkgs/pkgs/applications/graphics/cq-editor/spyder4.patch58
-rw-r--r--nixpkgs/pkgs/applications/graphics/darktable/default.nix62
-rw-r--r--nixpkgs/pkgs/applications/graphics/deskew/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/graphics/dia/CVE-2019-19451.patch11
-rw-r--r--nixpkgs/pkgs/applications/graphics/dia/default.nix43
-rw-r--r--nixpkgs/pkgs/applications/graphics/digikam/default.nix137
-rw-r--r--nixpkgs/pkgs/applications/graphics/displaycal/default.nix72
-rw-r--r--nixpkgs/pkgs/applications/graphics/djv/default.nix152
-rw-r--r--nixpkgs/pkgs/applications/graphics/djview/default.nix74
-rw-r--r--nixpkgs/pkgs/applications/graphics/dosage/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/graphics/drawing/default.nix69
-rw-r--r--nixpkgs/pkgs/applications/graphics/drawio/default.nix97
-rw-r--r--nixpkgs/pkgs/applications/graphics/drawpile/default.nix108
-rw-r--r--nixpkgs/pkgs/applications/graphics/eddy/default.nix47
-rw-r--r--nixpkgs/pkgs/applications/graphics/emulsion/default.nix77
-rw-r--r--nixpkgs/pkgs/applications/graphics/epeg/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/graphics/evilpixie/default.nix59
-rw-r--r--nixpkgs/pkgs/applications/graphics/exrdisplay/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/graphics/exrtools/default.nix23
-rw-r--r--nixpkgs/pkgs/applications/graphics/f3d/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/graphics/fbida/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/graphics/feh/default.nix44
-rw-r--r--nixpkgs/pkgs/applications/graphics/fig2dev/default.nix42
-rw-r--r--nixpkgs/pkgs/applications/graphics/fluxus/default.nix96
-rw-r--r--nixpkgs/pkgs/applications/graphics/fluxus/fix-build.patch16
-rw-r--r--nixpkgs/pkgs/applications/graphics/fondo/default.nix72
-rw-r--r--nixpkgs/pkgs/applications/graphics/fontmatrix/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/graphics/foxotron/default.nix74
-rw-r--r--nixpkgs/pkgs/applications/graphics/freecad/default.nix167
-rw-r--r--nixpkgs/pkgs/applications/graphics/freepv/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/graphics/fstl/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/graphics/gcolor2/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/graphics/gcolor2/gcolor2-amd64.patch46
-rw-r--r--nixpkgs/pkgs/applications/graphics/gcolor3/default.nix51
-rw-r--r--nixpkgs/pkgs/applications/graphics/geeqie/default.nix65
-rw-r--r--nixpkgs/pkgs/applications/graphics/gimp/default.nix184
-rw-r--r--nixpkgs/pkgs/applications/graphics/gimp/hardcode-plugin-interpreters.patch11
-rw-r--r--nixpkgs/pkgs/applications/graphics/gimp/plugins/default.nix261
-rw-r--r--nixpkgs/pkgs/applications/graphics/gimp/plugins/patches/focusblur-glib.patch200
-rw-r--r--nixpkgs/pkgs/applications/graphics/gimp/remove-cc-reference.patch13
-rw-r--r--nixpkgs/pkgs/applications/graphics/gimp/wrapper.nix29
-rw-r--r--nixpkgs/pkgs/applications/graphics/glabels/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/graphics/glimpse/default.nix199
-rw-r--r--nixpkgs/pkgs/applications/graphics/glimpse/plugins/default.nix11
-rw-r--r--nixpkgs/pkgs/applications/graphics/glimpse/remove-cc-reference.patch13
-rw-r--r--nixpkgs/pkgs/applications/graphics/glimpse/wrapper.nix30
-rw-r--r--nixpkgs/pkgs/applications/graphics/gnome-photos/default.nix127
-rw-r--r--nixpkgs/pkgs/applications/graphics/gnome-photos/installed-tests-path.patch23
-rw-r--r--nixpkgs/pkgs/applications/graphics/gnuclad/default.nix24
-rw-r--r--nixpkgs/pkgs/applications/graphics/gocr/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/graphics/goxel/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/graphics/goxel/disable-imgui_ini.patch13
-rw-r--r--nixpkgs/pkgs/applications/graphics/gpicview/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/graphics/gqview/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/graphics/grafx2/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/graphics/graphicsmagick/compat.nix37
-rw-r--r--nixpkgs/pkgs/applications/graphics/graphicsmagick/default.nix49
-rw-r--r--nixpkgs/pkgs/applications/graphics/graphicsmagick/disable-popen.patch12
-rw-r--r--nixpkgs/pkgs/applications/graphics/gscan2pdf/default.nix133
-rw-r--r--nixpkgs/pkgs/applications/graphics/gthumb/default.nix113
-rw-r--r--nixpkgs/pkgs/applications/graphics/guetzli/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/graphics/hdr-plus/default.nix42
-rw-r--r--nixpkgs/pkgs/applications/graphics/hello-wayland/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/graphics/hugin/default.nix53
-rw-r--r--nixpkgs/pkgs/applications/graphics/hydrus/default.nix114
-rw-r--r--nixpkgs/pkgs/applications/graphics/ideogram/default.nix68
-rw-r--r--nixpkgs/pkgs/applications/graphics/image_optim/Gemfile2
-rw-r--r--nixpkgs/pkgs/applications/graphics/image_optim/Gemfile.lock23
-rw-r--r--nixpkgs/pkgs/applications/graphics/image_optim/default.nix66
-rw-r--r--nixpkgs/pkgs/applications/graphics/image_optim/gemset.nix51
-rw-r--r--nixpkgs/pkgs/applications/graphics/imagej/default.nix74
-rw-r--r--nixpkgs/pkgs/applications/graphics/img-cat/default.nix22
-rw-r--r--nixpkgs/pkgs/applications/graphics/imgbrd-grabber/default.nix94
-rw-r--r--nixpkgs/pkgs/applications/graphics/imgcat/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/graphics/imgp/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/graphics/imlibsetroot/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/graphics/imv/default.nix116
-rw-r--r--nixpkgs/pkgs/applications/graphics/inkscape/default.nix171
-rw-r--r--nixpkgs/pkgs/applications/graphics/inkscape/extensions.nix46
-rw-r--r--nixpkgs/pkgs/applications/graphics/inkscape/extensions/applytransforms/default.nix42
-rw-r--r--nixpkgs/pkgs/applications/graphics/inkscape/fix-python-paths.patch17
-rw-r--r--nixpkgs/pkgs/applications/graphics/inkscape/with-extensions.nix27
-rw-r--r--nixpkgs/pkgs/applications/graphics/ipe/default.nix67
-rw-r--r--nixpkgs/pkgs/applications/graphics/jpeg-archive/default.nix43
-rw-r--r--nixpkgs/pkgs/applications/graphics/jpeginfo/default.nix21
-rw-r--r--nixpkgs/pkgs/applications/graphics/jpegoptim/default.nix24
-rw-r--r--nixpkgs/pkgs/applications/graphics/jpegrescan/default.nix42
-rw-r--r--nixpkgs/pkgs/applications/graphics/k3d/default.nix51
-rw-r--r--nixpkgs/pkgs/applications/graphics/kcc/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/graphics/kgraphviewer/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/graphics/kodelife/default.nix66
-rw-r--r--nixpkgs/pkgs/applications/graphics/krita/beta.nix7
-rw-r--r--nixpkgs/pkgs/applications/graphics/krita/default.nix7
-rw-r--r--nixpkgs/pkgs/applications/graphics/krita/generic.nix59
-rw-r--r--nixpkgs/pkgs/applications/graphics/krop/default.nix51
-rw-r--r--nixpkgs/pkgs/applications/graphics/ktikz/default.nix60
-rw-r--r--nixpkgs/pkgs/applications/graphics/lazpaint/default.nix68
-rw-r--r--nixpkgs/pkgs/applications/graphics/leocad/default.nix53
-rw-r--r--nixpkgs/pkgs/applications/graphics/lightburn/default.nix49
-rw-r--r--nixpkgs/pkgs/applications/graphics/luminance-hdr/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/graphics/mandelbulber/default.nix64
-rw-r--r--nixpkgs/pkgs/applications/graphics/mcomix3/default.nix104
-rw-r--r--nixpkgs/pkgs/applications/graphics/megapixels/default.nix71
-rw-r--r--nixpkgs/pkgs/applications/graphics/meh/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/graphics/meme-image-generator/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/graphics/menyoki/default.nix44
-rw-r--r--nixpkgs/pkgs/applications/graphics/meshlab/default.nix80
-rw-r--r--nixpkgs/pkgs/applications/graphics/meshlab/meshlab.desktop14
-rw-r--r--nixpkgs/pkgs/applications/graphics/minidjvu/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/graphics/monado/default.nix122
-rw-r--r--nixpkgs/pkgs/applications/graphics/mozjpeg/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/graphics/mtpaint/default.nix43
-rw-r--r--nixpkgs/pkgs/applications/graphics/mypaint/default.nix100
-rw-r--r--nixpkgs/pkgs/applications/graphics/nomacs/default.nix72
-rw-r--r--nixpkgs/pkgs/applications/graphics/nufraw/default.nix75
-rw-r--r--nixpkgs/pkgs/applications/graphics/nufraw/move-extern-c.patch21
-rw-r--r--nixpkgs/pkgs/applications/graphics/nufraw/nufraw.thumbnailer4
-rw-r--r--nixpkgs/pkgs/applications/graphics/ocrad/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/graphics/ocrfeeder/default.nix73
-rw-r--r--nixpkgs/pkgs/applications/graphics/odafileconverter/default.nix53
-rw-r--r--nixpkgs/pkgs/applications/graphics/openboard/default.nix116
-rw-r--r--nixpkgs/pkgs/applications/graphics/openimageio/2.x.nix62
-rw-r--r--nixpkgs/pkgs/applications/graphics/openimageio/2539_backport.patch31
-rw-r--r--nixpkgs/pkgs/applications/graphics/openimageio/default.nix48
-rw-r--r--nixpkgs/pkgs/applications/graphics/openscad/default.nix94
-rw-r--r--nixpkgs/pkgs/applications/graphics/opentoonz/default.nix51
-rw-r--r--nixpkgs/pkgs/applications/graphics/opentoonz/libtiff.nix21
-rw-r--r--nixpkgs/pkgs/applications/graphics/opentoonz/source.nix16
-rw-r--r--nixpkgs/pkgs/applications/graphics/ovito/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/graphics/panotools/default.nix24
-rw-r--r--nixpkgs/pkgs/applications/graphics/paraview/default.nix115
-rw-r--r--nixpkgs/pkgs/applications/graphics/pbrt/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/graphics/pbrt/openexr-cmake-3.12.patch26
-rw-r--r--nixpkgs/pkgs/applications/graphics/pdfcpu/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/graphics/pencil/default.nix106
-rw-r--r--nixpkgs/pkgs/applications/graphics/photivo/default.nix40
-rw-r--r--nixpkgs/pkgs/applications/graphics/photivo/gcc6.patch13
-rw-r--r--nixpkgs/pkgs/applications/graphics/photoflare/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/graphics/photoflow/CMakeLists.patch13
-rw-r--r--nixpkgs/pkgs/applications/graphics/photoflow/default.nix94
-rw-r--r--nixpkgs/pkgs/applications/graphics/photoqt/default.nix46
-rw-r--r--nixpkgs/pkgs/applications/graphics/phototonic/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/graphics/pick-colour-picker/default.nix67
-rw-r--r--nixpkgs/pkgs/applications/graphics/pikopixel/default.nix48
-rw-r--r--nixpkgs/pkgs/applications/graphics/pinta/default.nix83
-rw-r--r--nixpkgs/pkgs/applications/graphics/pixelnuke/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/graphics/potrace/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/graphics/pqiv/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/graphics/processing/default.nix73
-rw-r--r--nixpkgs/pkgs/applications/graphics/qcomicbook/default.nix43
-rw-r--r--nixpkgs/pkgs/applications/graphics/qimgv/default.nix60
-rw-r--r--nixpkgs/pkgs/applications/graphics/qimgv/qt5-12-compat.diff13
-rw-r--r--nixpkgs/pkgs/applications/graphics/qiv/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/graphics/qiv/default.upstream3
-rw-r--r--nixpkgs/pkgs/applications/graphics/qosmic/default.nix70
-rw-r--r--nixpkgs/pkgs/applications/graphics/qscreenshot/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/graphics/qvge/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/graphics/qvge/set-graphviz-path.patch13
-rw-r--r--nixpkgs/pkgs/applications/graphics/qview/default.nix40
-rw-r--r--nixpkgs/pkgs/applications/graphics/rapcad/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/graphics/rapid-photo-downloader/default.nix88
-rw-r--r--nixpkgs/pkgs/applications/graphics/rawtherapee/default.nix42
-rw-r--r--nixpkgs/pkgs/applications/graphics/renderdoc/default.nix80
-rw-r--r--nixpkgs/pkgs/applications/graphics/round/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/graphics/rx/default.nix45
-rw-r--r--nixpkgs/pkgs/applications/graphics/sane/backends/airscan/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/graphics/sane/backends/brscan4/default.nix95
-rw-r--r--nixpkgs/pkgs/applications/graphics/sane/backends/brscan4/preload.c170
-rw-r--r--nixpkgs/pkgs/applications/graphics/sane/backends/brscan4/udev_rules_type1.nix55
-rw-r--r--nixpkgs/pkgs/applications/graphics/sane/backends/brscan5/default.nix98
-rw-r--r--nixpkgs/pkgs/applications/graphics/sane/backends/default.nix118
-rw-r--r--nixpkgs/pkgs/applications/graphics/sane/backends/dsseries/default.nix53
-rw-r--r--nixpkgs/pkgs/applications/graphics/sane/config.nix53
-rw-r--r--nixpkgs/pkgs/applications/graphics/sane/drivers.nix13
-rw-r--r--nixpkgs/pkgs/applications/graphics/sane/frontends.nix28
-rw-r--r--nixpkgs/pkgs/applications/graphics/sane/xsane.nix32
-rw-r--r--nixpkgs/pkgs/applications/graphics/scantailor/advanced.nix26
-rw-r--r--nixpkgs/pkgs/applications/graphics/scantailor/default.nix23
-rw-r--r--nixpkgs/pkgs/applications/graphics/screencloud/default.nix76
-rw-r--r--nixpkgs/pkgs/applications/graphics/shotwell/default.nix112
-rw-r--r--nixpkgs/pkgs/applications/graphics/shutter/default.nix110
-rw-r--r--nixpkgs/pkgs/applications/graphics/smartdeblur/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/graphics/solvespace/default.nix50
-rw-r--r--nixpkgs/pkgs/applications/graphics/swingsane/default.nix61
-rw-r--r--nixpkgs/pkgs/applications/graphics/sxiv/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/graphics/synfigstudio/default.nix127
-rw-r--r--nixpkgs/pkgs/applications/graphics/tesseract/default.nix18
-rwxr-xr-xnixpkgs/pkgs/applications/graphics/tesseract/fetch-language-hashes35
-rw-r--r--nixpkgs/pkgs/applications/graphics/tesseract/languages.nix289
-rw-r--r--nixpkgs/pkgs/applications/graphics/tesseract/tesseract3.nix29
-rw-r--r--nixpkgs/pkgs/applications/graphics/tesseract/tesseract4.nix27
-rw-r--r--nixpkgs/pkgs/applications/graphics/tesseract/wrapper.nix58
-rw-r--r--nixpkgs/pkgs/applications/graphics/tev/default.nix58
-rw-r--r--nixpkgs/pkgs/applications/graphics/timelapse-deflicker/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/graphics/unigine-valley/default.nix115
-rw-r--r--nixpkgs/pkgs/applications/graphics/veusz/default.nix71
-rw-r--r--nixpkgs/pkgs/applications/graphics/viewnior/default.nix49
-rw-r--r--nixpkgs/pkgs/applications/graphics/vimiv-qt/default.nix49
-rw-r--r--nixpkgs/pkgs/applications/graphics/vimiv/default.nix73
-rw-r--r--nixpkgs/pkgs/applications/graphics/weylus/default.nix58
-rw-r--r--nixpkgs/pkgs/applications/graphics/wings/default.nix45
-rw-r--r--nixpkgs/pkgs/applications/graphics/write_stylus/default.nix61
-rw-r--r--nixpkgs/pkgs/applications/graphics/xaos/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/graphics/xfig/default.nix58
-rw-r--r--nixpkgs/pkgs/applications/graphics/xfractint/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/graphics/xlife/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/graphics/xmountains/default.nix25
-rw-r--r--nixpkgs/pkgs/applications/graphics/xournal/default.nix65
-rw-r--r--nixpkgs/pkgs/applications/graphics/xournalpp/default.nix62
-rw-r--r--nixpkgs/pkgs/applications/graphics/xrgears/default.nix48
-rw-r--r--nixpkgs/pkgs/applications/graphics/xzgv/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/graphics/yacreader/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/graphics/yed/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/graphics/yeetgif/default.nix22
-rw-r--r--nixpkgs/pkgs/applications/graphics/zgrviewer/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/graphics/zgv/default.nix42
-rw-r--r--nixpkgs/pkgs/applications/graphics/zgv/switch.patch14
244 files changed, 13248 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/graphics/ImageMagick/6.x.nix b/nixpkgs/pkgs/applications/graphics/ImageMagick/6.x.nix
new file mode 100644
index 000000000000..7cb4018f38f4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/ImageMagick/6.x.nix
@@ -0,0 +1,89 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, libtool
+, bzip2, zlib, libX11, libXext, libXt, fontconfig, freetype, ghostscript, libjpeg, djvulibre
+, lcms2, openexr, libpng, liblqr1, librsvg, libtiff, libxml2, openjpeg, libwebp, fftw, libheif, libde265
+, ApplicationServices, Foundation
+}:
+
+let
+  arch =
+    if stdenv.hostPlatform.system == "i686-linux" then "i686"
+    else if stdenv.hostPlatform.system == "x86_64-linux" || stdenv.hostPlatform.system == "x86_64-darwin" then "x86-64"
+    else if stdenv.hostPlatform.system == "armv7l-linux" then "armv7l"
+    else if stdenv.hostPlatform.system == "aarch64-linux"  || stdenv.hostPlatform.system == "aarch64-darwin" then "aarch64"
+    else if stdenv.hostPlatform.system == "powerpc64le-linux" then "ppc64le"
+    else null;
+in
+
+stdenv.mkDerivation rec {
+  pname = "imagemagick";
+  version = "6.9.12-19";
+
+  src = fetchFromGitHub {
+    owner = "ImageMagick";
+    repo = "ImageMagick6";
+    rev = version;
+    sha256 = "sha256-8KofT9aNd8SXL0YBQ0RUOTccVxQNacvJL1uYPZiSPkY=";
+  };
+
+  outputs = [ "out" "dev" "doc" ]; # bin/ isn't really big
+  outputMan = "out"; # it's tiny
+
+  enableParallelBuilding = true;
+
+  configureFlags =
+    [ "--with-frozenpaths" ]
+    ++ (if arch != null then [ "--with-gcc-arch=${arch}" ] else [ "--without-gcc-arch" ])
+    ++ lib.optional (librsvg != null) "--with-rsvg"
+    ++ lib.optional (liblqr1 != null) "--with-lqr"
+    ++ lib.optionals (ghostscript != null)
+      [ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts"
+        "--with-gslib"
+      ]
+    ++ lib.optionals (stdenv.hostPlatform.isMinGW)
+      [ "--enable-static" "--disable-shared" ] # due to libxml2 being without DLLs ATM
+    ;
+
+  nativeBuildInputs = [ pkg-config libtool ];
+
+  buildInputs =
+    [ zlib fontconfig freetype ghostscript
+      liblqr1 libpng libtiff libxml2 libheif libde265 djvulibre
+    ]
+    ++ lib.optionals (!stdenv.hostPlatform.isMinGW)
+      [ openexr librsvg openjpeg ]
+    ++ lib.optionals stdenv.isDarwin
+      [ ApplicationServices Foundation ];
+
+  propagatedBuildInputs =
+    [ bzip2 freetype libjpeg lcms2 fftw ]
+    ++ lib.optionals (!stdenv.hostPlatform.isMinGW)
+      [ libX11 libXext libXt libwebp ]
+    ;
+
+  doCheck = false; # fails 6 out of 76 tests
+
+  postInstall = ''
+    (cd "$dev/include" && ln -s ImageMagick* ImageMagick)
+    moveToOutput "bin/*-config" "$dev"
+    moveToOutput "lib/ImageMagick-*/config-Q16" "$dev" # includes configure params
+    for file in "$dev"/bin/*-config; do
+      substituteInPlace "$file" --replace "${pkg-config}/bin/pkg-config -config" \
+        ${pkg-config}/bin/${pkg-config.targetPrefix}pkg-config
+      substituteInPlace "$file" --replace ${pkg-config}/bin/pkg-config \
+        "PKG_CONFIG_PATH='$dev/lib/pkgconfig' '${pkg-config}/bin/${pkg-config.targetPrefix}pkg-config'"
+    done
+  '' + lib.optionalString (ghostscript != null) ''
+    for la in $out/lib/*.la; do
+      sed 's|-lgs|-L${lib.getLib ghostscript}/lib -lgs|' -i $la
+    done
+  '';
+
+  meta = with lib; {
+    homepage = "https://legacy.imagemagick.org/";
+    changelog = "https://legacy.imagemagick.org/script/changelog.php";
+    description = "A software suite to create, edit, compose, or convert bitmap images";
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ erictapen ];
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/ImageMagick/7.0.nix b/nixpkgs/pkgs/applications/graphics/ImageMagick/7.0.nix
new file mode 100644
index 000000000000..64fdf50a0d15
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/ImageMagick/7.0.nix
@@ -0,0 +1,99 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, libtool
+, bzip2, zlib, libX11, libXext, libXt, fontconfig, freetype, ghostscript, libjpeg, djvulibre
+, lcms2, openexr, libjxl, libpng, liblqr1, libraw, librsvg, libtiff, libxml2, openjpeg, libwebp, libheif
+, ApplicationServices
+, Foundation
+, testVersion, imagemagick
+}:
+
+let
+  arch =
+    if stdenv.hostPlatform.system == "i686-linux" then "i686"
+    else if stdenv.hostPlatform.system == "x86_64-linux" || stdenv.hostPlatform.system == "x86_64-darwin" then "x86-64"
+    else if stdenv.hostPlatform.system == "armv7l-linux" then "armv7l"
+    else if stdenv.hostPlatform.system == "aarch64-linux"  || stdenv.hostPlatform.system == "aarch64-darwin" then "aarch64"
+    else if stdenv.hostPlatform.system == "powerpc64le-linux" then "ppc64le"
+    else null;
+in
+
+stdenv.mkDerivation rec {
+  pname = "imagemagick";
+  version = "7.1.0-9";
+
+  src = fetchFromGitHub {
+    owner = "ImageMagick";
+    repo = "ImageMagick";
+    rev = version;
+    sha256 = "sha256-9eeOY6TvNykWA3yyQH1UR3ahdhOja87I9rsie9fMbso=";
+  };
+
+  outputs = [ "out" "dev" "doc" ]; # bin/ isn't really big
+  outputMan = "out"; # it's tiny
+
+  enableParallelBuilding = true;
+
+  configureFlags =
+    [ "--with-frozenpaths" ]
+    ++ (if arch != null then [ "--with-gcc-arch=${arch}" ] else [ "--without-gcc-arch" ])
+    ++ lib.optional (librsvg != null) "--with-rsvg"
+    ++ lib.optional (liblqr1 != null) "--with-lqr"
+    # libjxl is broken on aarch64 (see meta.broken in libjxl) for now,
+    # let's disable it for now to unbreak the imagemagick build.
+    ++ lib.optional (libjxl != null && !stdenv.isAarch64) "--with-jxl"
+    ++ lib.optionals (ghostscript != null)
+      [ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts"
+        "--with-gslib"
+      ]
+    ++ lib.optionals stdenv.hostPlatform.isMinGW
+      [ "--enable-static" "--disable-shared" ] # due to libxml2 being without DLLs ATM
+    ;
+
+  nativeBuildInputs = [ pkg-config libtool ];
+
+  buildInputs =
+    [ zlib fontconfig freetype ghostscript
+      liblqr1 libpng libraw libtiff libxml2 libheif djvulibre
+    ]
+    # libjxl is broken on aarch64 (see meta.broken in libjxl) for now,
+    # let's disable it for now to unbreak the imagemagick build.
+    ++ lib.optionals (!stdenv.isAarch64)
+      [ libjxl ]
+    ++ lib.optionals (!stdenv.hostPlatform.isMinGW)
+      [ openexr librsvg openjpeg ]
+    ++ lib.optionals stdenv.isDarwin [
+      ApplicationServices
+      Foundation
+    ];
+
+  propagatedBuildInputs =
+    [ bzip2 freetype libjpeg lcms2 ]
+    ++ lib.optionals (!stdenv.hostPlatform.isMinGW)
+      [ libX11 libXext libXt libwebp ]
+    ;
+
+  postInstall = ''
+    (cd "$dev/include" && ln -s ImageMagick* ImageMagick)
+    moveToOutput "bin/*-config" "$dev"
+    moveToOutput "lib/ImageMagick-*/config-Q16HDRI" "$dev" # includes configure params
+    for file in "$dev"/bin/*-config; do
+      substituteInPlace "$file" --replace pkg-config \
+        "PKG_CONFIG_PATH='$dev/lib/pkgconfig' '${pkg-config}/bin/${pkg-config.targetPrefix}pkg-config'"
+    done
+  '' + lib.optionalString (ghostscript != null) ''
+    for la in $out/lib/*.la; do
+      sed 's|-lgs|-L${lib.getLib ghostscript}/lib -lgs|' -i $la
+    done
+  '';
+
+  passthru.tests.version =
+    testVersion { package = imagemagick; };
+
+  meta = with lib; {
+    homepage = "http://www.imagemagick.org/";
+    description = "A software suite to create, edit, compose, or convert bitmap images";
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ erictapen dotlambda ];
+    license = licenses.asl20;
+    mainProgram = "magick";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/ahoviewer/default.nix b/nixpkgs/pkgs/applications/graphics/ahoviewer/default.nix
new file mode 100644
index 000000000000..0459d1d04ac2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/ahoviewer/default.nix
@@ -0,0 +1,53 @@
+{ config, lib, stdenv, fetchFromGitHub, pkg-config, libconfig
+, gtkmm2, glibmm, libxml2, libsecret, curl, libzip
+, librsvg, gst_all_1, autoreconfHook, makeWrapper
+, useUnrar ? config.ahoviewer.useUnrar or false, unrar
+}:
+
+assert useUnrar -> unrar != null;
+
+stdenv.mkDerivation rec {
+  pname = "ahoviewer";
+  version = "1.6.5";
+
+  src = fetchFromGitHub {
+    owner = "ahodesuka";
+    repo = "ahoviewer";
+    rev = version;
+    sha256 = "1avdl4qcpznvf3s2id5qi1vnzy4wgh6vxpnrz777a1s4iydxpcd8";
+  };
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ autoreconfHook pkg-config makeWrapper ];
+  buildInputs = [
+    glibmm libconfig gtkmm2 glibmm libxml2
+    libsecret curl libzip librsvg
+    gst_all_1.gstreamer
+    gst_all_1.gst-plugins-good
+    gst_all_1.gst-libav
+    gst_all_1.gst-plugins-base
+  ] ++ lib.optional useUnrar unrar;
+
+  NIX_LDFLAGS = "-lpthread";
+
+  postPatch = "patchShebangs version.sh";
+
+  postInstall = ''
+    wrapProgram $out/bin/ahoviewer \
+    --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0" \
+    --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE"
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/ahodesuka/ahoviewer";
+    description = "A GTK2 image viewer, manga reader, and booru browser";
+    maintainers = with maintainers; [ skrzyp xzfc ];
+    license = licenses.mit;
+    # Unintentionally not working on Darwin:
+    # https://github.com/ahodesuka/ahoviewer/issues/62
+    platforms = platforms.linux;
+  };
+}
+
+
diff --git a/nixpkgs/pkgs/applications/graphics/akira/default.nix b/nixpkgs/pkgs/applications/graphics/akira/default.nix
new file mode 100644
index 000000000000..430c582dd793
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/akira/default.nix
@@ -0,0 +1,75 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, appstream-glib
+, desktop-file-utils
+, meson
+, ninja
+, pantheon
+, pkg-config
+, python3
+, vala
+, vala-lint
+, wrapGAppsHook
+, cairo
+, glib
+, goocanvas3
+, gtk3
+, gtksourceview3
+, json-glib
+, libarchive
+, libgee
+, libxml2
+}:
+
+stdenv.mkDerivation rec {
+  pname = "akira";
+  version = "0.0.16";
+
+  src = fetchFromGitHub {
+    owner = "akiraux";
+    repo = "Akira";
+    rev = "v${version}";
+    sha256 = "sha256-qrqmSCwA0kQVFD1gzutks9gMr7My7nw/KJs/VPisa0w=";
+  };
+
+  nativeBuildInputs = [
+    appstream-glib
+    desktop-file-utils
+    meson
+    ninja
+    pkg-config
+    python3
+    vala
+    vala-lint
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    cairo
+    glib
+    goocanvas3
+    pantheon.granite
+    gtk3
+    gtksourceview3
+    json-glib
+    libarchive
+    libgee
+    libxml2
+  ];
+
+  mesonFlags = [ "-Dprofile=default" ];
+
+  postPatch = ''
+    chmod +x build-aux/meson/post_install.py
+    patchShebangs build-aux/meson/post_install.py
+  '';
+
+  meta = with lib; {
+    description = "Native Linux Design application built in Vala and GTK";
+    homepage = "https://github.com/akiraux/Akira";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ Br1ght0ne neonfuz ] ++ teams.pantheon.members;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/alchemy/default.nix b/nixpkgs/pkgs/applications/graphics/alchemy/default.nix
new file mode 100644
index 000000000000..27d5ece57fe6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/alchemy/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchurl, jre, runtimeShell }:
+
+stdenv.mkDerivation rec {
+  pname = "alchemy";
+  version = "008";
+
+  enableParallelBuilding = true;
+
+  src = fetchurl {
+    url = "http://al.chemy.org/files/Alchemy-${version}.tar.gz";
+    sha256 = "0449bvdccgx1jqnws1bckzs4nv2d230523qs0jx015gi81s1q7li";
+  };
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share
+    cp -a . $out/share/alchemy
+    cat >> $out/bin/alchemy << EOF
+    #!${runtimeShell}
+    cd $out/share/alchemy
+    ${jre}/bin/java -jar Alchemy.jar "$@"
+    EOF
+    chmod +x $out/bin/alchemy
+  '';
+
+  meta = with lib; {
+    description = "Drawing application";
+    longDescription = ''
+      Alchemy is an open drawing project aimed at exploring how we can sketch,
+      draw, and create on computers in new ways. Alchemy isn’t software for
+      creating finished artwork, but rather a sketching environment that
+      focuses on the absolute initial stage of the creation process.
+      Experimental in nature, Alchemy lets you brainstorm visually to explore
+      an expanded range of ideas and possibilities in a serendipitous way.
+    '';
+    homepage = "http://al.chemy.org/";
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.marcweber ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/animbar/default.nix b/nixpkgs/pkgs/applications/graphics/animbar/default.nix
new file mode 100644
index 000000000000..dda734363ebc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/animbar/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, lib, fetchurl, cmake, qt4, file }:
+
+stdenv.mkDerivation rec {
+  pname = "animbar";
+  version = "1.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.bz2";
+    sha256 = "0836nwcpyfdrapyj3hbg3wh149ihc26pc78h01adpc7c0r7d9pr9";
+  };
+
+  nativeBuildInputs = [ cmake  ];
+
+  buildInputs = [ qt4 file ];
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/pixmaps
+    cp src/animbar $out/bin
+    cp ../icon/* $out/share/pixmaps
+  '';
+
+  meta = with lib; {
+    description = "Create your own animation on paper and transparancy";
+    longDescription = ''
+      Animbar lets you easily create your own animation on paper and
+      transparancy. From a set of input images two output images are
+      computed, that are printed one on paper and one on
+      transparency. By moving the transparency over the paper you
+      create a fascinating animation effect. This kind of animation
+      technique is hundreds of years old and known under several
+      names: picket fence animation, barrier grid animation, Moiré
+      animation, to name a few.
+    '';
+    homepage = "http://animbar.mnim.org";
+    maintainers = with maintainers; [ leenaars ];
+    platforms = platforms.linux;
+    license = licenses.gpl3;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/antimony/default.nix b/nixpkgs/pkgs/applications/graphics/antimony/default.nix
new file mode 100644
index 000000000000..8b482626c91a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/antimony/default.nix
@@ -0,0 +1,74 @@
+{ lib, stdenv, fetchFromGitHub, libpng, python3
+, libGLU, libGL, qtbase, wrapQtAppsHook, ncurses
+, cmake, flex, lemon
+, makeDesktopItem, copyDesktopItems
+}:
+
+let
+  gitRev    = "8fb4b0929ce84cf375bfb83a9d522ccd80681eaf";
+  gitBranch = "develop";
+  gitTag    = "0.9.3";
+in
+  stdenv.mkDerivation {
+    pname = "antimony";
+    version = "2020-03-28";
+
+    src = fetchFromGitHub {
+      owner  = "mkeeter";
+      repo   = "antimony";
+      rev    = gitRev;
+      sha256 = "1s0zmq5jmhmb1wcsyaxfmii448g6x8b41mzvb1awlljj85qj0k2s";
+    };
+
+    patches = [ ./paths-fix.patch ];
+
+    postPatch = ''
+       sed -i "s,/usr/local,$out,g" \
+       app/CMakeLists.txt app/app/app.cpp app/app/main.cpp
+       sed -i "s,python3,${python3.executable}," CMakeLists.txt
+    '';
+
+    postInstall = lib.optionalString stdenv.isLinux ''
+      install -Dm644 $src/deploy/icon.svg $out/share/icons/hicolor/scalable/apps/antimony.svg
+      install -Dm644 ${./mimetype.xml} $out/share/mime/packages/antimony.xml
+    '';
+
+    buildInputs = [
+      libpng python3 python3.pkgs.boost
+      libGLU libGL qtbase ncurses
+    ];
+
+    nativeBuildInputs = [ cmake flex lemon wrapQtAppsHook copyDesktopItems ];
+
+    desktopItems = [
+      (makeDesktopItem {
+        name = "antimony";
+        desktopName = "Antimony";
+        comment="Tree-based Modeler";
+        genericName = "CAD Application";
+        exec = "antimony %f";
+        icon = "antimony";
+        terminal = "false";
+        categories = "Graphics;Science;Engineering";
+        mimeType = "application/x-extension-sb;application/x-antimony;";
+        extraEntries = ''
+          StartupWMClass=antimony
+          Version=1.0
+        '';
+      })
+    ];
+
+    cmakeFlags= [
+      "-DGITREV=${gitRev}"
+      "-DGITTAG=${gitTag}"
+      "-DGITBRANCH=${gitBranch}"
+    ];
+
+    meta = with lib; {
+      description = "A computer-aided design (CAD) tool from a parallel universe";
+      homepage    = "https://github.com/mkeeter/antimony";
+      license     = licenses.mit;
+      maintainers = with maintainers; [ rnhmjoj ];
+      platforms   = platforms.linux;
+    };
+  }
diff --git a/nixpkgs/pkgs/applications/graphics/antimony/mimetype.xml b/nixpkgs/pkgs/applications/graphics/antimony/mimetype.xml
new file mode 100644
index 000000000000..c6960fba9abc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/antimony/mimetype.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
+  <mime-type type="application/x-antimony">
+    <comment xml:lang="en">Antimony model</comment>
+    <glob pattern="*.sb"/>
+  </mime-type>
+</mime-info>
diff --git a/nixpkgs/pkgs/applications/graphics/antimony/paths-fix.patch b/nixpkgs/pkgs/applications/graphics/antimony/paths-fix.patch
new file mode 100644
index 000000000000..9235dd6cdce1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/antimony/paths-fix.patch
@@ -0,0 +1,21 @@
+diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
+index ddc5c9b..d80728a 100644
+--- a/app/CMakeLists.txt
++++ b/app/CMakeLists.txt
+@@ -158,16 +158,6 @@ target_link_libraries(${ANTIMONY_APP}
+ 
+ ################################################################################
+ 
+-execute_process(COMMAND git log --pretty=format:'%h' -n 1
+-                OUTPUT_VARIABLE GITREV)
+-execute_process(COMMAND bash -c "git diff --quiet --exit-code || echo +"
+-                OUTPUT_VARIABLE GITDIFF)
+-execute_process(COMMAND git describe --exact-match --tags
+-                OUTPUT_VARIABLE GITTAG
+-                ERROR_QUIET)
+-execute_process(COMMAND git rev-parse --abbrev-ref HEAD
+-                OUTPUT_VARIABLE GITBRANCH)
+-
+ add_definitions(-D'GITREV="${GITREV}${GITDIFF}"'
+                 -D'GITTAG="${GITTAG}"'
+                 -D'GITBRANCH="${GITBRANCH}"')
diff --git a/nixpkgs/pkgs/applications/graphics/apitrace/default.nix b/nixpkgs/pkgs/applications/graphics/apitrace/default.nix
new file mode 100644
index 000000000000..f842cf6f5c4b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/apitrace/default.nix
@@ -0,0 +1,67 @@
+{ lib, stdenv, fetchFromGitHub, cmake, libX11, procps, python2, libdwarf, qtbase, qtwebkit, wrapQtAppsHook, libglvnd }:
+
+stdenv.mkDerivation rec {
+  pname = "apitrace";
+  version = "7.1-572-g${builtins.substring 0 8 src.rev}";
+
+  src = fetchFromGitHub {
+    sha256 = "11bwb0l8cr1bf9bj1s6cbmi77d5fy4qrphj9cgmcd8jpa862anp5";
+    rev = "26966134f15d28f6b4a9a0a560017b3ba36d60bf";
+    repo = "apitrace";
+    owner = "apitrace";
+  };
+
+  # LD_PRELOAD wrappers need to be statically linked to work against all kinds
+  # of games -- so it's fine to use e.g. bundled snappy.
+  buildInputs = [ libX11 procps python2 libdwarf qtbase qtwebkit ];
+
+  nativeBuildInputs = [ cmake wrapQtAppsHook ];
+
+  # Don't automatically wrap all binaries, I prefer to explicitly only wrap
+  # `qapitrace`.
+  dontWrapQtApps = true;
+
+  postFixup = ''
+
+    # Since https://github.com/NixOS/nixpkgs/pull/60985, we add `/run-opengl-driver[-32]`
+    # to the `RUNPATH` of dispatcher libraries `dlopen()` ing OpenGL drivers.
+    # `RUNPATH` doesn't propagate throughout the whole application, but only
+    # from the module performing the `dlopen()`.
+    #
+    # Apitrace wraps programs by running them with `LD_PRELOAD` pointing to `.so`
+    # files in $out/lib/apitrace/wrappers.
+    #
+    # Theses wrappers effectively wrap the `dlopen()` calls from `libglvnd`
+    # and other dispatcher libraries, and run `dlopen()`  by themselves.
+    #
+    # As `RUNPATH` doesn't propagate through the whole library, and they're now the
+    # library doing the real `dlopen()`, they also need to have
+    # `/run-opengl-driver[-32]` added to their `RUNPATH`.
+    #
+    # To stay simple, we add paths for 32 and 64 bits unconditionally.
+    # This doesn't have an impact on closure size, and if the 32 bit drivers
+    # are not available, that folder is ignored.
+    for i in $out/lib/apitrace/wrappers/*.so
+    do
+      echo "Patching OpenGL driver path for $i"
+      patchelf --set-rpath "/run/opengl-driver/lib:/run/opengl-driver-32/lib:$(patchelf --print-rpath $i)" $i
+    done
+
+    # Theses open the OpenGL driver at runtime, but it is not listed as NEEDED libraries. They need
+    # a reference to libglvnd.
+    for i in $out/bin/eglretrace $out/bin/glretrace
+    do
+      echo "Patching RPath for $i"
+      patchelf --set-rpath "${lib.makeLibraryPath [libglvnd]}:$(patchelf --print-rpath $i)" $i
+    done
+
+    wrapQtApp $out/bin/qapitrace
+  '';
+
+  meta = with lib; {
+    homepage = "https://apitrace.github.io";
+    description = "Tools to trace OpenGL, OpenGL ES, Direct3D, and DirectDraw APIs";
+    license = licenses.mit;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/apngasm/2.nix b/nixpkgs/pkgs/applications/graphics/apngasm/2.nix
new file mode 100644
index 000000000000..0313115ddfa8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/apngasm/2.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchzip, libpng, zlib, zopfli }:
+
+stdenv.mkDerivation rec {
+  pname = "apngasm";
+  version = "2.91";
+
+  src = fetchzip {
+    url = "mirror://sourceforge/${pname}/${pname}-${version}-src.zip";
+    stripRoot = false;
+    sha256 = "0qhljqql159xkn1l83vz0q8wvzr7rjz4jnhiy0zn36pgvacg0zn1";
+  };
+
+  buildInputs = [ libpng zlib zopfli ];
+
+  postPatch = ''
+    rm -rf libpng zlib zopfli
+  '';
+
+  NIX_CFLAGS_LINK = "-lzopfli";
+
+  installPhase = ''
+    install -Dt $out/bin apngasm
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Create highly optimized Animated PNG files from PNG/TGA images";
+    homepage = "http://apngasm.sourceforge.net/";
+    license = licenses.zlib;
+    maintainers = with maintainers; [ orivej ];
+    platforms = platforms.linux;
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/graphics/apngasm/default.nix b/nixpkgs/pkgs/applications/graphics/apngasm/default.nix
new file mode 100644
index 000000000000..1f58ee83e03a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/apngasm/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, cmake, boost, libpng, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "apngasm";
+  version = "3.1.9";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = "d50bfb0cf14c376f4cfb94eb91c61d795a76b715"; # not tagged, but in debian/changelog
+    sha256 = "0pk0r8x1950pm6j3d5wgryvy3ldm7a9gl59jmnwnjmg1sf9mzf97";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ boost libpng zlib ];
+
+  meta = with lib; {
+    description = "Create an APNG from multiple PNG files";
+    homepage = "https://github.com/apngasm/apngasm";
+    license = licenses.zlib;
+    maintainers = with maintainers; [ orivej ];
+    platforms = platforms.linux;
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/graphics/autopanosiftc/default.nix b/nixpkgs/pkgs/applications/graphics/autopanosiftc/default.nix
new file mode 100644
index 000000000000..129e3e547691
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/autopanosiftc/default.nix
@@ -0,0 +1,27 @@
+{lib, stdenv, fetchurl, cmake, libpng, libtiff, libjpeg, panotools, libxml2 }:
+
+stdenv.mkDerivation {
+  name = "autopano-sift-C-2.5.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/hugin/autopano-sift-C-2.5.1.tar.gz";
+    sha256 = "0dqk8ff82gmy4v5ns5nr9gpzkc1p7c2y8c8fkid102r47wsjk44s";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ libpng libtiff libjpeg panotools libxml2 ];
+
+  patches = [
+    (fetchurl {
+      url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-gfx/autopano-sift-C/files/autopano-sift-C-2.5.1-lm.patch";
+      sha256 = "1bfcr5sps0ip9gl4jprji5jgf9wkczz6d2clsjjlbsy8r3ixi3lv";
+    })
+  ];
+
+  meta = {
+    homepage = "http://hugin.sourceforge.net/";
+    description = "Implementation in C of the autopano-sift algorithm for automatically stitching panoramas";
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/autotrace/autofig.nix b/nixpkgs/pkgs/applications/graphics/autotrace/autofig.nix
new file mode 100644
index 000000000000..0f53965786b9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/autotrace/autofig.nix
@@ -0,0 +1,10 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation {
+  name = "autofig-0.1";
+
+  src = fetchurl {
+    url = "http://autotrace.sourceforge.net/tools/autofig.tar.gz";
+    sha256 = "11cs9hdbgcl3aamcs3149i8kvyyldmnjf6yq81kbcf8fdmfk2zdq";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/autotrace/default.nix b/nixpkgs/pkgs/applications/graphics/autotrace/default.nix
new file mode 100644
index 000000000000..e3b966353ffe
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/autotrace/default.nix
@@ -0,0 +1,125 @@
+{ lib, stdenv, fetchurl, callPackage, libpng12, imagemagick
+, autoreconfHook, glib, pstoedit, pkg-config, gettext, gd, darwin
+, runtimeShell }:
+
+# TODO: Figure out why the resultant binary is somehow linked against
+# libpng16.so.16 rather than libpng12.
+
+stdenv.mkDerivation rec {
+  pname = "autotrace";
+  version = "0.31.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/autotrace/AutoTrace/0.31.1/${pname}-${version}.tar.gz";
+    sha256 = "1xmgja5fv48mdbsa51inf7ksz36nqd6bsaybrk5xgprm6cy946js";
+  };
+
+  # The below commented out part is for an identically-named project
+  # on GitHub which appears to derive somehow from the Sourceforge
+  # version, but I have no idea what the lineage is of this project.
+  # It will build, but it segfaults when I attempt to run -centerline.
+  # Someone may need this for some reason, so I've left it here.
+  #
+  #src = fetchFromGitHub {
+  #  owner = "autotrace";
+  #  repo = "autotrace";
+  #  rev = "b3ac8818d86943102cb4f13734e0b527c42dc45a";
+  #  sha256 = "0z5h2mvxwckk2msi361zk1nc9fdcvxyimyc2hlyqd6h8k3p7zdi4";
+  #};
+  #postConfigure = ''
+  #  sed -i -e "s/at_string/gchar */g" *.c
+  #  sed -i -e "s/at_address/gpointer/g" *.c
+  #  sed -i -e "s/at_bitmap_type/struct _at_bitmap/g" *.c
+  #  sed -i -e "s/AT_BITMAP_BITS(bitmap)/AT_BITMAP_BITS(\&bitmap)/g" input-magick.c
+  #'';
+
+  autofig = callPackage ./autofig.nix {};
+  nativeBuildInputs = [ autoreconfHook glib autofig pkg-config gettext ];
+  buildInputs = [ libpng12 imagemagick pstoedit ]
+    ++ lib.optionals stdenv.isDarwin
+       (with darwin.apple_sdk.frameworks; [ gd ApplicationServices ]);
+
+  postUnpack = ''
+    pushd $sourceRoot
+    autofig autotrace-config.af
+    popd
+  '';
+
+  # This complains about various m4 files, but it appears to not be an
+  # actual error.
+  preConfigure = ''
+    glib-gettextize --copy --force
+    # pstoedit-config no longer exists, it was replaced with pkg-config
+    mkdir wrappers
+    cat >wrappers/pstoedit-config <<'EOF'
+    #!${runtimeShell}
+    # replace --version with --modversion for pkg-config
+    args=''${@/--version/--modversion}
+    exec pkg-config pstoedit "''${args[@]}"
+    EOF
+    chmod +x wrappers/pstoedit-config
+    export PATH="$PATH:$PWD/wrappers"
+  '';
+
+  meta = with lib; {
+    homepage = "http://autotrace.sourceforge.net/";
+    description = "Utility for converting bitmap into vector graphics";
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ hodapp ];
+    license = licenses.gpl2;
+    knownVulnerabilities = [
+      "CVE-2013-1953"
+      "CVE-2016-7392"
+      "CVE-2017-9151"
+      "CVE-2017-9152"
+      "CVE-2017-9153"
+      "CVE-2017-9154"
+      "CVE-2017-9155"
+      "CVE-2017-9156"
+      "CVE-2017-9157"
+      "CVE-2017-9158"
+      "CVE-2017-9159"
+      "CVE-2017-9160"
+      "CVE-2017-9161"
+      "CVE-2017-9162"
+      "CVE-2017-9163"
+      "CVE-2017-9164"
+      "CVE-2017-9165"
+      "CVE-2017-9166"
+      "CVE-2017-9167"
+      "CVE-2017-9168"
+      "CVE-2017-9169"
+      "CVE-2017-9170"
+      "CVE-2017-9171"
+      "CVE-2017-9172"
+      "CVE-2017-9173"
+      "CVE-2017-9174"
+      "CVE-2017-9175"
+      "CVE-2017-9176"
+      "CVE-2017-9177"
+      "CVE-2017-9178"
+      "CVE-2017-9179"
+      "CVE-2017-9180"
+      "CVE-2017-9181"
+      "CVE-2017-9182"
+      "CVE-2017-9183"
+      "CVE-2017-9184"
+      "CVE-2017-9185"
+      "CVE-2017-9186"
+      "CVE-2017-9187"
+      "CVE-2017-9188"
+      "CVE-2017-9189"
+      "CVE-2017-9190"
+      "CVE-2017-9191"
+      "CVE-2017-9192"
+      "CVE-2017-9193"
+      "CVE-2017-9194"
+      "CVE-2017-9195"
+      "CVE-2017-9196"
+      "CVE-2017-9197"
+      "CVE-2017-9198"
+      "CVE-2017-9199"
+      "CVE-2017-9200"
+    ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/avocode/default.nix b/nixpkgs/pkgs/applications/graphics/avocode/default.nix
new file mode 100644
index 000000000000..a2a9dcd4750a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/avocode/default.nix
@@ -0,0 +1,106 @@
+{ lib, stdenv, makeDesktopItem, fetchurl, unzip
+, gdk-pixbuf, glib, gtk3, atk, at-spi2-atk, pango, cairo, freetype, fontconfig, dbus, nss, nspr, alsa-lib, cups, expat, udev, gnome
+, xorg, mozjpeg, makeWrapper, wrapGAppsHook, libuuid, at-spi2-core, libdrm, mesa, libxkbcommon
+}:
+
+stdenv.mkDerivation rec {
+  pname = "avocode";
+  version = "4.15.1";
+
+  src = fetchurl {
+    url = "https://media.avocode.com/download/avocode-app/${version}/avocode-${version}-linux.zip";
+    sha256 = "sha256-Cli1tbe/eHS0yk1OhrSgFwjjGx2jvQSYStkKYj6gk4I=";
+  };
+
+  libPath = lib.makeLibraryPath (with xorg; [
+    stdenv.cc.cc.lib
+    at-spi2-core.out
+    gdk-pixbuf
+    glib
+    gtk3
+    atk
+    at-spi2-atk
+    pango
+    cairo
+    freetype
+    fontconfig
+    dbus
+    nss
+    nspr
+    alsa-lib
+    cups
+    expat
+    udev
+    libX11
+    libxcb
+    libxshmfence
+    libxkbcommon
+    libXi
+    libXcursor
+    libXdamage
+    libXrandr
+    libXcomposite
+    libXext
+    libXfixes
+    libXrender
+    libXtst
+    libXScrnSaver
+    libuuid
+    libdrm
+    mesa
+  ]);
+
+  desktopItem = makeDesktopItem {
+    name = "Avocode";
+    exec = "avocode";
+    icon = "avocode";
+    desktopName = "Avocode";
+    genericName = "Design Inspector";
+    categories = "Development;";
+    comment = "The bridge between designers and developers";
+  };
+
+  nativeBuildInputs = [makeWrapper wrapGAppsHook unzip];
+  buildInputs = [ gtk3 gnome.adwaita-icon-theme ];
+
+  # src is producing multiple folder on unzip so we must
+  # override unpackCmd to extract it into newly created folder
+  unpackCmd = ''
+    mkdir out
+    unzip $curSrc -d out
+  '';
+
+  installPhase = ''
+    substituteInPlace avocode.desktop.in \
+      --replace /path/to/avocode-dir/Avocode $out/bin/avocode \
+      --replace /path/to/avocode-dir/avocode.png avocode
+
+    mkdir -p share/applications share/pixmaps
+    mv avocode.desktop.in share/applications/avocode.desktop
+    mv avocode.png share/pixmaps/
+
+    rm resources/cjpeg
+    cp -av . $out
+
+    mkdir $out/bin
+    ln -s $out/avocode $out/bin/avocode
+    ln -s ${mozjpeg}/bin/cjpeg $out/resources/cjpeg
+  '';
+
+  postFixup = ''
+    patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/avocode
+    for file in $(find $out -type f \( -perm /0111 -o -name \*.so\* \) ); do
+      patchelf --set-rpath ${libPath}:$out/ $file || true
+    done
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "https://avocode.com/";
+    description = "The bridge between designers and developers";
+    license = licenses.unfree;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ megheaiulian ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/awesomebump/default.nix b/nixpkgs/pkgs/applications/graphics/awesomebump/default.nix
new file mode 100644
index 000000000000..4d79f10a9e10
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/awesomebump/default.nix
@@ -0,0 +1,63 @@
+{ mkDerivation, lib, fetchgit, qtbase, qmake, qtscript, flex, bison, qtdeclarative }:
+
+
+let
+  version = "5.1";
+
+  src = fetchgit {
+    url = "https://github.com/kmkolasinski/AwesomeBump.git";
+    rev = "Winx32v${version}";
+    sha256 = "1c8b9jki0v8kzkvsvyv7q1w3s7j40br6ph15hh2xi0a1mpwckq56";
+    fetchSubmodules = true;
+  };
+
+  qtnproperty = mkDerivation {
+    name = "qtnproperty";
+    inherit src;
+    sourceRoot = "AwesomeBump/Sources/utils/QtnProperty";
+    patches = [ ./qtnproperty-parallel-building.patch ];
+    buildInputs = [ qtscript qtbase qtdeclarative ];
+    nativeBuildInputs = [ qmake flex bison ];
+    postInstall = ''
+      install -D bin-linux/QtnPEG $out/bin/QtnPEG
+    '';
+  };
+in mkDerivation {
+  pname = "awesomebump";
+  inherit version;
+
+  inherit src;
+
+  buildInputs = [ qtbase qtscript qtdeclarative ];
+
+  nativeBuildInputs = [ qmake ];
+
+  preBuild = ''
+    ln -sf ${qtnproperty}/bin/QtnPEG Sources/utils/QtnProperty/bin-linux/QtnPEG
+  '';
+
+  dontWrapQtApps = true;
+  postInstall = ''
+    d=$out/libexec/AwesomeBump
+
+    mkdir -p $d
+    cp -vr workdir/`cat workdir/current`/bin/AwesomeBump $d/
+    cp -prd Bin/Configs Bin/Core $d/
+
+    # AwesomeBump expects to find Core and Configs in its current directory.
+    makeQtWrapper $d/AwesomeBump $out/bin/AwesomeBump \
+        --run "cd $d"
+  '';
+
+  # $ cd Sources; qmake; make ../workdir/linux-g++-dgb-gl4/obj/glwidget.o
+  # fatal error: properties/ImageProperties.peg.h: No such file or directory
+  enableParallelBuilding = false;
+
+  meta = {
+    homepage = "https://github.com/kmkolasinski/AwesomeBump";
+    description = "A program to generate normal, height, specular or ambient occlusion textures from a single image";
+    license = lib.licenses.gpl3Plus;
+    maintainers = [ lib.maintainers.eelco ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/awesomebump/qtnproperty-parallel-building.patch b/nixpkgs/pkgs/applications/graphics/awesomebump/qtnproperty-parallel-building.patch
new file mode 100644
index 000000000000..b3f8e68dd1ad
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/awesomebump/qtnproperty-parallel-building.patch
@@ -0,0 +1,9 @@
+--- a/PEG/Flex.pri
++++ b/PEG/Flex.pri
+@@ -1,5 +1,6 @@
+ flex.name = Flex ${QMAKE_FILE_IN}
+ flex.input = FLEX_SOURCES
++flex.depends = ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}.parser.cpp
+ flex.output = ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}.lexer.cpp
+ 
+ win32:flex.commands = win_flex --wincompat -o ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}.lexer.cpp ${QMAKE_FILE_IN}
diff --git a/nixpkgs/pkgs/applications/graphics/azpainter/default.nix b/nixpkgs/pkgs/applications/graphics/azpainter/default.nix
new file mode 100644
index 000000000000..74dc55fc5e13
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/azpainter/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchFromGitHub
+, libX11, libXext, libXi
+, freetype, fontconfig
+, libpng, libjpeg
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "azpainter";
+  version = "2.1.6";
+
+  src = fetchFromGitHub {
+    owner = "Symbian9";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0i5g67s4ysnvbaxmi7dhan0hfcfk8an14xykkafl47pqfx33npva";
+  };
+
+  buildInputs = [
+    libX11 libXext libXi
+    freetype fontconfig
+    libpng libjpeg
+    zlib
+  ];
+
+  meta = with lib; {
+    description = "Full color painting software for illustration drawing";
+    homepage = "https://osdn.net/projects/azpainter";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ dtzWill ];
+    platforms = with platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/batik/default.nix b/nixpkgs/pkgs/applications/graphics/batik/default.nix
new file mode 100644
index 000000000000..a88209bfbd89
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/batik/default.nix
@@ -0,0 +1,23 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  pname = "batik";
+  version = "1.14";
+
+  src = fetchurl {
+    url = "mirror://apache/xmlgraphics/batik/binaries/batik-bin-${version}.tar.gz";
+    sha256 = "sha256-D06qgb5wdS5AahnznDnAGISPCZY/CPqJdGQFRwUsRhg=";
+  };
+
+  meta = with lib; {
+    description = "Java based toolkit for handling SVG";
+    homepage = "https://xmlgraphics.apache.org/batik";
+    license = licenses.asl20;
+    platforms = platforms.unix;
+  };
+
+  installPhase = ''
+    mkdir $out
+    cp -r * $out/
+  '';
+}
diff --git a/nixpkgs/pkgs/applications/graphics/blockbench-electron/default.nix b/nixpkgs/pkgs/applications/graphics/blockbench-electron/default.nix
new file mode 100644
index 000000000000..a9c258ce925d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/blockbench-electron/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, fetchurl, appimageTools, makeWrapper, electron_8 }:
+
+stdenv.mkDerivation rec {
+  pname = "blockbench-electron";
+  version = "3.7.5";
+
+  src = fetchurl {
+    url = "https://github.com/JannisX11/blockbench/releases/download/v${version}/Blockbench_${version}.AppImage";
+    sha256 = "0qqklhncd4khqmgp7jg7wap2rzkrg8b6dflmz0wmm5zxxp5vcy1c";
+    name = "${pname}-${version}.AppImage";
+  };
+
+  appimageContents = appimageTools.extractType2 {
+    name = "${pname}-${version}";
+    inherit src;
+  };
+
+  dontUnpack = true;
+  dontConfigure = true;
+  dontBuild = true;
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/bin $out/share/${pname} $out/share/applications
+    cp -a ${appimageContents}/{locales,resources} $out/share/${pname}
+    cp -a ${appimageContents}/blockbench.desktop $out/share/applications/${pname}.desktop
+    cp -a ${appimageContents}/usr/share/icons $out/share
+    substituteInPlace $out/share/applications/${pname}.desktop \
+      --replace 'Exec=AppRun' 'Exec=${pname}'
+    runHook postInstall
+  '';
+
+  postFixup = ''
+    makeWrapper ${electron_8}/bin/electron $out/bin/${pname} \
+      --add-flags $out/share/${pname}/resources/app.asar \
+      --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc ]}"
+  '';
+
+  meta = with lib; {
+    description = "A boxy 3D model editor powered by Electron";
+    homepage = "https://blockbench.net/";
+    license = licenses.gpl3Only;
+    maintainers = [ maintainers.ckie ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/c3d/default.nix b/nixpkgs/pkgs/applications/graphics/c3d/default.nix
new file mode 100644
index 000000000000..0a4ed515511c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/c3d/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, cmake, itk4, Cocoa }:
+
+stdenv.mkDerivation rec {
+  pname   = "c3d";
+  version = "unstable-2020-10-05";
+
+  src = fetchFromGitHub {
+    owner = "pyushkevich";
+    repo = pname;
+    rev = "0a87e3972ea403babbe2d05ec6d50855e7c06465";
+    sha256 = "0wsmkifqrcfy13fnwvinmnq1m0lkqmpyg7bgbwnb37mbrlbq06wf";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ itk4 ]
+    ++ lib.optional stdenv.isDarwin Cocoa;
+
+  meta = with lib; {
+    homepage = "https://github.com/pyushkevich/c3d";
+    description = "Medical imaging processing tool";
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms = platforms.unix;
+    license = licenses.gpl3;
+    broken = stdenv.isAarch64;
+    # /build/git-3453f61/itkextras/OneDimensionalInPlaceAccumulateFilter.txx:311:10: fatal error: xmmintrin.h: No such file or directory
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/cloudcompare/default.nix b/nixpkgs/pkgs/applications/graphics/cloudcompare/default.nix
new file mode 100644
index 000000000000..9fbe390f5d83
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/cloudcompare/default.nix
@@ -0,0 +1,92 @@
+{ lib
+, mkDerivation
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, dxflib
+, eigen
+, flann
+, gdal
+, LASzip
+, libLAS
+, pdal
+, qtbase
+, qtsvg
+, qttools
+, tbb
+, xercesc
+}:
+
+mkDerivation rec {
+  pname = "cloudcompare";
+  version = "2.11.2"; # Remove below patch with the next version bump.
+
+  src = fetchFromGitHub {
+    owner = "CloudCompare";
+    repo = "CloudCompare";
+    rev = "v${version}";
+    sha256 = "0sb2h08iaf6zrf54sg6ql6wm63q5vq0kpd3gffdm26z8w6j6wv3s";
+    # As of writing includes (https://github.com/CloudCompare/CloudCompare/blob/a1c589c006fc325e8b560c77340809b9c7e7247a/.gitmodules):
+    # * libE57Format
+    # * PoissonRecon
+    # In a future version it will also contain
+    # * CCCoreLib
+    fetchSubmodules = true;
+  };
+
+  patches = [
+    # TODO: Remove with next CloudCompare release (see https://github.com/CloudCompare/CloudCompare/pull/1478)
+    (fetchpatch {
+      name = "CloudCompare-fix-for-PDAL-2.3.0.patch";
+      url = "https://github.com/CloudCompare/CloudCompare/commit/f3038dcdeb0491c4a653c2ee6fb017326eb676a3.patch";
+      sha256 = "0ca5ry987mcgsdawz5yd4xhbsdb5k44qws30srxymzx2djvamwli";
+    })
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    eigen # header-only
+  ];
+
+  buildInputs = [
+    dxflib
+    flann
+    gdal
+    LASzip
+    libLAS
+    pdal
+    qtbase
+    qtsvg
+    qttools
+    tbb
+    xercesc
+  ];
+
+  cmakeFlags = [
+    # TODO: This will become -DCCCORELIB_USE_TBB=ON in a future version, see
+    #       https://github.com/CloudCompare/CloudCompare/commit/f5a0c9fd788da26450f3fa488b2cf0e4a08d255f
+    "-DCOMPILE_CC_CORE_LIB_WITH_TBB=ON"
+    "-DOPTION_USE_DXF_LIB=ON"
+    "-DOPTION_USE_GDAL=ON"
+    "-DOPTION_USE_SHAPE_LIB=ON"
+
+    "-DPLUGIN_GL_QEDL=ON"
+    "-DPLUGIN_GL_QSSAO=ON"
+    "-DPLUGIN_IO_QADDITIONAL=ON"
+    "-DPLUGIN_IO_QCORE=ON"
+    "-DPLUGIN_IO_QCSV_MATRIX=ON"
+    "-DPLUGIN_IO_QE57=ON"
+    "-DPLUGIN_IO_QFBX=OFF" # Autodesk FBX SDK is gratis+proprietary; not packaged in nixpkgs
+    "-DPLUGIN_IO_QPDAL=ON" # required for .las/.laz support
+    "-DPLUGIN_IO_QPHOTOSCAN=ON"
+    "-DPLUGIN_IO_QRDB=OFF" # Riegl rdblib is proprietary; not packaged in nixpkgs
+  ];
+
+  meta = with lib; {
+    description = "3D point cloud and mesh processing software";
+    homepage = "https://cloudcompare.org";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ nh2 ];
+    platforms = with platforms; linux; # only tested here; might work on others
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/comical/default.nix b/nixpkgs/pkgs/applications/graphics/comical/default.nix
new file mode 100644
index 000000000000..5c6ec804e62c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/comical/default.nix
@@ -0,0 +1,23 @@
+{lib, stdenv, fetchurl, wxGTK, util-linux, zlib }:
+
+stdenv.mkDerivation rec {
+  name = "comical-0.8";
+  src = fetchurl {
+    url = "mirror://sourceforge/comical/${name}.tar.gz";
+    sha256 = "0b6527cc06b25a937041f1eb248d0fd881cf055362097036b939817f785ab85e";
+  };
+  buildInputs = [ wxGTK util-linux zlib ];
+  preBuild="makeFlags=\"prefix=$out\"";
+
+  patches = [ ./wxgtk-2.8.patch ];
+
+  preInstall = "mkdir -pv $out/bin";
+
+  meta = {
+    description = "Viewer of CBR and CBZ files, often used to store scanned comics";
+    homepage = "http://comical.sourceforge.net/";
+    license = lib.licenses.gpl2Plus;
+    maintainers = with lib.maintainers; [viric];
+    platforms = with lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/comical/wxgtk-2.8.patch b/nixpkgs/pkgs/applications/graphics/comical/wxgtk-2.8.patch
new file mode 100644
index 000000000000..db7626074a0f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/comical/wxgtk-2.8.patch
@@ -0,0 +1,36 @@
+diff --git a/Makefile b/Makefile
+index a648e72..181c47f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,5 +1,5 @@
+ CC = `wx-config --cxx`
+-LDFLAGS = `wx-config --libs` -Lunrar -lunrar -Lunzip -lminiunzip
++LDFLAGS = `wx-config --libs` -Lunrar -lunrar -Lunzip -lminiunzip -lz
+ INSTALL = install
+ INSTALL_PROGRAM = $(INSTALL)
+ prefix = /usr/local
+diff --git a/src/ComicalApp.cpp b/src/ComicalApp.cpp
+index 0c004cd..667e75e 100644
+--- a/src/ComicalApp.cpp
++++ b/src/ComicalApp.cpp
+@@ -28,6 +28,7 @@
+ #include "ComicalApp.h"
+ #include "ComicalFrame.h"
+ #include <wx/log.h>
++#include <wx/icon.h>
+ 
+ #if !defined(__WXMAC__) && !defined(__WXCOCOA__) && !defined(__WXMSW__) && !defined(__WXPM__)
+ #include "../Comical Icons/comical.xpm"
+diff --git a/unzip/unzip.h b/unzip/unzip.h
+index b247937..5bb6a69 100644
+--- a/unzip/unzip.h
++++ b/unzip/unzip.h
+@@ -50,7 +50,7 @@ extern "C" {
+ #endif
+ 
+ #ifndef _ZLIB_H
+-#include "zlib.h"
++#include <zlib.h>
+ #endif
+ 
+ #ifndef _ZLIBIOAPI_H
diff --git a/nixpkgs/pkgs/applications/graphics/coreimage/default.nix b/nixpkgs/pkgs/applications/graphics/coreimage/default.nix
new file mode 100644
index 000000000000..1dcff1f6e8f2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/coreimage/default.nix
@@ -0,0 +1,31 @@
+{ mkDerivation, lib, fetchFromGitLab, libcprime, qtbase, cmake, ninja }:
+
+mkDerivation rec {
+  pname = "coreimage";
+  version = "4.2.0";
+
+  src = fetchFromGitLab {
+    owner = "cubocore/coreapps";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-dxRHzSG5ea1MhpTjgZbFztV9mElEaeOK4NsmieSgf5Q";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    ninja
+  ];
+
+  buildInputs = [
+    qtbase
+    libcprime
+  ];
+
+  meta = with lib; {
+    description = "An image viewer from the C Suite";
+    homepage = "https://gitlab.com/cubocore/coreapps/coreimage";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ dan4ik605743 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/cq-editor/default.nix b/nixpkgs/pkgs/applications/graphics/cq-editor/default.nix
new file mode 100644
index 000000000000..33bae268c8a6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/cq-editor/default.nix
@@ -0,0 +1,63 @@
+{ lib
+, mkDerivationWith
+, python3Packages
+, fetchFromGitHub
+, wrapQtAppsHook
+}:
+
+mkDerivationWith python3Packages.buildPythonApplication rec {
+  pname = "cq-editor";
+  version = "0.1.1";
+
+  src = fetchFromGitHub {
+    owner = "CadQuery";
+    repo = "CQ-editor";
+    rev = version;
+    sha256 = "1970izjaa60r5cg9i35rzz9lk5c5d8q1vw1rh2skvfbf63z1hnzv";
+  };
+
+  patches = [
+    ./spyder4.patch
+  ];
+
+  propagatedBuildInputs = with python3Packages; [
+    cadquery
+    Logbook
+    pyqt5
+    pyparsing
+    pyqtgraph
+    spyder
+    pathpy
+    qtconsole
+    requests
+  ];
+
+  nativeBuildInputs = [ wrapQtAppsHook ];
+  preFixup = ''
+    makeWrapperArgs+=("''${qtWrapperArgs[@]}")
+  '';
+
+  checkInputs = with python3Packages; [
+    pytest
+    pytest-xvfb
+    pytest-mock
+    pytest-cov
+    pytest-repeat
+    pytest-qt
+  ];
+
+  checkPhase = ''
+    pytest --no-xvfb
+  '';
+
+  # requires X server
+  doCheck = false;
+
+  meta = with lib; {
+    description = "CadQuery GUI editor based on PyQT";
+    homepage = "https://github.com/CadQuery/CQ-editor";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ costrouc marcus7070 ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/graphics/cq-editor/spyder4.patch b/nixpkgs/pkgs/applications/graphics/cq-editor/spyder4.patch
new file mode 100644
index 000000000000..49813b18a0c0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/cq-editor/spyder4.patch
@@ -0,0 +1,58 @@
+diff --git a/cq_editor/widgets/debugger.py b/cq_editor/widgets/debugger.py
+index b7398fb..d039db5 100644
+--- a/cq_editor/widgets/debugger.py
++++ b/cq_editor/widgets/debugger.py
+@@ -162,7 +162,7 @@ class Debugger(QObject,ComponentMixin):
+ 
+     def get_breakpoints(self):
+ 
+-        return self.parent().components['editor'].get_breakpoints()
++        return self.parent().components['editor'].debugger.get_breakpoints()
+ 
+     def compile_code(self,cq_script):
+ 
+@@ -178,12 +178,14 @@ class Debugger(QObject,ComponentMixin):
+     def _exec(self, code, locals_dict, globals_dict):
+ 
+         with ExitStack() as stack:
+-            p = Path(self.parent().components['editor'].filename).dirname()
+-            if self.preferences['Add script dir to path'] and p:
++            fname = self.parent().components['editor'].filename
++            p = Path(fname if fname else '').abspath().dirname()
++            if self.preferences['Add script dir to path'] and p.exists():
+                 sys.path.append(p)
+                 stack.callback(sys.path.remove, p)
+-            if self.preferences['Change working dir to script dir'] and p:
++            if self.preferences['Change working dir to script dir'] and p.exists():
+                 stack.enter_context(p)
++
+             exec(code, locals_dict, globals_dict)
+             
+     def _inject_locals(self,module):
+diff --git a/cq_editor/widgets/editor.py b/cq_editor/widgets/editor.py
+index 45aa048..2763469 100644
+--- a/cq_editor/widgets/editor.py
++++ b/cq_editor/widgets/editor.py
+@@ -1,4 +1,4 @@
+-from spyder.widgets.sourcecode.codeeditor import  CodeEditor
++from spyder.plugins.editor.widgets.codeeditor import  CodeEditor
+ from PyQt5.QtCore import pyqtSignal, QFileSystemWatcher, QTimer
+ from PyQt5.QtWidgets import QAction, QFileDialog
+ from PyQt5.QtGui import QFontDatabase
+@@ -32,6 +32,8 @@ class Editor(CodeEditor,ComponentMixin):
+ 
+     def __init__(self,parent=None):
+ 
++        self._watched_file = None
++
+         super(Editor,self).__init__(parent)
+         ComponentMixin.__init__(self)
+ 
+@@ -83,7 +85,6 @@ class Editor(CodeEditor,ComponentMixin):
+ 
+         # autoreload support
+         self._file_watcher = QFileSystemWatcher(self)
+-        self._watched_file = None
+         # we wait for 50ms after a file change for the file to be written completely
+         self._file_watch_timer = QTimer(self)
+         self._file_watch_timer.setInterval(50)
diff --git a/nixpkgs/pkgs/applications/graphics/darktable/default.nix b/nixpkgs/pkgs/applications/graphics/darktable/default.nix
new file mode 100644
index 000000000000..50e26677377f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/darktable/default.nix
@@ -0,0 +1,62 @@
+{ lib, stdenv, fetchurl, libsoup, graphicsmagick, json-glib, wrapGAppsHook
+, cairo, cmake, ninja, curl, perl, llvm, desktop-file-utils, exiv2, glib
+, ilmbase, gtk3, intltool, lcms2, lensfun, libX11, libexif, libgphoto2, libjpeg
+, libpng, librsvg, libtiff, openexr, osm-gps-map, pkg-config, sqlite, libxslt
+, openjpeg, lua, pugixml, colord, colord-gtk, libwebp, libsecret, gnome
+, ocl-icd, pcre, gtk-mac-integration, isocodes, llvmPackages, gmic, libavif, icu
+}:
+
+stdenv.mkDerivation rec {
+  version = "3.6.1";
+  pname = "darktable";
+
+  src = fetchurl {
+    url = "https://github.com/darktable-org/darktable/releases/download/release-${version}/darktable-${version}.tar.xz";
+    sha256 = "sha256-or/HwQO4JJRUV6m/7Z5S8Af6HQMPnbyz/wMnhRvkLRQ=";
+  };
+
+  nativeBuildInputs = [ cmake ninja llvm pkg-config intltool perl desktop-file-utils wrapGAppsHook ];
+
+  buildInputs = [
+    cairo curl exiv2 glib gtk3 ilmbase lcms2 lensfun libexif
+    libgphoto2 libjpeg libpng librsvg libtiff openexr sqlite libxslt
+    libsoup graphicsmagick json-glib openjpeg lua pugixml
+    libwebp libsecret gnome.adwaita-icon-theme osm-gps-map pcre isocodes gmic libavif icu
+  ] ++ lib.optionals stdenv.isLinux [
+    colord colord-gtk libX11 ocl-icd
+  ] ++ lib.optional stdenv.isDarwin gtk-mac-integration
+    ++ lib.optional stdenv.cc.isClang llvmPackages.openmp;
+
+  cmakeFlags = [
+    "-DBUILD_USERMANUAL=False"
+  ] ++ lib.optionals stdenv.isDarwin [
+    "-DUSE_COLORD=OFF"
+    "-DUSE_KWALLET=OFF"
+  ];
+
+
+  # darktable changed its rpath handling in commit
+  # 83c70b876af6484506901e6b381304ae0d073d3c and as a result the
+  # binaries can't find libdarktable.so, so change LD_LIBRARY_PATH in
+  # the wrappers:
+  preFixup = let
+    libPathEnvVar = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH";
+    libPathPrefix = "$out/lib/darktable" + lib.optionalString stdenv.isLinux ":${ocl-icd}/lib";
+  in ''
+    for f in $out/share/darktable/kernels/*.cl; do
+      sed -r "s|#include \"(.*)\"|#include \"$out/share/darktable/kernels/\1\"|g" -i "$f"
+    done
+
+    gappsWrapperArgs+=(
+      --prefix ${libPathEnvVar} ":" "${libPathPrefix}"
+    )
+  '';
+
+  meta = with lib; {
+    description = "Virtual lighttable and darkroom for photographers";
+    homepage = "https://www.darktable.org";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ goibhniu flosse mrVanDalo ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/deskew/default.nix b/nixpkgs/pkgs/applications/graphics/deskew/default.nix
new file mode 100644
index 000000000000..66309ebf7acf
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/deskew/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitHub, libtiff, fpc }:
+
+stdenv.mkDerivation rec {
+
+  pname = "deskew";
+  version = "1.25";
+
+  src = fetchFromGitHub {
+    owner = "galfar";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0zjjj66qhgqkmfxl3q7p78dv4xl4ci918pgl4d5259pqdj1bfgc8";
+  };
+
+  nativeBuildInputs = [ fpc ];
+  buildInputs = [ libtiff ];
+
+  buildPhase = ''
+    rm -r Bin # Remove pre-compiled binary
+    mkdir Bin
+    chmod +x compile.sh
+    ./compile.sh
+  '';
+
+  installPhase = ''
+    install -Dt $out/bin Bin/*
+  '';
+
+  meta = with lib; {
+    description = "A command line tool for deskewing scanned text documents";
+    homepage = "https://bitbucket.org/galfar/app-deskew/overview";
+    license = licenses.mit;
+    maintainers = with maintainers; [ryantm];
+    platforms = platforms.all;
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/graphics/dia/CVE-2019-19451.patch b/nixpkgs/pkgs/applications/graphics/dia/CVE-2019-19451.patch
new file mode 100644
index 000000000000..28d6598330a3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/dia/CVE-2019-19451.patch
@@ -0,0 +1,11 @@
+diff -ru a/app/app_procs.c b/app/app_procs.c
+--- a/app/app_procs.c	2021-01-30 11:09:52.000000000 -0500
++++ b/app/app_procs.c	2021-01-30 11:11:05.000000000 -0500
+@@ -785,6 +785,7 @@
+ 
+ 	if (!filename) {
+ 	  g_print (_("Filename conversion failed: %s\n"), filenames[i]);
++	  ++i;
+ 	  continue;
+ 	}
+ 
diff --git a/nixpkgs/pkgs/applications/graphics/dia/default.nix b/nixpkgs/pkgs/applications/graphics/dia/default.nix
new file mode 100644
index 000000000000..d07904c8597b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/dia/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchgit, autoconf, automake, libtool, gtk2, pkg-config, perlPackages,
+libxml2, gettext, python2, libxml2Python, docbook5, docbook_xsl,
+libxslt, intltool, libart_lgpl, withGNOME ? false, libgnomeui,
+gtk-mac-integration-gtk2 }:
+
+stdenv.mkDerivation {
+  pname = "dia";
+  version = "0.97.3.20170622";
+
+  src = fetchgit {
+    url = "https://gitlab.gnome.org/GNOME/dia.git";
+    rev = "b86085dfe2b048a2d37d587adf8ceba6fb8bc43c";
+    sha256 = "1fyxfrzdcs6blxhkw3bcgkksaf3byrsj4cbyrqgb4869k3ynap96";
+  };
+
+  patches = [
+    ./CVE-2019-19451.patch
+  ];
+
+  buildInputs =
+    [ gtk2 libxml2 gettext python2 libxml2Python docbook5
+      libxslt docbook_xsl libart_lgpl ]
+      ++ lib.optional withGNOME libgnomeui
+      ++ lib.optional stdenv.isDarwin gtk-mac-integration-gtk2;
+
+  nativeBuildInputs = [ autoconf automake libtool pkg-config intltool ]
+    ++ (with perlPackages; [ perl XMLParser ]);
+
+  preConfigure = ''
+    NOCONFIGURE=1 ./autogen.sh # autoreconfHook is not enough
+  '';
+  configureFlags = lib.optional withGNOME "--enable-gnome";
+
+  hardeningDisable = [ "format" ];
+
+  meta = with lib; {
+    description = "Gnome Diagram drawing software";
+    homepage = "http://live.gnome.org/Dia";
+    maintainers = with maintainers; [ raskin ];
+    license = licenses.gpl2;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/digikam/default.nix b/nixpkgs/pkgs/applications/graphics/digikam/default.nix
new file mode 100644
index 000000000000..141f966253d8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/digikam/default.nix
@@ -0,0 +1,137 @@
+{ mkDerivation, lib, fetchurl, cmake, doxygen, extra-cmake-modules, wrapGAppsHook
+
+# For `digitaglinktree`
+, perl, sqlite
+
+, qtbase
+, qtxmlpatterns
+, qtsvg
+, qtwebengine
+
+, akonadi-contacts
+, kcalendarcore
+, kconfigwidgets
+, kcoreaddons
+, kdoctools
+, kfilemetadata
+, knotifications
+, knotifyconfig
+, ktextwidgets
+, kwidgetsaddons
+, kxmlgui
+
+, bison
+, boost
+, eigen
+, exiv2
+, ffmpeg
+, flex
+, graphviz
+, imagemagick
+, lcms2
+, lensfun
+, libgphoto2
+, libkipi
+, libksane
+, liblqr1
+, libqtav
+, libusb1
+, marble
+, libGL
+, libGLU
+, opencv
+, pcre
+, threadweaver
+, x265
+
+# For panorama and focus stacking
+, enblend-enfuse
+, hugin
+, gnumake
+
+, breeze-icons
+, oxygen
+}:
+
+mkDerivation rec {
+  pname   = "digikam";
+  version = "7.3.0";
+
+  src = fetchurl {
+    url = "mirror://kde/stable/${pname}/${version}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-la6pO+HP05u1IzO4Kz5Xv2gIDH0TGddU0WeiD22+RVE=";
+  };
+
+  nativeBuildInputs = [ cmake doxygen extra-cmake-modules kdoctools wrapGAppsHook ];
+
+  buildInputs = [
+    bison
+    boost
+    eigen
+    exiv2
+    ffmpeg
+    flex
+    graphviz
+    imagemagick
+    lcms2
+    lensfun
+    libgphoto2
+    libkipi
+    libksane
+    liblqr1
+    libqtav
+    libusb1
+    libGL
+    libGLU
+    opencv
+    pcre
+    x265
+
+    qtbase
+    qtxmlpatterns
+    qtsvg
+    qtwebengine
+
+    akonadi-contacts
+    kcalendarcore
+    kconfigwidgets
+    kcoreaddons
+    kfilemetadata
+    knotifications
+    knotifyconfig
+    ktextwidgets
+    kwidgetsaddons
+    kxmlgui
+
+    breeze-icons
+    marble
+    oxygen
+    threadweaver
+  ];
+
+  cmakeFlags = [
+    "-DENABLE_MYSQLSUPPORT=1"
+    "-DENABLE_INTERNALMYSQL=1"
+    "-DENABLE_MEDIAPLAYER=1"
+    "-DENABLE_QWEBENGINE=on"
+    "-DENABLE_APPSTYLES=on"
+  ];
+
+  dontWrapGApps = true;
+
+  preFixup = ''
+    qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
+    qtWrapperArgs+=(--prefix PATH : ${lib.makeBinPath [ gnumake hugin enblend-enfuse ]})
+    qtWrapperArgs+=(--suffix DK_PLUGIN_PATH : ${placeholder "out"}/${qtbase.qtPluginPrefix}/${pname})
+    substituteInPlace $out/bin/digitaglinktree \
+      --replace "/usr/bin/perl" "${perl}/bin/perl" \
+      --replace "/usr/bin/sqlite3" "${sqlite}/bin/sqlite3"
+  '';
+
+  meta = with lib; {
+    description = "Photo Management Program";
+    license = licenses.gpl2;
+    homepage = "https://www.digikam.org";
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/displaycal/default.nix b/nixpkgs/pkgs/applications/graphics/displaycal/default.nix
new file mode 100644
index 000000000000..3b6bb01bb150
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/displaycal/default.nix
@@ -0,0 +1,72 @@
+{ python2
+, lib
+, fetchurl
+, pkg-config
+, libXext
+, libXxf86vm
+, libX11
+, libXrandr
+, libXinerama
+, libXScrnSaver
+, argyllcms
+ }:
+
+let
+  inherit (python2.pkgs) buildPythonApplication wxPython numpy dbus-python;
+in buildPythonApplication rec {
+  pname = "displaycal";
+  version = "3.8.9.3";
+
+  enableParallelBuilding = true;
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/dispcalgui/release/${version}/DisplayCAL-${version}.tar.gz";
+    sha256 = "1sivi4q7sqsrc95qg5gh37bsm2761md4mpl89hflzwk6kyyxyd3w";
+  };
+
+  propagatedBuildInputs = [
+    libXext
+    libXxf86vm
+    libX11
+    libXrandr
+    libXinerama
+    libXScrnSaver
+    argyllcms
+    wxPython
+    numpy
+    dbus-python
+  ];
+
+  nativeBuildInputs = [
+    pkg-config
+  ];
+
+  preConfigure = ''
+    mkdir dist
+    cp {misc,dist}/net.displaycal.DisplayCAL.appdata.xml
+    touch dist/copyright
+    mkdir -p $out
+    ln -s $out/share/DisplayCAL $out/Resources
+  '';
+
+  # no idea why it looks there - symlink .json lang (everything)
+  postInstall = ''
+    for x in $out/share/DisplayCAL/*; do
+      ln -s $x $out/lib/python2.7/site-packages/DisplayCAL
+    done
+
+    for prog in "$out/bin/"*; do
+      wrapProgram "$prog" \
+        --prefix PYTHONPATH : "$PYTHONPATH" \
+        --prefix PATH : ${argyllcms}/bin
+    done
+  '';
+
+  meta = {
+    description = "Display Calibration and Characterization powered by Argyll CMS";
+    homepage = "https://displaycal.net/";
+    license = lib.licenses.gpl3;
+    maintainers = [lib.maintainers.marcweber];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/djv/default.nix b/nixpkgs/pkgs/applications/graphics/djv/default.nix
new file mode 100644
index 000000000000..95a29f243e4a
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/applications/graphics/djview/default.nix b/nixpkgs/pkgs/applications/graphics/djview/default.nix
new file mode 100644
index 000000000000..ef100e5f7bd5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/djview/default.nix
@@ -0,0 +1,74 @@
+{ lib, stdenv
+, mkDerivation
+, fetchurl
+, pkg-config
+, djvulibre
+, qtbase
+, qttools
+, xorg
+, libtiff
+, darwin
+}:
+
+mkDerivation rec {
+  pname = "djview";
+  version = "4.10.6";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/djvu/${pname}-${version}.tar.gz";
+    sha256 = "08bwv8ppdzhryfcnifgzgdilb12jcnivl4ig6hd44f12d76z6il4";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    qttools
+  ];
+
+  buildInputs = [
+    djvulibre
+    qtbase
+    xorg.libXt
+    libtiff
+  ] ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.AGL;
+
+  configureFlags = [
+    "--disable-silent-rules"
+    "--disable-dependency-tracking"
+    "--with-x"
+    "--with-tiff"
+    # NOTE: 2019-09-19: experimental "--enable-npdjvu" fails
+  ] ++ lib.optional stdenv.isDarwin "--enable-mac";
+
+  passthru = {
+    mozillaPlugin = "/lib/mozilla/plugins";
+  };
+
+  meta = with lib; {
+    description = "A portable DjVu viewer (Qt5) and browser (nsdejavu) plugin";
+    homepage = "http://djvu.sourceforge.net/djview4.html";
+    license = licenses.gpl2;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ Anton-Latukha ];
+    longDescription = ''
+      The portable DjVu viewer (Qt5) and browser (nsdejavu) plugin.
+
+      Djview highlights:
+        - entirely based on the public DjVulibre api.
+        - entirely written in portable Qt5.
+        - works natively under Unix/X11, MS Windows, and macOS X.
+        - continuous scrolling of pages
+        - side-by-side display of pages
+        - ability to specify a url to the djview command
+        - all plugin and cgi options available from the command line
+        - all silly annotations implemented
+        - display thumbnails as a grid
+        - display outlines
+        - page names supported (see djvused command set-page-title)
+        - metadata dialog (see djvused command set-meta)
+        - implemented as reusable Qt widgets
+
+      nsdejavu: browser plugin for DjVu. It internally uses djview.
+      Has CGI-style arguments to configure the view of document (see man).
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/dosage/default.nix b/nixpkgs/pkgs/applications/graphics/dosage/default.nix
new file mode 100644
index 000000000000..e5e77dccbbb4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/dosage/default.nix
@@ -0,0 +1,30 @@
+{ lib, python3Packages }:
+
+python3Packages.buildPythonApplication rec {
+  pname = "dosage";
+  version = "2.17";
+
+  src = python3Packages.fetchPypi {
+    inherit pname version;
+    sha256 = "0vmxgn9wd3j80hp4gr5iq06jrl4gryz5zgfdd2ah30d12sfcfig0";
+  };
+
+  checkInputs = with python3Packages; [
+    pytestCheckHook pytest-xdist responses
+  ];
+
+  nativeBuildInputs = with python3Packages; [ setuptools-scm ];
+
+  propagatedBuildInputs = with python3Packages; [
+    colorama imagesize lxml requests setuptools six
+  ];
+
+  disabled = python3Packages.pythonOlder "3.3";
+
+  meta = {
+    description = "A comic strip downloader and archiver";
+    homepage = "https://dosage.rocks/";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ toonn ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/drawing/default.nix b/nixpkgs/pkgs/applications/graphics/drawing/default.nix
new file mode 100644
index 000000000000..9c25b2784b40
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/drawing/default.nix
@@ -0,0 +1,69 @@
+{ lib
+, fetchFromGitHub
+, meson
+, ninja
+, pkg-config
+, python3
+, gtk3
+, appstream-glib
+, desktop-file-utils
+, gobject-introspection
+, wrapGAppsHook
+, glib
+, gdk-pixbuf
+, pango
+, gettext
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "drawing";
+  version = "0.8.3";
+
+  format = "other";
+
+  src = fetchFromGitHub {
+    owner = "maoschanz";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-qDLJ+Mw4z66ro9/zoEIzDJpA+jJLYw0WgsP7mA+56XM=";
+  };
+
+  nativeBuildInputs = [
+    appstream-glib
+    desktop-file-utils
+    gobject-introspection
+    meson
+    ninja
+    pkg-config
+    wrapGAppsHook
+    glib
+    gettext
+  ];
+
+  buildInputs = [
+    glib
+    gtk3
+    gdk-pixbuf
+    pango
+  ];
+
+  propagatedBuildInputs = with python3.pkgs; [
+    pycairo
+    pygobject3
+  ];
+
+  postPatch = ''
+    chmod +x build-aux/meson/postinstall.py # patchShebangs requires executable file
+    patchShebangs build-aux/meson/postinstall.py
+  '';
+
+  strictDeps = false;
+
+  meta = with lib; {
+    description = "A free basic image editor, similar to Microsoft Paint, but aiming at the GNOME desktop";
+    homepage = "https://maoschanz.github.io/drawing/";
+    maintainers = with maintainers; [ mothsart ];
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/drawio/default.nix b/nixpkgs/pkgs/applications/graphics/drawio/default.nix
new file mode 100644
index 000000000000..5bb94baf76f2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/drawio/default.nix
@@ -0,0 +1,97 @@
+{ stdenv, lib, fetchurl, rpmextract, autoPatchelfHook, wrapGAppsHook
+
+# Dynamic libraries
+, alsa-lib, atk, at-spi2-atk, at-spi2-core, cairo, dbus, cups, expat
+, gdk-pixbuf, glib, gtk3, libX11, libXScrnSaver, libXcomposite, libXcursor
+, libXdamage, libXext, libXfixes, libXi, libXrandr, libXrender, libXtst
+, libxcb, libuuid, libxshmfence, nspr, nss, pango, mesa
+
+, systemd
+}:
+
+stdenv.mkDerivation rec {
+  pname = "drawio";
+  version = "14.5.1";
+
+  src = fetchurl {
+    url = "https://github.com/jgraph/drawio-desktop/releases/download/v${version}/drawio-x86_64-${version}.rpm";
+    hash = "sha256-ZrEoeeEhHQOLm/L3KA43Ru5fruIPK35CCUsllwpPB58=";
+  };
+
+  nativeBuildInputs = [
+    autoPatchelfHook
+    rpmextract
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    alsa-lib
+    atk
+    at-spi2-atk
+    at-spi2-core
+    cairo
+    cups
+    dbus
+    expat
+    gdk-pixbuf
+    glib
+    gtk3
+    libX11
+    libXScrnSaver
+    libXcomposite
+    libXcursor
+    libXdamage
+    libXext
+    libXfixes
+    libXi
+    libXrandr
+    libXrender
+    libxshmfence
+    libXtst
+    libxcb
+    libuuid
+    mesa # for libgbm
+    nspr
+    nss
+    pango
+    systemd
+  ];
+
+  runtimeDependencies = [
+    (lib.getLib systemd)
+  ];
+
+  dontBuild = true;
+  dontConfigure = true;
+
+  unpackPhase = "rpmextract ${src}";
+
+  installPhase = ''
+    mkdir -p $out/share
+    cp -r opt/drawio $out/share/
+
+    # Application icon
+    mkdir -p $out/share/icons/hicolor
+    cp -r usr/share/icons/hicolor/* $out/share/icons/hicolor/
+
+    # XDG desktop item
+    cp -r usr/share/applications $out/share/applications
+
+    # Symlink wrapper
+    mkdir -p $out/bin
+    ln -s $out/share/drawio/drawio $out/bin/drawio
+
+    # Update binary path
+    substituteInPlace $out/share/applications/drawio.desktop \
+      --replace /opt/drawio/drawio $out/bin/drawio
+  '';
+
+  meta = with lib; {
+    description = "A desktop application for creating diagrams";
+    homepage = "https://about.draw.io/";
+    license = licenses.asl20;
+    changelog = "https://github.com/jgraph/drawio-desktop/releases/tag/v${version}";
+    maintainers = with maintainers; [ ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/drawpile/default.nix b/nixpkgs/pkgs/applications/graphics/drawpile/default.nix
new file mode 100644
index 000000000000..09d51db254ba
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/drawpile/default.nix
@@ -0,0 +1,108 @@
+{ stdenv
+, lib
+, mkDerivation
+, fetchFromGitHub
+, extra-cmake-modules
+
+# common deps
+, karchive
+
+# client deps
+, qtbase
+, qtkeychain
+, qtmultimedia
+, qtsvg
+, qttools
+, libsecret
+
+# optional client deps
+, giflib
+, kdnssd
+, libvpx
+, miniupnpc
+, qtx11extras # kis
+
+# optional server deps
+, libmicrohttpd
+, libsodium
+, withSystemd ? stdenv.isLinux
+, systemd ? null
+
+# options
+, buildClient ? true
+, buildServer ? true
+, buildServerGui ? true # if false builds a headless server
+, buildExtraTools ? false
+, enableKisTablet ? false # enable improved graphics tablet support
+}:
+
+with lib;
+
+let
+  clientDeps = [
+    qtbase
+    qtkeychain
+    qtmultimedia
+    qtsvg
+    qttools
+    libsecret
+    # optional:
+    giflib # gif animation export support
+    kdnssd # local server discovery with Zeroconf
+    libvpx # WebM video export
+    miniupnpc # automatic port forwarding
+  ];
+
+  serverDeps = [
+    # optional:
+    libmicrohttpd # HTTP admin api
+    libsodium # ext-auth support
+  ] ++ optional withSystemd systemd;
+
+  kisDeps = [
+    qtx11extras
+  ];
+
+  boolToFlag = bool:
+    if bool then "ON" else "OFF";
+
+in mkDerivation rec {
+  pname = "drawpile";
+  version = "2.1.20";
+
+  src = fetchFromGitHub {
+    owner = "drawpile";
+    repo = "drawpile";
+    rev = version;
+    sha256 = "sha256-HjGsaa2BYRNxaQP9e8Z7BkVlIKByC/ta92boGbYHRWQ=";
+  };
+
+  nativeBuildInputs = [ extra-cmake-modules ];
+
+  buildInputs = [
+    karchive
+  ]
+  ++ optionals buildClient      clientDeps
+  ++ optionals buildServer      serverDeps
+  ++ optionals enableKisTablet  kisDeps;
+
+  cmakeFlags = [
+    "-Wno-dev"
+    "-DINITSYS=systemd"
+    "-DCLIENT=${boolToFlag buildClient}"
+    "-DSERVER=${boolToFlag buildServer}"
+    "-DSERVERGUI=${boolToFlag buildServerGui}"
+    "-DTOOLS=${boolToFlag buildExtraTools}"
+    "-DKIS_TABLET=${boolToFlag enableKisTablet}"
+  ];
+
+  meta = {
+    description = "A collaborative drawing program that allows multiple users to sketch on the same canvas simultaneously";
+    homepage = "https://drawpile.net/";
+    downloadPage = "https://drawpile.net/download/";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ fgaz ];
+    platforms = platforms.unix;
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/graphics/eddy/default.nix b/nixpkgs/pkgs/applications/graphics/eddy/default.nix
new file mode 100644
index 000000000000..6b8f465a1061
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/eddy/default.nix
@@ -0,0 +1,47 @@
+{ python3Packages
+, fetchFromGitHub
+, lib
+, jre
+, qt5
+, wrapQtAppsHook
+}:
+
+python3Packages.buildPythonApplication rec {
+  pname = "eddy";
+  version = "1.2.1";
+
+  src = fetchFromGitHub {
+    owner = "obdasystems";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "12j77bbva5py9bd57c80cmjvf8vll40h19n81h16lvv2r2r7jynh";
+  };
+
+  propagatedBuildInputs = [
+    qt5.qtbase
+    wrapQtAppsHook
+    python3Packages.setuptools
+    python3Packages.rfc3987
+    python3Packages.JPype1
+    python3Packages.pyqt5
+  ];
+
+  # Tests fail with: ImportError: cannot import name 'QtXmlPatterns' from 'PyQt5'
+  doCheck = false;
+
+  preBuild = ''
+    export HOME=/tmp
+  '';
+
+  preFixup = ''
+    wrapQtApp "$out/bin/eddy" --prefix JAVA_HOME : ${jre}
+  '';
+
+  meta = with lib; {
+    homepage = "http://www.obdasystems.com/eddy";
+    description = "Graphical editor for the specification and visualization of Graphol ontologies";
+    license = licenses.gpl3Only;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ koslambrou ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/emulsion/default.nix b/nixpkgs/pkgs/applications/graphics/emulsion/default.nix
new file mode 100644
index 000000000000..3012250b9ce3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/emulsion/default.nix
@@ -0,0 +1,77 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, rustPlatform
+, installShellFiles
+, makeWrapper
+, pkg-config
+, python3
+, libGL
+, libX11
+, libXcursor
+, libXi
+, libXrandr
+, libXxf86vm
+, libxcb
+, libxkbcommon
+, wayland
+, AppKit
+, CoreGraphics
+, CoreServices
+, Foundation
+, OpenGL
+}:
+let
+  rpathLibs = [
+    libGL
+    libX11
+    libXcursor
+    libXi
+    libXrandr
+    libXxf86vm
+    libxcb
+  ] ++ lib.optionals stdenv.isLinux [
+    libxkbcommon
+    wayland
+  ];
+in
+rustPlatform.buildRustPackage rec {
+  pname = "emulsion";
+  version = "9.0";
+
+  src = fetchFromGitHub {
+    owner = "ArturKovacs";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-Cdi+PQDHxMQG7t7iwDi6UWfDwQjjA2yiOf9p/ahBlOw=";
+  };
+
+  cargoSha256 = "sha256-2wiLamnGqACx1r4WJbWPCN3tvhww/rRWz8fcvAbjYE0=";
+
+  nativeBuildInputs = [
+    installShellFiles
+    makeWrapper
+    pkg-config
+    python3
+  ];
+
+  buildInputs = rpathLibs ++ lib.optionals stdenv.isDarwin [
+    AppKit
+    CoreGraphics
+    CoreServices
+    Foundation
+    OpenGL
+  ];
+
+  postFixup = lib.optionalString stdenv.isLinux ''
+    patchelf --set-rpath "${lib.makeLibraryPath rpathLibs}" $out/bin/emulsion
+  '';
+
+  meta = with lib; {
+    description = "A fast and minimalistic image viewer";
+    homepage = "https://arturkovacs.github.io/emulsion-website/";
+    maintainers = [ maintainers.magnetophon ];
+    platforms = platforms.unix;
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/epeg/default.nix b/nixpkgs/pkgs/applications/graphics/epeg/default.nix
new file mode 100644
index 000000000000..942a6d63bd51
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/epeg/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, libtool, autoconf, automake
+, libjpeg, libexif
+}:
+
+stdenv.mkDerivation rec {
+  pname = "epeg";
+  version = "0.9.2";
+
+  src = fetchFromGitHub {
+    owner = "mattes";
+    repo = "epeg";
+    rev = "v${version}";
+    sha256 = "14bjl9v6zzac4df25gm3bkw3n0mza5iazazsi65gg3m6661x6c5g";
+  };
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ pkg-config libtool autoconf automake ];
+
+  propagatedBuildInputs = [ libjpeg libexif ];
+
+  preConfigure = ''
+    ./autogen.sh
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/mattes/epeg";
+    description = "Insanely fast JPEG/ JPG thumbnail scaling";
+    platforms = platforms.linux ++ platforms.darwin;
+    license = {
+      url = "https://github.com/mattes/epeg#license";
+    };
+    maintainers = with maintainers; [ nh2 ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/evilpixie/default.nix b/nixpkgs/pkgs/applications/graphics/evilpixie/default.nix
new file mode 100644
index 000000000000..4c47283c42ac
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/evilpixie/default.nix
@@ -0,0 +1,59 @@
+{ mkDerivation
+, lib
+, fetchFromGitHub
+, makeDesktopItem
+, qmake
+, qtbase
+, libpng
+, giflib
+, impy
+}:
+
+let
+  desktopItem = makeDesktopItem {
+    name = "EvilPixie";
+    desktopName = "EvilPixie";
+    exec = "evilpixie %F";
+    icon = "evilpixie";
+    genericName = "Image Editor";
+    categories = "Graphics;2DGraphics;RasterGraphics;";
+    mimeType = "image/bmp;image/gif;image/jpeg;image/jpg;image/png;image/x-pcx;image/x-targa;image/x-tga;";
+  };
+
+in mkDerivation rec {
+  pname = "evilpixie";
+  version = "0.2.1";
+
+  src = fetchFromGitHub {
+    owner = "bcampbell";
+    repo = "evilpixie";
+    rev = "v${version}";
+    sha256 = "0dwgfr8kmkfppgf5wx9i5f7fjz3gxk0ji1l06x1z4r3vj52hdbph";
+  };
+
+  nativeBuildInputs = [
+    qmake
+  ];
+
+  buildInputs = [
+    qtbase
+    libpng
+    giflib
+    impy
+  ];
+
+  postInstall = ''
+    ln -s ${desktopItem}/share/applications $out/share
+    install -Dm 444 icon_128x128.png $out/share/icons/hicolor/128x128/apps/evilpixie.png
+  '';
+
+  meta = with lib; {
+    description = "Pixel-oriented paint program, modelled on Deluxe Paint";
+    homepage = "http://evilpixie.scumways.com/";
+    downloadPage = "https://github.com/bcampbell/evilpixie/releases";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ fgaz ];
+    platforms = platforms.all;
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/graphics/exrdisplay/default.nix b/nixpkgs/pkgs/applications/graphics/exrdisplay/default.nix
new file mode 100644
index 000000000000..c31c1407da7e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/exrdisplay/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl, pkg-config, fltk, openexr, libGLU, libGL, ctl }:
+
+stdenv.mkDerivation {
+  name ="openexr_viewers-2.2.1";
+
+  src = fetchurl {
+    url =  "mirror://savannah/openexr/openexr_viewers-2.2.1.tar.gz";
+    sha256 = "1ixx2wbjp4rvsf7h3bkja010gl1ihjrcjzy7h20jnn47ikg12vj8";
+  };
+
+  configurePhase = ''
+    ./configure --prefix=$out --with-fltk-config=${fltk}/bin/fltk-config
+  '';
+
+  buildPhase = ''
+    make LDFLAGS="`fltk-config --ldflags` -lGL -lfltk_gl"
+  '';
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ openexr fltk libGLU libGL ctl ];
+
+  meta = {
+    description = "Application for viewing OpenEXR images on a display at various exposure settings";
+    homepage = "http://openexr.com";
+    platforms = lib.platforms.linux;
+    license = lib.licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/exrtools/default.nix b/nixpkgs/pkgs/applications/graphics/exrtools/default.nix
new file mode 100644
index 000000000000..1985176765f0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/exrtools/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl, pkg-config, openexr, libpng12, libjpeg }:
+
+stdenv.mkDerivation rec {
+  pname = "exrtools";
+  version = "0.4";
+
+  src = fetchurl {
+    url =  "http://scanline.ca/exrtools/${pname}-${version}.tar.gz";
+    sha256 = "0jpkskqs1yjiighab4s91jy0c0qxcscwadfn94xy2mm2bx2qwp4z";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ stdenv openexr libpng12 libjpeg ];
+
+  meta = with lib; {
+    description = "Collection of utilities for manipulating OpenEXR images";
+    homepage = "http://scanline.ca/exrtools";
+    platforms = platforms.linux;
+    license = licenses.mit;
+    maintainers = [ maintainers.juliendehos ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/graphics/f3d/default.nix b/nixpkgs/pkgs/applications/graphics/f3d/default.nix
new file mode 100644
index 000000000000..92875bcaeee6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/f3d/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitLab, cmake, vtk_9, libX11, libGL, Cocoa, OpenGL }:
+
+stdenv.mkDerivation rec {
+  pname = "f3d";
+  version = "1.1.0";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.kitware.com";
+    owner = "f3d";
+    repo = "f3d";
+    rev = "v${version}";
+    sha256 = "0lj20k5qyw9z85k3wsp05f7dcv7v7asrnppi8i1jm32dzxjm4siw";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ vtk_9 ]
+    ++ lib.optionals stdenv.isLinux [ libGL libX11 ]
+    ++ lib.optionals stdenv.isDarwin [ Cocoa OpenGL ];
+
+  meta = with lib; {
+    description = "Fast and minimalist 3D viewer using VTK";
+    homepage = "https://kitware.github.io/F3D";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/fbida/default.nix b/nixpkgs/pkgs/applications/graphics/fbida/default.nix
new file mode 100644
index 000000000000..f2d2e267595c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/fbida/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, libjpeg, libexif, giflib, libtiff, libpng, libwebp, libdrm
+, pkg-config, freetype, fontconfig, which, imagemagick, curl, sane-backends, libXpm
+, epoxy, poppler, mesa, lirc }:
+
+stdenv.mkDerivation rec {
+  name = "fbida-2.14";
+
+  src = fetchurl {
+    url = "http://dl.bytesex.org/releases/fbida/${name}.tar.gz";
+    sha256 = "0f242mix20rgsqz1llibhsz4r2pbvx6k32rmky0zjvnbaqaw1dwm";
+  };
+
+  nativeBuildInputs = [ pkg-config which ];
+  buildInputs = [
+    libexif libjpeg libpng giflib freetype fontconfig libtiff libwebp
+    imagemagick curl sane-backends libdrm libXpm epoxy poppler lirc
+    mesa
+  ];
+
+  makeFlags = [ "prefix=$(out)" "verbose=yes" "STRIP=" "JPEG_VER=62" ];
+
+  patchPhase = ''
+    sed -e 's@ cpp\>@ gcc -E -@' -i GNUmakefile
+    sed -e 's@$(HAVE_LINUX_FB_H)@yes@' -i GNUmakefile
+  '';
+
+  meta = with lib; {
+    description = "Image viewing and manipulation programs including fbi, fbgs, ida, exiftran and thumbnail.cgi";
+    homepage = "https://www.kraxel.org/blog/linux/fbida/";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ pSub ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/feh/default.nix b/nixpkgs/pkgs/applications/graphics/feh/default.nix
new file mode 100644
index 000000000000..c279ccf3df64
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/feh/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, fetchurl, makeWrapper
+, xorg, imlib2, libjpeg, libpng
+, curl, libexif, jpegexiforient, perl
+, enableAutoreload ? !stdenv.hostPlatform.isDarwin }:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "feh";
+  version = "3.7.2";
+
+  src = fetchurl {
+    url = "https://feh.finalrewind.org/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-hHGP0nIM9UDSRXaElP4OtOWY9Es54jJrrow2ioKcglg=";
+  };
+
+  outputs = [ "out" "man" "doc" ];
+
+  nativeBuildInputs = [ makeWrapper xorg.libXt ];
+
+  buildInputs = [ xorg.libX11 xorg.libXinerama imlib2 libjpeg libpng curl libexif ];
+
+  makeFlags = [
+    "PREFIX=${placeholder "out"}" "exif=1"
+  ] ++ optional stdenv.isDarwin "verscmp=0"
+    ++ optional enableAutoreload "inotify=1";
+
+  installTargets = [ "install" ];
+  postInstall = ''
+    wrapProgram "$out/bin/feh" --prefix PATH : "${makeBinPath [ libjpeg jpegexiforient ]}" \
+                               --add-flags '--theme=feh'
+  '';
+
+  checkInputs = lib.singleton (perl.withPackages (p: [ p.TestCommand ]));
+  doCheck = true;
+
+  meta = {
+    description = "A light-weight image viewer";
+    homepage = "https://feh.finalrewind.org/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ viric willibutz globin ma27 ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/fig2dev/default.nix b/nixpkgs/pkgs/applications/graphics/fig2dev/default.nix
new file mode 100644
index 000000000000..8fa85803bfd8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/fig2dev/default.nix
@@ -0,0 +1,42 @@
+{ lib
+, stdenv
+, fetchurl
+, ghostscript
+, libpng
+, makeWrapper
+, coreutils
+, bc
+, gnugrep
+, gawk
+, gnused
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fig2dev";
+  version = "3.2.8b";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/mcj/fig2dev-${version}.tar.xz";
+    sha256 = "1jv8rg71dsy00lpg434r5zqs5qrg8mxqvv2gpcjjvmzsm551d2j1";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ libpng ];
+
+  GSEXE="${ghostscript}/bin/gs";
+
+  postInstall = ''
+    wrapProgram $out/bin/fig2ps2tex \
+        --set PATH ${lib.makeBinPath [ coreutils bc gnugrep gawk ]}
+    wrapProgram $out/bin/pic2tpic \
+        --set PATH ${lib.makeBinPath [ gnused ]}
+  '';
+
+  meta = with lib; {
+    description = "Tool to convert Xfig files to other formats";
+    homepage = "http://mcj.sourceforge.net/";
+    license = licenses.xfig;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ lesuisse ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/fluxus/default.nix b/nixpkgs/pkgs/applications/graphics/fluxus/default.nix
new file mode 100644
index 000000000000..3db183b2531a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/fluxus/default.nix
@@ -0,0 +1,96 @@
+{ lib, stdenv
+, fetchFromGitLab
+, alsa-lib
+, bzip2
+, fftw
+, freeglut
+, freetype
+, glew
+, libjack2
+, libGL
+, libGLU
+, libjpeg
+, liblo
+, libpng
+, libsndfile
+, libtiff
+, ode
+, openal
+, openssl
+, racket
+, sconsPackages
+, zlib
+}:
+let
+  libs = [
+    alsa-lib
+    bzip2
+    fftw
+    freeglut
+    freetype
+    glew
+    libjack2
+    libGL
+    libGLU
+    libjpeg
+    liblo
+    libpng
+    libsndfile
+    libtiff
+    ode
+    openal
+    openssl
+    zlib
+  ];
+in
+stdenv.mkDerivation rec {
+  pname = "fluxus";
+  version = "0.19";
+  src = fetchFromGitLab {
+    owner = "nebogeo";
+    repo = "fluxus";
+    rev = "ba9aee218dd4a9cfab914ad78bdb6d59e9a37400";
+    sha256 = "0mwghpgq4n1khwlmgscirhmcdhi6x00c08q4idi2zcqz961bbs28";
+  };
+
+  buildInputs = [
+    alsa-lib
+    fftw
+    freeglut.dev
+    freetype
+    glew
+    libjack2
+    libjpeg.dev
+    liblo
+    libsndfile.dev
+    libtiff.dev
+    ode
+    openal
+    openssl.dev
+    racket
+  ];
+  nativeBuildInputs = [ sconsPackages.scons_3_1_2 ];
+
+  patches = [ ./fix-build.patch ];
+  sconsFlags = [
+    "RacketPrefix=${racket}"
+    "RacketInclude=${racket}/include/racket"
+    "RacketLib=${racket}/lib/racket"
+    "LIBPATH=${lib.makeLibraryPath libs}"
+    "DESTDIR=build"
+  ];
+  configurePhase = ''
+    sconsFlags+=" Prefix=$out"
+  '';
+  installPhase = ''
+    mkdir -p $out
+    cp -r build$out/* $out/
+  '';
+
+  meta = with lib; {
+    description = "Livecoding environment for 3D graphics, sound, and games";
+    license = licenses.gpl2;
+    homepage = "http://www.pawfal.org/fluxus/";
+    maintainers = [ maintainers.brainrape ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/fluxus/fix-build.patch b/nixpkgs/pkgs/applications/graphics/fluxus/fix-build.patch
new file mode 100644
index 000000000000..7810dd59e357
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/fluxus/fix-build.patch
@@ -0,0 +1,16 @@
+diff --git a/SConstruct b/SConstruct
+index 32cb644..0b3a208 100644
+--- a/SConstruct
++++ b/SConstruct
+@@ -225,6 +225,11 @@ if env['PLATFORM'] == 'posix':
+                     ["asound", "alsa/asoundlib.h"],
+                     ["openal", "AL/al.h"]]
+
++env.Append(ENV={'PATH': ' ' + os.environ['PATH'], })
++env.Append(LIBPATH=ARGUMENTS.get('LIBPATH', '').split(':'))
++env.Append(CCFLAGS=' ' + os.environ.get('NIX_CFLAGS_COMPILE',''))
++env.Append(CCFLAGS=' -DNULL=0')
++
+ ################################################################################
+ # Make sure we have these libraries availible
+
diff --git a/nixpkgs/pkgs/applications/graphics/fondo/default.nix b/nixpkgs/pkgs/applications/graphics/fondo/default.nix
new file mode 100644
index 000000000000..abcb77f9f8b2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/fondo/default.nix
@@ -0,0 +1,72 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, nix-update-script
+, pantheon
+, vala
+, pkg-config
+, meson
+, ninja
+, python3
+, glib
+, gsettings-desktop-schemas
+, gtk3
+, libgee
+, libhandy
+, libsoup
+, json-glib
+, glib-networking
+, desktop-file-utils
+, wrapGAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fondo";
+  version = "1.6.1";
+
+  src = fetchFromGitHub {
+    owner = "calo001";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-JiDbkVs+EZRWRohSiuh8xFFgEhbnMYZfnZtz5Z4Wdb0=";
+  };
+
+  nativeBuildInputs = [
+    desktop-file-utils
+    meson
+    ninja
+    pkg-config
+    python3
+    vala
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    glib
+    glib-networking
+    gsettings-desktop-schemas
+    gtk3
+    json-glib
+    libgee
+    libhandy
+    libsoup
+    pantheon.granite
+  ];
+
+  postPatch = ''
+    chmod +x meson/post_install.py
+    patchShebangs meson/post_install.py
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/calo001/fondo";
+    description = "Find the most beautiful wallpapers for your desktop";
+    license = licenses.agpl3Plus;
+    maintainers = with maintainers; [ AndersonTorres ] ++ teams.pantheon.members;
+    platforms = platforms.linux;
+  };
+
+  passthru.updateScript = nix-update-script {
+    attrPath = pname;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/fontmatrix/default.nix b/nixpkgs/pkgs/applications/graphics/fontmatrix/default.nix
new file mode 100644
index 000000000000..3c67b11844d0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/fontmatrix/default.nix
@@ -0,0 +1,32 @@
+{ lib, mkDerivation, fetchpatch, fetchFromGitHub, cmake, qttools, qtwebkit }:
+
+mkDerivation rec {
+  pname = "fontmatrix";
+  version = "0.6.0-qt5";
+
+  src = fetchFromGitHub {
+    owner = "fcoiffie";
+    repo = "fontmatrix";
+    rev = "1ff8382d8c85c18d9962918f461341ff4fe21993";
+    sha256 = "0yx1gbsjj9ddq1kiqplif1w5x5saw250zbmhmd4phqmaqzr60w0h";
+  };
+
+  # Add missing QAction include
+  patches = [ (fetchpatch {
+    url = "https://github.com/fcoiffie/fontmatrix/commit/dc6de8c414ae21516b72daead79c8db88309b102.patch";
+    sha256 = "092860fdyf5gq67jqfxnlgwzjgpizi6j0njjv3m62aiznrhig7c8";
+  })];
+
+  buildInputs = [ qttools qtwebkit ];
+
+  nativeBuildInputs = [ cmake ];
+
+  hardeningDisable = [ "format" ];
+
+  meta = with lib; {
+    description = "Fontmatrix is a free/libre font explorer for Linux, Windows and Mac";
+    homepage = "https://github.com/fontmatrix/fontmatrix";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/foxotron/default.nix b/nixpkgs/pkgs/applications/graphics/foxotron/default.nix
new file mode 100644
index 000000000000..cd4972de4550
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/foxotron/default.nix
@@ -0,0 +1,74 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, nix-update-script
+, cmake
+, pkg-config
+, makeWrapper
+, zlib
+, libX11
+, libXrandr
+, libXinerama
+, libXcursor
+, libXi
+, libXext
+, libGLU
+, alsa-lib
+, fontconfig
+, AVFoundation
+, Carbon
+, Cocoa
+, CoreAudio
+, Kernel
+, OpenGL
+}:
+
+stdenv.mkDerivation rec {
+  pname = "foxotron";
+  version = "2021-08-13";
+
+  src = fetchFromGitHub {
+    owner = "Gargaj";
+    repo = "Foxotron";
+    rev = version;
+    fetchSubmodules = true;
+    sha256 = "sha256-0cnLHTZMeh8ilP0iXaMpFgKQAkizy/FimxXFDbH0b2w=";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config makeWrapper ];
+
+  buildInputs = [ zlib ]
+    ++ lib.optionals stdenv.hostPlatform.isLinux [ libX11 libXrandr libXinerama libXcursor libXi libXext alsa-lib fontconfig libGLU ]
+    ++ lib.optionals stdenv.hostPlatform.isDarwin [ AVFoundation Carbon Cocoa CoreAudio Kernel OpenGL ];
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/{bin,lib/foxotron}
+    cp -R ${lib.optionalString stdenv.hostPlatform.isDarwin "Foxotron.app/Contents/MacOS/"}Foxotron \
+      ../{config.json,Shaders,Skyboxes} $out/lib/foxotron/
+    wrapProgram $out/lib/foxotron/Foxotron \
+      --run "cd $out/lib/foxotron"
+    ln -s $out/{lib/foxotron,bin}/Foxotron
+
+    runHook postInstall
+  '';
+
+  passthru = {
+    updateScript = nix-update-script {
+      attrPath = pname;
+    };
+  };
+
+  meta = with lib; {
+    description = "General purpose model viewer";
+    longDescription = ''
+      ASSIMP based general purpose model viewer ("turntable") created for the
+      Revision 2021 3D Graphics Competition.
+    '';
+    homepage = "https://github.com/Gargaj/Foxotron";
+    license = licenses.unlicense;
+    maintainers = with maintainers; [ OPNA2608 ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/freecad/default.nix b/nixpkgs/pkgs/applications/graphics/freecad/default.nix
new file mode 100644
index 000000000000..8f5404cf3ae9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/freecad/default.nix
@@ -0,0 +1,167 @@
+{ lib
+, stdenv
+, mkDerivation
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, ninja
+, GitPython
+, boost
+, coin3d
+, eigen
+, gfortran
+, gts
+, hdf5
+, libGLU
+, libXmu
+, libf2c
+, libredwg
+, libspnav
+, matplotlib
+, medfile
+, mpi
+, ode
+, opencascade-occt
+, pivy
+, pkg-config
+, ply
+, pycollada
+, pyside2
+, pyside2-tools
+, python
+, pyyaml
+, qtbase
+, qttools
+, qtwebengine
+, qtx11extras
+, qtxmlpatterns
+, scipy
+, shiboken2
+, soqt
+, spaceNavSupport ? stdenv.isLinux
+, swig
+, vtk
+, wrapQtAppsHook
+, xercesc
+, zlib
+}:
+
+mkDerivation rec {
+  pname = "freecad";
+  version = "0.19.2";
+
+  src = fetchFromGitHub {
+    owner = "FreeCAD";
+    repo = "FreeCAD";
+    rev = version;
+    hash = "sha256-XZ+fRl3CPCIFu3nHeMTLibwwFBlG/cWpKJlI58hTAuU=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    ninja
+    pkg-config
+    pyside2-tools
+    gfortran
+    wrapQtAppsHook
+  ];
+
+  buildInputs = [
+    GitPython # for addon manager
+    boost
+    coin3d
+    eigen
+    gts
+    hdf5
+    libGLU
+    libXmu
+    libf2c
+    matplotlib
+    medfile
+    mpi
+    ode
+    opencascade-occt
+    pivy
+    ply # for openSCAD file support
+    pycollada
+    pyside2
+    pyside2-tools
+    python
+    pyyaml # (at least for) PyrateWorkbench
+    qtbase
+    qttools
+    qtwebengine
+    qtxmlpatterns
+    scipy
+    shiboken2
+    soqt
+    swig
+    vtk
+    xercesc
+    zlib
+  ] ++ lib.optionals spaceNavSupport [
+    libspnav
+    qtx11extras
+  ];
+
+  cmakeFlags = [
+    "-Wno-dev" # turns off warnings which otherwise makes it hard to see what is going on
+    "-DBUILD_FLAT_MESH:BOOL=ON"
+    "-DBUILD_QT5=ON"
+    "-DSHIBOKEN_INCLUDE_DIR=${shiboken2}/include"
+    "-DSHIBOKEN_LIBRARY=Shiboken2::libshiboken"
+    ("-DPYSIDE_INCLUDE_DIR=${pyside2}/include"
+      + ";${pyside2}/include/PySide2/QtCore"
+      + ";${pyside2}/include/PySide2/QtWidgets"
+      + ";${pyside2}/include/PySide2/QtGui"
+    )
+    "-DPYSIDE_LIBRARY=PySide2::pyside2"
+  ];
+
+  # This should work on both x86_64, and i686 linux
+  preBuild = ''
+    export NIX_LDFLAGS="-L${gfortran.cc}/lib64 -L${gfortran.cc}/lib $NIX_LDFLAGS";
+  '';
+
+  # Their main() removes PYTHONPATH=, and we rely on it.
+  preConfigure = ''
+    sed '/putenv("PYTHONPATH/d' -i src/Main/MainGui.cpp
+
+    qtWrapperArgs+=(--prefix PYTHONPATH : "$PYTHONPATH")
+  '';
+
+  qtWrapperArgs = [
+    "--set COIN_GL_NO_CURRENT_CONTEXT_CHECK 1"
+    "--prefix PATH : ${libredwg}/bin"
+  ];
+
+  postFixup = ''
+    mv $out/share/doc $out
+    ln -s $out/bin/FreeCAD $out/bin/freecad
+    ln -s $out/bin/FreeCADCmd $out/bin/freecadcmd
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.freecadweb.org/";
+    description = "General purpose Open Source 3D CAD/MCAD/CAx/CAE/PLM modeler";
+    longDescription = ''
+      FreeCAD is an open-source parametric 3D modeler made primarily to design
+      real-life objects of any size. Parametric modeling allows you to easily
+      modify your design by going back into your model history and changing its
+      parameters.
+
+      FreeCAD allows you to sketch geometry constrained 2D shapes and use them
+      as a base to build other objects. It contains many components to adjust
+      dimensions or extract design details from 3D models to create high quality
+      production ready drawings.
+
+      FreeCAD is designed to fit a wide range of uses including product design,
+      mechanical engineering and architecture. Whether you are a hobbyist, a
+      programmer, an experienced CAD user, a student or a teacher, you will feel
+      right at home with FreeCAD.
+    '';
+    license = licenses.lgpl2Plus;
+    maintainers = with maintainers; [ viric gebner AndersonTorres ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/freepv/default.nix b/nixpkgs/pkgs/applications/graphics/freepv/default.nix
new file mode 100644
index 000000000000..bf990c4d0ef8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/freepv/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchurl, libjpeg, libGLU, libGL, freeglut, zlib, cmake, libX11, libxml2, libpng,
+  libXxf86vm }:
+
+stdenv.mkDerivation {
+  name = "freepv-0.3.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/freepv/freepv-0.3.0.tar.gz";
+    sha256 = "1w19abqjn64w47m35alg7bcdl1p97nf11zn64cp4p0dydihmhv56";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ libjpeg libGLU libGL freeglut zlib libX11 libxml2 libpng libXxf86vm ];
+
+  postPatch = ''
+    sed -i -e '/GECKO/d' CMakeLists.txt
+    sed -i -e '/mozilla/d' src/CMakeLists.txt
+    sed -i -e '1i \
+      #include <cstdio>' src/libfreepv/OpenGLRenderer.cpp
+    sed -i -e '1i \
+      #include <cstring>' src/libfreepv/Image.cpp
+    substituteInPlace src/libfreepv/Action.h \
+      --replace NULL nullptr
+    substituteInPlace src/libfreepv/pngReader.cpp \
+      --replace png_set_gray_1_2_4_to_8 png_set_expand_gray_1_2_4_to_8
+  '';
+
+  NIX_CFLAGS_COMPILE = "-fpermissive -Wno-narrowing";
+
+  meta = {
+    description = "Open source panorama viewer using GL";
+    homepage = "http://freepv.sourceforge.net/";
+    license = [ lib.licenses.lgpl21 ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/fstl/default.nix b/nixpkgs/pkgs/applications/graphics/fstl/default.nix
new file mode 100644
index 000000000000..c6b77300cb31
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/fstl/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchFromGitHub, mkDerivation, qtbase, mesa_glu }:
+
+mkDerivation rec {
+  pname = "fstl";
+  version = "0.9.4";
+
+  buildInputs = [qtbase mesa_glu];
+
+  prePatch = ''
+    sed -i "s|/usr/bin|$out/bin|g" qt/fstl.pro
+  '';
+
+  preBuild = ''
+    qmake qt/fstl.pro
+  '';
+
+  postInstall = lib.optionalString stdenv.isDarwin ''
+    mkdir -p $out/Applications
+    mv fstl.app $out/Applications
+  '';
+
+  src = fetchFromGitHub {
+    owner = "mkeeter";
+    repo = "fstl";
+    rev = "v" + version;
+    sha256 = "028hzdv11hgvcpc36q5scf4nw1256qswh37xhfn5a0iv7wycmnif";
+  };
+
+  meta = with lib; {
+    description = "The fastest STL file viewer";
+    homepage = "https://github.com/mkeeter/fstl";
+    license = licenses.mit;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ tweber ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/gcolor2/default.nix b/nixpkgs/pkgs/applications/graphics/gcolor2/default.nix
new file mode 100644
index 000000000000..0e79f981fbc0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/gcolor2/default.nix
@@ -0,0 +1,34 @@
+{lib, stdenv, fetchurl, gtk2, perlPackages, pkg-config } :
+
+let version = "0.4"; in
+stdenv.mkDerivation {
+  pname = "gcolor2";
+  inherit version;
+  arch = if stdenv.hostPlatform.system == "x86_64-linux" then "amd64" else "386";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/gcolor2/gcolor2/${version}/gcolor2-${version}.tar.bz2";
+    sha256 = "1siv54vwx9dbfcflklvf7pkp5lk6h3nn63flg6jzifz9wp0c84q6";
+  };
+
+  preConfigure = ''
+    sed -i 's/\[:space:\]/[&]/g' configure
+  '';
+
+  # from https://github.com/PhantomX/slackbuilds/tree/master/gcolor2/patches
+  patches = if stdenv.hostPlatform.system == "x86_64-linux" then
+        [ ./gcolor2-amd64.patch ] else
+        [ ];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ gtk2 ]
+    ++ (with perlPackages; [ perl XMLParser ]);
+
+  meta = {
+    description = "Simple GTK 2 color selector";
+    homepage = "http://gcolor2.sourceforge.net/";
+    license = lib.licenses.gpl2Plus;
+    maintainers = with lib.maintainers; [ notthemessiah ];
+    platforms = with lib.platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/gcolor2/gcolor2-amd64.patch b/nixpkgs/pkgs/applications/graphics/gcolor2/gcolor2-amd64.patch
new file mode 100644
index 000000000000..cd06a8315f98
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/gcolor2/gcolor2-amd64.patch
@@ -0,0 +1,46 @@
+diff --exclude-from=/home/dang/bin/scripts/diffrc -up -ruN gcolor2-0.4.orig/src/callbacks.c gcolor2-0.4/src/callbacks.c
+--- gcolor2-0.4.orig/src/callbacks.c	2005-07-12 14:06:12.000000000 -0400
++++ gcolor2-0.4/src/callbacks.c	2007-02-17 19:19:38.000000000 -0500
+@@ -4,6 +4,9 @@
+ 
+ #include <gtk/gtk.h>
+ #include <stdio.h>
++#include <string.h>
++#include <glib.h>
++#include <glib/gprintf.h>
+ 
+ #include "callbacks.h"
+ #include "interface.h"
+@@ -172,6 +175,9 @@ void on_copy_color_to_clipboard_activate
+ 	gtk_clipboard_set_text (cb, hex, strlen (hex));
+ }
+ 
++void add_rgb_file (gchar *filename, gchar *type);
++gchar* get_system_file (void);
++
+ void on_show_system_colors_activate (GtkMenuItem *menuitem, gpointer user_data)
+ {
+ 	if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (menuitem)))
+@@ -266,6 +272,8 @@ void on_save_button_clicked (GtkButton *
+ 	gtk_widget_destroy (savedialog);
+ }
+ 
++void add_list_color (gchar *spec, gchar *name, gchar *type, gboolean is_new_color);
++
+ void add_color_to_treeview ()
+ {
+ 	GtkTreeView      *treeview;
+diff --exclude-from=/home/dang/bin/scripts/diffrc -up -ruN gcolor2-0.4.orig/src/main.c gcolor2-0.4/src/main.c
+--- gcolor2-0.4.orig/src/main.c	2005-07-11 10:55:49.000000000 -0400
++++ gcolor2-0.4/src/main.c	2007-02-17 19:18:23.000000000 -0500
+@@ -4,6 +4,10 @@
+ 
+ #include <gtk/gtk.h>
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <glib.h>
++#include <glib/gprintf.h>
+ 
+ #include "interface.h"
+ #include "support.h"
diff --git a/nixpkgs/pkgs/applications/graphics/gcolor3/default.nix b/nixpkgs/pkgs/applications/graphics/gcolor3/default.nix
new file mode 100644
index 000000000000..2771559416bf
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/gcolor3/default.nix
@@ -0,0 +1,51 @@
+{ lib, stdenv
+, fetchFromGitLab
+, meson
+, ninja
+, gettext
+, pkg-config
+, libxml2
+, gtk3
+, libportal
+, wrapGAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gcolor3";
+  version = "2.4.0";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.gnome.org";
+    owner = "World";
+    repo = "gcolor3";
+    rev = "v${version}";
+    sha256 = "rHIAjk2m3Lkz11obgNZaapa1Zr2GDH7XzgzuAJmq+MU=";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    gettext
+    pkg-config
+    libxml2 # xml-stripblanks preprocessing of GResource
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    gtk3
+    libportal
+  ];
+
+  postPatch = ''
+    chmod +x meson_install.sh # patchShebangs requires executable file
+    patchShebangs meson_install.sh
+  '';
+
+  meta = with lib; {
+    description = "A simple color chooser written in GTK3";
+    homepage = "https://gitlab.gnome.org/World/gcolor3";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/geeqie/default.nix b/nixpkgs/pkgs/applications/graphics/geeqie/default.nix
new file mode 100644
index 000000000000..5d44c5dceeac
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/geeqie/default.nix
@@ -0,0 +1,65 @@
+{ lib, stdenv, fetchurl, pkg-config, autoconf, automake, gettext, intltool
+, gtk3, lcms2, exiv2, libchamplain, clutter-gtk, ffmpegthumbnailer, fbida
+, wrapGAppsHook, fetchpatch
+}:
+
+stdenv.mkDerivation rec {
+  pname = "geeqie";
+  version = "1.6.0";
+
+  src = fetchurl {
+    url = "https://github.com/BestImageViewer/geeqie/archive/refs/tags/v1.6.tar.gz";
+    sha256 = "0ky248j6n8hszkwwi949i1ypm2l5444byaspaa6564d9rpij01aj";
+  };
+
+  patches = [
+    # Do not build the changelog as this requires markdown.
+    (fetchpatch {
+      name = "geeqie-1.4-goodbye-changelog.patch";
+      url = "https://src.fedoraproject.org/rpms/geeqie/raw/132fb04a1a5e74ddb333d2474f7edb9a39dc8d27/f/geeqie-1.4-goodbye-changelog.patch";
+      sha256 = "00a35dds44kjjdqsbbfk0x9y82jspvsbpm2makcm1ivzlhjjgszn";
+    })
+  ];
+
+  preConfigure = "./autogen.sh";
+
+  nativeBuildInputs =
+    [ pkg-config autoconf automake gettext intltool
+      wrapGAppsHook
+    ];
+
+  buildInputs = [
+    gtk3 lcms2 exiv2 libchamplain clutter-gtk ffmpegthumbnailer fbida
+  ];
+
+  postInstall = ''
+    # Allow geeqie to find exiv2 and exiftran, necessary to
+    # losslessly rotate JPEG images.
+    sed -i $out/lib/geeqie/geeqie-rotate \
+        -e '1 a export PATH=${lib.makeBinPath [ exiv2 fbida ]}:$PATH'
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Lightweight GTK based image viewer";
+
+    longDescription =
+      ''
+        Geeqie is a lightweight GTK based image viewer for Unix like
+        operating systems.  It features: EXIF, IPTC and XMP metadata
+        browsing and editing interoperability; easy integration with other
+        software; geeqie works on files and directories, there is no need to
+        import images; fast preview for many raw image formats; tools for
+        image comparison, sorting and managing photo collection.  Geeqie was
+        initially based on GQview.
+      '';
+
+    license = licenses.gpl2Plus;
+
+    homepage = "http://geeqie.sourceforge.net";
+
+    maintainers = with maintainers; [ jfrankenau pSub markus1189 ];
+    platforms = platforms.gnu ++ platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/gimp/default.nix b/nixpkgs/pkgs/applications/graphics/gimp/default.nix
new file mode 100644
index 000000000000..08d3f122aab5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/gimp/default.nix
@@ -0,0 +1,184 @@
+{ stdenv
+, lib
+, fetchurl
+, substituteAll
+, autoreconfHook
+, pkg-config
+, intltool
+, babl
+, gegl
+, gtk2
+, glib
+, gdk-pixbuf
+, isocodes
+, pango
+, cairo
+, freetype
+, fontconfig
+, lcms
+, libpng
+, libjpeg
+, poppler
+, poppler_data
+, libtiff
+, libmng
+, librsvg
+, libwmf
+, zlib
+, libzip
+, ghostscript
+, aalib
+, shared-mime-info
+, python2
+, libexif
+, gettext
+, makeWrapper
+, gtk-doc
+, xorg
+, glib-networking
+, libmypaint
+, gexiv2
+, harfbuzz
+, mypaint-brushes1
+, libwebp
+, libheif
+, libgudev
+, openexr
+, AppKit
+, Cocoa
+, gtk-mac-integration-gtk2
+}:
+
+let
+  python = python2.withPackages (pp: [ pp.pygtk ]);
+in stdenv.mkDerivation rec {
+  pname = "gimp";
+  version = "2.10.24";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "http://download.gimp.org/pub/gimp/v${lib.versions.majorMinor version}/${pname}-${version}.tar.bz2";
+    sha256 = "17lq6ns5qhspd171zqh76yf98xnn5n0hcl7hbhbx63cc6ribf6xx";
+  };
+
+  patches = [
+    # to remove compiler from the runtime closure, reference was retained via
+    # gimp --version --verbose output
+    (substituteAll {
+      src = ./remove-cc-reference.patch;
+      cc_version = stdenv.cc.cc.name;
+    })
+
+    # Use absolute paths instead of relying on PATH
+    # to make sure plug-ins are loaded by the correct interpreter.
+    ./hardcode-plugin-interpreters.patch
+  ];
+
+  nativeBuildInputs = [
+    autoreconfHook # hardcode-plugin-interpreters.patch changes Makefile.am
+    pkg-config
+    intltool
+    gettext
+    makeWrapper
+    gtk-doc
+  ];
+
+  buildInputs = [
+    babl
+    gegl
+    gtk2
+    glib
+    gdk-pixbuf
+    pango
+    cairo
+    gexiv2
+    harfbuzz
+    isocodes
+    freetype
+    fontconfig
+    lcms
+    libpng
+    libjpeg
+    poppler
+    poppler_data
+    libtiff
+    openexr
+    libmng
+    librsvg
+    libwmf
+    zlib
+    libzip
+    ghostscript
+    aalib
+    shared-mime-info
+    libwebp
+    libheif
+    python
+    libexif
+    xorg.libXpm
+    glib-networking
+    libmypaint
+    mypaint-brushes1
+  ] ++ lib.optionals stdenv.isDarwin [
+    AppKit
+    Cocoa
+    gtk-mac-integration-gtk2
+  ] ++ lib.optionals stdenv.isLinux [
+    libgudev
+  ];
+
+  # needed by gimp-2.0.pc
+  propagatedBuildInputs = [
+    gegl
+  ];
+
+  configureFlags = [
+    "--without-webkit" # old version is required
+    "--disable-check-update"
+    "--with-bug-report-url=https://github.com/NixOS/nixpkgs/issues/new"
+    "--with-icc-directory=/run/current-system/sw/share/color/icc"
+    # fix libdir in pc files (${exec_prefix} needs to be passed verbatim)
+    "--libdir=\${exec_prefix}/lib"
+  ];
+
+  enableParallelBuilding = true;
+
+  # on Darwin,
+  # test-eevl.c:64:36: error: initializer element is not a compile-time constant
+  doCheck = !stdenv.isDarwin;
+
+  # Check if librsvg was built with --disable-pixbuf-loader.
+  PKG_CONFIG_GDK_PIXBUF_2_0_GDK_PIXBUF_MODULEDIR = "${librsvg}/${gdk-pixbuf.moduleDir}";
+
+  preConfigure = ''
+    # The check runs before glib-networking is registered
+    export GIO_EXTRA_MODULES="${glib-networking}/lib/gio/modules:$GIO_EXTRA_MODULES"
+  '';
+
+  postFixup = ''
+    wrapProgram $out/bin/gimp-${lib.versions.majorMinor version} \
+      --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE"
+  '';
+
+  passthru = rec {
+    # The declarations for `gimp-with-plugins` wrapper,
+    # used for determining plug-in installation paths
+    majorVersion = "${lib.versions.major version}.0";
+    targetLibDir = "lib/gimp/${majorVersion}";
+    targetDataDir = "share/gimp/${majorVersion}";
+    targetPluginDir = "${targetLibDir}/plug-ins";
+    targetScriptDir = "${targetDataDir}/scripts";
+
+    # probably its a good idea to use the same gtk in plugins ?
+    gtk = gtk2;
+  };
+
+  meta = with lib; {
+    description = "The GNU Image Manipulation Program";
+    homepage = "https://www.gimp.org/";
+    maintainers = with maintainers; [ jtojnar ];
+    license = licenses.gpl3Plus;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/gimp/hardcode-plugin-interpreters.patch b/nixpkgs/pkgs/applications/graphics/gimp/hardcode-plugin-interpreters.patch
new file mode 100644
index 000000000000..1528404c31d2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/gimp/hardcode-plugin-interpreters.patch
@@ -0,0 +1,11 @@
+--- a/plug-ins/pygimp/Makefile.am
++++ b/plug-ins/pygimp/Makefile.am
+@@ -157,7 +157,7 @@ install-interp-file:
+ 	echo 'python=$(PYBIN_PATH)' > '$(DESTDIR)$(pyinterpfile)'
+ 	echo 'python2=$(PYBIN_PATH)' >> '$(DESTDIR)$(pyinterpfile)'
+ 	echo '/usr/bin/python=$(PYBIN_PATH)' >> '$(DESTDIR)$(pyinterpfile)'
+-	echo ":Python:E::py::`basename $(PYTHON)`:" >> '$(DESTDIR)$(pyinterpfile)'
++	echo ":Python:E::py::$(PYTHON):" >> '$(DESTDIR)$(pyinterpfile)'
+ 
+ install-data-local: install-env-file install-interp-file
+ 
diff --git a/nixpkgs/pkgs/applications/graphics/gimp/plugins/default.nix b/nixpkgs/pkgs/applications/graphics/gimp/plugins/default.nix
new file mode 100644
index 000000000000..1715542adce4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/gimp/plugins/default.nix
@@ -0,0 +1,261 @@
+# Use `gimp-with-plugins` package for GIMP with all plug-ins.
+# If you just want a subset of plug-ins, you can specify them explicitly:
+# `gimp-with-plugins.override { plugins = with gimpPlugins; [ gap ]; }`.
+
+{ config, lib, pkgs }:
+
+let
+  inherit (pkgs) stdenv fetchurl pkg-config intltool glib fetchFromGitHub;
+in
+
+lib.makeScope pkgs.newScope (self:
+
+let
+  # Use GIMP from the scope.
+  inherit (self) gimp;
+
+  pluginDerivation = attrs: let
+    name = attrs.name or "${attrs.pname}-${attrs.version}";
+  in stdenv.mkDerivation ({
+    prePhases = "extraLib";
+    extraLib = ''
+      installScripts(){
+        mkdir -p $out/${gimp.targetScriptDir}/${name};
+        for p in "$@"; do cp "$p" -r $out/${gimp.targetScriptDir}/${name}; done
+      }
+      installPlugin() {
+        # The base name of the first argument is the plug-in name and the main executable.
+        # GIMP only allows a single plug-in per directory:
+        # https://gitlab.gnome.org/GNOME/gimp/-/commit/efae55a73e98389e38fa0e59ebebcda0abe3ee96
+        pluginDir=$out/${gimp.targetPluginDir}/$(basename "$1")
+        install -Dt "$pluginDir" "$@"
+      }
+    '';
+
+    # Override installation paths.
+    PKG_CONFIG_GIMP_2_0_GIMPLIBDIR = "${placeholder "out"}/${gimp.targetLibDir}";
+    PKG_CONFIG_GIMP_2_0_GIMPDATADIR = "${placeholder "out"}/${gimp.targetDataDir}";
+  }
+  // attrs
+  // {
+      name = "${gimp.pname}-plugin-${name}";
+      buildInputs = [
+        gimp
+        gimp.gtk
+        glib
+      ] ++ (attrs.buildInputs or []);
+
+      nativeBuildInputs = [
+        pkg-config
+        intltool
+      ] ++ (attrs.nativeBuildInputs or []);
+    }
+  );
+
+  scriptDerivation = {src, ...}@attrs : pluginDerivation ({
+    prePhases = "extraLib";
+    dontUnpack = true;
+    installPhase = ''
+      runHook preInstall
+      installScripts ${src}
+      runHook postInstall
+    '';
+  } // attrs);
+in
+{
+  # Allow overriding GIMP package in the scope.
+  inherit (pkgs) gimp;
+
+  gap = pluginDerivation {
+    /* menu:
+       Video
+    */
+    name = "gap-2.6.0";
+    src = fetchurl {
+      url = "https://ftp.gimp.org/pub/gimp/plug-ins/v2.6/gap/gimp-gap-2.6.0.tar.bz2";
+      sha256 = "1jic7ixcmsn4kx2cn32nc5087rk6g8xsrz022xy11yfmgvhzb0ql";
+    };
+    NIX_LDFLAGS = "-lm";
+    hardeningDisable = [ "format" ];
+    meta = with lib; {
+      description = "The GIMP Animation Package";
+      homepage = "https://www.gimp.org";
+      # The main code is given in GPLv3, but it has ffmpeg in it, and I think ffmpeg license
+      # falls inside "free".
+      license = with licenses; [ gpl3 free ];
+    };
+  };
+
+  farbfeld = pluginDerivation rec {
+    pname = "farbfeld";
+    version = "unstable-2019-08-12";
+
+    src = fetchFromGitHub {
+      owner = "ids1024";
+      repo = "gimp-farbfeld";
+      rev = "5feacebf61448bd3c550dda03cd08130fddc5af4";
+      sha256 = "1vmw7k773vrndmfffj0m503digdjmkpcqy2r3p3i5x0qw9vkkkc6";
+    };
+
+    installPhase = ''
+      installPlugin farbfeld
+    '';
+
+    meta = {
+      description = "Gimp plug-in for the farbfeld image format";
+      homepage = "https://github.com/ids1024/gimp-farbfeld";
+      license = lib.licenses.mit;
+      maintainers = with lib.maintainers; [ sikmir ];
+    };
+  };
+
+  fourier = pluginDerivation rec {
+    /* menu:
+       Filters/Generic/FFT Forward
+       Filters/Generic/FFT Inverse
+    */
+    pname = "fourier";
+    version = "0.4.3";
+
+    src = fetchurl {
+      url = "https://www.lprp.fr/files/old-web/soft/gimp/${pname}-${version}.tar.gz";
+      sha256 = "0mf7f8vaqs2madx832x3kcxw3hv3w3wampvzvaps1mkf2kvrjbsn";
+    };
+
+    buildInputs = with pkgs; [ fftw ];
+
+    postPatch = ''
+      # The tarball contains a prebuilt binary.
+      make clean
+    '';
+
+    installPhase = ''
+      runHook preInstall
+
+      installPlugin fourier
+
+      runHook postInstall
+    '';
+
+    meta = with lib; {
+      description = "GIMP plug-in to do the fourier transform";
+      homepage = "https://people.via.ecp.fr/~remi/soft/gimp/gimp_plugin_en.php3#fourier";
+      license = with licenses; [ gpl3Plus ];
+    };
+  };
+
+  resynthesizer = pluginDerivation rec {
+    /* menu:
+      Edit/Fill with pattern seamless...
+      Filters/Enhance/Heal selection...
+      Filters/Enhance/Heal transparency...
+      Filters/Enhance/Sharpen by synthesis...
+      Filters/Enhance/Uncrop...
+      Filters/Map/Style...
+      Filters/Render/Texture...
+    */
+    pname = "resynthesizer";
+    version = "2.0.3";
+    buildInputs = with pkgs; [ fftw ];
+    nativeBuildInputs = with pkgs; [ autoreconfHook ];
+    makeFlags = [ "GIMP_LIBDIR=${placeholder "out"}/${gimp.targetLibDir}" ];
+    src = fetchFromGitHub {
+      owner = "bootchk";
+      repo = "resynthesizer";
+      rev = "v${version}";
+      sha256 = "1jwc8bhhm21xhrgw56nzbma6fwg59gc8anlmyns7jdiw83y0zx3j";
+    };
+  };
+
+  texturize = pluginDerivation {
+    name = "texturize-2.2.2017-07-28";
+    src = fetchFromGitHub {
+      owner = "lmanul";
+      repo = "gimp-texturize";
+      rev = "de4367f71e40fe6d82387eaee68611a80a87e0e1";
+      sha256 = "1zzvbczly7k456c0y6s92a1i8ph4ywmbvdl8i4rcc29l4qd2z8fw";
+    };
+    installPhase = "installPlugin src/texturize";
+    meta.broken = true; # https://github.com/lmanul/gimp-texturize/issues/1
+  };
+
+  waveletSharpen = pluginDerivation {
+    /* menu:
+      Filters/Enhance/Wavelet sharpen
+    */
+    name = "wavelet-sharpen-0.1.2";
+    NIX_LDFLAGS = "-lm";
+    src = fetchurl {
+      url = "https://github.com/pixlsus/registry.gimp.org_static/raw/master/registry.gimp.org/files/wavelet-sharpen-0.1.2.tar.gz";
+      sha256 = "0vql1k67i21g5ivaa1jh56rg427m0icrkpryrhg75nscpirfxxqw";
+    };
+    installPhase = "installPlugin src/wavelet-sharpen"; # TODO translations are not copied .. How to do this on nix?
+  };
+
+  lqrPlugin = pluginDerivation rec {
+    /* menu:
+       Layer/Liquid Rescale
+    */
+    pname = "lqr-plugin";
+    version = "0.7.2";
+    buildInputs = with pkgs; [ liblqr1 ];
+    src = fetchFromGitHub {
+      owner = "carlobaldassi";
+      repo = "gimp-lqr-plugin";
+      rev = "v${version}";
+      sha256 = "81ajdZ2zQi/THxnBlSeT36tVTEzrS1YqLGpHMhFTKAo=";
+    };
+  };
+
+  gmic = pkgs.gmic-qt.override {
+    variant = "gimp";
+  };
+
+  gimplensfun = pluginDerivation rec {
+    version = "unstable-2018-10-21";
+    name = "gimplensfun-${version}";
+
+    src = fetchFromGitHub {
+      owner = "seebk";
+      repo = "GIMP-Lensfun";
+      rev = "1c5a5c1534b5faf098b7441f8840d22835592f17";
+      sha256 = "1jj3n7spkjc63aipwdqsvq9gi07w13bb1v8iqzvxwzld2kxa3c8w";
+    };
+
+    buildInputs = with pkgs; [ lensfun gexiv2 ];
+
+    installPhase = "
+      installPlugin gimp-lensfun
+    ";
+
+    meta = {
+      description = "GIMP plugin to correct lens distortion using the lensfun library and database";
+
+      homepage = "http://lensfun.sebastiankraft.net/";
+
+      license = lib.licenses.gpl3Plus;
+      maintainers = [ ];
+      platforms = lib.platforms.gnu ++ lib.platforms.linux;
+    };
+  };
+
+  /* =============== simple script files ==================== */
+
+  # also have a look at enblend-enfuse in all-packages.nix
+  exposureBlend = scriptDerivation {
+    name = "exposure-blend";
+    src = fetchurl {
+      url = "http://tir.astro.utoledo.edu/jdsmith/code/eb/exposure-blend.scm";
+      sha256 = "1b6c9wzpklqras4wwsyw3y3jp6fjmhnnskqiwm5sabs8djknfxla";
+    };
+    meta.broken = true;
+  };
+
+  lightning = scriptDerivation {
+    name = "Lightning";
+    src = fetchurl {
+      url = "https://github.com/pixlsus/registry.gimp.org_static/raw/master/registry.gimp.org/files/Lightning.scm";
+      sha256 = "c14a8f4f709695ede3f77348728a25b3f3ded420da60f3f8de3944b7eae98a49";
+    };
+  };
+})
diff --git a/nixpkgs/pkgs/applications/graphics/gimp/plugins/patches/focusblur-glib.patch b/nixpkgs/pkgs/applications/graphics/gimp/plugins/patches/focusblur-glib.patch
new file mode 100644
index 000000000000..b1079ab36604
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/gimp/plugins/patches/focusblur-glib.patch
@@ -0,0 +1,200 @@
+ls diff --git focusblur-3.2.6/src/aaa.h focusblur-3.2.6/src/aaa.h
+index 4a6d90b..c74cab2 100644
+--- focusblur-3.2.6/src/aaa.h
++++ focusblur-3.2.6/src/aaa.h
+@@ -19,8 +19,7 @@
+ #ifndef __AAA_H__
+ #define __AAA_H__
+ 
+-#include <glib/gmacros.h>
+-#include <glib/gtypes.h>
++#include <glib.h>
+ 
+ 
+ G_BEGIN_DECLS
+diff --git focusblur-3.2.6/src/brush.h focusblur-3.2.6/src/brush.h
+index 685b253..8778fec 100644
+--- focusblur-3.2.6/src/brush.h
++++ focusblur-3.2.6/src/brush.h
+@@ -22,7 +22,7 @@
+ #ifndef __FOCUSBLUR_BRUSH_H__
+ #define __FOCUSBLUR_BRUSH_H__
+ 
+-#include <glib/gtypes.h>
++#include <glib.h>
+ #include "focusblurtypes.h"
+ 
+ G_BEGIN_DECLS
+diff --git focusblur-3.2.6/src/depthmap.h focusblur-3.2.6/src/depthmap.h
+index 78f5e99..baee540 100644
+--- focusblur-3.2.6/src/depthmap.h
++++ focusblur-3.2.6/src/depthmap.h
+@@ -22,7 +22,7 @@
+ #ifndef __FOCUSBLUR_DEPTHMAP_H__
+ #define __FOCUSBLUR_DEPTHMAP_H__
+ 
+-#include <glib/gtypes.h>
++#include <glib.h>
+ 
+ #include "focusblurtypes.h"
+ #include "focusblurenums.h"
+diff --git focusblur-3.2.6/src/diffusion.h focusblur-3.2.6/src/diffusion.h
+index 07ffe4b..3c1e4b9 100644
+--- focusblur-3.2.6/src/diffusion.h
++++ focusblur-3.2.6/src/diffusion.h
+@@ -23,7 +23,7 @@
+ #define __FOCUSBLUR_DIFFUSION_H__
+ 
+ 
+-#include <glib/gtypes.h>
++#include <glib.h>
+ 
+ #include "focusblur.h"
+ #include "focusblurtypes.h"
+diff --git focusblur-3.2.6/src/fftblur.h focusblur-3.2.6/src/fftblur.h
+index 124bcba..cd809fa 100644
+--- focusblur-3.2.6/src/fftblur.h
++++ focusblur-3.2.6/src/fftblur.h
+@@ -23,8 +23,7 @@
+ #define __FOCUSBLUR_FFTBLUR_H__
+ 
+ 
+-#include <glib/gmacros.h>
+-#include <glib/gtypes.h>
++#include <glib.h>
+ #include <libgimpwidgets/gimpwidgetstypes.h>
+ 
+ #include "focusblurparam.h"
+diff --git focusblur-3.2.6/src/fftblurbuffer.h focusblur-3.2.6/src/fftblurbuffer.h
+index b34d682..42e6380 100644
+--- focusblur-3.2.6/src/fftblurbuffer.h
++++ focusblur-3.2.6/src/fftblurbuffer.h
+@@ -28,8 +28,7 @@
+ #endif
+ #include <fftw3.h>
+ 
+-#include <glib/gmacros.h>
+-#include <glib/gtypes.h>
++#include <glib.h>
+ #include <gtk/gtkstyle.h>
+ #include <libgimp/gimptypes.h>
+ #include <libgimpwidgets/gimpwidgetstypes.h>
+diff --git focusblur-3.2.6/src/fftblurproc.h focusblur-3.2.6/src/fftblurproc.h
+index 495572d..10a34f4 100644
+--- focusblur-3.2.6/src/fftblurproc.h
++++ focusblur-3.2.6/src/fftblurproc.h
+@@ -23,8 +23,7 @@
+ #define __FOCUSBLUR_FFTBLUR_PROC_H__
+ 
+ 
+-#include <glib/gmacros.h>
+-#include <glib/gtypes.h>
++#include <glib.h>
+ 
+ #include "focusblurtypes.h"
+ 
+diff --git focusblur-3.2.6/src/focusblur.h focusblur-3.2.6/src/focusblur.h
+index 54ca40a..d7e13a6 100644
+--- focusblur-3.2.6/src/focusblur.h
++++ focusblur-3.2.6/src/focusblur.h
+@@ -22,7 +22,7 @@
+ #ifndef __FOCUSBLUR_H__
+ #define __FOCUSBLUR_H__
+ 
+-#include <glib/gmacros.h>
++#include <glib.h>
+ 
+ G_BEGIN_DECLS
+ 
+diff --git focusblur-3.2.6/src/focusblurparam.h focusblur-3.2.6/src/focusblurparam.h
+index 64c887b..32865b4 100644
+--- focusblur-3.2.6/src/focusblurparam.h
++++ focusblur-3.2.6/src/focusblurparam.h
+@@ -22,8 +22,7 @@
+ #ifndef __FOCUSBLUR_PARAM_H__
+ #define __FOCUSBLUR_PARAM_H__
+ 
+-#include <glib/gmacros.h>
+-#include <glib/gtypes.h>
++#include <glib.h>
+ #include <gtk/gtkstyle.h>
+ #include <libgimp/gimptypes.h>
+ 
+diff --git focusblur-3.2.6/src/focusblurstock.h focusblur-3.2.6/src/focusblurstock.h
+index 15f3603..cfc0567 100644
+--- focusblur-3.2.6/src/focusblurstock.h
++++ focusblur-3.2.6/src/focusblurstock.h
+@@ -22,7 +22,7 @@
+ #ifndef __FOCUSBLUR_STOCK_H__
+ #define __FOCUSBLUR_STOCK_H__
+ 
+-#include <glib/gtypes.h>
++#include <glib.h>
+ 
+ G_BEGIN_DECLS
+ 
+diff --git focusblur-3.2.6/src/focusblurtypes.h focusblur-3.2.6/src/focusblurtypes.h
+index 0954c60..1531c84 100644
+--- focusblur-3.2.6/src/focusblurtypes.h
++++ focusblur-3.2.6/src/focusblurtypes.h
+@@ -22,7 +22,7 @@
+ #ifndef __FOCUSBLUR_TYPES_H__
+ #define __FOCUSBLUR_TYPES_H__
+ 
+-#include <glib/gmacros.h>
++#include <glib.h>
+ 
+ 
+ G_BEGIN_DECLS
+diff --git focusblur-3.2.6/src/interface.h focusblur-3.2.6/src/interface.h
+index 6defd27..e819c60 100644
+--- focusblur-3.2.6/src/interface.h
++++ focusblur-3.2.6/src/interface.h
+@@ -22,7 +22,7 @@
+ #ifndef __FOCUSBLUR_INTERFACE_H__
+ #define __FOCUSBLUR_INTERFACE_H__
+ 
+-#include <glib/gtypes.h>
++#include <glib.h>
+ 
+ #include "focusblurtypes.h"
+ 
+diff --git focusblur-3.2.6/src/render.h focusblur-3.2.6/src/render.h
+index febbd24..a501f1e 100644
+--- focusblur-3.2.6/src/render.h
++++ focusblur-3.2.6/src/render.h
+@@ -24,7 +24,7 @@
+ 
+ #include "config.h"
+ 
+-#include <glib/gtypes.h>
++#include <glib.h>
+ //#include <libgimp/gimp.h>
+ #include <libgimp/gimpui.h>
+ 
+diff --git focusblur-3.2.6/src/shine.h focusblur-3.2.6/src/shine.h
+index c5a3621..86b4c09 100644
+--- focusblur-3.2.6/src/shine.h
++++ focusblur-3.2.6/src/shine.h
+@@ -22,7 +22,7 @@
+ #ifndef __FOCUSBLUR_SHINE_H__
+ #define __FOCUSBLUR_SHINE_H__
+ 
+-#include <glib/gtypes.h>
++#include <glib.h>
+ #include <libgimp/gimptypes.h>
+ 
+ #include "focusblurtypes.h"
+diff --git focusblur-3.2.6/src/source.h focusblur-3.2.6/src/source.h
+index 50d34ca..8eec35c 100644
+--- focusblur-3.2.6/src/source.h
++++ focusblur-3.2.6/src/source.h
+@@ -24,7 +24,7 @@
+ 
+ #include "config.h"
+ 
+-#include <glib/gtypes.h>
++#include <glib.h>
+ #include <libgimp/gimptypes.h>
+ 
+ #include "focusblurtypes.h"
diff --git a/nixpkgs/pkgs/applications/graphics/gimp/remove-cc-reference.patch b/nixpkgs/pkgs/applications/graphics/gimp/remove-cc-reference.patch
new file mode 100644
index 000000000000..20c350bdaea1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/gimp/remove-cc-reference.patch
@@ -0,0 +1,13 @@
+diff --git a/app/gimp-version.c b/app/gimp-version.c
+index 3d1894a036..48bb670b64 100644
+--- a/app/gimp-version.c
++++ b/app/gimp-version.c
+@@ -230,7 +230,7 @@ gimp_version (gboolean be_verbose,
+                                       GIMP_BUILD_ID,
+                                       gimp_version_get_revision (),
+                                       GIMP_BUILD_PLATFORM_FAMILY,
+-                                      CC_VERSION,
++                                      "@cc_version@",
+                                       lib_versions);
+       g_free (lib_versions);
+ 
diff --git a/nixpkgs/pkgs/applications/graphics/gimp/wrapper.nix b/nixpkgs/pkgs/applications/graphics/gimp/wrapper.nix
new file mode 100644
index 000000000000..679e9136c44a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/gimp/wrapper.nix
@@ -0,0 +1,29 @@
+{ lib, symlinkJoin, gimp, makeWrapper, gimpPlugins, gnome, plugins ? null}:
+
+let
+allPlugins = lib.filter (pkg: lib.isDerivation pkg && !pkg.meta.broken or false) (lib.attrValues gimpPlugins);
+selectedPlugins = lib.filter (pkg: pkg != gimpPlugins.gimp) (if plugins == null then allPlugins else plugins);
+extraArgs = map (x: x.wrapArgs or "") selectedPlugins;
+versionBranch = lib.versions.majorMinor gimp.version;
+
+in symlinkJoin {
+  name = "gimp-with-plugins-${gimp.version}";
+
+  paths = [ gimp ] ++ selectedPlugins;
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  postBuild = ''
+    for each in gimp-${versionBranch} gimp-console-${versionBranch}; do
+      wrapProgram $out/bin/$each \
+        --set GIMP2_PLUGINDIR "$out/lib/gimp/2.0" \
+        --set GIMP2_DATADIR "$out/share/gimp/2.0" \
+        --prefix GTK_PATH : "${gnome.gnome-themes-extra}/lib/gtk-2.0" \
+        ${toString extraArgs}
+    done
+    set +x
+    for each in gimp gimp-console; do
+      ln -sf "$each-${versionBranch}" $out/bin/$each
+    done
+  '';
+}
diff --git a/nixpkgs/pkgs/applications/graphics/glabels/default.nix b/nixpkgs/pkgs/applications/graphics/glabels/default.nix
new file mode 100644
index 000000000000..c2ce2840379c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/glabels/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchurl, barcode, gnome, autoreconfHook
+, gtk3, gtk-doc, libxml2, librsvg , libtool, libe-book, gsettings-desktop-schemas
+, intltool, itstool, makeWrapper, pkg-config, yelp-tools
+}:
+
+stdenv.mkDerivation rec {
+  pname = "glabels";
+  version = "3.4.1";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0f2rki8i27pkd9r0gz03cdl1g4vnmvp0j49nhxqn275vi8lmgr0q";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config makeWrapper intltool ];
+  buildInputs = [
+    barcode gtk3 gtk-doc yelp-tools
+    gnome.gnome-common gsettings-desktop-schemas
+    itstool libxml2 librsvg libe-book libtool
+  ];
+
+  preFixup = ''
+    wrapProgram "$out/bin/glabels-3" \
+      --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "none";
+    };
+  };
+
+  meta = with lib; {
+    description = "Create labels and business cards";
+    homepage = "https://glabels.org/";
+    license = with licenses; [ gpl3Plus lgpl3Plus ];
+    platforms = platforms.unix;
+    maintainers = [ maintainers.nico202 ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/glimpse/default.nix b/nixpkgs/pkgs/applications/graphics/glimpse/default.nix
new file mode 100644
index 000000000000..01271f53b572
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/glimpse/default.nix
@@ -0,0 +1,199 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, substituteAll
+, pkg-config
+, intltool
+, babl
+, gegl
+, gtk2
+, glib
+, gdk-pixbuf
+, isocodes
+, pango
+, cairo
+, freetype
+, fontconfig
+, lcms
+, libpng
+, libjpeg
+, poppler
+, poppler_data
+, libtiff
+, libmng
+, librsvg
+, libwmf
+, zlib
+, libzip
+, ghostscript
+, aalib
+, shared-mime-info
+, python2
+, libexif
+, gettext
+, xorg
+, glib-networking
+, libmypaint
+, gexiv2
+, harfbuzz
+, mypaint-brushes1
+, libwebp
+, libheif
+, libgudev
+, openexr
+, AppKit
+, Cocoa
+, gtk-mac-integration-gtk2
+, libxslt
+, automake
+, autoconf
+, libtool
+, makeWrapper
+, autoreconfHook
+, gtk-doc
+, graphviz
+}:
+let
+  python = python2.withPackages (pp: [ pp.pygtk ]);
+in
+stdenv.mkDerivation rec {
+  pname = "glimpse";
+  version = "0.2.0";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchFromGitHub {
+    owner = "glimpse-editor";
+    repo = "Glimpse";
+    rev = "v${version}";
+    sha256 = "sha256-qbZQmAo7fuJWWbn0QTyxAwAenZOdsGueUq5/3IV8Njc=";
+  };
+
+  patches = [
+    # to remove compiler from the runtime closure, reference was retained via
+    # gimp --version --verbose output
+    (substituteAll {
+      src = ./remove-cc-reference.patch;
+      cc_version = stdenv.cc.cc.name;
+    })
+    ../gimp/hardcode-plugin-interpreters.patch
+  ];
+
+  postPatch = ''
+    ln -s ${gtk-doc}/share/gtk-doc/data/gtk-doc.make .
+  '';
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+    intltool
+    gettext
+    automake
+    autoconf
+    makeWrapper
+    gtk-doc
+    libxslt
+    libtool
+  ];
+
+  buildInputs = [
+    babl
+    gegl
+    gtk2
+    glib
+    gdk-pixbuf
+    pango
+    cairo
+    gexiv2
+    harfbuzz
+    isocodes
+    freetype
+    fontconfig
+    lcms
+    libpng
+    libjpeg
+    poppler
+    poppler_data
+    libtiff
+    openexr
+    libmng
+    librsvg
+    libwmf
+    zlib
+    libzip
+    ghostscript
+    aalib
+    shared-mime-info
+    libwebp
+    libheif
+    python
+    libexif
+    xorg.libXpm
+    glib-networking
+    libmypaint
+    mypaint-brushes1
+  ] ++ lib.optionals stdenv.isDarwin [
+    AppKit
+    Cocoa
+    gtk-mac-integration-gtk2
+  ] ++ lib.optionals stdenv.isLinux [
+    libgudev
+  ];
+
+  # needed by gimp-2.0.pc
+  propagatedBuildInputs = [
+    gegl
+  ];
+
+  # Check if librsvg was built with --disable-pixbuf-loader.
+  PKG_CONFIG_GDK_PIXBUF_2_0_GDK_PIXBUF_MODULEDIR = "${librsvg}/${gdk-pixbuf.moduleDir}";
+
+  preAutoreconf = ''
+    # The check runs before glib-networking is registered
+    export GIO_EXTRA_MODULES="${glib-networking}/lib/gio/modules:$GIO_EXTRA_MODULES"
+  '';
+
+  postFixup = ''
+    wrapProgram $out/bin/glimpse-${lib.versions.majorMinor version} \
+      --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \
+      --prefix PATH ":" ${ lib.makeBinPath [ graphviz ] }
+  '';
+
+  passthru = rec {
+    # The declarations for `glimpse-with-plugins` wrapper,
+    # used for determining plug-in installation paths
+    majorVersion = "2.0";
+    targetPluginDir = "lib/glimpse/${majorVersion}/plug-ins";
+    targetScriptDir = "share/glimpse/${majorVersion}/scripts";
+    targetDataDir = "share/gimp/${majorVersion}";
+    targetLibDir = "lib/gimp/${majorVersion}";
+
+    # probably its a good idea to use the same gtk in plugins ?
+    gtk = gtk2;
+  };
+
+  configureFlags = [
+    "--without-webkit" # old version is required
+    "--with-bug-report-url=https://github.com/NixOS/nixpkgs/issues/new"
+    "--with-icc-directory=/run/current-system/sw/share/color/icc"
+    # fix libdir in pc files (${exec_prefix} needs to be passed verbatim)
+    "--libdir=\${exec_prefix}/lib"
+  ];
+
+  # on Darwin,
+  # test-eevl.c:64:36: error: initializer element is not a compile-time constant
+  doCheck = !stdenv.isDarwin;
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "An open source image editor based on the GNU Image Manipulation Program";
+    longDescription = ''
+      Glimpse is an open source image editor based on the GNU Image Manipulation Program (GIMP). The goal is to experiment with new ideas and expand the use of free software.
+    '';
+    homepage = "https://glimpse-editor.org";
+    maintainers = with maintainers; [ ashkitten erictapen ];
+    license = licenses.gpl3Plus;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/glimpse/plugins/default.nix b/nixpkgs/pkgs/applications/graphics/glimpse/plugins/default.nix
new file mode 100644
index 000000000000..48c65c3d5646
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/glimpse/plugins/default.nix
@@ -0,0 +1,11 @@
+# Use `glimpse-with-plugins` package for Glimpse with all plug-ins.
+# If you just want a subset of plug-ins, you can specify them explicitly:
+# `glimpse-with-plugins.override { plugins = with glimpsePlugins; [ gap ]; }`.
+
+{ gimpPlugins, glimpse }:
+
+# This attrs can be extended in the future if there happen to be glimpse-only
+# plugins or some that need further modification in order to work with Glimpse.
+gimpPlugins.overrideScope' (self: super: {
+  gimp = glimpse;
+})
diff --git a/nixpkgs/pkgs/applications/graphics/glimpse/remove-cc-reference.patch b/nixpkgs/pkgs/applications/graphics/glimpse/remove-cc-reference.patch
new file mode 100644
index 000000000000..e63bf88dfdd7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/glimpse/remove-cc-reference.patch
@@ -0,0 +1,13 @@
+diff --git a/app/gimp-version.c b/app/gimp-version.c
+index b584398231..1b40a1570f 100644
+--- a/app/gimp-version.c
++++ b/app/gimp-version.c
+@@ -230,7 +230,7 @@ gimp_version (gboolean be_verbose,
+                                       GIMP_BUILD_ID,
+                                       gimp_version_get_revision (),
+                                       GIMP_BUILD_PLATFORM_FAMILY,
+-                                      CC_VERSION,
++                                      "@cc_version@",
+                                       lib_versions);
+       g_free (lib_versions);
+ 
diff --git a/nixpkgs/pkgs/applications/graphics/glimpse/wrapper.nix b/nixpkgs/pkgs/applications/graphics/glimpse/wrapper.nix
new file mode 100644
index 000000000000..361b2ba38b6e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/glimpse/wrapper.nix
@@ -0,0 +1,30 @@
+{ lib, symlinkJoin, glimpse, makeWrapper, glimpsePlugins, gnome, plugins ? null }:
+
+let
+  allPlugins = lib.filter (pkg: lib.isDerivation pkg && !pkg.meta.broken or false) (lib.attrValues glimpsePlugins);
+  selectedPlugins = if plugins == null then allPlugins else plugins;
+  extraArgs = map (x: x.wrapArgs or "") selectedPlugins;
+  versionBranch = lib.versions.majorMinor glimpse.version;
+
+in
+symlinkJoin {
+  name = "glimpse-with-plugins-${glimpse.version}";
+
+  paths = [ glimpse ] ++ selectedPlugins;
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  postBuild = ''
+    for each in glimpse-${versionBranch} glimpse-console-${versionBranch}; do
+      wrapProgram $out/bin/$each \
+        --set GIMP2_PLUGINDIR "$out/lib/glimpse/2.0" \
+        --set GIMP2_DATADIR "$out/share/glimpse/2.0" \
+        --prefix GTK_PATH : "${gnome.gnome-themes-extra}/lib/gtk-2.0" \
+        ${toString extraArgs}
+    done
+
+    for each in glimpse glimpse-console; do
+      ln -sf "$each-${versionBranch}" $out/bin/$each
+    done
+  '';
+}
diff --git a/nixpkgs/pkgs/applications/graphics/gnome-photos/default.nix b/nixpkgs/pkgs/applications/graphics/gnome-photos/default.nix
new file mode 100644
index 000000000000..f0911395404e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/gnome-photos/default.nix
@@ -0,0 +1,127 @@
+{ lib, stdenv
+, fetchurl
+, at-spi2-core
+, babl
+, dbus
+, desktop-file-utils
+, dleyna-renderer
+, gdk-pixbuf
+, gegl
+, geocode-glib
+, gettext
+, gexiv2
+, gfbgraph
+, glib
+, gnome-online-accounts
+, gnome
+, gobject-introspection
+, grilo
+, grilo-plugins
+, gsettings-desktop-schemas
+, gtk3
+, itstool
+, libdazzle
+, libhandy
+, libgdata
+, libxml2
+, meson
+, ninja
+, nixosTests
+, pkg-config
+, python3
+, tracker
+, tracker-miners
+, wrapGAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gnome-photos";
+  version = "40.0";
+
+  outputs = [ "out" "installedTests" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.major version}/${pname}-${version}.tar.xz";
+    sha256 = "1bzi79plw6ji6qlckhxnwfnswy6jpnhzmmyanml2i2xg73hp6bg0";
+  };
+
+  patches = [
+    ./installed-tests-path.patch
+  ];
+
+  nativeBuildInputs = [
+    desktop-file-utils
+    gettext
+    gobject-introspection # for setup hook
+    glib # for setup hook
+    itstool
+    libxml2
+    meson
+    ninja
+    pkg-config
+    (python3.withPackages (pkgs: with pkgs; [
+      dogtail
+      pygobject3
+      pyatspi
+    ]))
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    babl
+    dbus
+    dleyna-renderer
+    gdk-pixbuf
+    gegl
+    geocode-glib
+    gexiv2
+    gfbgraph
+    glib
+    gnome-online-accounts
+    gnome.adwaita-icon-theme
+    grilo
+    grilo-plugins
+    gsettings-desktop-schemas
+    gtk3
+    libdazzle
+    libhandy
+    libgdata
+    tracker
+    tracker-miners # For 'org.freedesktop.Tracker.Miner.Files' GSettings schema
+
+    at-spi2-core # for tests
+  ];
+
+  mesonFlags = [
+    "-Dinstalled_tests=true"
+    "-Dinstalled_test_prefix=${placeholder "installedTests"}"
+  ];
+
+  postPatch = ''
+    chmod +x meson_post_install.py
+    patchShebangs meson_post_install.py
+    patchShebangs tests/basic.py
+  '';
+
+  postFixup = ''
+    wrapGApp "${placeholder "installedTests"}/libexec/installed-tests/gnome-photos/basic.py"
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+    };
+
+    tests = {
+      installed-tests = nixosTests.installed-tests.gnome-photos;
+    };
+  };
+
+  meta = with lib; {
+    description = "Access, organize and share your photos";
+    homepage = "https://wiki.gnome.org/Apps/Photos";
+    license = licenses.gpl3Plus;
+    maintainers = teams.gnome.members;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/gnome-photos/installed-tests-path.patch b/nixpkgs/pkgs/applications/graphics/gnome-photos/installed-tests-path.patch
new file mode 100644
index 000000000000..218108328dd8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/gnome-photos/installed-tests-path.patch
@@ -0,0 +1,23 @@
+diff --git a/meson.build b/meson.build
+index dee932dc..f8851913 100644
+--- a/meson.build
++++ b/meson.build
+@@ -16,8 +16,8 @@
+ photos_docdir = join_paths(photos_datadir, 'doc', meson.project_name())
+ photos_libdir = join_paths(photos_prefix, get_option('libdir'), meson.project_name())
+ 
+-photos_installed_test_metadir = join_paths(photos_datadir, 'installed-tests', meson.project_name())
+-photos_installed_test_execdir = join_paths(photos_libexecdir, 'installed-tests', meson.project_name())
++photos_installed_test_metadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests', meson.project_name())
++photos_installed_test_execdir = join_paths(get_option('installed_test_prefix'), 'libexec', 'installed-tests', meson.project_name())
+ 
+ photos_namespace = 'org.gnome.Photos'
+ 
+diff --git a/meson_options.txt b/meson_options.txt
+index f34b5cc0..8e09970b 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -1,2 +1,3 @@
+ option('dogtail', type: 'boolean', value: true, description: 'test using dogtail')
+ option('installed_tests', type: 'boolean', value: false, description: 'Enable installation of some test cases')
++option('installed_test_prefix', type: 'string', value: '', description: 'Prefix for installed tests')
diff --git a/nixpkgs/pkgs/applications/graphics/gnuclad/default.nix b/nixpkgs/pkgs/applications/graphics/gnuclad/default.nix
new file mode 100644
index 000000000000..a1b4accc8d59
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/gnuclad/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, lib, fetchurl, pkg-config
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gnuclad";
+  version = "0.2.4";
+
+  src = fetchurl {
+    url = "https://launchpad.net/gnuclad/trunk/${lib.versions.majorMinor version}/+download/${pname}-${version}.tar.gz";
+    sha256 = "0ka2kscpjff7gflsargv3r9fdaxhkf3nym9mfaln3pnq6q7fwdki";
+  };
+
+  NIX_CFLAGS_COMPILE = "-Wno-error=catch-value";
+
+  nativeBuildInputs = [ pkg-config ];
+
+  meta = with lib; {
+    homepage = "https://launchpad.net/gnuclad";
+    description = "gnuclad tries to help the environment by creating trees.  Its primary use will be generating cladogram trees for the GNU/Linux distro timeline project";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ mog ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/gocr/default.nix b/nixpkgs/pkgs/applications/graphics/gocr/default.nix
new file mode 100644
index 000000000000..3c87e62e3d66
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/gocr/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchurl, tk }:
+
+stdenv.mkDerivation rec {
+  name = "gocr-0.52";
+
+  src = fetchurl {
+    url = "https://www-e.uni-magdeburg.de/jschulen/ocr/${name}.tar.gz";
+    sha256 = "11l6gds1lrm8lwrrsxnm5fjlwz8q1xbh896cprrl4psz21in946z";
+  };
+
+  buildFlags = [ "all" "libs" ];
+  installFlags = [ "libdir=/lib/" ]; # Specify libdir so Makefile will also install library.
+
+  preInstall = "mkdir -p $out/lib";
+
+  postInstall = ''
+    for i in pgm2asc.h gocr.h; do
+      install -D -m644 src/$i $out/include/gocr/$i
+    done
+  '';
+
+  preFixup = ''
+    sed -i -e 's|exec wish|exec ${tk}/bin/wish|' $out/bin/gocr.tcl
+  '';
+
+  meta = {
+    homepage = "http://jocr.sourceforge.net/";
+    description = "GPL Optical Character Recognition";
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/goxel/default.nix b/nixpkgs/pkgs/applications/graphics/goxel/default.nix
new file mode 100644
index 000000000000..325d1bcf083d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/goxel/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchFromGitHub, scons, pkg-config, wrapGAppsHook
+, glfw3, gtk3, libpng12 }:
+
+stdenv.mkDerivation rec {
+  pname = "goxel";
+  version = "0.10.8";
+
+  src = fetchFromGitHub {
+    owner = "guillaumechereau";
+    repo = "goxel";
+    rev = "v${version}";
+    sha256 = "sha256-M9H9SV8xmU7Jw5rEdV0gfloIEBvWmWSuH+BCrowpf2M=";
+  };
+
+  patches = [ ./disable-imgui_ini.patch ];
+
+  nativeBuildInputs = [ scons pkg-config wrapGAppsHook ];
+  buildInputs = [ glfw3 gtk3 libpng12 ];
+  NIX_LDFLAGS = "-lpthread";
+
+  buildPhase = ''
+    make release
+  '';
+
+  installPhase = ''
+    install -D ./goxel $out/bin/goxel
+  '';
+
+  meta = with lib; {
+    description = "Open Source 3D voxel editor";
+    homepage = "https://guillaumechereau.github.io/goxel/";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ tilpner ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/goxel/disable-imgui_ini.patch b/nixpkgs/pkgs/applications/graphics/goxel/disable-imgui_ini.patch
new file mode 100644
index 000000000000..9427d45487d4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/goxel/disable-imgui_ini.patch
@@ -0,0 +1,13 @@
+diff --git a/src/gui.cpp b/src/gui.cpp
+index 9b7236c..a8a11b2 100644
+--- a/src/gui.cpp
++++ b/src/gui.cpp
+@@ -314,6 +314,8 @@ static void init_ImGui(const inputs_t *inputs)
+     ImGuiIO& io = ImGui::GetIO();
+     io.DeltaTime = 1.0f/60.0f;
+
++    io.IniFilename = NULL;
++
+     io.KeyMap[ImGuiKey_Tab]         = KEY_TAB;
+     io.KeyMap[ImGuiKey_LeftArrow]   = KEY_LEFT;
+     io.KeyMap[ImGuiKey_RightArrow]  = KEY_RIGHT;
diff --git a/nixpkgs/pkgs/applications/graphics/gpicview/default.nix b/nixpkgs/pkgs/applications/graphics/gpicview/default.nix
new file mode 100644
index 000000000000..b661ba562f9d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/gpicview/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, intltool, pkg-config, gtk2, fetchpatch }:
+
+stdenv.mkDerivation {
+  name = "gpicview-0.2.4";
+
+  src = fetchurl {
+    url    = "mirror://sourceforge/lxde/gpicview-0.2.4.tar.gz";
+    sha256 = "1svcy1c8bgk0pl12yhyv16h2fl52x5vzzcv57z6qdcv5czgvgglr";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/nonas/debian-clang/master/buildlogs/gpicview/gpicview-0.2.4/debian/patches/clang_FTBFS_Wreturn-type.patch";
+      sha256 = "02dm966bplnv10knpdx7rlpjipk884156ggd9ij05zhza0jl8xcs";
+    })
+  ];
+
+  meta = with lib; {
+    description = "A simple and fast image viewer for X";
+    homepage    = "http://lxde.sourceforge.net/gpicview/";
+    repositories.git = "git://lxde.git.sourceforge.net/gitroot/lxde/gpicview";
+    license     = licenses.gpl2;
+    maintainers = with maintainers; [ lovek323 ];
+    platforms   = platforms.unix;
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ intltool gtk2 ];
+}
diff --git a/nixpkgs/pkgs/applications/graphics/gqview/default.nix b/nixpkgs/pkgs/applications/graphics/gqview/default.nix
new file mode 100644
index 000000000000..39f7a42b3b3b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/gqview/default.nix
@@ -0,0 +1,29 @@
+{lib, stdenv, fetchurl, pkg-config, gtk2, libpng}:
+
+assert pkg-config != null && gtk2 != null && libpng != null;
+# Note that we cannot just copy gtk's png attribute, since gtk might
+# not be linked against png.
+# !!! assert libpng == gtk2.libpng;
+
+stdenv.mkDerivation {
+  name = "gqview-2.1.5";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/gqview/gqview-2.1.5.tar.gz";
+    sha256 = "0ilm5s7ps9kg4f5hzgjhg0xhn6zg0v9i7jnd67zrx9h7wsaa9zhj";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ gtk2 libpng];
+
+  hardeningDisable = [ "format" ];
+
+  NIX_LDFLAGS = "-lm";
+
+  meta = with lib; {
+    description = "A fast image viewer";
+    homepage = "http://gqview.sourceforge.net";
+    license = licenses.gpl2;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/grafx2/default.nix b/nixpkgs/pkgs/applications/graphics/grafx2/default.nix
new file mode 100644
index 000000000000..3529f827b4a7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/grafx2/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, SDL, SDL_image, SDL_ttf, zlib, libpng, pkg-config, lua5 }:
+
+stdenv.mkDerivation rec {
+
+  version = "2.4.2035";
+  pname = "grafx2";
+
+  src = fetchurl {
+    url = "https://grafx2.googlecode.com/files/${pname}-${version}-src.tgz";
+    sha256 = "0svsy6rqmdj11b400c242i2ixihyz0hds0dgicqz6g6dcgmcl62q";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ SDL SDL_image SDL_ttf libpng zlib lua5 ];
+
+  preBuild = "cd src";
+
+  preInstall = '' mkdir -p "$out" '';
+
+  installPhase = ''make install prefix="$out"'';
+
+  meta = {
+    description = "Bitmap paint program inspired by the Amiga programs Deluxe Paint and Brilliance";
+    homepage = "http://pulkomandy.tk/projects/GrafX2";
+    license = lib.licenses.gpl2;
+    platforms = [ "x86_64-linux" "i686-linux" ];
+    maintainers = [ lib.maintainers.zoomulator ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/graphicsmagick/compat.nix b/nixpkgs/pkgs/applications/graphics/graphicsmagick/compat.nix
new file mode 100644
index 000000000000..b715093308fa
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/graphicsmagick/compat.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, graphicsmagick }:
+
+stdenv.mkDerivation {
+  pname = "graphicsmagick-imagemagick-compat";
+  inherit (graphicsmagick) version;
+
+  dontUnpack = true;
+  buildPhase = "true";
+
+  utils = [
+    "composite"
+    "conjure"
+    "convert"
+    "identify"
+    "mogrify"
+    "montage"
+    "animate"
+    "display"
+    "import"
+  ];
+
+  # TODO: symlink libraries?
+  installPhase = ''
+    mkdir -p "$out"/bin
+    mkdir -p "$out"/share/man/man1
+    for util in ''${utils[@]}; do
+      ln -s ${graphicsmagick}/bin/gm "$out/bin/$util"
+      ln -s ${graphicsmagick}/share/man/man1/gm.1.gz "$out/share/man/man1/$util.1.gz"
+    done
+  '';
+
+  meta = {
+    description = "ImageMagick interface for GraphicsMagick";
+    license = lib.licenses.free;
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/graphicsmagick/default.nix b/nixpkgs/pkgs/applications/graphics/graphicsmagick/default.nix
new file mode 100644
index 000000000000..13752bfc05db
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/graphicsmagick/default.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv, fetchurl, bzip2, freetype, graphviz, ghostscript
+, libjpeg, libpng, libtiff, libxml2, zlib, libtool, xz, libX11
+, libwebp, quantumdepth ? 8, fixDarwinDylibNames, nukeReferences }:
+
+stdenv.mkDerivation rec {
+  pname = "graphicsmagick";
+  version = "1.3.36";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/graphicsmagick/GraphicsMagick-${version}.tar.xz";
+    sha256 = "0ilg6fkppb4avzais1dvi3qf6ln7v3mzj7gjm83w7pwwfpg3ynsx";
+  };
+
+  patches = [
+    ./disable-popen.patch
+  ];
+
+  configureFlags = [
+    "--enable-shared"
+    "--with-frozenpaths"
+    "--with-quantum-depth=${toString quantumdepth}"
+    "--with-gslib=yes"
+  ];
+
+  buildInputs =
+    [ bzip2 freetype ghostscript graphviz libjpeg libpng libtiff libX11 libxml2
+      zlib libtool libwebp
+    ];
+
+  nativeBuildInputs = [ xz nukeReferences ]
+  ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+
+  # Remove CFLAGS from the binaries to avoid closure bloat.
+  # In the past we have had -dev packages in the closure of the binaries soley due to the string references.
+  postConfigure = ''
+    nuke-refs ./magick/magick_config.h
+  '';
+
+  postInstall = ''
+    sed -i 's/-ltiff.*'\'/\'/ $out/bin/*
+  '';
+
+  meta = {
+    homepage = "http://www.graphicsmagick.org";
+    description = "Swiss army knife of image processing";
+    license = lib.licenses.mit;
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/graphicsmagick/disable-popen.patch b/nixpkgs/pkgs/applications/graphics/graphicsmagick/disable-popen.patch
new file mode 100644
index 000000000000..2cdb1f7e90f7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/graphicsmagick/disable-popen.patch
@@ -0,0 +1,12 @@
+http://permalink.gmane.org/gmane.comp.security.oss.general/19669
+
+--- a/magick/blob.c Sat Nov 07 14:49:16 2015 -0600
++++ b/magick/blob.c Sun May 29 14:12:57 2016 -0500
+@@ -68,6 +68,7 @@
+ */
+ #define DefaultBlobQuantum  65541
+ 
++#undef HAVE_POPEN
+ 
+ /*
+   Enum declarations.
diff --git a/nixpkgs/pkgs/applications/graphics/gscan2pdf/default.nix b/nixpkgs/pkgs/applications/graphics/gscan2pdf/default.nix
new file mode 100644
index 000000000000..4f76af0afb4f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/gscan2pdf/default.nix
@@ -0,0 +1,133 @@
+{ lib, fetchurl, perlPackages, wrapGAppsHook,
+  # libs
+  librsvg, sane-backends, sane-frontends,
+  # runtime dependencies
+  imagemagick, libtiff, djvulibre, poppler_utils, ghostscript, unpaper, pdftk,
+  # test dependencies
+  xvfb-run, liberation_ttf, file, tesseract }:
+
+with lib;
+
+perlPackages.buildPerlPackage rec {
+  pname = "gscan2pdf";
+  version = "2.12.3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/gscan2pdf/${version}/${pname}-${version}.tar.xz";
+    sha256 = "tdXTcoI7DnrBsXtXR0r07hz0lDcAjZJad+o4wwxHcOk=";
+  };
+
+  nativeBuildInputs = [ wrapGAppsHook ];
+
+  buildInputs =
+    [ librsvg sane-backends sane-frontends ] ++
+    (with perlPackages; [
+      Gtk3
+      Gtk3ImageView
+      Gtk3SimpleList
+      Cairo
+      CairoGObject
+      Glib
+      GlibObjectIntrospection
+      GooCanvas2
+      GraphicsTIFF
+      IPCSystemSimple
+      LocaleCodes
+      LocaleGettext
+      PDFBuilder
+      ImagePNGLibpng
+      ImageSane
+      SetIntSpan
+      ImageMagick
+      ConfigGeneral
+      ListMoreUtils
+      HTMLParser
+      ProcProcessTable
+      LogLog4perl
+      TryTiny
+      DataUUID
+      DateCalc
+      IOString
+      FilesysDf
+      SubOverride
+    ]);
+
+  postPatch = let
+    fontSubstitute = "${liberation_ttf}/share/fonts/truetype/LiberationSans-Regular.ttf";
+  in ''
+    # Required for the program to properly load its SVG assets
+    substituteInPlace bin/gscan2pdf \
+      --replace "/usr/share" "$out/share"
+
+    # Substitute the non-free Helvetica font in the tests
+    sed -i 's|-pointsize|-font ${fontSubstitute} -pointsize|g' t/*.t
+  '';
+
+  postInstall = ''
+    # Remove impurity
+    find $out -type f -name "*.pod" -delete
+
+    # Add runtime dependencies
+    wrapProgram "$out/bin/gscan2pdf" \
+      --prefix PATH : "${sane-backends}/bin" \
+      --prefix PATH : "${imagemagick}/bin" \
+      --prefix PATH : "${libtiff}/bin" \
+      --prefix PATH : "${djvulibre}/bin" \
+      --prefix PATH : "${poppler_utils}/bin" \
+      --prefix PATH : "${ghostscript}/bin" \
+      --prefix PATH : "${unpaper}/bin" \
+      --prefix PATH : "${pdftk}/bin"
+  '';
+
+  enableParallelBuilding = true;
+
+  installTargets = [ "install" ];
+
+  outputs = [ "out" "man" ];
+
+  checkInputs = [
+    imagemagick
+    libtiff
+    djvulibre
+    poppler_utils
+    ghostscript
+    unpaper
+    pdftk
+
+    xvfb-run
+    file
+    tesseract # tests are expecting tesseract 3.x precisely
+  ] ++ (with perlPackages; [
+    TestPod
+  ]);
+
+  checkPhase = ''
+    # Temporarily disable a dubiously failing test:
+    # t/169_import_scan.t ........................... 1/1
+    # #   Failed test 'variable-height scan imported with expected size'
+    # #   at t/169_import_scan.t line 50.
+    # #          got: '179'
+    # #     expected: '296'
+    # # Looks like you failed 1 test of 1.
+    # t/169_import_scan.t ........................... Dubious, test returned 1 (wstat 256, 0x100)
+    rm t/169_import_scan.t
+    # t/1604_import_multipage_DjVu.t ................ Dubious, test returned 255 (wstat 65280, 0xff00)
+    rm t/1604_import_multipage_DjVu.t
+
+    # Disable a test which passes but reports an incorrect status
+    # t/0601_Dialog_Scan.t .......................... All 14 subtests passed
+    # t/0601_Dialog_Scan.t                        (Wstat: 139 Tests: 14 Failed: 0)
+    #   Non-zero wait status: 139
+    rm t/0601_Dialog_Scan.t
+
+    xvfb-run -s '-screen 0 800x600x24' \
+      make test
+  '';
+
+  meta = {
+    description = "A GUI to produce PDFs or DjVus from scanned documents";
+    homepage = "http://gscan2pdf.sourceforge.net/";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ pacien ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/gthumb/default.nix b/nixpkgs/pkgs/applications/graphics/gthumb/default.nix
new file mode 100644
index 000000000000..d412c6fded87
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/gthumb/default.nix
@@ -0,0 +1,113 @@
+{ lib, stdenv
+, fetchurl
+, gnome
+, pkg-config
+, meson
+, ninja
+, exiv2
+, libheif
+, libjpeg
+, libtiff
+, gst_all_1
+, libraw
+, libsoup
+, libsecret
+, glib
+, gtk3
+, gsettings-desktop-schemas
+, libchamplain
+, librsvg
+, libwebp
+, json-glib
+, webkitgtk
+, lcms2
+, bison
+, flex
+, clutter-gtk
+, wrapGAppsHook
+, shared-mime-info
+, python3
+, desktop-file-utils
+, itstool
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gthumb";
+  version = "3.12.0";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-Pe/8AwOE5ktXNhxDfHm0ga4Uie9EyHroVugbsQ2OOD8=";
+  };
+
+  nativeBuildInputs = [
+    bison
+    desktop-file-utils
+    flex
+    itstool
+    meson
+    ninja
+    pkg-config
+    python3
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    clutter-gtk
+    exiv2
+    glib
+    gnome.adwaita-icon-theme
+    gsettings-desktop-schemas
+    gst_all_1.gst-plugins-base
+    (gst_all_1.gst-plugins-good.override { gtkSupport = true; })
+    gst_all_1.gst-libav
+    gst_all_1.gst-plugins-bad
+    gst_all_1.gst-plugins-ugly
+    gtk3
+    json-glib
+    lcms2
+    libchamplain
+    libheif
+    libjpeg
+    libraw
+    librsvg
+    libsecret
+    libsoup
+    libtiff
+    libwebp
+    webkitgtk
+  ];
+
+  mesonFlags = [
+    "-Dlibchamplain=true"
+  ];
+
+  postPatch = ''
+    chmod +x gthumb/make-gthumb-h.py
+
+    patchShebangs data/gschemas/make-enums.py \
+      gthumb/make-gthumb-h.py \
+      po/make-potfiles-in.py \
+      postinstall.py \
+      gthumb/make-authors-tab.py
+  '';
+
+  preFixup = ''
+    gappsWrapperArgs+=(--prefix XDG_DATA_DIRS : "${shared-mime-info}/share")
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    homepage = "https://wiki.gnome.org/Apps/Gthumb";
+    description = "Image browser and viewer for GNOME";
+    platforms = platforms.linux;
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.mimame ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/guetzli/default.nix b/nixpkgs/pkgs/applications/graphics/guetzli/default.nix
new file mode 100644
index 000000000000..9f2f050441f1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/guetzli/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, libpng, fetchFromGitHub, pkg-config }:
+let
+  version = "1.0.1";
+in
+stdenv.mkDerivation {
+  pname = "guetzli";
+  inherit version;
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = "guetzli";
+    rev = "v${version}";
+    sha256 = "1wy9wfvyradp0aigfv8yijvj0dgb5kpq2yf2xki15f605jc1r5dm";
+  };
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libpng ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    install bin/Release/guetzli $out/bin/
+  '';
+
+  meta = {
+    description = "Perceptual JPEG encoder";
+    longDescription = "Guetzli is a JPEG encoder that aims for excellent compression density at high visual quality.";
+    homepage = "https://github.com/google/guetzli";
+    license = lib.licenses.asl20;
+    platforms = lib.platforms.x86_64;
+    maintainers = [ lib.maintainers.seppeljordan ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/hdr-plus/default.nix b/nixpkgs/pkgs/applications/graphics/hdr-plus/default.nix
new file mode 100644
index 000000000000..15042e6877ff
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/hdr-plus/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch
+, cmake, halide
+, libpng, libjpeg, libtiff, libraw
+}:
+
+stdenv.mkDerivation rec {
+  pname = "hdr-plus-unstable";
+  version = "2020-10-29";
+
+  src = fetchFromGitHub {
+    owner = "timothybrooks";
+    repo = "hdr-plus";
+    rev = "132bd73ccd4eaef9830124605c93f06a98607cfa";
+    sha256 = "1n49ggrppf336p7n510kapzh376791bysxj3f33m3bdzksq360ps";
+  };
+
+  patches = [
+    # PR #70, fixes incompatibility with Halide 10.0.0
+    (fetchpatch {
+      url = "https://github.com/timothybrooks/hdr-plus/pull/70/commits/077e1a476279539c72e615210762dca27984c57b.patch";
+      sha256 = "1sg2l1bqs2smpfpy4flwg86fzhcc4yf7zx998v1bfhim43yyrx59";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ halide libpng libjpeg libtiff libraw ];
+
+  installPhase = ''
+    for bin in hdrplus stack_frames; do
+      install -Dm755 $bin $out/bin/$bin
+    done
+  '';
+
+  meta = with lib; {
+    description = "Burst photography pipeline based on Google's HDR+";
+    homepage = "https://www.timothybrooks.com/tech/hdr-plus/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ OPNA2608 ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/hello-wayland/default.nix b/nixpkgs/pkgs/applications/graphics/hello-wayland/default.nix
new file mode 100644
index 000000000000..b11e2be9daf6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/hello-wayland/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, lib, fetchFromGitHub
+, imagemagick, pkg-config, wayland, wayland-protocols
+}:
+
+stdenv.mkDerivation {
+  pname = "hello-wayland-unstable";
+  version = "2020-07-27";
+
+  src = fetchFromGitHub {
+    owner = "emersion";
+    repo = "hello-wayland";
+    rev = "501d0851cfa7f21c780c0eb52f0a6b23f02918c5";
+    sha256 = "0dz6przqp57kw8ycja3gw6jp9x12217nwbwdpgmvw7jf0lzhk4xr";
+  };
+
+  nativeBuildInputs = [ imagemagick pkg-config ];
+  buildInputs = [ wayland wayland-protocols ];
+
+  installPhase = ''
+    runHook preBuild
+    mkdir -p $out/bin
+    install hello-wayland $out/bin
+    runHook postBuild
+  '';
+
+  meta = with lib; {
+    description = "Hello world Wayland client";
+    homepage = "https://github.com/emersion/hello-wayland";
+    maintainers = with maintainers; [ qyliss ];
+    license = licenses.mit;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/hugin/default.nix b/nixpkgs/pkgs/applications/graphics/hugin/default.nix
new file mode 100644
index 000000000000..a83070e5e6b6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/hugin/default.nix
@@ -0,0 +1,53 @@
+{ lib, stdenv, cmake, fetchurl, gnumake, makeWrapper, pkg-config, fetchpatch
+, autopanosiftc, boost, cairo, enblend-enfuse, exiv2, fftw, flann, gettext
+, glew, ilmbase, lcms2, lensfun, libjpeg, libpng, libtiff, libX11, libXi
+, libXmu, libGLU, libGL, openexr, panotools, perlPackages, sqlite, vigra, wxGTK, zlib
+}:
+
+stdenv.mkDerivation rec {
+  name = "hugin-2019.0.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/hugin/${name}.tar.bz2";
+    sha256 = "1l925qslp98gg7yzmgps10h6dq0nb60wbfk345anlxsv0g2ifizr";
+  };
+
+  patches = [
+    # Fixes build with exiv2 0.27.1
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/archlinux/svntogit-community/0467d8ba362b9c196e4c1dc4be7de0c1b336335b/hugin/trunk/hugin-exiv2-0.27.1.patch";
+      sha256 = "1yxvlpvrhyrfd2w6kwx1w3mncsvlzdhp0w7xchy8q6kc2kd5nf7r";
+    })
+  ];
+
+  buildInputs = [
+    boost cairo exiv2 fftw flann gettext glew ilmbase lcms2 lensfun libjpeg
+    libpng libtiff libX11 libXi libXmu libGLU libGL openexr panotools sqlite vigra
+    wxGTK zlib
+  ];
+
+  nativeBuildInputs = [ cmake makeWrapper pkg-config ];
+
+  # disable installation of the python scripting interface
+  cmakeFlags = [ "-DBUILD_HSI:BOOl=OFF" ];
+
+  NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR";
+
+  postInstall = ''
+    for p in $out/bin/*; do
+      wrapProgram "$p" \
+        --suffix PATH : ${autopanosiftc}/bin \
+        --suffix PATH : ${enblend-enfuse}/bin \
+        --suffix PATH : ${gnumake}/bin \
+        --suffix PATH : ${perlPackages.ImageExifTool}/bin
+    done
+  '';
+
+  meta = with lib; {
+    homepage = "http://hugin.sourceforge.net/";
+    description = "Toolkit for stitching photographs and assembling panoramas, together with an easy to use graphical front end";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ hrdinka ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/hydrus/default.nix b/nixpkgs/pkgs/applications/graphics/hydrus/default.nix
new file mode 100644
index 000000000000..36dad897668c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/hydrus/default.nix
@@ -0,0 +1,114 @@
+{ lib
+, fetchFromGitHub
+, wrapQtAppsHook
+, miniupnpc_2
+, ffmpeg
+, enableSwftools ? false
+, swftools
+, python3Packages
+}:
+
+python3Packages.buildPythonPackage rec {
+  pname = "hydrus";
+  version = "458";
+  format = "other";
+
+  src = fetchFromGitHub {
+    owner = "hydrusnetwork";
+    repo = "hydrus";
+    rev = "v${version}";
+    sha256 = "sha256-oVNgXelFMVT5V41SRlnN+pnYzOWbdDKQQcvRWFZqEro=";
+  };
+
+  nativeBuildInputs = [
+    wrapQtAppsHook
+  ];
+
+  propagatedBuildInputs = with python3Packages; [
+    beautifulsoup4
+    chardet
+    cloudscraper
+    html5lib
+    lxml
+    lz4
+    nose
+    numpy
+    opencv4
+    pillow
+    psutil
+    pylzma
+    pyopenssl
+    pyside2
+    pysocks
+    pythonPackages.mpv
+    pyyaml
+    qtpy
+    requests
+    send2trash
+    service-identity
+    six
+    twisted
+  ];
+
+  checkInputs = with python3Packages; [ nose mock httmock ];
+
+  # most tests are failing, presumably because we are not using test.py
+  checkPhase = ''
+    nosetests $src/hydrus/test  \
+    -e TestClientAPI \
+    -e TestClientConstants \
+    -e TestClientDaemons \
+    -e TestClientData \
+    -e TestClientDB \
+    -e TestClientDBDuplicates \
+    -e TestClientDBTags \
+    -e TestClientImageHandling \
+    -e TestClientImportOptions \
+    -e TestClientListBoxes \
+    -e TestClientMigration \
+    -e TestClientNetworking \
+    -e TestClientTags \
+    -e TestClientThreading \
+    -e TestDialogs \
+    -e TestFunctions \
+    -e TestHydrusNetwork \
+    -e TestHydrusNATPunch \
+    -e TestHydrusSerialisable \
+    -e TestHydrusServer \
+    -e TestHydrusSessions \
+    -e TestServer \
+  '';
+
+  outputs = [ "out" "doc" ];
+
+  installPhase = ''
+    # Move the hydrus module and related directories
+    mkdir -p $out/${python3Packages.python.sitePackages}
+    mv {hydrus,static} $out/${python3Packages.python.sitePackages}
+    mv help $out/doc/
+
+    # install the hydrus binaries
+    mkdir -p $out/bin
+    install -m0755 server.py $out/bin/hydrus-server
+    install -m0755 client.py $out/bin/hydrus-client
+  '' + lib.optionalString enableSwftools ''
+    mkdir -p $out/${python3Packages.python.sitePackages}/bin
+    # swfrender seems to have to be called sfwrender_linux
+    # not sure if it can be loaded through PATH, but this is simpler
+    # $out/python3Packages.python.sitePackages/bin is correct NOT .../hydrus/bin
+    ln -s ${swftools}/bin/swfrender $out/${python3Packages.python.sitePackages}/bin/swfrender_linux
+  '';
+
+  dontWrapQtApps = true;
+  preFixup = ''
+    makeWrapperArgs+=("''${qtWrapperArgs[@]}")
+    makeWrapperArgs+=(--prefix PATH : ${lib.makeBinPath [ ffmpeg miniupnpc_2 ]})
+  '';
+
+  meta = with lib; {
+    description = "Danbooru-like image tagging and searching system for the desktop";
+    license = licenses.wtfpl;
+    homepage = "https://hydrusnetwork.github.io/hydrus/";
+    maintainers = with maintainers; [ dandellion evanjs ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/ideogram/default.nix b/nixpkgs/pkgs/applications/graphics/ideogram/default.nix
new file mode 100644
index 000000000000..f9b123ddb40b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/ideogram/default.nix
@@ -0,0 +1,68 @@
+{ lib, stdenv
+, fetchFromGitHub
+, nix-update-script
+, fetchpatch
+, vala
+, pkg-config
+, python3
+, glib
+, gtk3
+, meson
+, ninja
+, libgee
+, pantheon
+, desktop-file-utils
+, xorg
+, wrapGAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ideogram";
+  version = "1.3.3";
+
+  src = fetchFromGitHub {
+    owner = "cassidyjames";
+    repo = pname;
+    rev = version;
+    sha256 = "1zkr7x022khn5g3sq2dkxzy1hiiz66vl81s3i5sb9qr88znh79p1";
+  };
+
+  nativeBuildInputs = [
+    desktop-file-utils
+    meson
+    ninja
+    vala
+    pkg-config
+    python3
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    glib
+    gtk3
+    libgee
+    pantheon.granite
+    xorg.libX11
+    xorg.libXtst
+  ];
+
+  postPatch = ''
+    chmod +x meson/post_install.py
+    patchShebangs meson/post_install.py
+  '';
+
+  passthru = {
+    updateScript = nix-update-script {
+      attrPath = pname;
+    };
+  };
+
+  meta = with lib; {
+    description = "Insert emoji anywhere, even in non-native apps - designed for elementary OS";
+    homepage = "https://github.com/cassidyjames/ideogram";
+    license = licenses.gpl2Plus;
+    maintainers = teams.pantheon.members;
+    platforms = platforms.linux;
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/graphics/image_optim/Gemfile b/nixpkgs/pkgs/applications/graphics/image_optim/Gemfile
new file mode 100644
index 000000000000..d6a0f13a4c1a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/image_optim/Gemfile
@@ -0,0 +1,2 @@
+source 'https://rubygems.org'
+gem 'image_optim'
diff --git a/nixpkgs/pkgs/applications/graphics/image_optim/Gemfile.lock b/nixpkgs/pkgs/applications/graphics/image_optim/Gemfile.lock
new file mode 100644
index 000000000000..3ffadb5acbe3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/image_optim/Gemfile.lock
@@ -0,0 +1,23 @@
+GEM
+  remote: https://rubygems.org/
+  specs:
+    exifr (1.3.6)
+    fspath (3.1.0)
+    image_optim (0.26.3)
+      exifr (~> 1.2, >= 1.2.2)
+      fspath (~> 3.0)
+      image_size (>= 1.5, < 3)
+      in_threads (~> 1.3)
+      progress (~> 3.0, >= 3.0.1)
+    image_size (2.0.0)
+    in_threads (1.5.1)
+    progress (3.5.0)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  image_optim
+
+BUNDLED WITH
+   2.1.4
diff --git a/nixpkgs/pkgs/applications/graphics/image_optim/default.nix b/nixpkgs/pkgs/applications/graphics/image_optim/default.nix
new file mode 100644
index 000000000000..ba437eab4122
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/image_optim/default.nix
@@ -0,0 +1,66 @@
+{ lib, bundlerApp, bundlerUpdateScript, makeWrapper,
+  withPngcrush ? true,       pngcrush ? null,
+  withPngout ? true,         pngout ? null,
+  withAdvpng ? true,         advancecomp ? null,
+  withOptipng ? true,        optipng ? null,
+  withPngquant ? true,       pngquant ? null,
+  withJhead ? true,          jhead ? null,
+  withJpegoptim ? true,      jpegoptim ? null,
+  withJpegrecompress ? true, jpeg-archive ? null,
+  withJpegtran ? true,       libjpeg ? null,
+  withGifsicle ? true,       gifsicle ? null,
+  withSvgo ? true,           svgo ? null
+}:
+
+assert withPngcrush       -> pngcrush != null;
+assert withPngout         -> pngout != null;
+assert withAdvpng         -> advancecomp != null;
+assert withOptipng        -> optipng != null;
+assert withPngquant       -> pngquant != null;
+assert withJhead          -> jhead != null;
+assert withJpegoptim      -> jpegoptim != null;
+assert withJpegrecompress -> jpeg-archive != null;
+assert withJpegtran       -> libjpeg != null;
+assert withGifsicle       -> gifsicle != null;
+assert withSvgo           -> svgo != null;
+
+with lib;
+
+let
+  optionalDepsPath = []
+    ++ optional withPngcrush pngcrush
+    ++ optional withPngout pngout
+    ++ optional withAdvpng advancecomp
+    ++ optional withOptipng optipng
+    ++ optional withPngquant pngquant
+    ++ optional withJhead jhead
+    ++ optional withJpegoptim jpegoptim
+    ++ optional withJpegrecompress jpeg-archive
+    ++ optional withJpegtran libjpeg
+    ++ optional withGifsicle gifsicle
+    ++ optional withSvgo svgo;
+in
+
+bundlerApp {
+  pname = "image_optim";
+  gemdir = ./.;
+
+  exes = [ "image_optim" ];
+
+  buildInputs = [ makeWrapper ];
+
+  postBuild = ''
+    wrapProgram $out/bin/image_optim \
+      --prefix PATH : ${makeBinPath optionalDepsPath}
+  '';
+
+  passthru.updateScript = bundlerUpdateScript "image_optim";
+
+  meta = with lib; {
+    description = "Command line tool and ruby interface to optimize (lossless compress, optionally lossy) jpeg, png, gif and svg images using external utilities (advpng, gifsicle, jhead, jpeg-recompress, jpegoptim, jpegrescan, jpegtran, optipng, pngcrush, pngout, pngquant, svgo)";
+    homepage    = "https://github.com/toy/image_optim";
+    license     = licenses.mit;
+    maintainers = with maintainers; [ srghma nicknovitski ];
+    platforms   = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/image_optim/gemset.nix b/nixpkgs/pkgs/applications/graphics/image_optim/gemset.nix
new file mode 100644
index 000000000000..08e7f5c78ef9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/image_optim/gemset.nix
@@ -0,0 +1,51 @@
+{
+  exifr = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0q2abhiyvgfv23i0izbskjxcqaxiw9bfg6s57qgn4li4yxqpwpfg";
+      type = "gem";
+    };
+    version = "1.3.6";
+  };
+  fspath = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1vjn9sy4hklr2d5wxmj5x1ry31dfq3sjp779wyprb3nbbdmra1sc";
+      type = "gem";
+    };
+    version = "3.1.0";
+  };
+  image_optim = {
+    dependencies = ["exifr" "fspath" "image_size" "in_threads" "progress"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "082w9qcyy9j6m6s2pknfdcik7l2qch4j48axs13m06l4s1hz0dmg";
+      type = "gem";
+    };
+    version = "0.26.3";
+  };
+  image_size = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0bcn7nc6qix3w4sf7xd557lnsgjniqa7qvz7nnznx70m8qfbc7ig";
+      type = "gem";
+    };
+    version = "2.0.0";
+  };
+  in_threads = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "14hqm59sgqi91ag187zwpgwi58xckjkk58m031ghkp0csl8l9mkx";
+      type = "gem";
+    };
+    version = "1.5.1";
+  };
+  progress = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1yrzq4v5sp7cg4nbgqh11k3d1czcllfz98dcdrxrsjxwq5ziiw0p";
+      type = "gem";
+    };
+    version = "3.5.0";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/imagej/default.nix b/nixpkgs/pkgs/applications/graphics/imagej/default.nix
new file mode 100644
index 000000000000..0dbc2d5d4e14
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/imagej/default.nix
@@ -0,0 +1,74 @@
+{ lib
+, stdenv
+, fetchurl
+, jre
+, unzip
+, makeWrapper
+, makeDesktopItem
+, copyDesktopItems
+}:
+
+let
+  icon = fetchurl {
+    url = "https://imagej.net/media/icons/imagej.png";
+    sha256 = "sha256-nU2nWI1wxZB/xlOKsZzdUjj+qiCTjO6GwEKYgZ5Risg=";
+  };
+in stdenv.mkDerivation rec {
+  pname = "imagej";
+  version = "153";
+
+  src = fetchurl {
+    url = "https://wsr.imagej.net/distros/cross-platform/ij${version}.zip";
+    sha256 = "sha256-MGuUdUDuW3s/yGC68rHr6xxzmYScUjdXRawDpc1UQqw=";
+  };
+  nativeBuildInputs = [ copyDesktopItems makeWrapper unzip ];
+  desktopItems = lib.optionals stdenv.isLinux [
+    (makeDesktopItem {
+      name = "ImageJ";
+      desktopName = "ImageJ";
+      icon = "imagej";
+      categories = "Science;Utility;Graphics;";
+      exec = "imagej";
+    })
+  ];
+
+  passthru = {
+    inherit jre;
+  };
+
+  # JAR files that are intended to be used by other packages
+  # should go to $out/share/java.
+  # (Some uses ij.jar as a library not as a standalone program.)
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/share/java $out/bin
+    # Read permisssion suffices for the jar and others.
+    # Simple cp shall clear suid bits, if any.
+    cp ij.jar $out/share/java
+    cp -dR luts macros plugins $out/share
+    makeWrapper ${jre}/bin/java $out/bin/imagej \
+      --add-flags "-jar $out/share/java/ij.jar -ijpath $out/share"
+
+    runHook postInstall
+  '';
+
+  postFixup = lib.optionalString stdenv.isLinux ''
+    install -Dm644 ${icon} $out/share/icons/hicolor/128x128/apps/imagej.png
+    substituteInPlace $out/share/applications/ImageJ.desktop \
+      --replace Exec=imagej Exec=$out/bin/imagej
+  '';
+
+  meta = with lib; {
+    homepage = "https://imagej.nih.gov/ij/";
+    description = "Image processing and analysis in Java";
+    longDescription = ''
+      ImageJ is a public domain Java image processing program
+      inspired by NIH Image for the Macintosh.
+      It runs on any computer with a Java 1.4 or later virtual machine.
+    '';
+    license = licenses.publicDomain;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ yuriaisaka ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/img-cat/default.nix b/nixpkgs/pkgs/applications/graphics/img-cat/default.nix
new file mode 100644
index 000000000000..a4985c4e2c70
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/img-cat/default.nix
@@ -0,0 +1,22 @@
+{ lib, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+  pname = "imgcat";
+  version = "1.2.0";
+
+  src = fetchFromGitHub {
+    owner = "trashhalo";
+    repo = "imgcat";
+    rev = "v${version}";
+    sha256 = "0x7a1izsbrbfph7wa9ny9r4a8lp6z15qpb6jf8wsxshiwnkjyrig";
+  };
+
+  vendorSha256 = "191gi4c5jk8p9xvbm1cdhk5yi8q2cp2jvjq1sgxqw1ad0lppwhg2";
+
+  meta = with lib; {
+    description = "A tool to output images as RGB ANSI graphics on the terminal";
+    homepage = "https://github.com/trashhalo/imgcat";
+    license = licenses.mit;
+    maintainers = with maintainers; [ penguwin ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/imgbrd-grabber/default.nix b/nixpkgs/pkgs/applications/graphics/imgbrd-grabber/default.nix
new file mode 100644
index 000000000000..c0115d95ac80
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/imgbrd-grabber/default.nix
@@ -0,0 +1,94 @@
+{ lib, stdenv
+, cmake
+, fetchFromGitHub
+, wrapQtAppsHook
+, qtmultimedia
+, qttools
+, qtscript
+, qtdeclarative
+, qtbase
+, autogen
+, automake
+, makeWrapper
+, catch2
+, nodejs
+, libpulseaudio
+, openssl
+, rsync
+, typescript
+}:
+stdenv.mkDerivation rec {
+  pname = "imgbrd-grabber";
+
+  version = "7.3.2";
+  src = fetchFromGitHub {
+    owner = "Bionus";
+    repo = "imgbrd-grabber";
+    rev = "v${version}";
+    sha256 = "053rwvcr88fcba0447a6r115cgnqsm9rl066z8d5jacqnhdij58k";
+    fetchSubmodules = true;
+  };
+
+  buildInputs = [
+    openssl
+    makeWrapper
+    libpulseaudio
+    typescript
+  ];
+
+  nativeBuildInputs = [
+    qtmultimedia
+    qtbase
+    qtdeclarative
+    qttools
+    nodejs
+    cmake
+    wrapQtAppsHook
+  ];
+
+  extraOutputsToLink = [ "doc" ];
+
+  postPatch = ''
+    # the package.sh script provides some install helpers
+    # using this might make it easier to maintain/less likely for the
+    # install phase to fail across version bumps
+    patchShebangs ./scripts/package.sh
+
+    # ensure the script uses the rsync package from nixpkgs
+    substituteInPlace ../scripts/package.sh --replace "rsync" "${rsync}/bin/rsync"
+
+
+    # the npm build step only runs typescript
+    # run this step directly so it doesn't try and fail to download the unnecessary node_modules, etc.
+    substituteInPlace ./sites/CMakeLists.txt --replace "npm install" "npm run build"
+
+    # remove the vendored catch2
+    rm -rf tests/src/vendor/catch
+
+    # link the catch2 sources from nixpkgs
+    ln -sf ${catch2.src} tests/src/vendor/catch
+  '';
+
+  postInstall = ''
+    # move the binaries to the share/Grabber folder so
+    # some relative links can be resolved (e.g. settings.ini)
+    mv $out/bin/* $out/share/Grabber/
+
+    cd ../..
+    # run the package.sh with $out/share/Grabber as the $APP_DIR
+    sh ./scripts/package.sh $out/share/Grabber
+
+    # add symlinks for the binaries to $out/bin
+    ln -s $out/share/Grabber/Grabber $out/bin/Grabber
+    ln -s $out/share/Grabber/Grabber-cli $out/bin/Grabber-cli
+  '';
+
+  sourceRoot = "source/src";
+
+  meta = with lib; {
+    description = "Very customizable imageboard/booru downloader with powerful filenaming features";
+    license = licenses.asl20;
+    homepage = "https://bionus.github.io/imgbrd-grabber/";
+    maintainers = [ maintainers.evanjs ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/imgcat/default.nix b/nixpkgs/pkgs/applications/graphics/imgcat/default.nix
new file mode 100644
index 000000000000..cb2301d6339e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/imgcat/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, ncurses }:
+
+stdenv.mkDerivation rec {
+  pname = "imgcat";
+  version = "2.3.1";
+
+  nativeBuildInputs = [ autoconf automake libtool ];
+  buildInputs = [ ncurses ];
+
+  preConfigure = ''
+    ${autoconf}/bin/autoconf
+    sed -i -e "s|-ltermcap|-L ${ncurses}/lib -lncurses|" Makefile
+  '';
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  src = fetchFromGitHub {
+    owner = "eddieantonio";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0frz40rjwi73nx2dlqvmnn56zwr29bmnngfb11hhwr7v58yfajdi";
+  };
+
+  NIX_CFLAGS_COMPILE = "-Wno-error";
+
+  meta = with lib; {
+    description = "It's like cat, but for images";
+    homepage = "https://github.com/eddieantonio/imgcat";
+    license = licenses.isc;
+    maintainers = with maintainers; [ jwiegley ];
+    platforms = platforms.unix;
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/graphics/imgp/default.nix b/nixpkgs/pkgs/applications/graphics/imgp/default.nix
new file mode 100644
index 000000000000..1f6e20f465a2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/imgp/default.nix
@@ -0,0 +1,38 @@
+{ lib, fetchFromGitHub, buildPythonApplication, pillow, imgp }:
+
+buildPythonApplication rec {
+  pname = "imgp";
+  version = "2.8";
+
+  src = fetchFromGitHub {
+    owner = "jarun";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1miabaxd5pwxn0va4drzj1d4ppxvyqsrrd4xw1j6qr52yci0lms8";
+  };
+
+  propagatedBuildInputs = [ pillow ];
+
+  installFlags = [
+    "DESTDIR=$(out)"
+    "PREFIX="
+  ];
+
+  postInstall = ''
+    install -Dm555 auto-completion/bash/imgp-completion.bash $out/share/bash-completion/completions/imgp.bash
+    install -Dm555 auto-completion/fish/imgp.fish -t $out/share/fish/vendor_completions.d
+    install -Dm555 auto-completion/zsh/_imgp -t $out/share/zsh/site-functions
+  '';
+
+  checkPhase = ''
+    $out/bin/imgp --help
+  '';
+
+  meta = with lib; {
+    description = "High-performance CLI batch image resizer & rotator";
+    homepage = "https://github.com/jarun/imgp";
+    license = licenses.gpl3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ sikmir ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/imlibsetroot/default.nix b/nixpkgs/pkgs/applications/graphics/imlibsetroot/default.nix
new file mode 100644
index 000000000000..d3640a656f13
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/imlibsetroot/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, libX11, libXinerama, imlib2 }:
+
+stdenv.mkDerivation {
+  pname = "imlibsetroot";
+  version = "1.2";
+  src = fetchurl {
+    url = "https://robotmonkeys.net/wp-content/uploads/2010/03/imlibsetroot-12.tar.gz";
+    sha256 = "8c1b3b7c861e4d865883ec13a96b8e4ab22464a87d4e6c67255b17a88e3cfd1c";
+  };
+
+  buildInputs = [ libX11 imlib2 libXinerama ];
+  buildPhase = ''
+    gcc -g imlibsetroot.c -o imlibsetroot             \
+      `imlib2-config --cflags` `imlib2-config --libs` \
+      -I/include/X11/extensions -lXinerama -lX11
+  '';
+  installPhase = ''
+    mkdir -p $out/bin
+    install -m 755 imlibsetroot $out/bin
+  '';
+
+  meta = with lib; {
+    description = "A Xinerama Aware Background Changer";
+    homepage = "http://robotmonkeys.net/2010/03/30/imlibsetroot/";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ dwarfmaster ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/imv/default.nix b/nixpkgs/pkgs/applications/graphics/imv/default.nix
new file mode 100644
index 000000000000..04150a1ceb81
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/imv/default.nix
@@ -0,0 +1,116 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, asciidoc
+, cmocka
+, docbook_xsl
+, libxslt
+, meson
+, ninja
+, pkg-config
+, icu
+, pango
+, inih
+, withWindowSystem ? "all"
+, xorg
+, libxkbcommon
+, libGLU
+, wayland
+, withBackends ? [ "freeimage" "libtiff" "libjpeg" "libpng" "librsvg" "libnsgif" "libheif" ]
+, freeimage
+, libtiff
+, libjpeg_turbo
+, libpng
+, librsvg
+, netsurf
+, libheif
+}:
+
+let
+  windowSystems = {
+    all = windowSystems.x11 ++ windowSystems.wayland;
+    x11 = [ libGLU xorg.libxcb xorg.libX11 ];
+    wayland = [ wayland ];
+  };
+
+  backends = {
+    inherit freeimage libtiff libpng librsvg libheif;
+    libjpeg = libjpeg_turbo;
+    inherit (netsurf) libnsgif;
+  };
+
+  backendFlags = builtins.map
+    (b: if builtins.elem b withBackends
+        then "-D${b}=enabled"
+        else "-D${b}=disabled")
+    (builtins.attrNames backends);
+in
+
+# check that given window system is valid
+assert lib.assertOneOf "withWindowSystem" withWindowSystem
+  (builtins.attrNames windowSystems);
+# check that every given backend is valid
+assert builtins.all
+  (b: lib.assertOneOf "each backend" b (builtins.attrNames backends))
+  withBackends;
+
+stdenv.mkDerivation rec {
+  pname = "imv";
+  version = "4.3.0";
+
+  src = fetchFromGitHub {
+    owner = "eXeC64";
+    repo = "imv";
+    rev = "v${version}";
+    sha256 = "sha256-HP9W9US9e3YAXwCqiHV8NVqrO20SfQKcW3a6+r1XrIs=";
+  };
+
+  mesonFlags = [
+    "-Dwindows=${withWindowSystem}"
+    "-Dtest=enabled"
+    "-Dman=enabled"
+  ] ++ backendFlags;
+
+  nativeBuildInputs = [
+    asciidoc
+    cmocka
+    docbook_xsl
+    libxslt
+    meson
+    ninja
+    pkg-config
+  ];
+
+  buildInputs = [
+    icu
+    libxkbcommon
+    pango
+    inih
+  ] ++ windowSystems."${withWindowSystem}"
+    ++ builtins.map (b: backends."${b}") withBackends;
+
+  postInstall = ''
+    # fix the executable path and install the desktop item
+    substituteInPlace ../files/imv.desktop --replace "imv %F" "$out/bin/imv %F"
+    install -Dm644 ../files/imv.desktop $out/share/applications/
+  '';
+
+  postFixup = lib.optionalString (withWindowSystem == "all") ''
+    # The `bin/imv` script assumes imv-wayland or imv-x11 in PATH,
+    # so we have to fix those to the binaries we installed into the /nix/store
+
+    substituteInPlace "$out/bin/imv" \
+      --replace "imv-wayland" "$out/bin/imv-wayland" \
+      --replace "imv-x11" "$out/bin/imv-x11"
+  '';
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "A command line image viewer for tiling window managers";
+    homepage = "https://github.com/eXeC64/imv";
+    license = licenses.mit;
+    maintainers = with maintainers; [ rnhmjoj markus1189 ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/inkscape/default.nix b/nixpkgs/pkgs/applications/graphics/inkscape/default.nix
new file mode 100644
index 000000000000..c65dfa1b6c08
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/inkscape/default.nix
@@ -0,0 +1,171 @@
+{ lib, stdenv
+, boehmgc
+, boost
+, cairo
+, cmake
+, fetchurl
+, fetchpatch
+, gettext
+, ghostscript
+, glib
+, glib-networking
+, glibmm
+, gsl
+, gspell
+, gtk-mac-integration
+, gtkmm3
+, gdk-pixbuf
+, imagemagick
+, lcms
+, lib2geom
+, libcdr
+, libexif
+, libpng
+, librevenge
+, librsvg
+, libsigcxx
+, libsoup
+, libvisio
+, libwpg
+, libXft
+, libxml2
+, libxslt
+, ninja
+, perlPackages
+, pkg-config
+, poppler
+, popt
+, potrace
+, python3
+, substituteAll
+, wrapGAppsHook
+, zlib
+}:
+let
+  python3Env = python3.withPackages
+    (ps: with ps; [
+      numpy
+      lxml
+      pillow
+      scour
+    ]);
+in
+stdenv.mkDerivation rec {
+  pname = "inkscape";
+  version = "1.1";
+
+  src = fetchurl {
+    url = "https://media.inkscape.org/dl/resources/file/${pname}-${version}.tar.xz";
+    sha256 = "sha256-cebozj/fcC9Z28SidmZeuYLreCKwKbvb7O0t9DAXleY=";
+  };
+
+  # Inkscape hits the ARGMAX when linking on macOS. It appears to be
+  # CMake’s ARGMAX check doesn’t offer enough padding for NIX_LDFLAGS.
+  # Setting strictDeps it avoids duplicating some dependencies so it
+  # will leave us under ARGMAX.
+  strictDeps = true;
+
+  patches = [
+    (substituteAll {
+      src = ./fix-python-paths.patch;
+      # Python is used at run-time to execute scripts,
+      # e.g., those from the "Effects" menu.
+      python3 = "${python3Env}/bin/python";
+    })
+
+    # Fix parsing paths by Python extensions.
+    # https://gitlab.com/inkscape/extensions/-/merge_requests/342
+    (fetchpatch {
+      url = "https://gitlab.com/inkscape/extensions/-/commit/a82c382c610d37837c8f3f5b13224bab8fd3667e.patch";
+      sha256 = "YWrgjCnQ9q6BUsxSLQojIXnDzPxM/SgrIfj1gxQ/JKM=";
+      stripLen = 1;
+      extraPrefix = "share/extensions/";
+    })
+  ];
+
+  postPatch = ''
+    patchShebangs share/extensions
+    substituteInPlace share/extensions/eps_input.inx \
+      --replace "location=\"path\">ps2pdf" "location=\"absolute\">${ghostscript}/bin/ps2pdf"
+    substituteInPlace share/extensions/ps_input.inx \
+      --replace "location=\"path\">ps2pdf" "location=\"absolute\">${ghostscript}/bin/ps2pdf"
+    substituteInPlace share/extensions/ps_input.py \
+      --replace "call('ps2pdf'" "call('${ghostscript}/bin/ps2pdf'"
+    patchShebangs share/templates
+    patchShebangs man/fix-roff-punct
+
+    # double-conversion is a dependency of 2geom
+    substituteInPlace CMakeScripts/DefineDependsandFlags.cmake \
+      --replace 'find_package(DoubleConversion REQUIRED)' ""
+  '';
+
+  nativeBuildInputs = [
+    pkg-config
+    cmake
+    ninja
+    python3Env
+    glib # for setup hook
+    gdk-pixbuf # for setup hook
+    wrapGAppsHook
+  ] ++ (with perlPackages; [
+    perl
+    XMLParser
+  ]);
+
+  buildInputs = [
+    boehmgc
+    boost
+    gettext
+    glib
+    glib-networking
+    glibmm
+    gsl
+    gtkmm3
+    imagemagick
+    lcms
+    lib2geom
+    libcdr
+    libexif
+    libpng
+    librevenge
+    librsvg # for loading icons
+    libsigcxx
+    libsoup
+    libvisio
+    libwpg
+    libXft
+    libxml2
+    libxslt
+    perlPackages.perl
+    poppler
+    popt
+    potrace
+    python3Env
+    zlib
+  ] ++ lib.optionals (!stdenv.isDarwin) [
+    gspell
+  ] ++ lib.optionals stdenv.isDarwin [
+    cairo
+    gtk-mac-integration
+  ];
+
+  # Make sure PyXML modules can be found at run-time.
+  postInstall = lib.optionalString stdenv.isDarwin ''
+    install_name_tool -change $out/lib/libinkscape_base.dylib $out/lib/inkscape/libinkscape_base.dylib $out/bin/inkscape
+    install_name_tool -change $out/lib/libinkscape_base.dylib $out/lib/inkscape/libinkscape_base.dylib $out/bin/inkview
+  '';
+
+  meta = with lib; {
+    description = "Vector graphics editor";
+    homepage = "https://www.inkscape.org";
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.jtojnar ];
+    platforms = platforms.all;
+    longDescription = ''
+      Inkscape is a feature-rich vector graphics editor that edits
+      files in the W3C SVG (Scalable Vector Graphics) file format.
+
+      If you want to import .eps files install ps2edit.
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/inkscape/extensions.nix b/nixpkgs/pkgs/applications/graphics/inkscape/extensions.nix
new file mode 100644
index 000000000000..63010a19f14d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/inkscape/extensions.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv
+, fetchFromGitHub
+, runCommand
+, inkcut
+, callPackage
+}:
+
+{
+  applytransforms = callPackage ./extensions/applytransforms { };
+
+  hexmap = stdenv.mkDerivation {
+    name = "hexmap";
+    version = "2020-06-06";
+
+    src = fetchFromGitHub {
+      owner = "lifelike";
+      repo = "hexmapextension";
+      rev = "11401e23889318bdefb72df6980393050299d8cc";
+      sha256 = "1a4jhva624mbljj2k43wzi6hrxacjz4626jfk9y2fg4r4sga22mm";
+    };
+
+    preferLocalBuild = true;
+
+    installPhase = ''
+      runHook preInstall
+
+      mkdir -p "$out/share/inkscape/extensions"
+      cp -p *.inx *.py "$out/share/inkscape/extensions/"
+      find "$out/share/inkscape/extensions/" -name "*.py" -exec chmod +x {} \;
+
+      runHook postInstall
+    '';
+
+    meta = with lib; {
+      description = "This is an extension for creating hex grids in Inkscape. It can also be used to make brick patterns of staggered rectangles";
+      homepage = "https://github.com/lifelike/hexmapextension";
+      license = licenses.gpl2Plus;
+      maintainers = [ maintainers.raboof ];
+      platforms = platforms.all;
+    };
+  };
+  inkcut = (runCommand "inkcut-inkscape-plugin" {} ''
+    mkdir -p $out/share/inkscape/extensions
+    cp ${inkcut}/share/inkscape/extensions/* $out/share/inkscape/extensions
+  '');
+}
diff --git a/nixpkgs/pkgs/applications/graphics/inkscape/extensions/applytransforms/default.nix b/nixpkgs/pkgs/applications/graphics/inkscape/extensions/applytransforms/default.nix
new file mode 100644
index 000000000000..f1bac3dd76c4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/inkscape/extensions/applytransforms/default.nix
@@ -0,0 +1,42 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, python3
+}:
+
+stdenv.mkDerivation {
+  pname = "inkscape-applytransforms";
+  version = "0.pre+unstable=2021-05-11";
+
+  src = fetchFromGitHub {
+    owner = "Klowner";
+    repo = "inkscape-applytransforms";
+    rev = "5b3ed4af0fb66e399e686fc2b649b56db84f6042";
+    sha256 = "XWwkuw+Um/cflRWjIeIgQUxJLrk2DLDmx7K+pMWvIlI=";
+  };
+
+  checkInputs = [
+    python3.pkgs.inkex
+    python3.pkgs.pytestCheckHook
+  ];
+
+  dontBuild = true;
+
+  doCheck = true;
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dt "$out/share/inkscape/extensions" *.inx *.py
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Inkscape extension which removes all matrix transforms by applying them recursively to shapes";
+    homepage = "https://github.com/Klowner/inkscape-applytransforms";
+    license = licenses.gpl2Only;
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/inkscape/fix-python-paths.patch b/nixpkgs/pkgs/applications/graphics/inkscape/fix-python-paths.patch
new file mode 100644
index 000000000000..9634be50497f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/inkscape/fix-python-paths.patch
@@ -0,0 +1,17 @@
+diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp
+index bc6c0ed845..181467834d 100644
+--- a/src/extension/implementation/script.cpp
++++ b/src/extension/implementation/script.cpp
+@@ -82,10 +82,10 @@ const std::map<std::string, Script::interpreter_t> Script::interpreterTab = {
+     { "python",  {"python-interpreter",  {"pythonw"           }}},
+ #elif defined __APPLE__
+     { "perl",    {"perl-interpreter",    {"perl"              }}},
+-    { "python",  {"python-interpreter",  {"python3"           }}},
++    { "python",  {"python-interpreter",  {"@python3@"         }}},
+ #else
+     { "perl",    {"perl-interpreter",    {"perl"              }}},
+-    { "python",  {"python-interpreter",  {"python3", "python" }}},
++    { "python",  {"python-interpreter",  {"@python3@"         }}},
+ #endif
+     { "python2", {"python2-interpreter", {"python2", "python" }}},
+     { "ruby",    {"ruby-interpreter",    {"ruby"    }}},
diff --git a/nixpkgs/pkgs/applications/graphics/inkscape/with-extensions.nix b/nixpkgs/pkgs/applications/graphics/inkscape/with-extensions.nix
new file mode 100644
index 000000000000..14fffadd0360
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/inkscape/with-extensions.nix
@@ -0,0 +1,27 @@
+{ lib
+, inkscape
+, symlinkJoin
+, makeWrapper
+, inkscapeExtensions ? [ ]
+, inkscape-extensions
+}:
+
+let
+  allExtensions = lib.filter (pkg: lib.isDerivation pkg && !pkg.meta.broken or false) (lib.attrValues inkscape-extensions);
+  selectedExtensions = if inkscapeExtensions == null then allExtensions else inkscapeExtensions;
+in
+
+symlinkJoin {
+  name = "inkscape-with-extensions-${lib.getVersion inkscape}";
+
+  paths = [ inkscape ] ++ selectedExtensions;
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  postBuild = ''
+    rm -f $out/bin/inkscape
+    makeWrapper "${inkscape}/bin/inkscape" "$out/bin/inkscape" --set INKSCAPE_DATADIR "$out/share"
+  '';
+
+  inherit (inkscape) meta;
+}
diff --git a/nixpkgs/pkgs/applications/graphics/ipe/default.nix b/nixpkgs/pkgs/applications/graphics/ipe/default.nix
new file mode 100644
index 000000000000..72c79d7dc501
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/ipe/default.nix
@@ -0,0 +1,67 @@
+{ lib
+, mkDerivation
+, fetchurl
+, pkg-config
+, cairo
+, freetype
+, ghostscript
+, gsl
+, libjpeg
+, libpng
+, libspiro
+, lua5
+, qtbase
+, texlive
+, zlib
+}:
+
+mkDerivation rec {
+  pname = "ipe";
+  version = "7.2.23";
+
+  src = fetchurl {
+    url = "https://dl.bintray.com/otfried/generic/ipe/7.2/${pname}-${version}-src.tar.gz";
+    sha256 = "0yvm3zfba1ljyy518vjnvwpyg7lgnmdwm19v5k0wfgz64aca56x1";
+  };
+
+  sourceRoot = "${pname}-${version}/src";
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [
+    cairo
+    freetype
+    ghostscript
+    gsl
+    libjpeg
+    libpng
+    libspiro
+    lua5
+    qtbase
+    texlive
+    zlib
+  ];
+
+  IPEPREFIX=placeholder "out";
+  URWFONTDIR="${texlive}/texmf-dist/fonts/type1/urw/";
+  LUA_PACKAGE = "lua";
+
+  qtWrapperArgs = [ "--prefix PATH : ${texlive}/bin"  ];
+
+  enableParallelBuilding = true;
+
+  # TODO: make .desktop entry
+
+  meta = with lib; {
+    description = "An editor for drawing figures";
+    homepage = "http://ipe.otfried.org";  # https not available
+    license = licenses.gpl3Plus;
+    longDescription = ''
+      Ipe is an extensible drawing editor for creating figures in PDF and Postscript format.
+      It supports making small figures for inclusion into LaTeX-documents
+      as well as presentations in PDF.
+    '';
+    maintainers = with maintainers; [ ttuegel ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/jpeg-archive/default.nix b/nixpkgs/pkgs/applications/graphics/jpeg-archive/default.nix
new file mode 100644
index 000000000000..b974e271a675
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/jpeg-archive/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchFromGitHub, mozjpeg, makeWrapper, coreutils, parallel, findutils }:
+
+stdenv.mkDerivation {
+  pname = "jpeg-archive";
+  version = "2.2.0"; # can be found here https://github.com/danielgtaylor/jpeg-archive/blob/master/src/util.c#L15
+
+  # update with
+  # nix-prefetch-git https://github.com/danielgtaylor/jpeg-archive
+  src = fetchFromGitHub {
+    owner = "danielgtaylor";
+    repo = "jpeg-archive";
+    rev = "8da4bf76b6c3c0e11e4941294bfc1857c119419b";
+    sha256 = "1639y9qp2ls80fzimwmwds792q8rq5p6c14c0r4jswx4yp6dcs33";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ mozjpeg ];
+
+  prePatch = ''
+    # allow override LIBJPEG
+    substituteInPlace Makefile --replace 'LIBJPEG =' 'LIBJPEG ?='
+  '';
+
+  makeFlags = [
+    "CC=${stdenv.cc.targetPrefix}cc"
+    "PREFIX=$(out)"
+    "MOZJPEG_PREFIX=${mozjpeg}"
+    "LIBJPEG=${mozjpeg}/lib/libjpeg${stdenv.hostPlatform.extensions.sharedLibrary}"
+  ];
+
+  postInstall = ''
+    wrapProgram $out/bin/jpeg-archive \
+      --set PATH "$out/bin:${coreutils}/bin:${parallel}/bin:${findutils}/bin"
+  '';
+
+  meta = with lib; {
+    description = "Utilities for archiving photos for saving to long term storage or serving over the web";
+    homepage    = "https://github.com/danielgtaylor/jpeg-archive";
+    license = licenses.mit;
+    maintainers = [ maintainers.srghma ];
+    platforms   = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/jpeginfo/default.nix b/nixpkgs/pkgs/applications/graphics/jpeginfo/default.nix
new file mode 100644
index 000000000000..1660d89eacf9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/jpeginfo/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, libjpeg }:
+
+stdenv.mkDerivation rec {
+  pname = "jpeginfo";
+  version = "1.6.1";
+
+  src = fetchurl {
+    url = "https://www.kokkonen.net/tjko/src/${pname}-${version}.tar.gz";
+    sha256 = "0lvn3pnylyj56158d3ix9w1gas1s29klribw9bz1xym03p7k37k2";
+  };
+
+  buildInputs = [ libjpeg ];
+
+  meta = with lib; {
+    description = "Prints information and tests integrity of JPEG/JFIF files";
+    homepage = "https://www.kokkonen.net/tjko/projects.html";
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.bjornfor ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/jpegoptim/default.nix b/nixpkgs/pkgs/applications/graphics/jpegoptim/default.nix
new file mode 100644
index 000000000000..6095d81c528d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/jpegoptim/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl, libjpeg }:
+
+stdenv.mkDerivation rec {
+  version = "1.4.6";
+  pname = "jpegoptim";
+
+  src = fetchurl {
+    url = "https://www.kokkonen.net/tjko/src/${pname}-${version}.tar.gz";
+    sha256 = "1dss7907fclfl8zsw0bl4qcw0hhz6fqgi3867w0jyfm3q9jfpcc8";
+  };
+
+  # There are no checks, it seems.
+  doCheck = false;
+
+  buildInputs = [ libjpeg ];
+
+  meta = with lib; {
+    description = "Optimize JPEG files";
+    homepage = "https://www.kokkonen.net/tjko/projects.html";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.aristid ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/jpegrescan/default.nix b/nixpkgs/pkgs/applications/graphics/jpegrescan/default.nix
new file mode 100644
index 000000000000..1a7320bf6930
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/jpegrescan/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchFromGitHub, makeWrapper, libjpeg_turbo, perl, perlPackages }:
+
+stdenv.mkDerivation rec {
+  pname = "jpegrescan";
+  date = "2016-06-01";
+  name = "${pname}-${date}";
+
+  src = fetchFromGitHub {
+    owner = "kud";
+    repo = pname;
+    rev = "e5e39cd972b48ccfb2cba4da6855c511385c05f9";
+    sha256 = "0jbx1vzkzif6yjx1fnsm7fjsmq166sh7mn22lf01ll7s245nmpdp";
+  };
+
+  patchPhase = ''
+    patchShebangs jpegrescan
+  '';
+
+  installPhase = ''
+    mkdir -p $out/share/jpegrescan
+    mv README.md $out/share/jpegrescan/
+    mkdir $out/bin
+    mv jpegrescan $out/bin
+    chmod +x $out/bin/jpegrescan
+
+    wrapProgram $out/bin/jpegrescan --prefix PERL5LIB : $PERL5LIB
+  '';
+
+  propagatedBuildInputs = [ perlPackages.FileSlurp ];
+
+  buildInputs = [
+    perl libjpeg_turbo makeWrapper
+  ];
+
+  meta = with lib; {
+    description = "losslessly shrink any JPEG file";
+    homepage = "https://github.com/kud/jpegrescan";
+    license = licenses.publicDomain;
+    maintainers = [ maintainers.ramkromberg ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/k3d/default.nix b/nixpkgs/pkgs/applications/graphics/k3d/default.nix
new file mode 100644
index 000000000000..68e28c5cc886
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/k3d/default.nix
@@ -0,0 +1,51 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, ftgl, glew, asciidoc
+, cmake, ninja, libGLU, libGL, zlib, python2, expat, libxml2, libsigcxx, libuuid, freetype
+, libpng, boost, doxygen, cairomm, pkg-config, libjpeg, libtiff
+, gettext, intltool, perl, gtkmm2, glibmm, gtkglext, libXmu }:
+
+stdenv.mkDerivation rec {
+  version = "0.8.0.6";
+  pname = "k3d";
+  src = fetchFromGitHub {
+    owner = "K-3D";
+    repo = "k3d";
+    rev = "${pname}-${version}";
+    sha256 = "0vdjjg6h8mxm2n8mvkkg2mvd27jn2xx90hnmx23cbd35mpz9p4aa";
+  };
+
+  patches = [
+    (fetchpatch { /* glibmm 2.50 fix */
+      url = "https://github.com/K-3D/k3d/commit/c65889d0652490d88a573e47de7a9324bf27bff2.patch";
+      sha256 = "162icv1hicr2dirkb9ijacvg9bhz5j30yfwg7b45ijavk8rns62j";
+    })
+  ];
+
+  cmakeFlags = [
+    "-DK3D_BUILD_DOCS=false"
+    "-DK3D_BUILD_GUIDE=false"
+  ];
+
+  preConfigure = ''
+    export LD_LIBRARY_PATH="$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/build/lib"
+  '';
+
+  nativeBuildInputs = [ cmake ninja gettext intltool doxygen pkg-config perl asciidoc ];
+
+  buildInputs = [
+     libGLU libGL zlib python2 expat libxml2 libsigcxx libuuid freetype libpng
+     boost cairomm libjpeg libtiff
+     ftgl glew gtkmm2 glibmm gtkglext libXmu
+    ];
+
+  #doCheck = false;
+
+  NIX_CFLAGS_COMPILE = "-Wno-deprecated-declarations";
+
+  meta = with lib; {
+    description = "A 3D editor with support for procedural editing";
+    homepage = "http://www.k-3d.org/";
+    platforms = platforms.linux;
+    maintainers = [ maintainers.raskin ];
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/kcc/default.nix b/nixpkgs/pkgs/applications/graphics/kcc/default.nix
new file mode 100644
index 000000000000..bbbd4ed351bc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/kcc/default.nix
@@ -0,0 +1,38 @@
+{ lib
+, mkDerivationWith
+, python3Packages
+, p7zip
+, archiveSupport ? true
+}:
+
+mkDerivationWith python3Packages.buildPythonApplication rec {
+  pname = "kcc";
+  version = "5.5.1";
+
+  src = python3Packages.fetchPypi {
+    inherit version;
+    pname = "KindleComicConverter";
+    sha256 = "5dbee5dc5ee06a07316ae5ebaf21ffa1970094dbae5985ad735e2807ef112644";
+  };
+
+  propagatedBuildInputs = with python3Packages ; [
+    pillow
+    pyqt5
+    psutil
+    python-slugify
+    raven
+  ];
+
+  qtWrapperArgs = lib.optional archiveSupport [ "--prefix" "PATH" ":" "${ lib.makeBinPath [ p7zip ] }" ];
+
+  postFixup =  ''
+    wrapProgram $out/bin/kcc "''${qtWrapperArgs[@]}"
+  '';
+
+  meta = with lib; {
+    description = "Python app to convert comic/manga files or folders to EPUB, Panel View MOBI or E-Ink optimized CBZ";
+    homepage = "https://kcc.iosphe.re";
+    license = licenses.isc;
+    maintainers = with maintainers; [ dawidsowa ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/kgraphviewer/default.nix b/nixpkgs/pkgs/applications/graphics/kgraphviewer/default.nix
new file mode 100644
index 000000000000..4b9b93505ad8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/kgraphviewer/default.nix
@@ -0,0 +1,36 @@
+{ lib, mkDerivation, fetchurl, cmake, extra-cmake-modules, pkg-config, wrapGAppsHook
+, kconfig, kinit, kdoctools, kio, kparts, kwidgetsaddons
+, qtbase, qtsvg
+, boost, graphviz
+}:
+
+mkDerivation rec {
+  pname = "kgraphviewer";
+  version = "2.4.3";
+
+  src = fetchurl {
+    url = "mirror://kde/stable/kgraphviewer/${version}/${pname}-${version}.tar.xz";
+    sha256 = "1h6pgg89gvxl8gw7wmkabyqqrzad5pxyv5lsmn1fl4ir8lcc5q2l";
+  };
+
+  buildInputs = [
+    qtbase qtsvg
+    boost graphviz
+  ];
+
+  nativeBuildInputs = [
+    cmake extra-cmake-modules pkg-config wrapGAppsHook
+    kdoctools
+  ];
+
+  propagatedBuildInputs = [
+    kconfig kinit kio kparts kwidgetsaddons
+  ];
+
+  meta = with lib; {
+    description = "A Graphviz dot graph viewer for KDE";
+    license     = licenses.gpl2;
+    maintainers = with maintainers; [ ];
+    platforms   = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/kodelife/default.nix b/nixpkgs/pkgs/applications/graphics/kodelife/default.nix
new file mode 100644
index 000000000000..1c4609ac55b7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/kodelife/default.nix
@@ -0,0 +1,66 @@
+{ lib, stdenv
+, fetchzip
+, alsa-lib
+, glib
+, gst_all_1
+, libGLU, libGL
+, xorg
+}:
+
+stdenv.mkDerivation rec {
+  pname = "kodelife";
+  version = "0.9.8.143";
+
+  suffix = {
+    aarch64-linux = "linux-arm64";
+    armv7l-linux  = "linux-armhf";
+    x86_64-linux  = "linux-x86_64";
+  }.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
+
+  src = fetchzip {
+    url = "https://hexler.net/pub/${pname}/${pname}-${version}-${suffix}.zip";
+    sha256 = {
+      aarch64-linux = "0ryjmpzpfqdqrvqpq851vvrjd8ld5g91gcigpv9rxp3z1b7qdand";
+      armv7l-linux  = "08nlwn8ixndqil4m7j6c8gjxmwx8zi3in86arnwf13shk6cds5nb";
+      x86_64-linux  = "0kbz7pvh4i4a3pj1vzbzzslha825i888isvsigcqsqvipjr4798q";
+    }.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
+  };
+
+  dontConfigure = true;
+  dontBuild = true;
+  dontStrip = true;
+  dontPatchELF = true;
+  preferLocalBuild = true;
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/bin
+    mv KodeLife $out/bin
+    runHook postInstall
+  '';
+
+  preFixup = let
+    libPath = lib.makeLibraryPath [
+      stdenv.cc.cc.lib
+      alsa-lib
+      glib
+      gst_all_1.gstreamer
+      gst_all_1.gst-plugins-base
+      libGLU libGL
+      xorg.libX11
+    ];
+  in ''
+    patchelf \
+      --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+      --set-rpath "${libPath}" \
+      $out/bin/KodeLife
+  '';
+
+  meta = with lib; {
+    homepage = "https://hexler.net/products/kodelife";
+    description = "Real-time GPU shader editor";
+    license = licenses.unfree;
+    maintainers = with maintainers; [ prusnak ];
+    platforms = [ "aarch64-linux" "armv7l-linux" "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/krita/beta.nix b/nixpkgs/pkgs/applications/graphics/krita/beta.nix
new file mode 100644
index 000000000000..167a96050fd6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/krita/beta.nix
@@ -0,0 +1,7 @@
+{ callPackage, ... } @ args:
+
+callPackage ./generic.nix (args // {
+  version = "5.0.0-beta1";
+  kde-channel = "unstable";
+  sha256 = "1p5l2vpsgcp4wajgn5rgjcyb8l5ickm1nkmfx8zzr4rnwjnyxdbm";
+})
diff --git a/nixpkgs/pkgs/applications/graphics/krita/default.nix b/nixpkgs/pkgs/applications/graphics/krita/default.nix
new file mode 100644
index 000000000000..7e0a8915c408
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/krita/default.nix
@@ -0,0 +1,7 @@
+{ callPackage, ... } @ args:
+
+callPackage ./generic.nix (args // {
+  version = "4.4.8";
+  kde-channel = "stable";
+  sha256 = "1y0d8gnxfdg5nfwk8dgx8fc2bwskvnys049napb1a9fr25bqmimw";
+})
diff --git a/nixpkgs/pkgs/applications/graphics/krita/generic.nix b/nixpkgs/pkgs/applications/graphics/krita/generic.nix
new file mode 100644
index 000000000000..efaf341b1f64
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/krita/generic.nix
@@ -0,0 +1,59 @@
+{ mkDerivation, lib, stdenv, makeWrapper, fetchurl, cmake, extra-cmake-modules
+, karchive, kconfig, kwidgetsaddons, kcompletion, kcoreaddons
+, kguiaddons, ki18n, kitemmodels, kitemviews, kwindowsystem
+, kio, kcrash, breeze-icons
+, boost, libraw, fftw, eigen, exiv2, libheif, lcms2, gsl, openexr, giflib
+, openjpeg, opencolorio_1, vc, poppler, curl, ilmbase
+, qtmultimedia, qtx11extras, quazip
+, python3Packages
+
+, version
+, kde-channel
+, sha256
+
+, callPackage
+}:
+
+mkDerivation rec {
+  pname = "krita";
+  inherit version;
+
+  src = fetchurl {
+    url = "https://download.kde.org/${kde-channel}/${pname}/${version}/${pname}-${version}.tar.gz";
+    inherit sha256;
+  };
+
+  nativeBuildInputs = [ cmake extra-cmake-modules python3Packages.sip_4 makeWrapper ];
+
+  buildInputs = [
+    karchive kconfig kwidgetsaddons kcompletion kcoreaddons kguiaddons
+    ki18n kitemmodels kitemviews kwindowsystem kio kcrash breeze-icons
+    boost libraw fftw eigen exiv2 lcms2 gsl openexr libheif giflib
+    openjpeg opencolorio_1 poppler curl ilmbase
+    qtmultimedia qtx11extras quazip
+    python3Packages.pyqt5
+  ] ++ lib.optional (stdenv.hostPlatform.isi686 || stdenv.hostPlatform.isx86_64) vc;
+
+  NIX_CFLAGS_COMPILE = [ "-I${ilmbase.dev}/include/OpenEXR" ]
+    ++ lib.optional stdenv.cc.isGNU "-Wno-deprecated-copy";
+
+  cmakeFlags = [
+    "-DPYQT5_SIP_DIR=${python3Packages.pyqt5}/${python3Packages.python.sitePackages}/PyQt5/bindings"
+    "-DPYQT_SIP_DIR_OVERRIDE=${python3Packages.pyqt5}/${python3Packages.python.sitePackages}/PyQt5/bindings"
+    "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
+  ];
+
+  postInstall = ''
+    for i in $out/bin/*; do
+      wrapProgram $i --prefix PYTHONPATH : "$PYTHONPATH"
+    done
+  '';
+
+  meta = with lib; {
+    description = "A free and open source painting application";
+    homepage = "https://krita.org/";
+    maintainers = with maintainers; [ abbradar ];
+    platforms = platforms.linux;
+    license = licenses.gpl3Only;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/krop/default.nix b/nixpkgs/pkgs/applications/graphics/krop/default.nix
new file mode 100644
index 000000000000..ef335cd6be2a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/krop/default.nix
@@ -0,0 +1,51 @@
+{ lib, fetchFromGitHub, python3Packages, libsForQt5, ghostscript, qt5}:
+
+python3Packages.buildPythonApplication rec {
+  pname = "krop";
+  version = "0.6.0";
+
+  src = fetchFromGitHub {
+    owner = "arminstraub";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1ygzc7vlwszqmsd3v1dsqp1dpsn6inx7g8gck63alvf88dbn8m3s";
+  };
+
+  propagatedBuildInputs = with python3Packages; [
+    pyqt5
+    pypdf2
+    poppler-qt5
+    ghostscript
+  ];
+  buildInputs = [
+    libsForQt5.poppler
+  ];
+
+  nativeBuildInputs = [ qt5.wrapQtAppsHook ];
+  makeWrapperArgs = [
+   "\${qtWrapperArgs[@]}"
+  ];
+
+  postInstall = ''
+    install -m666 -Dt $out/share/applications krop.desktop
+  '';
+
+  # Disable checks because of interference with older Qt versions // xcb
+  doCheck = false;
+
+  meta = {
+    homepage = "http://arminstraub.com/software/krop";
+    description = "Graphical tool to crop the pages of PDF files";
+    longDescription = ''
+    Krop is a tool that allows you to optimise your PDF files, and remove
+    sections of the page you do not want.  A unique feature of krop, at least to my
+    knowledge, is its ability to automatically split pages into subpages to fit the
+    limited screensize of devices such as eReaders. This is particularly useful, if
+    your eReader does not support convenient scrolling. Krop also has a command line
+    interface.
+    '';
+    license = lib.licenses.gpl3Plus;
+    maintainers = with lib.maintainers; [ leenaars ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/ktikz/default.nix b/nixpkgs/pkgs/applications/graphics/ktikz/default.nix
new file mode 100644
index 000000000000..d176ce38f0ad
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/ktikz/default.nix
@@ -0,0 +1,60 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch
+, pkg-config, wrapQtAppsHook
+, poppler, gnuplot
+, qmake, qtbase, qttools
+}:
+
+# This package only builds ktikz without KDE integration because KDE4 is
+# deprecated and upstream does not (yet ?) support KDE5.
+# See historical versions of this file for building ktikz with KDE4.
+
+stdenv.mkDerivation rec {
+  version = "0.12";
+  pname = "qtikz";
+
+  meta = with lib; {
+    description = "Editor for the TikZ language";
+    homepage = "https://github.com/fhackenberger/ktikz";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.layus ];
+    longDescription = ''
+      You will also need a working *tex installation in your PATH, containing at least `preview` and `pgf`.
+    '';
+  };
+
+  src = fetchFromGitHub {
+    owner = "fhackenberger";
+    repo = "ktikz";
+    rev = version;
+    sha256 = "1s83x8r2yi64wc6ah2iz09dj3qahy0fkxx6cfgpkavjw9x0j0582";
+  };
+
+  patches = [
+    # Fix version in qtikz.pro
+    (fetchpatch {
+      url = "https://github.com/fhackenberger/ktikz/commit/972685a406517bb85eb561f2c8e26f029eacd7db.patch";
+      sha256 = "13z40rcd4m4n088v7z2ns17lnpn0z3rzp31lsamic3qdcwjwa5k8";
+    })
+    # Fix missing qt5.15 QPainterPath include
+    (fetchpatch {
+      url = "https://github.com/fhackenberger/ktikz/commit/ebe4dfb72ac8a137b475ef688b9f7ac3e5c7f242.patch";
+      sha256 = "GIgPh+iUBPftHKIpZR3a0FxmLhMLuPUapF/t+bCuqMs=";
+    })
+  ];
+
+  nativeBuildInputs = [ pkg-config qttools qmake wrapQtAppsHook ];
+  QT_PLUGIN_PATH = "${qtbase}/${qtbase.qtPluginPrefix}";
+
+  buildInputs = [ qtbase poppler ];
+
+  qmakeFlags = [
+    "DESKTOP_INSTALL_DIR=${placeholder "out"}/share/applications"
+    "MIME_INSTALL_DIR=${placeholder "out"}/share/mime/packages"
+    # qcollectiongenerator does no more exist in `qt5.qttools`.
+    # It was merged with qhelpgenerator at some point.
+    "QCOLLECTIONGENERATORCOMMAND=qhelpgenerator"
+  ];
+
+  qtWrapperArgs = [ ''--prefix PATH : "${gnuplot}/bin"'' ];
+}
diff --git a/nixpkgs/pkgs/applications/graphics/lazpaint/default.nix b/nixpkgs/pkgs/applications/graphics/lazpaint/default.nix
new file mode 100644
index 000000000000..82eab9757c73
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/lazpaint/default.nix
@@ -0,0 +1,68 @@
+{ lib, stdenv, fetchFromGitHub, lazarus, fpc, pango, cairo, glib
+, atk, gtk2, libX11, gdk-pixbuf, busybox, python3, makeWrapper }:
+
+with stdenv;
+
+let
+  bgrabitmap = fetchFromGitHub {
+    owner = "bgrabitmap";
+    repo = "bgrabitmap";
+    rev = "v11.2.5";
+    sha256 = "0w5pdihsxn039kalkf4cx23j69hz5r09qmhd358h2n74irv1r3x1";
+  };
+  bgracontrols = fetchFromGitHub {
+    owner = "bgrabitmap";
+    repo = "bgracontrols";
+    rev = "v7.0";
+    sha256 = "0qz3cscrc9jvhrix1hbmzhdxv6mxk0mz9azr46canflsydda8fjy";
+  };
+in stdenv.mkDerivation rec {
+  pname = "lazpaint";
+  version = "7.1.5";
+
+  src = fetchFromGitHub {
+    owner = "bgrabitmap";
+    repo = "lazpaint";
+    rev = "v${version}";
+    sha256 = "0bpk3rlqzbxvgrxmrzs0hcrgwhsqnpjqv1kdd9cp09knimmksvy5";
+  };
+
+  nativeBuildInputs = [ lazarus fpc makeWrapper ];
+
+  buildInputs = [ pango cairo glib atk gtk2 libX11 gdk-pixbuf ];
+
+  NIX_LDFLAGS = "--as-needed -rpath ${lib.makeLibraryPath buildInputs}";
+
+  buildPhase = ''
+    cp -r --no-preserve=mode ${bgrabitmap} bgrabitmap
+    cp -r --no-preserve=mode ${bgracontrols} bgracontrols
+
+    lazbuild --lazarusdir=${lazarus}/share/lazarus \
+      --build-mode=Release \
+      bgrabitmap/bgrabitmap/bgrabitmappack.lpk \
+      bgracontrols/bgracontrols.lpk \
+      lazpaintcontrols/lazpaintcontrols.lpk \
+      lazpaint/lazpaint.lpi
+  '';
+
+  installPhase = ''
+    # Reuse existing install script
+    cd lazpaint/release/debian
+    substituteInPlace makedeb.sh --replace "rm -rf" "ls"
+    patchShebangs ./makedeb.sh
+    PATH=$PATH:${busybox}/bin ./makedeb.sh
+    cp -r staging/usr $out
+
+    # Python is needed for scripts
+    makeWrapper $out/share/lazpaint/lazpaint $out/bin/lazpaint \
+      --prefix PATH : ${lib.makeBinPath [ python3 ]}
+  '';
+
+  meta = with lib; {
+    description = "Image editor like PaintBrush or Paint.Net";
+    homepage = "https://sourceforge.net/projects/lazpaint/";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/leocad/default.nix b/nixpkgs/pkgs/applications/graphics/leocad/default.nix
new file mode 100644
index 000000000000..9c16e23ebb59
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/leocad/default.nix
@@ -0,0 +1,53 @@
+{ lib
+, mkDerivation
+, fetchFromGitHub
+, fetchurl
+, qmake
+, qttools
+, zlib
+}:
+
+/*
+To use aditional parts libraries
+set the variable LEOCAD_LIB=/path/to/libs/ or use option -l /path/to/libs/
+*/
+
+let
+  parts = fetchurl {
+    url = "https://web.archive.org/web/20190715142541/https://www.ldraw.org/library/updates/complete.zip";
+    sha256 = "sha256-PW3XCbFwRaNkx4EgCnl2rXH7QgmpNgjTi17kZ5bladA=";
+  };
+
+in
+mkDerivation rec {
+  pname = "leocad";
+  version = "21.03";
+
+  src = fetchFromGitHub {
+    owner = "leozide";
+    repo = "leocad";
+    rev = "v${version}";
+    sha256 = "sha256-69Ocfk5dBXwcRqAZWEP9Xg41o/tAQo76dIOk9oYhCUE=";
+  };
+
+  nativeBuildInputs = [ qmake qttools ];
+
+  buildInputs = [ zlib ];
+
+  qmakeFlags = [
+    "INSTALL_PREFIX=${placeholder "out"}"
+    "DISABLE_UPDATE_CHECK=1"
+  ];
+
+  qtWrapperArgs = [
+    "--set-default LEOCAD_LIB ${parts}"
+  ];
+
+  meta = with lib; {
+    description = "CAD program for creating virtual LEGO models";
+    homepage = "https://www.leocad.org/";
+    license = licenses.gpl2Only;
+    maintainers = with maintainers; [ peterhoeg ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/lightburn/default.nix b/nixpkgs/pkgs/applications/graphics/lightburn/default.nix
new file mode 100644
index 000000000000..cc6c4f42e640
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/lightburn/default.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv, patchelf, fetchurl, p7zip
+, nss, nspr, libusb1
+, qtbase, qtmultimedia, qtserialport
+, autoPatchelfHook, wrapQtAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "lightburn";
+  version = "1.0.02";
+
+  nativeBuildInputs = [
+    p7zip
+    autoPatchelfHook
+    wrapQtAppsHook
+  ];
+
+  src = fetchurl {
+    url = "https://github.com/LightBurnSoftware/deployment/releases/download/${version}/LightBurn-Linux64-v${version}.7z";
+    sha256 = "sha256-JaKThw6ubutpOCsO1pVAPVxhhUTKpfYRHjBSu02nlN4=";
+  };
+
+  buildInputs = [
+    nss nspr libusb1
+    qtbase qtmultimedia qtserialport
+  ];
+
+  # We nuke the vendored Qt5 libraries that LightBurn ships and instead use our
+  # own.
+  unpackPhase = ''
+    7z x $src
+    rm -rf LightBurn/lib LightBurn/plugins
+  '';
+
+  installPhase = ''
+    mkdir -p $out/share $out/bin
+    cp -ar LightBurn $out/share/LightBurn
+    ln -s $out/share/LightBurn/LightBurn $out/bin
+
+    wrapQtApp $out/bin/LightBurn
+  '';
+
+  meta = {
+    description = "Layout, editing, and control software for your laser cutter";
+    homepage = "https://lightburnsoftware.com/";
+    license = lib.licenses.unfree;
+    maintainers = with lib.maintainers; [ q3k ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/luminance-hdr/default.nix b/nixpkgs/pkgs/applications/graphics/luminance-hdr/default.nix
new file mode 100644
index 000000000000..c44ff57d18f3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/luminance-hdr/default.nix
@@ -0,0 +1,34 @@
+{ lib, mkDerivation, cmake, fetchFromGitHub, pkg-config
+, boost, exiv2, fftwFloat, gsl
+, ilmbase, lcms2, libraw, libtiff, openexr
+, qtbase, qtdeclarative, qttools, qtwebengine, eigen
+}:
+
+mkDerivation rec {
+  pname = "luminance-hdr";
+  version = "2.6.0";
+
+  src = fetchFromGitHub {
+    owner = "LuminanceHDR";
+    repo = "LuminanceHDR";
+    rev = "v.${version}";
+    sha256 = "1izmgjjp8mgyxv57sjjr05z7g7059ykb5wchlcn4wrnnb6aslnvn";
+  };
+
+  NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR";
+
+  buildInputs = [
+    qtbase qtdeclarative qttools qtwebengine eigen
+    boost exiv2 fftwFloat gsl ilmbase lcms2 libraw libtiff openexr
+  ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  meta = with lib; {
+    homepage = "http://qtpfsgui.sourceforge.net/";
+    description = "A complete open source solution for HDR photography";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.hrdinka ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/mandelbulber/default.nix b/nixpkgs/pkgs/applications/graphics/mandelbulber/default.nix
new file mode 100644
index 000000000000..a113136c248a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/mandelbulber/default.nix
@@ -0,0 +1,64 @@
+{ lib
+, mkDerivation
+, fetchFromGitHub
+, libpng
+, gsl
+, libsndfile
+, lzo
+, qmake
+, qttools
+, qtbase
+, qtmultimedia
+, withOpenCL ? true
+, opencl-clhpp ? null
+, ocl-icd ? null
+}:
+
+assert withOpenCL -> opencl-clhpp != null;
+assert withOpenCL -> ocl-icd != null;
+
+mkDerivation rec {
+  pname = "mandelbulber";
+  version = "2.26";
+
+  src = fetchFromGitHub {
+    owner = "buddhi1980";
+    repo = "mandelbulber2";
+    rev = version;
+    sha256 = "sha256-RKpg7LBsrBFOlFozoDcALwGeZ9whPiCpFMZF5ljsp7Q=";
+  };
+
+  nativeBuildInputs = [
+    qmake
+    qttools
+  ];
+  buildInputs = [
+    qtbase
+    qtmultimedia
+    libpng
+    gsl
+    libsndfile
+    lzo
+  ] ++ lib.optionals withOpenCL [
+    opencl-clhpp
+    ocl-icd
+  ];
+
+  sourceRoot = "${src.name}/mandelbulber2";
+
+  qmakeFlags = [
+    "SHARED_PATH=${placeholder "out"}"
+    (if withOpenCL
+      then "qmake/mandelbulber-opencl.pro"
+      else "qmake/mandelbulber.pro")
+  ];
+
+  meta = with lib; {
+    description = "A 3D fractal rendering engine";
+    longDescription = "Mandelbulber creatively generates three-dimensional fractals. Explore trigonometric, hyper-complex, Mandelbox, IFS, and many other 3D fractals.";
+    homepage = "https://mandelbulber.com";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ kovirobi ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/mcomix3/default.nix b/nixpkgs/pkgs/applications/graphics/mcomix3/default.nix
new file mode 100644
index 000000000000..db777b3bd77d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/mcomix3/default.nix
@@ -0,0 +1,104 @@
+{ lib
+, fetchFromGitHub
+, wrapGAppsHook
+, installShellFiles
+, python3
+, gobject-introspection
+, gtk3
+, gdk-pixbuf
+
+# Recommended Dependencies:
+, unrarSupport ? false  # unfree software
+, unrar
+, p7zip
+, lhasa
+, mupdf
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "mcomix3";
+  version = "unstable-2021-04-23";
+
+  # no official release on pypi/github and no build system
+  src = fetchFromGitHub {
+    repo   = "${pname}";
+    owner  = "multiSnow";
+    rev = "139344e23898c28484328fc29fd0c6659affb12d";
+    sha256 = "0q9xgl60ryf7qmy5vgzgfry4rvw5j9rb4d1ilxmpjmvm7dd3fm2k";
+  };
+
+  buildInputs = [ gobject-introspection gtk3 gdk-pixbuf ];
+  nativeBuildInputs = [ wrapGAppsHook installShellFiles ];
+  propagatedBuildInputs = (with python3.pkgs; [ pillow pygobject3 pycairo ]);
+
+  format = "other";
+
+  # Correct wrapper behavior, see https://github.com/NixOS/nixpkgs/issues/56943
+  # until https://github.com/NixOS/nixpkgs/pull/102613
+  strictDeps = false;
+
+  preInstall = ''
+    libdir=$out/lib/${python3.libPrefix}/site-packages
+    mkdir -p $out/share/{icons/hicolor,man/man1,applications,metainfo,thumbnailers}
+    mkdir -p $out/bin $libdir
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    substituteInPlace mime/*.desktop \
+      --replace "Exec=mcomix" "Exec=mcomix3"
+    ${python3.executable} installer.py --srcdir=mcomix --target=$libdir
+    mv $libdir/mcomix/mcomixstarter.py $out/bin/${pname}
+    mv $libdir/mcomix/comicthumb.py $out/bin/comicthumb
+    mv $libdir/mcomix/mcomix/* $libdir/mcomix
+
+    runHook postInstall
+  '';
+
+  postInstall = ''
+    rmdir $libdir/mcomix/mcomix
+    mv man/mcomix.1 man/${pname}.1
+    installManPage man/*
+    cp -r mime/icons/* $out/share/icons/hicolor/
+    cp mime/*.desktop $out/share/applications/
+    cp mime/*.appdata.xml $out/share/metainfo/
+    cp mime/*.thumbnailer $out/share/thumbnailers/
+    for folder in $out/share/icons/hicolor/*; do
+        mkdir $folder/{apps,mimetypes}
+        mv $folder/*.png $folder/mimetypes
+        cp $libdir/mcomix/images/$(basename $folder)/mcomix.png $folder/apps/${pname}.png
+        cp $folder/mimetypes/application-x-cbt.png $folder/mimetypes/application-x-cbr.png
+        cp $folder/mimetypes/application-x-cbt.png $folder/mimetypes/application-x-cbz.png
+    done
+  '';
+
+  # prevent double wrapping
+  dontWrapGApps = true;
+  preFixup = ''
+    makeWrapperArgs+=(
+      "''${gappsWrapperArgs[@]}"
+      "--prefix" "PATH" ":" "${lib.makeBinPath ([ p7zip lhasa mupdf ] ++ lib.optional (unrarSupport) unrar)}"
+    )
+  '';
+
+  # real pytests broken upstream
+  checkPhase = ''
+    $out/bin/comicthumb --help > /dev/null
+    $out/bin/${pname} --help > /dev/null
+  '';
+
+  meta = with lib; {
+    description = "Comic book reader and image viewer; python3 fork of mcomix";
+    longDescription = ''
+      User-friendly, customizable image viewer, specifically designed to handle
+      comic books and manga supporting a variety of container formats
+      (including CBR, CBZ, CB7, CBT, LHA and PDF)
+    '';
+    homepage = "https://github.com/multiSnow/mcomix3";
+    changelog = "https://github.com/multiSnow/mcomix3/blob/gtk3/ChangeLog";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ confus ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/megapixels/default.nix b/nixpkgs/pkgs/applications/graphics/megapixels/default.nix
new file mode 100644
index 000000000000..c949b8e6b4d0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/megapixels/default.nix
@@ -0,0 +1,71 @@
+{ stdenv
+, lib
+, fetchFromSourcehut
+, meson
+, ninja
+, pkg-config
+, glib
+, wrapGAppsHook
+, epoxy
+, gtk4
+, zbar
+, tiffSupport ? true
+, libraw
+, jpgSupport ? true
+, graphicsmagick
+, exiftool
+}:
+
+assert jpgSupport -> tiffSupport;
+
+let
+  inherit (lib) makeBinPath optional optionals optionalString;
+  runtimePath = makeBinPath (
+    optional tiffSupport libraw
+    ++ optionals jpgSupport [ graphicsmagick exiftool ]
+  );
+in
+stdenv.mkDerivation rec {
+  pname = "megapixels";
+  version = "1.3.0";
+
+  src = fetchFromSourcehut {
+    owner = "~martijnbraam";
+    repo = "megapixels";
+    rev = version;
+    sha256 = "0dagp1sh5whnnllrydk7ijjid0hmvcbdm8kkzq2g168khdfn80jm";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    glib
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    epoxy
+    gtk4
+    zbar
+  ];
+
+  postInstall = ''
+    glib-compile-schemas $out/share/glib-2.0/schemas
+  '';
+
+  preFixup = optionalString (tiffSupport || jpgSupport) ''
+    gappsWrapperArgs+=(
+      --prefix PATH : ${runtimePath}
+    )
+  '';
+
+  meta = with lib; {
+    description = "GTK4 camera application that knows how to deal with the media request api";
+    homepage = "https://sr.ht/~martijnbraam/Megapixels";
+    changelog = "https://git.sr.ht/~martijnbraam/megapixels/refs/${version}";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ OPNA2608 dotlambda ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/meh/default.nix b/nixpkgs/pkgs/applications/graphics/meh/default.nix
new file mode 100644
index 000000000000..d23176c2518d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/meh/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, libX11, libXext, libjpeg, libpng, giflib }:
+
+stdenv.mkDerivation {
+  pname = "meh";
+  version = "unstable-2018-10-22";
+
+  src = fetchFromGitHub {
+    owner = "jhawthorn";
+    repo = "meh";
+    rev = "69f653a1f16d11b12e5b600e808a740898f3223e";
+    sha256 = "sha256-srSwoaajW4H4+kmE7NQAqVz9d/1q2XQ5ayQaOcGwzI0=";
+  };
+
+  installFlags = [ "PREFIX=${placeholder "out"}" ];
+
+  outputs = [ "out" "man" ];
+
+  buildInputs = [ libXext libX11 libjpeg libpng giflib ];
+
+  meta = {
+    description = "A minimal image viewer using raw XLib";
+    homepage = "https://www.johnhawthorn.com/meh/";
+    license = lib.licenses.mit;
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/meme-image-generator/default.nix b/nixpkgs/pkgs/applications/graphics/meme-image-generator/default.nix
new file mode 100644
index 000000000000..7418aa07c75b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/meme-image-generator/default.nix
@@ -0,0 +1,26 @@
+{ lib
+, buildGoModule
+, fetchFromGitHub
+}:
+
+buildGoModule rec {
+  pname = "meme-image-generator";
+  version = "1.0.1";
+
+  src = fetchFromGitHub {
+    owner = "nomad-software";
+    repo = "meme";
+    rev = "v${version}";
+    sha256 = "089r0v5az2d2njn0s3d3wd0861pcs4slg6zl0rj4cm1k5cj8yd1k";
+  };
+
+  vendorSha256 = null;
+
+  meta = with lib; {
+    description = "A command line utility for creating image macro style memes";
+    homepage = "https://github.com/nomad-software/meme";
+    license = licenses.mit;
+    maintainers = [ maintainers.fgaz ];
+    platforms = with platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/menyoki/default.nix b/nixpkgs/pkgs/applications/graphics/menyoki/default.nix
new file mode 100644
index 000000000000..0b4b80d648ac
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/menyoki/default.nix
@@ -0,0 +1,44 @@
+{ fetchFromGitHub
+, installShellFiles
+, lib
+, pkg-config
+, rustPlatform
+, stdenv
+, libX11
+, libXrandr
+, withSki ? true
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "menyoki";
+  version = "1.5.3";
+
+  src = fetchFromGitHub {
+    owner = "orhun";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "050c6c60il6cy0a8d3nw4z2cyp043912a7n4n44yjpmx047w7kc7";
+  };
+
+  cargoSha256 = "0wwcda2w8jg3q132cvhdgfmjc0rz93fx6fai93g5w8br98aq9qzx";
+
+  nativeBuildInputs = [ installShellFiles ]
+    ++ lib.optional stdenv.isLinux pkg-config;
+
+  buildInputs = lib.optionals stdenv.isLinux [ libX11 libXrandr ];
+
+  cargoBuildFlags = lib.optional (!withSki) "--no-default-features";
+
+  postInstall = ''
+    installManPage man/*
+    installShellCompletion completions/menyoki.{bash,fish,zsh}
+  '';
+
+  meta = with lib; {
+    description = "Screen{shot,cast} and perform ImageOps on the command line";
+    homepage = "https://menyoki.cli.rs/";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ figsoda ];
+    broken = stdenv.isDarwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/meshlab/default.nix b/nixpkgs/pkgs/applications/graphics/meshlab/default.nix
new file mode 100644
index 000000000000..8633494a4ca4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/meshlab/default.nix
@@ -0,0 +1,80 @@
+{ mkDerivation
+, lib
+, fetchFromGitHub
+, libGLU
+, qtbase
+, qtscript
+, qtxmlpatterns
+, lib3ds
+, bzip2
+, muparser
+, eigen
+, glew
+, gmp
+, levmar
+, qhull
+, cmake
+}:
+
+mkDerivation rec {
+  pname = "meshlab";
+  version = "2020.12";
+
+  src = fetchFromGitHub {
+    owner = "cnr-isti-vclab";
+    repo = "meshlab";
+    rev = "Meshlab-${version}";
+    sha256 = "QrnqXEVqI1ADUYWalZ0h/0+xS+gDZTinm0weT39onw0=";
+    fetchSubmodules = true; # for vcglib
+  };
+
+  buildInputs = [
+    libGLU
+    qtbase
+    qtscript
+    qtxmlpatterns
+    lib3ds
+    bzip2
+    muparser
+    eigen
+    glew
+    gmp
+    levmar
+    qhull
+  ];
+
+  nativeBuildInputs = [ cmake ];
+
+  preConfigure = ''
+    substituteAll ${./meshlab.desktop} scripts/Linux/resources/meshlab.desktop
+    cmakeDir=$PWD/src
+    mkdir ../build
+    cd ../build
+  '';
+
+  cmakeFlags = [
+    "-DALLOW_BUNDLED_EIGEN=OFF"
+    "-DALLOW_BUNDLED_GLEW=OFF"
+    "-DALLOW_BUNDLED_LIB3DS=OFF"
+    "-DALLOW_BUNDLED_MUPARSER=OFF"
+    "-DALLOW_BUNDLED_QHULL=OFF"
+    # disable when available in nixpkgs
+    "-DALLOW_BUNDLED_OPENCTM=ON"
+    "-DALLOW_BUNDLED_SSYNTH=ON"
+    # some plugins are disabled unless these are on
+    "-DALLOW_BUNDLED_NEWUOA=ON"
+    "-DALLOW_BUNDLED_LEVMAR=ON"
+  ];
+
+  postFixup = ''
+    patchelf --add-needed $out/lib/meshlab/libmeshlab-common.so $out/bin/.meshlab-wrapped
+  '';
+
+  meta = {
+    description = "A system for processing and editing 3D triangular meshes";
+    homepage = "https://www.meshlab.net/";
+    license = lib.licenses.gpl3Only;
+    maintainers = with lib.maintainers; [ viric ];
+    platforms = with lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/meshlab/meshlab.desktop b/nixpkgs/pkgs/applications/graphics/meshlab/meshlab.desktop
new file mode 100644
index 000000000000..aa8de186440d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/meshlab/meshlab.desktop
@@ -0,0 +1,14 @@
+[Desktop Entry]
+Name=MeshLab
+Version=@version@
+Name[en_GB]=MeshLab
+GenericName=Mesh processing
+GenericName[en_GB]=Mesh processing
+Comment=View and process meshes
+Type=Application
+Exec=@out@/bin/meshlab %U
+TryExec=@out@/bin/meshlab
+Icon=@out@/share/icons/hicolor/meshlab.png
+Terminal=false
+MimeType=model/mesh;application/x-3ds;image/x-3ds;model/x-ply;application/sla;model/x-quad-object;model/x-geomview-off;application/x-cyclone-ptx;application/x-vmi;application/x-bre;model/vnd.collada+xml;model/openctm;application/x-expe-binary;application/x-expe-ascii;application/x-xyz;application/x-gts;chemical/x-pdb;application/x-tri;application/x-asc;model/x3d+xml;model/x3d+vrml;model/vrml;model/u3d;model/idtf;
+Categories=Graphics;3DGraphics;Viewer;Qt;
diff --git a/nixpkgs/pkgs/applications/graphics/minidjvu/default.nix b/nixpkgs/pkgs/applications/graphics/minidjvu/default.nix
new file mode 100644
index 000000000000..40b28dd8566a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/minidjvu/default.nix
@@ -0,0 +1,27 @@
+{lib, stdenv, fetchurl, libtiff, gettext }:
+
+stdenv.mkDerivation {
+  name = "minidjvu-0.8";
+  src = fetchurl {
+    url = "mirror://sourceforge/minidjvu/minidjvu-0.8.tar.gz";
+    sha256 = "0jmpvy4g68k6xgplj9zsl6brg6vi81mx3nx2x9hfbr1f4zh95j79";
+  };
+
+  patchPhase = ''
+    sed -i s,/usr/bin/gzip,gzip, Makefile.in
+  '';
+
+  buildInputs = [ libtiff gettext];
+
+  preInstall = ''
+    mkdir -p $out/lib
+  '';
+
+  meta = {
+    homepage = "http://djvu.sourceforge.net/djview4.html";
+    description = "Black-and-white djvu page encoder and decoder that use interpage information";
+    license = lib.licenses.gpl2Plus;
+    maintainers = [ lib.maintainers.viric ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/monado/default.nix b/nixpkgs/pkgs/applications/graphics/monado/default.nix
new file mode 100644
index 000000000000..fe5f99de121f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/monado/default.nix
@@ -0,0 +1,122 @@
+{ lib
+, stdenv
+, fetchFromGitLab
+, writeText
+, cmake
+, doxygen
+, glslang
+, pkg-config
+, python3
+, SDL2
+, dbus
+, eigen
+, ffmpeg
+, gst-plugins-base
+, gstreamer
+, hidapi
+, libGL
+, libXau
+, libXdmcp
+, libXrandr
+, libffi
+, libjpeg
+# , librealsense
+, libsurvive
+, libusb1
+, libuv
+, libuvc
+, libv4l
+, libxcb
+, opencv4
+, openhmd
+, udev
+, vulkan-headers
+, vulkan-loader
+, wayland
+, wayland-protocols
+, zlib
+# Set as 'false' to build monado without service support, i.e. allow VR
+# applications linking against libopenxr_monado.so to use OpenXR standalone
+# instead of via the monado-service program. For more information see:
+# https://gitlab.freedesktop.org/monado/monado/-/blob/master/doc/targets.md#xrt_feature_service-disabled
+, serviceSupport ? true
+}:
+
+stdenv.mkDerivation rec {
+  pname = "monado";
+  version = "21.0.0";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.freedesktop.org";
+    owner = pname;
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "07zxs96i3prjqww1f68496cl2xxqaidx32lpfyy0pn5am4c297zc";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    doxygen
+    glslang
+    pkg-config
+    python3
+  ];
+
+  cmakeFlags = [
+    "-DXRT_FEATURE_SERVICE=${if serviceSupport then "ON" else "OFF"}"
+  ];
+
+  buildInputs = [
+    SDL2
+    dbus
+    eigen
+    ffmpeg
+    gst-plugins-base
+    gstreamer
+    hidapi
+    libGL
+    libXau
+    libXdmcp
+    libXrandr
+    libjpeg
+    libffi
+    # librealsense.dev - see below
+    libsurvive
+    libusb1
+    libuv
+    libuvc
+    libv4l
+    libxcb
+    opencv4
+    openhmd
+    udev
+    vulkan-headers
+    vulkan-loader
+    wayland
+    wayland-protocols
+    zlib
+  ];
+
+  # realsense is disabled, the build ends with the following error:
+  #
+  # CMake Error in src/xrt/drivers/CMakeLists.txt:
+  # Imported target "realsense2::realsense2" includes non-existent path
+  # "/nix/store/2v95aps14hj3jy4ryp86vl7yymv10mh0-librealsense-2.41.0/include"
+  # in its INTERFACE_INCLUDE_DIRECTORIES.
+  #
+  # for some reason cmake is trying to use ${librealsense}/include
+  # instead of ${librealsense.dev}/include as an include directory
+
+  # Help openxr-loader find this runtime
+  setupHook = writeText "setup-hook" ''
+    export XDG_CONFIG_DIRS=@out@/etc/xdg''${XDG_CONFIG_DIRS:+:''${XDG_CONFIG_DIRS}}
+  '';
+
+  meta = with lib; {
+    description = "Open source XR runtime";
+    homepage = "https://monado.freedesktop.org/";
+    license = licenses.boost;
+    maintainers = with maintainers; [ expipiplus1 prusnak ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/mozjpeg/default.nix b/nixpkgs/pkgs/applications/graphics/mozjpeg/default.nix
new file mode 100644
index 000000000000..0c1933ad6129
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/mozjpeg/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libpng, zlib, nasm }:
+
+stdenv.mkDerivation rec {
+  version = "4.0.3";
+  pname = "mozjpeg";
+
+  src = fetchFromGitHub {
+    owner = "mozilla";
+    repo = "mozjpeg";
+    rev = "v${version}";
+    sha256 = "1wb2ys0yjy6hgpb9qvzjxs7sb2zzs44p6xf7n026mx5nx85hjbyv";
+  };
+
+  cmakeFlags = [ "-DENABLE_STATIC=NO" "-DPNG_SUPPORTED=TRUE" ]; # See https://github.com/mozilla/mozjpeg/issues/351
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ libpng zlib nasm ];
+
+  meta = {
+    description = "Mozilla JPEG Encoder Project";
+    longDescription = ''
+      This project's goal is to reduce the size of JPEG files without reducing quality or compatibility with the
+      vast majority of the world's deployed decoders.
+
+      The idea is to reduce transfer times for JPEGs on the Web, thus reducing page load times.
+    '';
+    homepage = "https://github.com/mozilla/mozjpeg";
+    license = lib.licenses.bsd3;
+    maintainers = [ lib.maintainers.aristid ];
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/mtpaint/default.nix b/nixpkgs/pkgs/applications/graphics/mtpaint/default.nix
new file mode 100644
index 000000000000..3565173285b4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/mtpaint/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchFromGitHub
+, pkg-config
+, freetype, giflib, gtk3, lcms2, libjpeg, libpng, libtiff, openjpeg, gifsicle
+}:
+
+stdenv.mkDerivation rec {
+  p_name  = "mtPaint";
+  ver_maj = "3.50";
+  ver_min = "01";
+  name = "${p_name}-${ver_maj}.${ver_min}";
+
+  src = fetchFromGitHub {
+    owner = "wjaguar";
+    repo = p_name;
+    rev = "a4675ff5cd9fcd57d291444cb9f332b48f11243f";
+    sha256 = "04wqxz8i655gz5rnz90cksy8v6m2jhcn1j8rzhqpp5xhawlmq24y";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [
+    freetype giflib gtk3 lcms2 libjpeg libpng libtiff openjpeg gifsicle
+  ];
+
+  configureFlags = [ "gtk3" "intl" "man" ];
+
+  meta = {
+    description = "A simple GTK painting program";
+    longDescription = ''
+      mtPaint is a simple GTK painting program designed for
+      creating icons and pixel based artwork.  It can edit indexed palette
+      or 24 bit RGB images and offers basic painting and palette manipulation
+      tools. It also has several other more powerful features such as channels,
+      layers and animation.
+      Due to its simplicity and lack of dependencies it runs well on
+      GNU/Linux, Windows and older PC hardware.
+    '';
+    homepage = "http://mtpaint.sourceforge.net/";
+    license = lib.licenses.gpl3Plus;
+    platforms = lib.platforms.linux;
+    maintainers = [ lib.maintainers.vklquevs ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/graphics/mypaint/default.nix b/nixpkgs/pkgs/applications/graphics/mypaint/default.nix
new file mode 100644
index 000000000000..7b83bdec8c6b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/mypaint/default.nix
@@ -0,0 +1,100 @@
+{ lib
+, fetchFromGitHub
+, gtk3
+, gettext
+, json_c
+, lcms2
+, libpng
+, librsvg
+, gobject-introspection
+, libmypaint
+, hicolor-icon-theme
+, mypaint-brushes
+, gdk-pixbuf
+, pkg-config
+, python3
+, swig
+, wrapGAppsHook
+}:
+
+let
+  inherit (python3.pkgs) pycairo pygobject3 numpy buildPythonApplication;
+in buildPythonApplication rec {
+  pname = "mypaint";
+  version = "2.0.1";
+
+  src = fetchFromGitHub {
+    owner = "mypaint";
+    repo = "mypaint";
+    rev = "v${version}";
+    sha256 = "rVKcxzWZRLcuxK8xRyRgvitXAh4uOEyqHswLeTdA2Mk=";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [
+    gettext
+    pkg-config
+    swig
+    wrapGAppsHook
+    gobject-introspection # for setup hook
+    hicolor-icon-theme # fór setup hook
+  ];
+
+  buildInputs = [
+    gtk3
+    gdk-pixbuf
+    libmypaint
+    mypaint-brushes
+    json_c
+    lcms2
+    libpng
+    librsvg
+    pycairo
+    pygobject3
+
+    # Mypaint checks for a presence of this theme scaffold and crashes when not present.
+    hicolor-icon-theme
+  ];
+
+  propagatedBuildInputs = [
+    numpy
+    pycairo
+    pygobject3
+  ];
+
+  checkInputs = [
+    gtk3
+  ];
+
+  buildPhase = ''
+    runHook preBuild
+
+    ${python3.interpreter} setup.py build
+
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    ${python3.interpreter} setup.py managed_install --prefix=$out
+
+    runHook postInstall
+  '';
+
+  checkPhase = ''
+    runHook preCheck
+
+    HOME=$TEMPDIR ${python3.interpreter} setup.py test
+
+    runHook postCheck
+  '';
+
+  meta = with lib; {
+    description = "A graphics application for digital painters";
+    homepage = "http://mypaint.org/";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ goibhniu jtojnar ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/nomacs/default.nix b/nixpkgs/pkgs/applications/graphics/nomacs/default.nix
new file mode 100644
index 000000000000..9f3c1e453f8d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/nomacs/default.nix
@@ -0,0 +1,72 @@
+{ lib
+, mkDerivation
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, pkg-config
+
+, qtbase
+, qttools
+, qtsvg
+, qtimageformats
+
+, exiv2
+, opencv4
+, libraw
+, libtiff
+, quazip
+}:
+
+mkDerivation rec {
+  pname = "nomacs";
+  version = "3.17.2206";
+
+  src = fetchFromGitHub {
+    owner = "nomacs";
+    repo = "nomacs";
+    rev = version;
+    sha256 = "1bq7bv4p7w67172y893lvpk90d6fgdpnylynbj2kn8m2hs6khya4";
+  };
+
+  patches = [
+    # Add support for Quazip 1.x.
+    (fetchpatch {
+      url = "https://github.com/nomacs/nomacs/pull/576.patch";
+      sha256 = "11ryjvd9jbb0cqagai4a6980jfq8lrcbyw2d7z9yld1f42w9kbxm";
+      stripLen = 1;
+    })
+  ];
+
+  setSourceRoot = ''
+    sourceRoot=$(echo */ImageLounge)
+  '';
+
+  nativeBuildInputs = [cmake
+                       pkg-config];
+
+  buildInputs = [qtbase
+                 qttools
+                 qtsvg
+                 qtimageformats
+                 exiv2
+                 opencv4
+                 libraw
+                 libtiff
+                 quazip];
+
+  cmakeFlags = ["-DENABLE_OPENCV=ON"
+                "-DENABLE_RAW=ON"
+                "-DENABLE_TIFF=ON"
+                "-DENABLE_QUAZIP=ON"
+                "-DENABLE_TRANSLATIONS=ON"
+                "-DUSE_SYSTEM_QUAZIP=ON"];
+
+  meta = with lib; {
+    homepage = "https://nomacs.org";
+    description = "Qt-based image viewer";
+    maintainers = with lib.maintainers; [ mindavi ];
+    license = licenses.gpl3Plus;
+    repositories.git = "https://github.com/nomacs/nomacs.git";
+    inherit (qtbase.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/nufraw/default.nix b/nixpkgs/pkgs/applications/graphics/nufraw/default.nix
new file mode 100644
index 000000000000..f6031bea069d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/nufraw/default.nix
@@ -0,0 +1,75 @@
+{ stdenv
+, fetchurl
+, lib
+
+, autoreconfHook
+, bzip2
+, cfitsio
+, exiv2
+, gettext
+, gtk2
+, gtkimageview
+, lcms2
+, lensfun
+, libjpeg
+, libtiff
+, perl
+, pkg-config
+, zlib
+
+, addThumbnailer ? false
+}:
+
+stdenv.mkDerivation rec {
+  pname = "nufraw";
+  version = "0.43-3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/nufraw/nufraw-${version}.tar.gz";
+    sha256 = "0b63qvw9r8kaqw36bk3a9zwxc41h8fr6498indkw4glrj0awqz9c";
+  };
+
+  nativeBuildInputs = [ autoreconfHook gettext perl pkg-config ];
+
+  buildInputs = [
+    bzip2
+    cfitsio
+    exiv2
+    gtk2
+    gtkimageview
+    lcms2
+    lensfun
+    libjpeg
+    libtiff
+    zlib
+  ];
+
+  configureFlags = [
+    "--enable-contrast"
+    "--enable-dst-correction"
+  ];
+
+  postInstall = lib.optionalString addThumbnailer ''
+    mkdir -p $out/share/thumbnailers
+    substituteAll ${./nufraw.thumbnailer} $out/share/thumbnailers/${pname}.thumbnailer
+  '';
+
+  # Fixes an upstream issue where headers with templates were included in an extern-C scope
+  # which caused the build to fail
+  patches = [ ./move-extern-c.patch ];
+
+  meta = with lib; {
+    homepage = "https://nufraw.sourceforge.io/";
+    description = "Utility to read and manipulate raw images from digital cameras";
+    longDescription =
+      ''
+        A new version of the popular raw digital images manipulator ufraw.
+        Forks from the version 0.23 of ufraw (that's why the first nufraw version is the 0.24).
+        Nufraw offers the same features (gimp plugin, batch, ecc) and the same quality of
+        ufraw in a brand new improved user interface.
+      '';
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ asbachb ];
+    platforms   = [ "x86_64-linux" "i686-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/nufraw/move-extern-c.patch b/nixpkgs/pkgs/applications/graphics/nufraw/move-extern-c.patch
new file mode 100644
index 000000000000..43a4942d3e62
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/nufraw/move-extern-c.patch
@@ -0,0 +1,21 @@
+diff --git a/uf_glib.h b/uf_glib.h
+index c1a17bd..8a10800 100644
+--- a/uf_glib.h
++++ b/uf_glib.h
+@@ -13,13 +13,13 @@
+ #ifndef _UF_GLIB_H
+ #define _UF_GLIB_H
+ 
++#include <glib.h>
++#include <glib/gstdio.h>
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+ 
+-#include <glib.h>
+-#include <glib/gstdio.h>
+-
+ // g_win32_locale_filename_from_utf8 is needed only on win32
+ #ifdef _WIN32
+ #define uf_win32_locale_filename_from_utf8(__some_string__) \
diff --git a/nixpkgs/pkgs/applications/graphics/nufraw/nufraw.thumbnailer b/nixpkgs/pkgs/applications/graphics/nufraw/nufraw.thumbnailer
new file mode 100644
index 000000000000..34b2adc43aee
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/nufraw/nufraw.thumbnailer
@@ -0,0 +1,4 @@
+[Thumbnailer Entry]
+TryExec=@out@/bin/nufraw-batch
+Exec=@out@/bin/nufraw-batch --silent --size %s --out-type=png --noexif --output=%o --embedded-image %i
+MimeType=image/x-canon-cr2;image/x-canon-crw;image/x-minolta-mrw;image/x-nikon-nef;image/x-pentax-pef;image/x-panasonic-rw2;image/x-panasonic-raw2;image/x-samsung-srw;image/x-olympus-orf;image/x-sony-arw
diff --git a/nixpkgs/pkgs/applications/graphics/ocrad/default.nix b/nixpkgs/pkgs/applications/graphics/ocrad/default.nix
new file mode 100644
index 000000000000..476d56fb3fe3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/ocrad/default.nix
@@ -0,0 +1,36 @@
+{ fetchurl, lib, stdenv, lzip, texinfo }:
+
+stdenv.mkDerivation rec {
+  pname = "ocrad";
+  version = "0.27";
+
+  src = fetchurl {
+    url = "mirror://gnu/ocrad/${pname}-${version}.tar.lz";
+    sha256 = "0divffvcaim89g4pvqs8kslbcxi475bcl3b4ynphf284k9zfdgx9";
+  };
+
+  nativeBuildInputs = [ lzip /* unpack */ ];
+  buildInputs = [ texinfo ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Optical character recognition (OCR) program & library";
+    longDescription =
+      '' GNU Ocrad is an OCR (Optical Character Recognition) program based on
+         a feature extraction method.  It reads images in pbm (bitmap), pgm
+         (greyscale) or ppm (color) formats and produces text in byte (8-bit)
+         or UTF-8 formats.
+
+         Also includes a layout analyser able to separate the columns or
+         blocks of text normally found on printed pages.
+
+         Ocrad can be used as a stand-alone console application, or as a
+         backend to other programs.
+      '';
+
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ pSub ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/ocrfeeder/default.nix b/nixpkgs/pkgs/applications/graphics/ocrfeeder/default.nix
new file mode 100644
index 000000000000..da5f1c5dcc49
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/ocrfeeder/default.nix
@@ -0,0 +1,73 @@
+{ lib, stdenv
+, fetchurl
+, pkg-config
+, gtk3
+, gtkspell3
+, isocodes
+, goocanvas2
+, intltool
+, itstool
+, libxml2
+, gnome
+, python3
+, gobject-introspection
+, wrapGAppsHook
+, tesseract4
+, extraOcrEngines ? [] # other supported engines are: ocrad gocr cuneiform
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ocrfeeder";
+  version = "0.8.3";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "12f5gnq92ffnd5zaj04df7jrnsdz1zn4zcgpbf5p9qnd21i2y529";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    wrapGAppsHook
+    intltool
+    itstool
+    libxml2
+  ];
+
+  buildInputs = [
+    gtk3
+    gobject-introspection
+    goocanvas2
+    gtkspell3
+    isocodes
+    (python3.withPackages(ps: with ps; [
+      pyenchant
+      sane
+      pillow
+      reportlab
+      odfpy
+      pygobject3
+    ]))
+  ];
+
+  # https://gitlab.gnome.org/GNOME/ocrfeeder/-/issues/22
+  postConfigure = ''
+    substituteInPlace src/ocrfeeder/util/constants.py \
+      --replace /usr/share/xml/iso-codes ${isocodes}/share/xml/iso-codes
+  '';
+
+  enginesPath = lib.makeBinPath ([
+    tesseract4
+  ] ++ extraOcrEngines);
+
+  preFixup = ''
+    gappsWrapperArgs+=(--prefix PATH : "${enginesPath}")
+  '';
+
+  meta = with lib; {
+    homepage = "https://wiki.gnome.org/Apps/OCRFeeder";
+    description = "Complete Optical Character Recognition and Document Analysis and Recognition program";
+    maintainers = with maintainers; [ doronbehar ];
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/odafileconverter/default.nix b/nixpkgs/pkgs/applications/graphics/odafileconverter/default.nix
new file mode 100644
index 000000000000..a74043730bf5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/odafileconverter/default.nix
@@ -0,0 +1,53 @@
+{ lib, stdenv, mkDerivation, dpkg, fetchurl, qtbase }:
+
+let
+  # To obtain the version you will need to run the following command:
+  #
+  # dpkg-deb -I ${odafileconverter.src} | grep Version
+  version = "21.11.0.0";
+  rpath = "$ORIGIN:${lib.makeLibraryPath [ stdenv.cc.cc qtbase ]}";
+
+in mkDerivation {
+  pname = "oda-file-converter";
+  inherit version;
+  nativeBuildInputs = [ dpkg ];
+
+  src = fetchurl {
+    # NB: this URL is not stable (i.e. the underlying file and the corresponding version will change over time)
+    url = "http://web.archive.org/web/20201206221727if_/https://download.opendesign.com/guestfiles/Demo/ODAFileConverter_QT5_lnxX64_7.2dll_21.11.deb";
+    sha256 = "10027a3ab18efd04ca75aa699ff550eca3bdfe6f7084460d3c00001bffb50070";
+  };
+
+  unpackPhase = ''
+    dpkg -x $src oda_unpacked
+    sourceRoot=$PWD/oda_unpacked
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin $out/lib
+    cp -vr $sourceRoot/usr/bin/ODAFileConverter_${version} $out/libexec
+    cp -vr $sourceRoot/usr/share $out/share
+  '';
+
+  dontWrapQtApps = true;
+  fixupPhase = ''
+    echo "setting interpreter"
+    patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/libexec/ODAFileConverter
+    patchelf --set-rpath '${rpath}' $out/libexec/ODAFileConverter
+    wrapQtApp $out/libexec/ODAFileConverter
+    mv $out/libexec/ODAFileConverter $out/bin
+
+    find $out/libexec -type f -executable | while read file; do
+      echo "patching $file"
+      patchelf --set-rpath '${rpath}' $file
+    done
+  '';
+
+  meta = with lib; {
+    description = "For converting between different versions of .dwg and .dxf";
+    homepage = "https://www.opendesign.com/guestfiles/oda_file_converter";
+    license = licenses.unfree;
+    maintainers = with maintainers; [ nagisa ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/openboard/default.nix b/nixpkgs/pkgs/applications/graphics/openboard/default.nix
new file mode 100644
index 000000000000..b30dbab1570a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/openboard/default.nix
@@ -0,0 +1,116 @@
+{ mkDerivation, lib, fetchFromGitHub, copyDesktopItems, makeDesktopItem, qmake
+, qtbase, qtxmlpatterns, qttools, qtwebkit, libGL, fontconfig, openssl, poppler
+, ffmpeg, libva, alsa-lib, SDL, x264, libvpx, libvorbis, libtheora, libogg
+, libopus, lame, fdk_aac, libass, quazip, libXext, libXfixes }:
+
+let
+  importer = mkDerivation rec {
+    pname = "openboard-importer";
+    version = "unstable-2016-10-08";
+
+    src = fetchFromGitHub {
+      owner = "OpenBoard-org";
+      repo = "OpenBoard-Importer";
+      rev = "47927bda021b4f7f1540b794825fb0d601875e79";
+      sha256 = "19zhgsimy0f070caikc4vrrqyc8kv2h6rl37sy3iggks8z0g98gf";
+    };
+
+    nativeBuildInputs = [ qmake ];
+
+    installPhase = ''
+      install -Dm755 OpenBoardImporter $out/bin/OpenBoardImporter
+    '';
+  };
+in mkDerivation rec {
+  pname = "openboard";
+  version = "1.6.1";
+
+  src = fetchFromGitHub {
+    owner = "OpenBoard-org";
+    repo = "OpenBoard";
+    rev = "v${version}";
+    sha256 = "sha256-OlGXGIMghil/GG6eso20+CWo/hCjarXGs6edXX9pc/M=";
+  };
+
+  postPatch = ''
+    substituteInPlace OpenBoard.pro \
+      --replace '/usr/include/quazip' '${quazip}/include/QuaZip-Qt5-${quazip.version}/quazip' \
+      --replace '-lquazip5' '-lquazip1-qt5' \
+      --replace '/usr/include/poppler' '${poppler.dev}/include/poppler'
+  '';
+
+  nativeBuildInputs = [ qmake copyDesktopItems ];
+
+  buildInputs = [
+    qtbase
+    qtxmlpatterns
+    qttools
+    qtwebkit
+    libGL
+    fontconfig
+    openssl
+    poppler
+    ffmpeg
+    libva
+    alsa-lib
+    SDL
+    x264
+    libvpx
+    libvorbis
+    libtheora
+    libogg
+    libopus
+    lame
+    fdk_aac
+    libass
+    quazip
+    libXext
+    libXfixes
+  ];
+
+  propagatedBuildInputs = [ importer ];
+
+  makeFlags = [ "release-install" ];
+
+  desktopItems = [
+    (makeDesktopItem {
+      name = "OpenBoard";
+      exec = "OpenBoard %f";
+      icon = "OpenBoard";
+      comment = "OpenBoard, an interactive white board application";
+      desktopName = "OpenBoard";
+      mimeType = "application/ubz";
+      categories = "Education;";
+      startupNotify = true;
+    })
+  ];
+
+  installPhase = ''
+    runHook preInstall
+
+    lrelease OpenBoard.pro
+
+    # Replicated release_scripts/linux/package.sh
+    mkdir -p $out/opt/openboard/i18n
+    cp -R resources/customizations build/linux/release/product/* $out/opt/openboard/
+    cp resources/i18n/*.qm $out/opt/openboard/i18n/
+    install -m644 resources/linux/openboard-ubz.xml $out/opt/openboard/etc/
+    install -Dm644 resources/images/OpenBoard.png $out/share/icons/hicolor/64x64/apps/OpenBoard.png
+
+    runHook postInstall
+  '';
+
+  dontWrapQtApps = true;
+
+  postFixup = ''
+    makeWrapper $out/opt/openboard/OpenBoard $out/bin/OpenBoard \
+      "''${qtWrapperArgs[@]}"
+  '';
+
+  meta = with lib; {
+    description = "Interactive whiteboard application";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ fufexan ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/openimageio/2.x.nix b/nixpkgs/pkgs/applications/graphics/openimageio/2.x.nix
new file mode 100644
index 000000000000..17a811aa87f8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/openimageio/2.x.nix
@@ -0,0 +1,62 @@
+{ lib, stdenv
+, fetchFromGitHub
+, boost
+, cmake
+, giflib
+, ilmbase
+, libjpeg
+, libpng
+, libtiff
+, opencolorio_1
+, openexr
+, robin-map
+, unzip
+, fmt
+}:
+
+stdenv.mkDerivation rec {
+  pname = "openimageio";
+  version = "2.2.17.0";
+
+  src = fetchFromGitHub {
+    owner = "OpenImageIO";
+    repo = "oiio";
+    rev = "Release-${version}";
+    sha256 = "0jqpb1zci911wdm928addsljxx8zsh0gzbhv9vbw6man4wi93h6h";
+  };
+
+  outputs = [ "bin" "out" "dev" "doc" ];
+
+  nativeBuildInputs = [
+    cmake
+    unzip
+  ];
+
+  buildInputs = [
+    boost
+    giflib
+    ilmbase
+    libjpeg
+    libpng
+    libtiff
+    opencolorio_1
+    openexr
+    robin-map
+    fmt
+  ];
+
+  cmakeFlags = [
+    "-DUSE_PYTHON=OFF"
+    "-DUSE_QT=OFF"
+    # GNUInstallDirs
+    "-DCMAKE_INSTALL_LIBDIR=lib" # needs relative path for pkg-config
+  ];
+
+  meta = with lib; {
+    homepage = "http://www.openimageio.org";
+    description = "A library and tools for reading and writing images";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ goibhniu jtojnar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/openimageio/2539_backport.patch b/nixpkgs/pkgs/applications/graphics/openimageio/2539_backport.patch
new file mode 100644
index 000000000000..c484b2ef9cf9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/openimageio/2539_backport.patch
@@ -0,0 +1,31 @@
+diff --git a/src/libOpenImageIO/exif.cpp b/src/libOpenImageIO/exif.cpp
+index 10b75c21..0287d9c5 100644
+--- a/src/libOpenImageIO/exif.cpp
++++ b/src/libOpenImageIO/exif.cpp
+@@ -213,6 +213,9 @@ static const EXIF_tag_info exif_tag_table[] = {
+ 
+ 
+ 
++// libtiff > 4.1.0 defines these in tiff.h. For older libtiff, let's define
++// them ourselves.
++#ifndef GPSTAG_VERSIONID
+ enum GPSTag {
+     GPSTAG_VERSIONID = 0, 
+     GPSTAG_LATITUDEREF = 1,  GPSTAG_LATITUDE = 2,
+@@ -237,6 +240,7 @@ enum GPSTag {
+     GPSTAG_DIFFERENTIAL = 30,
+     GPSTAG_HPOSITIONINGERROR = 31
+ };
++#endif
+ 
+ static const EXIF_tag_info gps_tag_table[] = {
+     { GPSTAG_VERSIONID,		"GPS:VersionID",	TIFF_BYTE, 4 }, 
+@@ -270,7 +274,7 @@ static const EXIF_tag_info gps_tag_table[] = {
+     { GPSTAG_AREAINFORMATION,	"GPS:AreaInformation",	TIFF_UNDEFINED, 1 },
+     { GPSTAG_DATESTAMP,		"GPS:DateStamp",	TIFF_ASCII, 0 },
+     { GPSTAG_DIFFERENTIAL,	"GPS:Differential",	TIFF_SHORT, 1 },
+-    { GPSTAG_HPOSITIONINGERROR,	"GPS:HPositioningError",TIFF_RATIONAL, 1 },
++    { GPSTAG_GPSHPOSITIONINGERROR,     "GPS:HPositioningError",TIFF_RATIONAL, 1 },
+     { -1, NULL }  // signal end of table
+ };
+ 
diff --git a/nixpkgs/pkgs/applications/graphics/openimageio/default.nix b/nixpkgs/pkgs/applications/graphics/openimageio/default.nix
new file mode 100644
index 000000000000..e5262ab98d0a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/openimageio/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, fetchFromGitHub, boost, cmake, ilmbase, libjpeg, libpng, libtiff
+, opencolorio_1, openexr, unzip
+}:
+
+stdenv.mkDerivation rec {
+  pname = "openimageio";
+  version = "1.8.17";
+
+  src = fetchFromGitHub {
+    owner = "OpenImageIO";
+    repo = "oiio";
+    rev = "Release-${version}";
+    sha256 = "0zq34szprgkrrayg5sl3whrsx2l6lr8nw4hdrnwv2qhn70jbi2w2";
+  };
+
+  outputs = [ "bin" "out" "dev" "doc" ];
+
+  nativeBuildInputs = [ cmake unzip ];
+  buildInputs = [
+    boost ilmbase libjpeg libpng
+    libtiff opencolorio_1 openexr
+  ];
+
+  cmakeFlags = [
+    "-DUSE_PYTHON=OFF"
+  ];
+
+  makeFlags = [
+    "ILMBASE_HOME=${ilmbase.dev}"
+    "OPENEXR_HOME=${openexr.dev}"
+    "USE_PYTHON=0"
+    "INSTALLDIR=${placeholder "out"}"
+    "dist_dir="
+  ];
+
+  patches = [
+    # Backported from https://github.com/OpenImageIO/oiio/pull/2539 for 1.8.17
+    ./2539_backport.patch
+  ];
+
+  meta = with lib; {
+    homepage = "http://www.openimageio.org";
+    description = "A library and tools for reading and writing images";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/openscad/default.nix b/nixpkgs/pkgs/applications/graphics/openscad/default.nix
new file mode 100644
index 000000000000..c7be99469b05
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/openscad/default.nix
@@ -0,0 +1,94 @@
+{ lib, stdenv
+, fetchFromGitHub
+, qtbase
+, qtmultimedia
+, qscintilla
+, bison
+, flex
+, eigen
+, boost
+, libGLU, libGL
+, glew
+, opencsg
+, cgal
+, mpfr
+, gmp
+, glib
+, pkg-config
+, harfbuzz
+, gettext
+, freetype
+, fontconfig
+, double-conversion
+, lib3mf
+, libzip
+, mkDerivation
+, qtmacextras
+, qmake
+, spacenavSupport ? stdenv.isLinux, libspnav
+}:
+
+mkDerivation rec {
+  pname = "openscad";
+  version = "2021.01";
+
+  src = fetchFromGitHub {
+    owner = "openscad";
+    repo = "openscad";
+    rev = "${pname}-${version}";
+    sha256 = "sha256-2tOLqpFt5klFPxHNONnHVzBKEFWn4+ufx/MU+eYbliA=";
+  };
+
+  nativeBuildInputs = [ bison flex pkg-config gettext qmake ];
+
+  buildInputs = [
+    eigen boost glew opencsg cgal mpfr gmp glib
+    harfbuzz lib3mf libzip double-conversion freetype fontconfig
+    qtbase qtmultimedia qscintilla
+  ] ++ lib.optionals stdenv.isLinux [ libGLU libGL ]
+    ++ lib.optional stdenv.isDarwin qtmacextras
+    ++ lib.optional spacenavSupport libspnav
+  ;
+
+  qmakeFlags = [ "VERSION=${version}" ] ++
+    lib.optionals spacenavSupport [
+      "ENABLE_SPNAV=1"
+      "SPNAV_INCLUDEPATH=${libspnav}/include"
+      "SPNAV_LIBPATH=${libspnav}/lib"
+    ];
+
+  # src/lexer.l:36:10: fatal error: parser.hxx: No such file or directory
+  enableParallelBuilding = false; # true by default due to qmake
+
+  postInstall = lib.optionalString stdenv.isDarwin ''
+    mkdir $out/Applications
+    mv $out/bin/*.app $out/Applications
+    rmdir $out/bin || true
+
+    wrapQtApp "$out"/Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD
+
+    mv --target-directory=$out/Applications/OpenSCAD.app/Contents/Resources \
+      $out/share/openscad/{examples,color-schemes,locale,libraries,fonts,templates}
+
+    rmdir $out/share/openscad
+  '';
+
+  meta = {
+    description = "3D parametric model compiler";
+    longDescription = ''
+      OpenSCAD is a software for creating solid 3D CAD objects. It is free
+      software and available for Linux/UNIX, MS Windows and macOS.
+
+      Unlike most free software for creating 3D models (such as the famous
+      application Blender) it does not focus on the artistic aspects of 3D
+      modelling but instead on the CAD aspects. Thus it might be the
+      application you are looking for when you are planning to create 3D models of
+      machine parts but pretty sure is not what you are looking for when you are more
+      interested in creating computer-animated movies.
+    '';
+    homepage = "http://openscad.org/";
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ bjornfor raskin gebner ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/opentoonz/default.nix b/nixpkgs/pkgs/applications/graphics/opentoonz/default.nix
new file mode 100644
index 000000000000..14a130d7f412
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/opentoonz/default.nix
@@ -0,0 +1,51 @@
+{ boost, cmake, fetchFromGitHub, freeglut, freetype, glew, libjpeg, libmypaint
+, libpng, libtiff, libusb1, lz4, xz, lzo, openblas, pkg-config, qtbase
+, qtmultimedia, qtscript, lib, stdenv, superlu, wrapQtAppsHook, }:
+let source = import ./source.nix { inherit fetchFromGitHub; };
+in stdenv.mkDerivation rec {
+  inherit (source) src;
+
+  pname = "opentoonz";
+  version = source.versions.opentoonz;
+
+  nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook ];
+
+  buildInputs = [
+    boost
+    freeglut
+    freetype
+    glew
+    libjpeg
+    libmypaint
+    libpng
+    libtiff
+    libusb1
+    lz4
+    xz
+    lzo
+    openblas
+    qtbase
+    qtmultimedia
+    qtscript
+    superlu
+  ];
+
+  postUnpack = "sourceRoot=$sourceRoot/toonz";
+
+  cmakeDir = "../sources";
+  cmakeFlags = [
+    "-DTIFF_INCLUDE_DIR=${libtiff.dev}/include"
+    "-DTIFF_LIBRARY=${libtiff.out}/lib/libtiff.so"
+  ];
+
+  postInstall = ''
+    sed -i '/cp -r .*stuff/a\    chmod -R u+w $HOME/.config/OpenToonz/stuff' $out/bin/opentoonz
+  '';
+
+  meta = {
+    description = "Full-featured 2D animation creation software";
+    homepage = "https://opentoonz.github.io/";
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ chkno ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/opentoonz/libtiff.nix b/nixpkgs/pkgs/applications/graphics/opentoonz/libtiff.nix
new file mode 100644
index 000000000000..6663c47553e3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/opentoonz/libtiff.nix
@@ -0,0 +1,21 @@
+# Per https://github.com/opentoonz/opentoonz/blob/master/doc/how_to_build_linux.md ,
+# opentoonz requires its own modified version of libtiff.  We still build it as
+# a separate package
+#  1. For visibility for tools like vulnix, and
+#  2. To avoid a diamond-dependency problem with qt linking the normal libtiff
+#     and opentoonz linking qt and this modified libtiff, we build a qt against
+#     this modified libtiff as well.
+
+{ fetchFromGitHub, libtiff }:
+let source = import ./source.nix { inherit fetchFromGitHub; };
+in libtiff.overrideAttrs (old: {
+  inherit (source) src;
+  version = source.versions.libtiff + "-opentoonz";
+  postUnpack = (old.postUnpack or "") + ''
+    sourceRoot="$sourceRoot/thirdparty/tiff-${source.versions.libtiff}"
+  '';
+  # opentoonz uses internal libtiff headers
+  postInstall = (old.postInstall or "") + ''
+    cp libtiff/{tif_config,tif_dir,tiffiop}.h $dev/include
+  '';
+})
diff --git a/nixpkgs/pkgs/applications/graphics/opentoonz/source.nix b/nixpkgs/pkgs/applications/graphics/opentoonz/source.nix
new file mode 100644
index 000000000000..7378d2f5f965
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/opentoonz/source.nix
@@ -0,0 +1,16 @@
+# opentoonz's source archive contains both opentoonz's source and a modified
+# version of libtiff that opentoonz requires.
+
+{ fetchFromGitHub, }: rec {
+  versions = {
+    opentoonz = "1.4.0";
+    libtiff = "4.0.3";
+  };
+
+  src = fetchFromGitHub {
+    owner = "opentoonz";
+    repo = "opentoonz";
+    rev = "v${versions.opentoonz}";
+    sha256 = "0vgclx2yydsm5i2smff3fj8m750nhf35wfhva37kywgws01s189b";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/ovito/default.nix b/nixpkgs/pkgs/applications/graphics/ovito/default.nix
new file mode 100644
index 000000000000..f0dc5f2b363e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/ovito/default.nix
@@ -0,0 +1,41 @@
+{ mkDerivation, lib, fetchFromGitLab, cmake
+, boost, netcdf, hdf5, fftwSinglePrec, muparser, openssl, ffmpeg, python
+, qtbase, qtsvg, qttools, qscintilla }:
+
+mkDerivation rec {
+  pname = "ovito";
+  version = "3.4.0";
+
+  src = fetchFromGitLab {
+    owner = "stuko";
+    repo = "ovito";
+    rev = "v${version}";
+    sha256 = "1y3wr6yzpsl0qm7cicp2mppfszxd0fgx8hm99in9wff9qd0r16b5";
+  };
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  buildInputs = [
+    boost
+    netcdf
+    hdf5
+    fftwSinglePrec
+    muparser
+    openssl
+    ffmpeg
+    python
+    qtbase
+    qtsvg
+    qttools
+    qscintilla
+  ];
+
+  meta = with lib; {
+    description = "Scientific visualization and analysis software for atomistic and particle simulation data";
+    homepage = "https://ovito.org";
+    license = with licenses;  [ gpl3Only mit ];
+    maintainers = with maintainers; [ twhitehead ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/panotools/default.nix b/nixpkgs/pkgs/applications/graphics/panotools/default.nix
new file mode 100644
index 000000000000..52351fab4ce5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/panotools/default.nix
@@ -0,0 +1,24 @@
+{ fetchurl, lib, stdenv, libjpeg, libpng, libtiff, perl }:
+
+stdenv.mkDerivation rec {
+  pname = "libpano13";
+  version = "2.9.20";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/panotools/${pname}-${version}.tar.gz";
+    sha256 = "12cv4886l1czfjwy7k6ipgf3zjksgwhdjzr2s9fdg33vqcv2hlrv";
+  };
+
+  buildInputs = [ perl libjpeg libpng libtiff ];
+
+  # one of the tests succeeds on my machine but fails on Hydra (no idea why)
+  #doCheck = true;
+
+  meta = {
+    homepage = "http://panotools.sourceforge.net/";
+    description = "Free software suite for authoring and displaying virtual reality panoramas";
+    license = lib.licenses.gpl2Plus;
+
+    platforms = lib.platforms.gnu ++ lib.platforms.linux;  # arbitrary choice
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/paraview/default.nix b/nixpkgs/pkgs/applications/graphics/paraview/default.nix
new file mode 100644
index 000000000000..1a761de6ec08
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/paraview/default.nix
@@ -0,0 +1,115 @@
+{ lib, stdenv, fetchFromGitLab, fetchurl
+, boost, cmake, ffmpeg, qtbase, qtx11extras
+, qttools, qtxmlpatterns, qtsvg, gdal, gfortran, libXt, makeWrapper
+, mkDerivation, ninja, mpi, python3, tbb, libGLU, libGL
+, withDocs ? true
+}:
+
+let
+  version = "5.9.1";
+
+  docFiles = [
+    (fetchurl {
+      url = "https://www.paraview.org/paraview-downloads/download.php?submit=Download&version=v${lib.versions.majorMinor version}&type=data&os=Sources&downloadFile=ParaViewTutorial-${version}.pdf";
+      name = "Tutorial.pdf";
+      sha256 = "1knpirjbz3rv8p8n03p39vv8vi5imvxakjsssqgly09g0cnsikkw";
+    })
+    (fetchurl {
+      url = "https://www.paraview.org/paraview-downloads/download.php?submit=Download&version=v${lib.versions.majorMinor version}&type=data&os=Sources&downloadFile=ParaViewGettingStarted-${version}.pdf";
+      name = "GettingStarted.pdf";
+      sha256 = "14xhlvg7s7d5amqf4qfyamx2a6b66zf4cmlfm3s7iw3jq01x1lx6";
+    })
+    (fetchurl {
+      url = "https://www.paraview.org/paraview-downloads/download.php?submit=Download&version=v${lib.versions.majorMinor version}&type=data&os=Sources&downloadFile=ParaViewCatalystGuide-${version}.pdf";
+      name = "CatalystGuide.pdf";
+      sha256 = "133vcfrbg2nh15igl51ns6gnfn1is20vq6j0rg37wha697pmcr4a";
+    })
+  ];
+
+in mkDerivation rec {
+  pname = "paraview";
+  inherit version;
+
+  src = fetchFromGitLab {
+    domain = "gitlab.kitware.com";
+    owner = "paraview";
+    repo = "paraview";
+    rev = "v${version}";
+    sha256 = "0pzic95br0vr785jnpxqmfxcljw3wk7bhm2xy0jfmwm1dh2b7xac";
+    fetchSubmodules = true;
+  };
+
+  # Find the Qt platform plugin "minimal"
+  preConfigure = ''
+    export QT_PLUGIN_PATH=${qtbase.bin}/${qtbase.qtPluginPrefix}
+  '';
+
+  # During build, binaries are called that rely on freshly built
+  # libraries.  These reside in build/lib, and are not found by
+  # default.
+  preBuild = ''
+    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib:$PWD/VTK/ThirdParty/vtkm/vtk-m/lib
+  '';
+
+  cmakeFlags = [
+    "-DCMAKE_BUILD_TYPE=Release"
+    "-DPARAVIEW_ENABLE_FFMPEG=ON"
+    "-DPARAVIEW_ENABLE_GDAL=ON"
+    "-DPARAVIEW_ENABLE_MOTIONFX=ON"
+    "-DPARAVIEW_ENABLE_VISITBRIDGE=ON"
+    "-DPARAVIEW_ENABLE_XDMF3=ON"
+    "-DPARAVIEW_INSTALL_DEVELOPMENT_FILES=ON"
+    "-DPARAVIEW_USE_MPI=ON"
+    "-DPARAVIEW_USE_PYTHON=ON"
+    "-DVTK_SMP_IMPLEMENTATION_TYPE=TBB"
+    "-DVTKm_ENABLE_MPI=ON"
+    "-DCMAKE_INSTALL_LIBDIR=lib"
+    "-DCMAKE_INSTALL_INCLUDEDIR=include"
+    "-DCMAKE_INSTALL_BINDIR=bin"
+    "-DOpenGL_GL_PREFERENCE=GLVND"
+    "-GNinja"
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    makeWrapper
+    ninja
+    gfortran
+  ];
+
+  buildInputs = [
+    libGLU
+    libGL
+    libXt
+    mpi
+    tbb
+    boost
+    ffmpeg
+    gdal
+    qtbase
+    qtx11extras
+    qttools
+    qtxmlpatterns
+    qtsvg
+  ];
+
+  postInstall = let docDir = "$out/share/paraview-${lib.versions.majorMinor version}/doc"; in
+    lib.optionalString withDocs ''
+      mkdir -p ${docDir};
+      for docFile in ${lib.concatStringsSep " " docFiles}; do
+        cp $docFile ${docDir}/$(stripHash $docFile);
+      done;
+    '';
+
+  propagatedBuildInputs = [
+    (python3.withPackages (ps: with ps; [ numpy matplotlib mpi4py ]))
+  ];
+
+  meta = with lib; {
+    homepage = "https://www.paraview.org/";
+    description = "3D Data analysis and visualization application";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ guibert ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/pbrt/default.nix b/nixpkgs/pkgs/applications/graphics/pbrt/default.nix
new file mode 100644
index 000000000000..9fdf92a4ae80
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/pbrt/default.nix
@@ -0,0 +1,31 @@
+{lib, stdenv, fetchFromGitHub, flex, bison, cmake, git, zlib}:
+
+stdenv.mkDerivation {
+  version = "2018-08-15";
+  pname = "pbrt-v3";
+
+  src = fetchFromGitHub {
+    rev = "86b5821308088deea70b207bc8c22219d0103d65";
+    owner  = "mmp";
+    repo   = "pbrt-v3";
+    sha256 = "0f7ivsczba6zfk5f0bba1js6dcwf6w6jrkiby147qp1sx5k35cv8";
+    fetchSubmodules = true;
+  };
+
+  patches = [
+    # https://github.com/mmp/pbrt-v3/issues/196
+    ./openexr-cmake-3.12.patch
+  ];
+
+  nativeBuildInputs = [ flex bison cmake ];
+  buildInputs = [ zlib ];
+
+  meta = with lib; {
+    homepage = "http://pbrt.org";
+    description = "The renderer described in the third edition of the book 'Physically Based Rendering: From Theory To Implementation'";
+    platforms = platforms.linux;
+    license = licenses.bsd2;
+    maintainers = [ maintainers.juliendehos ];
+    priority = 10;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/pbrt/openexr-cmake-3.12.patch b/nixpkgs/pkgs/applications/graphics/pbrt/openexr-cmake-3.12.patch
new file mode 100644
index 000000000000..2993922a1ecf
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/pbrt/openexr-cmake-3.12.patch
@@ -0,0 +1,26 @@
+diff -ur a/src/ext/openexr/CMakeLists.txt b/src/ext/openexr/CMakeLists.txt
+--- a/src/ext/openexr/CMakeLists.txt	1970-01-01 09:00:01.000000000 +0900
++++ b/src/ext/openexr/CMakeLists.txt	2018-08-31 21:44:56.490714484 +0900
+@@ -26,22 +26,4 @@
+   ${CMAKE_CURRENT_BINARY_DIR}/IlmBase/config
+ )
+ 
+-add_custom_target(CopyIlmBaseLibs
+-  COMMAND ${CMAKE_COMMAND} -E copy_directory
+-  ${CMAKE_CURRENT_BINARY_DIR}/IlmBase/Half/$<CONFIGURATION>
+-  ${CMAKE_CURRENT_BINARY_DIR}/OpenEXR/IlmImf/$<CONFIGURATION>
+-  COMMAND ${CMAKE_COMMAND} -E copy_directory
+-  ${CMAKE_CURRENT_BINARY_DIR}/IlmBase/IlmThread/$<CONFIGURATION>
+-  ${CMAKE_CURRENT_BINARY_DIR}/OpenEXR/IlmImf/$<CONFIGURATION>
+-  COMMAND ${CMAKE_COMMAND} -E copy_directory
+-  ${CMAKE_CURRENT_BINARY_DIR}/IlmBase/Iex/$<CONFIGURATION>
+-  ${CMAKE_CURRENT_BINARY_DIR}/OpenEXR/IlmImf/$<CONFIGURATION>
+-  COMMAND ${CMAKE_COMMAND} -E copy_directory
+-  ${CMAKE_CURRENT_BINARY_DIR}/IlmBase/Imath/$<CONFIGURATION>
+-  ${CMAKE_CURRENT_BINARY_DIR}/OpenEXR/IlmImf/$<CONFIGURATION>
+-)
+-add_dependencies(CopyIlmBaseLibs Iex Imath IlmThread Half)
+-
+ add_subdirectory(OpenEXR OpenEXR)
+-add_dependencies(b44ExpLogTable CopyIlmBaseLibs)
+-add_dependencies(dwaLookups CopyIlmBaseLibs)
diff --git a/nixpkgs/pkgs/applications/graphics/pdfcpu/default.nix b/nixpkgs/pkgs/applications/graphics/pdfcpu/default.nix
new file mode 100644
index 000000000000..d30437c93184
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/pdfcpu/default.nix
@@ -0,0 +1,27 @@
+{ lib, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+  pname = "pdfcpu";
+  version = "0.3.12";
+
+  src = fetchFromGitHub {
+    owner = "pdfcpu";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-Ts4FJWUeWHVfeBEetgACYMGEsDLHm5JOEEn7EtQduPU=";
+  };
+
+  vendorSha256 = "sha256-p/2Bu5h2P3ebgvSC12jdR2Zpd27xCFwtB/KZV0AULAM=";
+
+  # No tests
+  doCheck = false;
+
+  subPackages = [ "cmd/pdfcpu" ];
+
+  meta = with lib; {
+    description = "A PDF processor written in Go";
+    homepage = "https://pdfcpu.io";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ doronbehar ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/pencil/default.nix b/nixpkgs/pkgs/applications/graphics/pencil/default.nix
new file mode 100644
index 000000000000..5c5557d6d601
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/pencil/default.nix
@@ -0,0 +1,106 @@
+{ stdenv, fetchurl, lib, makeWrapper, wrapGAppsHook,
+  # build dependencies
+  alsa-lib, atk, at-spi2-atk, at-spi2-core, cairo, cups, dbus, expat, fontconfig,
+  freetype, gdk-pixbuf, glib, glibc, gtk3, libuuid, nspr, nss, pango,
+  xorg, systemd
+}:
+let
+
+  deps = [
+    alsa-lib
+    atk
+    at-spi2-atk
+    at-spi2-core
+    cairo
+    cups
+    dbus
+    expat
+    fontconfig
+    freetype
+    gdk-pixbuf
+    glib
+    glibc
+    gtk3
+    libuuid
+    nspr
+    nss
+    pango
+    xorg.libX11
+    xorg.libxcb
+    xorg.libXScrnSaver
+    xorg.libXcomposite
+    xorg.libXcursor
+    xorg.libXdamage
+    xorg.libXext
+    xorg.libXfixes
+    xorg.libXi
+    xorg.libXrandr
+    xorg.libXrender
+    xorg.libXtst
+    stdenv.cc.cc.lib
+    stdenv.cc.cc
+  ];
+
+in stdenv.mkDerivation rec {
+  version = "3.1.0";
+  pname = "pencil";
+
+  src = fetchurl {
+    url    = "http://pencil.evolus.vn/dl/V${version}.ga/pencil_${version}.ga_amd64.deb";
+    sha256 = "01ae54b1a1351b909eb2366c6ec00816e1deba370e58f35601cf7368f10aaba3";
+  };
+
+  sourceRoot = ".";
+
+  unpackCmd = ''
+    ar p "$src" data.tar.gz | tar xz
+  '';
+
+  dontBuild = true;
+
+  nativeBuildInputs = [ makeWrapper wrapGAppsHook ];
+
+  buildInputs = deps;
+
+  installPhase = ''
+    mkdir -p $out/bin $out/opt $out/share/applications
+    cp -R usr/share $out/
+    cp -R opt/pencil*/ $out/opt/pencil
+    cp $out/opt/pencil/pencil.desktop $out/share/applications/
+
+    # fix the path in the desktop file
+    substituteInPlace \
+      $out/share/applications/pencil.desktop \
+      --replace /opt/ $out/opt/
+
+    # symlink the binary to bin/
+    ln -s $out/opt/pencil/pencil $out/bin/pencil
+  '';
+
+
+  preFixup = let
+    packages = deps;
+    libPathNative = lib.makeLibraryPath packages;
+    libPath64 = lib.makeSearchPathOutput "lib" "lib64" packages;
+    libPath = "${libPathNative}:${libPath64}";
+  in ''
+    # patch executable
+    patchelf \
+      --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+      --set-rpath "${libPath}:$out/opt/pencil" \
+      $out/opt/pencil/pencil
+
+    # fix missing libudev
+    ln -s ${lib.getLib systemd}/lib/libudev.so.1 $out/opt/pencil/libudev.so.1
+    wrapProgram $out/opt/pencil/pencil \
+      --prefix LD_LIBRARY_PATH : $out/opt/pencil
+  '';
+
+  meta = with lib; {
+    description = "GUI prototyping/mockup tool";
+    homepage    = "https://pencil.evolus.vn/";
+    license     = licenses.gpl2; # Commercial license is also available
+    maintainers = with maintainers; [ bjornfor prikhi mrVanDalo ];
+    platforms   = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/photivo/default.nix b/nixpkgs/pkgs/applications/graphics/photivo/default.nix
new file mode 100644
index 000000000000..4acb50e200fd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/photivo/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchhg, fetchpatch, cmake, qt4, fftw, graphicsmagick_q16,
+  lcms2, lensfun, pkg-config, libjpeg, exiv2, liblqr1 }:
+
+stdenv.mkDerivation {
+  name = "photivo-2014-01-25";
+
+  src = fetchhg {
+    url = "http://code.google.com/p/photivo/";
+    rev = "d687864489da";
+    sha256 = "0f6y18k7db2ci6xn664zcwm1g1k04sdv7gg1yd5jk41bndjb7z8h";
+  };
+
+  patches = [
+    # Patch fixing build with lensfun >= 0.3, taken from
+    # https://www.linuxquestions.org/questions/slackware-14/photivo-4175530230/#post5296578
+    (fetchpatch {
+      url = "https://www.linuxquestions.org/questions/attachment.php?attachmentid=17287&d=1420577220";
+      name = "lensfun-0.3.patch";
+      sha256 = "0ys45x4r4bjjlx0zpd5d56rgjz7k8gxili4r4k8zx3zfka4a3zwv";
+    })
+    ./gcc6.patch
+  ];
+
+  postPatch = '' # kinda icky
+    sed -e '/("@INSTALL@")/d' \
+        -e s,@INSTALL@,$out/share/photivo, \
+        -i Sources/ptSettings.cpp
+    sed '1i#include <math.h>' -i Sources/filters/ptFilter_StdCurve.cpp
+  '';
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  buildInputs = [ qt4 fftw graphicsmagick_q16 lcms2 lensfun libjpeg exiv2 liblqr1 ];
+
+  meta = with lib; {
+    platforms = platforms.linux;
+    license = licenses.gpl3;
+    broken = true; # exiv2 0.27.1 FTBFS
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/photivo/gcc6.patch b/nixpkgs/pkgs/applications/graphics/photivo/gcc6.patch
new file mode 100644
index 000000000000..e2eb795fc8e2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/photivo/gcc6.patch
@@ -0,0 +1,13 @@
+diff --git c/Sources/ptImage.cpp i/Sources/ptImage.cpp
+index 9c95093..623c157 100755
+--- c/Sources/ptImage.cpp
++++ i/Sources/ptImage.cpp
+@@ -5291,7 +5291,7 @@ ptImage* ptImage::Box(const uint16_t MaxRadius, float* Mask) {
+         NewRow = NewRow < 0? -NewRow : NewRow > Height1? Height1_2-NewRow : NewRow ;

+         NewRow *= m_Width;

+         for(j = -IntRadius; j <= IntRadius; j++) {

+-          if (Dist[abs(i)][abs(j)] < Radius) {

++          if (Dist[int16_t(abs(i))][int16_t(abs(j))] < Radius) {

+             NewCol = Col+j;

+             NewCol = NewCol < 0? -NewCol : NewCol > Width1? Width1_2-NewCol : NewCol ;

+ 

diff --git a/nixpkgs/pkgs/applications/graphics/photoflare/default.nix b/nixpkgs/pkgs/applications/graphics/photoflare/default.nix
new file mode 100644
index 000000000000..cc4f4342c618
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/photoflare/default.nix
@@ -0,0 +1,29 @@
+{ mkDerivation, lib, graphicsmagick, fetchFromGitHub, qmake, qtbase, qttools
+}:
+
+mkDerivation rec {
+  pname = "photoflare";
+  version = "1.6.7.1";
+
+  src = fetchFromGitHub {
+    owner = "PhotoFlare";
+    repo = "photoflare";
+    rev = "v${version}";
+    sha256 = "sha256-7b7ICcHuMjOMtyQDkokoHeZrF4G+bOzgRJP4mkns+Zc=";
+  };
+
+  nativeBuildInputs = [ qmake qttools ];
+  buildInputs = [ qtbase graphicsmagick ];
+
+  qmakeFlags = [ "PREFIX=${placeholder "out"}" ];
+
+  NIX_CFLAGS_COMPILE = "-I${graphicsmagick}/include/GraphicsMagick";
+
+  meta = with lib; {
+    description = "A cross-platform image editor with a powerful features and a very friendly graphical user interface";
+    homepage = "https://photoflare.io";
+    maintainers = [ maintainers.omgbebebe ];
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/photoflow/CMakeLists.patch b/nixpkgs/pkgs/applications/graphics/photoflow/CMakeLists.patch
new file mode 100644
index 000000000000..7d3d62b41b42
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/photoflow/CMakeLists.patch
@@ -0,0 +1,13 @@
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 9b48beea..078ba20d 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -603,7 +603,7 @@ ENDIF(APPLE)
+ #
+ # photoflow executable
+ #
+-add_executable(photoflow main.cc ${RESOURCE_OBJECT})
++add_executable(photoflow main.cc version.cc ${RESOURCE_OBJECT})
+ IF(APPLE)
+   set_target_properties(photoflow PROPERTIES LINK_FLAGS " -framework ApplicationServices ")
+ ENDIF(APPLE)
diff --git a/nixpkgs/pkgs/applications/graphics/photoflow/default.nix b/nixpkgs/pkgs/applications/graphics/photoflow/default.nix
new file mode 100644
index 000000000000..46e5ce420a78
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/photoflow/default.nix
@@ -0,0 +1,94 @@
+{ automake
+, cmake
+, exiv2
+, expat
+, fetchFromGitHub
+, fftw
+, fftwFloat
+, gettext
+, glib
+, gobject-introspection
+, gtkmm2
+, lcms2
+, lensfun
+, libexif
+, libiptcdata
+, libjpeg
+, libraw
+, libtiff
+, libxml2
+, ninja
+, openexr
+, pcre
+, pkg-config
+, pugixml
+, lib, stdenv
+, swig
+, vips
+}:
+
+stdenv.mkDerivation rec {
+  pname = "photoflow";
+  version = "2020-08-28";
+
+  src = fetchFromGitHub {
+    owner = "aferrero2707";
+    repo = pname;
+    rev = "8472024fb91175791e0eb23c434c5b58ecd250eb";
+    sha256 = "1bq4733hbh15nwpixpyhqfn3bwkg38amdj2xc0my0pii8l9ln793";
+  };
+
+  patches = [ ./CMakeLists.patch ];
+
+  nativeBuildInputs = [
+    automake
+    cmake
+    gettext
+    glib
+    gobject-introspection
+    libxml2
+    ninja
+    pkg-config
+    swig
+  ];
+
+  buildInputs = [
+    exiv2
+    expat
+    fftw
+    fftwFloat
+    gtkmm2  # Could be build with gtk3 but proper UI theme is missing and therefore not very usable with gtk3
+            # See: https://discuss.pixls.us/t/help-needed-for-gtk3-theme/5803
+    lcms2
+    lensfun
+    libexif
+    libiptcdata
+    libjpeg
+    libraw
+    libtiff
+    openexr
+    pcre
+    pugixml
+    vips
+  ];
+
+  cmakeFlags = [
+    "-DBUNDLED_EXIV2=OFF"
+    "-DBUNDLED_LENSFUN=OFF"
+    "-DBUNDLED_GEXIV2=OFF"
+  ];
+
+  meta = with lib; {
+    description = "A fully non-destructive photo retouching program providing a complete RAW image editing workflow";
+    homepage = "https://aferrero2707.github.io/PhotoFlow/";
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.MtP ];
+    platforms = platforms.linux;
+    # sse3 is not supported on aarch64
+    badPlatforms = [ "aarch64-linux" ];
+    # added 2021-09-30
+    # upstream seems pretty dead
+    #/build/source/src/operations/denoise.cc:30:10: fatal error: vips/cimg_funcs.h: No such file or directory
+    broken = true;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/photoqt/default.nix b/nixpkgs/pkgs/applications/graphics/photoqt/default.nix
new file mode 100644
index 000000000000..52e38b23c1ff
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/photoqt/default.nix
@@ -0,0 +1,46 @@
+{ mkDerivation, lib, fetchurl, cmake, exiv2, graphicsmagick, libraw, fetchpatch
+, qtbase, qtdeclarative, qtmultimedia, qtquickcontrols, qttools, qtgraphicaleffects
+, extra-cmake-modules, poppler, kimageformats, libarchive, libdevil
+}:
+
+mkDerivation rec {
+  pname = "photoqt";
+  version = "1.7.1";
+
+  src = fetchurl {
+    url = "https://${pname}.org/pkgs/${pname}-${version}.tar.gz";
+    sha256 = "1qvxdh3cbjcywqx0da2qp8z092660qyzv5yknqbps2zr12qqb103";
+  };
+
+  patches = [
+    # Fixes build with exiv2 0.27.1
+    (fetchpatch {
+      url = "https://gitlab.com/luspi/photoqt/commit/c6fd41478e818f3a651d40f96cab3d790e1c09a4.patch";
+      sha256 = "1j2pdr7hm3js7lswhb4qkf9sj9viclhjqz50qxpyd7pqrl1gf2va";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake extra-cmake-modules qttools ];
+
+  buildInputs = [
+    qtbase qtquickcontrols exiv2 graphicsmagick poppler
+    qtmultimedia qtdeclarative libraw qtgraphicaleffects
+    kimageformats libarchive
+  ];
+
+  cmakeFlags = [
+    "-DFREEIMAGE=OFF"
+    "-DDEVIL=OFF"
+  ];
+
+  preConfigure = ''
+    export MAGICK_LOCATION="${graphicsmagick}/include/GraphicsMagick"
+  '';
+
+  meta = {
+    homepage = "https://photoqt.org/";
+    description = "Simple, yet powerful and good looking image viewer";
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/phototonic/default.nix b/nixpkgs/pkgs/applications/graphics/phototonic/default.nix
new file mode 100644
index 000000000000..5044e60161cf
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/phototonic/default.nix
@@ -0,0 +1,28 @@
+{ mkDerivation, lib, fetchFromGitHub, qtbase, qmake, exiv2 }:
+
+mkDerivation rec {
+  pname = "phototonic";
+  version = "2.1";
+
+  src = fetchFromGitHub {
+    repo = "phototonic";
+    owner = "oferkv";
+    rev = "v${version}";
+    sha256 = "0csidmxl1sfmn6gq81vn9f9jckb4swz3sgngnwqa4f75lr6604h7";
+  };
+
+  buildInputs = [ qtbase exiv2 ];
+  nativeBuildInputs = [ qmake ];
+
+  preConfigure = ''
+    sed -i 's;/usr;$$PREFIX/;g' phototonic.pro
+  '';
+
+  meta = with lib; {
+    description = "An image viewer and organizer";
+    homepage = "https://sourceforge.net/projects/phototonic/";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ pSub ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/pick-colour-picker/default.nix b/nixpkgs/pkgs/applications/graphics/pick-colour-picker/default.nix
new file mode 100644
index 000000000000..0d3a86663b30
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/pick-colour-picker/default.nix
@@ -0,0 +1,67 @@
+{ lib
+, fetchFromGitHub
+, buildPythonPackage
+, pygobject3
+, pycairo
+, glib
+, gtk3
+, gobject-introspection
+, wrapGAppsHook
+, python
+}:
+
+buildPythonPackage rec {
+  pname = "pick-colour-picker";
+  version = "unstable-2021-01-19";
+
+  src = fetchFromGitHub {
+    owner = "stuartlangridge";
+    repo = "ColourPicker";
+    rev = "dec8f144918aa7964aaf86a346161beb7e997f09";
+    sha256 = "hW2rarfchZ3M0JVfz5RbJRvMhv2PpyLNEMyMAp2gC+o=";
+    fetchSubmodules = false;
+  };
+
+  nativeBuildInputs = [
+    gobject-introspection
+    wrapGAppsHook
+  ];
+
+  pythonPath = [
+    pygobject3
+    pycairo
+  ];
+
+  buildInputs = [
+    glib
+    gtk3
+  ];
+
+  # https://github.com/NixOS/nixpkgs/issues/56943
+  # this must be false, otherwise the gobject-introspection hook doesn't run
+  strictDeps = false;
+
+  preDistPhases = [ "fixupIconPath" ];
+
+  fixupIconPath = ''
+    pickLoc="$out/${python.sitePackages}/pick"
+    shareLoc=$(echo "$out/${python.sitePackages}/nix/store/"*)
+    mv "$shareLoc/share" "$out/share"
+
+    sed "s|os.environ.get('SNAP'), \"usr\"|'$out'|g" -i "$pickLoc/__main__.py"
+    '';
+
+  meta = with lib; {
+    homepage = "https://kryogenix.org/code/pick/";
+    license = licenses.mit;
+    platforms = platforms.linux;
+    description = "A colour picker that remembers where you picked colours from";
+    maintainers = [ maintainers.mkg20001 ];
+
+    longDescription = ''
+      Pick lets you pick colours from anywhere on your screen. Choose the colour you want and Pick remembers it, names it, and shows you a screenshot so you can remember where you got it from.
+
+      Zoom all the way in to pixels to pick just the right one. Show your colours in your choice of format: rgba() or hex, CSS or Gdk or Qt, whichever you prefer. Copy to the clipboard ready for pasting into code or graphics apps.
+      '';
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/pikopixel/default.nix b/nixpkgs/pkgs/applications/graphics/pikopixel/default.nix
new file mode 100644
index 000000000000..97a3684682d4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/pikopixel/default.nix
@@ -0,0 +1,48 @@
+{ lib
+, fetchurl
+, gnustep
+, gcc
+, llvmPackages_9
+}:
+
+let
+  # Earlier llvm than 9 segfaults
+  gnustep' = gnustep.override { llvmPackages = llvmPackages_9; };
+
+in gnustep'.gsmakeDerivation rec {
+  pname = "pikopixel";
+  version = "1.0-b10";
+
+  src = fetchurl {
+    url = "http://twilightedge.com/downloads/PikoPixel.Sources.${version}.tar.gz";
+    sha256 = "1b27npgsan2nx1p581b9q2krx4506yyd6s34r4sf1r9x9adshm77";
+  };
+
+  sourceRoot = "PikoPixel.Sources.${version}/PikoPixel";
+
+  buildInputs = [
+    gnustep'.base
+    gnustep'.gui
+    gnustep'.back
+  ];
+
+  # Fix the Exec and Icon paths in the .desktop file, and save the file in the
+  # correct place.
+  # postInstall gets redefined in gnustep.make's builder.sh, so we use preFixup
+  preFixup = ''
+    mkdir -p $out/share/applications
+    sed \
+      -e "s@^Exec=.*\$@Exec=$out/bin/PikoPixel %F@" \
+      -e "s@^Icon=.*/local@Icon=$out@" \
+      PikoPixel.app/Resources/PikoPixel.desktop > $out/share/applications/PikoPixel.desktop
+  '';
+
+  meta = with lib; {
+    description = "Application for drawing and editing pixel-art images";
+    homepage = "http://twilightedge.com/mac/pikopixel/";
+    downloadPage = "http://twilightedge.com/mac/pikopixel/";
+    license = licenses.agpl3;
+    maintainers = with maintainers; [ fgaz ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/pinta/default.nix b/nixpkgs/pkgs/applications/graphics/pinta/default.nix
new file mode 100644
index 000000000000..2635b2d3d886
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/pinta/default.nix
@@ -0,0 +1,83 @@
+{ lib, fetchFromGitHub, buildDotnetPackage, dotnetPackages, gtksharp,
+  gettext }:
+
+let
+  mono-addins = dotnetPackages.MonoAddins;
+in
+buildDotnetPackage rec {
+  name = "pinta-1.6";
+
+  baseName = "Pinta";
+  version = "1.6";
+  outputFiles = [ "bin/*" ];
+  buildInputs = [ gtksharp mono-addins gettext ];
+  xBuildFiles = [ "Pinta.sln" ];
+
+  src = fetchFromGitHub {
+    owner = "PintaProject";
+    repo = "Pinta";
+    rev = version;
+    sha256 = "0vgswy981c7ys4q7js5k85sky7bz8v32wsfq3br4j41vg92pw97d";
+  };
+
+  # Remove version information from nodes <Reference Include="... Version=... ">
+  postPatch = with lib; let
+    csprojFiles = [
+      "Pinta/Pinta.csproj"
+      "Pinta.Core/Pinta.Core.csproj"
+      "Pinta.Effects/Pinta.Effects.csproj"
+      "Pinta.Gui.Widgets/Pinta.Gui.Widgets.csproj"
+      "Pinta.Resources/Pinta.Resources.csproj"
+      "Pinta.Tools/Pinta.Tools.csproj"
+    ];
+    versionedNames = [
+      "Mono\\.Addins"
+      "Mono\\.Posix"
+      "Mono\\.Addins\\.Gui"
+      "Mono\\.Addins\\.Setup"
+    ];
+
+    stripVersion = name: file: let
+        match = ''<Reference Include="${name}([ ,][^"]*)?"'';
+        replace = ''<Reference Include="${name}"'';
+      in "sed -i -re 's/${match}/${replace}/g' ${file}\n";
+
+    # Map all possible pairs of two lists
+    map2 = f: listA: listB: concatMap (a: map (f a) listB) listA;
+    concatMap2Strings = f: listA: listB: concatStrings (map2 f listA listB);
+  in
+    concatMap2Strings stripVersion versionedNames csprojFiles
+    + ''
+      # For some reason there is no Microsoft.Common.tasks file
+      # in ''${mono}/lib/mono/3.5 .
+      substituteInPlace Pinta.Install.proj \
+        --replace 'ToolsVersion="3.5"' 'ToolsVersion="4.0"' \
+        --replace "/usr/local" "$out"
+    '';
+
+  makeWrapperArgs = [
+    "--prefix MONO_GAC_PREFIX : ${gtksharp}"
+    "--prefix LD_LIBRARY_PATH : ${gtksharp}/lib"
+    "--prefix LD_LIBRARY_PATH : ${gtksharp.gtk.out}/lib"
+  ];
+
+  postInstall = ''
+    # Do automake's job manually
+    substitute xdg/pinta.desktop.in xdg/pinta.desktop \
+      --replace _Name Name \
+      --replace _Comment Comment \
+      --replace _GenericName GenericName \
+      --replace _X-GNOME-FullName X-GNOME-FullName
+
+    xbuild /target:CompileTranslations Pinta.Install.proj
+    xbuild /target:Install Pinta.Install.proj
+  '';
+
+  meta = {
+    homepage = "https://www.pinta-project.com/";
+    description = "Drawing/editing program modeled after Paint.NET";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ ];
+    platforms = with lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/pixelnuke/default.nix b/nixpkgs/pkgs/applications/graphics/pixelnuke/default.nix
new file mode 100644
index 000000000000..4cb2440cb8ee
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/pixelnuke/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, libevent, glew, glfw }:
+
+stdenv.mkDerivation {
+  pname = "pixelnuke";
+  version = "unstable-2019-05-19";
+
+  src = fetchFromGitHub {
+    owner = "defnull";
+    repo = "pixelflut";
+    rev = "3458157a242ba1789de7ce308480f4e1cbacc916";
+    sha256 = "03dp0p00chy00njl4w02ahxqiwqpjsrvwg8j4yi4dgckkc3gbh40";
+  };
+
+  sourceRoot = "source/pixelnuke";
+
+  buildInputs = [ libevent glew glfw ];
+
+  installPhase = ''
+    install -Dm755 ./pixelnuke $out/bin/pixelnuke
+  '';
+
+  meta = with lib; {
+    description = "Multiplayer canvas (C implementation)";
+    homepage = "https://cccgoe.de/wiki/Pixelflut";
+    license = licenses.unlicense;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ mrVanDalo ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/potrace/default.nix b/nixpkgs/pkgs/applications/graphics/potrace/default.nix
new file mode 100644
index 000000000000..9392f27c1713
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/potrace/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchurl, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "potrace";
+  version = "1.16";
+
+  src = fetchurl {
+    url = "http://potrace.sourceforge.net/download/${version}/potrace-${version}.tar.gz";
+    sha256 = "1k3sxgjqq0jnpk9xxys05q32sl5hbf1lbk1gmfxcrmpdgnhli0my";
+  };
+
+  configureFlags = [ "--with-libpotrace" ];
+
+  buildInputs = [ zlib ];
+
+  enableParallelBuilding = true;
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "http://potrace.sourceforge.net/";
+    description = "A tool for tracing a bitmap, which means, transforming a bitmap into a smooth, scalable image";
+    platforms = platforms.unix;
+    maintainers = [ maintainers.pSub ];
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/pqiv/default.nix b/nixpkgs/pkgs/applications/graphics/pqiv/default.nix
new file mode 100644
index 000000000000..f678af706119
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/pqiv/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config
+, ffmpeg, gtk3, imagemagick, libarchive, libspectre, libwebp, poppler
+}:
+
+stdenv.mkDerivation (rec {
+  pname = "pqiv";
+  version = "2.12";
+
+  src = fetchFromGitHub {
+    owner = "phillipberndt";
+    repo = "pqiv";
+    rev = version;
+    sha256 = "18nvrqmlifh4m8nfs0d19sb9d1l3a95xc89qxqdr881jcxdsgflw";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ ffmpeg gtk3 imagemagick libarchive libspectre libwebp poppler ];
+
+  prePatch = "patchShebangs .";
+
+  meta = with lib; {
+    description = "Powerful image viewer with minimal UI";
+    homepage = "https://www.pberndt.com/Programme/Linux/pqiv";
+    license = licenses.gpl3Plus;
+    maintainers = [];
+    platforms = platforms.linux;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/graphics/processing/default.nix b/nixpkgs/pkgs/applications/graphics/processing/default.nix
new file mode 100644
index 000000000000..2e61e40b01fe
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/processing/default.nix
@@ -0,0 +1,73 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, fetchurl, xmlstarlet, makeWrapper, ant, jdk, rsync, javaPackages, libXxf86vm, gsettings-desktop-schemas }:
+
+stdenv.mkDerivation rec {
+  pname = "processing";
+  version = "3.5.4";
+
+  src = fetchFromGitHub {
+    owner = "processing";
+    repo = "processing";
+    rev = "processing-0270-${version}";
+    sha256 = "0cvv8jda9y8qnfcsziasyv3w7h3w22q78ihr23cm4an63ghxci58";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "oraclejdk-8u281-compat.patch";
+      url = "https://github.com/processing/processing/commit/7e176876173c93e3a00a922e7ae37951366d1761.patch";
+      sha256 = "g+zwpoIVgw7Sp6QWW3vyPZ/fKHk+o/YCY6xnrX8IGKo=";
+    })
+  ];
+
+  nativeBuildInputs = [ ant rsync makeWrapper ];
+  buildInputs = [ jdk ];
+
+  buildPhase = ''
+    # use compiled jogl to avoid patchelf'ing .so files inside jars
+    rm core/library/*.jar
+    cp ${javaPackages.jogl_2_3_2}/share/java/*.jar core/library/
+
+    # do not download a file during build
+    ${xmlstarlet}/bin/xmlstarlet ed --inplace -P -d '//get[@src="http://download.processing.org/reference.zip"]' build/build.xml
+    install -D -m0444 ${fetchurl {
+                          # Use archive.org link for reproducibility until the following issue is fixed:
+                          # https://github.com/processing/processing/issues/5711
+                          url = "https://web.archive.org/web/20200406132357/https://download.processing.org/reference.zip";
+                          sha256 = "093hc7kc9wfxqgf5dzfmfp68pbsy8x647cj0a25vgjm1swi61zbi";
+                        }
+                       } ./java/reference.zip
+
+    # suppress "Not fond of this Java VM" message box
+    substituteInPlace app/src/processing/app/platform/LinuxPlatform.java \
+      --replace 'Messages.showWarning' 'if (false) Messages.showWarning'
+
+    ( cd build
+      substituteInPlace build.xml --replace "jre-download," ""  # do not download jre1.8.0_144
+      mkdir -p linux/jre1.8.0_144                               # fake dir to avoid error
+      ant build )
+  '';
+
+  installPhase = ''
+    mkdir $out
+    cp -dpR build/linux/work $out/${pname}
+
+    rmdir $out/${pname}/java
+    ln -s ${jdk} $out/${pname}/java
+
+    makeWrapper $out/${pname}/processing      $out/bin/processing \
+        --prefix XDG_DATA_DIRS : ${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name} \
+        --prefix _JAVA_OPTIONS " " -Dawt.useSystemAAFontSettings=lcd \
+        --prefix LD_LIBRARY_PATH : ${libXxf86vm}/lib
+    makeWrapper $out/${pname}/processing-java $out/bin/processing-java \
+        --prefix XDG_DATA_DIRS : ${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name} \
+        --prefix _JAVA_OPTIONS " " -Dawt.useSystemAAFontSettings=lcd \
+        --prefix LD_LIBRARY_PATH : ${libXxf86vm}/lib
+  '';
+
+  meta = with lib; {
+    description = "A language and IDE for electronic arts";
+    homepage = "https://processing.org";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/qcomicbook/default.nix b/nixpkgs/pkgs/applications/graphics/qcomicbook/default.nix
new file mode 100644
index 000000000000..47bf2d950283
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/qcomicbook/default.nix
@@ -0,0 +1,43 @@
+{ mkDerivation, lib, fetchFromGitHub, pkg-config, cmake, qtbase, qttools, qtx11extras, poppler }:
+
+mkDerivation rec {
+  pname = "qcomicbook";
+  version = "0.9.1";
+
+  src = fetchFromGitHub {
+    owner = "stolowski";
+    repo = "QComicBook";
+    rev = version;
+    sha256 = "1b769lp6gfwds4jb2g7ymhdm9c06zg57zpyz3zpdb40w07zfsjzv";
+  };
+
+  nativeBuildInputs = [
+    cmake pkg-config
+  ];
+
+  buildInputs = [
+    qtbase qttools qtx11extras poppler
+  ];
+
+  postInstall = ''
+    substituteInPlace $out/share/applications/*.desktop \
+      --replace "Exec=qcomicbook" "Exec=$out/bin/qcomicbook"
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/stolowski/QComicBook";
+    description = "Comic book reader in Qt5";
+    license = licenses.gpl2;
+
+    longDescription = ''
+      QComicBook is a viewer for PDF files and comic book archives containing
+      jpeg/png/xpm/gif/bmp images, which aims at convenience and simplicity.
+      Features include: automatic unpacking of archive files, full-screen mode, continuous
+      scrolling mode, double-pages viewing, manga mode, thumbnails view, page scaling,
+      mouse or keyboard navigation etc.
+    '';
+
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ greydot ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/qimgv/default.nix b/nixpkgs/pkgs/applications/graphics/qimgv/default.nix
new file mode 100644
index 000000000000..d3a46482be52
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/qimgv/default.nix
@@ -0,0 +1,60 @@
+{ mkDerivation
+, lib
+, fetchFromGitHub
+, fetchpatch
+
+, cmake
+, pkg-config
+
+, exiv2
+, mpv
+, opencv4
+, qtbase
+, qtimageformats
+, qtsvg
+}:
+
+mkDerivation rec {
+  pname = "qimgv";
+  version = "1.0.1";
+
+  src = fetchFromGitHub {
+    owner = "easymodo";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1wybpmqvj7vj7cl6r4gif7mkrcdr6zpb939mmz46xsil5vb4pirh";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
+
+  buildInputs = [
+    exiv2
+    mpv
+    opencv4
+    qtbase
+    qtimageformats
+    qtsvg
+  ];
+
+  postPatch = ''
+    sed -i "s@/usr/bin/mpv@${mpv}/bin/mpv@" \
+      qimgv/settings.cpp
+  '';
+
+  # Wrap the library path so it can see `libqimgv_player_mpv.so`, which is used
+  # to play video files within qimgv itself.
+  qtWrapperArgs = [
+    "--prefix LD_LIBRARY_PATH : ${placeholder "out"}/lib"
+  ];
+
+  meta = with lib; {
+    description = "A Qt5 image viewer with optional video support";
+    homepage = "https://github.com/easymodo/qimgv";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ cole-h ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/qimgv/qt5-12-compat.diff b/nixpkgs/pkgs/applications/graphics/qimgv/qt5-12-compat.diff
new file mode 100644
index 000000000000..da64759e22d6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/qimgv/qt5-12-compat.diff
@@ -0,0 +1,13 @@
+diff --git a/qimgv/components/directorymanager/watchers/linux/linuxworker.cpp b/qimgv/components/directorymanager/watchers/linux/linuxworker.cpp
+index 96ec9d3..6d95d08 100644
+--- a/qimgv/components/directorymanager/watchers/linux/linuxworker.cpp
++++ b/qimgv/components/directorymanager/watchers/linux/linuxworker.cpp
+@@ -21,7 +21,7 @@ void LinuxWorker::setDescriptor(int desc) {
+ 
+ void LinuxWorker::run() {
+     emit started();
+-    isRunning.storeRelaxed(true);
++    isRunning.store(true);
+ 
+     if (fd == -1) {
+         qDebug() << TAG << "File descriptor isn't set! Stopping";
diff --git a/nixpkgs/pkgs/applications/graphics/qiv/default.nix b/nixpkgs/pkgs/applications/graphics/qiv/default.nix
new file mode 100644
index 000000000000..0075abc0f6f0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/qiv/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, pkg-config, gtk2, imlib2, file, lcms2, libexif } :
+
+stdenv.mkDerivation (rec {
+  version = "2.3.2";
+  pname = "qiv";
+
+  src = fetchurl {
+    url = "https://spiegl.de/qiv/download/${pname}-${version}.tgz";
+    sha256 = "1mc0f2nnas4q0d7zc9r6g4z93i32xlx0p9hl4fn5zkyml24a1q28";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ gtk2 imlib2 file lcms2 libexif ];
+
+  preBuild=''
+    substituteInPlace Makefile --replace /usr/local "$out"
+    substituteInPlace Makefile --replace /man/ /share/man/
+    substituteInPlace Makefile --replace /share/share/ /share/
+  '';
+
+  meta = with lib; {
+    description = "Quick image viewer";
+    homepage = "http://spiegl.de/qiv/";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/graphics/qiv/default.upstream b/nixpkgs/pkgs/applications/graphics/qiv/default.upstream
new file mode 100644
index 000000000000..e6c7ef2408e8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/qiv/default.upstream
@@ -0,0 +1,3 @@
+url http://spiegl.de/qiv/download/
+version_link '[.]tgz$'
+do_overwrite() { do_overwrite_just_version; }
diff --git a/nixpkgs/pkgs/applications/graphics/qosmic/default.nix b/nixpkgs/pkgs/applications/graphics/qosmic/default.nix
new file mode 100644
index 000000000000..96823441b6e1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/qosmic/default.nix
@@ -0,0 +1,70 @@
+{ mkDerivation
+, fetchFromGitHub
+, fetchpatch
+, qmake
+, wrapQtAppsHook
+, qtbase
+, pkg-config
+, lua
+, flam3
+, libxml2
+, libpng
+, libjpeg
+, lib
+}:
+
+mkDerivation rec {
+  pname = "qosmic";
+  version = "1.6.0";
+
+  src = fetchFromGitHub {
+    owner = "bitsed";
+    repo = "qosmic";
+    rev = "v${version}";
+    sha256 = "13nw1mkdib14430r21mj352v62vi546vf184vyhxm7yjjygyra1w";
+  };
+
+  patches = [
+    # Allow overriding PREFIX (to install to $out,
+    # written while creating this derivation)
+    # https://github.com/bitsed/qosmic/pull/39
+    (fetchpatch {
+      name = "allow-overriding-PREFIX.patch";
+      url = "https://github.com/bitsed/qosmic/commit/77fb3a577b0710efae2a1d9ed97c26ae16f3a5ba.patch";
+      sha256 = "0v9hj9s78cb6bg8ca0wjkbr3c7ml1n51n8h4a70zpzzgzz7rli5b";
+    })
+    # Fix QButtonGroup include errors with Qt 5.11:
+    # Will be part of the next post-1.6.0 release
+    (fetchpatch {
+      name = "fix-class-QButtonGroup-include-errors-with-Qt-5.11.patch";
+      url = "https://github.com/bitsed/qosmic/commit/3f6e1ea8d384a124dbc2d568171a4da798480752.patch";
+      sha256 = "0bp6b759plkqs32nvfpkfvf3qqzc9716k3ycwnjvwabbvpg1xwbl";
+    })
+  ];
+
+  nativeBuildInputs = [ qmake wrapQtAppsHook pkg-config ];
+
+  buildInputs = [
+    qtbase
+    lua
+    flam3
+    libxml2
+    libpng
+    libjpeg
+  ];
+
+  qmakeFlags = [
+    # Use pkg-config to correctly locate library paths
+    "-config" "link_pkgconfig"
+  ];
+
+  meta = with lib; {
+    description = "A cosmic recursive flame fractal editor";
+    homepage = "https://github.com/bitsed/qosmic";
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.raboof ];
+    # It might be possible to make it work on OSX,
+    # but this has not been tested.
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/qscreenshot/default.nix b/nixpkgs/pkgs/applications/graphics/qscreenshot/default.nix
new file mode 100644
index 000000000000..b3e555358bed
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/qscreenshot/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, dos2unix, which, qt, Carbon }:
+
+stdenv.mkDerivation rec {
+  name = "qscreenshot-1.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/qscreenshot/${name}-src.tar.gz";
+    sha256 = "1spj5fg2l8p5bk81xsv6hqn1kcrdiy54w19jsfb7g5i94vcb1pcx";
+  };
+
+  buildInputs = [ dos2unix which qt ]
+    ++ lib.optional stdenv.isDarwin Carbon;
+
+  # Remove carriage returns that cause /bin/sh to abort
+  preConfigure = ''
+    dos2unix configure
+    sed -i "s|lrelease-qt4|lrelease|" src/src.pro
+  '';
+
+  meta = with lib; {
+    description = "Simple creation and editing of screenshots";
+    homepage = "https://sourceforge.net/projects/qscreenshot/";
+    license = licenses.gpl2;
+    platforms = platforms.all;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/qvge/default.nix b/nixpkgs/pkgs/applications/graphics/qvge/default.nix
new file mode 100644
index 000000000000..f50e87d1eddb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/qvge/default.nix
@@ -0,0 +1,39 @@
+{ lib
+, mkDerivation
+, fetchFromGitHub
+, substituteAll
+, qmake
+, qtx11extras
+, graphviz
+}:
+
+mkDerivation rec {
+  pname = "qvge";
+  version = "0.6.3";
+
+  src = fetchFromGitHub {
+    owner = "ArsMasiuk";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-rtbUAp3l0VZsu+D9HCHM3q0UkDLflw50rYRq/LP4Wu4=";
+  };
+
+  sourceRoot = "${src.name}/src";
+
+  patches = (substituteAll {
+    src = ./set-graphviz-path.patch;
+    inherit graphviz;
+  });
+
+  nativeBuildInputs = [ qmake ];
+
+  buildInputs = [ qtx11extras ];
+
+  meta = with lib; {
+    description = "Qt Visual Graph Editor";
+    homepage = "https://github.com/ArsMasiuk/qvge";
+    license = licenses.mit;
+    maintainers = with maintainers; [ sikmir ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/qvge/set-graphviz-path.patch b/nixpkgs/pkgs/applications/graphics/qvge/set-graphviz-path.patch
new file mode 100644
index 000000000000..d18eb81c5d04
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/qvge/set-graphviz-path.patch
@@ -0,0 +1,13 @@
+diff --git i/commonui/CNodeEditorUIController.cpp w/commonui/CNodeEditorUIController.cpp
+index 7dacd48..64983e4 100644
+--- i/commonui/CNodeEditorUIController.cpp
++++ w/commonui/CNodeEditorUIController.cpp
+@@ -123,7 +123,7 @@ CNodeEditorUIController::CNodeEditorUIController(CMainWindow *parent) :
+ 	QString pathToGraphviz = QCoreApplication::applicationDirPath() + "/../tools/graphviz";
+ 	m_optionsData.graphvizPath = QFileInfo(pathToGraphviz).absoluteFilePath();
+ #else
+-	m_optionsData.graphvizPath = "";
++	m_optionsData.graphvizPath = "@graphviz@/bin";
+ #endif
+ 	m_gvController->setPathToGraphviz(m_optionsData.graphvizPath);
+ 
diff --git a/nixpkgs/pkgs/applications/graphics/qview/default.nix b/nixpkgs/pkgs/applications/graphics/qview/default.nix
new file mode 100644
index 000000000000..7f4f4cc1a976
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/qview/default.nix
@@ -0,0 +1,40 @@
+{ lib
+, mkDerivation
+, fetchFromGitHub
+, qmake
+, qtbase
+, qtimageformats
+, qtsvg
+}:
+
+mkDerivation rec {
+  pname = "qview";
+  version = "4.0";
+
+  src = fetchFromGitHub {
+    owner = "jurplel";
+    repo = "qView";
+    rev = version;
+    sha256 = "15n9cq7w3ckinnx38hvncxrbkv4qm4k51sal41q4y0pkvhmafhnr";
+  };
+
+  nativeBuildInputs = [ qmake ];
+
+  buildInputs = [
+    qtbase
+    qtimageformats
+    qtsvg
+  ];
+
+  patchPhase = ''
+    sed "s|/usr/|$out/|g" -i qView.pro
+  '';
+
+  meta = with lib; {
+    description = "Practical and minimal image viewer";
+    homepage = "https://interversehq.com/qview/";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ acowley ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/rapcad/default.nix b/nixpkgs/pkgs/applications/graphics/rapcad/default.nix
new file mode 100644
index 000000000000..904c9f8f4025
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/rapcad/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub, fetchurl, cgal, boost, gmp, mpfr, flex, bison, dxflib, readline
+, qtbase, qmake, libGLU
+}:
+
+stdenv.mkDerivation rec {
+  version = "0.9.8";
+  pname = "rapcad";
+
+  src = fetchFromGitHub {
+    owner = "gilesbathgate";
+    repo = "rapcad";
+    rev = "v${version}";
+    sha256 = "0a0sqf6h227zalh0jrz6jpm8iwji7q3i31plqk76i4qm9vsgrhir";
+  };
+
+  patches = [
+    (fetchurl {
+      url = "https://github.com/GilesBathgate/RapCAD/commit/278a8d6c7b8fe08f867002528bbab4a6319a7bb6.patch";
+      sha256 = "1vvkyf0wg79zdzs5zlggfrr1lrp1x75dglzl0mspnycwldsdwznj";
+      name = "disable-QVector-qHash.patch";
+    })
+  ];
+
+  nativeBuildInputs = [ qmake ];
+  buildInputs = [ qtbase cgal boost gmp mpfr flex bison dxflib readline libGLU ];
+
+  meta = with lib; {
+    license = licenses.gpl3;
+    maintainers = [ maintainers.raskin ];
+    platforms = platforms.linux;
+    description = "Constructive solid geometry package";
+    broken = true; # 2018-04-11
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/rapid-photo-downloader/default.nix b/nixpkgs/pkgs/applications/graphics/rapid-photo-downloader/default.nix
new file mode 100644
index 000000000000..f9120ca0ee48
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/rapid-photo-downloader/default.nix
@@ -0,0 +1,88 @@
+{ lib, mkDerivationWith, fetchurl, python3Packages
+, file, intltool, gobject-introspection, libgudev
+, udisks, gexiv2, gst_all_1, libnotify
+, exiftool, gdk-pixbuf, libmediainfo, vmtouch
+}:
+
+mkDerivationWith python3Packages.buildPythonApplication rec {
+  pname = "rapid-photo-downloader";
+  version = "0.9.18";
+
+  src = fetchurl {
+    url = "https://launchpad.net/rapid/pyqt/${version}/+download/${pname}-${version}.tar.gz";
+    sha256 = "15p7sssg6vmqbm5xnc4j5dr89d7gl7y5qyq44a240yl5aqkjnybw";
+  };
+
+  # Disable version check and fix install tests
+  postPatch = ''
+    substituteInPlace raphodo/constants.py \
+      --replace "disable_version_check = False" "disable_version_check = True"
+    substituteInPlace raphodo/rescan.py \
+      --replace "from preferences" "from raphodo.preferences"
+  '';
+
+  nativeBuildInputs = [
+    file
+    intltool
+  ];
+
+  # Package has no generally usable unit tests.
+  # The included doctests expect specific, hardcoded hardware to be present.
+  doCheck = false;
+
+  # NOTE: Without gobject-introspection in buildInputs, launching fails with
+  #       "Namespace [Notify / GExiv2 / GUdev] not available"
+  buildInputs = [
+    gdk-pixbuf
+    gexiv2
+    gobject-introspection
+    gst_all_1.gst-libav
+    gst_all_1.gst-plugins-base
+    gst_all_1.gst-plugins-good
+    gst_all_1.gstreamer
+    gst_all_1.gstreamer.dev
+    libgudev
+    libnotify
+    udisks
+  ];
+
+  propagatedBuildInputs = with python3Packages; [
+    pyqt5
+    pygobject3
+    gphoto2
+    pyzmq
+    tornado
+    psutil
+    pyxdg
+    arrow
+    python-dateutil
+    easygui
+    colour
+    pymediainfo
+    sortedcontainers
+    rawkit
+    requests
+    colorlog
+    pyprind
+    tenacity
+  ];
+
+  preFixup = ''
+    makeWrapperArgs+=(
+      --set GI_TYPELIB_PATH "$GI_TYPELIB_PATH"
+      --set PYTHONPATH "$PYTHONPATH"
+      --prefix PATH : "${lib.makeBinPath [ exiftool vmtouch ]}"
+      --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libmediainfo ]}"
+      --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0"
+      "''${qtWrapperArgs[@]}"
+    )
+  '';
+
+  meta = with lib; {
+    description = "Photo and video importer for cameras, phones, and memory cards";
+    homepage = "https://www.damonlynch.net/rapid/";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ jfrankenau ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/rawtherapee/default.nix b/nixpkgs/pkgs/applications/graphics/rawtherapee/default.nix
new file mode 100644
index 000000000000..7d1acc1dcd69
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/rawtherapee/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, cmake, pixman, libpthreadstubs, gtkmm3, libXau
+, libXdmcp, lcms2, libiptcdata, libcanberra-gtk3, fftw, expat, pcre, libsigcxx, wrapGAppsHook
+, lensfun, librsvg
+}:
+
+stdenv.mkDerivation rec {
+  version = "5.8";
+  pname = "rawtherapee";
+
+  src = fetchFromGitHub {
+    owner = "Beep6581";
+    repo = "RawTherapee";
+    rev = version;
+    sha256 = "0d644s4grfia6f3k6y0byd5pwajr12kai2kc280yxi8v3w1b12ik";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config wrapGAppsHook ];
+
+  buildInputs = [
+    pixman libpthreadstubs gtkmm3 libXau libXdmcp
+    lcms2 libiptcdata libcanberra-gtk3 fftw expat pcre libsigcxx lensfun librsvg
+  ];
+
+  cmakeFlags = [
+    "-DPROC_TARGET_NUMBER=2"
+    "-DCACHE_NAME_SUFFIX=\"\""
+  ];
+
+  CMAKE_CXX_FLAGS = "-std=c++11 -Wno-deprecated-declarations -Wno-unused-result";
+
+  postUnpack = ''
+    echo "set(HG_VERSION $version)" > $sourceRoot/ReleaseInfo.cmake
+  '';
+
+  meta = {
+    description = "RAW converter and digital photo processing software";
+    homepage = "http://www.rawtherapee.com/";
+    license = lib.licenses.gpl3Plus;
+    maintainers = with lib.maintainers; [ jcumming mahe ];
+    platforms = with lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/renderdoc/default.nix b/nixpkgs/pkgs/applications/graphics/renderdoc/default.nix
new file mode 100644
index 000000000000..0faed5e12ea5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/renderdoc/default.nix
@@ -0,0 +1,80 @@
+{ lib, fetchFromGitHub, cmake, pkg-config, mkDerivation
+, qtbase, qtx11extras, qtsvg, makeWrapper
+, vulkan-loader, libglvnd, xorg, python3, python3Packages
+, bison, pcre, automake, autoconf, addOpenGLRunpath
+, waylandSupport ? false, wayland
+}:
+let
+  custom_swig = fetchFromGitHub {
+    owner = "baldurk";
+    repo = "swig";
+    rev = "renderdoc-modified-7";
+    sha256 = "15r2m5kcs0id64pa2fsw58qll3jyh71jzc04wy20pgsh2326zis6";
+  };
+  cmakeBool = b: if b then "ON" else "OFF";
+in
+mkDerivation rec {
+  pname = "renderdoc";
+  version = "1.16";
+
+  src = fetchFromGitHub {
+    owner = "baldurk";
+    repo = "renderdoc";
+    rev = "v${version}";
+    sha256 = "150d1qzjs420clqr48gickiw5ymjx4md6iyjbxmxsdml0pyxpwwn";
+  };
+
+  buildInputs = [
+    qtbase qtsvg xorg.libpthreadstubs xorg.libXdmcp qtx11extras vulkan-loader python3
+  ] # ++ (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 ];
+
+  postUnpack = ''
+    cp -r ${custom_swig} swig
+    chmod -R +w swig
+    patchShebangs swig/autogen.sh
+  '';
+
+  cmakeFlags = [
+    "-DBUILD_VERSION_HASH=${src.rev}"
+    "-DBUILD_VERSION_DIST_NAME=NixOS"
+    "-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
+  preConfigure = ''
+    cmakeFlags+=" -DVULKAN_LAYER_FOLDER=$out/share/vulkan/implicit_layer.d/"
+    cmakeFlags+=" -DRENDERDOC_SWIG_PACKAGE=$PWD/../swig"
+  '';
+
+  dontWrapQtApps = true;
+  preFixup = ''
+    wrapQtApp $out/bin/qrenderdoc --suffix LD_LIBRARY_PATH : "$out/lib:${vulkan-loader}/lib:${libglvnd}/lib"
+    wrapProgram $out/bin/renderdoccmd --suffix LD_LIBRARY_PATH : "$out/lib:${vulkan-loader}/lib:${libglvnd}/lib"
+  '';
+
+  # The only documentation for this so far is in pkgs/build-support/add-opengl-runpath/setup-hook.sh
+  postFixup = ''
+    addOpenGLRunpath $out/lib/librenderdoc.so
+  '';
+
+  meta = with lib; {
+    description = "A single-frame graphics debugger";
+    homepage = "https://renderdoc.org/";
+    license = licenses.mit;
+    longDescription = ''
+      RenderDoc is a free MIT licensed stand-alone graphics debugger that
+      allows quick and easy single-frame capture and detailed introspection
+      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" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/round/default.nix b/nixpkgs/pkgs/applications/graphics/round/default.nix
new file mode 100644
index 000000000000..a34a52c4eeeb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/round/default.nix
@@ -0,0 +1,27 @@
+{ lib
+, buildGoModule
+, fetchFromGitHub
+}:
+
+buildGoModule rec {
+  pname = "round";
+  version = "0.0.2";
+
+  src = fetchFromGitHub {
+    owner = "mingrammer";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "09brjr3h4qnhlidxlki1by5anahxy16ai078zm4k7ryl579amzdw";
+  };
+
+  vendorSha256 = null;
+
+  subPackages = [ "." ];
+
+  meta = with lib; {
+    description = "Round image corners from CLI";
+    homepage    = "https://github.com/mingrammer/round";
+    license     = licenses.mit;
+    maintainers =  with maintainers; [ addict3d ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/rx/default.nix b/nixpkgs/pkgs/applications/graphics/rx/default.nix
new file mode 100644
index 000000000000..fe3d10bae635
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/rx/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, rustPlatform, fetchFromGitHub, makeWrapper
+, cmake, pkg-config
+, xorg ? null
+, libGL ? null }:
+
+with lib;
+
+rustPlatform.buildRustPackage rec {
+  pname = "rx";
+  version = "0.5.2";
+
+  src = fetchFromGitHub {
+    owner = "cloudhead";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-LTpaV/fgYUgA2M6Wz5qLHnTNywh13900g+umhgLvciM=";
+  };
+
+  cargoSha256 = "sha256-4hi1U4jl6QA7H8AKHlU+Hqz5iKGYHRXHDsrcqY7imkU=";
+
+  nativeBuildInputs = [ cmake pkg-config makeWrapper ];
+
+  buildInputs = optionals stdenv.isLinux
+  (with xorg; [
+    # glfw-sys dependencies:
+    libX11 libXrandr libXinerama libXcursor libXi libXext
+  ]);
+
+  # FIXME: GLFW (X11) requires DISPLAY env variable for all tests
+  doCheck = false;
+
+  postInstall = optionalString stdenv.isLinux ''
+    mkdir -p $out/share/applications
+    cp $src/rx.desktop $out/share/applications
+    wrapProgram $out/bin/rx --prefix LD_LIBRARY_PATH : ${libGL}/lib
+  '';
+
+  meta = {
+    description = "Modern and extensible pixel editor implemented in Rust";
+    homepage = "https://rx.cloudhead.io/";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ minijackson Br1ght0ne ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/sane/backends/airscan/default.nix b/nixpkgs/pkgs/applications/graphics/sane/backends/airscan/default.nix
new file mode 100644
index 000000000000..8d0e32e2b4e1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/sane/backends/airscan/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, meson, ninja, pkg-config, avahi, libjpeg, libpng
+, libxml2, gnutls, sane-backends }:
+stdenv.mkDerivation rec {
+  pname = "sane-airscan";
+  version = "0.99.26";
+
+  nativeBuildInputs = [ meson ninja pkg-config ];
+  buildInputs = [ avahi gnutls libjpeg libpng libxml2 sane-backends ];
+
+  src = fetchFromGitHub {
+    owner = "alexpevzner";
+    repo = pname;
+    rev = version;
+    sha256 = "08snfg5zx9924ryww0kxf1kgl085yw7fg6l4f1kzlhcmqf1958w5";
+  };
+
+  meta = with lib; {
+    homepage = "https://github.com/alexpevzner/sane-airscan";
+    description = "Scanner Access Now Easy - Apple AirScan (eSCL) driver";
+    longDescription = ''
+      sane-airscan: Linux support of Apple AirScan (eSCL) compatible document scanners.
+    '';
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ zaninime ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/sane/backends/brscan4/default.nix b/nixpkgs/pkgs/applications/graphics/sane/backends/brscan4/default.nix
new file mode 100644
index 000000000000..6fcb58305565
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/sane/backends/brscan4/default.nix
@@ -0,0 +1,95 @@
+{ stdenv, lib, fetchurl, callPackage, patchelf, makeWrapper, coreutils, libusb-compat-0_1 }:
+let
+  myPatchElf = file: with lib; ''
+    patchelf --set-interpreter \
+      ${stdenv.glibc}/lib/ld-linux${optionalString stdenv.is64bit "-x86-64"}.so.2 \
+      ${file}
+  '';
+
+  udevRules = callPackage ./udev_rules_type1.nix { };
+
+in
+stdenv.mkDerivation rec {
+  pname = "brscan4";
+  version = "0.4.10-1";
+  src = {
+    "i686-linux" = fetchurl {
+      url = "http://download.brother.com/welcome/dlf006646/${pname}-${version}.i386.deb";
+      sha256 = "sha256-ymIAg+rfSYP5uzsAM1hUYZacJ0PXmKEoljNtb0pgGMw=";
+    };
+    "x86_64-linux" = fetchurl {
+      url = "https://download.brother.com/welcome/dlf006645/${pname}-${version}.amd64.deb";
+      sha256 = "sha256-Gpr5456MCNpyam3g2qPo7S3aEZFMaUGR8bu7YmRY8xk=";
+    };
+  }."${stdenv.hostPlatform.system}";
+
+  unpackPhase = ''
+    ar x $src
+    tar xfvz data.tar.gz
+  '';
+
+  nativeBuildInputs = [ makeWrapper patchelf coreutils udevRules ];
+  buildInputs = [ libusb-compat-0_1 ];
+  dontBuild = true;
+
+  postPatch = ''
+    ${myPatchElf "opt/brother/scanner/brscan4/brsaneconfig4"}
+
+    RPATH=${libusb-compat-0_1.out}/lib
+    for a in usr/lib64/sane/*.so*; do
+      if ! test -L $a; then
+        patchelf --set-rpath $RPATH $a
+      fi
+    done
+  '';
+
+  installPhase = with lib; ''
+    runHook preInstall
+    PATH_TO_BRSCAN4="opt/brother/scanner/brscan4"
+    mkdir -p $out/$PATH_TO_BRSCAN4
+    cp -rp $PATH_TO_BRSCAN4/* $out/$PATH_TO_BRSCAN4
+    mkdir -p $out/lib/sane
+    cp -rp usr/lib${optionalString stdenv.is64bit "64"}/sane/* $out/lib/sane
+
+    # Symbolic links were absolute. Fix them so that they point to $out.
+    pushd "$out/lib/sane" > /dev/null
+    for a in *.so*; do
+      if test -L $a; then
+        fixedTargetFileName="$(basename $(readlink $a))"
+        unlink "$a"
+        ln -s -T "$fixedTargetFileName" "$a"
+      fi
+    done
+    popd > /dev/null
+
+    # Generate an LD_PRELOAD wrapper to redirect execvp(), open() and open64()
+    # calls to `/opt/brother/scanner/brscan4`.
+    preload=$out/libexec/brother/scanner/brscan4/libpreload.so
+    mkdir -p $(dirname $preload)
+    gcc -shared ${./preload.c} -o $preload -ldl -DOUT=\"$out\" -fPIC
+
+    makeWrapper \
+      "$out/$PATH_TO_BRSCAN4/brsaneconfig4" \
+      "$out/bin/brsaneconfig4" \
+      --set LD_PRELOAD $preload
+
+    mkdir -p $out/etc/sane.d
+    echo "brother4" > $out/etc/sane.d/dll.conf
+
+    mkdir -p $out/etc/udev/rules.d
+    cp -p ${udevRules}/etc/udev/rules.d/*.rules \
+      $out/etc/udev/rules.d
+    runHook postInstall
+  '';
+
+  dontStrip = true;
+  dontPatchELF = true;
+
+  meta = {
+    description = "Brother brscan4 sane backend driver";
+    homepage = "http://www.brother.com";
+    platforms = [ "i686-linux" "x86_64-linux" ];
+    license = lib.licenses.unfree;
+    maintainers = with lib.maintainers; [ jraygauthier ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/sane/backends/brscan4/preload.c b/nixpkgs/pkgs/applications/graphics/sane/backends/brscan4/preload.c
new file mode 100644
index 000000000000..016162770934
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/sane/backends/brscan4/preload.c
@@ -0,0 +1,170 @@
+/* Brgen4 search for configuration under `/etc/opt/brother/scanner/brscan4`. This
+   LD_PRELOAD library intercepts execvp(), open and open64 calls to redirect them to
+   the corresponding location in $out. Also support specifying an alternate
+   file name for `brsanenetdevice4.cfg` which otherwise is invariable
+   created at `/etc/opt/brother/scanner/brscan4`*/
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <dlfcn.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <string.h>
+#include <dirent.h>
+
+char origDir [] = "/etc/opt/brother/scanner/brscan4";
+char realDir [] = OUT "/opt/brother/scanner/brscan4";
+
+char devCfgFileNameEnvVar [] = "BRSANENETDEVICE4_CFG_FILENAME";
+char devCfgFileName [] = "/etc/opt/brother/scanner/brscan4//brsanenetdevice4.cfg";
+
+const char * rewrite(const char * path, char * buf)
+{
+    if (strncmp(path, devCfgFileName, sizeof(devCfgFileName)) == 0) {
+
+      const char* newCfgFileName = getenv(devCfgFileNameEnvVar);
+      if (!newCfgFileName) return path;
+
+      if (snprintf(buf, PATH_MAX, "%s", newCfgFileName) >= PATH_MAX)
+          abort();
+      return buf;
+    }
+
+    if (strncmp(path, origDir, sizeof(origDir) - 1) != 0) return path;
+    if (snprintf(buf, PATH_MAX, "%s%s", realDir, path + sizeof(origDir) - 1) >= PATH_MAX)
+        abort();
+    return buf;
+}
+
+const char* findAndReplaceFirstOccurence(const char* inStr, const char* subStr, 
+                                         const char* replaceStr, 
+                                         char* buf, unsigned maxBuf)
+{
+    const char* foundStr = strstr(inStr, subStr);
+    if (!foundStr)
+      return inStr;
+
+    const unsigned inStrLen = strlen(inStr);
+    const unsigned subStrLen = strlen(subStr);
+    const unsigned replaceStrLen = strlen(replaceStr);
+
+    const unsigned precedingStrLen = foundStr - inStr;
+    if (precedingStrLen + 1 > maxBuf)
+      return NULL;
+
+    const unsigned followingStrPos = precedingStrLen + subStrLen;
+    const unsigned followingStrLen = inStrLen - followingStrPos;
+
+    strncpy(buf, inStr, precedingStrLen);
+    unsigned outLength = precedingStrLen;
+
+    if (outLength + replaceStrLen + 1 > maxBuf)
+      return NULL;
+
+    strncpy(buf + outLength, replaceStr, replaceStrLen);
+    outLength += replaceStrLen;
+    
+    if (outLength + followingStrLen + 1 > maxBuf)
+      return NULL;
+
+    strncpy(buf + outLength, inStr + followingStrPos, followingStrLen);
+    outLength += followingStrLen;
+    
+    buf[outLength] = '\0';
+
+    return buf;
+}
+
+const char* rewriteSystemCall(const char* command, char* buf, unsigned maxBuf)
+{
+
+    const char* foundStr = strstr(command, devCfgFileName);
+    if (!foundStr)
+      return command;
+
+    const char* replaceStr = getenv(devCfgFileNameEnvVar);
+    if (!replaceStr) return command;
+
+    const char* result = 
+      findAndReplaceFirstOccurence(command, devCfgFileName, replaceStr, buf, maxBuf);
+
+    if (!result)
+      abort();
+
+    return result;
+}
+
+int execvp(const char * path, char * const argv[])
+{
+    int (*_execvp) (const char *, char * const argv[]) = dlsym(RTLD_NEXT, "execvp");
+    char buf[PATH_MAX];
+    return _execvp(rewrite(path, buf), argv);
+}
+
+
+int open(const char *path, int flags, ...)
+{
+    char buf[PATH_MAX];
+    int (*_open) (const char *, int, mode_t) = dlsym(RTLD_NEXT, "open");
+    mode_t mode = 0;
+    if (flags & O_CREAT) {
+        va_list ap;
+        va_start(ap, flags);
+        mode = va_arg(ap, mode_t);
+        va_end(ap);
+    }
+    return _open(rewrite(path, buf), flags, mode);
+}
+
+int open64(const char *path, int flags, ...)
+{
+    char buf[PATH_MAX];
+    int (*_open64) (const char *, int, mode_t) = dlsym(RTLD_NEXT, "open64");
+    mode_t mode = 0;
+    if (flags & O_CREAT) {
+        va_list ap;
+        va_start(ap, flags);
+        mode = va_arg(ap, mode_t);
+        va_end(ap);
+    }
+    return _open64(rewrite(path, buf), flags, mode);
+}
+
+FILE* fopen(const char* path, const char* mode)
+{
+  char buf[PATH_MAX];
+	FILE* (*_fopen) (const char*, const char*) = dlsym(RTLD_NEXT, "fopen");
+
+	return _fopen(rewrite(path, buf), mode);
+}
+
+FILE *fopen64(const char *path, const char *mode)
+{
+  char buf[PATH_MAX];
+	FILE* (*_fopen64) (const char*, const char*) = dlsym(RTLD_NEXT, "fopen64");
+
+	return _fopen64(rewrite(path, buf), mode);
+}
+
+DIR* opendir(const char* path)
+{
+  char buf[PATH_MAX];
+	DIR* (*_opendir) (const char*) = dlsym(RTLD_NEXT, "opendir");
+
+	return _opendir(rewrite(path, buf));
+}
+
+#define SYSTEM_CMD_MAX 512
+
+int system(const char *command)
+{
+    char buf[SYSTEM_CMD_MAX];
+    int (*_system) (const char*) = dlsym(RTLD_NEXT, "system");
+
+    const char* newCommand = rewriteSystemCall(command, buf, SYSTEM_CMD_MAX);
+    return _system(newCommand);
+}
diff --git a/nixpkgs/pkgs/applications/graphics/sane/backends/brscan4/udev_rules_type1.nix b/nixpkgs/pkgs/applications/graphics/sane/backends/brscan4/udev_rules_type1.nix
new file mode 100644
index 000000000000..9ca0a7020609
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/sane/backends/brscan4/udev_rules_type1.nix
@@ -0,0 +1,55 @@
+{ lib, stdenv, fetchurl, libsaneUDevRuleNumber ? "49"}:
+
+stdenv.mkDerivation rec {
+  name = "brother-udev-rule-type1-1.0.0-1";
+
+  src = fetchurl {
+    url = "http://download.brother.com/welcome/dlf006654/${name}.all.deb";
+    sha256 = "0i0x5jw135pli4jl9mgnr5n2rrdvml57nw84yq2999r4frza53xi";
+  };
+
+  dontBuild = true;
+
+  unpackPhase = ''
+    ar x $src
+    tar xfvz data.tar.gz
+  '';
+
+  /*
+    Fix the following error:
+
+    ~~~
+    invalid rule 49-brother-libsane-type1.rules
+    unknown key 'SYSFS{idVendor}'
+    ~~~
+
+    Apparently the udev rules syntax has change and the SYSFS key has to
+    be changed to ATTR.
+
+    See:
+
+     -  <http://ubuntuforums.org/showthread.php?t=1496878>
+     -  <http://www.planet-libre.org/index.php?post_id=10937>
+  */
+  patchPhase = ''
+    sed -i -e s/SYSFS/ATTR/g opt/brother/scanner/udev-rules/type1/*.rules
+  '';
+
+  installPhase = ''
+    mkdir -p $out/etc/udev/rules.d
+    cp opt/brother/scanner/udev-rules/type1/NN-brother-mfp-type1.rules \
+      $out/etc/udev/rules.d/${libsaneUDevRuleNumber}-brother-libsane-type1.rules
+    chmod 644 $out/etc/udev/rules.d/${libsaneUDevRuleNumber}-brother-libsane-type1.rules
+  '';
+
+  dontStrip = true;
+  dontPatchELF = true;
+
+  meta = {
+    description = "Brother type1 scanners udev rules";
+    homepage = "http://www.brother.com";
+    platforms = lib.platforms.linux;
+    license = lib.licenses.unfree;
+    maintainers = with lib.maintainers; [ jraygauthier ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/sane/backends/brscan5/default.nix b/nixpkgs/pkgs/applications/graphics/sane/backends/brscan5/default.nix
new file mode 100644
index 000000000000..e42c0980a1bc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/sane/backends/brscan5/default.nix
@@ -0,0 +1,98 @@
+{ stdenv, lib, fetchurl, callPackage, patchelf, makeWrapper, coreutils, libusb1, avahi-compat, glib, libredirect }:
+let
+  myPatchElf = file: with lib; ''
+    patchelf --set-interpreter \
+      ${stdenv.glibc}/lib/ld-linux${optionalString stdenv.is64bit "-x86-64"}.so.2 \
+      ${file}
+  '';
+
+in
+stdenv.mkDerivation rec {
+  pname = "brscan5";
+  version = "1.2.6-0";
+  src = {
+    "i686-linux" = fetchurl {
+      url = "https://download.brother.com/welcome/dlf104034/${pname}-${version}.i386.deb";
+      sha256 = "102q745pc0168syggd4gym51qf3m3iqld3a4skfnbkm6yky4w4s8";
+    };
+    "x86_64-linux" = fetchurl {
+      url = "https://download.brother.com/welcome/dlf104033/${pname}-${version}.amd64.deb";
+      sha256 = "1pwbzhpg5nzpw2rw936vf2cr334v8iny16y8fbb1zimgzmv427wx";
+    };
+  }."${stdenv.hostPlatform.system}";
+
+  unpackPhase = ''
+    ar x $src
+    tar xfv data.tar.xz
+  '';
+
+  nativeBuildInputs = [ makeWrapper patchelf coreutils ];
+  buildInputs = [ libusb1 avahi-compat stdenv.cc.cc glib ];
+  dontBuild = true;
+
+  postPatch = ''
+    ${myPatchElf "opt/brother/scanner/brscan5/brsaneconfig5"}
+    ${myPatchElf "opt/brother/scanner/brscan5/brscan_cnetconfig"}
+    ${myPatchElf "opt/brother/scanner/brscan5/brscan_gnetconfig"}
+
+    for a in opt/brother/scanner/brscan5/*.so.* opt/brother/scanner/brscan5/brscan_[cg]netconfig; do
+      if ! test -L $a; then
+        patchelf --set-rpath ${lib.makeLibraryPath buildInputs} $a
+      fi
+    done
+
+    # driver is hardcoded to look in /opt/brother/scanner/brscan5/models for model metadata.
+    # patch it to look in /etc/opt/brother/scanner/models instead, so nixos environment.etc can make it available
+    printf '/etc/opt/brother/scanner/models\x00' | dd of=opt/brother/scanner/brscan5/libsane-brother5.so.1.0.7 bs=1 seek=84632 conv=notrunc
+  '';
+
+  installPhase = with lib; ''
+    runHook preInstall
+    PATH_TO_BRSCAN5="opt/brother/scanner/brscan5"
+    mkdir -p $out/$PATH_TO_BRSCAN5
+    cp -rp $PATH_TO_BRSCAN5/* $out/$PATH_TO_BRSCAN5
+
+
+    pushd $out/$PATH_TO_BRSCAN5
+      ln -s libLxBsDeviceAccs.so.1.0.0 libLxBsDeviceAccs.so.1
+      ln -s libLxBsNetDevAccs.so.1.0.0 libLxBsNetDevAccs.so.1
+      ln -s libLxBsScanCoreApi.so.3.0.0 libLxBsScanCoreApi.so.3
+      ln -s libLxBsUsbDevAccs.so.1.0.0 libLxBsUsbDevAccs.so.1
+      ln -s libsane-brother5.so.1.0.7 libsane-brother5.so.1
+    popd
+
+    mkdir -p $out/lib/sane
+    for file in $out/$PATH_TO_BRSCAN5/*.so.* ; do
+      ln -s $file $out/lib/sane/
+    done
+
+    makeWrapper \
+      "$out/$PATH_TO_BRSCAN5/brsaneconfig5" \
+      "$out/bin/brsaneconfig5" \
+      --suffix-each NIX_REDIRECT ":" "/etc/opt/brother/scanner/brscan5=$out/opt/brother/scanner/brscan5 /opt/brother/scanner/brscan5=$out/opt/brother/scanner/brscan5" \
+      --set LD_PRELOAD ${libredirect}/lib/libredirect.so
+
+    mkdir -p $out/etc/sane.d/dll.d
+    echo "brother5" > $out/etc/sane.d/dll.d/brother5.conf
+
+    mkdir -p $out/etc/udev/rules.d
+    cp -p $PATH_TO_BRSCAN5/udev-rules/NN-brother-mfp-brscan5-1.0.2-2.rules \
+      $out/etc/udev/rules.d/49-brother-mfp-brscan5-1.0.2-2.rules
+
+    ETCDIR=$out/etc/opt/brother/scanner/brscan5
+    mkdir -p $ETCDIR
+    cp -rp $PATH_TO_BRSCAN5/{models,brscan5.ini,brsanenetdevice.cfg} $ETCDIR/
+
+    runHook postInstall
+  '';
+
+  dontPatchELF = true;
+
+  meta = {
+    description = "Brother brscan5 sane backend driver";
+    homepage = "https://www.brother.com";
+    platforms = [ "i686-linux" "x86_64-linux" ];
+    license = lib.licenses.unfree;
+    maintainers = with lib.maintainers; [ mattchrist ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/sane/backends/default.nix b/nixpkgs/pkgs/applications/graphics/sane/backends/default.nix
new file mode 100644
index 000000000000..93a7d75ce45a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/sane/backends/default.nix
@@ -0,0 +1,118 @@
+{ stdenv, lib, fetchurl, runtimeShell
+, gettext, pkg-config, python3
+, avahi, libgphoto2, libieee1284, libjpeg, libpng, libtiff, libusb1, libv4l, net-snmp
+, curl, systemd, libxml2, poppler, gawk
+, 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 {
+  pname = "sane-backends";
+  version = "1.0.32";
+
+  src = fetchurl {
+    # raw checkouts of the repo do not work because, the configure script is
+    # only functional in manually uploaded release tarballs.
+    # https://gitlab.com/sane-project/backends/-/issues/440
+    # unfortunately this make the url unpredictable on update, to find the link
+    # go to https://gitlab.com/sane-project/backends/-/releases and choose
+    # the link with other in the URL.
+    url = "https://gitlab.com/sane-project/backends/uploads/104f09c07d35519cc8e72e604f11643f/sane-backends-1.0.32.tar.gz";
+    sha256 = "055iicihxa6b28iv5fnz13n67frdr5nrydq2c846f9x7q0vw4a1s";
+  };
+
+  outputs = [ "out" "doc" "man" ];
+
+  nativeBuildInputs = [
+    gettext
+    pkg-config
+    python3
+  ];
+
+  buildInputs = [
+    avahi
+    libgphoto2
+    libieee1284
+    libjpeg
+    libpng
+    libtiff
+    libusb1
+    libv4l
+    net-snmp
+    curl
+    systemd
+    libxml2
+    poppler
+    gawk
+  ];
+
+  enableParallelBuilding = true;
+
+  configureFlags =
+    lib.optional (avahi != null)   "--with-avahi"
+    ++ lib.optional (libusb1 != null) "--with-usb"
+  ;
+
+  postInstall = let
+
+    compatFirmware = extraFirmware
+      ++ lib.optional (gt68xxFirmware != null) {
+        src = gt68xxFirmware.fw;
+        inherit (gt68xxFirmware) name;
+        backend = "gt68xx";
+      }
+      ++ lib.optional (snapscanFirmware != null) {
+        src = snapscanFirmware;
+        name = "your-firmwarefile.bin";
+        backend = "snapscan";
+      };
+
+    installFirmware = f: ''
+      mkdir -p $out/share/sane/${f.backend}
+      ln -sv ${f.src} $out/share/sane/${f.backend}/${f.name}
+    '';
+
+  in ''
+    mkdir -p $out/etc/udev/rules.d/
+    ./tools/sane-desc -m udev > $out/etc/udev/rules.d/49-libsane.rules || \
+    cp tools/udev/libsane.rules $out/etc/udev/rules.d/49-libsane.rules
+    # the created 49-libsane references /bin/sh
+    substituteInPlace $out/etc/udev/rules.d/49-libsane.rules \
+      --replace "RUN+=\"/bin/sh" "RUN+=\"${runtimeShell}"
+
+    substituteInPlace $out/lib/libsane.la \
+      --replace "-ljpeg" "-L${lib.getLib libjpeg}/lib -ljpeg"
+
+    # net.conf conflicts with the file generated by the nixos module
+    rm $out/etc/sane.d/net.conf
+
+  ''
+  + 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";
+    longDescription = ''
+      Collection of open-source SANE backends (device drivers).
+      SANE is a universal scanner interface providing standardized access to
+      any raster image scanner hardware: flatbed scanners, hand-held scanners,
+      video- and still-cameras, frame-grabbers, etc. For a list of supported
+      scanners, see http://www.sane-project.org/sane-backends.html.
+    '';
+    homepage = "http://www.sane-project.org/";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/sane/backends/dsseries/default.nix b/nixpkgs/pkgs/applications/graphics/sane/backends/dsseries/default.nix
new file mode 100644
index 000000000000..8a01f70c6b00
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/sane/backends/dsseries/default.nix
@@ -0,0 +1,53 @@
+{ lib, stdenv, fetchurl, rpmextract }:
+
+stdenv.mkDerivation rec {
+  pname = "libsane-dsseries";
+  version = "1.0.5-1";
+
+  src = fetchurl {
+    url = "https://download.brother.com/welcome/dlf100974/${pname}-${version}.x86_64.rpm";
+    sha256 = "1wfdbfbf51cc7njzikdg48kwpnpc0pg5s6p0s0y3z0q7y59x2wbq";
+  };
+
+  nativeBuildInputs = [ rpmextract ];
+
+  unpackCmd = ''
+    mkdir ${pname}-${version} && pushd ${pname}-${version}
+    rpmextract $curSrc
+    popd
+  '';
+
+  patchPhase = ''
+    substituteInPlace etc/udev/rules.d/50-Brother_DSScanner.rules \
+      --replace 'GROUP="users"' 'GROUP="scanner", ENV{libsane_matched}="yes"'
+
+    mkdir -p etc/sane.d/dll.d
+    echo "dsseries" > etc/sane.d/dll.d/dsseries.conf
+  '';
+
+  installPhase = ''
+    mkdir -p $out
+    cp -dr etc $out
+    cp -dr usr/lib64 $out/lib
+  '';
+
+  preFixup = ''
+    for f in `find $out/lib/sane/ -type f`; do
+      # Make it possible to find libstdc++.so.6
+      patchelf --set-rpath ${stdenv.cc.cc.lib}/lib:$out/lib/sane $f
+
+      # Horrible kludge: The driver hardcodes /usr/lib/sane/ as a dlopen path.
+      # We can directly modify the binary to force a relative lookup instead.
+      # The new path is NULL-padded to the same length as the original path.
+      sed -i "s|/usr/lib/sane/%s|%s\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00|g" $f
+    done
+  '';
+
+  meta = {
+    description = "Brother DSSeries SANE backend driver";
+    homepage = "http://www.brother.com";
+    platforms = lib.platforms.linux;
+    license = lib.licenses.unfree;
+    maintainers = with lib.maintainers; [ callahad ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/sane/config.nix b/nixpkgs/pkgs/applications/graphics/sane/config.nix
new file mode 100644
index 000000000000..397e17837bcc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/sane/config.nix
@@ -0,0 +1,53 @@
+{ lib, stdenv }:
+
+{ paths, disabledDefaultBackends ? [] }:
+
+with lib;
+let
+installSanePath = path: ''
+      if [ -e "${path}/lib/sane" ]; then
+        find "${path}/lib/sane" -maxdepth 1 -not -type d | while read backend; do
+          symlink "$backend" "$out/lib/sane/$(basename "$backend")"
+        done
+      fi
+
+      if [ -e "${path}/etc/sane.d" ]; then
+        find "${path}/etc/sane.d" -maxdepth 1 -not -type d | while read conf; do
+          name="$(basename $conf)"
+          if [ "$name" = "dll.conf" ] || [ "$name" = "saned.conf" ] || [ "$name" = "net.conf" ]; then
+            cat "$conf" >> "$out/etc/sane.d/$name"
+          else
+            symlink "$conf" "$out/etc/sane.d/$name"
+          fi
+        done
+      fi
+
+      if [ -e "${path}/etc/sane.d/dll.d" ]; then
+        find "${path}/etc/sane.d/dll.d" -maxdepth 1 -not -type d | while read conf; do
+          symlink "$conf" "$out/etc/sane.d/dll.d/$(basename $conf)"
+        done
+      fi
+    '';
+    disableBackend = backend: ''
+      grep -q '${backend}' $out/etc/sane.d/dll.conf || { echo '${backend} is not a default plugin in $SANE_CONFIG_DIR/dll.conf'; exit 1; }
+      substituteInPlace $out/etc/sane.d/dll.conf --replace '${backend}' '# ${backend} disabled in nixos config'
+    '';
+in
+stdenv.mkDerivation {
+  name = "sane-config";
+  phases = "installPhase";
+
+  installPhase = ''
+    function symlink () {
+      local target=$1 linkname=$2
+      if [ -e "$linkname" ]; then
+        echo "warning: conflict for $linkname. Overriding $(readlink $linkname) with $target."
+      fi
+      ln -sfn "$target" "$linkname"
+    }
+
+    mkdir -p $out/etc/sane.d $out/etc/sane.d/dll.d $out/lib/sane
+  ''
+  + (concatMapStrings installSanePath paths)
+  + (concatMapStrings disableBackend disabledDefaultBackends);
+}
diff --git a/nixpkgs/pkgs/applications/graphics/sane/drivers.nix b/nixpkgs/pkgs/applications/graphics/sane/drivers.nix
new file mode 100644
index 000000000000..9f1a644f4fac
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/applications/graphics/sane/frontends.nix b/nixpkgs/pkgs/applications/graphics/sane/frontends.nix
new file mode 100644
index 000000000000..d34ab9856fca
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/sane/frontends.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl, sane-backends, libX11, gtk2, pkg-config, libusb-compat-0_1 ? null }:
+
+stdenv.mkDerivation rec {
+  pname = "sane-frontends";
+  version = "1.0.14";
+
+  src = fetchurl {
+    url = "https://alioth-archive.debian.org/releases/sane/${pname}/${version}/${pname}-${version}.tar.gz";
+    sha256 = "1ad4zr7rcxpda8yzvfkq1rfjgx9nl6lan5a628wvpdbh3fn9v0z7";
+  };
+
+  preConfigure = ''
+    sed -e '/SANE_CAP_ALWAYS_SETTABLE/d' -i src/gtkglue.c
+  '';
+
+  buildInputs = [ sane-backends libX11 gtk2 ]
+    ++ lib.optional (libusb-compat-0_1 != null) libusb-compat-0_1;
+  nativeBuildInputs = [ pkg-config ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Scanner Access Now Easy";
+    homepage    = "http://www.sane-project.org/";
+    license     = licenses.gpl2Plus;
+    platforms   = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/sane/xsane.nix b/nixpkgs/pkgs/applications/graphics/sane/xsane.nix
new file mode 100644
index 000000000000..e394acf2b061
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/sane/xsane.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchurl, sane-backends, sane-frontends, libX11, gtk2, pkg-config, libpng
+, libusb-compat-0_1 ? null
+, gimpSupport ? false, gimp ? null
+}:
+
+assert gimpSupport -> gimp != null;
+
+stdenv.mkDerivation rec {
+  name = "xsane-0.999";
+
+  src = fetchurl {
+    url = "http://www.xsane.org/download/${name}.tar.gz";
+    sha256 = "0jrb918sfb9jw3vmrz0z7np4q55hgsqqffpixs0ir5nwcwzd50jp";
+  };
+
+  preConfigure = ''
+    sed -e '/SANE_CAP_ALWAYS_SETTABLE/d' -i src/xsane-back-gtk.c
+    chmod a+rX -R .
+  '';
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [libpng sane-backends sane-frontends libX11 gtk2 ]
+    ++ (if libusb-compat-0_1 != null then [libusb-compat-0_1] else [])
+    ++ lib.optional gimpSupport gimp;
+
+  meta = {
+    homepage = "http://www.sane-project.org/";
+    description = "Graphical scanning frontend for sane";
+    license = lib.licenses.gpl2Plus;
+    platforms = with lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/scantailor/advanced.nix b/nixpkgs/pkgs/applications/graphics/scantailor/advanced.nix
new file mode 100644
index 000000000000..048b8b56fc08
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/scantailor/advanced.nix
@@ -0,0 +1,26 @@
+{ lib, fetchFromGitHub, mkDerivation
+, cmake, libjpeg, libpng, libtiff, boost
+, qtbase, qttools }:
+
+mkDerivation rec {
+  pname = "scantailor-advanced";
+  version = "1.0.16";
+
+  src = fetchFromGitHub {
+    owner = "4lex4";
+    repo = "scantailor-advanced";
+    rev = "v${version}";
+    sha256 = "0lc9lzbpiy5hgimyhl4s4q67pb9gacpy985gl6iy8pl79zxhmcyp";
+  };
+
+  nativeBuildInputs = [ cmake qttools ];
+  buildInputs = [ libjpeg libpng libtiff boost qtbase ];
+
+  meta = with lib; {
+    homepage = "https://github.com/4lex4/scantailor-advanced";
+    description = "Interactive post-processing tool for scanned pages";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ jfrankenau ];
+    platforms = with platforms; gnu ++ linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/scantailor/default.nix b/nixpkgs/pkgs/applications/graphics/scantailor/default.nix
new file mode 100644
index 000000000000..898cc3336a55
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/scantailor/default.nix
@@ -0,0 +1,23 @@
+{lib, stdenv, fetchurl, qt4, cmake, libjpeg, libtiff, boost }:
+
+stdenv.mkDerivation {
+  name = "scantailor-0.9.12.1";
+
+  src = fetchurl {
+    url = "https://github.com/scantailor/scantailor/archive/RELEASE_0_9_12_1.tar.gz";
+    sha256 = "1pjx3a6hs16az6rki59bchy3biy7jndjx8r125q01aq7lbf5npgg";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ qt4 libjpeg libtiff boost ];
+
+  meta = {
+    homepage = "https://scantailor.org/";
+    description = "Interactive post-processing tool for scanned pages";
+
+    license = lib.licenses.gpl3Plus;
+
+    maintainers = [ lib.maintainers.viric ];
+    platforms = lib.platforms.gnu ++ lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/screencloud/default.nix b/nixpkgs/pkgs/applications/graphics/screencloud/default.nix
new file mode 100644
index 000000000000..b7d6ecdef3d7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/screencloud/default.nix
@@ -0,0 +1,76 @@
+{ lib, stdenv, fetchFromGitHub, cmake, qt4, quazip, qt-mobility, qxt, pythonPackages }:
+
+with lib;
+stdenv.mkDerivation rec {
+  pname = "screencloud";
+  version = "1.2.0";
+
+  # API Keys. According to the author of the AUR package, these are only used
+  # for tracking usage.
+  consumerKey = "23e747012c68601f27ab69c6de129ed70552d55b6";
+  consumerSecret = "4701cb00c1bd357bbcae7c3d713dd216";
+
+  src = fetchFromGitHub {
+    owner = "olav-st";
+    repo = "screencloud";
+    rev = "v${version}";
+    sha256 = "1s0dxa1sa37nvna5nfqdsp294810favj68qb7ghl78qna7zw0cim";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ qt4 quazip qt-mobility qxt pythonPackages.python pythonPackages.pycrypto ];
+
+  patchPhase = ''
+    # Required to make the configure script work. Normally, screencloud's
+    # CMakeLists file sets the install prefix to /opt by force. This is stupid
+    # and breaks nix, so we force it to install where we want. Please don't
+    # write CMakeLists files like this, as things like this are why we can't
+    # have nice things.
+    substituteInPlace "CMakeLists.txt" --replace "set(CMAKE_INSTALL_PREFIX \"/opt\")" ""
+  '';
+
+  # We need to append /opt to our CMAKE_INSTALL_PREFIX, so we tell the Nix not
+  # to add the argument for us.
+  dontAddPrefix = true;
+
+  cmakeFlags = [
+    "-DQXT_QXTCORE_INCLUDE_DIR=${qxt}/include/QxtCore"
+    "-DQXT_QXTCORE_LIB_RELEASE=${qxt}/lib/libQxtCore.so"
+    "-DQXT_QXTGUI_INCLUDE_DIR=${qxt}/include/QxtGui"
+    "-DQXT_QXTGUI_LIB_RELEASE=${qxt}/lib/libQxtGui.so"
+    "-DCONSUMER_KEY_SCREENCLOUD=${consumerKey}"
+    "-DCONSUMER_SECRET_SCREENCLOUD=${consumerSecret}"
+  ];
+
+  setSourceRoot = ''
+    sourceRoot=$(echo */screencloud)
+  '';
+
+  preConfigure = ''
+    # This needs to be set in preConfigure instead of cmakeFlags in order to
+    # access the $prefix environment variable.
+    export cmakeFlags="-DCMAKE_INSTALL_PREFIX=$prefix/opt $cmakeFlags"
+  '';
+
+  # There are a number of issues with screencloud's installation. We need to add
+  # pycrypto to the PYTHONPATH so that the SFTP plugin will work properly; and
+  # we need to move the libPythonQt library into a folder where it can actually
+  # be found.
+  postInstall = ''
+    patchShebangs $prefix/opt/screencloud/screencloud.sh
+    substituteInPlace "$prefix/opt/screencloud/screencloud.sh" --replace "/opt" "$prefix/opt"
+    sed -i "2 i\export PYTHONPATH=$(toPythonPath ${pythonPackages.pycrypto}):\$PYTHONPATH" "$prefix/opt/screencloud/screencloud.sh"
+    mkdir $prefix/bin
+    mkdir $prefix/lib
+    ln -s $prefix/opt/screencloud/screencloud.sh $prefix/bin/screencloud
+    ln -s $prefix/opt/screencloud/libPythonQt.so $prefix/lib/libPythonQt.so
+  '';
+
+  meta = {
+    homepage = "https://screencloud.net/";
+    description = "Client for Screencloud, an easy to use screenshot sharing tool";
+    license = lib.licenses.gpl2;
+    maintainers = with lib.maintainers; [ forkk ];
+    platforms = with lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/shotwell/default.nix b/nixpkgs/pkgs/applications/graphics/shotwell/default.nix
new file mode 100644
index 000000000000..7b74dd745f78
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/shotwell/default.nix
@@ -0,0 +1,112 @@
+{ lib, stdenv
+, fetchurl
+, meson
+, ninja
+, gtk3
+, libexif
+, libgphoto2
+, libwebp
+, libsoup
+, libxml2
+, vala
+, sqlite
+, webkitgtk
+, pkg-config
+, gnome
+, gst_all_1
+, libgudev
+, libraw
+, glib
+, glib-networking
+, json-glib
+, gcr
+, libgee
+, gexiv2
+, librest
+, gettext
+, desktop-file-utils
+, gdk-pixbuf
+, librsvg
+, wrapGAppsHook
+, gobject-introspection
+, itstool
+, libgdata
+, libchamplain
+, libsecret
+, gsettings-desktop-schemas
+, python3
+}:
+
+# for dependencies see https://wiki.gnome.org/Apps/Shotwell/BuildingAndInstalling
+
+stdenv.mkDerivation rec {
+  pname = "shotwell";
+  version = "0.30.14";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-McLkgzkI02GcssNnWgXw2lnCuqduKLkFOF/VbADBKJU=";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    vala
+    pkg-config
+    itstool
+    gettext
+    desktop-file-utils
+    python3
+    wrapGAppsHook
+    gobject-introspection
+  ];
+
+  buildInputs = [
+    gtk3
+    libexif
+    libgphoto2
+    libwebp
+    libsoup
+    libxml2
+    sqlite
+    webkitgtk
+    gst_all_1.gstreamer
+    gst_all_1.gst-plugins-base
+    libgee
+    libgudev
+    gexiv2
+    gsettings-desktop-schemas
+    libraw
+    json-glib
+    glib
+    glib-networking
+    gdk-pixbuf
+    librsvg
+    librest
+    gcr
+    gnome.adwaita-icon-theme
+    libgdata
+    libchamplain
+    libsecret
+  ];
+
+  postPatch = ''
+    chmod +x build-aux/meson/postinstall.py # patchShebangs requires executable file
+    patchShebangs build-aux/meson/postinstall.py
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "none";
+    };
+  };
+
+  meta = with lib; {
+    description = "Popular photo organizer for the GNOME desktop";
+    homepage = "https://wiki.gnome.org/Apps/Shotwell";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/shutter/default.nix b/nixpkgs/pkgs/applications/graphics/shutter/default.nix
new file mode 100644
index 000000000000..c7e55be9f041
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/shutter/default.nix
@@ -0,0 +1,110 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, perlPackages
+, wrapGAppsHook
+, imagemagick
+, gdk-pixbuf
+, librsvg
+, hicolor-icon-theme
+, procps
+, libwnck
+, libappindicator-gtk3
+}:
+
+let
+  perlModules = with perlPackages; [
+      # Not sure if these are needed
+      # Gnome2 Gnome2Canvas Gnome2VFS Gtk2AppIndicator Gtk2Unique
+      ImageMagick
+      Cairo
+      FileBaseDir
+      FileWhich
+      FileCopyRecursive
+      XMLSimple
+      XMLTwig
+      XMLParser
+      SortNaturally
+      LocaleGettext
+      ProcProcessTable
+      X11Protocol
+      ProcSimple
+      ImageExifTool
+      JSON
+      JSONMaybeXS
+      NetOAuth
+      PathClass
+      LWP
+      LWPProtocolHttps
+      NetDBus
+      TryTiny
+      WWWMechanize
+      HTTPMessage
+      HTTPDate
+      HTMLForm
+      HTMLParser
+      HTMLTagset
+      HTTPCookies
+      EncodeLocale
+      URI
+      CarpAlways
+      GlibObjectIntrospection
+      NumberBytesHuman
+      CairoGObject
+      Readonly
+      Gtk3ImageView
+      Gtk3
+      Glib
+      Pango
+      GooCanvas2
+      GooCanvas2CairoTypes
+      commonsense
+      TypesSerialiser
+    ];
+in
+stdenv.mkDerivation rec {
+  pname = "shutter";
+  version = "0.99";
+
+  src = fetchFromGitHub {
+    owner = "shutter-project";
+    repo = "shutter";
+    rev = "v${version}";
+    sha256 = "sha256-n5M+Ggk8ulJQMWjAW+/fC8fbqiBGzsx6IXlYxvf8utA=";
+  };
+
+  nativeBuildInputs = [ wrapGAppsHook ];
+  buildInputs = [
+    perlPackages.perl
+    procps
+    gdk-pixbuf
+    librsvg
+    libwnck
+    libappindicator-gtk3
+  ] ++ perlModules;
+
+  makeFlags = [
+    "prefix=${placeholder "out"}"
+  ];
+
+  postPatch = ''
+    patchShebangs po2mo.sh
+  '';
+
+  preFixup = ''
+    gappsWrapperArgs+=(
+      --set PERL5LIB ${perlPackages.makePerlPath perlModules} \
+      --prefix PATH : ${lib.makeBinPath [ imagemagick ] } \
+      --suffix XDG_DATA_DIRS : ${hicolor-icon-theme}/share \
+      --set GDK_PIXBUF_MODULE_FILE $GDK_PIXBUF_MODULE_FILE
+    )
+  '';
+
+  meta = with lib; {
+    description = "Screenshot and annotation tool";
+    homepage = "https://shutter-project.org/";
+    license = licenses.gpl3Plus;
+    platforms = platforms.all;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/smartdeblur/default.nix b/nixpkgs/pkgs/applications/graphics/smartdeblur/default.nix
new file mode 100644
index 000000000000..6a835fb3c71a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/smartdeblur/default.nix
@@ -0,0 +1,31 @@
+{ fetchurl, lib, stdenv, cmake, qt4, fftw }:
+
+let
+  rev = "9895036d26";
+in
+stdenv.mkDerivation rec {
+  name = "smartdeblur-git-${rev}";
+
+  src = fetchurl {
+    url = "https://github.com/Y-Vladimir/SmartDeblur/tarball/${rev}";
+    name = "${name}.tar.gz";
+    sha256 = "126x9x1zhqdarjz9in0p1qhmqg3jwz7frizadjvx723g2ppi33s4";
+  };
+
+  preConfigure = ''
+    cd src
+  '';
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ qt4 fftw ];
+
+  cmakeFlags = [ "-DUSE_SYSTEM_FFTW=ON" ];
+
+  meta = {
+    homepage = "https://github.com/Y-Vladimir/SmartDeblur";
+    description = "Tool for restoring blurry and defocused images";
+    license = lib.licenses.gpl3;
+    maintainers = with lib.maintainers; [ ];
+    platforms = with lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/solvespace/default.nix b/nixpkgs/pkgs/applications/graphics/solvespace/default.nix
new file mode 100644
index 000000000000..73c5a038aab6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/solvespace/default.nix
@@ -0,0 +1,50 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, zlib, libpng, cairo, freetype
+, json_c, fontconfig, gtkmm3, pangomm, glew, libGLU, xorg, pcre, wrapGAppsHook
+}:
+stdenv.mkDerivation rec {
+  pname = "solvespace";
+  version = "v3.0";
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = version;
+    sha256 = "04aympdsjp37vp0p13mb8nwkc080hp9cdrjpyy5m1mhwkm8jm9k9";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [
+    pkg-config cmake wrapGAppsHook
+  ];
+  buildInputs = [
+    zlib libpng cairo freetype
+    json_c fontconfig gtkmm3 pangomm glew libGLU
+    xorg.libpthreadstubs xorg.libXdmcp pcre
+  ];
+
+  preConfigure = ''
+    patch CMakeLists.txt <<EOF
+    @@ -20,9 +20,9 @@
+     # NOTE TO PACKAGERS: The embedded git commit hash is critical for rapid bug triage when the builds
+     # can come from a variety of sources. If you are mirroring the sources or otherwise build when
+     # the .git directory is not present, please comment the following line:
+    -include(GetGitCommitHash)
+    +# include(GetGitCommitHash)
+     # and instead uncomment the following, adding the complete git hash of the checkout you are using:
+    -# set(GIT_COMMIT_HASH 0000000000000000000000000000000000000000)
+    +set(GIT_COMMIT_HASH $version)
+    EOF
+  '';
+
+  postInstall = ''
+    substituteInPlace $out/share/applications/solvespace.desktop \
+      --replace /usr/bin/ $out/bin/
+  '';
+
+  meta = with lib; {
+    description = "A parametric 3d CAD program";
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.edef ];
+    platforms = platforms.linux;
+    homepage = "http://solvespace.com";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/swingsane/default.nix b/nixpkgs/pkgs/applications/graphics/swingsane/default.nix
new file mode 100644
index 000000000000..c9d119a7d605
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/swingsane/default.nix
@@ -0,0 +1,61 @@
+{ lib, stdenv, fetchurl, makeDesktopItem, unzip, jre, runtimeShell }:
+
+stdenv.mkDerivation rec {
+  pname = "swingsane";
+  version = "0.2";
+
+  src = fetchurl {
+    sha256 = "15pgqgyw46yd2i367ax9940pfyvinyw2m8apmwhrn0ix5nywa7ni";
+    url = "mirror://sourceforge/swingsane/swingsane-${version}-bin.zip";
+  };
+
+  nativeBuildInputs = [ unzip ];
+
+  dontConfigure = true;
+
+  installPhase = let
+
+    execWrapper = ''
+      #!${runtimeShell}
+      exec ${jre}/bin/java -jar $out/share/java/swingsane/swingsane-${version}.jar "$@"
+    '';
+
+    desktopItem = makeDesktopItem {
+      name = "swingsane";
+      exec = "swingsane";
+      icon = "swingsane";
+      desktopName = "SwingSane";
+      genericName = "Scan from local or remote SANE servers";
+      comment = meta.description;
+      categories = "Office;";
+    };
+
+  in ''
+    install -v -m 755    -d $out/share/java/swingsane/
+    install -v -m 644 *.jar $out/share/java/swingsane/
+
+    echo "${execWrapper}" > swingsane
+    install -v -D -m 755 swingsane $out/bin/swingsane
+
+    unzip -j swingsane-${version}.jar "com/swingsane/images/*.png"
+    install -v -D -m 644 swingsane_512x512.png $out/share/pixmaps/swingsane.png
+
+    cp -v -r ${desktopItem}/share/applications $out/share
+  '';
+
+  meta = with lib; {
+    description = "Java GUI for SANE scanner servers (saned)";
+    longDescription = ''
+      SwingSane is a powerful, cross platform, open source Java front-end for
+      using both local and remote Scanner Access Now Easy (SANE) servers.
+      The most powerful feature is its ability to query back-ends for scanner
+      specific options which can be set by the user as a scanner profile.
+      It also has support for authentication, mutlicast DNS discovery,
+      simultaneous scan jobs, image transformation jobs (deskew, binarize,
+      crop, etc), PDF and PNG output.
+    '';
+    homepage = "http://swingsane.com/";
+    license = licenses.asl20;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/sxiv/default.nix b/nixpkgs/pkgs/applications/graphics/sxiv/default.nix
new file mode 100644
index 000000000000..fec378d38437
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/sxiv/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub, libXft, imlib2, giflib, libexif, conf ? null }:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "sxiv";
+  version = "26";
+
+  src = fetchFromGitHub {
+    owner = "muennich";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0xaawlfdy7b277m38mgg4423kd7p1ffn0dq4hciqs6ivbb3q9c4f";
+  };
+
+  configFile = optionalString (conf!=null) (builtins.toFile "config.def.h" conf);
+  preBuild = optionalString (conf!=null) "cp ${configFile} config.def.h";
+
+  buildInputs = [ libXft imlib2 giflib libexif ];
+
+  makeFlags = [ "PREFIX=${placeholder "out"}" ];
+
+  postInstall = ''
+    install -Dt $out/share/applications sxiv.desktop
+  '';
+
+  meta = {
+    description = "Simple X Image Viewer";
+    homepage = "https://github.com/muennich/sxiv";
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.linux;
+    maintainers = with maintainers; [ jfrankenau ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/synfigstudio/default.nix b/nixpkgs/pkgs/applications/graphics/synfigstudio/default.nix
new file mode 100644
index 000000000000..2b9fee974b37
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/synfigstudio/default.nix
@@ -0,0 +1,127 @@
+{ lib, stdenv, fetchFromGitHub, boost, cairo, gettext, glibmm, gtk3, gtkmm3
+, libjack2, libsigcxx, libxmlxx, makeWrapper, mlt-qt5, pango, pkg-config
+, imagemagick, intltool, autoreconfHook, which, gnome
+}:
+
+let
+  version = "1.0.2";
+
+  ETL = stdenv.mkDerivation {
+    name = "ETL-0.04.19";
+
+    src = fetchFromGitHub {
+       repo   = "synfig";
+       owner  = "synfig";
+       rev    = version;
+       sha256 = "09ldkvzczqvb1yvlibd62y56dkyprxlr0w3rk38rcs7jnrhj2cqc";
+    };
+
+    postUnpack = "sourceRoot=\${sourceRoot}/ETL/";
+
+    nativeBuildInputs = [ autoreconfHook ];
+  };
+
+  synfig = stdenv.mkDerivation {
+    pname = "synfig";
+    inherit version;
+
+    src = fetchFromGitHub {
+       repo   = "synfig";
+       owner  = "synfig";
+       rev    = version;
+       sha256 = "09ldkvzczqvb1yvlibd62y56dkyprxlr0w3rk38rcs7jnrhj2cqc";
+    };
+
+    postUnpack = "sourceRoot=\${sourceRoot}/synfig-core/";
+
+    configureFlags = [
+      "--with-boost=${boost.dev}"
+      "--with-boost-libdir=${boost.out}/lib"
+    ];
+
+    nativeBuildInputs = [ pkg-config autoreconfHook gettext ];
+    buildInputs = [
+      ETL boost cairo glibmm mlt-qt5 libsigcxx libxmlxx pango
+    ];
+
+    meta.broken = true;
+  };
+in
+stdenv.mkDerivation {
+  pname = "synfigstudio";
+  inherit version;
+
+  src = fetchFromGitHub {
+     repo   = "synfig";
+     owner  = "synfig";
+     rev    = version;
+     sha256 = "09ldkvzczqvb1yvlibd62y56dkyprxlr0w3rk38rcs7jnrhj2cqc";
+  };
+
+  postUnpack = "sourceRoot=\${sourceRoot}/synfig-studio/";
+
+  postPatch = ''
+    for i in \
+      brushlib/brushlib.hpp \
+      gui/canvasview.cpp \
+      gui/compview.cpp \
+      gui/docks/dock_canvasspecific.cpp \
+      gui/docks/dock_children.cpp \
+      gui/docks/dock_curves.cpp \
+      gui/docks/dock_history.cpp \
+      gui/docks/dock_keyframes.cpp \
+      gui/docks/dock_layergroups.cpp \
+      gui/docks/dock_layers.cpp \
+      gui/docks/dock_metadata.cpp \
+      gui/docks/dock_params.cpp \
+      gui/docks/dock_timetrack.cpp \
+      gui/docks/dock_toolbox.cpp \
+      gui/docks/dockable.cpp \
+      gui/docks/dockdialog.cpp \
+      gui/docks/dockmanager.h \
+      gui/duck.h \
+      gui/duckmatic.cpp \
+      gui/duckmatic.h \
+      gui/instance.cpp \
+      gui/instance.h \
+      gui/states/state_stroke.h \
+      gui/states/state_zoom.cpp \
+      gui/widgets/widget_curves.cpp \
+      gui/workarea.cpp \
+      gui/workarearenderer/workarearenderer.h \
+      synfigapp/action_system.h \
+      synfigapp/canvasinterface.h \
+      synfigapp/instance.h \
+      synfigapp/main.h \
+      synfigapp/uimanager.h
+    do
+      substituteInPlace src/"$i" --replace '#include <sigc++/object.h>' '#include <sigc++/sigc++.h>'
+      substituteInPlace src/"$i" --replace '#include <sigc++/hide.h>' '#include <sigc++/adaptors/hide.h>'
+      substituteInPlace src/"$i" --replace '#include <sigc++/retype.h>' '#include <sigc++/adaptors/retype.h>'
+    done
+  '';
+
+  preConfigure = "./bootstrap.sh";
+
+  nativeBuildInputs = [ pkg-config autoreconfHook gettext ];
+  buildInputs = [
+    ETL boost cairo glibmm gtk3 gtkmm3 imagemagick intltool
+    libjack2 libsigcxx libxmlxx makeWrapper mlt-qt5
+    synfig which gnome.adwaita-icon-theme
+  ];
+
+  postInstall = ''
+    wrapProgram "$out/bin/synfigstudio" \
+      --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH"
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "A 2D animation program";
+    homepage = "http://www.synfig.org";
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/tesseract/default.nix b/nixpkgs/pkgs/applications/graphics/tesseract/default.nix
new file mode 100644
index 000000000000..840c87de216b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/tesseract/default.nix
@@ -0,0 +1,18 @@
+{ callPackage, lowPrio }:
+
+let
+  base3 = callPackage ./tesseract3.nix {};
+  base4 = callPackage ./tesseract4.nix {};
+  languages = callPackage ./languages.nix {};
+in
+{
+  tesseract3 = callPackage ./wrapper.nix {
+    tesseractBase = base3;
+    languages = languages.v3;
+  };
+
+  tesseract4 = lowPrio (callPackage ./wrapper.nix {
+    tesseractBase = base4;
+    languages = languages.v4;
+  });
+}
diff --git a/nixpkgs/pkgs/applications/graphics/tesseract/fetch-language-hashes b/nixpkgs/pkgs/applications/graphics/tesseract/fetch-language-hashes
new file mode 100755
index 000000000000..c431f1d97c26
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/tesseract/fetch-language-hashes
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+
+# Usage:
+#   ./fetch-language-hashes <tessdataRev> [<language code>…]
+#
+#   Fetches all languages if no language codes are given.
+#
+# Example:
+#   ./fetch-language-hashes 4.0.0 eng spa
+#
+#   Output:
+#     eng = "0iy0...";
+#     spa = "15kw...";
+
+set -e
+
+(( $# >= 1 )) || exit 1
+tessdataRev=$1
+shift
+
+if (( $# > 0 )); then
+    langCodes="$@"
+else
+    repoPage=$(curl -fs https://github.com/tesseract-ocr/tessdata/tree/$tessdataRev || {
+                   >&2 echo "Invalid tessdataRev: $tessdataRev"
+                   exit 1
+               })
+    langCodes=$(echo $(echo "$repoPage" | grep -ohP "(?<=/)[^/]+?(?=\.traineddata)" | sort))
+fi
+
+for lang in $langCodes; do
+    url=https://github.com/tesseract-ocr/tessdata/raw/$tessdataRev/$lang.traineddata
+    hash=$(nix-prefetch-url $url 2>/dev/null)
+    echo "$lang = \"$hash\";"
+done
diff --git a/nixpkgs/pkgs/applications/graphics/tesseract/languages.nix b/nixpkgs/pkgs/applications/graphics/tesseract/languages.nix
new file mode 100644
index 000000000000..08512a5cdd9d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/tesseract/languages.nix
@@ -0,0 +1,289 @@
+{ stdenv, lib, fetchurl, fetchFromGitHub }:
+
+rec {
+  makeLanguages = { tessdataRev, tessdata ? null, all ? null, languages ? {} }:
+    let
+      tessdataSrc = fetchFromGitHub {
+        owner = "tesseract-ocr";
+        repo = "tessdata";
+        rev = tessdataRev;
+        sha256 = tessdata;
+      };
+
+      languageFile = lang: sha256: fetchurl {
+        url = "https://github.com/tesseract-ocr/tessdata/raw/${tessdataRev}/${lang}.traineddata";
+        inherit sha256;
+      };
+    in
+      {
+        # Use a simple fixed-output derivation for all languages to increase nix eval performance
+        all = stdenv.mkDerivation {
+          name = "all";
+          buildCommand = ''
+            mkdir $out
+            cd ${tessdataSrc}
+            cp *.traineddata $out
+          '';
+          outputHashMode = "recursive";
+          outputHashAlgo = "sha256";
+          outputHash = all;
+        };
+      } // (lib.mapAttrs languageFile languages);
+
+  v3 = makeLanguages {
+    tessdataRev = "3cf1e2df1fe1d1da29295c9ef0983796c7958b7d";
+    tessdata = "1v4b63v5nzcxr2y3635r19l7lj5smjmc9vfk0wmxlryxncb4vpg7";
+    all = "0yj6h9n6h0kzzcqsn3z87vsi8pa60szp0yiayb0znd0v9my0dqhn";
+
+    # Run `./fetch-language-hashes <tessdataRev>` to generate these hashes
+    languages = {
+      afr = "15dsnzy4i9ai26ilm73gkfj4ck039raa88i6w443c4b1fnay2akf";
+      amh = "1wbcsdq3svxga3j1alk61xs72a9fhsfsyjxhp3cwxfaqfhrzg7h4";
+      ara = "0nk495gki6jbbnwcl2ybsx4nd02d6qykcjncq0d2g8pbgapqmj91";
+      asm = "0c3wq15yphq7x74s2sn3f90k6z1cf5j7ic62z0dynidrv99bddfh";
+      aze = "0pz073hxqkx1a1cshlgg5k11lj73s52sdxa7k3020drc314lhaxw";
+      aze_cyrl = "0djbfgx28ykcjsn2p0766qrmj256g7vhc7valc3ivsva8b906lxq";
+      bel = "04zqy8vik0fcakq6apfp8wjhkkhlg0yn9kmag1lk7s8fy9ax3ws2";
+      ben = "0q7812kn5xjm47hcgdcg911lhbgqr7hbvqckfxxm8qw0yjx2cy0m";
+      bod = "0rwq7539zzfs8xs0bf1535z1cwkm0yk1ni25f5gjav7nm6qpiaan";
+      bos = "1qr04dj7lx347gxpin5nfprbggmxq2mwx8kf3pcc3vb5x3pa57g4";
+      bul = "0cyyqgi3i4y9bfzwls0lwljzgd0r8ayfqb4bbvdh4qmbni9x42ya";
+      cat = "0kgw8f5pdw9lfbn6cfp5n1s0j8pj3418yx6rsbagzcf1gr36gbr9";
+      ceb = "1g1n4np4vhar7wfwx2km5k6kldb600rrl7npfbf75229rar068f1";
+      ces = "0zxkkyhpd74i6321nv86pkjb0k7p9cp6m174rbn42nl7jz6qxib0";
+      chi_sim = "0k250xr0gk9yh22yqxd0zpxdsrqfzs164kdv5n9rxx1g996yffij";
+      chi_tra = "03nxqpd546p0gwfj6pqzbdbv5zjpdddzlpa10xn4nvmks1mmckbp";
+      chr = "1k1sg3hap0kd5aa36ysvmhp7r3fynxf0f7lzz814h6p3g250zclb";
+      cym = "0d6wbf9cmrrzf66mhcckwdfy3xh2i38r0by9nk6isw9rl7bf7j07";
+      dan = "1s1yj56rpzmif3ir3qs4iab744cgpflk7y8812z2665bh61illpr";
+      dan_frak = "1bxi53ymib5g0139vfd2pflh7nl5925vqznq3sfgaqx7gdx630vi";
+      deu = "0fna7fqk1a8ivd7q2k38vx37qm3vbn183zh4z5zfqb4pgqmb8znb";
+      deu_frak = "1y4krkvarg7jxhcq49fgybg4phbn58y9c0z2bm8mnp28jkih1cnb";
+      dzo = "1fcz0imi7zxi99762pxfcm5iz2jcbqj3s742magka4ihrxnz07xm";
+      ell = "0r0f71jy4y29bg055qvvy93wchi3lh08zz0k9c8l7466b03yvq5v";
+      eng = "0vghah8kqcv0n5fnjb88w6siz156ysrc41fckw3f2y8c3sgmqlf0";
+      enm = "10y61xv3w1ypgqz5rgb22y5hh1i4zx03cwiqw21ifqvg4xdrln46";
+      epo = "1y5lh55mbcx33cm7qlf1dcah8ffycxmlcpzjzx9r6ij14fdd4964";
+      equ = "1nqrd0a9jqqh6byy8snfhad1hisrc92dcx44wsy7v4nf40j3mx1s";
+      est = "12ll8lq1hjcsq9hh93020w78r7f1rcxcwlvrjqw8j5p3k9jg5a4g";
+      eus = "034s9mp7lw1a4yvf2cmbbj2fbqbaq6xnjqh30yn0wq0c0jck96nw";
+      fas = "0m61p4byc0kzf75cdn6g18s8hcg9r8ifs34wr85lbsb65kil4ijx";
+      fin = "1wac333k0lcd5jwprzg99b10bq8sdc96b9d6275kg9imyqjwcc7q";
+      fra = "1ax7i0nw1lwkz4sbrvn4z0lcrcai77ymdpla7qk7yij6s4xb5bw6";
+      frk = "16nmr71p93724vk1x5mq4r8vxpwnm448p6dwqv8scg8asch1cidp";
+      frm = "00yz3hz7wcralq8wbx1ap4c6b37ac6vnz5bgmxmgdx0kqzibiddn";
+      gle = "1n8z8kmn5m628rlzgz5v0iw6h46aalflq5asa1wj5rygx1y2azpa";
+      glg = "0fdniayplc3iwmlmvhblarh1gm97dp8rqhhkb8b0clwfd9cj342z";
+      grc = "04r2193qcxqyab5998xn8bf7197wiccmjm7iakij8d0c7l61dnxb";
+      guj = "0dp8mlxmf0x9wb8dg0c508sdwz03icq94z8ji8jhwgdqgv8hw1al";
+      hat = "0793mmlxbb09c8103jhdvlczz647nyn4ykkgd3gwgavncmjh72v8";
+      heb = "16za9ff1i3ya6hz75l9v3v7j4039kscxxw21g3i2w5p9zn52hyag";
+      hin = "1vnn5wpc724kgib8jbx0kpnnp4al60ivqir72gnbyh6cpnflb6bf";
+      hrv = "15rqd6xiv2bdmalb5s6rxvw0yk6w9agn9fli3bvi703q6vpj2yn3";
+      hun = "19zzwdxwi3h3vdsgr271i1m87gfpdirk6b1ljw2j8qmfilp4sw56";
+      iku = "1v1yvc1194qycjgb4ihh5hpj6472nlbp66dii183514g2dh9x0db";
+      ind = "120d4b41wvsgcd1sgy2mp78i9hvi7w03a63078dz1yds0yqdwf1p";
+      isl = "003ngk8dfv6dglkq8pmi6jsglrfkc65js5ywh3vvkg7qfqf6qsxz";
+      ita = "1lxklk3zc3x3k8yfpp6ygyv7fndgs57dfasc97rh8782ds16wkjs";
+      ita_old = "188gby1y51pa1ycyc8y17d16hs5w27yl5ch7xzni98bdjkwbkl1z";
+      jav = "1fjyjznjchls5ifbnx2b9xagisgxvgj9lsf39rr9d87sbzdbbwbp";
+      jpn = "1wmayj8wh3pfwznjhalad2qzv38mhrzw2sxl71mycvzvpdy9ag1w";
+      kan = "0hak4953whw9vd9dzl0hq076kzb19kk45kmfxk03af4k6gb206vg";
+      kat = "16k0057cvvdc6snm5svhdv3cr7cw71g74yy8215njjbsi838imi3";
+      kat_old = "02gl755d38plyvzwfjqxvjgfqkbjs9rvzx33qfhm2zvmgbwrfrfh";
+      kaz = "0hc36w7zz5waycsk220v0r83sg991gd5f5r937mvz44viql80sgm";
+      khm = "1gb2nv5qdq5fz9w9xq4fj68p46b62sd1m986ra5qbnskxqizr12s";
+      kir = "1b1ing6qqi8qqfh4xpk76rp4gxp69wdjdl5m777ayx3v02d7nhh3";
+      kor = "1rldj6f8h1nn5wpx57b0ci7p0fnivnwzgaf0d3576xls26z2wcgv";
+      kur = "1cp2pfd6g662gvxi7ywkxfbfq1lwbis888bf1gg8ynzy342mx1ic";
+      lao = "03bdaxakmxpbbr9vsnbzzfksvm6js0l5i0ijwl71piqyxqjj1gxf";
+      lat = "1q7v7drnwpna9k2l79jbdlxiv1j617rqzjc9d48h3lfrma5z97sj";
+      lav = "0fxzyvw7n67rmw2irvlghkf1bii4w47200zv26p0v3a9dwvhc7sg";
+      lit = "0f00ggjjqrl94kwwjmjqwajyfprsml0br8vhn2gvn11gaxvm52hm";
+      mal = "1i83plhin3m6sq8p92vzlyng5z59gvvqypyh7rnmvdmm9rranx8a";
+      mar = "0ay7q53yl3709crvn5l9c9jx7hw6m5d3x2crmvnvczsh83ayfdik";
+      mkd = "1q1wadcr4j1dzssyyqz43qmizc6vfqkbivr6xi2p7p4h9rl11x73";
+      mlt = "1qp4v6habak1l7xrw322wglvjjndrfp4j7bj8d4npwbzk1sh4s0h";
+      msa = "048p6mkx9zr40s9s5vbi0gnizhvqwn0g8i1hf1l8db7igbax5xyj";
+      mya = "17nyr5bd42kzvid3421n3mwckd49vzrjhjahd8rnfsmbsy1x382l";
+      nep = "154375r32sdmvcnp1ckvgbp3wxvb2xiiypb8bxbsvrabrz4wzjqc";
+      nld = "1clwbky71zkz55zd3f8r9hj8fhpnbkply80p1js4fvs7x12r715x";
+      nor = "1ynvrz6s0vmlq1xkjd8k2w6bx8770x6v29qgx83d4nl17ngjd459";
+      ori = "0dsakc8gnwhs6z5kxc2wdkbn31gkkiqk5vriw0swghychp164aac";
+      osd = "1zq0dfliavglmix7zzrqdxz1w01rm1f1x1352bqn8xf4zivdbxcw";
+      pan = "1fwdpwkydfmr6drwgkqzn89z12r2rdm02a75vvdxhxg2a9yiwmbv";
+      pol = "155z870ygzws476kp7qpzi8jcjcv3jb5px8rbzhnag1fklqr48hx";
+      por = "1814cff2rffpzlg4hyyrjzpf5ps2i95rmpa4c8ikblbvrlcv97q8";
+      pus = "1iz5nn1zfvn1l9gb1jriwx991d2hwwc7x4k1nvzjlwpzscplx25b";
+      ron = "11lr80zhvnnngvwwk01z1d3prfpbh3qbwpl1nl5fp7h09d6n3wzl";
+      rus = "1d6a8lg4bmd3np16jds1py3qpkaq4ahnhwghd5r0159y0jpxq00q";
+      san = "169f4ajgwn99yfdfrlwfvdgvv1abal7fpdp31sknvq8l7w2sak3g";
+      sin = "1411g18r6f6j6f4n0sn7ajgs4gkplb892s6ak0hi9nyyxwv3r1gm";
+      slk = "0bxfbrg1nf6px0xzkh6ihdi71fmr1rxxs99qb191k7pm16x2lpds";
+      slk_frak = "0zyqnn1y5cyx1y7wzgw743k4584ljl0rhvk2q1ni6jnjx9ciwzqy";
+      slv = "1kjn9m9hbwp0m0p2v8c3skpzr6f8x42hz8x48zl22550a7hq8n1h";
+      spa = "1npgl8ylvfm60hd4214z8a3lriy1hckhijschrbjpzmwdfcqafgj";
+      spa_old = "0w4ivkv8flyn7bjlyjcrcrdnslkvrrfs7l33mvird1jhhkyqd8sx";
+      sqi = "15wzvh6qm3yx7yf0k5j7g1imsaqxvq7r2xh6a0xgmkqbyypbbkdf";
+      srp = "05blqriv30x02c80ds3x7zhw0y21nc6lkqlv5jwgwnjgw4yfpgrm";
+      srp_latn = "0ss8s3q60aq8sd2a3sbnzvp13qqarxnjw4hij8hd9ab5gsjw0nwr";
+      swa = "1pwwhx7ldq21cv06cchws8gvwsmkwn5sjcy9z3nk3nbp9qjsf44f";
+      swe = "0l10iyn2cr7ibgk0akmpg8725mpwpydawgv3s77izsw7y6xhfr1a";
+      syr = "08bxil13wyp5h4hvbxjcys7ypgqgg46rrp653m7gyv5q94ycjgb0";
+      tam = "1g155kyba2wjfgzgy48g6yd2csinwbfjdi5r7vw0wm3dh1z39dvz";
+      tel = "0fydrcb54b6mmqazb337x4s36i2a64sb4xm7y7g3nqqmk9afsipv";
+      tgk = "0f6j37friywj7y132fv0jm6aj4sx8f0b7brspj3pbjqqpi4v5ws0";
+      tgl = "0f1r0gicif57qhyw8xaa1sqgny720q3z5cpd5srrn9i6fihaz577";
+      tha = "1y2hw55jfpidk95y8qbsiczgg2r2khabac97s1y3gl0v93a44jna";
+      tir = "1y7iryhjr83ca4yh5jjz7qlnrx4kbrp0a0p650whjvk2gnv8m98h";
+      tur = "0xqnq99b2jb4v74bj95py6wmg14dm31zp5s3l48dmcv6zdgcxg2w";
+      uig = "1sdddr15zlb33kd1d7hzi5lfd15bfhqn105d7x6snfpqp7vq4bxv";
+      ukr = "0cdwjnfnnmzz7jdn49l96vqgaimclfxcxaw09cm63f5my382r2rg";
+      urd = "10xcn1zs2lfswp5yai0ckyg7js587qhr5cf7qib3i35qjbw7nc18";
+      uzb = "1jkkd5j6vsx5jv5gwprbfwg1vwh714prm8j446wzvp74brmk949l";
+      uzb_cyrl = "1kdia38rgm2qd3ly80a412jyagxxryr09h1nz2d0iw71bmfn4855";
+      vie = "1ja18jxxaw282y4jljxpjf1gj15il61vc2ykpfy22vn88wvydxff";
+      yid = "1jddd0g8mm5v00z5kb8rbpfs7ppzgq9kzm1xlhhvv960yfdbi6fd";
+    };
+  };
+
+  v4 = makeLanguages {
+    tessdataRev = "4.0.0";
+    tessdata = "1chw1ya5zf8aaj2ixr9x013x7vwwwjjmx6f2ag0d6i14lypygy28";
+    all = "0dqgkp369rcvq72yhgnzj1pj8yrv7kqzc7y6sqs7nzcq7l5qazlg";
+
+    # Run `./fetch-language-hashes <tessdataRev>` to generate these hashes
+    languages = {
+      afr = "1a9f8pnrspfmcq9gpjnxn2kkhjlsmh912bnpx671fjizxpmiri2y";
+      amh = "0m1vdyxjx57kmf2qra0p31k509y1cqn4pyckzw00i5n3wx11d2j0";
+      ara = "0nswl6n0s94g900j5k1gwzp7m140c0yd9a2fdb2lzhdvg1krf190";
+      asm = "025d9vrjcrwyd6cc6hrw1x8xqhicgrb9wpvhhmlw71ql04dadslf";
+      aze = "01shcs78a6xn3my8p3y42x1c9f5hzfn83w2n2nwpffbgz4y2nsgf";
+      aze_cyrl = "1sbd89i5r7rnkjh2in8j0plrxnfiill9jl8pr68iw77ghih6q1vg";
+      bel = "0dhyymsxcyzwal8474q7ag3m2akv0b92hkdz7rka5z1cxry1cn8c";
+      ben = "0a7q9414k3frn37x2qcglz722ysg2iivj6kqaaa0ik7z14ibc8v0";
+      bod = "0rh7x54nlh6ir6ldccj8hi7g8hwlp13r3fkljw8gndvhwmgfkkar";
+      bos = "1szym4n605hlx12a9vpz4jjs76jscajh22rgkqwbv4qdsl0gi3nd";
+      bre = "070f4c84iznblsw4jkwpzh9dss8nfb678160szm5r8dlv2yinrrk";
+      bul = "03bg2yw79lg8rl43y9288313jrfh0h69vl4s4cmlgbmnbx8pvxwj";
+      cat = "19xs691aj8yy2ff07c3gzm07zicd5ha0gmcjxjh9pknqf2gfy7qv";
+      ceb = "1896vn41hqc4anm6hjvrnn022i0p8pmhwsp5rv9w2cvr6738l79r";
+      ces = "0fh2g47msfr91285rnccxcmcshihm126sqy496s4vrr0vk8ix1nf";
+      chi_sim = "0qxkvbpm5l7gzsshnn72wfx473pprf5nmw8hd4i4x2qxnfddh1gw";
+      chi_sim_vert = "1f75pzvxbda82vxa2zb1z9b9f13sh81kzaw45vg5118ncsklj8w7";
+      chi_tra = "056vjws1fir1v5iv44pzykkxs5q1dbb2j8blhj47i53w1zf6g42m";
+      chi_tra_vert = "10c9cdycg1a5kwlgg60sh8yp07w2fl4whinpxfhlzrzs56allql4";
+      chr = "19qq8a6c27973djsc4xpcklis92r58x21fg4mz5azdyka5i1n46l";
+      cos = "0z9kx1hw8h5n00pcahxla808wya50wrkk8cz7x676pd93ibyrlyx";
+      cym = "13pk9cpf43xxqbz3blfz2av2yd1ma6ds6jbdiqw8anhhj7l9ch2d";
+      dan = "1jirmahxvyyswhhyzhinvcqaycz7m3ixchqrj3lgfcdi3anvabr2";
+      dan_frak = "17wcgdqxmbzn7qchnx5gsa05aj4wmhbwk43w173bl3wr6h5ylmh0";
+      deu = "194rqsg4nlycca9bg2fqf15xgcl110rxp182l7dbjfjhar4knsw9";
+      deu_frak = "12hhhp32f15c7fw2jp05mwim9ps14kmamhh6vmalvm7r2033vbm7";
+      div = "09mm9r5hxhsc4qpyg10ym9mc2kdpawx8zk0aiv1xpgd35rzpyz41";
+      dzo = "1zk7crgcazgqy5zmslp6iw4jws07nja31qdxx0rpzhn3c0bjgw1b";
+      ell = "1hhym18a9411953j47xjk47jx9ij9xi2qwlx05c93zl41528nsqg";
+      eng = "0iy07z182lwhqfa0q288ha691scpsry330aynaizn68wcmywk86s";
+      enm = "1dhr1qvil38bil43wk5ci645sbm3my2y9y7qlcbnwz2p4pflayvm";
+      epo = "1jig4db7050vww32vxsqyig3j1b0vgz9ipxbsw0jpkjia84k44n9";
+      equ = "02qwg6s1z7pynwm0p6dvpwi04ivfkr1s7qgssbla1dx7v0ih6rlg";
+      est = "1jxygahy6by7fbirbmjmd68k6560q1a3h5mvpzdx15h5fw0q58gl";
+      eus = "0cai7nm7si8680avrrls8bf9ski980rvsj560fh9y6n9rz7mh9mp";
+      fao = "1n3434jf18bzakbylzyg3jaw2ad4h376g56dsql32bgh2yvyww8a";
+      fas = "17wjkfka9725rz32clgqgk9msmbz4axs59vz30jmhhxyrkliafqb";
+      fil = "0p713k8g27df9z384ns111xqxii5kq20m8brflsmd3yckw1mibhz";
+      fin = "1wc3y9nnm7rb2c2c5fkj7cv7jb27jlkb2bh0g8kaz57h6imfmb2g";
+      fra = "04qrfvi6irlaahh1pgn5azyfhbhavm12yyybza8603alf8firh7a";
+      frk = "05cqmxxxjqdl5hjyzi6dpmixnjpd6f3jr6741yapdmnxvkzxkiyp";
+      frm = "0a86yy6hd0lvlbzvnzjmyapzc0rn7mnkdadqycd65bw1b714cvy2";
+      fry = "0i84r8g9hlkr9nlhypl4lq6ncrhbcpskqkdcijgk88c2fdknh57h";
+      gla = "17idyhb505waz9dnb8dsk54faw7y0xvvb12yw71k0skq3i90akar";
+      gle = "1q87h5zzcva54pg364d3hl6q9hdlydlyj1qmq8n5k7hqk11msxmk";
+      glg = "01xssz1rhpy3a0sm4i43nba61wc2srz6wv327vdw1kg8ijm0s0g4";
+      grc = "00x0s3smx4wg5h12y2b9al0j2jk1y3f0yy2x6f2qf7ps831drgyl";
+      guj = "028v4fgn0zi2044vk6j2rlqklc9i0kj22s52vhifmx1g02kz9154";
+      hat = "1bca516pr2cnyjlwycc7pr6gfmdjb8565hp06pw9nwpr20ry0hss";
+      heb = "1qfkffjh29b21frs0mv6llsrchixl5kjkpj1if7fq816g9mym9kx";
+      hin = "1rkfam5c6qil2590lfffzndhq3bncdgf4ij0cyjcglgyljgx0xnc";
+      hrv = "0da7b6mk0rwc9zlbqkycwjpddp3qpy07l643i00ia5a1zq35fmgp";
+      hun = "0w2s4mn9p74zqzmp9hh2017zgsh5v43k4lid4pv29f4b0y5gj9xi";
+      hye = "0ifzm875wlbjh4vkpmj1n6f14m8i174413l6pc6i44y4p5fpgxrf";
+      iku = "19arnv82xbxhbcy8pf9fv1sl5zc5707mk34nh7w46dlz86qkidmn";
+      ind = "1d421hizwni4m6sr4f3nqqpr1g744hzn0krk130m7x8mhzgamba5";
+      isl = "1hjjw8k2r9qa990ziq5wxr36kyf16mnmrqfmq5vbcjprka9h08pq";
+      ita = "1qyrvlf7pjxzyb29sc7aq3gq61bww14sijka44scxggfw7134l3r";
+      ita_old = "1pf8461jbj0vpyry0b54crmkf2bk9mh4klxvmj09jvf0aq2vm9s6";
+      jav = "18vvbyimj0y462amjmwvqa6h9n8l122j9v0w3hfp63hlxpfprm0m";
+      jpn = "16hma9w32vdh41ihymp894jza72b0d235hwriv18r78j5n86nhbg";
+      jpn_vert = "0yca09l9sbpfjgb2slnpb9q7qd7vz3a1wb6bkln30d3nl0d9r1rn";
+      kan = "0lcmx37rjfxkbhhbrld1ndmkwkm9w9b3pzxhas0cv5dqsx2f84jd";
+      kat = "1b164bgwa7bbvw4177h8fxfh0fbh4bycfl9pkaa184dpjpaiqpia";
+      kat_old = "1mgff7sh93hdp3wh0ckikdggrdgf0syp75s39pickpbkp9ic41ai";
+      kaz = "0h37y0kb5lwsp5zpl7bvxg3ryqldl5hxfnardliwgyqgnag951vi";
+      khm = "0m7x1fynr18sid2kjjw8xa9ika0a0fc6a6hvc7ihizi47893hdfb";
+      kir = "09kxwqpqf6kxjii07qlqsiii83zk12rszp88xnzzjp8rjsnk78s3";
+      kor = "0nsr43fwrp9876ia1fc0zcviv2n8hw16n0wfh158vhygwglvy84m";
+      kor_vert = "1wmvdznmikk9fq7wdffvn22scxmcl26vjh26jhicqwxpc7kg4bh8";
+      kur = "0gbsf3ny3n5mgb30v54bz3crgnimdpg19jn633pbpzryzg3xhd25";
+      kur_ara = "1sbj0cczhi9q119fbzpi0m6zr9kjp3k76bv9w8szkv1wc5y4fng6";
+      lao = "1gvxlg8bw3a4c9izg3c2a2yl7q6rsy7z9y64axdw9a04pz2ndbl5";
+      lat = "0b7an3q3xrf9c55bhiqqh7l45ga88l0kwvkp1akmlr98piach3vr";
+      lav = "0fqsmy47cygamddxyjfrdgkfa9bvmrvf4csvppnkdvfzy6iiv0c2";
+      lit = "0wjgbkwc3bf5khdqali7ylnhhs4xvpx19m3zx2y9s27v2wjbb6kv";
+      ltz = "02zdxbniiqfl87fzsiaaqgldqfsv15z5hja1xhxnqpl0nds7shfc";
+      mal = "0a41ifz8i6lj2ywxjkwvymxzxahkz2cjv4apbrawdj1h42bn7frd";
+      mar = "00swhlh9bckvmlxanfmlw5j4n9qqhggl84bsq0827bmijsqwnl44";
+      mkd = "1bqfiwxlzfpz4fs4z5ci2wbv01qhrcayk1inmk3dxq7dsywx1ajg";
+      mlt = "1rmmga2aw88hr7q7cfr5cvhnsgnf1mi069d5k7z66zp4vzbl4zyz";
+      mon = "1jksvcavn9plsmjdmhg40mwq5rlvrd1b9gvghdjg7zkf6qqqynlh";
+      mri = "0jlfawx20s5clsnk82ndy3v2zidh4cfh4acrh8nindk21xmiwh5i";
+      msa = "0m7zs8anaa3l4z5f3xvbhs4syp41dp4all2yfpi1plyr0hy784an";
+      mya = "0hljm5haadlr4k5rhw4mvhkygcnrr709rvl7amz7av3nskmi8mb1";
+      nep = "1dhy0m2h6xfgwibf92iwxsn926dmrhfvkg9rafkdaqcr4pq6w563";
+      nld = "0bspf5bv1s7qzm6k4aqbpq91zvk4kxxhx5zv08w91xfsa1zpdxmi";
+      nor = "08majhc9m0fjvac50yq52ia2af9kscclimwkv403klnj4kgf8ndq";
+      oci = "1mzrw9gsdjrd1xj3zv7l5gzgjq5jrygxf8cfkz20d9lls0wj1xdv";
+      ori = "1sh42mjzb1hv6l6lljp3wifjmz7wrv818f9f16m8qjikwqxm0s78";
+      osd = "03mvfk1q1xp1klpf4bwna903rnp51bkqr3gl5hvxybvrc3l2m7z1";
+      pan = "0165kr94p6x5yxzs4p8sfppvg9cywp65ps0xaym5rqz9iashz32h";
+      pol = "0g0b71ms6ddgykmkna4mlavgzgmh9vj6s62fi8l4ja93nfpr37hp";
+      por = "132jbhzmcsq8skanm15bw2niyx9xpbrqr411wn7w9r5i3cvnlv01";
+      pus = "0iiglnkn478al11avigsav625pn7ifscycnxpj6fg8835vjww3xr";
+      que = "01vkmfi9idjwskv5pllmrxpil0v5h7f7rzv5viclxrzkmbvrz9b5";
+      ron = "0ag6vs0cn3sryavs1mfrallgdgi4h28114g7m61rhlhq0z484g0m";
+      rus = "1hippm3w5d73sh50r136x0xff2p6x128ry2x4fywf6xdpv1f46v8";
+      san = "1qlpqkr5c5wqcf1bvlipy72advqnvd4wm61vghmrj2sda8mx87sx";
+      sin = "097d2s4ma0zsq0ab5qs1ylgl9l5phw91fnpsvb7vjmz2mw3ic964";
+      slk = "0c97pp5iffhdzyma605x8q3rx1qq9pq2h6cai1kppaj92rz3ji9k";
+      slk_frak = "16ivsam1g18zlpw6pgidvzwb7h8rvw1s10nigs6yfwir8hjxsgki";
+      slv = "0644jlm55p0dg4zchgrashmbv36zb4x649ckmf2jkbss8bzx7wsf";
+      snd = "1i2mfi4414l3v9nznjy7959y2jcr8ymvf6w8zpyrw6nad4d1aak7";
+      spa = "15kwvr7cpcnlxm1ja1yyc022dmsd04gmk7h1p0df12aicsscn3qb";
+      spa_old = "1jq80c4mi3rmwnfhb3mbaaq0ci101mgbibkji9ala4l5dkcwjra3";
+      sqi = "19cvvixhz9906p4c9i2grpr386rbp5alp4fp14xm9nd81bmq4701";
+      srp = "1jd25n13h6vxsa3gzbj6q6mdh02rjl4qrd1bffr5psp33asqvw0l";
+      srp_latn = "1k7577mn3z0bm5ma9d8l14sn5wpvw50hq1nxwbc36yn3a5b3mhiz";
+      sun = "0lvlaw3jfvr7b5v09669kq8mm19jdsk9g5h09jsa2gr6fvsq11pa";
+      swa = "0qy9qc5pa1dzzqrh1z40gk845z1r4d2smywnzydknbb3n240lhz0";
+      swe = "1y56r7bgzw0pqkdylbah07r1f0v03sblkggiql8x5200rhaxvqi4";
+      syr = "1vfj5fsiv170jghryrxwyz0i9mdsaki1kglxrklkb2caal9kwy38";
+      tam = "0rhhdbnp0a2hpg00vpc0xyxcl2w36i1kn63mrvwx1f9q7m3y1fmf";
+      tat = "0a74rp8pyp4yivv2xcy2m8xgwch8scr3wmk1fzniwzf43fsrqp76";
+      tel = "0gcq8hxhxvilyh7x7kiikq07hllqysc8sfyr88gvpj4xi092h2bx";
+      tgk = "1458gk0k6gk49n8lr6fj7l7cwkhxn0lrhybzq10zl1ly7yzjhf67";
+      tgl = "12yscwckdy3l21mvsrj1021gxw2isjrg369r08rsf7lh96wn4wkn";
+      tha = "01f0j7gsc5slxaaql1gqbhk4wlwaxc29dlmfxwjzikxc46gjl0w8";
+      tir = "1q6w48b1jchv55713pq20inzjjdymh32fw8wxfaj1qi7bjqfb9fk";
+      ton = "06g60ga8rys8jaimqrvd4svh40qs1nz4bszdnf2hdv05ibryibdq";
+      tur = "0g9g1wvibp61qbriy8ys948yfkl88xk9g8f93bnq8w8dx029b6s8";
+      uig = "09sajx21lw3a3ph62dyqr10pjaq2mij10sdhkhvvjiydk34dn548";
+      ukr = "14q8ls8gkrg7c9pc6qzm6yf5ady3i3303vs1hz4d2idcl6yry334";
+      urd = "15vszhqraxqdcng1069p6i4xq3ck3904q207nkbap6dfpcpjig40";
+      uzb = "03hyw0vavmjirqs4wkd5r85g91w2avsyl14z624fhm3gc66pqg7n";
+      uzb_cyrl = "1433lrrp2lfgb1k0a4sc20b35b2jcl8f1z92vm2936y7w04xpaq7";
+      vie = "02k40d3wji74d1jgvkr3zrn9gpzlmp0lqhrrdmc48r2sgvnrnk8n";
+      yid = "0xnbvi04xv1qapqg72wa3bjwbw51pkdnyncjpjp37vn6dzh04l0z";
+      yor = "07w3aci52ng6i6nyp97q5zb2dqlj08w6im90y1h691qah1x44zlv";
+    };
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/tesseract/tesseract3.nix b/nixpkgs/pkgs/applications/graphics/tesseract/tesseract3.nix
new file mode 100644
index 000000000000..7b9669bc465e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/tesseract/tesseract3.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config
+, leptonica, libpng, libtiff, icu, pango, opencl-headers }:
+
+stdenv.mkDerivation rec {
+  pname = "tesseract";
+  version = "3.05.00";
+
+  src = fetchFromGitHub {
+    owner = "tesseract-ocr";
+    repo = "tesseract";
+    rev = version;
+    sha256 = "11wrpcfl118wxsv2c3w2scznwb48c4547qml42s2bpdz079g8y30";
+  };
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
+  buildInputs = [ leptonica libpng libtiff icu pango opencl-headers ];
+
+  LIBLEPT_HEADERSDIR = "${leptonica}/include";
+
+  meta = {
+    description = "OCR engine";
+    homepage = "https://github.com/tesseract-ocr/tesseract";
+    license = lib.licenses.asl20;
+    maintainers = with lib.maintainers; [ viric earvstedt ];
+    platforms = with lib.platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/tesseract/tesseract4.nix b/nixpkgs/pkgs/applications/graphics/tesseract/tesseract4.nix
new file mode 100644
index 000000000000..49cf93835b10
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/tesseract/tesseract4.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, autoconf-archive, pkg-config
+, leptonica, libpng, libtiff, icu, pango, opencl-headers }:
+
+stdenv.mkDerivation rec {
+  pname = "tesseract";
+  version = "4.1.1";
+
+  src = fetchFromGitHub {
+    owner = "tesseract-ocr";
+    repo = "tesseract";
+    rev = version;
+    sha256 = "1ca27zbjpx35nxh9fha410z3jskwyj06i5hqiqdc08s2d7kdivwn";
+  };
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ pkg-config autoreconfHook autoconf-archive ];
+  buildInputs = [ leptonica libpng libtiff icu pango opencl-headers ];
+
+  meta = {
+    description = "OCR engine";
+    homepage = "https://github.com/tesseract-ocr/tesseract";
+    license = lib.licenses.asl20;
+    maintainers = with lib.maintainers; [ viric earvstedt ];
+    platforms = with lib.platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/tesseract/wrapper.nix b/nixpkgs/pkgs/applications/graphics/tesseract/wrapper.nix
new file mode 100644
index 000000000000..1dfc4393c46b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/tesseract/wrapper.nix
@@ -0,0 +1,58 @@
+{ lib, makeWrapper, tesseractBase, languages
+
+# A list of languages like [ "eng" "spa" … ] or `null` for all available languages
+, enableLanguages ? null
+
+# A list of files or a directory containing files
+, tessdata ? (if enableLanguages == null then languages.all
+              else map (lang: languages.${lang}) enableLanguages)
+
+# This argument is obsolete
+, enableLanguagesHash ? null
+}:
+
+let
+  passthru = { inherit tesseractBase languages tessdata; };
+
+  tesseractWithData = tesseractBase.overrideAttrs (_: {
+    inherit tesseractBase tessdata;
+
+    nativeBuildInputs = [ makeWrapper ];
+
+    buildCommand = ''
+      makeWrapper {$tesseractBase,$out}/bin/tesseract --set-default TESSDATA_PREFIX $out/share/tessdata
+
+      # Recursively link include, share
+      cp -rs --no-preserve=mode $tesseractBase/{include,share} $out
+
+      cp -r --no-preserve=mode $tesseractBase/lib $out
+      # Fixup the store paths in lib so that the tessdata from this derivation is used.
+      if (( ''${#tesseractBase} != ''${#out} )); then
+        echo "Can't replace store paths due to differing lengths"
+        exit 1
+      fi
+      find $out/lib -type f -exec sed -i "s|$tesseractBase|$out|g" {} \;
+
+      if [[ -d "$tessdata" ]]; then
+        ln -s $tessdata/* $out/share/tessdata
+      else
+        for lang in $tessdata; do
+          ln -s $lang $out/share/tessdata/''${lang#/nix/store*-}
+        done
+      fi
+
+      if [[ ! -e $out/share/tessdata/eng.traineddata ]]; then
+         # This is a bug in Tesseract's internal tessdata discovery mechanism
+         echo "eng.traineddata must be present in tessdata for Tesseract to work"
+         exit 1
+      fi
+    '';
+  });
+
+  tesseract = (if enableLanguages == [] then tesseractBase else tesseractWithData) // passthru;
+in
+  if enableLanguagesHash == null then
+    tesseract
+  else
+    lib.warn "Argument `enableLanguagesHash` is obsolete and can be removed."
+    tesseract
diff --git a/nixpkgs/pkgs/applications/graphics/tev/default.nix b/nixpkgs/pkgs/applications/graphics/tev/default.nix
new file mode 100644
index 000000000000..6c9cee851486
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/tev/default.nix
@@ -0,0 +1,58 @@
+{ lib, stdenv, fetchFromGitHub
+, cmake, wrapGAppsHook
+, libX11, libzip, glfw, libpng, xorg, gnome
+}:
+
+stdenv.mkDerivation rec {
+  pname = "tev";
+  version = "1.17";
+
+  src = fetchFromGitHub {
+    owner = "Tom94";
+    repo = pname;
+    rev = "v${version}";
+    fetchSubmodules = true;
+    sha256 = "12wsy2zdfhg0ygkpvz58rk86qiy259fi9grb0jxiz8zcyd6x1ngk";
+  };
+
+  nativeBuildInputs = [ cmake wrapGAppsHook ];
+  buildInputs = [ libX11 libzip glfw libpng ]
+    ++ (with xorg; [ libXrandr libXinerama libXcursor libXi libXxf86vm ]);
+
+  dontWrapGApps = true; # We also need zenity (see below)
+
+  postPatch = ''
+    substituteInPlace CMakeLists.txt \
+      --replace "/usr/" "''${out}/"
+  '';
+
+  cmakeFlags = [
+    "-DTEV_DEPLOY=1" # Only relevant not to append "dev" to the version
+  ];
+
+  postInstall = ''
+    wrapProgram $out/bin/tev \
+      "''${gappsWrapperArgs[@]}" \
+      --prefix PATH ":" "${gnome.zenity}/bin"
+  '';
+
+  meta = with lib; {
+    description = "A high dynamic range (HDR) image comparison tool";
+    longDescription = ''
+      A high dynamic range (HDR) image comparison tool for graphics people. tev
+      allows viewing images through various tonemapping operators and inspecting
+      the values of individual pixels. Often, it is important to find exact
+      differences between pairs of images. For this purpose, tev allows rapidly
+      switching between opened images and visualizing various error metrics (L1,
+      L2, and relative versions thereof). To avoid clutter, opened images and
+      their layers can be filtered by keywords.
+      While the predominantly supported file format is OpenEXR certain other
+      types of images can also be loaded.
+    '';
+    inherit (src.meta) homepage;
+    changelog = "https://github.com/Tom94/tev/releases/tag/v${version}";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ primeos ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/timelapse-deflicker/default.nix b/nixpkgs/pkgs/applications/graphics/timelapse-deflicker/default.nix
new file mode 100644
index 000000000000..c752d7e3f718
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/timelapse-deflicker/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, makeWrapper, perl, perlPackages }:
+
+stdenv.mkDerivation rec {
+  pname = "timelapse-deflicker";
+  version = "0.1.0";
+
+  src = fetchFromGitHub {
+    owner = "cyberang3l";
+    repo = "timelapse-deflicker";
+    rev = "v${version}";
+    sha256 = "0bbfnrdycrpyz7rqrql5ib9qszny7z5xpqp65c1mxqd2876gv960";
+  };
+
+  installPhase = ''
+    install -m755 -D timelapse-deflicker.pl $out/bin/timelapse-deflicker
+    wrapProgram $out/bin/timelapse-deflicker --set PERL5LIB $PERL5LIB
+  '';
+
+  buildInputs = with perlPackages; [
+    makeWrapper perl
+    ImageMagick TermProgressBar ImageExifTool
+    FileType ClassMethodMaker
+  ];
+
+  meta = with lib; {
+    description = "Simple script to deflicker images taken for timelapses";
+    homepage = "https://github.com/cyberang3l/timelapse-deflicker";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ valeriangalliat ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/unigine-valley/default.nix b/nixpkgs/pkgs/applications/graphics/unigine-valley/default.nix
new file mode 100644
index 000000000000..3187f573de70
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/unigine-valley/default.nix
@@ -0,0 +1,115 @@
+{ lib, stdenv, fetchurl
+
+# Build-time dependencies
+, makeWrapper
+, file
+
+# Runtime dependencies
+, fontconfig
+, freetype
+, libX11
+, libXext
+, libXinerama
+, libXrandr
+, libXrender
+, libGL
+, openal}:
+
+let
+  version = "1.0";
+
+  arch = if stdenv.hostPlatform.system == "x86_64-linux" then
+    "x64"
+  else if stdenv.hostPlatform.system == "i686-linux" then
+    "x86"
+  else
+    throw "Unsupported platform ${stdenv.hostPlatform.system}";
+
+in
+  stdenv.mkDerivation rec {
+    pname = "unigine-valley";
+    inherit version;
+
+    src = fetchurl {
+      url = "http://assets.unigine.com/d/Unigine_Valley-${version}.run";
+      sha256 = "5f0c8bd2431118551182babbf5f1c20fb14e7a40789697240dcaf546443660f4";
+    };
+
+    sourceRoot = "Unigine_Valley-${version}";
+    instPath = "lib/unigine/valley";
+
+    nativeBuildInputs = [file makeWrapper];
+
+    libPath = lib.makeLibraryPath [
+      stdenv.cc.cc  # libstdc++.so.6
+      fontconfig
+      freetype
+      libX11
+      libXext
+      libXinerama
+      libXrandr
+      libXrender
+      libGL
+      openal
+    ];
+
+    unpackPhase = ''
+      runHook preUnpack
+
+      cp $src extractor.run
+      chmod +x extractor.run
+      ./extractor.run --target $sourceRoot
+
+      runHook postUnpack
+    '';
+
+    patchPhase = ''
+      runHook prePatch
+
+      # Patch ELF files.
+      elfs=$(find bin -type f | xargs file | grep ELF | cut -d ':' -f 1)
+      for elf in $elfs; do
+        patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 $elf || true
+      done
+
+      runHook postPatch
+    '';
+
+    installPhase = ''
+      runHook preInstall
+
+      instdir=$out/${instPath}
+
+      # Install executables and libraries
+      mkdir -p $instdir/bin
+      install -m 0755 bin/browser_${arch} $instdir/bin
+      install -m 0755 bin/libApp{Stereo,Surround,Wall}_${arch}.so $instdir/bin
+      install -m 0755 bin/libGPUMonitor_${arch}.so $instdir/bin
+      install -m 0755 bin/libQt{Core,Gui,Network,WebKit,Xml}Unigine_${arch}.so.4 $instdir/bin
+      install -m 0755 bin/libUnigine_${arch}.so $instdir/bin
+      install -m 0755 bin/valley_${arch} $instdir/bin
+      install -m 0755 valley $instdir
+
+      # Install other files
+      cp -R data documentation $instdir
+
+      # Install and wrap executable
+      mkdir -p $out/bin
+      install -m 0755 valley $out/bin/valley
+      wrapProgram $out/bin/valley \
+        --run "cd $instdir" \
+        --prefix LD_LIBRARY_PATH : /run/opengl-driver/lib:$instdir/bin:$libPath
+
+      runHook postInstall
+    '';
+
+    stripDebugList = ["${instPath}/bin"];
+
+    meta = {
+      description = "The Unigine Valley GPU benchmarking tool";
+      homepage = "https://unigine.com/products/benchmarks/valley/";
+      license = lib.licenses.unfree; # see also: $out/$instPath/documentation/License.pdf
+      maintainers = [ lib.maintainers.kierdavis ];
+      platforms = ["x86_64-linux" "i686-linux"];
+    };
+  }
diff --git a/nixpkgs/pkgs/applications/graphics/veusz/default.nix b/nixpkgs/pkgs/applications/graphics/veusz/default.nix
new file mode 100644
index 000000000000..d8f1ae76a887
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/veusz/default.nix
@@ -0,0 +1,71 @@
+{ python3Packages
+, qtbase
+, ghostscript
+, wrapQtAppsHook
+, lib
+}:
+
+python3Packages.buildPythonApplication rec {
+  pname = "veusz";
+  version = "3.3.1";
+
+  src = python3Packages.fetchPypi {
+    inherit pname version;
+    sha256 = "4ClgYwiU21wHDve2q9cItSAVb9hbR2F+fJc8znGI8OA=";
+  };
+
+  nativeBuildInputs = [ wrapQtAppsHook python3Packages.sip_4 ];
+
+  buildInputs = [ qtbase ];
+
+  # veusz is a script and not an ELF-executable, so wrapQtAppsHook will not wrap
+  # it automatically -> we have to do it explicitly
+  dontWrapQtApps = true;
+  preFixup = ''
+    wrapQtApp "$out/bin/veusz"
+  '';
+
+  # Since sip 6 (we use sip 4 here, but pyqt5 is built with sip 6), sip files are
+  # placed in a different directory layout and --sip-dir won't work anymore.
+  # --sip-dir expects a directory with a PyQt5 subdirectory (where sip files are located),
+  # but the new directory layout places sip files in a subdirectory named 'bindings'.
+  # To workaround this, we patch the full path into pyqtdistutils.py.
+  postPatch = ''
+    substituteInPlace pyqtdistutils.py \
+      --replace "'-I', pyqt5_include_dir," "'-I', '${python3Packages.pyqt5}/${python3Packages.python.sitePackages}/PyQt5/bindings',"
+    patchShebangs tests/runselftest.py
+  '';
+
+  # you can find these options at
+  # https://github.com/veusz/veusz/blob/53b99dffa999f2bc41fdc5335d7797ae857c761f/pyqtdistutils.py#L71
+  # --sip-dir cannot be used here for the reasons explained above
+  setupPyBuildFlags = [
+    "--qt-include-dir=${qtbase.dev}/include"
+    # veusz tries to find a libinfix and fails without one
+    # but we simply don't need a libinfix, so set it to empty here
+    "--qt-libinfix="
+  ];
+
+  propagatedBuildInputs = with python3Packages; [
+    numpy
+    pyqt5
+    # optional requirements:
+    dbus-python
+    h5py
+    # astropy -- fails to build on master
+    # optional TODO: add iminuit, pyemf and sampy
+  ];
+
+  installCheckPhase = ''
+    wrapQtApp "tests/runselftest.py"
+    QT_QPA_PLATFORM=minimal tests/runselftest.py
+  '';
+
+  meta = with lib; {
+    description = "A scientific plotting and graphing program with a GUI";
+    homepage = "https://veusz.github.io/";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ laikq ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/viewnior/default.nix b/nixpkgs/pkgs/applications/graphics/viewnior/default.nix
new file mode 100644
index 000000000000..fc39306b7535
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/viewnior/default.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv, fetchFromGitHub, meson, ninja, pkg-config, desktop-file-utils, gtk2, libpng, exiv2, lcms
+, intltool, gettext, shared-mime-info, glib, gdk-pixbuf, perl}:
+
+stdenv.mkDerivation rec {
+  pname = "viewnior";
+  version = "1.7";
+
+  src = fetchFromGitHub {
+    owner = "hellosiyan";
+    repo = "Viewnior";
+    rev = "${pname}-${version}";
+    sha256 = "0y4hk3vq8psba5k615w18qj0kbdfp5w0lm98nv5apy6hmcpwfyig";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    desktop-file-utils
+    intltool
+    gettext
+  ];
+
+  buildInputs = [
+    gtk2
+    libpng
+    exiv2
+    lcms
+    shared-mime-info
+    glib
+    gdk-pixbuf
+    perl
+  ];
+
+  meta = with lib; {
+    description = "Fast and simple image viewer";
+    longDescription =
+      '' Viewnior is insipred by big projects like Eye of Gnome, because of it's
+         usability and richness,and by GPicView, because of it's lightweight design and
+         minimal interface. So here comes Viewnior - small and light, with no compromise
+         with the quality of it's functions. The program is made with better integration
+         in mind (follows Gnome HIG2).
+      '';
+    license = licenses.gpl3;
+    homepage = "http://siyanpanayotov.com/project/viewnior/";
+    maintainers = with maintainers; [ smironov artturin ];
+    platforms = platforms.gnu ++ platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/vimiv-qt/default.nix b/nixpkgs/pkgs/applications/graphics/vimiv-qt/default.nix
new file mode 100644
index 000000000000..8e0caff1d175
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/vimiv-qt/default.nix
@@ -0,0 +1,49 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, python3
+, qt5
+, installShellFiles
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "vimiv-qt";
+  version = "0.8.0";
+
+  src = fetchFromGitHub {
+    owner = "karlch";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1pj3gak7nxkw9r9m71zsfvcaq8dk9crbk5rz4n7pravxkl5hs2bg";
+  };
+
+  nativeBuildInputs = [ installShellFiles qt5.wrapQtAppsHook python3.pkgs.setuptools ];
+
+  propagatedBuildInputs = with python3.pkgs; [ pyqt5 py3exiv2 qt5.qtsvg ];
+
+  postInstall = ''
+    install -Dm644 misc/vimiv.desktop $out/share/applications/vimiv.desktop
+    install -Dm644 misc/org.karlch.vimiv.qt.metainfo.xml $out/metainfo/org.karlch.vimiv.qt.metainfo.xml
+    install -Dm644 LICENSE $out/licenses/vimiv/LICENSE
+    install -Dm644 icons/vimiv.svg $out/icons/hicolor/scalable/apps/vimiv.svg
+    installManPage misc/vimiv.1
+
+    for i in 16 32 64 128 256 512; do
+      install -Dm644 icons/vimiv_''${i}x''${i}.png $out/icons/hicolor/''${i}x''${i}/apps/vimiv.png
+    done
+  '';
+
+  # Vimiv has to be wrapped manually because it is a non-ELF executable.
+  dontWrapQtApps = true;
+  preFixup = ''
+      wrapQtApp $out/bin/vimiv
+  '';
+
+  meta = with lib; {
+    description = "Image viewer with Vim-like keybindings (Qt port)";
+    license = licenses.gpl3Plus;
+    homepage = "https://github.com/karlch/vimiv-qt";
+    maintainers = with maintainers; [ dschrempf ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/vimiv/default.nix b/nixpkgs/pkgs/applications/graphics/vimiv/default.nix
new file mode 100644
index 000000000000..a6320f774fd5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/vimiv/default.nix
@@ -0,0 +1,73 @@
+{ lib, python3Packages, fetchFromGitHub, imagemagick, librsvg, gtk3, jhead
+, gnome
+
+# Test requirements
+, dbus, xvfb-run, xdotool
+}:
+
+python3Packages.buildPythonApplication rec {
+  pname = "vimiv";
+  version = "0.7.3";
+
+  src = fetchFromGitHub {
+    owner = "karlch";
+    repo = "vimiv";
+    rev = "v${version}";
+    sha256 = "18dn81n8hcrqhrqfida34qz7a0ar9rz2rrmzsvyp54zc6nyvv1cn";
+  };
+
+  testimages = fetchFromGitHub {
+    owner = "karlch";
+    repo = "vimiv";
+    rev = "6f4d1372b27f2065c56eafdb521d230d9bb8f4e2";
+    sha256 = "0a3aybzpms0381dz9japhm4c7j5klhmw91prcac6zaww6x34nmxb";
+  };
+
+  postPatch = ''
+    patchShebangs scripts/install_icons.sh
+    sed -i -e 's,/usr,,g' -e '/setup\.py/d' Makefile scripts/install_icons.sh
+
+    sed -i \
+      -e 's,/etc/vimiv/\(vimivrc\|keys\.conf\),'"$out"'&,g' \
+      man/* vimiv/parser.py
+
+    sed -i \
+      -e 's!"mogrify"!"${imagemagick}/bin/mogrify"!g' \
+      -e '/cmd *=/s!"jhead"!"${jhead}/bin/jhead"!g' \
+      vimiv/imageactions.py
+  '';
+
+  checkInputs = [ python3Packages.nose dbus.daemon xvfb-run xdotool ];
+  buildInputs = [ gnome.adwaita-icon-theme librsvg ];
+  propagatedBuildInputs = with python3Packages; [ pillow pygobject3 gtk3 ];
+
+  makeWrapperArgs = [
+    "--prefix GI_TYPELIB_PATH : \"$GI_TYPELIB_PATH\""
+    "--suffix XDG_DATA_DIRS : \"$XDG_ICON_DIRS:$out/share\""
+    "--set GDK_PIXBUF_MODULE_FILE \"$GDK_PIXBUF_MODULE_FILE\""
+  ];
+
+  postCheck = ''
+    # Some tests assume that the directory only contains one vimiv directory
+    rm -rf vimiv.egg-info vimiv.desktop
+
+    # Re-use the wrapper args from the main program
+    makeWrapper "$SHELL" run-tests $makeWrapperArgs
+
+    cp -Rd --no-preserve=mode "$testimages/testimages" vimiv/testimages
+    HOME="$(mktemp -d)" PATH="$out/bin:$PATH" \
+      xvfb-run -s '-screen 0 800x600x24' dbus-run-session \
+      --config-file=${dbus.daemon}/share/dbus-1/session.conf \
+      ./run-tests -c 'python tests/main_test.py && nosetests -vx'
+  '';
+
+  postInstall = "make DESTDIR=\"$out\" install";
+
+  meta = {
+    homepage = "https://github.com/karlch/vimiv";
+    description = "An image viewer with Vim-like keybindings";
+    license = lib.licenses.mit;
+    platforms = lib.platforms.linux;
+    broken = true;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/weylus/default.nix b/nixpkgs/pkgs/applications/graphics/weylus/default.nix
new file mode 100644
index 000000000000..54b86c09341e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/weylus/default.nix
@@ -0,0 +1,58 @@
+{ lib
+, dbus
+, stdenv
+, gst_all_1
+, xorg
+, libdrm
+, libva
+, fetchzip
+, copyDesktopItems
+, fontconfig
+, libpng
+, autoPatchelfHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "weylus";
+  version = "0.11.2";
+
+  src = fetchzip {
+    url = "https://github.com/H-M-H/Weylus/releases/download/v${version}/linux.zip";
+    sha256 = "sha256-coA8qUpUgRjVBF/0LZgimx61fTTpdck/AO6e+r2uNu0=";
+    stripRoot = false;
+  };
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm755 ./weylus $out/bin/weylus
+    copyDesktopItems ./weylus.desktop
+
+    runHook postInstall
+  '';
+
+  buildInputs = [
+    libpng
+    dbus
+    libdrm
+    fontconfig
+    libva
+    gst_all_1.gst-plugins-base
+    # autoPatchelfHook complains if these are missing, even on wayland
+    xorg.libXft
+    xorg.libXinerama
+    xorg.libXcursor
+    xorg.libXrandr
+    xorg.libXcomposite
+    xorg.libXtst
+  ];
+
+  nativeBuildInputs = [ copyDesktopItems autoPatchelfHook ];
+
+  meta = with lib; {
+    description = "Use your tablet as graphic tablet/touch screen on your computer";
+    homepage = "https://github.com/H-M-H/Weylus";
+    license = with licenses; [ agpl3Only ];
+    maintainers = with maintainers; [ legendofmiracles ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/wings/default.nix b/nixpkgs/pkgs/applications/graphics/wings/default.nix
new file mode 100644
index 000000000000..ef8d4b5096e6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/wings/default.nix
@@ -0,0 +1,45 @@
+{ fetchurl, lib, stdenv, erlang, cl, libGL, libGLU, runtimeShell }:
+
+stdenv.mkDerivation rec {
+  name = "wings-2.2.4";
+  src = fetchurl {
+    url = "mirror://sourceforge/wings/${name}.tar.bz2";
+    sha256 = "1xcmifs4vq2810pqqvsjsm8z3lz24ys4c05xkh82nyppip2s89a3";
+  };
+
+  ERL_LIBS = "${cl}/lib/erlang/lib";
+
+  patchPhase = ''
+    sed -i 's,-Werror ,,' e3d/Makefile
+    sed -i 's,../../wings/,../,' icons/Makefile
+    find plugins_src -mindepth 2 -type f -name "*.[eh]rl" -exec sed -i 's,wings/src/,../../src/,' {} \;
+    find plugins_src -mindepth 2 -type f -name "*.[eh]rl" -exec sed -i 's,wings/e3d/,../../e3d/,' {} \;
+    find plugins_src -mindepth 2 -type f -name "*.[eh]rl" -exec sed -i 's,wings/intl_tools/,../../intl_tools/,' {} \;
+    find . -type f -name "*.[eh]rl" -exec sed -i 's,wings/src/,../src/,' {} \;
+    find . -type f -name "*.[eh]rl" -exec sed -i 's,wings/e3d/,../e3d/,' {} \;
+    find . -type f -name "*.[eh]rl" -exec sed -i 's,wings/intl_tools/,../intl_tools/,' {} \;
+  '';
+
+  buildInputs = [ erlang cl libGL libGLU ];
+
+  # I did not test the *cl* part. I added the -pa just by imitation.
+  installPhase = ''
+    mkdir -p $out/bin $out/lib/${name}/ebin
+    cp ebin/* $out/lib/${name}/ebin
+    cp -R textures shaders plugins $out/lib/$name
+    cat << EOF > $out/bin/wings
+    #!${runtimeShell}
+    ${erlang}/bin/erl \
+      -pa $out/lib/${name}/ebin -run wings_start start_halt "$@"
+    EOF
+    chmod +x $out/bin/wings
+  '';
+
+  meta = {
+    homepage = "http://www.wings3d.com/";
+    description = "Subdivision modeler inspired by Nendo and Mirai from Izware";
+    license = lib.licenses.tcltk;
+    maintainers = with lib.maintainers; [viric];
+    platforms = with lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/write_stylus/default.nix b/nixpkgs/pkgs/applications/graphics/write_stylus/default.nix
new file mode 100644
index 000000000000..65f6c46f7daf
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/write_stylus/default.nix
@@ -0,0 +1,61 @@
+{ mkDerivation, stdenv, lib, qtbase, qtsvg, libglvnd, libX11, libXi, fetchurl, makeDesktopItem }:
+let
+  desktopItem = makeDesktopItem {
+    name = "Write";
+    exec = "Write";
+    comment = "A word processor for handwriting";
+    icon = "write_stylus";
+    desktopName = "Write";
+    genericName = "Write";
+    categories = "Office;Graphics";
+  };
+in
+mkDerivation rec {
+  pname = "write_stylus";
+  version = "300";
+
+  src = fetchurl {
+    url = "http://www.styluslabs.com/write/write${version}.tar.gz";
+    sha256 = "0h1wf3af7jzp3f3l8mlnshi83d7a4v4y8nfqfai4lmskyicqlz7c";
+  };
+
+  sourceRoot = ".";
+
+  dontBuild = true;
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp -R Write $out/
+    # symlink the binary to bin/
+    ln -s $out/Write/Write $out/bin/Write
+
+    # Create desktop item
+    mkdir -p $out/share/applications
+    ln -s ${desktopItem}/share/applications/* $out/share/applications/
+    mkdir -p $out/share/icons
+    ln -s $out/Write/Write144x144.png $out/share/icons/write_stylus.png
+  '';
+  preFixup = let
+    libPath = lib.makeLibraryPath [
+      qtbase            # libQt5PrintSupport.so.5
+      qtsvg             # libQt5Svg.so.5
+      stdenv.cc.cc.lib  # libstdc++.so.6
+      libglvnd          # libGL.so.1
+      libX11            # libX11.so.6
+      libXi             # libXi.so.6
+    ];
+  in ''
+    patchelf \
+      --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+      --set-rpath "${libPath}" \
+      $out/Write/Write
+  '';
+
+  meta = with lib; {
+    homepage = "http://www.styluslabs.com/";
+    description = "Write is a word processor for handwriting";
+    platforms = platforms.linux;
+    license = lib.licenses.unfree;
+    maintainers = with maintainers; [ oyren ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/xaos/default.nix b/nixpkgs/pkgs/applications/graphics/xaos/default.nix
new file mode 100644
index 000000000000..15c2d468fb4f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/xaos/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, aalib, gsl, libpng, libX11, xorgproto, libXext
+, libXt, zlib, gettext, intltool, perl }:
+
+stdenv.mkDerivation rec {
+  pname = "xaos";
+  version = "3.6";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/xaos/${pname}-${version}.tar.gz";
+    sha256 = "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq";
+  };
+
+  hardeningDisable = [ "format" ];
+
+  buildInputs = [
+    aalib gsl libpng libX11 xorgproto libXext
+    libXt zlib gettext intltool perl
+  ];
+
+  preConfigure = ''
+    sed -e s@/usr/@"$out/"@g -i configure $(find . -name 'Makefile*')
+    mkdir -p $out/share/locale
+  '';
+
+  meta = {
+    homepage = "http://xaos.sourceforge.net/";
+    description = "Fractal viewer";
+    license = lib.licenses.gpl2Plus;
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/xfig/default.nix b/nixpkgs/pkgs/applications/graphics/xfig/default.nix
new file mode 100644
index 000000000000..dc98d761bf08
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/xfig/default.nix
@@ -0,0 +1,58 @@
+{ lib
+, stdenv
+, fetchurl
+, xlibsWrapper
+, makeWrapper
+, libXpm
+, libXmu
+, libXi
+, libXp
+, Xaw3d
+, libXaw
+, fig2dev
+}:
+
+stdenv.mkDerivation rec {
+  pname = "xfig";
+  version = "3.2.8b";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/mcj/xfig-${version}.tar.xz";
+    sha256 = "0fndgbm1mkqb1sn2v2kj3nx9mxj70jbp31y2bjvzcmmkry0q3k5j";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  buildInputs = [
+    xlibsWrapper
+    libXpm
+    libXmu
+    libXi
+    libXp
+    Xaw3d
+    libXaw
+  ];
+
+  postPatch = ''
+    sed -i 's:"fig2dev":"${fig2dev}/bin/fig2dev":' src/main.c
+  '';
+
+  postInstall = ''
+    mkdir -p $out/share/X11/app-defaults
+    cp app-defaults/* $out/share/X11/app-defaults
+
+    wrapProgram $out/bin/xfig \
+      --set XAPPLRESDIR $out/share/X11/app-defaults
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "An interactive drawing tool for X11";
+    longDescription = ''
+      Note that you need to have the <literal>netpbm</literal> tools
+      in your path to export bitmaps.
+    '';
+    inherit (fig2dev.meta) license homepage platforms maintainers;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/xfractint/default.nix b/nixpkgs/pkgs/applications/graphics/xfractint/default.nix
new file mode 100644
index 000000000000..c43127bfa993
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/xfractint/default.nix
@@ -0,0 +1,28 @@
+{lib, stdenv, fetchurl, libX11, libXft}:
+stdenv.mkDerivation rec {
+  pname = "xfractint";
+  version = "20.04p16";
+  # or fetchFromGitHub(owner,repo,rev) or fetchgit(rev)
+  src = fetchurl {
+    url = "https://www.fractint.net/ftp/current/linux/xfractint-${version}.tar.gz";
+    sha256 = "1ba77jifxv8jql044mdydh4p4ms4w5vw3qrqmcfzlvqfxk7h2m2f";
+  };
+
+  buildInputs = [libX11 libXft];
+
+  configurePhase = ''
+    sed -e 's@/usr/bin/@@' -i Makefile
+  '';
+
+  makeFlags = ["PREFIX=$(out)"];
+
+  meta = {
+    description = "";
+    # Code cannot be used in commercial programs
+    # Looks like the definition hinges on the price, not license
+    license = lib.licenses.unfree;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.linux;
+    homepage = "https://www.fractint.net/";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/xlife/default.nix b/nixpkgs/pkgs/applications/graphics/xlife/default.nix
new file mode 100644
index 000000000000..482134269d2b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/xlife/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchsvn, xorg }:
+
+stdenv.mkDerivation {
+  pname = "xlife";
+  version = "6.7.5";
+
+  src = fetchsvn {
+    url = "https://svn.code.sf.net/p/xlife-cal/xlife/trunk";
+    rev = "365";
+    sha256 = "1gadlcp32s179kd7ypxr8cymd6s060p6z4c2vnx94i8bmiw3nn8h";
+  };
+
+  nativeBuildInputs = with xorg; [ imake gccmakedep ];
+  buildInputs = [ xorg.libX11 ];
+
+  hardeningDisable = [ "format" ];
+  installPhase = ''
+    install -Dm755 xlife -t $out/bin
+    install -Dm755 lifeconv -t $out/bin
+  '';
+
+  meta = with lib; {
+    homepage = "http://litwr2.atspace.eu/xlife.php";
+    description = "Conway's Game of Life and other cellular automata, for X";
+    license = licenses.hpndSellVariant;
+    maintainers = with maintainers; [ djanatyn ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/xmountains/default.nix b/nixpkgs/pkgs/applications/graphics/xmountains/default.nix
new file mode 100644
index 000000000000..c31f7923c990
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/xmountains/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub, xlibsWrapper, xorg }:
+
+stdenv.mkDerivation rec {
+  pname = "xmountains";
+  version = "2.10";
+
+  src = fetchFromGitHub {
+    owner = "spbooth";
+    repo = pname;
+    rev = "aa3bcbfed228adf3fff0fe4295589f13fc194f0b";
+    sha256 = "0dx4n2y736lv04sj41cp1dw8n5zkw5gyd946a6zsiv0k796s9ra9";
+  };
+
+  buildInputs = [ xlibsWrapper xorg.xbitmaps ];
+  nativeBuildInputs = with xorg; [ imake gccmakedep ];
+
+  installPhase = "install -Dm755 xmountains -t $out/bin";
+
+  meta = with lib; {
+    description = "X11 based fractal landscape generator";
+    homepage = "https://spbooth.github.io/xmountains";
+    license = licenses.hpndSellVariant;
+    maintainers = with maintainers; [ djanatyn ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/xournal/default.nix b/nixpkgs/pkgs/applications/graphics/xournal/default.nix
new file mode 100644
index 000000000000..7d9ab53bef8b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/xournal/default.nix
@@ -0,0 +1,65 @@
+{ lib, stdenv, fetchurl, makeDesktopItem
+, ghostscript, atk, gtk2, glib, fontconfig, freetype
+, libgnomecanvas, libgnomeprint, libgnomeprintui
+, pango, libX11, xorgproto, zlib, poppler
+, autoconf, automake, libtool, pkg-config}:
+
+let
+  isGdkQuartzBackend = (gtk2.gdktarget == "quartz");
+in
+
+stdenv.mkDerivation rec {
+  version = "0.4.8.2016";
+  name = "xournal-" + version;
+  src = fetchurl {
+    url = "mirror://sourceforge/xournal/${name}.tar.gz";
+    sha256 = "09i88v3wacmx7f96dmq0l3afpyv95lh6jrx16xzm0jd1szdrhn5j";
+  };
+
+  buildInputs = [
+    ghostscript atk gtk2 glib fontconfig freetype
+    libgnomecanvas
+    pango libX11 xorgproto zlib poppler
+  ] ++ lib.optionals (!stdenv.isDarwin) [
+    libgnomeprint libgnomeprintui
+  ];
+
+  nativeBuildInputs = [ autoconf automake libtool pkg-config ];
+
+  NIX_LDFLAGS = "-lz"
+    + lib.optionalString (!isGdkQuartzBackend) " -lX11";
+
+  desktopItem = makeDesktopItem {
+    name = name;
+    exec = "xournal";
+    icon = "xournal";
+    desktopName = "Xournal";
+    comment = meta.description;
+    categories = "Office;Graphics;";
+    mimeType = "application/pdf;application/x-xoj";
+    genericName = "PDF Editor";
+  };
+
+  postInstall=''
+      mkdir --parents $out/share/mime/packages
+      cat << EOF > $out/share/mime/packages/xournal.xml
+      <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
+         <mime-type type="application/x-xoj">
+          <comment>Xournal Document</comment>
+          <glob pattern="*.xoj"/>
+         </mime-type>
+      </mime-info>
+      EOF
+      cp --recursive ${desktopItem}/share/applications $out/share
+      mkdir --parents $out/share/icons
+      cp $out/share/xournal/pixmaps/xournal.png $out/share/icons
+  '';
+
+  meta = with lib; {
+    homepage = "http://xournal.sourceforge.net/";
+    description = "Note-taking application (supposes stylus)";
+    maintainers = [ maintainers.guibert ];
+    license = licenses.gpl2;
+    platforms = with platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/xournalpp/default.nix b/nixpkgs/pkgs/applications/graphics/xournalpp/default.nix
new file mode 100644
index 000000000000..16544c85650a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/xournalpp/default.nix
@@ -0,0 +1,62 @@
+{ lib, stdenv
+, fetchFromGitHub
+
+, cmake
+, gettext
+, wrapGAppsHook
+, pkg-config
+
+, glib
+, gsettings-desktop-schemas
+, gtk3
+, librsvg
+, libsndfile
+, libxml2
+, libzip
+, pcre
+, poppler
+, portaudio
+, zlib
+# plugins
+, withLua ? true, lua
+}:
+
+stdenv.mkDerivation rec {
+  pname = "xournalpp";
+  version = "1.1.0";
+
+  src = fetchFromGitHub {
+    owner = "xournalpp";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-FIIpWgWvq1uo/lIQXpOkUTZ6YJPtOtxKF8VjXSgqrlE=";
+  };
+
+  nativeBuildInputs = [ cmake gettext pkg-config wrapGAppsHook ];
+  buildInputs =
+    [ glib
+      gsettings-desktop-schemas
+      gtk3
+      librsvg
+      libsndfile
+      libxml2
+      libzip
+      pcre
+      poppler
+      portaudio
+      zlib
+    ]
+    ++ lib.optional withLua lua;
+
+  buildFlags = "translations";
+
+  hardeningDisable = [ "format" ];
+
+  meta = with lib; {
+    description = "Xournal++ is a handwriting Notetaking software with PDF annotation support";
+    homepage    = "https://xournalpp.github.io/";
+    license     = licenses.gpl2Plus;
+    maintainers = with maintainers; [ andrew-d sikmir ];
+    platforms   = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/xrgears/default.nix b/nixpkgs/pkgs/applications/graphics/xrgears/default.nix
new file mode 100644
index 000000000000..20e01a1701da
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/xrgears/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv
+, fetchFromGitLab
+, glm
+, glslang
+, meson
+, ninja
+, openxr-loader
+, pkg-config
+, vulkan-headers
+, vulkan-loader
+, xxd
+}:
+
+stdenv.mkDerivation rec {
+  pname = "xrgears";
+  version = "unstable-2020-04-15";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.freedesktop.org";
+    owner = "monado";
+    repo = "demos/xrgears";
+    rev = "d0bee35fbf8f181e8313f1ead13d88c4fb85c154";
+    sha256 = "1k0k8dkclyiav99kf0933kyd2ymz3hs1p0ap2wbciq9s62jgz29i";
+  };
+
+  nativeBuildInputs = [
+    glslang
+    meson
+    ninja
+    pkg-config
+    xxd
+  ];
+
+  buildInputs = [
+    glm
+    openxr-loader
+    vulkan-headers
+    vulkan-loader
+  ];
+
+  meta = with lib; {
+    homepage = "https://gitlab.freedesktop.org/monado/demos/xrgears";
+    description = "An OpenXR example using Vulkan for rendering";
+    platforms = platforms.linux;
+    license = licenses.mit;
+    maintainers = with maintainers; [ expipiplus1 ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/xzgv/default.nix b/nixpkgs/pkgs/applications/graphics/xzgv/default.nix
new file mode 100644
index 000000000000..d26f6eccf76a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/xzgv/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl, gtk2, libexif, pkg-config, texinfo }:
+
+stdenv.mkDerivation rec {
+  pname = "xzgv";
+  version = "0.9.2";
+  src = fetchurl {
+    url = "mirror://sourceforge/xzgv/xzgv-${version}.tar.gz";
+    sha256 = "17l1xr9v07ggwga3vn0z1i4lnwjrr20rr8z1kjbw71aaijxl18i5";
+  };
+  nativeBuildInputs = [ pkg-config texinfo ];
+  buildInputs = [ gtk2 libexif ];
+  postPatch = ''
+    substituteInPlace config.mk \
+      --replace /usr/local $out
+    substituteInPlace Makefile \
+      --replace "all: src man" "all: src man info"
+  '';
+  preInstall = ''
+    mkdir -p $out/share/{app-install/desktop,applications,info,pixmaps}
+  '';
+  meta = with lib; {
+    homepage = "https://sourceforge.net/projects/xzgv/";
+    description = "Picture viewer for X with a thumbnail-based selector";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.womfoo ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/yacreader/default.nix b/nixpkgs/pkgs/applications/graphics/yacreader/default.nix
new file mode 100644
index 000000000000..0a25889c2dcd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/yacreader/default.nix
@@ -0,0 +1,26 @@
+{ mkDerivation, lib, fetchFromGitHub, qmake, poppler, pkg-config, libunarr
+, libGLU, qtdeclarative, qtgraphicaleffects, qtmultimedia, qtquickcontrols
+, qtscript
+}:
+
+mkDerivation rec {
+  pname = "yacreader";
+  version = "9.8.2";
+
+  src = fetchFromGitHub {
+    owner = "YACReader";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-Xvf0xXtMs3x1fPgAvS4GJXrZgDZWhzIgrOF4yECr7/g=";
+  };
+
+  nativeBuildInputs = [ qmake pkg-config ];
+  buildInputs = [ poppler libunarr libGLU qtmultimedia qtscript ];
+  propagatedBuildInputs = [ qtquickcontrols qtgraphicaleffects qtdeclarative ];
+
+  meta = {
+    description = "A comic reader for cross-platform reading and managing your digital comic collection";
+    homepage = "http://www.yacreader.com";
+    license = lib.licenses.gpl3;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/yed/default.nix b/nixpkgs/pkgs/applications/graphics/yed/default.nix
new file mode 100644
index 000000000000..d2873f641428
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/yed/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchzip, makeWrapper, unzip, jre, wrapGAppsHook }:
+
+stdenv.mkDerivation rec {
+  pname = "yEd";
+  version = "3.21.1";
+
+  src = fetchzip {
+    url = "https://www.yworks.com/resources/yed/demo/${pname}-${version}.zip";
+    sha256 = "1jw28hkd7p0n660gid8yh5y0kdcz6ycn4hsgjlf0pq48x9kv6w0c";
+  };
+
+  nativeBuildInputs = [ makeWrapper unzip wrapGAppsHook ];
+  # For wrapGAppsHook setup hook
+  buildInputs = [ (jre.gtk3 or null) ];
+
+  dontConfigure = true;
+  dontBuild = true;
+  dontInstall = true;
+
+  preFixup = ''
+    mkdir -p $out/yed
+    cp -r * $out/yed
+    mkdir -p $out/bin
+
+    makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
+    makeWrapper ${jre}/bin/java $out/bin/yed \
+      ''${makeWrapperArgs[@]} \
+      --add-flags "-jar $out/yed/yed.jar --"
+  '';
+  dontWrapGApps = true;
+
+  meta = with lib; {
+    license = licenses.unfree;
+    homepage = "https://www.yworks.com/products/yed";
+    description = "A powerful desktop application that can be used to quickly and effectively generate high-quality diagrams";
+    platforms = jre.meta.platforms;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/yeetgif/default.nix b/nixpkgs/pkgs/applications/graphics/yeetgif/default.nix
new file mode 100644
index 000000000000..84bcdee5b76e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/yeetgif/default.nix
@@ -0,0 +1,22 @@
+{ buildGoPackage, fetchFromGitHub, lib }:
+
+buildGoPackage rec {
+  pname = "yeetgif";
+  version = "1.23.6";
+
+  goPackagePath = "github.com/sgreben/yeetgif";
+
+  src = fetchFromGitHub {
+    owner = "sgreben";
+    repo = pname;
+    rev = version;
+    sha256 = "05z1ylsra60bb4cvr383g9im94zsph1dgicqbv5p73qgs634ckk7";
+  };
+
+  meta = with lib; {
+    description = "gif effects CLI. single binary, no dependencies. linux, osx, windows. #1 workplace productivity booster. #yeetgif #eggplant #golang";
+    homepage = "https://github.com/sgreben/yeetgif";
+    license = with licenses; [ mit asl20 cc-by-nc-sa-40 ];
+    maintainers = with maintainers; [ ajs124 ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/zgrviewer/default.nix b/nixpkgs/pkgs/applications/graphics/zgrviewer/default.nix
new file mode 100644
index 000000000000..b5fc70494fcd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/zgrviewer/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, jre, unzip, runtimeShell }:
+stdenv.mkDerivation rec {
+  version = "0.9.0";
+  pname = "zgrviewer";
+  src = fetchurl {
+    url = "mirror://sourceforge/zvtm/${pname}/${version}/${pname}-${version}.zip";
+    sha256 = "1yg2rck81sqqrgfi5kn6c1bz42dr7d0zqpcsdjhicssi1y159f23";
+  };
+  nativeBuildInputs = [ unzip ];
+  buildInputs = [jre];
+  buildPhase = "";
+  installPhase = ''
+    mkdir -p "$out"/{bin,share/java/zvtm/plugins,share/doc/zvtm}
+
+    cp overview.html *.license.* "$out/share/doc/zvtm"
+
+    cp -r target/* "$out/share/java/zvtm/"
+
+    echo '#!${runtimeShell}' > "$out/bin/zgrviewer"
+    echo "${jre}/bin/java -jar '$out/share/java/zvtm/zgrviewer-${version}.jar' \"\$@\"" >> "$out/bin/zgrviewer"
+    chmod a+x "$out/bin/zgrviewer"
+  '';
+  meta = {
+    # Quicker to unpack locally than load Hydra
+    hydraPlatforms = [];
+    maintainers = with lib.maintainers; [raskin];
+    license = lib.licenses.lgpl21Plus;
+    description = "GraphViz graph viewer/navigator";
+    platforms = with lib.platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/zgv/default.nix b/nixpkgs/pkgs/applications/graphics/zgv/default.nix
new file mode 100644
index 000000000000..a4e5e725490f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/zgv/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchurl, fetchpatch, pkg-config, SDL, SDL_image, libjpeg, libpng, libtiff }:
+
+stdenv.mkDerivation rec {
+  pname = "zgv";
+  version = "5.9";
+  src = fetchurl {
+    url = "https://www.svgalib.org/rus/zgv/${pname}-${version}.tar.gz";
+    sha256 = "1fk4i9x0cpnpn3llam0zy2pkmhlr2hy3iaxhxg07v9sizd4dircj";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ SDL SDL_image libjpeg libpng libtiff ];
+
+  hardeningDisable = [ "format" ];
+
+  makeFlags = [
+    "BACKEND=SDL"
+  ];
+
+  patches = [
+    (fetchpatch {
+    url = "https://foss.aueb.gr/mirrors/linux/gentoo/media-gfx/zgv/files/zgv-5.9-libpng15.patch";
+    sha256 = "1blw9n04c28bnwcmcn64si4f5zpg42s8yn345js88fyzi9zm19xw";
+    })
+    ./switch.patch
+  ];
+
+  patchFlags = [ "-p0" ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp src/zgv $out/bin
+  '';
+
+  meta = with lib; {
+    homepage = "http://www.svgalib.org/rus/zgv/";
+    description = "Picture viewer with a thumbnail-based selector";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.vrthra ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/graphics/zgv/switch.patch b/nixpkgs/pkgs/applications/graphics/zgv/switch.patch
new file mode 100644
index 000000000000..0b5ad092d72d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/graphics/zgv/switch.patch
@@ -0,0 +1,14 @@
+GCC complains
+
+diff -ur src/zgv_io.c src/zgv_io.c
+--- src/zgv_io.c	2005-01-20 15:07:46.000000000 -0800
++++ src/zgv_io.c	2016-06-29 10:19:40.169897611 -0700
+@@ -645,7 +645,7 @@
+         case SDLK_INSERT:	return(RK_INSERT);
+         case SDLK_DELETE:	return(RK_DELETE);
+         case SDLK_RETURN:	return(RK_ENTER);
+-        default:
++        default: ;
+           /* stop complaints */
+         }
+