about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--maintainers/maintainer-list.nix10
-rw-r--r--nixos/doc/manual/from_md/release-notes/rl-2111.section.xml21
-rw-r--r--nixos/doc/manual/release-notes/rl-2111.section.md4
-rw-r--r--nixos/lib/make-zfs-image.nix2
-rw-r--r--nixos/lib/qemu-common.nix2
-rwxr-xr-xnixos/lib/test-driver/test-driver.py72
-rw-r--r--nixos/lib/testing-python.nix4
-rw-r--r--nixos/modules/hardware/all-firmware.nix2
-rw-r--r--nixos/modules/installer/cd-dvd/iso-image.nix2
-rw-r--r--nixos/modules/services/databases/hbase.nix5
-rw-r--r--nixos/modules/services/mail/dovecot.nix3
-rw-r--r--nixos/modules/system/boot/kernel.nix2
-rw-r--r--nixos/modules/tasks/network-interfaces.nix4
-rw-r--r--nixos/modules/virtualisation/azure-agent.nix2
-rw-r--r--nixos/modules/virtualisation/qemu-vm.nix6
-rw-r--r--nixos/modules/virtualisation/virtualbox-guest.nix2
-rw-r--r--nixos/modules/virtualisation/vmware-guest.nix2
-rw-r--r--nixos/tests/airsonic.nix4
-rw-r--r--nixos/tests/all-tests.nix2
-rw-r--r--nixos/tests/cage.nix1
-rw-r--r--nixos/tests/cagebreak.nix1
-rw-r--r--nixos/tests/cassandra.nix1
-rw-r--r--nixos/tests/ceph-multi-node.nix1
-rw-r--r--nixos/tests/ceph-single-node-bluestore.nix1
-rw-r--r--nixos/tests/ceph-single-node.nix1
-rw-r--r--nixos/tests/common/wayland-cage.nix13
-rw-r--r--nixos/tests/containers-bridge.nix1
-rw-r--r--nixos/tests/containers-ephemeral.nix1
-rw-r--r--nixos/tests/containers-extra_veth.nix1
-rw-r--r--nixos/tests/containers-hosts.nix1
-rw-r--r--nixos/tests/containers-imperative.nix1
-rw-r--r--nixos/tests/containers-ip.nix1
-rw-r--r--nixos/tests/containers-macvlans.nix2
-rw-r--r--nixos/tests/containers-physical_interfaces.nix4
-rw-r--r--nixos/tests/containers-portforward.nix1
-rw-r--r--nixos/tests/containers-tmpfs.nix1
-rw-r--r--nixos/tests/custom-ca.nix2
-rw-r--r--nixos/tests/enlightenment.nix1
-rw-r--r--nixos/tests/fcitx/default.nix1
-rw-r--r--nixos/tests/fenics.nix1
-rw-r--r--nixos/tests/firefox.nix3
-rw-r--r--nixos/tests/gerrit.nix1
-rw-r--r--nixos/tests/gnome-xorg.nix1
-rw-r--r--nixos/tests/gnome.nix1
-rw-r--r--nixos/tests/graphite.nix1
-rw-r--r--nixos/tests/hadoop/hadoop.nix2
-rw-r--r--nixos/tests/hadoop/hdfs.nix1
-rw-r--r--nixos/tests/hibernate.nix1
-rw-r--r--nixos/tests/installed-tests/fwupd.nix1
-rw-r--r--nixos/tests/installer.nix4
-rw-r--r--nixos/tests/jitsi-meet.nix1
-rw-r--r--nixos/tests/kafka.nix1
-rw-r--r--nixos/tests/keycloak.nix1
-rw-r--r--nixos/tests/lxd-image.nix2
-rw-r--r--nixos/tests/metabase.nix1
-rw-r--r--nixos/tests/mysql/mysql.nix4
-rw-r--r--nixos/tests/networking-proxy.nix1
-rw-r--r--nixos/tests/nginx-etag.nix1
-rw-r--r--nixos/tests/nixops/default.nix1
-rw-r--r--nixos/tests/opensmtpd-rspamd.nix1
-rw-r--r--nixos/tests/pantheon.nix1
-rw-r--r--nixos/tests/paperless-ng.nix1
-rw-r--r--nixos/tests/plasma5-systemd-start.nix1
-rw-r--r--nixos/tests/plasma5.nix1
-rw-r--r--nixos/tests/pleroma.nix1
-rw-r--r--nixos/tests/privacyidea.nix1
-rw-r--r--nixos/tests/prometheus-exporters.nix2
-rw-r--r--nixos/tests/prometheus.nix1
-rw-r--r--nixos/tests/rspamd.nix5
-rw-r--r--nixos/tests/seafile.nix2
-rw-r--r--nixos/tests/signal-desktop.nix1
-rw-r--r--nixos/tests/spark/default.nix1
-rw-r--r--nixos/tests/sway.nix1
-rw-r--r--nixos/tests/sympa.nix1
-rw-r--r--nixos/tests/systemd-cryptenroll.nix1
-rw-r--r--nixos/tests/systemd.nix1
-rw-r--r--nixos/tests/vault-postgresql.nix1
-rw-r--r--nixos/tests/vault.nix1
-rw-r--r--nixos/tests/vaultwarden.nix1
-rw-r--r--nixos/tests/vscodium.nix92
-rw-r--r--nixos/tests/xfce.nix1
-rw-r--r--pkgs/applications/audio/vimpc/default.nix11
-rw-r--r--pkgs/applications/audio/zynaddsubfx/default.nix13
-rw-r--r--pkgs/applications/gis/qgis/unwrapped.nix12
-rw-r--r--pkgs/applications/graphics/f3d/default.nix11
-rw-r--r--pkgs/applications/graphics/fluxus/default.nix5
-rw-r--r--pkgs/applications/graphics/gimp/default.nix2
-rw-r--r--pkgs/applications/graphics/gimp/plugins/default.nix2
-rw-r--r--pkgs/applications/graphics/hdr-plus/default.nix4
-rw-r--r--pkgs/applications/graphics/krita/generic.nix2
-rw-r--r--pkgs/applications/graphics/qvge/default.nix12
-rw-r--r--pkgs/applications/misc/joshuto/default.nix11
-rw-r--r--pkgs/applications/misc/joshuto/fix-cargo-lock.patch11
-rw-r--r--pkgs/applications/misc/prusa-slicer/super-slicer.nix2
-rwxr-xr-xpkgs/applications/networking/browsers/chromium/update.py6
-rw-r--r--pkgs/applications/networking/browsers/chromium/upstream-info.json24
-rw-r--r--pkgs/applications/networking/browsers/firefox/common.nix83
-rw-r--r--pkgs/applications/networking/browsers/tor-browser-bundle-bin/default.nix2
-rw-r--r--pkgs/applications/networking/instant-messengers/rocketchat-desktop/default.nix10
-rw-r--r--pkgs/applications/networking/instant-messengers/signal-desktop/default.nix39
-rw-r--r--pkgs/applications/networking/instant-messengers/viber/default.nix6
-rw-r--r--pkgs/applications/science/biology/hmmer/default.nix3
-rw-r--r--pkgs/applications/science/logic/monosat/default.nix2
-rw-r--r--pkgs/applications/science/math/R/default.nix2
-rw-r--r--pkgs/applications/science/math/pari/default.nix30
-rw-r--r--pkgs/applications/science/math/pari/gp2c.nix16
-rw-r--r--pkgs/applications/science/math/pari/rnfdisc.patch51
-rw-r--r--pkgs/applications/science/math/sage/sage-src.nix14
-rw-r--r--pkgs/applications/video/makemkv/default.nix3
-rw-r--r--pkgs/applications/video/mplayer/default.nix2
-rw-r--r--pkgs/applications/window-managers/afterstep/default.nix8
-rw-r--r--pkgs/build-support/fetchgitlab/default.nix2
-rw-r--r--pkgs/build-support/fetchurl/mirrors.nix4
-rw-r--r--pkgs/build-support/trivial-builders.nix2
-rw-r--r--pkgs/build-support/vm/default.nix8
-rw-r--r--pkgs/data/themes/qogir/default.nix32
-rw-r--r--pkgs/data/themes/rose-pine-gtk/default.nix44
-rw-r--r--pkgs/desktops/gnome/core/gnome-software/default.nix2
-rw-r--r--pkgs/desktops/mate/mate-screensaver/default.nix4
-rw-r--r--pkgs/desktops/mate/mozo/default.nix4
-rw-r--r--pkgs/development/compilers/llvm/7/libcxxabi/default.nix8
-rw-r--r--pkgs/development/compilers/ocaml/ber-metaocaml.nix2
-rw-r--r--pkgs/development/compilers/sbcl/common.nix4
-rw-r--r--pkgs/development/compilers/souffle/default.nix14
-rw-r--r--pkgs/development/interpreters/clisp/default.nix4
-rw-r--r--pkgs/development/interpreters/clisp/hg.nix4
-rw-r--r--pkgs/development/interpreters/racket/racket_7_9.nix111
-rw-r--r--pkgs/development/libraries/SDL2_gfx/default.nix2
-rw-r--r--pkgs/development/libraries/adns/default.nix2
-rw-r--r--pkgs/development/libraries/ctl/default.nix10
-rw-r--r--pkgs/development/libraries/cxxtools/default.nix2
-rw-r--r--pkgs/development/libraries/glibc/common.nix2
-rw-r--r--pkgs/development/libraries/grpc/default.nix3
-rw-r--r--pkgs/development/libraries/intel-gmmlib/default.nix4
-rw-r--r--pkgs/development/libraries/isl/0.11.1.nix26
-rw-r--r--pkgs/development/libraries/isl/0.14.1.nix30
-rw-r--r--pkgs/development/libraries/isl/0.17.1.nix30
-rw-r--r--pkgs/development/libraries/isl/0.20.0.nix32
-rw-r--r--pkgs/development/libraries/isl/0.24.0.nix11
-rw-r--r--pkgs/development/libraries/isl/generic.nix32
-rw-r--r--pkgs/development/libraries/java/gwt-dragdrop/builder.sh4
-rw-r--r--pkgs/development/libraries/java/gwt-dragdrop/default.nix21
-rw-r--r--pkgs/development/libraries/java/gwt-widgets/builder.sh6
-rw-r--r--pkgs/development/libraries/java/gwt-widgets/default.nix19
-rw-r--r--pkgs/development/libraries/libasyncns/default.nix5
-rw-r--r--pkgs/development/libraries/libfprint-tod/default.nix4
-rw-r--r--pkgs/development/libraries/libgphoto2/default.nix19
-rw-r--r--pkgs/development/libraries/libimagequant/default.nix2
-rw-r--r--pkgs/development/libraries/libite/default.nix4
-rw-r--r--pkgs/development/libraries/libqb/default.nix4
-rw-r--r--pkgs/development/libraries/libtsm/default.nix2
-rw-r--r--pkgs/development/libraries/notcurses/default.nix4
-rw-r--r--pkgs/development/libraries/opencolorio/1.x.nix2
-rw-r--r--pkgs/development/libraries/pcl/default.nix2
-rw-r--r--pkgs/development/libraries/x264/default.nix2
-rw-r--r--pkgs/development/mobile/androidenv/ndk-bundle/default.nix1
-rw-r--r--pkgs/development/node-packages/default.nix8
-rw-r--r--pkgs/development/python-modules/aiohwenergy/default.nix40
-rw-r--r--pkgs/development/python-modules/aiovlc/default.nix45
-rw-r--r--pkgs/development/python-modules/angr/default.nix15
-rw-r--r--pkgs/development/python-modules/apache-airflow/default.nix20
-rw-r--r--pkgs/development/python-modules/casbin/default.nix4
-rw-r--r--pkgs/development/python-modules/dogpile-core/default.nix23
-rw-r--r--pkgs/development/python-modules/elementpath/default.nix9
-rw-r--r--pkgs/development/python-modules/env-canada/default.nix12
-rw-r--r--pkgs/development/python-modules/envisage/default.nix16
-rw-r--r--pkgs/development/python-modules/falcon/default.nix30
-rw-r--r--pkgs/development/python-modules/faraday-plugins/default.nix4
-rw-r--r--pkgs/development/python-modules/flux-led/default.nix7
-rw-r--r--pkgs/development/python-modules/gistyc/default.nix4
-rw-r--r--pkgs/development/python-modules/identify/default.nix8
-rw-r--r--pkgs/development/python-modules/imap-tools/default.nix7
-rw-r--r--pkgs/development/python-modules/justbackoff/default.nix41
-rw-r--r--pkgs/development/python-modules/keyutils/default.nix4
-rw-r--r--pkgs/development/python-modules/lc7001/default.nix42
-rw-r--r--pkgs/development/python-modules/libasyncns/default.nix16
-rw-r--r--pkgs/development/python-modules/ludios_wpull/default.nix14
-rw-r--r--pkgs/development/python-modules/luxtronik/default.nix36
-rw-r--r--pkgs/development/python-modules/mailman-hyperkitty/default.nix4
-rw-r--r--pkgs/development/python-modules/millheater/default.nix6
-rw-r--r--pkgs/development/python-modules/mujson/default.nix32
-rw-r--r--pkgs/development/python-modules/nessclient/default.nix47
-rw-r--r--pkgs/development/python-modules/oath/default.nix13
-rw-r--r--pkgs/development/python-modules/py-nightscout/default.nix50
-rw-r--r--pkgs/development/python-modules/pyads/default.nix12
-rw-r--r--pkgs/development/python-modules/pyahocorasick/default.nix5
-rw-r--r--pkgs/development/python-modules/pyatmo/default.nix9
-rw-r--r--pkgs/development/python-modules/pyebus/default.nix43
-rw-r--r--pkgs/development/python-modules/pyqtgraph/default.nix2
-rw-r--r--pkgs/development/python-modules/python-crontab/default.nix6
-rw-r--r--pkgs/development/python-modules/pytomlpp/default.nix6
-rw-r--r--pkgs/development/python-modules/pyupgrade/default.nix18
-rw-r--r--pkgs/development/python-modules/pywlroots/default.nix4
-rw-r--r--pkgs/development/python-modules/qcs-api-client/default.nix4
-rw-r--r--pkgs/development/python-modules/related/default.nix60
-rw-r--r--pkgs/development/python-modules/restrictedpython/default.nix34
-rw-r--r--pkgs/development/python-modules/roombapy/default.nix26
-rw-r--r--pkgs/development/python-modules/sanic/default.nix13
-rw-r--r--pkgs/development/python-modules/termplotlib/default.nix26
-rw-r--r--pkgs/development/python-modules/termplotlib/gnuplot-subprocess.patch26
-rw-r--r--pkgs/development/python-modules/tweepy/default.nix4
-rw-r--r--pkgs/development/python-modules/ukkonen/default.nix41
-rw-r--r--pkgs/development/python-modules/unicorn/default.nix14
-rw-r--r--pkgs/development/python-modules/uonet-request-signer-hebe/default.nix37
-rw-r--r--pkgs/development/python-modules/vulcan-api/default.nix57
-rw-r--r--pkgs/development/python-modules/xmlschema/default.nix4
-rw-r--r--pkgs/development/tools/analysis/checkov/default.nix4
-rw-r--r--pkgs/development/tools/database/prisma-engines/default.nix6
-rw-r--r--pkgs/development/tools/misc/ccache/default.nix4
-rw-r--r--pkgs/development/tools/misc/creduce/default.nix4
-rw-r--r--pkgs/development/tools/rust/cargo-msrv/default.nix9
-rw-r--r--pkgs/games/openrct2/default.nix26
-rw-r--r--pkgs/misc/drivers/foo2zjs/default.nix9
-rw-r--r--pkgs/misc/drivers/foo2zjs/hbpl1.patch4676
-rw-r--r--pkgs/misc/drivers/foo2zjs/papercode-format-fix.patch101
-rw-r--r--pkgs/misc/emulators/retroarch/0001-Disable-menu_show_core_updater.patch25
-rw-r--r--pkgs/misc/emulators/retroarch/0002-Use-fixed-paths-on-libretro_info_path.patch80
-rw-r--r--pkgs/misc/emulators/retroarch/cores.nix10
-rw-r--r--pkgs/misc/emulators/retroarch/default.nix21
-rw-r--r--pkgs/misc/emulators/retroarch/disable-menu-show-core-updater.patch13
-rw-r--r--pkgs/misc/emulators/retroarch/fix-libretro-paths.patch28
-rw-r--r--pkgs/misc/emulators/retroarch/kodi-advanced-launchers.nix4
-rw-r--r--pkgs/misc/emulators/wine/cert-path-6.21.patch15
-rw-r--r--pkgs/misc/emulators/wine/sources.nix8
-rw-r--r--pkgs/misc/vscode-extensions/default.nix4
-rw-r--r--pkgs/os-specific/linux/fbterm/default.nix2
-rw-r--r--pkgs/os-specific/linux/firmware/fwupd/default.nix2
-rw-r--r--pkgs/os-specific/linux/nmon/default.nix4
-rw-r--r--pkgs/os-specific/linux/plymouth/default.nix17
-rw-r--r--pkgs/os-specific/linux/powertop/default.nix11
-rw-r--r--pkgs/os-specific/linux/read-edid/default.nix4
-rw-r--r--pkgs/os-specific/linux/rtl8812au/default.nix2
-rw-r--r--pkgs/os-specific/linux/tiptop/default.nix19
-rw-r--r--pkgs/servers/home-assistant/component-packages.nix8
-rw-r--r--pkgs/servers/home-assistant/default.nix7
-rw-r--r--pkgs/servers/http/trafficserver/default.nix7
-rw-r--r--pkgs/servers/icingaweb2/default.nix4
-rw-r--r--pkgs/servers/icingaweb2/ipl.nix4
-rw-r--r--pkgs/servers/mail/mailman/default.nix11
-rw-r--r--pkgs/servers/mail/mailman/hyperkitty.nix18
-rw-r--r--pkgs/servers/mail/mailman/postorius.nix4
-rw-r--r--pkgs/servers/mail/mailman/web.nix31
-rw-r--r--pkgs/servers/mautrix-facebook/default.nix8
-rw-r--r--pkgs/servers/misc/navidrome/default.nix6
-rw-r--r--pkgs/servers/rippled/default.nix4
-rw-r--r--pkgs/servers/zookeeper/default.nix12
-rw-r--r--pkgs/shells/oil/default.nix5
-rw-r--r--pkgs/tools/admin/trivy/default.nix15
-rw-r--r--pkgs/tools/archivers/arj/default.nix5
-rw-r--r--pkgs/tools/backup/grab-site/default.nix17
-rw-r--r--pkgs/tools/compression/bsdiff/CVE-2020-14315.patch384
-rw-r--r--pkgs/tools/compression/bsdiff/default.nix24
-rw-r--r--pkgs/tools/compression/lrzip/default.nix28
-rw-r--r--pkgs/tools/filesystems/nilfs-utils/default.nix14
-rw-r--r--pkgs/tools/graphics/pngquant/default.nix2
-rw-r--r--pkgs/tools/misc/broot/default.nix6
-rw-r--r--pkgs/tools/misc/czkawka/default.nix17
-rw-r--r--pkgs/tools/misc/fluent-bit/default.nix7
-rw-r--r--pkgs/tools/misc/fluent-bit/fix-cmetrics-darwin.patch23
-rw-r--r--pkgs/tools/misc/fluent-bit/fix-luajit-darwin.patch31
-rw-r--r--pkgs/tools/misc/gotify-desktop/default.nix2
-rw-r--r--pkgs/tools/misc/ipxe/default.nix6
-rw-r--r--pkgs/tools/misc/vector/default.nix6
-rw-r--r--pkgs/tools/networking/cdpr/default.nix4
-rw-r--r--pkgs/tools/networking/fastd/default.nix2
-rw-r--r--pkgs/tools/networking/kail/default.nix24
-rw-r--r--pkgs/tools/networking/kail/deps.nix408
-rw-r--r--pkgs/tools/networking/ookla-speedtest/default.nix2
-rw-r--r--pkgs/tools/security/fprintd/tod.nix21
-rw-r--r--pkgs/tools/security/masscan/default.nix5
-rw-r--r--pkgs/tools/security/mkp224o/default.nix2
-rw-r--r--pkgs/tools/system/plan9port/default.nix3
-rw-r--r--pkgs/top-level/aliases.nix4
-rw-r--r--pkgs/top-level/all-packages.nix140
-rw-r--r--pkgs/top-level/python-aliases.nix1
-rw-r--r--pkgs/top-level/python-packages.nix28
276 files changed, 7359 insertions, 1389 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix
index bc9aaed9c80af..cbed76919bdb3 100644
--- a/maintainers/maintainer-list.nix
+++ b/maintainers/maintainer-list.nix
@@ -4187,6 +4187,16 @@
     githubId = 313929;
     name = "Gabriel Ebner";
   };
+  genofire = {
+    name = "genofire";
+    email = "geno+dev@fireorbit.de";
+    github = "genofire";
+    githubId = 6905586;
+    keys = [{
+      longkeyid = "rsa4096/0xFC83907C125BC2BC";
+      fingerprint = "386E D1BF 848A BB4A 6B4A  3C45 FC83 907C 125B C2BC";
+    }];
+  };
   georgewhewell = {
     email = "georgerw@gmail.com";
     github = "georgewhewell";
diff --git a/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml
index a64379b19ef6c..f1d803136aa00 100644
--- a/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml
+++ b/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml
@@ -1365,6 +1365,17 @@ Superuser created successfully.
           <literal>gnat11</literal> instead of <literal>gnat9</literal>.
         </para>
       </listitem>
+      <listitem>
+        <para>
+          <literal>retroArchCores</literal> has been removed. This means
+          that using <literal>nixpkgs.config.retroarch</literal> to
+          customize RetroArch cores is not supported anymore. Instead,
+          use package overrides, for example:
+          <literal>retroarch.override { cores = with libretro; [ citra snes9x ]; };</literal>.
+          Also, <literal>retroarchFull</literal> derivation is available
+          for those who want to have all RetroArch cores available.
+        </para>
+      </listitem>
     </itemizedlist>
   </section>
   <section xml:id="sec-release-21.11-notable-changes">
@@ -1966,6 +1977,16 @@ Superuser created successfully.
           <literal>1.5.4</literal>.
         </para>
       </listitem>
+      <listitem>
+        <para>
+          RetroArch has been upgraded from version
+          <literal>1.8.5</literal> to <literal>1.9.13.2</literal>. Since
+          the previous release was quite old, if you’re having issues
+          after the upgrade, please delete your
+          <literal>$XDG_CONFIG_HOME/retroarch/retroarch.cfg</literal>
+          file.
+        </para>
+      </listitem>
     </itemizedlist>
   </section>
 </section>
diff --git a/nixos/doc/manual/release-notes/rl-2111.section.md b/nixos/doc/manual/release-notes/rl-2111.section.md
index 9a76b4cca449b..275ee7142d0ec 100644
--- a/nixos/doc/manual/release-notes/rl-2111.section.md
+++ b/nixos/doc/manual/release-notes/rl-2111.section.md
@@ -407,6 +407,8 @@ In addition to numerous new and upgraded packages, this release has the followin
 - The default GNAT version has been changed: The `gnat` attribute now points to `gnat11`
   instead of `gnat9`.
 
+- `retroArchCores` has been removed. This means that using `nixpkgs.config.retroarch` to customize RetroArch cores is not supported anymore. Instead, use package overrides, for example: `retroarch.override { cores = with libretro; [ citra snes9x ]; };`. Also, `retroarchFull` derivation is available for those who want to have all RetroArch cores available.
+
 ## Other Notable Changes {#sec-release-21.11-notable-changes}
 
 
@@ -539,3 +541,5 @@ In addition to numerous new and upgraded packages, this release has the followin
 - Loki has had another release. Some default values have been changed for the configuration and some configuration options have been renamed. For more details, please check [the upgrade guide](https://grafana.com/docs/loki/latest/upgrading/#240).
 
 - `julia` now refers to `julia-stable` instead of `julia-lts`. In practice this means it has been upgraded from `1.0.4` to `1.5.4`.
+
+- RetroArch has been upgraded from version `1.8.5` to `1.9.13.2`. Since the previous release was quite old, if you're having issues after the upgrade, please delete your `$XDG_CONFIG_HOME/retroarch/retroarch.cfg` file.
diff --git a/nixos/lib/make-zfs-image.nix b/nixos/lib/make-zfs-image.nix
index 40648ca24d4d3..a84732aa11712 100644
--- a/nixos/lib/make-zfs-image.nix
+++ b/nixos/lib/make-zfs-image.nix
@@ -241,7 +241,7 @@ let
     pkgs.vmTools.override {
       rootModules =
         [ "zfs" "9p" "9pnet_virtio" "virtio_pci" "virtio_blk" ] ++
-          (pkgs.lib.optional (pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64) "rtc_cmos");
+          (pkgs.lib.optional pkgs.stdenv.hostPlatform.isx86 "rtc_cmos");
       kernel = modulesTree;
     }
   ).runInLinuxVM (
diff --git a/nixos/lib/qemu-common.nix b/nixos/lib/qemu-common.nix
index 84f9060acd631..1a1f7531feb0b 100644
--- a/nixos/lib/qemu-common.nix
+++ b/nixos/lib/qemu-common.nix
@@ -17,7 +17,7 @@ rec {
       ''-netdev vde,id=vlan${toString nic},sock="$QEMU_VDE_SOCKET_${toString net}"''
     ];
 
-  qemuSerialDevice = if pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64 then "ttyS0"
+  qemuSerialDevice = if pkgs.stdenv.hostPlatform.isx86 then "ttyS0"
         else if (with pkgs.stdenv.hostPlatform; isAarch32 || isAarch64 || isPower) then "ttyAMA0"
         else throw "Unknown QEMU serial device for system '${pkgs.stdenv.hostPlatform.system}'";
 
diff --git a/nixos/lib/test-driver/test-driver.py b/nixos/lib/test-driver/test-driver.py
index a7c0484060f2f..643446f313e3a 100755
--- a/nixos/lib/test-driver/test-driver.py
+++ b/nixos/lib/test-driver/test-driver.py
@@ -4,6 +4,7 @@ from queue import Queue, Empty
 from typing import Tuple, Any, Callable, Dict, Iterator, Optional, List, Iterable
 from xml.sax.saxutils import XMLGenerator
 from colorama import Style
+from pathlib import Path
 import queue
 import io
 import threading
@@ -11,7 +12,6 @@ import argparse
 import base64
 import codecs
 import os
-import pathlib
 import ptpython.repl
 import pty
 import re
@@ -239,8 +239,8 @@ class StartCommand:
 
     def cmd(
         self,
-        monitor_socket_path: pathlib.Path,
-        shell_socket_path: pathlib.Path,
+        monitor_socket_path: Path,
+        shell_socket_path: Path,
         allow_reboot: bool = False,  # TODO: unused, legacy?
     ) -> str:
         display_opts = ""
@@ -272,8 +272,8 @@ class StartCommand:
 
     @staticmethod
     def build_environment(
-        state_dir: pathlib.Path,
-        shared_dir: pathlib.Path,
+        state_dir: Path,
+        shared_dir: Path,
     ) -> dict:
         # We make a copy to not update the current environment
         env = dict(os.environ)
@@ -288,10 +288,10 @@ class StartCommand:
 
     def run(
         self,
-        state_dir: pathlib.Path,
-        shared_dir: pathlib.Path,
-        monitor_socket_path: pathlib.Path,
-        shell_socket_path: pathlib.Path,
+        state_dir: Path,
+        shared_dir: Path,
+        monitor_socket_path: Path,
+        shell_socket_path: Path,
     ) -> subprocess.Popen:
         return subprocess.Popen(
             self.cmd(monitor_socket_path, shell_socket_path),
@@ -334,7 +334,7 @@ class LegacyStartCommand(StartCommand):
         self,
         netBackendArgs: Optional[str] = None,
         netFrontendArgs: Optional[str] = None,
-        hda: Optional[Tuple[pathlib.Path, str]] = None,
+        hda: Optional[Tuple[Path, str]] = None,
         cdrom: Optional[str] = None,
         usb: Optional[str] = None,
         bios: Optional[str] = None,
@@ -394,11 +394,11 @@ class Machine:
     the machine lifecycle with the help of a start script / command."""
 
     name: str
-    tmp_dir: pathlib.Path
-    shared_dir: pathlib.Path
-    state_dir: pathlib.Path
-    monitor_path: pathlib.Path
-    shell_path: pathlib.Path
+    tmp_dir: Path
+    shared_dir: Path
+    state_dir: Path
+    monitor_path: Path
+    shell_path: Path
 
     start_command: StartCommand
     keep_vm_state: bool
@@ -421,7 +421,7 @@ class Machine:
 
     def __init__(
         self,
-        tmp_dir: pathlib.Path,
+        tmp_dir: Path,
         start_command: StartCommand,
         name: str = "machine",
         keep_vm_state: bool = False,
@@ -463,7 +463,7 @@ class Machine:
         hda = None
         if args.get("hda"):
             hda_arg: str = args.get("hda", "")
-            hda_arg_path: pathlib.Path = pathlib.Path(hda_arg)
+            hda_arg_path: Path = Path(hda_arg)
             hda = (hda_arg_path, args.get("hdaInterface", ""))
         return LegacyStartCommand(
             netBackendArgs=args.get("netBackendArgs"),
@@ -814,12 +814,12 @@ class Machine:
         """Copy a file from the host into the guest via the `shared_dir` shared
         among all the VMs (using a temporary directory).
         """
-        host_src = pathlib.Path(source)
-        vm_target = pathlib.Path(target)
+        host_src = Path(source)
+        vm_target = Path(target)
         with tempfile.TemporaryDirectory(dir=self.shared_dir) as shared_td:
-            shared_temp = pathlib.Path(shared_td)
+            shared_temp = Path(shared_td)
             host_intermediate = shared_temp / host_src.name
-            vm_shared_temp = pathlib.Path("/tmp/shared") / shared_temp.name
+            vm_shared_temp = Path("/tmp/shared") / shared_temp.name
             vm_intermediate = vm_shared_temp / host_src.name
 
             self.succeed(make_command(["mkdir", "-p", vm_shared_temp]))
@@ -836,11 +836,11 @@ class Machine:
         all the VMs (using a temporary directory).
         """
         # Compute the source, target, and intermediate shared file names
-        out_dir = pathlib.Path(os.environ.get("out", os.getcwd()))
-        vm_src = pathlib.Path(source)
+        out_dir = Path(os.environ.get("out", os.getcwd()))
+        vm_src = Path(source)
         with tempfile.TemporaryDirectory(dir=self.shared_dir) as shared_td:
-            shared_temp = pathlib.Path(shared_td)
-            vm_shared_temp = pathlib.Path("/tmp/shared") / shared_temp.name
+            shared_temp = Path(shared_td)
+            vm_shared_temp = Path("/tmp/shared") / shared_temp.name
             vm_intermediate = vm_shared_temp / vm_src.name
             intermediate = shared_temp / vm_src.name
             # Copy the file to the shared directory inside VM
@@ -911,12 +911,12 @@ class Machine:
 
         self.log("starting vm")
 
-        def clear(path: pathlib.Path) -> pathlib.Path:
+        def clear(path: Path) -> Path:
             if path.exists():
                 path.unlink()
             return path
 
-        def create_socket(path: pathlib.Path) -> socket.socket:
+        def create_socket(path: Path) -> socket.socket:
             s = socket.socket(family=socket.AF_UNIX, type=socket.SOCK_STREAM)
             s.bind(str(path))
             s.listen(1)
@@ -1061,7 +1061,7 @@ class VLan:
     """
 
     nr: int
-    socket_dir: pathlib.Path
+    socket_dir: Path
 
     process: subprocess.Popen
     pid: int
@@ -1070,7 +1070,7 @@ class VLan:
     def __repr__(self) -> str:
         return f"<Vlan Nr. {self.nr}>"
 
-    def __init__(self, nr: int, tmp_dir: pathlib.Path):
+    def __init__(self, nr: int, tmp_dir: Path):
         self.nr = nr
         self.socket_dir = tmp_dir / f"vde{self.nr}.ctl"
 
@@ -1123,7 +1123,7 @@ class Driver:
     ):
         self.tests = tests
 
-        tmp_dir = pathlib.Path(os.environ.get("TMPDIR", tempfile.gettempdir()))
+        tmp_dir = Path(os.environ.get("TMPDIR", tempfile.gettempdir()))
         tmp_dir.mkdir(mode=0o700, exist_ok=True)
 
         with rootlog.nested("start all VLans"):
@@ -1183,9 +1183,11 @@ class Driver:
             serial_stdout_on=self.serial_stdout_on,
             Machine=Machine,  # for typing
         )
-        machine_symbols = {
-            m.name: self.machines[idx] for idx, m in enumerate(self.machines)
-        }
+        machine_symbols = {m.name: m for m in self.machines}
+        # If there's exactly one machine, make it available under the name
+        # "machine", even if it's not called that.
+        if len(self.machines) == 1:
+            (machine_symbols["machine"],) = self.machines
         vlan_symbols = {
             f"vlan{v.nr}": self.vlans[idx] for idx, v in enumerate(self.vlans)
         }
@@ -1230,7 +1232,7 @@ class Driver:
             "Using legacy create_machine(), please instantiate the"
             "Machine class directly, instead"
         )
-        tmp_dir = pathlib.Path(os.environ.get("TMPDIR", tempfile.gettempdir()))
+        tmp_dir = Path(os.environ.get("TMPDIR", tempfile.gettempdir()))
         tmp_dir.mkdir(mode=0o700, exist_ok=True)
 
         if args.get("startCommand"):
@@ -1316,7 +1318,7 @@ if __name__ == "__main__":
         action=EnvDefault,
         envvar="testScript",
         help="the test script to run",
-        type=pathlib.Path,
+        type=Path,
     )
 
     args = arg_parser.parse_args()
diff --git a/nixos/lib/testing-python.nix b/nixos/lib/testing-python.nix
index cce017a6441db..4306d102b2d64 100644
--- a/nixos/lib/testing-python.nix
+++ b/nixos/lib/testing-python.nix
@@ -134,7 +134,9 @@ rec {
       vlans = map (m: m.config.virtualisation.vlans) (lib.attrValues nodes);
       vms = map (m: m.config.system.build.vm) (lib.attrValues nodes);
 
-      nodeHostNames = map (c: c.config.system.name) (lib.attrValues nodes);
+      nodeHostNames = let
+        nodesList = map (c: c.config.system.name) (lib.attrValues nodes);
+      in nodesList ++ lib.optional (lib.length nodesList == 1) "machine";
 
       # TODO: This is an implementation error and needs fixing
       # the testing famework cannot legitimately restrict hostnames further
diff --git a/nixos/modules/hardware/all-firmware.nix b/nixos/modules/hardware/all-firmware.nix
index bdf90816740c8..ce87f9e8be8a4 100644
--- a/nixos/modules/hardware/all-firmware.nix
+++ b/nixos/modules/hardware/all-firmware.nix
@@ -83,7 +83,7 @@ in {
         b43Firmware_5_1_138
         b43Firmware_6_30_163_46
         b43FirmwareCutter
-      ] ++ optional (pkgs.stdenv.hostPlatform.isi686 || pkgs.stdenv.hostPlatform.isx86_64) facetimehd-firmware;
+      ] ++ optional pkgs.stdenv.hostPlatform.isx86 facetimehd-firmware;
     })
     (mkIf cfg.wirelessRegulatoryDatabase {
       hardware.firmware = [ pkgs.wireless-regdb ];
diff --git a/nixos/modules/installer/cd-dvd/iso-image.nix b/nixos/modules/installer/cd-dvd/iso-image.nix
index 4812cacabaf3e..30610b4f42608 100644
--- a/nixos/modules/installer/cd-dvd/iso-image.nix
+++ b/nixos/modules/installer/cd-dvd/iso-image.nix
@@ -467,7 +467,7 @@ let
       throw "Unsupported architecture";
 
   # Syslinux (and isolinux) only supports x86-based architectures.
-  canx86BiosBoot = pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64;
+  canx86BiosBoot = pkgs.stdenv.hostPlatform.isx86;
 
 in
 
diff --git a/nixos/modules/services/databases/hbase.nix b/nixos/modules/services/databases/hbase.nix
index 183c8a2f46d53..181be2d6b0b87 100644
--- a/nixos/modules/services/databases/hbase.nix
+++ b/nixos/modules/services/databases/hbase.nix
@@ -22,7 +22,10 @@ let
         configAttr));
 
   configFile = pkgs.writeText "hbase-site.xml"
-    (buildProperty (defaultConfig // cfg.settings));
+    ''<configuration>
+        ${buildProperty (defaultConfig // cfg.settings)}
+      </configuration>
+    '';
 
   configDir = pkgs.runCommand "hbase-config-dir" { preferLocalBuild = true; } ''
     mkdir -p $out
diff --git a/nixos/modules/services/mail/dovecot.nix b/nixos/modules/services/mail/dovecot.nix
index 223f3bef77dbb..c39827c5b867d 100644
--- a/nixos/modules/services/mail/dovecot.nix
+++ b/nixos/modules/services/mail/dovecot.nix
@@ -103,11 +103,12 @@ let
 
         plugin {
           quota_rule = *:storage=${cfg.quotaGlobalPerUser}
-          quota = maildir:User quota # per virtual mail user quota # BUG/FIXME broken, we couldn't get this working
+          quota = count:User quota # per virtual mail user quota
           quota_status_success = DUNNO
           quota_status_nouser = DUNNO
           quota_status_overquota = "552 5.2.2 Mailbox is full"
           quota_grace = 10%%
+          quota_vsizes = yes
         }
       ''
     )
diff --git a/nixos/modules/system/boot/kernel.nix b/nixos/modules/system/boot/kernel.nix
index 4a9da93945191..d147155d796c1 100644
--- a/nixos/modules/system/boot/kernel.nix
+++ b/nixos/modules/system/boot/kernel.nix
@@ -243,7 +243,7 @@ in
             "hid_generic" "hid_lenovo" "hid_apple" "hid_roccat"
             "hid_logitech_hidpp" "hid_logitech_dj" "hid_microsoft"
 
-          ] ++ optionals (pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64) [
+          ] ++ optionals pkgs.stdenv.hostPlatform.isx86 [
             # Misc. x86 keyboard stuff.
             "pcips2" "atkbd" "i8042"
 
diff --git a/nixos/modules/tasks/network-interfaces.nix b/nixos/modules/tasks/network-interfaces.nix
index 75fc5a14a8009..49901cda848df 100644
--- a/nixos/modules/tasks/network-interfaces.nix
+++ b/nixos/modules/tasks/network-interfaces.nix
@@ -417,7 +417,11 @@ in
         network node hostname (uname --nodename) the option
         boot.kernel.sysctl."kernel.hostname" can be used as a workaround (but
         the 64 character limit still applies).
+
+        WARNING: Do not use underscores (_) or you may run into unexpected issues.
       '';
+       # warning until the issues in https://github.com/NixOS/nixpkgs/pull/138978
+       # are resolved
     };
 
     networking.fqdn = mkOption {
diff --git a/nixos/modules/virtualisation/azure-agent.nix b/nixos/modules/virtualisation/azure-agent.nix
index 41f3fa0e6642e..bd8c7f8c1eea3 100644
--- a/nixos/modules/virtualisation/azure-agent.nix
+++ b/nixos/modules/virtualisation/azure-agent.nix
@@ -76,7 +76,7 @@ in
 
   config = mkIf cfg.enable {
     assertions = [ {
-      assertion = pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64;
+      assertion = pkgs.stdenv.hostPlatform.isx86;
       message = "Azure not currently supported on ${pkgs.stdenv.hostPlatform.system}";
     } {
       assertion = config.networking.networkmanager.enable == false;
diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix
index 0c2782d3e0274..493c407222f7c 100644
--- a/nixos/modules/virtualisation/qemu-vm.nix
+++ b/nixos/modules/virtualisation/qemu-vm.nix
@@ -97,7 +97,7 @@ let
     imap1 (idx: drive: drive // { device = driveDeviceName idx; });
 
   efiPrefix =
-    if (pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64) then "${pkgs.OVMF.fd}/FV/OVMF"
+    if pkgs.stdenv.hostPlatform.isx86 then "${pkgs.OVMF.fd}/FV/OVMF"
     else if pkgs.stdenv.isAarch64 then "${pkgs.OVMF.fd}/FV/AAVMF"
     else throw "No EFI firmware available for platform";
   efiFirmware = "${efiPrefix}_CODE.fd";
@@ -296,7 +296,7 @@ in
     virtualisation.memorySize =
       mkOption {
         type = types.ints.positive;
-        default = 384;
+        default = 1024;
         description =
           ''
             The memory size in megabytes of the virtual machine.
@@ -833,7 +833,7 @@ in
 
     # FIXME: Consolidate this one day.
     virtualisation.qemu.options = mkMerge [
-      (mkIf (pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64) [
+      (mkIf pkgs.stdenv.hostPlatform.isx86 [
         "-usb" "-device usb-tablet,bus=usb-bus.0"
       ])
       (mkIf (pkgs.stdenv.isAarch32 || pkgs.stdenv.isAarch64) [
diff --git a/nixos/modules/virtualisation/virtualbox-guest.nix b/nixos/modules/virtualisation/virtualbox-guest.nix
index 486951983d303..f702fb4e525c2 100644
--- a/nixos/modules/virtualisation/virtualbox-guest.nix
+++ b/nixos/modules/virtualisation/virtualbox-guest.nix
@@ -33,7 +33,7 @@ in
 
   config = mkIf cfg.enable (mkMerge [{
     assertions = [{
-      assertion = pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64;
+      assertion = pkgs.stdenv.hostPlatform.isx86;
       message = "Virtualbox not currently supported on ${pkgs.stdenv.hostPlatform.system}";
     }];
 
diff --git a/nixos/modules/virtualisation/vmware-guest.nix b/nixos/modules/virtualisation/vmware-guest.nix
index 480a9703cef34..09b26eeb33a92 100644
--- a/nixos/modules/virtualisation/vmware-guest.nix
+++ b/nixos/modules/virtualisation/vmware-guest.nix
@@ -23,7 +23,7 @@ in
 
   config = mkIf cfg.enable {
     assertions = [ {
-      assertion = pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64;
+      assertion = pkgs.stdenv.hostPlatform.isx86;
       message = "VMWare guest is not currently supported on ${pkgs.stdenv.hostPlatform.system}";
     } ];
 
diff --git a/nixos/tests/airsonic.nix b/nixos/tests/airsonic.nix
index 59bd84877c61c..d8df092c2ecfa 100644
--- a/nixos/tests/airsonic.nix
+++ b/nixos/tests/airsonic.nix
@@ -11,10 +11,6 @@ import ./make-test-python.nix ({ pkgs, ... }: {
         enable = true;
         maxMemory = 800;
       };
-
-      # Airsonic is a Java application, and unfortunately requires a significant
-      # amount of memory.
-      virtualisation.memorySize = 1024;
     };
 
   testScript = ''
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index cd13183ed0a32..b8219416dc42a 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -489,7 +489,7 @@ in
   victoriametrics = handleTest ./victoriametrics.nix {};
   vikunja = handleTest ./vikunja.nix {};
   virtualbox = handleTestOn ["x86_64-linux"] ./virtualbox.nix {};
-  vscodium = handleTest ./vscodium.nix {};
+  vscodium = discoverTests (import ./vscodium.nix);
   wasabibackend = handleTest ./wasabibackend.nix {};
   wiki-js = handleTest ./wiki-js.nix {};
   wireguard = handleTest ./wireguard {};
diff --git a/nixos/tests/cage.nix b/nixos/tests/cage.nix
index e6bef374d3037..83bae3deeeab2 100644
--- a/nixos/tests/cage.nix
+++ b/nixos/tests/cage.nix
@@ -17,7 +17,6 @@ import ./make-test-python.nix ({ pkgs, ...} :
       program = "${pkgs.xterm}/bin/xterm -cm -pc -fa Monospace -fs 24";
     };
 
-    virtualisation.memorySize = 1024;
     # Need to switch to a different GPU driver than the default one (-vga std) so that Cage can launch:
     virtualisation.qemu.options = [ "-vga none -device virtio-gpu-pci" ];
   };
diff --git a/nixos/tests/cagebreak.nix b/nixos/tests/cagebreak.nix
index 242e59f5d7aba..c6c2c632b61ac 100644
--- a/nixos/tests/cagebreak.nix
+++ b/nixos/tests/cagebreak.nix
@@ -35,7 +35,6 @@ in
     programs.xwayland.enable = true;
     environment.systemPackages = [ pkgs.cagebreak pkgs.wayland-utils ];
 
-    virtualisation.memorySize = 1024;
     # Need to switch to a different GPU driver than the default one (-vga std) so that Cagebreak can launch:
     virtualisation.qemu.options = [ "-vga none -device virtio-gpu-pci" ];
   };
diff --git a/nixos/tests/cassandra.nix b/nixos/tests/cassandra.nix
index bef3105f0a9eb..a19d525c3431e 100644
--- a/nixos/tests/cassandra.nix
+++ b/nixos/tests/cassandra.nix
@@ -41,7 +41,6 @@ let
       ];
     };
     services.cassandra = cassandraCfg ipAddress // extra;
-    virtualisation.memorySize = 1024;
   };
 in
 {
diff --git a/nixos/tests/ceph-multi-node.nix b/nixos/tests/ceph-multi-node.nix
index 33736e27b984d..29e7c279d69ac 100644
--- a/nixos/tests/ceph-multi-node.nix
+++ b/nixos/tests/ceph-multi-node.nix
@@ -37,7 +37,6 @@ let
 
   generateHost = { pkgs, cephConfig, networkConfig, ... }: {
     virtualisation = {
-      memorySize = 1024;
       emptyDiskImages = [ 20480 ];
       vlans = [ 1 ];
     };
diff --git a/nixos/tests/ceph-single-node-bluestore.nix b/nixos/tests/ceph-single-node-bluestore.nix
index f706d4d56fcfd..acaae4cf300e8 100644
--- a/nixos/tests/ceph-single-node-bluestore.nix
+++ b/nixos/tests/ceph-single-node-bluestore.nix
@@ -34,7 +34,6 @@ let
 
   generateHost = { pkgs, cephConfig, networkConfig, ... }: {
     virtualisation = {
-      memorySize = 1024;
       emptyDiskImages = [ 20480 20480 20480 ];
       vlans = [ 1 ];
     };
diff --git a/nixos/tests/ceph-single-node.nix b/nixos/tests/ceph-single-node.nix
index d1d56ea6708cc..4fe5dc59ff8f3 100644
--- a/nixos/tests/ceph-single-node.nix
+++ b/nixos/tests/ceph-single-node.nix
@@ -34,7 +34,6 @@ let
 
   generateHost = { pkgs, cephConfig, networkConfig, ... }: {
     virtualisation = {
-      memorySize = 1024;
       emptyDiskImages = [ 20480 20480 20480 ];
       vlans = [ 1 ];
     };
diff --git a/nixos/tests/common/wayland-cage.nix b/nixos/tests/common/wayland-cage.nix
new file mode 100644
index 0000000000000..fd0700941392b
--- /dev/null
+++ b/nixos/tests/common/wayland-cage.nix
@@ -0,0 +1,13 @@
+{ ... }:
+
+{
+  imports = [ ./user-account.nix ];
+  services.cage = {
+    enable = true;
+    user = "alice";
+  };
+
+  virtualisation = {
+    qemu.options = [ "-vga virtio" ];
+  };
+}
diff --git a/nixos/tests/containers-bridge.nix b/nixos/tests/containers-bridge.nix
index a1b0c9469d83d..b8661fd7997c9 100644
--- a/nixos/tests/containers-bridge.nix
+++ b/nixos/tests/containers-bridge.nix
@@ -15,7 +15,6 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
     { pkgs, ... }:
     { imports = [ ../modules/installer/cd-dvd/channel.nix ];
       virtualisation.writableStore = true;
-      virtualisation.memorySize = 768;
 
       networking.bridges = {
         br0 = {
diff --git a/nixos/tests/containers-ephemeral.nix b/nixos/tests/containers-ephemeral.nix
index fabf0593f23af..db1631cf5b5d1 100644
--- a/nixos/tests/containers-ephemeral.nix
+++ b/nixos/tests/containers-ephemeral.nix
@@ -5,7 +5,6 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
   };
 
   machine = { pkgs, ... }: {
-    virtualisation.memorySize = 768;
     virtualisation.writableStore = true;
 
     containers.webserver = {
diff --git a/nixos/tests/containers-extra_veth.nix b/nixos/tests/containers-extra_veth.nix
index 172409f56e89e..b8f3d9844064c 100644
--- a/nixos/tests/containers-extra_veth.nix
+++ b/nixos/tests/containers-extra_veth.nix
@@ -8,7 +8,6 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
     { pkgs, ... }:
     { imports = [ ../modules/installer/cd-dvd/channel.nix ];
       virtualisation.writableStore = true;
-      virtualisation.memorySize = 768;
       virtualisation.vlans = [];
 
       networking.useDHCP = false;
diff --git a/nixos/tests/containers-hosts.nix b/nixos/tests/containers-hosts.nix
index 1f24ed1f3c2c4..3c6a15710027a 100644
--- a/nixos/tests/containers-hosts.nix
+++ b/nixos/tests/containers-hosts.nix
@@ -7,7 +7,6 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
   machine =
     { lib, ... }:
     {
-      virtualisation.memorySize = 256;
       virtualisation.vlans = [];
 
       networking.bridges.br0.interfaces = [];
diff --git a/nixos/tests/containers-imperative.nix b/nixos/tests/containers-imperative.nix
index 34103ef7586b5..a126a5480c035 100644
--- a/nixos/tests/containers-imperative.nix
+++ b/nixos/tests/containers-imperative.nix
@@ -14,7 +14,6 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
       nix.binaryCaches = []; # don't try to access cache.nixos.org
 
       virtualisation.writableStore = true;
-      virtualisation.memorySize = 1024;
       # Make sure we always have all the required dependencies for creating a
       # container available within the VM, because we don't have network access.
       virtualisation.additionalPaths = let
diff --git a/nixos/tests/containers-ip.nix b/nixos/tests/containers-ip.nix
index 8fc42dab62410..91fdda0392a9b 100644
--- a/nixos/tests/containers-ip.nix
+++ b/nixos/tests/containers-ip.nix
@@ -22,7 +22,6 @@ in import ./make-test-python.nix ({ pkgs, lib, ... }: {
       imports = [ ../modules/installer/cd-dvd/channel.nix ];
       virtualisation = {
         writableStore = true;
-        memorySize = 768;
       };
 
       containers.webserver4 = webserverFor "10.231.136.1" "10.231.136.2";
diff --git a/nixos/tests/containers-macvlans.nix b/nixos/tests/containers-macvlans.nix
index d0f41be8c1251..a0cea8db4a1ab 100644
--- a/nixos/tests/containers-macvlans.nix
+++ b/nixos/tests/containers-macvlans.nix
@@ -15,7 +15,6 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
     machine1 =
       { lib, ... }:
       {
-        virtualisation.memorySize = 256;
         virtualisation.vlans = [ 1 ];
 
         # To be able to ping containers from the host, it is necessary
@@ -55,7 +54,6 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
     machine2 =
       { ... }:
       {
-        virtualisation.memorySize = 256;
         virtualisation.vlans = [ 1 ];
       };
 
diff --git a/nixos/tests/containers-physical_interfaces.nix b/nixos/tests/containers-physical_interfaces.nix
index 57bd0eedcc335..e203f88786a3e 100644
--- a/nixos/tests/containers-physical_interfaces.nix
+++ b/nixos/tests/containers-physical_interfaces.nix
@@ -7,7 +7,6 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
   nodes = {
     server = { ... }:
       {
-        virtualisation.memorySize = 256;
         virtualisation.vlans = [ 1 ];
 
         containers.server = {
@@ -23,7 +22,6 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
         };
       };
     bridged = { ... }: {
-      virtualisation.memorySize = 128;
       virtualisation.vlans = [ 1 ];
 
       containers.bridged = {
@@ -41,7 +39,6 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
     };
 
     bonded = { ... }: {
-      virtualisation.memorySize = 128;
       virtualisation.vlans = [ 1 ];
 
       containers.bonded = {
@@ -62,7 +59,6 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
     };
 
     bridgedbond = { ... }: {
-      virtualisation.memorySize = 128;
       virtualisation.vlans = [ 1 ];
 
       containers.bridgedbond = {
diff --git a/nixos/tests/containers-portforward.nix b/nixos/tests/containers-portforward.nix
index e21f6cee76a9b..6cecd72f1bda3 100644
--- a/nixos/tests/containers-portforward.nix
+++ b/nixos/tests/containers-portforward.nix
@@ -15,7 +15,6 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
     { pkgs, ... }:
     { imports = [ ../modules/installer/cd-dvd/channel.nix ];
       virtualisation.writableStore = true;
-      virtualisation.memorySize = 768;
 
       containers.webserver =
         { privateNetwork = true;
diff --git a/nixos/tests/containers-tmpfs.nix b/nixos/tests/containers-tmpfs.nix
index 0185c2d91f232..d95178d1ff588 100644
--- a/nixos/tests/containers-tmpfs.nix
+++ b/nixos/tests/containers-tmpfs.nix
@@ -8,7 +8,6 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
     { pkgs, ... }:
     { imports = [ ../modules/installer/cd-dvd/channel.nix ];
       virtualisation.writableStore = true;
-      virtualisation.memorySize = 768;
 
       containers.tmpfs =
         {
diff --git a/nixos/tests/custom-ca.nix b/nixos/tests/custom-ca.nix
index 4480519c7edcc..0ab49f3b34306 100644
--- a/nixos/tests/custom-ca.nix
+++ b/nixos/tests/custom-ca.nix
@@ -81,8 +81,6 @@ in
 
       # chromium-based browsers refuse to run as root
       test-support.displayManager.auto.user = "alice";
-      # browsers may hang with the default memory
-      virtualisation.memorySize = 500;
 
       networking.hosts."127.0.0.1" = [ "good.example.com" "bad.example.com" ];
       security.pki.certificateFiles = [ "${example-good-cert}/ca.crt" ];
diff --git a/nixos/tests/enlightenment.nix b/nixos/tests/enlightenment.nix
index c5f0e208906b7..8506c348246de 100644
--- a/nixos/tests/enlightenment.nix
+++ b/nixos/tests/enlightenment.nix
@@ -19,7 +19,6 @@ import ./make-test-python.nix ({ pkgs, ...} :
       };
     };
     hardware.pulseaudio.enable = true; # needed for the factl test, /dev/snd/* exists without them but udev doesn't care then
-    virtualisation.memorySize = 1024;
     environment.systemPackages = [ pkgs.xdotool ];
     services.acpid.enable = true;
     services.connman.enable = true;
diff --git a/nixos/tests/fcitx/default.nix b/nixos/tests/fcitx/default.nix
index cbeb95d33b0cb..a243be8dc19b1 100644
--- a/nixos/tests/fcitx/default.nix
+++ b/nixos/tests/fcitx/default.nix
@@ -11,7 +11,6 @@ import ../make-test-python.nix (
           ...
         }:
           {
-            virtualisation.memorySize = 1024;
 
             imports = [
               ../common/user-account.nix
diff --git a/nixos/tests/fenics.nix b/nixos/tests/fenics.nix
index 56f09d6a27e40..f0a8c32c7cd8e 100644
--- a/nixos/tests/fenics.nix
+++ b/nixos/tests/fenics.nix
@@ -38,7 +38,6 @@ in
         gcc
         (python3.withPackages (ps: with ps; [ fenics ]))
       ];
-      virtualisation.memorySize = 512;
     };
   };
   testScript =
diff --git a/nixos/tests/firefox.nix b/nixos/tests/firefox.nix
index 7216ad43b8e9a..6101fc9735641 100644
--- a/nixos/tests/firefox.nix
+++ b/nixos/tests/firefox.nix
@@ -13,9 +13,6 @@ import ./make-test-python.nix ({ pkgs, firefoxPackage, ... }: {
         pkgs.xdotool
       ];
 
-      # Need some more memory to record audio.
-      virtualisation.memorySize = 500;
-
       # Create a virtual sound device, with mixing
       # and all, for recording audio.
       boot.kernelModules = [ "snd-aloop" ];
diff --git a/nixos/tests/gerrit.nix b/nixos/tests/gerrit.nix
index b6b6486fae86c..8ae9e89cf6b0c 100644
--- a/nixos/tests/gerrit.nix
+++ b/nixos/tests/gerrit.nix
@@ -18,7 +18,6 @@ in {
       { config, pkgs, ... }: {
         networking.firewall.allowedTCPPorts = [ 80 2222 ];
 
-        virtualisation.memorySize = 1024;
 
         services.gerrit = {
           enable = true;
diff --git a/nixos/tests/gnome-xorg.nix b/nixos/tests/gnome-xorg.nix
index b9ff5e6828758..6264b87af4ec5 100644
--- a/nixos/tests/gnome-xorg.nix
+++ b/nixos/tests/gnome-xorg.nix
@@ -40,7 +40,6 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : {
         };
       };
 
-      virtualisation.memorySize = 1024;
     };
 
   testScript = { nodes, ... }: let
diff --git a/nixos/tests/gnome.nix b/nixos/tests/gnome.nix
index 1da97f733cfd8..06f387ecad67d 100644
--- a/nixos/tests/gnome.nix
+++ b/nixos/tests/gnome.nix
@@ -45,7 +45,6 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : {
         };
       };
 
-      virtualisation.memorySize = 1024;
     };
 
   testScript = { nodes, ... }: let
diff --git a/nixos/tests/graphite.nix b/nixos/tests/graphite.nix
index 137be2d89c8b3..496f16846ea6a 100644
--- a/nixos/tests/graphite.nix
+++ b/nixos/tests/graphite.nix
@@ -4,7 +4,6 @@ import ./make-test-python.nix ({ pkgs, ... } :
   nodes = {
     one =
       { ... }: {
-        virtualisation.memorySize = 1024;
         time.timeZone = "UTC";
         services.graphite = {
           web = {
diff --git a/nixos/tests/hadoop/hadoop.nix b/nixos/tests/hadoop/hadoop.nix
index b4ed0e17a8520..48737debab546 100644
--- a/nixos/tests/hadoop/hadoop.nix
+++ b/nixos/tests/hadoop/hadoop.nix
@@ -95,7 +95,6 @@ import ../make-test-python.nix ({pkgs, ...}: {
 
     # YARN cluster
     rm1 = {pkgs, options, ...}: {
-      virtualisation.memorySize = 1024;
       services.hadoop = {
         inherit package coreSite hdfsSite;
         yarnSite = options.services.hadoop.yarnSite.default // yarnSiteHA;
@@ -103,7 +102,6 @@ import ../make-test-python.nix ({pkgs, ...}: {
       };
     };
     rm2 = {pkgs, options, ...}: {
-      virtualisation.memorySize = 1024;
       services.hadoop = {
         inherit package coreSite hdfsSite;
         yarnSite = options.services.hadoop.yarnSite.default // yarnSiteHA;
diff --git a/nixos/tests/hadoop/hdfs.nix b/nixos/tests/hadoop/hdfs.nix
index 360dbd60ed274..b63cbf4803271 100644
--- a/nixos/tests/hadoop/hdfs.nix
+++ b/nixos/tests/hadoop/hdfs.nix
@@ -2,7 +2,6 @@
 import ../make-test-python.nix ({...}: {
   nodes = {
     namenode = {pkgs, ...}: {
-      virtualisation.memorySize = 1024;
       services.hadoop = {
         package = pkgs.hadoop;
         hdfs = {
diff --git a/nixos/tests/hibernate.nix b/nixos/tests/hibernate.nix
index 4f05b99a5a116..fc6857e2fd024 100644
--- a/nixos/tests/hibernate.nix
+++ b/nixos/tests/hibernate.nix
@@ -51,6 +51,7 @@ in makeTest {
         connect-timeout = 1
       '';
 
+      virtualisation.memorySize = 2048;
       virtualisation.diskSize = 8 * 1024;
       virtualisation.emptyDiskImages = [
         # Small root disk for installer
diff --git a/nixos/tests/installed-tests/fwupd.nix b/nixos/tests/installed-tests/fwupd.nix
index a8a683a1af7b0..65614e2689d8e 100644
--- a/nixos/tests/installed-tests/fwupd.nix
+++ b/nixos/tests/installed-tests/fwupd.nix
@@ -7,6 +7,5 @@ makeInstalledTest {
     services.fwupd.enable = true;
     services.fwupd.disabledPlugins = lib.mkForce []; # don't disable test plugin
     services.fwupd.enableTestRemote = true;
-    virtualisation.memorySize = 768;
   };
 }
diff --git a/nixos/tests/installer.nix b/nixos/tests/installer.nix
index 73dc676ca32d7..1ff3dc76f4b62 100644
--- a/nixos/tests/installer.nix
+++ b/nixos/tests/installer.nix
@@ -70,7 +70,7 @@ let
     let iface = if grubVersion == 1 then "ide" else "virtio";
         isEfi = bootLoader == "systemd-boot" || (bootLoader == "grub" && grubUseEfi);
         bios  = if pkgs.stdenv.isAarch64 then "QEMU_EFI.fd" else "OVMF.fd";
-    in if !isEfi && !(pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64) then
+    in if !isEfi && !pkgs.stdenv.hostPlatform.isx86 then
       throw "Non-EFI boot methods are only supported on i686 / x86_64"
     else ''
       def assemble_qemu_flags():
@@ -288,7 +288,7 @@ let
           # builds stuff in the VM, needs more juice
           virtualisation.diskSize = 8 * 1024;
           virtualisation.cores = 8;
-          virtualisation.memorySize = 1536;
+          virtualisation.memorySize = 2048;
 
           # Use a small /dev/vdb as the root disk for the
           # installer. This ensures the target disk (/dev/vda) is
diff --git a/nixos/tests/jitsi-meet.nix b/nixos/tests/jitsi-meet.nix
index f9a0b121a2bfc..d95f7c2ea9eaa 100644
--- a/nixos/tests/jitsi-meet.nix
+++ b/nixos/tests/jitsi-meet.nix
@@ -8,7 +8,6 @@ import ./make-test-python.nix ({ pkgs, ... }: {
     client = { nodes, pkgs, ... }: {
     };
     server = { config, pkgs, ... }: {
-      virtualisation.memorySize = 512;
       services.jitsi-meet = {
         enable = true;
         hostName = "server";
diff --git a/nixos/tests/kafka.nix b/nixos/tests/kafka.nix
index 95711808a2c35..5def759ca24d9 100644
--- a/nixos/tests/kafka.nix
+++ b/nixos/tests/kafka.nix
@@ -19,7 +19,6 @@ let
         };
 
         networking.firewall.allowedTCPPorts = [ 2181 ];
-        virtualisation.memorySize = 1024;
       };
       kafka = { ... }: {
         services.apache-kafka = {
diff --git a/nixos/tests/keycloak.nix b/nixos/tests/keycloak.nix
index fc321b8902f1d..1be3fed6acc9d 100644
--- a/nixos/tests/keycloak.nix
+++ b/nixos/tests/keycloak.nix
@@ -17,7 +17,6 @@ let
 
       nodes = {
         keycloak = { ... }: {
-          virtualisation.memorySize = 1024;
 
           security.pki.certificateFiles = [
             certs.ca.cert
diff --git a/nixos/tests/lxd-image.nix b/nixos/tests/lxd-image.nix
index bc8274eebedd6..096b9d9aba906 100644
--- a/nixos/tests/lxd-image.nix
+++ b/nixos/tests/lxd-image.nix
@@ -46,8 +46,6 @@ in {
 
   machine = { lib, ... }: {
     virtualisation = {
-      # OOMs otherwise
-      memorySize = 1024;
       # disk full otherwise
       diskSize = 2048;
 
diff --git a/nixos/tests/metabase.nix b/nixos/tests/metabase.nix
index 370114e922230..1b25071902e97 100644
--- a/nixos/tests/metabase.nix
+++ b/nixos/tests/metabase.nix
@@ -7,7 +7,6 @@ import ./make-test-python.nix ({ pkgs, ... }: {
   nodes = {
     machine = { ... }: {
       services.metabase.enable = true;
-      virtualisation.memorySize = 1024;
     };
   };
 
diff --git a/nixos/tests/mysql/mysql.nix b/nixos/tests/mysql/mysql.nix
index dce5fa26acf7f..2ac2b34a18e2b 100644
--- a/nixos/tests/mysql/mysql.nix
+++ b/nixos/tests/mysql/mysql.nix
@@ -64,10 +64,6 @@ in
       {
         imports = [ users ];
 
-        # prevent oom:
-        # Kernel panic - not syncing: Out of memory: compulsory panic_on_oom is enabled
-        virtualisation.memorySize = 1024;
-
         services.mysql.enable = true;
         services.mysql.initialDatabases = [
           { name = "testdb3"; schema = ./testdb.sql; }
diff --git a/nixos/tests/networking-proxy.nix b/nixos/tests/networking-proxy.nix
index 62b5e690f6d1e..fcb2558cf3b08 100644
--- a/nixos/tests/networking-proxy.nix
+++ b/nixos/tests/networking-proxy.nix
@@ -8,7 +8,6 @@ let default-config = {
 
         services.xserver.enable = false;
 
-        virtualisation.memorySize = 128;
       };
 in import ./make-test-python.nix ({ pkgs, ...} : {
   name = "networking-proxy";
diff --git a/nixos/tests/nginx-etag.nix b/nixos/tests/nginx-etag.nix
index a7bfc0d26958b..b69511d081d4b 100644
--- a/nixos/tests/nginx-etag.nix
+++ b/nixos/tests/nginx-etag.nix
@@ -37,7 +37,6 @@ import ./make-test-python.nix {
     };
 
     client = { pkgs, lib, ... }: {
-      virtualisation.memorySize = 512;
       environment.systemPackages = let
         testRunner = pkgs.writers.writePython3Bin "test-runner" {
           libraries = [ pkgs.python3Packages.selenium ];
diff --git a/nixos/tests/nixops/default.nix b/nixos/tests/nixops/default.nix
index 3fb81906a5227..ec3d028aabae8 100644
--- a/nixos/tests/nixops/default.nix
+++ b/nixos/tests/nixops/default.nix
@@ -26,7 +26,6 @@ let
         nix.binaryCaches = lib.mkForce [ ];
         users.users.person.isNormalUser = true;
         virtualisation.writableStore = true;
-        virtualisation.memorySize = 1024 /*MiB*/;
         virtualisation.additionalPaths = [
           pkgs.hello
           pkgs.figlet
diff --git a/nixos/tests/opensmtpd-rspamd.nix b/nixos/tests/opensmtpd-rspamd.nix
index 9cb2624e6c4e9..19969a7b47ddd 100644
--- a/nixos/tests/opensmtpd-rspamd.nix
+++ b/nixos/tests/opensmtpd-rspamd.nix
@@ -39,7 +39,6 @@ import ./make-test-python.nix {
 
     smtp2 = { pkgs, ... }: {
       imports = [ common/user-account.nix ];
-      virtualisation.memorySize = 512;
       networking = {
         firewall.allowedTCPPorts = [ 25 143 ];
         useDHCP = false;
diff --git a/nixos/tests/pantheon.nix b/nixos/tests/pantheon.nix
index aebf6b534476e..989d29a966dfb 100644
--- a/nixos/tests/pantheon.nix
+++ b/nixos/tests/pantheon.nix
@@ -15,7 +15,6 @@ import ./make-test-python.nix ({ pkgs, lib, ...} :
     services.xserver.enable = true;
     services.xserver.desktopManager.pantheon.enable = true;
 
-    virtualisation.memorySize = 1024;
   };
 
   enableOCR = true;
diff --git a/nixos/tests/paperless-ng.nix b/nixos/tests/paperless-ng.nix
index a4b2f348ec328..618eeec6b1259 100644
--- a/nixos/tests/paperless-ng.nix
+++ b/nixos/tests/paperless-ng.nix
@@ -8,7 +8,6 @@ import ./make-test-python.nix ({ lib, ... }: {
       enable = true;
       passwordFile = builtins.toFile "password" "admin";
     };
-    virtualisation.memorySize = 1024;
   };
 
   testScript = ''
diff --git a/nixos/tests/plasma5-systemd-start.nix b/nixos/tests/plasma5-systemd-start.nix
index ac6fad7da6c6f..72de19af70cef 100644
--- a/nixos/tests/plasma5-systemd-start.nix
+++ b/nixos/tests/plasma5-systemd-start.nix
@@ -21,7 +21,6 @@ import ./make-test-python.nix ({ pkgs, ...} :
         user = "alice";
       };
     };
-    virtualisation.memorySize = 1024;
   };
 
   testScript = { nodes, ... }: let
diff --git a/nixos/tests/plasma5.nix b/nixos/tests/plasma5.nix
index 281c9843e9015..5c7ea602f79e0 100644
--- a/nixos/tests/plasma5.nix
+++ b/nixos/tests/plasma5.nix
@@ -19,7 +19,6 @@ import ./make-test-python.nix ({ pkgs, ...} :
       user = "alice";
     };
     hardware.pulseaudio.enable = true; # needed for the factl test, /dev/snd/* exists without them but udev doesn't care then
-    virtualisation.memorySize = 1024;
   };
 
   testScript = { nodes, ... }: let
diff --git a/nixos/tests/pleroma.nix b/nixos/tests/pleroma.nix
index d0ae1488d1346..bf3623fce38b7 100644
--- a/nixos/tests/pleroma.nix
+++ b/nixos/tests/pleroma.nix
@@ -202,7 +202,6 @@ import ./make-test-python.nix ({ pkgs, ... }:
       security.pki.certificateFiles = [ "${tls-cert}/cert.pem" ];
       networking.extraHosts = hosts nodes;
       networking.firewall.enable = false;
-      virtualisation.memorySize = 512;
       environment.systemPackages = with pkgs; [
         provision-db
         provision-secrets
diff --git a/nixos/tests/privacyidea.nix b/nixos/tests/privacyidea.nix
index 4a94f07279469..c1141465ec24e 100644
--- a/nixos/tests/privacyidea.nix
+++ b/nixos/tests/privacyidea.nix
@@ -8,7 +8,6 @@ import ./make-test-python.nix ({ pkgs, ...} : rec {
 
   machine = { ... }: {
     virtualisation.cores = 2;
-    virtualisation.memorySize = 512;
 
     services.privacyidea = {
       enable = true;
diff --git a/nixos/tests/prometheus-exporters.nix b/nixos/tests/prometheus-exporters.nix
index 38b93c4087c07..d069854328a2c 100644
--- a/nixos/tests/prometheus-exporters.nix
+++ b/nixos/tests/prometheus-exporters.nix
@@ -464,7 +464,6 @@ let
         extraFlags = [ "--lnd.network=regtest" ];
       };
       metricProvider = {
-        virtualisation.memorySize = 1024;
         systemd.services.prometheus-lnd-exporter.serviceConfig.RestartSec = 15;
         systemd.services.prometheus-lnd-exporter.after = [ "lnd.service" ];
         services.bitcoind.regtest = {
@@ -953,7 +952,6 @@ let
       };
       metricProvider = {
         services.rspamd.enable = true;
-        virtualisation.memorySize = 1024;
       };
       exporterTest = ''
         wait_for_unit("rspamd.service")
diff --git a/nixos/tests/prometheus.nix b/nixos/tests/prometheus.nix
index 20f8c4459e10c..a075cfc1f1b72 100644
--- a/nixos/tests/prometheus.nix
+++ b/nixos/tests/prometheus.nix
@@ -188,7 +188,6 @@ in import ./make-test-python.nix {
       # Minio requires at least 1GiB of free disk space to run.
       virtualisation = {
         diskSize = 2 * 1024;
-        memorySize = 1024;
       };
       networking.firewall.allowedTCPPorts = [ minioPort ];
 
diff --git a/nixos/tests/rspamd.nix b/nixos/tests/rspamd.nix
index 3fd55444fd8a5..f0ccfe7ea0e6a 100644
--- a/nixos/tests/rspamd.nix
+++ b/nixos/tests/rspamd.nix
@@ -25,7 +25,6 @@ let
     machine = {
       services.rspamd.enable = true;
       networking.enableIPv6 = enableIPv6;
-      virtualisation.memorySize = 1024;
     };
     testScript = ''
       start_all()
@@ -69,7 +68,6 @@ in
           group = "rspamd";
         }];
       };
-      virtualisation.memorySize = 1024;
     };
 
     testScript = ''
@@ -118,7 +116,6 @@ in
           '';
         };
       };
-      virtualisation.memorySize = 1024;
     };
 
     testScript = ''
@@ -224,7 +221,6 @@ in
           rspamd_logger.infox(rspamd_config, 'Work dammit!!!')
         '';
       };
-      virtualisation.memorySize = 1024;
     };
     testScript = ''
       ${initMachine}
@@ -291,7 +287,6 @@ in
         postfix.enable = true;
         workers.rspamd_proxy.type = "rspamd_proxy";
       };
-      virtualisation.memorySize = 1024;
     };
     testScript = ''
       ${initMachine}
diff --git a/nixos/tests/seafile.nix b/nixos/tests/seafile.nix
index 70b9ba55457e1..6eec8b1fbe55c 100644
--- a/nixos/tests/seafile.nix
+++ b/nixos/tests/seafile.nix
@@ -1,7 +1,6 @@
 import ./make-test-python.nix ({ pkgs, ... }:
   let
     client = { config, pkgs, ... }: {
-      virtualisation.memorySize = 256;
       environment.systemPackages = [ pkgs.seafile-shared pkgs.curl ];
     };
   in {
@@ -12,7 +11,6 @@ import ./make-test-python.nix ({ pkgs, ... }:
 
     nodes = {
       server = { config, pkgs, ... }: {
-        virtualisation.memorySize = 512;
         services.seafile = {
           enable = true;
           ccnetSettings.General.SERVICE_URL = "http://server";
diff --git a/nixos/tests/signal-desktop.nix b/nixos/tests/signal-desktop.nix
index 7bc7cfe18cf83..8c72306299230 100644
--- a/nixos/tests/signal-desktop.nix
+++ b/nixos/tests/signal-desktop.nix
@@ -29,7 +29,6 @@ in {
     environment.systemPackages = with pkgs; [
       signal-desktop file sqlite sqlcipher-signal
     ];
-    virtualisation.memorySize = 1024;
   };
 
   enableOCR = true;
diff --git a/nixos/tests/spark/default.nix b/nixos/tests/spark/default.nix
index 254cdec6e6b00..025c5a5222e71 100644
--- a/nixos/tests/spark/default.nix
+++ b/nixos/tests/spark/default.nix
@@ -3,7 +3,6 @@ import ../make-test-python.nix ({...}: {
 
   nodes = {
     worker = { nodes, pkgs, ... }: {
-      virtualisation.memorySize = 1024;
       services.spark.worker = {
         enable = true;
         master = "master:7077";
diff --git a/nixos/tests/sway.nix b/nixos/tests/sway.nix
index 01240ef572a68..3476ebab3e26c 100644
--- a/nixos/tests/sway.nix
+++ b/nixos/tests/sway.nix
@@ -44,7 +44,6 @@ import ./make-test-python.nix ({ pkgs, lib, ...} :
     # To test pinentry via gpg-agent:
     programs.gnupg.agent.enable = true;
 
-    virtualisation.memorySize = 1024;
     # Need to switch to a different GPU driver than the default one (-vga std) so that Sway can launch:
     virtualisation.qemu.options = [ "-vga none -device virtio-gpu-pci" ];
   };
diff --git a/nixos/tests/sympa.nix b/nixos/tests/sympa.nix
index eb38df180a789..aad7c95b6c99c 100644
--- a/nixos/tests/sympa.nix
+++ b/nixos/tests/sympa.nix
@@ -5,7 +5,6 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
   machine =
     { ... }:
     {
-      virtualisation.memorySize = 1024;
 
       services.sympa = {
         enable = true;
diff --git a/nixos/tests/systemd-cryptenroll.nix b/nixos/tests/systemd-cryptenroll.nix
index 2c436f2de890b..49634ef65672c 100644
--- a/nixos/tests/systemd-cryptenroll.nix
+++ b/nixos/tests/systemd-cryptenroll.nix
@@ -8,7 +8,6 @@ import ./make-test-python.nix ({ pkgs, ... }: {
     environment.systemPackages = [ pkgs.cryptsetup ];
     virtualisation = {
       emptyDiskImages = [ 512 ];
-      memorySize = 1024;
       qemu.options = [
         "-chardev socket,id=chrtpm,path=/tmp/swtpm-sock"
         "-tpmdev emulator,id=tpm0,chardev=chrtpm"
diff --git a/nixos/tests/systemd.nix b/nixos/tests/systemd.nix
index e0685f53a9454..6561f7efe1a5f 100644
--- a/nixos/tests/systemd.nix
+++ b/nixos/tests/systemd.nix
@@ -5,7 +5,6 @@ import ./make-test-python.nix ({ pkgs, ... }: {
     imports = [ common/user-account.nix common/x11.nix ];
 
     virtualisation.emptyDiskImages = [ 512 512 ];
-    virtualisation.memorySize = 1024;
 
     environment.systemPackages = [ pkgs.cryptsetup ];
 
diff --git a/nixos/tests/vault-postgresql.nix b/nixos/tests/vault-postgresql.nix
index a563aead22a3b..071cfd106ffbc 100644
--- a/nixos/tests/vault-postgresql.nix
+++ b/nixos/tests/vault-postgresql.nix
@@ -12,7 +12,6 @@ import ./make-test-python.nix ({ pkgs, ... }:
     maintainers = [ lnl7 roberth ];
   };
   machine = { lib, pkgs, ... }: {
-    virtualisation.memorySize = 512;
     environment.systemPackages = [ pkgs.vault ];
     environment.variables.VAULT_ADDR = "http://127.0.0.1:8200";
     services.vault.enable = true;
diff --git a/nixos/tests/vault.nix b/nixos/tests/vault.nix
index c3b28b62695ad..e86acd5b593fb 100644
--- a/nixos/tests/vault.nix
+++ b/nixos/tests/vault.nix
@@ -8,7 +8,6 @@ import ./make-test-python.nix ({ pkgs, ... }:
     environment.systemPackages = [ pkgs.vault ];
     environment.variables.VAULT_ADDR = "http://127.0.0.1:8200";
     services.vault.enable = true;
-    virtualisation.memorySize = 512;
   };
 
   testScript =
diff --git a/nixos/tests/vaultwarden.nix b/nixos/tests/vaultwarden.nix
index b5343f5cad2d7..56f1d245d5052 100644
--- a/nixos/tests/vaultwarden.nix
+++ b/nixos/tests/vaultwarden.nix
@@ -140,7 +140,6 @@ let
               in
               [ pkgs.firefox-unwrapped pkgs.geckodriver testRunner ];
 
-            virtualisation.memorySize = 768;
           }
         ];
 
diff --git a/nixos/tests/vscodium.nix b/nixos/tests/vscodium.nix
index 033090aa0e3d1..43a0d61c856f5 100644
--- a/nixos/tests/vscodium.nix
+++ b/nixos/tests/vscodium.nix
@@ -1,47 +1,69 @@
-import ./make-test-python.nix ({ pkgs, ...} :
+let
+  tests = {
+    wayland = { pkgs, ... }: {
+      imports = [ ./common/wayland-cage.nix ];
 
-{
-  name = "vscodium";
-  meta = with pkgs.lib.maintainers; {
-    maintainers = [ turion ];
+      services.cage.program = ''
+        ${pkgs.vscodium}/bin/codium \
+          --enable-features=UseOzonePlatform \
+          --ozone-platform=wayland
+      '';
+
+      fonts.fonts = with pkgs; [ dejavu_fonts ];
+    };
+    xorg = { pkgs, ... }: {
+      imports = [ ./common/user-account.nix ./common/x11.nix ];
+
+      virtualisation.memorySize = 2047;
+      services.xserver.enable = true;
+      services.xserver.displayManager.sessionCommands = ''
+        ${pkgs.vscodium}/bin/codium
+      '';
+      test-support.displayManager.auto.user = "alice";
+    };
   };
 
-  machine = { ... }:
+  mkTest = name: machine:
+    import ./make-test-python.nix ({ pkgs, ... }: {
+      inherit name;
 
-  {
-    imports = [
-      ./common/user-account.nix
-      ./common/x11.nix
-    ];
+      nodes = { "${name}" = machine; };
 
-    virtualisation.memorySize = 2047;
-    services.xserver.enable = true;
-    test-support.displayManager.auto.user = "alice";
-    environment.systemPackages = with pkgs; [
-      vscodium
-    ];
-  };
+      meta = with pkgs.lib.maintainers; {
+        maintainers = [ synthetica turion ];
+      };
+      enableOCR = true;
+      testScript = ''
+        start_all()
+
+        machine.wait_for_unit('graphical.target')
+        machine.wait_until_succeeds('pgrep -x codium')
 
-  enableOCR = true;
+        # Wait until vscodium is visible. "File" is in the menu bar.
+        machine.wait_for_text('File')
+        machine.screenshot('start_screen')
 
-  testScript = { nodes, ... }: ''
-    # Start up X
-    start_all()
-    machine.wait_for_x()
+        test_string = 'testfile'
 
-    # Start VSCodium with a file that doesn't exist yet
-    machine.fail("ls /home/alice/foo.txt")
-    machine.succeed("su - alice -c 'codium foo.txt' >&2 &")
+        # Create a new file
+        machine.send_key('ctrl-n')
+        machine.wait_for_text('Untitled')
+        machine.screenshot('empty_editor')
 
-    # Wait for the window to appear
-    machine.wait_for_text("VSCodium")
+        # Type a string
+        machine.send_chars(test_string)
+        machine.wait_for_text(test_string)
+        machine.screenshot('editor')
 
-    # Save file
-    machine.send_key("ctrl-s")
+        # Save the file
+        machine.send_key('ctrl-s')
+        machine.wait_for_text('Save')
+        machine.screenshot('save_window')
+        machine.send_key('ret')
 
-    # Wait until the file has been saved
-    machine.wait_for_file("/home/alice/foo.txt")
+        # (the default filename is the first line of the file)
+        machine.wait_for_file(f'/home/alice/{test_string}')
+      '';
+    });
 
-    machine.screenshot("VSCodium")
-  '';
-})
+in builtins.mapAttrs (k: v: mkTest k v { }) tests
diff --git a/nixos/tests/xfce.nix b/nixos/tests/xfce.nix
index 148eccdbe3084..9051deebae76e 100644
--- a/nixos/tests/xfce.nix
+++ b/nixos/tests/xfce.nix
@@ -23,7 +23,6 @@ import ./make-test-python.nix ({ pkgs, ...} : {
 
       hardware.pulseaudio.enable = true; # needed for the factl test, /dev/snd/* exists without them but udev doesn't care then
 
-      virtualisation.memorySize = 1024;
     };
 
   testScript = { nodes, ... }: let
diff --git a/pkgs/applications/audio/vimpc/default.nix b/pkgs/applications/audio/vimpc/default.nix
index a576898128ec6..5cc3c1099995f 100644
--- a/pkgs/applications/audio/vimpc/default.nix
+++ b/pkgs/applications/audio/vimpc/default.nix
@@ -1,6 +1,7 @@
 { lib
 , stdenv
 , fetchFromGitHub
+, fetchpatch
 , autoreconfHook
 , libmpdclient
 , ncurses
@@ -21,6 +22,16 @@ stdenv.mkDerivation rec {
     sha256 = "0lswzkap2nm7v5h7ppb6a64cb35rajysd09nb204rxgrkij4m6nx";
   };
 
+  patches = [
+    # Pull fix pending upstream inclusion for ncurses-6.3:
+    #  https://github.com/boysetsfrog/vimpc/pull/100
+    (fetchpatch {
+      name = "ncurses-6.3.patch";
+      url = "https://github.com/boysetsfrog/vimpc/commit/055ecdce0720fdfc9ec2528c520b6c33da36271b.patch";
+      sha256 = "01p858jjxm0bf8hnk1z8h45j8c1y9i995mafa6ff3vg9vlak61pv";
+    })
+  ];
+
   nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ libmpdclient ncurses pcre taglib curl ];
 
diff --git a/pkgs/applications/audio/zynaddsubfx/default.nix b/pkgs/applications/audio/zynaddsubfx/default.nix
index 4b3cbb171bd0e..e738a0fbcbe54 100644
--- a/pkgs/applications/audio/zynaddsubfx/default.nix
+++ b/pkgs/applications/audio/zynaddsubfx/default.nix
@@ -89,6 +89,19 @@ in stdenv.mkDerivation rec {
   doCheck = true;
   checkInputs = [ cxxtest ];
 
+  # TODO: Update cmake hook to make it simpler to selectively disable cmake tests: #113829
+  checkPhase = let
+    # Tests fail on aarch64
+    disabledTests = lib.optionals stdenv.isAarch64 [
+      "MessageTest"
+      "UnisonTest"
+    ];
+  in ''
+    runHook preCheck
+    ctest --output-on-failure -E '^${lib.concatStringsSep "|" disabledTests}$'
+    runHook postCheck
+  '';
+
   # When building with zest GUI, patch plugins
   # and standalone executable to properly locate zest
   postFixup = lib.optionalString (guiModule == "zest") ''
diff --git a/pkgs/applications/gis/qgis/unwrapped.nix b/pkgs/applications/gis/qgis/unwrapped.nix
index 70b5ffcc707ce..4f62ccecbaf57 100644
--- a/pkgs/applications/gis/qgis/unwrapped.nix
+++ b/pkgs/applications/gis/qgis/unwrapped.nix
@@ -1,7 +1,6 @@
 { lib
 , mkDerivation
 , fetchFromGitHub
-, fetchpatch
 , cmake
 , ninja
 , flex
@@ -57,23 +56,16 @@ let
     six
   ];
 in mkDerivation rec {
-  version = "3.16.10";
+  version = "3.16.13";
   pname = "qgis-unwrapped";
 
   src = fetchFromGitHub {
     owner = "qgis";
     repo = "QGIS";
     rev = "final-${lib.replaceStrings [ "." ] [ "_" ] version}";
-    sha256 = "sha256-/lsfyTDlkZNIVHg5qgZW7qfOyTC2+1r3ZbsnQmEdy30=";
+    sha256 = "13irzs89lknfxf2y7j931bh0zmqgiwifdbbzvwn8yxxr21gd68ac";
   };
 
-  patches = [
-    (fetchpatch {
-      url = "https://github.com/qgis/QGIS/commit/fc1ac8bef8dcc3194857ecd32519aca4867b4fa1.patch";
-      sha256 = "106smg3drx8c7yxzfhd1c7xrq757l5cfxx8lklihyvr4a7wc9gpy";
-    })
-  ];
-
   passthru = {
     inherit pythonBuildInputs;
     inherit python3Packages;
diff --git a/pkgs/applications/graphics/f3d/default.nix b/pkgs/applications/graphics/f3d/default.nix
index 92875bcaeee67..bcf707bcced61 100644
--- a/pkgs/applications/graphics/f3d/default.nix
+++ b/pkgs/applications/graphics/f3d/default.nix
@@ -1,15 +1,14 @@
-{ lib, stdenv, fetchFromGitLab, cmake, vtk_9, libX11, libGL, Cocoa, OpenGL }:
+{ lib, stdenv, fetchFromGitHub, cmake, vtk_9, libX11, libGL, Cocoa, OpenGL }:
 
 stdenv.mkDerivation rec {
   pname = "f3d";
-  version = "1.1.0";
+  version = "1.1.1";
 
-  src = fetchFromGitLab {
-    domain = "gitlab.kitware.com";
-    owner = "f3d";
+  src = fetchFromGitHub {
+    owner = "f3d-app";
     repo = "f3d";
     rev = "v${version}";
-    sha256 = "0lj20k5qyw9z85k3wsp05f7dcv7v7asrnppi8i1jm32dzxjm4siw";
+    sha256 = "sha256-ToFP2Q+Oi+MEU9FEe5CNp0pD0bQUBQh34B9guajnqgI=";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/applications/graphics/fluxus/default.nix b/pkgs/applications/graphics/fluxus/default.nix
index 3db183b2531a5..70d35ed671bb7 100644
--- a/pkgs/applications/graphics/fluxus/default.nix
+++ b/pkgs/applications/graphics/fluxus/default.nix
@@ -17,7 +17,7 @@
 , ode
 , openal
 , openssl
-, racket
+, racket_7_9
 , sconsPackages
 , zlib
 }:
@@ -42,6 +42,7 @@ let
     openssl
     zlib
   ];
+  racket = racket_7_9;
 in
 stdenv.mkDerivation rec {
   pname = "fluxus";
@@ -67,7 +68,7 @@ stdenv.mkDerivation rec {
     ode
     openal
     openssl.dev
-    racket
+    racket_7_9
   ];
   nativeBuildInputs = [ sconsPackages.scons_3_1_2 ];
 
diff --git a/pkgs/applications/graphics/gimp/default.nix b/pkgs/applications/graphics/gimp/default.nix
index 86550b873719c..11a9382c94c8b 100644
--- a/pkgs/applications/graphics/gimp/default.nix
+++ b/pkgs/applications/graphics/gimp/default.nix
@@ -148,6 +148,8 @@ in stdenv.mkDerivation rec {
   # test-eevl.c:64:36: error: initializer element is not a compile-time constant
   doCheck = !stdenv.isDarwin;
 
+  NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin "-DGDK_OSX_BIG_SUR=16";
+
   # Check if librsvg was built with --disable-pixbuf-loader.
   PKG_CONFIG_GDK_PIXBUF_2_0_GDK_PIXBUF_MODULEDIR = "${librsvg}/${gdk-pixbuf.moduleDir}";
 
diff --git a/pkgs/applications/graphics/gimp/plugins/default.nix b/pkgs/applications/graphics/gimp/plugins/default.nix
index 1715542adce45..17d87b60fece0 100644
--- a/pkgs/applications/graphics/gimp/plugins/default.nix
+++ b/pkgs/applications/graphics/gimp/plugins/default.nix
@@ -125,6 +125,8 @@ in
     buildInputs = with pkgs; [ fftw ];
 
     postPatch = ''
+      substituteInPlace Makefile --replace '$(GCC)' '$(CC)'
+
       # The tarball contains a prebuilt binary.
       make clean
     '';
diff --git a/pkgs/applications/graphics/hdr-plus/default.nix b/pkgs/applications/graphics/hdr-plus/default.nix
index 15042e6877ff3..0d2f19660062d 100644
--- a/pkgs/applications/graphics/hdr-plus/default.nix
+++ b/pkgs/applications/graphics/hdr-plus/default.nix
@@ -22,6 +22,10 @@ stdenv.mkDerivation rec {
     })
   ];
 
+  postPatch = ''
+    sed -i '2a #include <array>' src/InputSource.h
+  '';
+
   nativeBuildInputs = [ cmake ];
 
   buildInputs = [ halide libpng libjpeg libtiff libraw ];
diff --git a/pkgs/applications/graphics/krita/generic.nix b/pkgs/applications/graphics/krita/generic.nix
index efaf341b1f649..a0819a203e722 100644
--- a/pkgs/applications/graphics/krita/generic.nix
+++ b/pkgs/applications/graphics/krita/generic.nix
@@ -32,7 +32,7 @@ mkDerivation rec {
     openjpeg opencolorio_1 poppler curl ilmbase
     qtmultimedia qtx11extras quazip
     python3Packages.pyqt5
-  ] ++ lib.optional (stdenv.hostPlatform.isi686 || stdenv.hostPlatform.isx86_64) vc;
+  ] ++ lib.optional stdenv.hostPlatform.isx86 vc;
 
   NIX_CFLAGS_COMPILE = [ "-I${ilmbase.dev}/include/OpenEXR" ]
     ++ lib.optional stdenv.cc.isGNU "-Wno-deprecated-copy";
diff --git a/pkgs/applications/graphics/qvge/default.nix b/pkgs/applications/graphics/qvge/default.nix
index f50e87d1eddb2..442e3200e4696 100644
--- a/pkgs/applications/graphics/qvge/default.nix
+++ b/pkgs/applications/graphics/qvge/default.nix
@@ -1,13 +1,15 @@
 { lib
-, mkDerivation
+, stdenv
 , fetchFromGitHub
 , substituteAll
+, wrapQtAppsHook
 , qmake
+, qtsvg
 , qtx11extras
 , graphviz
 }:
 
-mkDerivation rec {
+stdenv.mkDerivation rec {
   pname = "qvge";
   version = "0.6.3";
 
@@ -25,15 +27,15 @@ mkDerivation rec {
     inherit graphviz;
   });
 
-  nativeBuildInputs = [ qmake ];
+  nativeBuildInputs = [ wrapQtAppsHook qmake ];
 
-  buildInputs = [ qtx11extras ];
+  buildInputs = if stdenv.isDarwin then [ qtsvg ] else [ 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;
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/applications/misc/joshuto/default.nix b/pkgs/applications/misc/joshuto/default.nix
index 5497d37ef0e13..7d4ec87b9f4bb 100644
--- a/pkgs/applications/misc/joshuto/default.nix
+++ b/pkgs/applications/misc/joshuto/default.nix
@@ -1,20 +1,17 @@
-{ fetchFromGitHub, lib, rustPlatform, stdenv, SystemConfiguration }:
+{ lib, rustPlatform, fetchFromGitHub, stdenv, SystemConfiguration }:
 
 rustPlatform.buildRustPackage rec {
   pname = "joshuto";
-  version = "0.9.1";
+  version = "0.9.2";
 
   src = fetchFromGitHub {
     owner = "kamiyaa";
     repo = pname;
     rev = version;
-    sha256 = "sha256-+qKOvFoEF/gZL4ijL8lIRWE9ZWJM2eBlk29Lk46jAfQ=";
+    sha256 = "sha256-9TGHSGYCzU6uAIO4zZ/6+B4oVPE6SD9Phl4dShylW5o=";
   };
 
-  # upstream includes an outdated Cargo.lock that stops cargo from compiling
-  cargoPatches = [ ./fix-cargo-lock.patch ];
-
-  cargoSha256 = "sha256-JlekxU9pMkHNsIcH3+7b2I6MYUlxRqNX+0wwyVrQMAE=";
+  cargoSha256 = "sha256-g8YYOk2RW4GPdkWlvAxd5KFdV4S1l5yKEzNm9OAc8RI=";
 
   buildInputs = lib.optional stdenv.isDarwin SystemConfiguration;
 
diff --git a/pkgs/applications/misc/joshuto/fix-cargo-lock.patch b/pkgs/applications/misc/joshuto/fix-cargo-lock.patch
deleted file mode 100644
index 023c824add10e..0000000000000
--- a/pkgs/applications/misc/joshuto/fix-cargo-lock.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/Cargo.lock
-+++ b/Cargo.lock
-@@ -512,7 +512,7 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
- 
- [[package]]
- name = "joshuto"
--version = "0.9.0"
-+version = "0.9.1"
- dependencies = [
-  "alphanumeric-sort",
-  "chrono",
diff --git a/pkgs/applications/misc/prusa-slicer/super-slicer.nix b/pkgs/applications/misc/prusa-slicer/super-slicer.nix
index 479e497e3418e..e7edafb5c05bb 100644
--- a/pkgs/applications/misc/prusa-slicer/super-slicer.nix
+++ b/pkgs/applications/misc/prusa-slicer/super-slicer.nix
@@ -6,7 +6,7 @@ let
 
   versions = {
     stable = { version = "2.3.56.9"; sha256 = "sha256-vv01wGQkrasKKjpGSDeDqZbd1X5/iTfGXYN5Jwz+FKE="; };
-    staging = { version = "2.3.57.0"; sha256 = "sha256-7o0AqgQcKYc6c+Hi3x5pC/pKJZPlEsYOYk9sC21+mvM="; };
+    staging = { version = "2.3.57.6"; sha256 = "sha256-ZCOtVmvNXDWLo9UMzxARCp+iyRTcy/ogd5sV0k86JG8="; };
   };
 
   override = { version, sha256 }: super: {
diff --git a/pkgs/applications/networking/browsers/chromium/update.py b/pkgs/applications/networking/browsers/chromium/update.py
index 72d6df055b387..f13bda6f5075a 100755
--- a/pkgs/applications/networking/browsers/chromium/update.py
+++ b/pkgs/applications/networking/browsers/chromium/update.py
@@ -5,6 +5,7 @@
 via upstream-info.json."""
 # Usage: ./update.py [--commit]
 
+import base64
 import csv
 import json
 import re
@@ -48,9 +49,10 @@ def nix_prefetch_git(url, rev):
 
 def get_file_revision(revision, file_path):
     """Fetches the requested Git revision of the given Chromium file."""
-    url = f'https://raw.githubusercontent.com/chromium/chromium/{revision}/{file_path}'
+    url = f'https://chromium.googlesource.com/chromium/src/+/refs/tags/{revision}/{file_path}?format=TEXT'
     with urlopen(url) as http_response:
-        return http_response.read()
+        resp = http_response.read()
+        return base64.b64decode(resp)
 
 
 def get_matching_chromedriver(version):
diff --git a/pkgs/applications/networking/browsers/chromium/upstream-info.json b/pkgs/applications/networking/browsers/chromium/upstream-info.json
index d35d3fa75175c..4e7149ec1ee5f 100644
--- a/pkgs/applications/networking/browsers/chromium/upstream-info.json
+++ b/pkgs/applications/networking/browsers/chromium/upstream-info.json
@@ -18,28 +18,28 @@
     }
   },
   "beta": {
-    "version": "96.0.4664.45",
-    "sha256": "01q4fsf2cbx6g9nnaihvc5jj3ap8jq2gf16pnhf7ixzbhgcnm328",
-    "sha256bin64": "1vaazcrlx0999xd9yp25i9kzb8y8g0yqd28xssw7jqwrhz033wgr",
+    "version": "97.0.4692.20",
+    "sha256": "1njgfz3kz1pyyaaskqc47ldy2gzc3c9a8mjib81nalzrqbmd3372",
+    "sha256bin64": "0nsaf46a9pl8cxw5v2zsfp2ynja4m55qi1m4mhwhmyr50138655f",
     "deps": {
       "gn": {
-        "version": "2021-09-24",
+        "version": "2021-11-03",
         "url": "https://gn.googlesource.com/gn",
-        "rev": "0153d369bbccc908f4da4993b1ba82728055926a",
-        "sha256": "0y4414h8jqsbz5af6pn91c0vkfp4s281s85g992xfyl785c5zbsi"
+        "rev": "90294ccdcf9334ed25a76ac9b67689468e506342",
+        "sha256": "0n0jml8s00ayy186jzrf207hbz70pxiq426znxwxd4gjcp60scsa"
       }
     }
   },
   "dev": {
-    "version": "97.0.4692.20",
-    "sha256": "1njgfz3kz1pyyaaskqc47ldy2gzc3c9a8mjib81nalzrqbmd3372",
-    "sha256bin64": "06vsmzz8nvmx7hfqwvqfmq4h000dw22srxdrgrdfgh7mry0yvf4a",
+    "version": "98.0.4710.4",
+    "sha256": "0ay4bn9963k7bbv31wfc1iy2z6n6jjk1h2mn7m7893i81raisk8m",
+    "sha256bin64": "0n4kb6iiv9aih7yzrnr9m7znqb2p37grlj8by6gpjfikx3fxf5gg",
     "deps": {
       "gn": {
-        "version": "2021-11-03",
+        "version": "2021-11-16",
         "url": "https://gn.googlesource.com/gn",
-        "rev": "90294ccdcf9334ed25a76ac9b67689468e506342",
-        "sha256": "0n0jml8s00ayy186jzrf207hbz70pxiq426znxwxd4gjcp60scsa"
+        "rev": "4aa9bdfa05b688c58d3d7d3e496f3f18cbb3d89e",
+        "sha256": "0jwjfbxlbqxlz7wm46vyrxn3pgwyyd03as6gy5mcvvk9aialqh9f"
       }
     }
   },
diff --git a/pkgs/applications/networking/browsers/firefox/common.nix b/pkgs/applications/networking/browsers/firefox/common.nix
index 1c0832e32ca2b..b0d11bd835b62 100644
--- a/pkgs/applications/networking/browsers/firefox/common.nix
+++ b/pkgs/applications/networking/browsers/firefox/common.nix
@@ -27,7 +27,9 @@
 , ltoSupport ? (stdenv.isLinux && stdenv.is64bit), overrideCC, buildPackages
 , gssSupport ? true, libkrb5
 , pipewireSupport ? waylandSupport && webrtcSupport, pipewire
-, jemallocSupport ? true, jemalloc
+# Workaround: disabled since currently jemalloc causes crashes with LLVM 13.
+# https://bugzilla.mozilla.org/show_bug.cgi?id=1741454
+, jemallocSupport ? false, jemalloc
 
 ## privacy-related options
 
@@ -71,6 +73,9 @@
 # > the experience of Firefox users, you won't have any issues using the
 # > official branding.
 , enableOfficialBranding ? true
+
+# On 32bit platforms, we disable adding "-g" for easier linking.
+, enableDebugSymbols ? !stdenv.is32bit
 }:
 
 assert stdenv.cc.libc or null != null;
@@ -116,12 +121,6 @@ let
                 })
                 else stdenv;
 
-  # --enable-release adds -ffunction-sections & LTO that require a big amount of
-  # RAM and the 32-bit memory space cannot handle that linking
-  # We also disable adding "-g" for easier linking
-  releaseFlags = if stdenv.is32bit
-                 then [ "--disable-release" "--disable-debug-symbols" ]
-                 else [ "--enable-release" ];
 in
 
 buildStdenv.mkDerivation ({
@@ -174,10 +173,6 @@ buildStdenv.mkDerivation ({
                                           AVFoundation MediaToolbox CoreLocation
                                           Foundation libobjc AddressBook cups ];
 
-  NIX_LDFLAGS = lib.optionalString ltoSupport ''
-    -rpath ${llvmPackages.libunwind.out}/lib
-  '';
-
   MACH_USE_SYSTEM_PYTHON = "1";
 
   postPatch = ''
@@ -206,6 +201,9 @@ buildStdenv.mkDerivation ({
     ++ lib.optionals buildStdenv.isDarwin [ xcbuild rsync ]
     ++ extraNativeBuildInputs;
 
+  separateDebugInfo = enableDebugSymbols;
+  setOutputFlags = false; # `./mach configure` doesn't understand `--*dir=` flags.
+
   preConfigure = ''
     # remove distributed configuration files
     rm -f configure
@@ -229,7 +227,11 @@ buildStdenv.mkDerivation ({
       ${lib.optionalString buildStdenv.cc.isClang "-idirafter ${buildStdenv.cc.cc.lib}/lib/clang/${lib.getVersion buildStdenv.cc.cc}/include"} \
       ${lib.optionalString buildStdenv.cc.isGNU "-isystem ${lib.getDev buildStdenv.cc.cc}/include/c++/${lib.getVersion buildStdenv.cc.cc} -isystem ${buildStdenv.cc.cc}/include/c++/${lib.getVersion buildStdenv.cc.cc}/${buildStdenv.hostPlatform.config}"} \
       $NIX_CFLAGS_COMPILE"
-
+    ${
+    # Bindgen doesn't like the flag added by `separateDebugInfo`.
+    lib.optionalString enableDebugSymbols ''
+      BINDGEN_CFLAGS="''${BINDGEN_CFLAGS/ -Wa,--compress-debug-sections/}"
+    ''}
     echo "ac_add_options BINDGEN_CFLAGS='$BINDGEN_CFLAGS'" >> $MOZCONFIG
   '' + (lib.optionalString googleAPISupport ''
     # Google API key used by Chromium and Firefox.
@@ -273,7 +275,7 @@ buildStdenv.mkDerivation ({
   #   https://bugzilla.mozilla.org/show_bug.cgi?id=1538724
   # elf-hack is broken when using clang+lld:
   #   https://bugzilla.mozilla.org/show_bug.cgi?id=1482204
-  ++ lib.optional ltoSupport "--enable-lto"
+  ++ lib.optional ltoSupport "--enable-lto=cross" # Cross-language LTO.
   ++ lib.optional (ltoSupport && (buildStdenv.isAarch32 || buildStdenv.isi686 || buildStdenv.isx86_64)) "--disable-elf-hack"
   ++ lib.optional (ltoSupport && !buildStdenv.isDarwin) "--enable-linker=lld"
 
@@ -287,9 +289,13 @@ buildStdenv.mkDerivation ({
   ++ lib.optional drmSupport "--enable-eme=widevine"
 
   ++ (if debugBuild then [ "--enable-debug" "--enable-profiling" ]
-                    else ([ "--disable-debug"
-                           "--enable-optimize"
-                           "--enable-strip" ] ++ releaseFlags))
+                    else [ "--disable-debug" "--enable-optimize" ])
+  # --enable-release adds -ffunction-sections & LTO that require a big amount of
+  # RAM and the 32-bit memory space cannot handle that linking
+  ++ flag (!debugBuild && !stdenv.is32bit) "release"
+  ++ flag enableDebugSymbols "debug-symbols"
+  ++ lib.optionals enableDebugSymbols [ "--disable-strip" "--disable-install-strip" ]
+
   ++ lib.optional enableOfficialBranding "--enable-official-branding"
   ++ extraConfigureFlags;
 
@@ -297,14 +303,7 @@ buildStdenv.mkDerivation ({
     cd obj-*
   '';
 
-  makeFlags = lib.optionals ltoSupport [
-    "AR=${buildStdenv.cc.bintools.bintools}/bin/llvm-ar"
-    "LLVM_OBJDUMP=${buildStdenv.cc.bintools.bintools}/bin/llvm-objdump"
-    "NM=${buildStdenv.cc.bintools.bintools}/bin/llvm-nm"
-    "RANLIB=${buildStdenv.cc.bintools.bintools}/bin/llvm-ranlib"
-    "STRIP=${buildStdenv.cc.bintools.bintools}/bin/llvm-strip"
-  ]
-  ++ extraMakeFlags;
+  makeFlags = extraMakeFlags;
 
   enableParallelBuilding = true;
   doCheck = false; # "--disable-tests" above
@@ -322,6 +321,42 @@ buildStdenv.mkDerivation ({
     gappsWrapperArgs+=(--argv0 "$out/bin/.${binaryName}-wrapped")
   '';
 
+  # Workaround: The separateDebugInfo hook skips artifacts whose build ID's length is not 40.
+  # But we got 16-length build ID here. The function body is mainly copied from pkgs/build-support/setup-hooks/separate-debug-info.sh
+  # Remove it when PR #146275 is merged.
+  preFixup = lib.optionalString enableDebugSymbols ''
+    _separateDebugInfo() {
+        [ -e "$prefix" ] || return 0
+
+        local dst="''${debug:-$out}"
+        if [ "$prefix" = "$dst" ]; then return 0; fi
+
+        dst="$dst/lib/debug/.build-id"
+
+        # Find executables and dynamic libraries.
+        local i
+        while IFS= read -r -d $'\0' i; do
+            if ! isELF "$i"; then continue; fi
+
+            # Extract the Build ID. FIXME: there's probably a cleaner way.
+            local id="$($READELF -n "$i" | sed 's/.*Build ID: \([0-9a-f]*\).*/\1/; t; d')"
+            if [[ -z "$id" ]]; then
+                echo "could not find build ID of $i, skipping" >&2
+                continue
+            fi
+
+            # Extract the debug info.
+            header "separating debug info from $i (build ID $id)"
+            mkdir -p "$dst/''${id:0:2}"
+            $OBJCOPY --only-keep-debug "$i" "$dst/''${id:0:2}/''${id:2}.debug"
+            $STRIP --strip-debug "$i"
+
+            # Also a create a symlink <original-name>.debug.
+            ln -sfn ".build-id/''${id:0:2}/''${id:2}.debug" "$dst/../$(basename "$i")"
+        done < <(find "$prefix" -type f -print0)
+    }
+  '';
+
   doInstallCheck = true;
   installCheckPhase = ''
     # Some basic testing
diff --git a/pkgs/applications/networking/browsers/tor-browser-bundle-bin/default.nix b/pkgs/applications/networking/browsers/tor-browser-bundle-bin/default.nix
index 0e1f67800a20d..c36d37ccfdf7a 100644
--- a/pkgs/applications/networking/browsers/tor-browser-bundle-bin/default.nix
+++ b/pkgs/applications/networking/browsers/tor-browser-bundle-bin/default.nix
@@ -23,7 +23,7 @@
 , pango
 
 , audioSupport ? mediaSupport
-, pulseaudioSupport ? false
+, pulseaudioSupport ? mediaSupport
 , libpulseaudio
 , apulse
 
diff --git a/pkgs/applications/networking/instant-messengers/rocketchat-desktop/default.nix b/pkgs/applications/networking/instant-messengers/rocketchat-desktop/default.nix
index 36e7a651eb3e9..73886d1cc52a5 100644
--- a/pkgs/applications/networking/instant-messengers/rocketchat-desktop/default.nix
+++ b/pkgs/applications/networking/instant-messengers/rocketchat-desktop/default.nix
@@ -1,16 +1,20 @@
-{ lib, stdenv, pkgs, fetchurl }:
+{ lib, stdenv, pkgs, fetchurl, wrapGAppsHook }:
 let
   libPathNative = { packages }: lib.makeLibraryPath packages;
 in
 stdenv.mkDerivation rec {
   pname = "rocketchat-desktop";
-  version = "3.5.7";
+  version = "3.6.0";
 
   src = fetchurl {
     url = "https://github.com/RocketChat/Rocket.Chat.Electron/releases/download/${version}/rocketchat_${version}_amd64.deb";
-    sha256 = "1ri8a60fsbqgq83f8wkyfnd59nqk4d0gpz1vanj54769zflpl71s";
+    sha256 = "1691mzg52hkvkzm4pvmjyc3n04ppxk36rjk7zxh8682ciszz9pl3";
   };
 
+  nativeBuildInputs = [
+    wrapGAppsHook #to fully work with gnome also needs programs.dconf.enable = true in your configuration.nix
+  ];
+
   buildInputs = with pkgs; [
     gtk3
     stdenv.cc.cc
diff --git a/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix b/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix
index c8797423bedbb..20e5898133819 100644
--- a/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix
+++ b/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix
@@ -10,7 +10,6 @@
 , hunspellDicts, spellcheckerLanguage ? null # E.g. "de_DE"
 # For a full list of available languages:
 # $ cat pkgs/development/libraries/hunspell/dictionaries.nix | grep "dictFileName =" | awk '{ print $3 }'
-, sqlcipher
 }:
 
 let
@@ -23,42 +22,9 @@ let
       --set HUNSPELL_DICTIONARIES "${hunspellDicts.${hunspellDict}}/share/hunspell" \
       --set LC_MESSAGES "${spellcheckerLanguage}"'');
 
-  sqlcipher-signal = sqlcipher.overrideAttrs (_: {
-    # Using the same features as the upstream signal sqlcipher build
-    # https://github.com/signalapp/better-sqlite3/blob/2fa02d2484e9f9a10df5ac7ea4617fb2dff30006/deps/defines.gypi
-    CFLAGS = [
-      "-DSQLITE_LIKE_DOESNT_MATCH_BLOBS"
-      "-DSQLITE_THREADSAFE=2"
-      "-DSQLITE_USE_URI=0"
-      "-DSQLITE_DEFAULT_MEMSTATUS=0"
-      "-DSQLITE_OMIT_DEPRECATED"
-      "-DSQLITE_OMIT_GET_TABLE"
-      "-DSQLITE_OMIT_TCL_VARIABLE"
-      "-DSQLITE_OMIT_PROGRESS_CALLBACK"
-      "-DSQLITE_OMIT_SHARED_CACHE"
-      "-DSQLITE_TRACE_SIZE_LIMIT=32"
-      "-DSQLITE_DEFAULT_CACHE_SIZE=-16000"
-      "-DSQLITE_DEFAULT_FOREIGN_KEYS=1"
-      "-DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1"
-      "-DSQLITE_ENABLE_COLUMN_METADATA"
-      "-DSQLITE_ENABLE_UPDATE_DELETE_LIMIT"
-      "-DSQLITE_ENABLE_STAT4"
-      "-DSQLITE_ENABLE_FTS5"
-      "-DSQLITE_ENABLE_JSON1"
-      "-DSQLITE_ENABLE_RTREE"
-      "-DSQLITE_INTROSPECTION_PRAGMAS"
-
-      # SQLCipher-specific options
-      "-DSQLITE_HAS_CODEC"
-      "-DSQLITE_TEMP_STORE=2"
-      "-DSQLITE_SECURE_DELETE"
-    ];
-
-    LDFLAGS = [ "-lm" ];
-  });
 in stdenv.mkDerivation rec {
   pname = "signal-desktop";
-  version = "5.23.1"; # Please backport all updates to the stable channel.
+  version = "5.24.0"; # Please backport all updates to the stable channel.
   # All releases have a limited lifetime and "expire" 90 days after the release.
   # When releases "expire" the application becomes unusable until an update is
   # applied. The expiration date for the current release can be extracted with:
@@ -68,7 +34,7 @@ in stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "https://updates.signal.org/desktop/apt/pool/main/s/signal-desktop/signal-desktop_${version}_amd64.deb";
-    sha256 = "0scbnkkbaqyqiz6bfvhdrc0yqnccjsf66iggjpa7kjyk3cy61s6c";
+    sha256 = "1p19vs4wxlghv8cbsq5k4bl8h9fzr9izp4k4qs5fcnqiy1z92ycy";
   };
 
   nativeBuildInputs = [
@@ -153,7 +119,6 @@ in stdenv.mkDerivation rec {
   preFixup = ''
     gappsWrapperArgs+=(
       --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc ] }"
-      --prefix LD_PRELOAD : "${sqlcipher-signal}/lib/libsqlcipher.so"
       ${customLanguageWrapperArgs}
     )
 
diff --git a/pkgs/applications/networking/instant-messengers/viber/default.nix b/pkgs/applications/networking/instant-messengers/viber/default.nix
index 53eea50767f56..97df6d643c88e 100644
--- a/pkgs/applications/networking/instant-messengers/viber/default.nix
+++ b/pkgs/applications/networking/instant-messengers/viber/default.nix
@@ -6,12 +6,12 @@
 
 stdenv.mkDerivation {
   pname = "viber";
-  version = "13.3.1.22";
+  version = "16.1.0.37";
 
   src = fetchurl {
     # Official link: https://download.cdn.viber.com/cdn/desktop/Linux/viber.deb
-    url = "http://web.archive.org/web/20210602004133/https://download.cdn.viber.com/cdn/desktop/Linux/viber.deb";
-    sha256 = "0rs26x0lycavybn6k1hbb5kzms0zzcmxlrmi4g8k7vyafj6s8dqh";
+    url = "https://web.archive.org/web/20211119123858/https://download.cdn.viber.com/cdn/desktop/Linux/viber.deb";
+    sha256 = "sha256-hOz+EQc2OOlLTPa2kOefPJMUyWvSvrgqgPgBKjWE3p8=";
   };
 
   nativeBuildInputs = [ makeWrapper ];
diff --git a/pkgs/applications/science/biology/hmmer/default.nix b/pkgs/applications/science/biology/hmmer/default.nix
index 0f83178626bf6..2a4df9d21dbac 100644
--- a/pkgs/applications/science/biology/hmmer/default.nix
+++ b/pkgs/applications/science/biology/hmmer/default.nix
@@ -20,6 +20,7 @@ stdenv.mkDerivation rec {
     homepage = "http://hmmer.org/";
     license = licenses.gpl3;
     maintainers = [ maintainers.iimog ];
-    platforms = platforms.unix;
+    # at least SSE is *required*
+    platforms = platforms.x86_64;
   };
 }
diff --git a/pkgs/applications/science/logic/monosat/default.nix b/pkgs/applications/science/logic/monosat/default.nix
index b26c122064a82..1356c88d478fc 100644
--- a/pkgs/applications/science/logic/monosat/default.nix
+++ b/pkgs/applications/science/logic/monosat/default.nix
@@ -31,7 +31,7 @@ let
   # source behind __linux__ check assumes system is also x86 and
   # tries to disable x86/x87-specific extended precision mode
   # https://github.com/sambayless/monosat/issues/33
-  commonPostPatch = lib.optionalString (!(stdenv.isi686 || stdenv.isx86_64)) ''
+  commonPostPatch = lib.optionalString (!stdenv.hostPlatform.isx86) ''
     substituteInPlace src/monosat/Main.cc \
       --replace 'defined(__linux__)' '0'
   '';
diff --git a/pkgs/applications/science/math/R/default.nix b/pkgs/applications/science/math/R/default.nix
index 815d108ce4125..d08078c356e1a 100644
--- a/pkgs/applications/science/math/R/default.nix
+++ b/pkgs/applications/science/math/R/default.nix
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
 
   # Test of the examples for package 'tcltk' fails in Darwin sandbox. See:
   # https://github.com/NixOS/nixpkgs/issues/146131
-  prePatch = lib.optionalString stdenv.isDarwin ''
+  postPatch = lib.optionalString stdenv.isDarwin ''
     substituteInPlace configure \
       --replace "-install_name libRblas.dylib" "-install_name $out/lib/R/lib/libRblas.dylib" \
       --replace "-install_name libRlapack.dylib" "-install_name $out/lib/R/lib/libRlapack.dylib" \
diff --git a/pkgs/applications/science/math/pari/default.nix b/pkgs/applications/science/math/pari/default.nix
index fc1a2e0abf8cb..4ba1d5c6b474e 100644
--- a/pkgs/applications/science/math/pari/default.nix
+++ b/pkgs/applications/science/math/pari/default.nix
@@ -1,10 +1,11 @@
-{ lib, stdenv
+{ lib
+, stdenv
 , fetchurl
 , gmp
-, readline
 , libX11
-, tex
 , perl
+, readline
+, tex
 , withThread ? true, libpthreadstubs
 }:
 
@@ -12,7 +13,7 @@ assert withThread -> libpthreadstubs != null;
 
 stdenv.mkDerivation rec {
   pname = "pari";
-  version = "2.13.1";
+  version = "2.13.3";
 
   src = fetchurl {
     urls = [
@@ -20,30 +21,25 @@ stdenv.mkDerivation rec {
       # old versions are at the url below
       "https://pari.math.u-bordeaux.fr/pub/pari/OLD/${lib.versions.majorMinor version}/${pname}-${version}.tar.gz"
     ];
-    sha256 = "sha256-gez31wzNquIwFlz/Ynyc4uwpe48i+fQHQiedhfht/LE=";
+    hash = "sha256-zLp/FgbGhU8UQ2N7tXrQlY1Bx/R1P4roRZ8dZMJnoco=";
   };
 
-  patches = [
-    # rebased version of 3edb98db78, see
-    # https://pari.math.u-bordeaux.fr/cgi-bin/bugreport.cgi?bug=2284
-    ./rnfdisc.patch
-  ];
-
   buildInputs = [
     gmp
-    readline
     libX11
-    tex
     perl
+    readline
+    tex
   ] ++ lib.optionals withThread [
     libpthreadstubs
   ];
 
   configureScript = "./Configure";
   configureFlags = [
-    "--with-gmp=${gmp.dev}"
-    "--with-readline=${readline.dev}"
-  ] ++ lib.optional stdenv.isDarwin "--host=x86_64-darwin"
+    "--with-gmp=${lib.getDev gmp}"
+    "--with-readline=${lib.getDev readline}"
+  ]
+  ++ lib.optional stdenv.isDarwin "--host=x86_64-darwin"
   ++ lib.optional withThread "--mt=pthread";
 
   preConfigure = ''
@@ -57,6 +53,7 @@ stdenv.mkDerivation rec {
   makeFlags = [ "all" ];
 
   meta = with lib; {
+    homepage = "http://pari.math.u-bordeaux.fr";
     description = "Computer algebra system for high-performance number theory computations";
     longDescription = ''
        PARI/GP is a widely used computer algebra system designed for fast
@@ -81,7 +78,6 @@ stdenv.mkDerivation rec {
          3 or 4 times faster.) gp2c currently only understands a subset of the
          GP language.
     '';
-    homepage = "http://pari.math.u-bordeaux.fr";
     downloadPage = "http://pari.math.u-bordeaux.fr/download.html";
     license = licenses.gpl2Plus;
     maintainers = with maintainers; [ ertes AndersonTorres ] ++ teams.sage.members;
diff --git a/pkgs/applications/science/math/pari/gp2c.nix b/pkgs/applications/science/math/pari/gp2c.nix
index 23183f83b36b6..7f31543a925f9 100644
--- a/pkgs/applications/science/math/pari/gp2c.nix
+++ b/pkgs/applications/science/math/pari/gp2c.nix
@@ -1,7 +1,9 @@
-{ lib, stdenv
-, pari
+{ lib
+, stdenv
 , fetchurl
-, perl }:
+, pari
+, perl
+}:
 
 stdenv.mkDerivation rec {
   pname = "gp2c";
@@ -12,11 +14,15 @@ stdenv.mkDerivation rec {
     sha256 = "039ip7qkwwv46wrcdrz7y12m30kazzkjr44kqbc0h137g4wzd7zf";
   };
 
-  buildInputs = [ pari perl ];
+  buildInputs = [
+    pari
+    perl
+  ];
 
   configureFlags = [
     "--with-paricfg=${pari}/lib/pari/pari.cfg"
-    "--with-perl=${perl}/bin/perl" ];
+    "--with-perl=${perl}/bin/perl"
+  ];
 
   meta = with lib; {
     description =  "A compiler to translate GP scripts to PARI programs";
diff --git a/pkgs/applications/science/math/pari/rnfdisc.patch b/pkgs/applications/science/math/pari/rnfdisc.patch
deleted file mode 100644
index 6acac96481d51..0000000000000
--- a/pkgs/applications/science/math/pari/rnfdisc.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-commit 0d8a3ac970291c62b56104172418b3f2ca30927c
-Author: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
-Date:   Sun Mar 28 13:27:24 2021 +0200
-
-    rnfdisc_factored: remove spurious Q_primpart [#2284]
-
-diff --git a/src/basemath/base2.c b/src/basemath/base2.c
-index 7e7d0db9d..c461826f4 100644
---- a/src/basemath/base2.c
-+++ b/src/basemath/base2.c
-@@ -3582,7 +3582,7 @@ rnfdisc_factored(GEN nf, GEN pol, GEN *pd)
- 
-   nf = checknf(nf);
-   pol = rnfdisc_get_T(nf, pol, &lim);
--  disc = nf_to_scalar_or_basis(nf, nfX_disc(nf, Q_primpart(pol)));
-+  disc = nf_to_scalar_or_basis(nf, nfX_disc(nf, pol));
-   pol = nfX_to_monic(nf, pol, NULL);
-   fa = idealfactor_partial(nf, disc, lim);
-   P = gel(fa,1); l = lg(P);
-diff --git a/src/test/32/rnf b/src/test/32/rnf
-index 1e743f415..c016dce00 100644
---- a/src/test/32/rnf
-+++ b/src/test/32/rnf
-@@ -853,9 +853,10 @@ error("inconsistent dimensions in idealtwoelt.")
- 0
- 0
- 1
--[[7361, 3786, 318, 5823; 0, 1, 0, 0; 0, 0, 1, 0; 0, 0, 0, 1], [-3, 6, -2, 0]
--~]
--[2, -1]
-+[[433, 322, 318, 1318/17; 0, 1, 0, 12/17; 0, 0, 1, 5/17; 0, 0, 0, 1/17], [25
-+/17, -12/17, 12/17, 16/17]~]
-+[1, -1]
-+[[12, 0, 0, 0; 0, 12, 4, 0; 0, 0, 4, 0; 0, 0, 0, 4], [6, 5, -1, 2]~]
-   ***   at top-level: rnfdedekind(nf,P,pr2,1)
-   ***                 ^-----------------------
-   *** rnfdedekind: sorry, Dedekind in the difficult case is not yet implemented.
-diff --git a/src/test/in/rnf b/src/test/in/rnf
-index 7851ae291..318d5349e 100644
---- a/src/test/in/rnf
-+++ b/src/test/in/rnf
-@@ -212,6 +212,9 @@ k = nfinit(y^4 + 10*y^2 + 17);
- rnfdisc(k, x^2 - x + 1/Mod(y,k.pol))
- rnfdisc(k, x^2 - x + 1/2)
- 
-+k = nfinit(y^4 - 10*y^2 + 1);
-+rnfdisc(k,x^2-(y^3/2+y^2-5*y/2+1))
-+
- \\ ERRORS, keep at end of file
- rnfdedekind(nf, P, pr2, 1)
- rnfdedekind(nf, P)
diff --git a/pkgs/applications/science/math/sage/sage-src.nix b/pkgs/applications/science/math/sage/sage-src.nix
index ed10121e5cdfb..4a912e002d979 100644
--- a/pkgs/applications/science/math/sage/sage-src.nix
+++ b/pkgs/applications/science/math/sage/sage-src.nix
@@ -23,6 +23,12 @@ let
       # branches (wip patches from tickets), but exports each commit as a separate
       # patch, so merge commits can lead to conflicts. Used if squashed == false.
       #
+      # The above is the preferred option. To use it, find a Trac ticket and pass the
+      # "Commit" field from the ticket as "rev", choosing "base" as an appropriate
+      # release tag, i.e. a tag that doesn't cause the patch to include a lot of
+      # unrelated changes. If there is no such tag (due to nonlinear history, for
+      # example), there are two other options, listed below.
+      #
       # 2) From GitHub's sagemath/sage repo. This lets us use a GH feature that allows
       # us to choose between a .patch file, with one patch per commit, or a .diff file,
       # which squashes all commits into a single diff. This is used if squashed ==
@@ -118,6 +124,14 @@ stdenv.mkDerivation rec {
       rev = "beed4e16aff32e47d0c3b1c58cb1e2f4c38590f8";
       sha256 = "sha256-3eJPfWfCrCAQ5filIn7FbzjRQeO9QyTIVl/HyRuqFtE=";
     })
+
+    # https://trac.sagemath.org/ticket/32797
+    (fetchSageDiff {
+      base = "9.5.beta7";
+      name = "pari-2.13.3-update.patch";
+      rev = "f5f7a86908daf60b25e66e6a189c51ada7e0a732";
+      sha256 = "sha256-H/caGx3q4KcdsyGe+ojV9bUTQ5y0siqM+QHgDbeEnbw=";
+    })
   ];
 
   patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches;
diff --git a/pkgs/applications/video/makemkv/default.nix b/pkgs/applications/video/makemkv/default.nix
index 1222749303671..26d80b1596c2c 100644
--- a/pkgs/applications/video/makemkv/default.nix
+++ b/pkgs/applications/video/makemkv/default.nix
@@ -3,6 +3,7 @@
 , fetchurl
 , autoPatchelfHook
 , pkg-config
+, curl
 , ffmpeg
 , openssl
 , qtbase
@@ -42,6 +43,8 @@ in mkDerivation {
 
   buildInputs = [ ffmpeg openssl qtbase zlib ];
 
+  runtimeDependencies = [ (lib.getLib curl) ];
+
   qtWrapperArgs =
     let
       binPath = lib.makeBinPath [ jre_headless ];
diff --git a/pkgs/applications/video/mplayer/default.nix b/pkgs/applications/video/mplayer/default.nix
index 644e35468fb54..1715ce4a6a171 100644
--- a/pkgs/applications/video/mplayer/default.nix
+++ b/pkgs/applications/video/mplayer/default.nix
@@ -174,7 +174,7 @@ stdenv.mkDerivation rec {
          (useUnfreeCodecs && codecs != null && !crossBuild)
          "--codecsdir=${codecs}"
     ++ optional
-         ((stdenv.hostPlatform.isi686 || stdenv.hostPlatform.isx86_64) && !crossBuild)
+         (stdenv.hostPlatform.isx86 && !crossBuild)
          "--enable-runtime-cpudetection"
     ++ optional fribidiSupport "--enable-fribidi"
     ++ optional stdenv.isLinux "--enable-vidix"
diff --git a/pkgs/applications/window-managers/afterstep/default.nix b/pkgs/applications/window-managers/afterstep/default.nix
index ec7d3ae5004d0..ac6ba4e0bf29e 100644
--- a/pkgs/applications/window-managers/afterstep/default.nix
+++ b/pkgs/applications/window-managers/afterstep/default.nix
@@ -22,6 +22,14 @@ stdenv.mkDerivation rec {
       url = "https://salsa.debian.org/debian/afterstep/raw/master/debian/patches/44-Fix-build-with-gcc-5.patch";
       sha256 = "1vipy2lzzd2gqrsqk85pwgcdhargy815fxlbn57hsm45zglc3lj4";
     })
+
+    # Fix pending upstream inclusion for binutils-2.36 support:
+    #  https://github.com/afterstep/afterstep/pull/7
+    (fetchpatch {
+      name = "binutils-2.36.patch";
+      url = "https://github.com/afterstep/afterstep/commit/5e9e897cf8c455390dd6f5b27fec49707f6b9088.patch";
+      sha256 = "1kk97max05r2p1a71pvpaza79ff0klz32rggik342p7ki3516qv8";
+    })
   ];
 
   postPatch = ''
diff --git a/pkgs/build-support/fetchgitlab/default.nix b/pkgs/build-support/fetchgitlab/default.nix
index 9ee0b3ca3686e..5c82a8f8587d9 100644
--- a/pkgs/build-support/fetchgitlab/default.nix
+++ b/pkgs/build-support/fetchgitlab/default.nix
@@ -10,7 +10,7 @@ let
   slug = lib.concatStringsSep "/" ((lib.optional (group != null) group) ++ [ owner repo ]);
   escapedSlug = lib.replaceStrings [ "." "/" ] [ "%2E" "%2F" ] slug;
   escapedRev = lib.replaceStrings [ "+" "%" "/" ] [ "%2B" "%25" "%2F" ] rev;
-  passthruAttrs = removeAttrs args [ "domain" "owner" "group" "repo" "rev" ];
+  passthruAttrs = removeAttrs args [ "protocol" "domain" "owner" "group" "repo" "rev" ];
 
   useFetchGit = deepClone || fetchSubmodules || leaveDotGit;
   fetcher = if useFetchGit then fetchgit else fetchzip;
diff --git a/pkgs/build-support/fetchurl/mirrors.nix b/pkgs/build-support/fetchurl/mirrors.nix
index 3ab4be4d8be21..e4d6f02a94bde 100644
--- a/pkgs/build-support/fetchurl/mirrors.nix
+++ b/pkgs/build-support/fetchurl/mirrors.nix
@@ -151,6 +151,7 @@
   cpan = [
     "https://cpan.metacpan.org/"
     "https://cpan.perl.org/"
+    "https://mirrors.kernel.org/CPAN/"
     "https://backpan.perl.org/"  # for old releases
   ];
 
@@ -171,6 +172,7 @@
   debian = [
     "https://httpredir.debian.org/debian/"
     "https://ftp.debian.org/debian/"
+    "https://mirrors.edge.kernel.org/debian/"
     "ftp://ftp.de.debian.org/debian/"
     "ftp://ftp.fr.debian.org/debian/"
     "ftp://ftp.nl.debian.org/debian/"
@@ -183,6 +185,7 @@
   ubuntu = [
     "https://nl.archive.ubuntu.com/ubuntu/"
     "https://old-releases.ubuntu.com/ubuntu/"
+    "https://mirrors.edge.kernel.org/ubuntu/"
     "http://de.archive.ubuntu.com/ubuntu/"
     "http://archive.ubuntu.com/ubuntu/"
   ];
@@ -206,6 +209,7 @@
     "https://ftp.funet.fi/pub/linux/mirrors/opensuse/distribution/"
     "https://ftp.opensuse.org/pub/opensuse/distribution/"
     "https://ftp5.gwdg.de/pub/opensuse/discontinued/distribution/"
+    "https://mirrors.edge.kernel.org/opensuse/distribution/"
     "http://ftp.hosteurope.de/mirror/ftp.opensuse.org/discontinued/"
   ];
 
diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix
index 2966675be7ca6..3c9f3189d2cf9 100644
--- a/pkgs/build-support/trivial-builders.nix
+++ b/pkgs/build-support/trivial-builders.nix
@@ -749,7 +749,7 @@ rec {
     { package,
       command ? "${package.meta.mainProgram or package.pname or package.name} --version",
       version ? package.version,
-    }: runCommand "test-version" { nativeBuildInputs = [ package ]; meta.timeout = 60; } ''
+    }: runCommand "${package.name}-test-version" { nativeBuildInputs = [ package ]; meta.timeout = 60; } ''
       ${command} |& grep -Fw ${version}
       touch $out
     '';
diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix
index a0f3b5efbaeb1..3f176db36c2bd 100644
--- a/pkgs/build-support/vm/default.nix
+++ b/pkgs/build-support/vm/default.nix
@@ -5,7 +5,7 @@
 , storeDir ? builtins.storeDir
 , rootModules ?
     [ "virtio_pci" "virtio_mmio" "virtio_blk" "virtio_balloon" "virtio_rng" "ext4" "unix" "9p" "9pnet_virtio" "crc32c_generic" ]
-      ++ pkgs.lib.optional (pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64) "rtc_cmos"
+      ++ pkgs.lib.optional pkgs.stdenv.hostPlatform.isx86 "rtc_cmos"
 }:
 
 let
@@ -1177,6 +1177,8 @@ rec {
   # The default 9P msize value is 8 KiB, which according to QEMU is
   # insufficient and would degrade performance.
   # See: https://wiki.qemu.org/Documentation/9psetup#msize
-  # Use 500 KiB as a conservative default, see also https://github.com/NixOS/nixpkgs/pull/142577#issuecomment-953848731
-  default9PMsizeBytes = 512000;
+  # Use 128KiB which is the default in linux 5.15+
+  # https://github.com/torvalds/linux/commit/9c4d94dc9a64426d2fa0255097a3a84f6ff2eebe
+  # TODO: actually set it to 128KiB, it was causing failures in many tests due to memory usage
+  default9PMsizeBytes = 16 * 1024;
 }
diff --git a/pkgs/data/themes/qogir/default.nix b/pkgs/data/themes/qogir/default.nix
index c85b5259f62c3..57d664415da8b 100644
--- a/pkgs/data/themes/qogir/default.nix
+++ b/pkgs/data/themes/qogir/default.nix
@@ -1,24 +1,44 @@
-{ lib, stdenv, fetchFromGitHub, gdk-pixbuf, librsvg, gtk-engine-murrine }:
+{ lib
+, stdenv
+, fetchFromGitHub
+, gdk-pixbuf
+, gnome-themes-extra
+, gtk-engine-murrine
+, librsvg
+, sassc
+, which
+}:
 
 stdenv.mkDerivation rec {
   pname = "qogir-theme";
-  version = "2021-08-02";
+  version = "2021-11-17";
 
   src = fetchFromGitHub {
     owner = "vinceliuice";
     repo = pname;
     rev = version;
-    sha256 = "sha256-U048qNBfxjx/5iHIXcqAwXfIwmux+sw4hVQkN3TDLzk=";
+    sha256 = "1ri2dh34vw2pfv0lxzk9f4755v0d4ilnr6fzj3raw9b5fp5zzi91";
   };
 
-  buildInputs = [ gdk-pixbuf librsvg ];
+  nativeBuildInputs = [
+    sassc
+    which
+  ];
 
-  propagatedUserEnvPkgs = [ gtk-engine-murrine ];
+  buildInputs = [
+    gdk-pixbuf # pixbuf engine for Gtk2
+    gnome-themes-extra # adwaita engine for Gtk2
+    librsvg # pixbuf loader for svg
+  ];
+
+  propagatedUserEnvPkgs = [
+    gtk-engine-murrine # murrine engine for Gtk2
+  ];
 
   installPhase = ''
     patchShebangs .
     mkdir -p $out/share/themes
-    name= ./install.sh -d $out/share/themes
+    name= ./install.sh -t all -d $out/share/themes
     mkdir -p $out/share/doc/${pname}
     cp -a src/firefox $out/share/doc/${pname}
     rm $out/share/themes/*/{AUTHORS,COPYING}
diff --git a/pkgs/data/themes/rose-pine-gtk/default.nix b/pkgs/data/themes/rose-pine-gtk/default.nix
new file mode 100644
index 0000000000000..d139876e14295
--- /dev/null
+++ b/pkgs/data/themes/rose-pine-gtk/default.nix
@@ -0,0 +1,44 @@
+{ stdenv
+, fetchFromGitHub
+, lib
+, gnome-themes-extra
+, gtk-engine-murrine
+, gtk_engines
+}:
+
+stdenv.mkDerivation rec {
+  pname = "rose-pine-gtk-theme";
+  version = "unstable-2021-02-22";
+
+  src = fetchFromGitHub {
+    owner = "rose-pine";
+    repo = "gtk";
+    rev = "9cd2dd449f911973ec549231a57a070d256da9fd";
+    sha256 = "0lqx8dmv754ix3xbg7h440x964n0bg4lb06vbzvsydnbx79h7lvy";
+  };
+
+  buildInputs = [
+    gnome-themes-extra # adwaita engine for Gtk2
+    gtk_engines # pixmap engine for Gtk2
+  ];
+
+  propagatedUserEnvPkgs = [
+    gtk-engine-murrine # murrine engine for Gtk2
+  ];
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/share/themes
+    cp -a Rose-Pine $out/share/themes
+    rm $out/share/themes/*/LICENSE
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Rosé Pine theme for GTK";
+    homepage = "https://github.com/rose-pine/gtk";
+    license = licenses.gpl3Only;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.romildo ];
+  };
+}
diff --git a/pkgs/desktops/gnome/core/gnome-software/default.nix b/pkgs/desktops/gnome/core/gnome-software/default.nix
index 7ee3a51aba2e6..61edbe9679d61 100644
--- a/pkgs/desktops/gnome/core/gnome-software/default.nix
+++ b/pkgs/desktops/gnome/core/gnome-software/default.nix
@@ -37,7 +37,7 @@
 }:
 
 let
-  withFwupd = stdenv.isx86_64 || stdenv.isi686;
+  withFwupd = stdenv.hostPlatform.isx86;
 in
 
 stdenv.mkDerivation rec {
diff --git a/pkgs/desktops/mate/mate-screensaver/default.nix b/pkgs/desktops/mate/mate-screensaver/default.nix
index f33c47cbf0a20..d80a19e29bb13 100644
--- a/pkgs/desktops/mate/mate-screensaver/default.nix
+++ b/pkgs/desktops/mate/mate-screensaver/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "mate-screensaver";
-  version = "1.26.0";
+  version = "1.26.1";
 
   src = fetchurl {
     url = "https://pub.mate-desktop.org/releases/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "0xmgzrb5nk7x6ganf7jd4gmdafanx7f0znga0lhsd8kd40r40la1";
+    sha256 = "T72yHqSlnqjeM+qb93bYaXU+SSlWBGZMMOIg4JZZuLw=";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/desktops/mate/mozo/default.nix b/pkgs/desktops/mate/mozo/default.nix
index 3a02b03ceb76d..6388b2319e8cf 100644
--- a/pkgs/desktops/mate/mozo/default.nix
+++ b/pkgs/desktops/mate/mozo/default.nix
@@ -2,14 +2,14 @@
 
 python3.pkgs.buildPythonApplication rec {
   pname = "mozo";
-  version = "1.26.0";
+  version = "1.26.1";
 
   format = "other";
   doCheck = false;
 
   src = fetchurl {
     url = "https://pub.mate-desktop.org/releases/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "1hnxqdk69g7j809k6picgq8y626hnyznlzxd0pi743gshpwwnhj6";
+    sha256 = "DyRCmjsDe9BojsTDkdnYeB5Csj7zRfXlCvHnLF7y+jk=";
   };
 
   nativeBuildInputs = [ pkg-config gettext gobject-introspection wrapGAppsHook ];
diff --git a/pkgs/development/compilers/llvm/7/libcxxabi/default.nix b/pkgs/development/compilers/llvm/7/libcxxabi/default.nix
index 1663b8c7291da..0bb76f916285b 100644
--- a/pkgs/development/compilers/llvm/7/libcxxabi/default.nix
+++ b/pkgs/development/compilers/llvm/7/libcxxabi/default.nix
@@ -1,4 +1,5 @@
 { lib, stdenv, llvm_meta, cmake, fetch, libcxx, libunwind, llvm, version
+, fetchpatch
 , standalone ? stdenv.hostPlatform.useLLVM or false
 , withLibunwind ? !stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm
   # on musl the shared objects don't build
@@ -21,6 +22,13 @@ stdenv.mkDerivation {
     export TRIPLE=x86_64-apple-darwin
   '' + lib.optionalString stdenv.hostPlatform.isMusl ''
     patch -p1 -d $(ls -d libcxx-*) -i ${../../libcxx-0001-musl-hacks.patch}
+  '' + lib.optionalString (!stdenv.cc.isClang) ''
+    pushd libcxx-*
+    patch -p2 < ${fetchpatch {
+      url = "https://github.com/llvm/llvm-project/commit/76ccec07b4fa0cc68dfd07d557e7fb661804a468.patch";
+      sha256 = "1lgzkfkp7qinfc6gd8x5di1iq1gqdv81249c6f02chn9q122sbq1";
+    }}
+    popd
   '';
 
   patches = [
diff --git a/pkgs/development/compilers/ocaml/ber-metaocaml.nix b/pkgs/development/compilers/ocaml/ber-metaocaml.nix
index d3ab0d6e1c609..895706312c140 100644
--- a/pkgs/development/compilers/ocaml/ber-metaocaml.nix
+++ b/pkgs/development/compilers/ocaml/ber-metaocaml.nix
@@ -4,7 +4,7 @@
 }:
 
 let
-   useX11 = stdenv.isi686 || stdenv.isx86_64;
+   useX11 = stdenv.hostPlatform.isx86;
    x11deps = [ libX11 xorgproto ];
    inherit (lib) optionals;
 
diff --git a/pkgs/development/compilers/sbcl/common.nix b/pkgs/development/compilers/sbcl/common.nix
index d2450315eb59f..9cfb38109f7bd 100644
--- a/pkgs/development/compilers/sbcl/common.nix
+++ b/pkgs/development/compilers/sbcl/common.nix
@@ -2,8 +2,8 @@
 
 { lib, stdenv, fetchurl, fetchpatch, writeText, sbclBootstrap
 , sbclBootstrapHost ? "${sbclBootstrap}/bin/sbcl --disable-debugger --no-userinit --no-sysinit"
-, threadSupport ? (stdenv.isi686 || stdenv.isx86_64 || "aarch64-linux" == stdenv.hostPlatform.system || "aarch64-darwin" == stdenv.hostPlatform.system)
-, linkableRuntime ? (stdenv.isi686 || stdenv.isx86_64)
+, threadSupport ? (stdenv.hostPlatform.isx86 || "aarch64-linux" == stdenv.hostPlatform.system || "aarch64-darwin" == stdenv.hostPlatform.system)
+, linkableRuntime ? stdenv.hostPlatform.isx86
 , disableImmobileSpace ? false
   # Meant for sbcl used for creating binaries portable to non-NixOS via save-lisp-and-die.
   # Note that the created binaries still need `patchelf --set-interpreter ...`
diff --git a/pkgs/development/compilers/souffle/default.nix b/pkgs/development/compilers/souffle/default.nix
index e57062642ba40..dada4dfe9e81d 100644
--- a/pkgs/development/compilers/souffle/default.nix
+++ b/pkgs/development/compilers/souffle/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub
+{ lib, stdenv, fetchFromGitHub, fetchpatch
 , perl, ncurses, zlib, sqlite, libffi
 , autoreconfHook, mcpp, bison, flex, doxygen, graphviz
 , makeWrapper
@@ -19,6 +19,16 @@ stdenv.mkDerivation rec {
     sha256 = "1fa6yssgndrln8qbbw2j7j199glxp63irfrz1c2y424rq82mm2r5";
   };
 
+  patches = [
+    # Pull pending unstream inclusion fix for ncurses-6.3:
+    #  https://github.com/souffle-lang/souffle/pull/2134
+    (fetchpatch {
+      name = "ncurses-6.3.patch";
+      url = "https://github.com/souffle-lang/souffle/commit/9e4bdf86d051ef2e1b1a1be64aff7e498fd5dd20.patch";
+      sha256 = "0jw1b6qfdf49dx2qlzn1b2yzrgpnkil4w9y3as1m28w8ws7iphpa";
+    })
+  ];
+
   nativeBuildInputs = [ autoreconfHook bison flex mcpp doxygen graphviz makeWrapper perl ];
   buildInputs = [ ncurses zlib sqlite libffi ];
 
@@ -29,7 +39,7 @@ stdenv.mkDerivation rec {
 
   # see 565a8e73e80a1bedbb6cc037209c39d631fc393f and parent commits upstream for
   # Wno-error fixes
-  patchPhase = ''
+  postPatch = ''
     substituteInPlace ./src/Makefile.am \
       --replace '-Werror' '-Werror -Wno-error=deprecated -Wno-error=other'
 
diff --git a/pkgs/development/interpreters/clisp/default.nix b/pkgs/development/interpreters/clisp/default.nix
index 137ebbccbc71f..2a387d34f4702 100644
--- a/pkgs/development/interpreters/clisp/default.nix
+++ b/pkgs/development/interpreters/clisp/default.nix
@@ -9,8 +9,8 @@
 , libffcall
 , coreutils
 # build options
-, threadSupport ? (stdenv.isi686 || stdenv.isx86_64)
-, x11Support ? (stdenv.isi686 || stdenv.isx86_64)
+, threadSupport ? stdenv.hostPlatform.isx86
+, x11Support ? stdenv.hostPlatform.isx86
 , dllSupport ? true
 , withModules ? [
     "pcre"
diff --git a/pkgs/development/interpreters/clisp/hg.nix b/pkgs/development/interpreters/clisp/hg.nix
index 83a1870d182b7..7ab4134facb9d 100644
--- a/pkgs/development/interpreters/clisp/hg.nix
+++ b/pkgs/development/interpreters/clisp/hg.nix
@@ -8,8 +8,8 @@
 , libffi, libffcall, automake
 , coreutils
 # build options
-, threadSupport ? (stdenv.isi686 || stdenv.isx86_64)
-, x11Support ? (stdenv.isi686 || stdenv.isx86_64)
+, threadSupport ? stdenv.hostPlatform.isx86
+, x11Support ? stdenv.hostPlatform.isx86
 , dllSupport ? true
 , withModules ? [
     "pcre"
diff --git a/pkgs/development/interpreters/racket/racket_7_9.nix b/pkgs/development/interpreters/racket/racket_7_9.nix
new file mode 100644
index 0000000000000..8d33962f914cf
--- /dev/null
+++ b/pkgs/development/interpreters/racket/racket_7_9.nix
@@ -0,0 +1,111 @@
+{ lib, stdenv, fetchurl, makeFontsConf
+, cacert
+, cairo, coreutils, fontconfig, freefont_ttf
+, glib, gmp
+, gtk3
+, libedit, libffi
+, libiconv
+, libGL
+, libGLU
+, libjpeg
+, libpng, libtool, mpfr, openssl, pango, poppler
+, readline, sqlite
+, disableDocs ? false
+, CoreFoundation
+, gsettings-desktop-schemas
+, wrapGAppsHook
+}:
+
+let
+
+  fontsConf = makeFontsConf {
+    fontDirectories = [ freefont_ttf ];
+  };
+
+  libPath = lib.makeLibraryPath [
+    cairo
+    fontconfig
+    glib
+    gmp
+    gtk3
+    gsettings-desktop-schemas
+    libedit
+    libGL
+    libGLU
+    libjpeg
+    libpng
+    mpfr
+    openssl
+    pango
+    poppler
+    readline
+    sqlite
+  ];
+
+in
+
+stdenv.mkDerivation rec {
+  pname = "racket";
+  version = "7.9"; # always change at once with ./minimal.nix
+
+  src = (lib.makeOverridable ({ name, sha256 }:
+    fetchurl {
+      url = "https://mirror.racket-lang.org/installers/${version}/${name}-src.tgz";
+      inherit sha256;
+    }
+  )) {
+    name = "${pname}-${version}";
+    sha256 = "0gmp2ahmfd97nn9bwpfx9lznjmjkd042slnrrbdmyh59cqh98y2m";
+  };
+
+  FONTCONFIG_FILE = fontsConf;
+  LD_LIBRARY_PATH = libPath;
+  NIX_LDFLAGS = lib.concatStringsSep " " [
+    (lib.optionalString (stdenv.cc.isGNU && ! stdenv.isDarwin) "-lgcc_s")
+    (lib.optionalString stdenv.isDarwin "-framework CoreFoundation")
+  ];
+
+  nativeBuildInputs = [ cacert wrapGAppsHook ];
+
+  buildInputs = [ fontconfig libffi libtool sqlite gsettings-desktop-schemas gtk3 ]
+    ++ lib.optionals stdenv.isDarwin [ libiconv CoreFoundation ];
+
+  preConfigure = ''
+    unset AR
+    for f in src/lt/configure src/cs/c/configure src/bc/src/string.c; do
+      substituteInPlace "$f" --replace /usr/bin/uname ${coreutils}/bin/uname
+    done
+    mkdir src/build
+    cd src/build
+
+    gappsWrapperArgs+=("--prefix" "LD_LIBRARY_PATH" ":" ${LD_LIBRARY_PATH})
+  '';
+
+  shared = if stdenv.isDarwin then "dylib" else "shared";
+  configureFlags = [ "--enable-${shared}"  "--enable-lt=${libtool}/bin/libtool" ]
+                   ++ lib.optional disableDocs [ "--disable-docs" ]
+                   ++ lib.optional stdenv.isDarwin [ "--enable-xonx" ];
+
+  configureScript = "../configure";
+
+  enableParallelBuilding = false;
+
+
+  meta = with lib; {
+    description = "A programmable programming language";
+    longDescription = ''
+      Racket is a full-spectrum programming language. It goes beyond
+      Lisp and Scheme with dialects that support objects, types,
+      laziness, and more. Racket enables programmers to link
+      components written in different dialects, and it empowers
+      programmers to create new, project-specific dialects. Racket's
+      libraries support applications from web servers and databases to
+      GUIs and charts.
+    '';
+    homepage = "https://racket-lang.org/";
+    license = with licenses; [ asl20 /* or */ mit ];
+    maintainers = with maintainers; [ kkallio henrytill vrthra ];
+    platforms = [ "x86_64-darwin" "x86_64-linux" "aarch64-linux" ];
+    broken = stdenv.isDarwin; # No support yet for setting FFI lookup path
+  };
+}
diff --git a/pkgs/development/libraries/SDL2_gfx/default.nix b/pkgs/development/libraries/SDL2_gfx/default.nix
index 783dedc5c78d3..3d599c39c05b5 100644
--- a/pkgs/development/libraries/SDL2_gfx/default.nix
+++ b/pkgs/development/libraries/SDL2_gfx/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ SDL2 ]
     ++ lib.optional stdenv.isDarwin darwin.libobjc;
 
-  configureFlags = [(if stdenv.isi686 || stdenv.isx86_64 then "--enable-mmx" else "--disable-mmx")]
+  configureFlags = [(if stdenv.hostPlatform.isx86 then "--enable-mmx" else "--disable-mmx")]
      ++ lib.optional stdenv.isDarwin "--disable-sdltest";
 
   meta = with lib; {
diff --git a/pkgs/development/libraries/adns/default.nix b/pkgs/development/libraries/adns/default.nix
index 4b929cdb7f0fe..50483758beb57 100644
--- a/pkgs/development/libraries/adns/default.nix
+++ b/pkgs/development/libraries/adns/default.nix
@@ -15,6 +15,8 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ gnum4 ];
 
+  configureFlags = lib.optional stdenv.hostPlatform.isStatic "--disable-dynamic";
+
   preConfigure =
     lib.optionalString stdenv.isDarwin "sed -i -e 's|-Wl,-soname=$(SHLIBSONAME)||' configure";
 
diff --git a/pkgs/development/libraries/ctl/default.nix b/pkgs/development/libraries/ctl/default.nix
index be643e3a52c6b..0a9f50a6aaa65 100644
--- a/pkgs/development/libraries/ctl/default.nix
+++ b/pkgs/development/libraries/ctl/default.nix
@@ -19,6 +19,16 @@ stdenv.mkDerivation rec {
     })
   ];
 
+  postPatch = ''
+    # Fix include guard name
+    substituteInPlace lib/dpx/dpx_raw.hh \
+        --replace CRL_DPX_RAW_INTERNAL_INCLUDE CTL_DPX_RAW_INTERNAL_INCLUDE
+
+    # Fix undefined symbols (link with Imath)
+    substituteInPlace lib/IlmCtlMath/CMakeLists.txt \
+        --replace "( IlmCtlMath IlmCtl )" "( IlmCtlMath IlmCtl Imath)"
+  '';
+
   nativeBuildInputs = [ cmake pkg-config ];
   buildInputs = [ libtiff ilmbase openexr ];
 
diff --git a/pkgs/development/libraries/cxxtools/default.nix b/pkgs/development/libraries/cxxtools/default.nix
index 0d8d2498ae737..50417dab1feb2 100644
--- a/pkgs/development/libraries/cxxtools/default.nix
+++ b/pkgs/development/libraries/cxxtools/default.nix
@@ -9,6 +9,8 @@ stdenv.mkDerivation rec {
     sha256 = "0hp3qkyhidxkdf8qgkwrnqq5bpahink55mf0yz23rjd7rpbbdswc";
   };
 
+  configureFlags = lib.optional stdenv.isAarch64 "--with-atomictype=pthread";
+
   enableParallelBuilding = true;
 
   meta = {
diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix
index 91281f9cd2448..57c2e259e0663 100644
--- a/pkgs/development/libraries/glibc/common.nix
+++ b/pkgs/development/libraries/glibc/common.nix
@@ -161,7 +161,7 @@ stdenv.mkDerivation ({
       "--enable-bind-now"
       (lib.withFeatureAs withLinuxHeaders "headers" "${linuxHeaders}/include")
       (lib.enableFeature profilingLibraries "profile")
-    ] ++ lib.optionals (stdenv.hostPlatform.isx86_64 || stdenv.hostPlatform.isi686 || stdenv.hostPlatform.isAarch64) [
+    ] ++ lib.optionals (stdenv.hostPlatform.isx86 || stdenv.hostPlatform.isAarch64) [
       # This feature is currently supported on
       # i386, x86_64 and x32 with binutils 2.29 or later,
       # and on aarch64 with binutils 2.30 or later.
diff --git a/pkgs/development/libraries/grpc/default.nix b/pkgs/development/libraries/grpc/default.nix
index c00e5a4e0d309..ae49974fefe11 100644
--- a/pkgs/development/libraries/grpc/default.nix
+++ b/pkgs/development/libraries/grpc/default.nix
@@ -81,7 +81,8 @@ stdenv.mkDerivation rec {
     export LD_LIBRARY_PATH=$(pwd)''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
   '';
 
-  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=unknown-warning-option";
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=unknown-warning-option"
+    + lib.optionalString stdenv.isAarch64 "-Wno-error=format-security";
 
   enableParallelBuilds = true;
 
diff --git a/pkgs/development/libraries/intel-gmmlib/default.nix b/pkgs/development/libraries/intel-gmmlib/default.nix
index 1304607b31751..59aaeb6ad9285 100644
--- a/pkgs/development/libraries/intel-gmmlib/default.nix
+++ b/pkgs/development/libraries/intel-gmmlib/default.nix
@@ -6,13 +6,13 @@
 
 stdenv.mkDerivation rec {
   pname = "intel-gmmlib";
-  version = "21.3.2";
+  version = "21.3.3";
 
   src = fetchFromGitHub {
     owner = "intel";
     repo = "gmmlib";
     rev = "intel-gmmlib-${version}";
-    sha256 = "0whi7dmdv36d5l90yhjyv2raj2j165q82h7df9a6wf2abvsaqvdh";
+    sha256 = "0hvly3fykhy4m7mzaa7xadaz7jz8krnfgj3zgzl2a2rpzja6frdn";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/development/libraries/isl/0.11.1.nix b/pkgs/development/libraries/isl/0.11.1.nix
index 5beffd1f0d2ed..a11d9eca6a6e6 100644
--- a/pkgs/development/libraries/isl/0.11.1.nix
+++ b/pkgs/development/libraries/isl/0.11.1.nix
@@ -1,22 +1,8 @@
-{ lib, stdenv, fetchurl, gmp }:
-
-stdenv.mkDerivation {
-  name = "isl-0.11.1"; # CLooG 0.16.3 fails to build with ISL 0.08.
-
-  src = fetchurl {
-    url = "https://src.fedoraproject.org/repo/pkgs/gcc/isl-0.11.1.tar.bz2/bce1586384d8635a76d2f017fb067cd2/isl-0.11.1.tar.bz2";
-    sha256 = "13d9cqa5rzhbjq0xf0b2dyxag7pqa72xj9dhsa03m8ccr1a4npq9";
-  };
-
-  buildInputs = [ gmp ];
+import ./generic.nix {
+  version = "0.11.1";
+  urls = [
+    "https://src.fedoraproject.org/repo/pkgs/gcc/isl-0.11.1.tar.bz2/bce1586384d8635a76d2f017fb067cd2/isl-0.11.1.tar.bz2"
+  ];
+  sha256 = "13d9cqa5rzhbjq0xf0b2dyxag7pqa72xj9dhsa03m8ccr1a4npq9";
   patches = [ ./fix-gcc-build.diff ];
-
-  enableParallelBuilding = true;
-
-  meta = {
-    homepage = "https://www.kotnet.org/~skimo/isl/";
-    license = lib.licenses.lgpl21;
-    description = "A library for manipulating sets and relations of integer points bounded by linear constraints";
-    platforms = lib.platforms.all;
-  };
 }
diff --git a/pkgs/development/libraries/isl/0.14.1.nix b/pkgs/development/libraries/isl/0.14.1.nix
index 87243def17960..1a368d2523e0c 100644
--- a/pkgs/development/libraries/isl/0.14.1.nix
+++ b/pkgs/development/libraries/isl/0.14.1.nix
@@ -1,24 +1,8 @@
-{ lib, stdenv, fetchurl, gmp }:
-
-stdenv.mkDerivation rec {
-  name = "isl-0.14.1";
-
-  src = fetchurl {
-    urls = [
-      "mirror://sourceforge/libisl/${name}.tar.xz"
-      "https://libisl.sourceforge.io/${name}.tar.xz"
-    ];
-    sha256 = "0xa6xagah5rywkywn19rzvbvhfvkmylhcxr6z9z7bz29cpiwk0l8";
-  };
-
-  buildInputs = [ gmp ];
-
-  enableParallelBuilding = true;
-
-  meta = {
-    homepage = "https://www.kotnet.org/~skimo/isl/";
-    license = lib.licenses.lgpl21;
-    description = "A library for manipulating sets and relations of integer points bounded by linear constraints";
-    platforms = lib.platforms.all;
-  };
+import ./generic.nix rec {
+  version = "0.14.1";
+  urls = [
+    "mirror://sourceforge/libisl/isl-${version}.tar.xz"
+    "https://libisl.sourceforge.io/isl-${version}.tar.xz"
+  ];
+  sha256 = "0xa6xagah5rywkywn19rzvbvhfvkmylhcxr6z9z7bz29cpiwk0l8";
 }
diff --git a/pkgs/development/libraries/isl/0.17.1.nix b/pkgs/development/libraries/isl/0.17.1.nix
index a066655d4a052..2e0110df786ef 100644
--- a/pkgs/development/libraries/isl/0.17.1.nix
+++ b/pkgs/development/libraries/isl/0.17.1.nix
@@ -1,24 +1,8 @@
-{ lib, stdenv, fetchurl, gmp }:
-
-stdenv.mkDerivation rec {
-  name = "isl-0.17.1";
-
-  src = fetchurl {
-    urls = [
-      "mirror://sourceforge/libisl/${name}.tar.xz"
-      "https://libisl.sourceforge.io/${name}.tar.xz"
-    ];
-    sha256 = "be152e5c816b477594f4c6194b5666d8129f3a27702756ae9ff60346a8731647";
-  };
-
-  buildInputs = [ gmp ];
-
-  enableParallelBuilding = true;
-
-  meta = {
-    homepage = "https://www.kotnet.org/~skimo/isl/";
-    license = lib.licenses.lgpl21;
-    description = "A library for manipulating sets and relations of integer points bounded by linear constraints";
-    platforms = lib.platforms.all;
-  };
+import ./generic.nix rec {
+  version = "0.17.1";
+  urls = [
+    "mirror://sourceforge/libisl/isl-${version}.tar.xz"
+    "https://libisl.sourceforge.io/isl-${version}.tar.xz"
+  ];
+  sha256 = "be152e5c816b477594f4c6194b5666d8129f3a27702756ae9ff60346a8731647";
 }
diff --git a/pkgs/development/libraries/isl/0.20.0.nix b/pkgs/development/libraries/isl/0.20.0.nix
index d68637ddbcde7..d7567bebf2984 100644
--- a/pkgs/development/libraries/isl/0.20.0.nix
+++ b/pkgs/development/libraries/isl/0.20.0.nix
@@ -1,29 +1,11 @@
-{ lib, stdenv, fetchurl, gmp }:
-
-stdenv.mkDerivation rec {
-  name = "isl-0.20";
-
-  src = fetchurl {
-    urls = [
-      "mirror://sourceforge/libisl/${name}.tar.xz"
-      "https://libisl.sourceforge.io/${name}.tar.xz"
-    ];
-
-    sha256 = "1akpgq0rbqbah5517blg2zlnfvjxfcl9cjrfc75nbcx5p2gnlnd5";
-  };
-
-  buildInputs = [ gmp ];
-
+import ./generic.nix rec {
+  version = "0.20";
+  urls = [
+    "mirror://sourceforge/libisl/isl-${version}.tar.xz"
+    "https://libisl.sourceforge.io/isl-${version}.tar.xz"
+  ];
+  sha256 = "1akpgq0rbqbah5517blg2zlnfvjxfcl9cjrfc75nbcx5p2gnlnd5";
   configureFlags = [
     "--with-gcc-arch=generic" # don't guess -march=/mtune=
   ];
-
-  enableParallelBuilding = true;
-
-  meta = {
-    homepage = "http://isl.gforge.inria.fr/";
-    license = lib.licenses.lgpl21;
-    description = "A library for manipulating sets and relations of integer points bounded by linear constraints";
-    platforms = lib.platforms.all;
-  };
 }
diff --git a/pkgs/development/libraries/isl/0.24.0.nix b/pkgs/development/libraries/isl/0.24.0.nix
new file mode 100644
index 0000000000000..90eb5ec0fac27
--- /dev/null
+++ b/pkgs/development/libraries/isl/0.24.0.nix
@@ -0,0 +1,11 @@
+import ./generic.nix rec {
+  version = "0.24";
+  urls = [
+    "mirror://sourceforge/libisl/isl-${version}.tar.xz"
+    "https://libisl.sourceforge.io/isl-${version}.tar.xz"
+  ];
+  sha256 = "1bgbk6n93qqn7w8v21kxf4x6dc3z0ypqrzvgfd46nhagak60ac84";
+  configureFlags = [
+    "--with-gcc-arch=generic" # don't guess -march=/mtune=
+  ];
+}
diff --git a/pkgs/development/libraries/isl/generic.nix b/pkgs/development/libraries/isl/generic.nix
new file mode 100644
index 0000000000000..eb6fe5f9cd69a
--- /dev/null
+++ b/pkgs/development/libraries/isl/generic.nix
@@ -0,0 +1,32 @@
+{ version
+, urls
+, sha256
+, configureFlags ? []
+, patches ? []
+}:
+
+{ lib, stdenv, fetchurl, gmp
+}:
+
+stdenv.mkDerivation {
+  name = "isl-${version}";
+
+  src = fetchurl {
+    inherit urls sha256;
+  };
+
+  inherit patches;
+
+  buildInputs = [ gmp ];
+
+  inherit configureFlags;
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = "https://libisl.sourceforge.io/";
+    license = lib.licenses.lgpl21;
+    description = "A library for manipulating sets and relations of integer points bounded by linear constraints";
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/pkgs/development/libraries/java/gwt-dragdrop/builder.sh b/pkgs/development/libraries/java/gwt-dragdrop/builder.sh
deleted file mode 100644
index d37e110011e8b..0000000000000
--- a/pkgs/development/libraries/java/gwt-dragdrop/builder.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-source $stdenv/setup
-
-mkdir -p $out/share/java
-cp $src $out/share/java/$name.jar
diff --git a/pkgs/development/libraries/java/gwt-dragdrop/default.nix b/pkgs/development/libraries/java/gwt-dragdrop/default.nix
index 34a0e8c530a47..a7270bbfa2ba2 100644
--- a/pkgs/development/libraries/java/gwt-dragdrop/default.nix
+++ b/pkgs/development/libraries/java/gwt-dragdrop/default.nix
@@ -1,14 +1,25 @@
-{lib, stdenv, fetchurl}:
+{ lib, stdenv, fetchurl }:
 
-stdenv.mkDerivation {
-  name = "gwt-dnd-2.6.5";
-  builder = ./builder.sh;
+stdenv.mkDerivation rec {
+  pname = "gwt-dnd";
+  version = "2.6.5";
 
   src = fetchurl {
-    url = "http://gwt-dnd.googlecode.com/files/gwt-dnd-2.6.5.jar";
+    url = "http://gwt-dnd.googlecode.com/files/gwt-dnd-${version}.jar";
     sha256 = "07zdlr8afs499asnw0dcjmw1cnjc646v91lflx5dv4qj374c97fw";
   };
 
+  dontUnpack = true;
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/share/java
+    cp $src $out/share/java/$name.jar
+
+    runHook postInstall
+  '';
+
   meta = with lib; {
     platforms = platforms.unix;
     license = licenses.asl20;
diff --git a/pkgs/development/libraries/java/gwt-widgets/builder.sh b/pkgs/development/libraries/java/gwt-widgets/builder.sh
deleted file mode 100644
index 8c2502385f2b5..0000000000000
--- a/pkgs/development/libraries/java/gwt-widgets/builder.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-source $stdenv/setup
-
-tar xfvz $src
-cd gwt-widgets-*
-mkdir -p $out/share/java
-cp gwt-widgets-*.jar $out/share/java
diff --git a/pkgs/development/libraries/java/gwt-widgets/default.nix b/pkgs/development/libraries/java/gwt-widgets/default.nix
index 692326a218953..ebba8548016ef 100644
--- a/pkgs/development/libraries/java/gwt-widgets/default.nix
+++ b/pkgs/development/libraries/java/gwt-widgets/default.nix
@@ -1,14 +1,23 @@
-{lib, stdenv, fetchurl}:
+{ lib, stdenv, fetchurl }:
 
-stdenv.mkDerivation {
-  name = "gwt-widgets-0.2.0";
-  builder = ./builder.sh;
+stdenv.mkDerivation rec {
+  pname = "gwt-widgets";
+  version = "0.2.0";
 
   src = fetchurl {
-    url = "mirror://sourceforge/gwt-widget/gwt-widgets-0.2.0-bin.tar.gz";
+    url = "mirror://sourceforge/gwt-widget/gwt-widgets-${version}-bin.tar.gz";
     sha256 = "09isj4j6842rj13nv8264irkjjhvmgihmi170ciabc98911bakxb";
   };
 
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/share/java
+    cp gwt-widgets-*.jar $out/share/java
+
+    runHook postInstall
+  '';
+
   meta = with lib; {
     platforms = platforms.unix;
     license = with licenses; [ afl21 lgpl2 ];
diff --git a/pkgs/development/libraries/libasyncns/default.nix b/pkgs/development/libraries/libasyncns/default.nix
index c94e1c04e0baa..423b8cca69150 100644
--- a/pkgs/development/libraries/libasyncns/default.nix
+++ b/pkgs/development/libraries/libasyncns/default.nix
@@ -9,6 +9,11 @@ stdenv.mkDerivation rec {
     sha256 = "0x5b6lcic4cd7q0bx00x93kvpyzl7n2abbgvqbrlzrfb8vknc6jg";
   };
 
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace libasyncns/asyncns.c \
+      --replace '<arpa/nameser.h>' '<arpa/nameser_compat.h>'
+  '';
+
   configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     "ac_cv_func_malloc_0_nonnull=yes"
     "ac_cv_func_realloc_0_nonnull=yes"
diff --git a/pkgs/development/libraries/libfprint-tod/default.nix b/pkgs/development/libraries/libfprint-tod/default.nix
index a7705792cd8c9..8d7df57896d4c 100644
--- a/pkgs/development/libraries/libfprint-tod/default.nix
+++ b/pkgs/development/libraries/libfprint-tod/default.nix
@@ -6,7 +6,7 @@
 # for the curious, "tod" means "Touch OEM Drivers" meaning it can load
 # external .so's.
 libfprint.overrideAttrs ({ postPatch ? "", mesonFlags ? [], ... }: let
-  version = "1.94.1+tod1";
+  version = "1.90.7+git20210222+tod1";
 in  {
   pname = "libfprint-tod";
   inherit version;
@@ -16,7 +16,7 @@ in  {
     owner = "3v1n0";
     repo = "libfprint";
     rev = "v${version}";
-    sha256 = "sha256-IVeTQlZjea4xgbG/N7OTHAj6RT4WutfvQhV8qFEvkKo=";
+    sha256 = "0cj7iy5799pchyzqqncpkhibkq012g3bdpn18pfb19nm43svhn4j";
   };
 
   mesonFlags = mesonFlags ++ [
diff --git a/pkgs/development/libraries/libgphoto2/default.nix b/pkgs/development/libraries/libgphoto2/default.nix
index 3e3fa1a725bff..666135f91bb98 100644
--- a/pkgs/development/libraries/libgphoto2/default.nix
+++ b/pkgs/development/libraries/libgphoto2/default.nix
@@ -1,7 +1,9 @@
-{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, gettext
+{ lib, stdenv, fetchFromGitHub, buildPackages
+, autoreconfHook, pkg-config, gettext
 , libusb1
 , libtool
 , libexif
+, libgphoto2
 , libjpeg
 }:
 
@@ -16,17 +18,17 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-c7fBl6GBLAU+RL5WFC4PL+n/nEHZUfqIJ9qq1+qNNCg=";
   };
 
-  patches = [];
+  depsBuildBuild = [ pkg-config ];
 
   nativeBuildInputs = [
     autoreconfHook
-    pkg-config
     gettext
     libtool
   ];
 
   buildInputs = [
     libjpeg
+    libtool # for libltdl
     libusb1
   ];
 
@@ -35,9 +37,16 @@ stdenv.mkDerivation rec {
 
   hardeningDisable = [ "format" ];
 
-  postInstall = ''
+  postInstall = let
+    executablePrefix = if stdenv.buildPlatform == stdenv.hostPlatform then
+      "$out"
+    else
+      buildPackages.libgphoto2;
+  in ''
     mkdir -p $out/lib/udev/rules.d
-    $out/lib/libgphoto2/print-camera-list udev-rules version 175 group camera >$out/lib/udev/rules.d/40-gphoto2.rules
+    ${executablePrefix}/lib/libgphoto2/print-camera-list \
+        udev-rules version 175 group camera \
+        >$out/lib/udev/rules.d/40-gphoto2.rules
   '';
 
   meta = {
diff --git a/pkgs/development/libraries/libimagequant/default.nix b/pkgs/development/libraries/libimagequant/default.nix
index 8a5751411486e..348f610bf1839 100644
--- a/pkgs/development/libraries/libimagequant/default.nix
+++ b/pkgs/development/libraries/libimagequant/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     patchShebangs ./configure
   '';
 
-  configureFlags = lib.optionals (!stdenv.isi686 && !stdenv.isx86_64) [ "--disable-sse" ];
+  configureFlags = lib.optionals (!stdenv.hostPlatform.isx86) [ "--disable-sse" ];
 
   meta = with lib; {
     homepage = "https://pngquant.org/lib/";
diff --git a/pkgs/development/libraries/libite/default.nix b/pkgs/development/libraries/libite/default.nix
index 4ffb7a5f7fbcb..3c1d1e8902075 100644
--- a/pkgs/development/libraries/libite/default.nix
+++ b/pkgs/development/libraries/libite/default.nix
@@ -15,7 +15,6 @@ stdenv.mkDerivation rec {
   buildInputs = [ libconfuse ];
 
   meta = with lib; {
-    inherit (src.meta) homepage;
     description = "Lightweight library of frog DNA";
     longDescription = ''
       Libite is a lightweight library of frog DNA. It can be used to fill
@@ -29,7 +28,8 @@ stdenv.mkDerivation rec {
       _SAFE macros in the BSD sys/queue.h API — highly recommended when
       traversing lists to delete/free nodes.
     '';
-    platforms = platforms.unix;
+    homepage = "https://github.com/troglobit/libite";
+    platforms = with platforms; linux ++ netbsd;
     maintainers = with maintainers; [ fpletz ];
     license = with licenses; [ mit isc bsd2 bsd3 ];
   };
diff --git a/pkgs/development/libraries/libqb/default.nix b/pkgs/development/libraries/libqb/default.nix
index 73938bd8f9732..bb3f568b1cf83 100644
--- a/pkgs/development/libraries/libqb/default.nix
+++ b/pkgs/development/libraries/libqb/default.nix
@@ -15,6 +15,10 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libxml2 ];
 
+  postPatch = ''
+    sed -i '/# --enable-new-dtags:/,/--enable-new-dtags is required/ d' configure.ac
+  '';
+
   meta = with lib; {
     homepage = "https://github.com/clusterlabs/libqb";
     description = "A library providing high performance logging, tracing, ipc, and poll";
diff --git a/pkgs/development/libraries/libtsm/default.nix b/pkgs/development/libraries/libtsm/default.nix
index d959306c97180..9c8e418fba4f0 100644
--- a/pkgs/development/libraries/libtsm/default.nix
+++ b/pkgs/development/libraries/libtsm/default.nix
@@ -20,6 +20,6 @@ stdenv.mkDerivation rec {
     homepage = "http://www.freedesktop.org/wiki/Software/kmscon/libtsm/";
     license = licenses.mit;
     maintainers = with maintainers; [ cstrahan ];
-    platforms = with platforms; unix;
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/development/libraries/notcurses/default.nix b/pkgs/development/libraries/notcurses/default.nix
index d15a87bade9dd..07ef398e6f8a4 100644
--- a/pkgs/development/libraries/notcurses/default.nix
+++ b/pkgs/development/libraries/notcurses/default.nix
@@ -13,13 +13,13 @@
 
 stdenv.mkDerivation rec {
   pname = "notcurses";
-  version = "2.4.8";
+  version = "2.4.9";
 
   src = fetchFromGitHub {
     owner = "dankamongmen";
     repo = "notcurses";
     rev = "v${version}";
-    sha256 = "sha256-mVSToryo7+zW1mow8eJT8GrXYlGe/BeSheJtJDKAgzo=";
+    sha256 = "sha256-J7yTNMvmcm69B+yF0PYLXFG8kkcnffWyUx3kEFU0ToI=";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/pkgs/development/libraries/opencolorio/1.x.nix b/pkgs/development/libraries/opencolorio/1.x.nix
index 041ddf8e83710..1b58faf54438e 100644
--- a/pkgs/development/libraries/opencolorio/1.x.nix
+++ b/pkgs/development/libraries/opencolorio/1.x.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     # External libyamlcpp 0.6.* not compatible: https://github.com/imageworks/OpenColorIO/issues/517
     "-DUSE_EXTERNAL_YAML=OFF"
   ] ++ lib.optional stdenv.isDarwin "-DOCIO_USE_BOOST_PTR=ON"
-    ++ lib.optional (!stdenv.hostPlatform.isi686 && !stdenv.hostPlatform.isx86_64) "-DOCIO_USE_SSE=OFF";
+    ++ lib.optional (!stdenv.hostPlatform.isx86) "-DOCIO_USE_SSE=OFF";
 
   postInstall = ''
     mkdir -p $bin/bin; mv $out/bin $bin/
diff --git a/pkgs/development/libraries/pcl/default.nix b/pkgs/development/libraries/pcl/default.nix
index 8afcdbf33f23a..bbc2bd8cc6f32 100644
--- a/pkgs/development/libraries/pcl/default.nix
+++ b/pkgs/development/libraries/pcl/default.nix
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
 
   # remove attempt to prevent (x86/x87-specific) extended precision use
   # when SSE not detected
-  postPatch = lib.optionalString (!(stdenv.isi686 || stdenv.isx86_64)) ''
+  postPatch = lib.optionalString (!stdenv.hostPlatform.isx86) ''
     sed -i '/-ffloat-store/d' cmake/pcl_find_sse.cmake
   '';
 
diff --git a/pkgs/development/libraries/x264/default.nix b/pkgs/development/libraries/x264/default.nix
index 57d0c0a4d6328..2c9f476313ecc 100644
--- a/pkgs/development/libraries/x264/default.nix
+++ b/pkgs/development/libraries/x264/default.nix
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
     ++ lib.optional (!stdenv.isi686) "--enable-pic"
     ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "--cross-prefix=${stdenv.cc.targetPrefix}";
 
-  nativeBuildInputs = lib.optional (stdenv.hostPlatform.isx86_64 || stdenv.hostPlatform.isi686) nasm;
+  nativeBuildInputs = lib.optional stdenv.hostPlatform.isx86 nasm;
 
   meta = with lib; {
     description = "Library for encoding H264/AVC video streams";
diff --git a/pkgs/development/mobile/androidenv/ndk-bundle/default.nix b/pkgs/development/mobile/androidenv/ndk-bundle/default.nix
index 26d6a847b4d0a..a854069e75a52 100644
--- a/pkgs/development/mobile/androidenv/ndk-bundle/default.nix
+++ b/pkgs/development/mobile/androidenv/ndk-bundle/default.nix
@@ -10,6 +10,7 @@ in
 deployAndroidPackage {
   inherit package os;
   nativeBuildInputs = [ autoPatchelfHook makeWrapper ];
+  autoPatchelfIgnoreMissingDeps = true;
   buildInputs = lib.optional (os == "linux") [ pkgs.glibc pkgs.stdenv.cc.cc pkgs.python2 pkgs.ncurses5 pkgs.zlib pkgs.libcxx.out pkgs.libxml2 ];
   patchInstructions = lib.optionalString (os == "linux") (''
     patchShebangs .
diff --git a/pkgs/development/node-packages/default.nix b/pkgs/development/node-packages/default.nix
index 45c566b0d6016..9738d16353d4b 100644
--- a/pkgs/development/node-packages/default.nix
+++ b/pkgs/development/node-packages/default.nix
@@ -309,18 +309,18 @@ let
 
     prisma = super.prisma.override rec {
       nativeBuildInputs = [ pkgs.makeWrapper ];
-      version = "3.4.0";
+      version = "3.5.0";
       src = fetchurl {
         url = "https://registry.npmjs.org/prisma/-/prisma-${version}.tgz";
-        sha512 = "sha512-W0AFjVxPOLW5SEnf0ZwbOu4k8ElX98ioFC1E8Gb9Q/nuO2brEwxFJebXglfG+N6zphGbu2bG1I3VAu7aYzR3VA==";
+        sha512 = "sha512-WEYQ+H98O0yigG+lI0gfh4iyBChvnM6QTXPDtY9eFraLXAmyb6tf/T2mUdrUAU1AEvHLVzQA5A+RpONZlQozBg==";
       };
       dependencies = [ rec {
         name = "_at_prisma_slash_engines";
         packageName = "@prisma/engines";
-        version = "3.4.0-27.1c9fdaa9e2319b814822d6dbfd0a69e1fcc13a85";
+        version = "3.5.0-38.78a5df6def6943431f4c022e1428dbc3e833cf8e";
         src = fetchurl {
           url = "https://registry.npmjs.org/@prisma/engines/-/engines-${version}.tgz";
-          sha512 = "sha512-jyCjXhX1ZUbzA7+6Hm0iEdeY+qFfpD/RB7iSwMrMoIhkVYvnncSdCLBgbK0yqxTJR2nglevkDY2ve3QDxFciMA==";
+          sha512 = "sha512-MqZUrxuLlIbjB3wu8LrRJOKcvR4k3dunKoI4Q2bPfAwLQY0XlpsLZ3TRVW1c32ooVk939p6iGNkaCUo63Et36g==";
         };
       }];
       postInstall = with pkgs; ''
diff --git a/pkgs/development/python-modules/aiohwenergy/default.nix b/pkgs/development/python-modules/aiohwenergy/default.nix
new file mode 100644
index 0000000000000..b9b2801f750db
--- /dev/null
+++ b/pkgs/development/python-modules/aiohwenergy/default.nix
@@ -0,0 +1,40 @@
+{ lib
+, aiohttp
+, buildPythonPackage
+, fetchFromGitHub
+, pytestCheckHook
+, pythonOlder
+}:
+
+buildPythonPackage rec {
+  pname = "aiohwenergy";
+  version = "0.4.0";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.7";
+
+  src = fetchFromGitHub {
+    owner = "DCSBL";
+    repo = pname;
+    rev = version;
+    sha256 = "Rs7kD+jN/z0j4KmkitquB+cm2UcYG87YHczZR0A4axI=";
+  };
+
+  propagatedBuildInputs = [
+    aiohttp
+  ];
+
+  # Project has no tests
+  doCheck = false;
+
+  pythonImportsCheck = [
+    "aiohwenergy"
+  ];
+
+  meta = with lib; {
+    description = "Python library to interact with the HomeWizard Energy devices API";
+    homepage = "https://github.com/DCSBL/aiohwenergy";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ fab ];
+  };
+}
diff --git a/pkgs/development/python-modules/aiovlc/default.nix b/pkgs/development/python-modules/aiovlc/default.nix
new file mode 100644
index 0000000000000..c41a390237060
--- /dev/null
+++ b/pkgs/development/python-modules/aiovlc/default.nix
@@ -0,0 +1,45 @@
+{ lib
+, buildPythonPackage
+, click
+, fetchFromGitHub
+, pytest-asyncio
+, pytest-timeout
+, pytestCheckHook
+, pythonOlder
+}:
+
+buildPythonPackage rec {
+  pname = "aiovlc";
+  version = "0.1.0";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.8";
+
+  src = fetchFromGitHub {
+    owner = "MartinHjelmare";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "jB2V/Wpxmp92wba41mWZAeO63wy3NrkupllGxJMNkFM=";
+  };
+
+  propagatedBuildInputs = [
+    click
+  ];
+
+  checkInputs = [
+    pytest-asyncio
+    pytest-timeout
+    pytestCheckHook
+  ];
+
+  pythonImportsCheck = [
+    "aiovlc"
+  ];
+
+  meta = with lib; {
+    description = "Python module to control VLC";
+    homepage = "https://github.com/MartinHjelmare/aiovlc";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ fab ];
+  };
+}
diff --git a/pkgs/development/python-modules/angr/default.nix b/pkgs/development/python-modules/angr/default.nix
index 488831e80080e..c85c5d6bd6396 100644
--- a/pkgs/development/python-modules/angr/default.nix
+++ b/pkgs/development/python-modules/angr/default.nix
@@ -30,14 +30,15 @@
 let
   # Only the pinned release in setup.py works properly
   unicorn' = unicorn.overridePythonAttrs (old: rec {
-      pname = "unicorn";
-      version = "1.0.2-rc4";
-      src =  fetchFromGitHub {
-        owner = "unicorn-engine";
-        repo = pname;
-        rev = version;
-        sha256 = "17nyccgk7hpc4hab24yn57f1xnmr7kq4px98zbp2bkwcrxny8gwy";
+    pname = "unicorn";
+    version = "1.0.2-rc4";
+    src =  fetchFromGitHub {
+      owner = "unicorn-engine";
+      repo = pname;
+      rev = version;
+      sha256 = "17nyccgk7hpc4hab24yn57f1xnmr7kq4px98zbp2bkwcrxny8gwy";
     };
+    doCheck = false;
   });
 in
 
diff --git a/pkgs/development/python-modules/apache-airflow/default.nix b/pkgs/development/python-modules/apache-airflow/default.nix
index 2ffe0b137528c..22a1772bf162e 100644
--- a/pkgs/development/python-modules/apache-airflow/default.nix
+++ b/pkgs/development/python-modules/apache-airflow/default.nix
@@ -58,7 +58,7 @@
 , termcolor
 , unicodecsv
 , werkzeug
-, pytest
+, pytestCheckHook
 , freezegun
 , mkYarnPackage
 }:
@@ -171,7 +171,7 @@ buildPythonPackage rec {
 
   checkInputs = [
     freezegun
-    pytest
+    pytestCheckHook
   ];
 
   INSTALL_PROVIDERS_FROM_SOURCES = "true";
@@ -199,12 +199,16 @@ buildPythonPackage rec {
 
     substituteInPlace tests/core/test_core.py \
       --replace "/bin/bash" "${stdenv.shell}"
+  '' + lib.optionalString stdenv.isDarwin ''
+    # Fix failing test on Hydra
+    substituteInPlace airflow/utils/db.py \
+      --replace "/tmp/sqlite_default.db" "$TMPDIR/sqlite_default.db"
   '';
 
   # allow for gunicorn processes to have access to python packages
   makeWrapperArgs = [ "--prefix PYTHONPATH : $PYTHONPATH" ];
 
-  checkPhase = ''
+  preCheck = ''
    export HOME=$(mktemp -d)
    export AIRFLOW_HOME=$HOME
    export AIRFLOW__CORE__UNIT_TEST_MODE=True
@@ -214,10 +218,16 @@ buildPythonPackage rec {
    airflow version
    airflow db init
    airflow db reset -y
-
-   pytest tests/core/test_core.py
   '';
 
+  pytestFlagsArray = [
+    "tests/core/test_core.py"
+  ];
+
+  disabledTests = lib.optionals stdenv.isDarwin [
+    "bash_operator_kill"  # psutil.AccessDenied
+  ];
+
   postInstall = ''
     cp -rv ${airflow-frontend}/static/dist $out/lib/${python.libPrefix}/site-packages/airflow/www/static
   '';
diff --git a/pkgs/development/python-modules/casbin/default.nix b/pkgs/development/python-modules/casbin/default.nix
index 9150e1c5298b0..64c69ddaa0435 100644
--- a/pkgs/development/python-modules/casbin/default.nix
+++ b/pkgs/development/python-modules/casbin/default.nix
@@ -9,7 +9,7 @@
 
 buildPythonPackage rec {
   pname = "casbin";
-  version = "1.9.7";
+  version = "1.11.1";
   format = "setuptools";
 
   disabled = pythonOlder "3.6";
@@ -18,7 +18,7 @@ buildPythonPackage rec {
     owner = pname;
     repo = "pycasbin";
     rev = "v${version}";
-    sha256 = "sha256-wNygKs37PtMLij3f+pAh6PNLqQ45cvrpF43Aj+cO8p8=";
+    sha256 = "sha256-gFGYpHd1kp4JMtoe47VbJ0uDnuGQegggbjXaw6nEMR4=";
   };
 
   propagatedBuildInputs = [
diff --git a/pkgs/development/python-modules/dogpile-core/default.nix b/pkgs/development/python-modules/dogpile-core/default.nix
deleted file mode 100644
index 32a1f59e92704..0000000000000
--- a/pkgs/development/python-modules/dogpile-core/default.nix
+++ /dev/null
@@ -1,23 +0,0 @@
-{ lib, buildPythonPackage, fetchPypi }:
-
-buildPythonPackage rec {
-  pname = "dogpile-core";
-  version = "0.4.1";
-
-  src = fetchPypi {
-    pname = "dogpile.core";
-    inherit version;
-    sha256 = "0xpdvg4kr1isfkrh1rfsh7za4q5a5s6l2kf9wpvndbwf3aqjyrdy";
-  };
-
-  doCheck = false;
-
-  pythonImportsCheck = [ "dogpile.core" ];
-
-  meta = with lib; {
-    description = "A 'dogpile' lock, typically used as a component of a larger caching solution";
-    homepage = "https://bitbucket.org/zzzeek/dogpile.core";
-    license = licenses.bsd3;
-    maintainers = with maintainers; [ ];
-  };
-}
diff --git a/pkgs/development/python-modules/elementpath/default.nix b/pkgs/development/python-modules/elementpath/default.nix
index 810b5dfedd01a..4dc34f92365e3 100644
--- a/pkgs/development/python-modules/elementpath/default.nix
+++ b/pkgs/development/python-modules/elementpath/default.nix
@@ -5,8 +5,9 @@
 }:
 
 buildPythonPackage rec {
-  version = "2.3.2";
   pname = "elementpath";
+  version = "2.4.0";
+  format = "setuptools";
 
   disabled = pythonOlder "3.6";
 
@@ -14,13 +15,15 @@ buildPythonPackage rec {
     owner = "sissaschool";
     repo = "elementpath";
     rev = "v${version}";
-    sha256 = "01h68v077xbcnqn9v52i8d6s6i7ds3zycn3ddn11hc074m4gg3af";
+    sha256 = "1f3w5zyvrkl4gab81i5z9b41ybs54b37znj5r7hrcf25x8hrqgvv";
   };
 
   # avoid circular dependency with xmlschema which directly depends on this
   doCheck = false;
 
-  pythonImportsCheck = [ "elementpath" ];
+  pythonImportsCheck = [
+    "elementpath"
+  ];
 
   meta = with lib; {
     description = "XPath 1.0/2.0 parsers and selectors for ElementTree and lxml";
diff --git a/pkgs/development/python-modules/env-canada/default.nix b/pkgs/development/python-modules/env-canada/default.nix
index 23dbf63df6917..587dcf1492314 100644
--- a/pkgs/development/python-modules/env-canada/default.nix
+++ b/pkgs/development/python-modules/env-canada/default.nix
@@ -8,18 +8,22 @@
 , pillow
 , pytestCheckHook
 , python-dateutil
+, pythonOlder
 , voluptuous
 }:
 
 buildPythonPackage rec {
   pname = "env-canada";
-  version = "0.5.16";
+  version = "0.5.17";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.8";
 
   src = fetchFromGitHub {
     owner = "michaeldavie";
     repo = "env_canada";
     rev = "v${version}";
-    sha256 = "sha256-5Cxpl5iwbBtpwQ9//yhEZNCIzBZgTm/fqAo9PNNxoG4=";
+    sha256 = "sha256-viuBuyGzAUcfb4qSecZsDvoAU++FNhuwNJET/s0qyOI=";
   };
 
   propagatedBuildInputs = [
@@ -49,7 +53,9 @@ buildPythonPackage rec {
     "test_ecradar"
   ];
 
-  pythonImportsCheck = [ "env_canada" ];
+  pythonImportsCheck = [
+    "env_canada"
+  ];
 
   meta = with lib; {
     description = "Python library to get Environment Canada weather data";
diff --git a/pkgs/development/python-modules/envisage/default.nix b/pkgs/development/python-modules/envisage/default.nix
index 20051804328ba..b8513fd1d9aec 100644
--- a/pkgs/development/python-modules/envisage/default.nix
+++ b/pkgs/development/python-modules/envisage/default.nix
@@ -1,7 +1,12 @@
-{ lib, fetchPypi, isPy27
+{ lib
+, fetchPypi
+, isPy27
 , buildPythonPackage
-, traits, apptools, pytestCheckHook
-, ipykernel, ipython, setuptools
+, traits
+, apptools
+, pytestCheckHook
+, ipython
+, setuptools
 }:
 
 buildPythonPackage rec {
@@ -15,6 +20,8 @@ buildPythonPackage rec {
     sha256 = "8864c29aa344f7ac26eeb94788798f2d0cc791dcf95c632da8d79ebc580e114c";
   };
 
+  # for the optional dependency ipykernel, only versions < 6 are
+  # supported, so it's not included in the tests, and not propagated
   propagatedBuildInputs = [ traits apptools setuptools ];
 
   preCheck = ''
@@ -22,7 +29,8 @@ buildPythonPackage rec {
   '';
 
   checkInputs = [
-    ipykernel ipython pytestCheckHook
+    ipython
+    pytestCheckHook
   ];
 
   meta = with lib; {
diff --git a/pkgs/development/python-modules/falcon/default.nix b/pkgs/development/python-modules/falcon/default.nix
index a42da353fc682..5dba22d839124 100644
--- a/pkgs/development/python-modules/falcon/default.nix
+++ b/pkgs/development/python-modules/falcon/default.nix
@@ -1,17 +1,28 @@
 { lib
 , buildPythonPackage
-, fetchPypi
 , pythonOlder
+, fetchPypi
+, pytestCheckHook
 , aiofiles
 , cbor2
+, ddt
+, gunicorn
 , httpx
+, hypercorn
+, jsonschema
 , msgpack
+, mujson
+, nose
+, orjson
 , pecan
 , pytest-asyncio
-, pytestCheckHook
+, python-mimeparse
 , pyyaml
+, rapidjson
 , requests
 , testtools
+, ujson
+, uvicorn
 , websockets
 }:
 
@@ -29,24 +40,31 @@ buildPythonPackage rec {
   checkInputs = [
     aiofiles
     cbor2
+    ddt
+    gunicorn
     httpx
+    hypercorn
+    jsonschema
     msgpack
+    mujson
+    nose
+    orjson
     pecan
     pytest-asyncio
     pytestCheckHook
+    python-mimeparse
     pyyaml
+    rapidjson
     requests
     testtools
+    ujson
+    uvicorn
     websockets
   ];
 
   disabledTestPaths = [
     # missing optional nuts package
     "falcon/bench/nuts/nuts/tests/test_functional.py"
-    # missing optional mujson package
-    "tests/test_media_handlers.py"
-    # tries to run uvicorn binary and doesn't find it
-    "tests/asgi/test_asgi_servers.py"
   ];
 
   meta = with lib; {
diff --git a/pkgs/development/python-modules/faraday-plugins/default.nix b/pkgs/development/python-modules/faraday-plugins/default.nix
index 4701e481b31a8..3aae84e2a2452 100644
--- a/pkgs/development/python-modules/faraday-plugins/default.nix
+++ b/pkgs/development/python-modules/faraday-plugins/default.nix
@@ -16,14 +16,14 @@
 
 buildPythonPackage rec {
   pname = "faraday-plugins";
-  version = "1.5.6";
+  version = "1.5.7";
   format = "setuptools";
 
   src = fetchFromGitHub {
     owner = "infobyte";
     repo = "faraday_plugins";
     rev = "v${version}";
-    sha256 = "sha256-RTHhCSOqtdPsgZgeziAYm+9NoR72Jfm+42fyyKqjFpA=";
+    sha256 = "sha256-EW9p5r7RwWohNGwbITtDrEd1FYLtOwWXhVWFgPCG+Po=";
   };
 
   propagatedBuildInputs = [
diff --git a/pkgs/development/python-modules/flux-led/default.nix b/pkgs/development/python-modules/flux-led/default.nix
index 58f23fba931c7..be3dab8bdfd86 100644
--- a/pkgs/development/python-modules/flux-led/default.nix
+++ b/pkgs/development/python-modules/flux-led/default.nix
@@ -7,8 +7,9 @@
 }:
 
 buildPythonPackage rec {
-  pname = "flux_led";
-  version = "0.24.24";
+  pname = "flux-led";
+  version = "0.24.25";
+  format = "setuptools";
 
   disabled = pythonOlder "3.7";
 
@@ -16,7 +17,7 @@ buildPythonPackage rec {
     owner = "Danielhiversen";
     repo = "flux_led";
     rev = version;
-    sha256 = "sha256-99EHmhyc6lAjYPHFvvqnd5r8HeEEJM6W3VK0/yLsz7I=";
+    sha256 = "sha256-HhoqsdaqNKdKH63glYEl5mRBFImu6Nxw5gwF7JAJABk=";
   };
 
   propagatedBuildInputs = [
diff --git a/pkgs/development/python-modules/gistyc/default.nix b/pkgs/development/python-modules/gistyc/default.nix
index 2f49552df2369..51003101abde3 100644
--- a/pkgs/development/python-modules/gistyc/default.nix
+++ b/pkgs/development/python-modules/gistyc/default.nix
@@ -21,6 +21,10 @@ buildPythonPackage rec {
     requests
   ];
 
+  pythonImportsCheck = [
+    "gistyc"
+  ];
+
   meta = with lib; {
     homepage = "https://github.com/ThomasAlbin/gistyc";
     description = "A Python based GitHub GIST management tool";
diff --git a/pkgs/development/python-modules/identify/default.nix b/pkgs/development/python-modules/identify/default.nix
index 37e5f5bcb8a52..fed8ddd419c02 100644
--- a/pkgs/development/python-modules/identify/default.nix
+++ b/pkgs/development/python-modules/identify/default.nix
@@ -1,14 +1,15 @@
 { lib
 , buildPythonPackage
+, editdistance-s
 , fetchFromGitHub
 , pytestCheckHook
-, editdistance-s
 , pythonOlder
+, ukkonen
 }:
 
 buildPythonPackage rec {
   pname = "identify";
-  version = "2.3.7";
+  version = "2.4.0";
   format = "setuptools";
 
   disabled = pythonOlder "3.7";
@@ -17,12 +18,13 @@ buildPythonPackage rec {
     owner = "pre-commit";
     repo = pname;
     rev = "v${version}";
-    sha256 = "sha256-L71Zi0SWFh7K4BRwF57prdrIdxLp8Igs0k/gc6k1+Mo=";
+    sha256 = "sha256-0J3P3RawafVAfOUhK9qSz5K8y0goMqTjMh5PL60sqME=";
   };
 
   checkInputs = [
     editdistance-s
     pytestCheckHook
+    ukkonen
   ];
 
   pythonImportsCheck = [
diff --git a/pkgs/development/python-modules/imap-tools/default.nix b/pkgs/development/python-modules/imap-tools/default.nix
index eb81678ae4f10..dcee12d68c3a3 100644
--- a/pkgs/development/python-modules/imap-tools/default.nix
+++ b/pkgs/development/python-modules/imap-tools/default.nix
@@ -7,7 +7,7 @@
 
 buildPythonPackage rec {
   pname = "imap-tools";
-  version = "0.49.1";
+  version = "0.50.0";
 
   disabled = isPy27;
 
@@ -15,7 +15,7 @@ buildPythonPackage rec {
     owner = "ikvk";
     repo = "imap_tools";
     rev = "v${version}";
-    sha256 = "071bri1h6j8saqqlb50zibdrk5hgkpwp4ysiskl1zin18794bq82";
+    sha256 = "sha256-4OMWLWvNRg7z4KAAkB1l5YaWILFwIepZOWhBd64SGWI=";
   };
 
   checkInputs = [
@@ -29,9 +29,6 @@ buildPythonPackage rec {
     "test_connectio"
     "test_attributes"
     "test_live"
-    # logic operator tests broken in 0.49.0
-    # https://github.com/ikvk/imap_tools/issues/143
-    "test_logic_operators"
   ];
 
   pythonImportsCheck = [ "imap_tools" ];
diff --git a/pkgs/development/python-modules/justbackoff/default.nix b/pkgs/development/python-modules/justbackoff/default.nix
new file mode 100644
index 0000000000000..814d1d3e53f36
--- /dev/null
+++ b/pkgs/development/python-modules/justbackoff/default.nix
@@ -0,0 +1,41 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, pytestCheckHook
+, pythonOlder
+}:
+
+buildPythonPackage rec {
+  pname = "justbackoff";
+  version = "0.6.0";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.8";
+
+  src = fetchFromGitHub {
+    owner = "alexferl";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "097j6jxgl4b3z46x9y9z10643vnr9v831vhagrxzrq6nviil2z6l";
+  };
+
+  checkInputs = [
+    pytestCheckHook
+  ];
+
+  postPatch = ''
+    substituteInPlace setup.py \
+      --replace "pytest-runner>=5.2" ""
+  '';
+
+  pythonImportsCheck = [
+    "justbackoff"
+  ];
+
+  meta = with lib; {
+    description = "Simple backoff algorithm in Python";
+    homepage = "https://github.com/alexferl/justbackoff";
+    license = with licenses; [ mit ];
+    maintainers = with maintainers; [ fab ];
+  };
+}
diff --git a/pkgs/development/python-modules/keyutils/default.nix b/pkgs/development/python-modules/keyutils/default.nix
index 3d1575d8c37f6..21eeb11d136cc 100644
--- a/pkgs/development/python-modules/keyutils/default.nix
+++ b/pkgs/development/python-modules/keyutils/default.nix
@@ -12,6 +12,10 @@ buildPythonPackage rec {
     sha256 = "0pfqfr5xqgsqkxzrmj8xl2glyl4nbq0irs0k6ik7iy3gd3mxf5g1";
   };
 
+  postPatch = ''
+    substituteInPlace setup.py --replace '"pytest-runner"' ""
+  '';
+
   buildInputs = [ keyutils ];
   checkInputs = [ pytest pytest-runner ];
 
diff --git a/pkgs/development/python-modules/lc7001/default.nix b/pkgs/development/python-modules/lc7001/default.nix
new file mode 100644
index 0000000000000..3567a01861edb
--- /dev/null
+++ b/pkgs/development/python-modules/lc7001/default.nix
@@ -0,0 +1,42 @@
+{ lib
+, buildPythonPackage
+, cryptography
+, fetchPypi
+, pythonOlder
+, poetry-core
+}:
+
+buildPythonPackage rec {
+  pname = "lc7001";
+  version = "1.0.3";
+  format = "pyproject";
+
+  disabled = pythonOlder "3.8";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "NgnszlgmeUnfWs9onnboFRz3c4OibsNaZHjDINvoMPc=";
+  };
+
+  nativeBuildInputs = [
+    poetry-core
+  ];
+
+  propagatedBuildInputs = [
+    cryptography
+  ];
+
+  # Project has no tests
+  doCheck = false;
+
+  pythonImportsCheck = [
+    "lc7001"
+  ];
+
+  meta = with lib; {
+    description = "Python module for interacting with Legrand LC7001";
+    homepage = "https://github.com/rtyle/lc7001";
+    license = licenses.mit;
+    maintainers = with maintainers; [ fab ];
+  };
+}
diff --git a/pkgs/development/python-modules/libasyncns/default.nix b/pkgs/development/python-modules/libasyncns/default.nix
index 38ca9b26360c6..bd28c2207340c 100644
--- a/pkgs/development/python-modules/libasyncns/default.nix
+++ b/pkgs/development/python-modules/libasyncns/default.nix
@@ -1,5 +1,10 @@
-{ lib, buildPythonPackage, fetchurl
-, libasyncns, pkg-config }:
+{ lib
+, stdenv
+, buildPythonPackage
+, fetchurl
+, libasyncns
+, pkg-config
+}:
 
 buildPythonPackage rec {
   pname = "libasyncns-python";
@@ -12,10 +17,17 @@ buildPythonPackage rec {
 
   patches = [ ./libasyncns-fix-res-consts.patch ];
 
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace resquery.c \
+      --replace '<arpa/nameser.h>' '<arpa/nameser_compat.h>'
+  '';
+
   buildInputs = [ libasyncns ];
   nativeBuildInputs = [ pkg-config ];
   doCheck = false; # requires network access
 
+  pythonImportsCheck = [ "libasyncns" ];
+
   meta = with lib; {
     description = "libasyncns-python is a python binding for the asynchronous name service query library";
     license = licenses.lgpl21;
diff --git a/pkgs/development/python-modules/ludios_wpull/default.nix b/pkgs/development/python-modules/ludios_wpull/default.nix
index e87146f6fbc3c..0045f4b3e0fa4 100644
--- a/pkgs/development/python-modules/ludios_wpull/default.nix
+++ b/pkgs/development/python-modules/ludios_wpull/default.nix
@@ -1,7 +1,6 @@
 { lib
 , buildPythonPackage
 , fetchFromGitHub
-, isPy3k
 , chardet
 , dnspython
 , html5-parser
@@ -15,15 +14,16 @@
 
 buildPythonPackage rec {
   pname = "ludios_wpull";
-  version = "3.0.7";
+  version = "3.0.9";
 
-  disabled = (!isPy3k) || (pythonAtLeast "3.8");
+  # https://github.com/ArchiveTeam/ludios_wpull/issues/20
+  disabled = pythonAtLeast "3.9";
 
   src = fetchFromGitHub {
     rev = version;
-    owner = "ludios";
-    repo = "wpull";
-    sha256 = "1j96avm0ynbazypzp766wh26n4qc73y7wgsiqfrdfl6x7rx20wgf";
+    owner = "ArchiveTeam";
+    repo = "ludios_wpull";
+    sha256 = "0j4dir0dgg8pkf4d1znicz6wyyi1wzij50r21z838cycsdr54j4c";
   };
 
   propagatedBuildInputs = [ chardet dnspython html5-parser lxml namedlist sqlalchemy tornado Yapsy ];
@@ -33,7 +33,7 @@ buildPythonPackage rec {
 
   meta = {
     description = "Web crawler; fork of wpull used by grab-site";
-    homepage = "https://github.com/ludios/wpull";
+    homepage = "https://github.com/ArchiveTeam/ludios_wpull";
     license = lib.licenses.gpl3;
     maintainers = with lib.maintainers; [ ivan ];
     broken = lib.versions.major tornado.version != "4";
diff --git a/pkgs/development/python-modules/luxtronik/default.nix b/pkgs/development/python-modules/luxtronik/default.nix
new file mode 100644
index 0000000000000..9aab07b016653
--- /dev/null
+++ b/pkgs/development/python-modules/luxtronik/default.nix
@@ -0,0 +1,36 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, pytestCheckHook
+, poetry-core
+, pythonOlder
+}:
+
+buildPythonPackage rec {
+  pname = "luxtronik";
+  version = "0.3.9";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.7";
+
+  src = fetchFromGitHub {
+    owner = "Bouni";
+    repo = "python-luxtronik";
+    rev = version;
+    sha256 = "mScdTQ82tV5fyy1S0YDDOz1UC4VB0OmSXD5gHp53WsE=";
+  };
+
+  # Project has no tests
+  doCheck = false;
+
+  pythonImportsCheck = [
+    "luxtronik"
+  ];
+
+  meta = with lib; {
+    description = "Python library to interact with Luxtronik heatpump controllers";
+    homepage = "https://github.com/Bouni/python-luxtronik";
+    license = licenses.mit;
+    maintainers = with maintainers; [ fab ];
+  };
+}
diff --git a/pkgs/development/python-modules/mailman-hyperkitty/default.nix b/pkgs/development/python-modules/mailman-hyperkitty/default.nix
index 649d8d4cf3dff..117ec4fb43619 100644
--- a/pkgs/development/python-modules/mailman-hyperkitty/default.nix
+++ b/pkgs/development/python-modules/mailman-hyperkitty/default.nix
@@ -12,14 +12,14 @@
 
 buildPythonPackage rec {
   pname = "mailman-hyperkitty";
-  version = "1.1.0";
+  version = "1.2.0";
   format = "setuptools";
 
   disabled = pythonOlder "3.9";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1lfqa9admhvdv71f528jmz2wl0i5cv77v6l64px2pm4zqr9ckkjx";
+    sha256 = "sha256-EQBx1KX3z/Wv3QAHOi+s/ihLOjpiupIQBYyE6IPbJto=";
   };
 
   propagatedBuildInputs = [
diff --git a/pkgs/development/python-modules/millheater/default.nix b/pkgs/development/python-modules/millheater/default.nix
index 0ff22033f6442..3968e8bf8088e 100644
--- a/pkgs/development/python-modules/millheater/default.nix
+++ b/pkgs/development/python-modules/millheater/default.nix
@@ -9,14 +9,16 @@
 
 buildPythonPackage rec {
   pname = "millheater";
-  version = "0.8.1";
+  version = "0.9.0";
+  format = "setuptools";
+
   disabled = pythonOlder "3.6";
 
   src = fetchFromGitHub {
     owner = "Danielhiversen";
     repo = "pymill";
     rev = version;
-    sha256 = "0269lhb6y4c13n6krsl2b66ldvzkd26jlax7bbnkvag2iv7g6hzj";
+    sha256 = "sha256-ocPp9tRghlOb0vZrpELDkwOq8ue+JBCRf2uB0Q7CPF8=";
   };
 
   propagatedBuildInputs = [
diff --git a/pkgs/development/python-modules/mujson/default.nix b/pkgs/development/python-modules/mujson/default.nix
new file mode 100644
index 0000000000000..10f0e40b76268
--- /dev/null
+++ b/pkgs/development/python-modules/mujson/default.nix
@@ -0,0 +1,32 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+}:
+
+buildPythonPackage rec {
+  pname = "mujson";
+  version = "1.4";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "sha256-J9nPGxDkLQje6AkL9cewNqmQ7Z+00TXBEr3p71E2cnE=";
+  };
+
+  # LICENSE file missing from src
+  # https://github.com/mattgiles/mujson/issues/8
+  postPatch = ''
+    substituteInPlace setup.cfg \
+      --replace "license_file = LICENSE" ""
+  '';
+
+  # No tests
+  doCheck = false;
+  pythonImportsCheck = [ "mujson" ];
+
+  meta = with lib; {
+    description = "Use the fastest JSON functions available at import time";
+    homepage = "https://github.com/mattgiles/mujson";
+    license = licenses.mit;
+    maintainers = with maintainers; [ artturin ];
+  };
+}
diff --git a/pkgs/development/python-modules/nessclient/default.nix b/pkgs/development/python-modules/nessclient/default.nix
new file mode 100644
index 0000000000000..d91a80eb9d0f3
--- /dev/null
+++ b/pkgs/development/python-modules/nessclient/default.nix
@@ -0,0 +1,47 @@
+{ lib
+, asynctest
+, buildPythonPackage
+, click
+, fetchFromGitHub
+, justbackoff
+, pythonOlder
+, pytest-asyncio
+, pytestCheckHook
+}:
+
+buildPythonPackage rec {
+  pname = "nessclient";
+  version = "0.9.16b2";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.8";
+
+  src = fetchFromGitHub {
+    owner = "nickw444";
+    repo = pname;
+    rev = version;
+    sha256 = "1g3q9bv1nn1b8n6bklc05k8pac4cndzfxfr7liky0gnnbri15k81";
+  };
+
+  propagatedBuildInputs = [
+    justbackoff
+    click
+  ];
+
+  checkInputs = [
+    asynctest
+    pytest-asyncio
+    pytestCheckHook
+  ];
+
+  pythonImportsCheck = [
+    "nessclient"
+  ];
+
+  meta = with lib; {
+    description = "Python implementation/abstraction of the Ness D8x/D16x Serial Interface ASCII protocol";
+    homepage = "https://github.com/nickw444/nessclient";
+    license = with licenses; [ mit ];
+    maintainers = with maintainers; [ fab ];
+  };
+}
diff --git a/pkgs/development/python-modules/oath/default.nix b/pkgs/development/python-modules/oath/default.nix
index fd12a830472be..a8740f685747d 100644
--- a/pkgs/development/python-modules/oath/default.nix
+++ b/pkgs/development/python-modules/oath/default.nix
@@ -1,16 +1,25 @@
 { lib
 , buildPythonPackage
 , fetchPypi
+, pytestCheckHook
 }:
 
 buildPythonPackage rec {
   pname = "oath";
-  version = "1.4.3";
+  version = "1.4.4";
+  format = "setuptools";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1xqgcqgx6aa0j21hwsdb3aqpqhviwj756bcqjjjcm1h1aij11p6m";
+    sha256 = "sha256-vWsg0g8sTj9TUj7pACEdynWu7KcvT1qf2NyswXX+HAs=";
   };
+  checkInputs = [
+    pytestCheckHook
+  ];
+
+  pythonImportsCheck = [
+    "oath"
+  ];
 
   meta = with lib; {
     description = "Python implementation of the three main OATH specifications: HOTP, TOTP and OCRA";
diff --git a/pkgs/development/python-modules/py-nightscout/default.nix b/pkgs/development/python-modules/py-nightscout/default.nix
new file mode 100644
index 0000000000000..e633e6ce81bf9
--- /dev/null
+++ b/pkgs/development/python-modules/py-nightscout/default.nix
@@ -0,0 +1,50 @@
+{ lib
+, aiohttp
+, aioresponses
+, buildPythonPackage
+, fetchFromGitHub
+, pytest-asyncio
+, pytestCheckHook
+, python-dateutil
+, pythonOlder
+, pytz
+}:
+
+buildPythonPackage rec {
+  pname = "py-nightscout";
+  version = "1.3.2";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.8";
+
+  src = fetchFromGitHub {
+    owner = "marciogranzotto";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "06i8vc7ykk5112y66cjixbrks46mdx3r0ygkmyah6gfgq1ddc39j";
+  };
+
+  propagatedBuildInputs = [
+    python-dateutil
+    pytz
+    aiohttp
+  ];
+
+  checkInputs = [
+    aioresponses
+    pytestCheckHook
+    pytest-asyncio
+  ];
+
+
+  pythonImportsCheck = [
+    "py_nightscout"
+  ];
+
+  meta = with lib; {
+    description = "Python library that provides an interface to Nightscout";
+    homepage = "https://github.com/marciogranzotto/py-nightscout";
+    license = with licenses; [ mit ];
+    maintainers = with maintainers; [ fab ];
+  };
+}
diff --git a/pkgs/development/python-modules/pyads/default.nix b/pkgs/development/python-modules/pyads/default.nix
index 232221365fa4d..a22e85154261e 100644
--- a/pkgs/development/python-modules/pyads/default.nix
+++ b/pkgs/development/python-modules/pyads/default.nix
@@ -8,14 +8,16 @@
 
 buildPythonPackage rec {
   pname = "pyads";
-  version = "3.3.8";
-  disabled = pythonOlder "3.6";
+  version = "3.3.9";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.7";
 
   src = fetchFromGitHub {
     owner = "stlehmann";
     repo = pname;
     rev = version;
-    sha256 = "sha256-jhEVBndUOKM8rBX0LEqPTMLqbpizCiD7T+OCzbVgLM8=";
+    sha256 = "sha256-eNouFJQDgp56fgkA7wZKfosKWOKU6OvXRjFwjCMvZqI=";
   };
 
   buildInputs = [
@@ -31,7 +33,9 @@ buildPythonPackage rec {
     pytestCheckHook
   ];
 
-  pythonImportsCheck = [ "pyads" ];
+  pythonImportsCheck = [
+    "pyads"
+  ];
 
   meta = with lib; {
     description = "Python wrapper for TwinCAT ADS library";
diff --git a/pkgs/development/python-modules/pyahocorasick/default.nix b/pkgs/development/python-modules/pyahocorasick/default.nix
index 87d1d0c9fc01f..7bb2f7c988a9d 100644
--- a/pkgs/development/python-modules/pyahocorasick/default.nix
+++ b/pkgs/development/python-modules/pyahocorasick/default.nix
@@ -15,6 +15,11 @@ buildPythonPackage rec {
     sha256 = "13x3718if28l50474xrz1b9709kvnvdg3nzm6y8bh7mc9a4zyss5";
   };
 
+  postPatch = ''
+    substituteInPlace unittests.py \
+        --replace '(tmp, "test.dat")' "(\"$TMPDIR\", \"test.dat\")"
+  '';
+
   checkInputs = [ pytestCheckHook ];
 
   pytestFlagsArray = [ "unittests.py" ];
diff --git a/pkgs/development/python-modules/pyatmo/default.nix b/pkgs/development/python-modules/pyatmo/default.nix
index bff5a9b6d14cd..c039ff16b80ee 100644
--- a/pkgs/development/python-modules/pyatmo/default.nix
+++ b/pkgs/development/python-modules/pyatmo/default.nix
@@ -16,7 +16,8 @@
 
 buildPythonPackage rec {
   pname = "pyatmo";
-  version = "6.1.0";
+  version = "6.2.0";
+  format = "setuptools";
 
   disabled = pythonOlder "3.8";
 
@@ -24,7 +25,7 @@ buildPythonPackage rec {
     owner = "jabesq";
     repo = "pyatmo";
     rev = "v${version}";
-    sha256 = "sha256-Iscnv3hfYa8QFiXMUN334Muo0oGqnnK11RPNxQJggG0=";
+    sha256 = "sha256-VBc2avJiIFQW1LYXQEvIZ/wZKMFJsCF9DDrxwL8dDnk=";
   };
 
   SETUPTOOLS_SCM_PRETEND_VERSION = version;
@@ -54,7 +55,9 @@ buildPythonPackage rec {
       --replace "requests~=2.24" "requests"
   '';
 
-  pythonImportsCheck = [ "pyatmo" ];
+  pythonImportsCheck = [
+    "pyatmo"
+  ];
 
   meta = with lib; {
     description = "Simple API to access Netatmo weather station data";
diff --git a/pkgs/development/python-modules/pyebus/default.nix b/pkgs/development/python-modules/pyebus/default.nix
new file mode 100644
index 0000000000000..d4c8658673a04
--- /dev/null
+++ b/pkgs/development/python-modules/pyebus/default.nix
@@ -0,0 +1,43 @@
+{ lib
+, anytree
+, buildPythonPackage
+, fetchPypi
+, pytestCheckHook
+, poetry-core
+, pythonOlder
+}:
+
+buildPythonPackage rec {
+  pname = "pyebus";
+  version = "1.2.4";
+  format = "pyproject";
+
+  disabled = pythonOlder "3.7";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "i+p40s9SXey1lfXWW+PiXsA1kUF4o6Rk7QLmQ2ljN6g=";
+  };
+
+  nativeBuildInputs = [
+    poetry-core
+  ];
+
+  propagatedBuildInputs = [
+    anytree
+  ];
+
+  # https://github.com/c0fec0de/pyebus/issues/3
+  doCheck = false;
+
+  pythonImportsCheck = [
+    "pyebus"
+  ];
+
+  meta = with lib; {
+    description = "Pythonic Interface to EBUS Daemon (ebusd)";
+    homepage = "https://github.com/c0fec0de/pyebus";
+    license = licenses.mit;
+    maintainers = with maintainers; [ fab ];
+  };
+}
diff --git a/pkgs/development/python-modules/pyqtgraph/default.nix b/pkgs/development/python-modules/pyqtgraph/default.nix
index 854af36e5bcd1..af5567acc8d32 100644
--- a/pkgs/development/python-modules/pyqtgraph/default.nix
+++ b/pkgs/development/python-modules/pyqtgraph/default.nix
@@ -53,7 +53,7 @@ buildPythonPackage rec {
     export FONTCONFIG_FILE=${fontsConf}
   '';
 
-  disabledTests = lib.optionals (!(stdenv.isi686 || stdenv.isx86_64)) [
+  disabledTests = lib.optionals (!stdenv.hostPlatform.isx86) [
     # small precision-related differences on other architectures,
     # upstream doesn't consider it serious.
     # https://github.com/pyqtgraph/pyqtgraph/issues/2110
diff --git a/pkgs/development/python-modules/python-crontab/default.nix b/pkgs/development/python-modules/python-crontab/default.nix
index d91418fc1d0e7..9de0801d53754 100644
--- a/pkgs/development/python-modules/python-crontab/default.nix
+++ b/pkgs/development/python-modules/python-crontab/default.nix
@@ -10,7 +10,11 @@ buildPythonPackage rec {
   };
 
   checkInputs = [ pytestCheckHook ];
-  disabledTests = [ "test_07_non_posix_shell"];
+  disabledTests = [
+    "test_07_non_posix_shell"
+    # doctest that assumes /tmp is writeable, awkward to patch
+    "test_03_usage"
+  ];
 
   propagatedBuildInputs = [ python-dateutil ];
 
diff --git a/pkgs/development/python-modules/pytomlpp/default.nix b/pkgs/development/python-modules/pytomlpp/default.nix
index d2fc8470d4874..271d193ce019f 100644
--- a/pkgs/development/python-modules/pytomlpp/default.nix
+++ b/pkgs/development/python-modules/pytomlpp/default.nix
@@ -13,14 +13,14 @@
 
 buildPythonPackage rec {
   pname = "pytomlpp";
-  version = "0.3.5";
+  version = "1.0.6";
 
   src = fetchFromGitHub {
     owner = "bobfang1992";
     repo = pname;
-    rev = version;
+    rev = "v${version}";
     fetchSubmodules = true;
-    sha256 = "1h06a2r0f5q4mml485113mn7a7585zmhqsk2p1apcybyydllcqda";
+    sha256 = "sha256-QyjIJCSgiSKjqMBvCbOlWYx6rBbKIoDvXez2YnYaPUo=";
   };
 
   buildInputs = [ pybind11 ];
diff --git a/pkgs/development/python-modules/pyupgrade/default.nix b/pkgs/development/python-modules/pyupgrade/default.nix
index 8e355699258dc..324f0a934a5a5 100644
--- a/pkgs/development/python-modules/pyupgrade/default.nix
+++ b/pkgs/development/python-modules/pyupgrade/default.nix
@@ -8,21 +8,29 @@
 
 buildPythonPackage rec {
   pname = "pyupgrade";
-  version = "2.29.0";
+  version = "2.29.1";
+  format = "setuptools";
+
   disabled = pythonOlder "3.6";
 
   src = fetchFromGitHub {
     owner = "asottile";
     repo = pname;
     rev = "v${version}";
-    sha256 = "sha256-Hq58DJe8ZLZSJdhqSxfTaZPnWae2aQFCe7lH+6Y6ABg=";
+    sha256 = "sha256-fN0+4/EeoMD2c16OgepjDWuUhowMxzM7nB3mkL3iDjc=";
   };
 
-  checkInputs = [ pytestCheckHook ];
+  checkInputs = [
+    pytestCheckHook
+  ];
 
-  propagatedBuildInputs = [ tokenize-rt ];
+  propagatedBuildInputs = [
+    tokenize-rt
+  ];
 
-  pythonImportsCheck = [ "pyupgrade" ];
+  pythonImportsCheck = [
+    "pyupgrade"
+  ];
 
   meta = with lib; {
     description = "Tool to automatically upgrade syntax for newer versions of the language";
diff --git a/pkgs/development/python-modules/pywlroots/default.nix b/pkgs/development/python-modules/pywlroots/default.nix
index ab7a8777a2432..a35132ade3f66 100644
--- a/pkgs/development/python-modules/pywlroots/default.nix
+++ b/pkgs/development/python-modules/pywlroots/default.nix
@@ -17,11 +17,11 @@
 
 buildPythonPackage rec {
   pname = "pywlroots";
-  version = "0.14.9";
+  version = "0.14.11";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "jzHh5ubonn6pCaOp+Dnr7tA9n5DdZ28hBM+03jZZlvc=";
+    sha256 = "Ey1B3tx6UufxZs8I64vaoPSNC+4LGdcPuyKrLBHxZa8=";
   };
 
   nativeBuildInputs = [ pkg-config ];
diff --git a/pkgs/development/python-modules/qcs-api-client/default.nix b/pkgs/development/python-modules/qcs-api-client/default.nix
index 78fc11f150ea0..dfb237fe2065a 100644
--- a/pkgs/development/python-modules/qcs-api-client/default.nix
+++ b/pkgs/development/python-modules/qcs-api-client/default.nix
@@ -18,14 +18,14 @@
 
 buildPythonPackage rec {
   pname = "qcs-api-client";
-  version = "0.19.0";
+  version = "0.20.0";
   format = "setuptools";
 
   disabled = pythonOlder "3.7";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "sha256-OfhOYvGcBzbirsD05D206b+mAOVvDVAwBvDgCKfXxSw=";
+    sha256 = "sha256-l6n/DUEWIBmnPvt5+TAZ2RnFrYEUwh4nIZa6aQG2lJ0=";
   };
 
   propagatedBuildInputs = [
diff --git a/pkgs/development/python-modules/related/default.nix b/pkgs/development/python-modules/related/default.nix
new file mode 100644
index 0000000000000..ddcedc4eae6df
--- /dev/null
+++ b/pkgs/development/python-modules/related/default.nix
@@ -0,0 +1,60 @@
+{ lib
+, attrs
+, buildPythonPackage
+, fetchPypi
+, future
+, pytestCheckHook
+, python-dateutil
+, pythonOlder
+, pyyaml
+}:
+
+buildPythonPackage rec {
+  pname = "related";
+  version = "0.7.2";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.7";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "w0XmNWh1xF08qitH22lQgTRNqO6qyYrYd2dc6x3Fop0=";
+  };
+
+  propagatedBuildInputs = [
+    attrs
+    future
+    python-dateutil
+    pyyaml
+  ];
+
+  checkInputs = [
+    pytestCheckHook
+  ];
+
+  postPatch = ''
+    # Remove outdated setup.cfg
+    rm setup.cfg
+    substituteInPlace setup.py \
+      --replace "'pytest-runner'," ""
+  '';
+
+  disabledTests = [
+    # Source tarball doesn't contains all needed files
+    "test_compose_from_yml"
+    "test_yaml_roundtrip_with_empty_values"
+    "test_compose_from_yml"
+    "test_store_data_from_json"
+  ];
+
+  pythonImportsCheck = [
+    "related"
+  ];
+
+  meta = with lib; {
+    description = "Nested Object Models in Python";
+    homepage = "https://github.com/genomoncology/related";
+    license = licenses.mit;
+    maintainers = with maintainers; [ fab ];
+  };
+}
diff --git a/pkgs/development/python-modules/restrictedpython/default.nix b/pkgs/development/python-modules/restrictedpython/default.nix
index d7005e1545046..6e782b1bd336a 100644
--- a/pkgs/development/python-modules/restrictedpython/default.nix
+++ b/pkgs/development/python-modules/restrictedpython/default.nix
@@ -1,34 +1,34 @@
 { lib
 , buildPythonPackage
 , fetchPypi
-
-# Test dependencies
-, pytest, pytest-mock
+, pytest-mock
+, pytestCheckHook
 }:
 
 buildPythonPackage rec {
-  pname = "RestrictedPython";
-  version = "5.1";
+  pname = "restrictedpython";
+  version = "5.2";
+  format = "setuptools";
 
   src = fetchPypi {
-    inherit pname version;
-    sha256 = "9ae16e500782b41bd1abefd8554ccb26330817bba9ce090d385aa226f1ca83e8";
+    pname = "RestrictedPython";
+    inherit version;
+    sha256 = "sha256-Y02h9sXBIqJi9DOwg+49F6mgOfjxs3eFl++0dGHNNhs=";
   };
 
-  #propagatedBuildInputs = [ xmltodict requests ifaddr ];
-
   checkInputs = [
-    pytest pytest-mock
+    pytestCheckHook
+    pytest-mock
   ];
 
-  checkPhase = ''
-    pytest
-  '';
+  pythonImportsCheck = [
+    "RestrictedPython"
+  ];
 
-  meta = {
+  meta = with lib; {
+    description = "Restricted execution environment for Python to run untrusted code";
     homepage = "https://github.com/zopefoundation/RestrictedPython";
-    description = "A restricted execution environment for Python to run untrusted code";
-    license = lib.licenses.zpl21;
-    maintainers = with lib.maintainers; [ juaningan ];
+    license = licenses.zpl21;
+    maintainers = with maintainers; [ juaningan ];
   };
 }
diff --git a/pkgs/development/python-modules/roombapy/default.nix b/pkgs/development/python-modules/roombapy/default.nix
index 459037d6191e9..cc73e58fc7b80 100644
--- a/pkgs/development/python-modules/roombapy/default.nix
+++ b/pkgs/development/python-modules/roombapy/default.nix
@@ -11,20 +11,25 @@
 
 buildPythonPackage rec {
   pname = "roombapy";
-  version = "1.6.3";
+  version = "1.6.4";
   format = "pyproject";
+
   disabled = pythonOlder "3.7";
 
   src = fetchFromGitHub {
     owner = "pschmitt";
     repo = "roombapy";
     rev = version;
-    sha256 = "sha256-GkDfIC2jx4Mpguk/Wu45pZw0czhabJwTz58WYSLCOV8=";
+    sha256 = "sha256-EN+em+lULAUplXlhcU409ZVPk9BfMmD2oNwO0ETuqoA=";
   };
 
-  nativeBuildInputs = [ poetry-core ];
+  nativeBuildInputs = [
+    poetry-core
+  ];
 
-  propagatedBuildInputs = [ paho-mqtt ];
+  propagatedBuildInputs = [
+    paho-mqtt
+  ];
 
   checkInputs = [
     amqtt
@@ -37,12 +42,19 @@ buildPythonPackage rec {
     "tests/test_discovery.py"
   ];
 
-  pythonImportsCheck = [ "roombapy" ];
+  disabledTests = [
+    # Test want to connect to a local MQTT broker
+    "test_roomba_connect"
+  ];
+
+  pythonImportsCheck = [
+    "roombapy"
+  ];
 
   meta = with lib; {
-    homepage = "https://github.com/pschmitt/roombapy";
     description = "Python program and library to control Wi-Fi enabled iRobot Roombas";
-    maintainers = with maintainers; [ justinas ];
+    homepage = "https://github.com/pschmitt/roombapy";
     license = licenses.mit;
+    maintainers = with maintainers; [ justinas ];
   };
 }
diff --git a/pkgs/development/python-modules/sanic/default.nix b/pkgs/development/python-modules/sanic/default.nix
index 1f7775c1d84f8..6161f5c5eb022 100644
--- a/pkgs/development/python-modules/sanic/default.nix
+++ b/pkgs/development/python-modules/sanic/default.nix
@@ -85,19 +85,14 @@ buildPythonPackage rec {
     "test_auto_reload"
     "test_no_exceptions_when_cancel_pending_request"
     "test_ipv6_address_is_not_wrapped"
-  ] ++ lib.optionals stdenv.isDarwin [
-    # https://github.com/sanic-org/sanic/issues/2298
-    "test_no_exceptions_when_cancel_pending_request"
-  ] ++ lib.optionals (stdenv.hostPlatform.system == "aarch64-linux") [
     # These appear to be very sensitive to output of commands
-    # Output is different on aarch64
-    "test_server_run"
+    "test_access_logs"
+    "test_auto_reload"
     "test_host_port"
+    "test_no_exceptions_when_cancel_pending_request"
     "test_num_workers"
-    "test_access_logs"
+    "test_server_run"
     "test_version"
-    # Failing for a different reason than Darwin
-    "test_no_exceptions_when_cancel_pending_request"
   ];
 
   # avoid usage of nixpkgs-review in darwin since tests will compete usage
diff --git a/pkgs/development/python-modules/termplotlib/default.nix b/pkgs/development/python-modules/termplotlib/default.nix
index 06432b673afd4..fde1080491e01 100644
--- a/pkgs/development/python-modules/termplotlib/default.nix
+++ b/pkgs/development/python-modules/termplotlib/default.nix
@@ -1,4 +1,5 @@
 { lib
+, substituteAll
 , buildPythonPackage
 , fetchFromGitHub
 , pytestCheckHook
@@ -19,13 +20,28 @@ buildPythonPackage rec {
   };
 
   format = "pyproject";
-  checkInputs = [ pytestCheckHook numpy exdown gnuplot ];
+  checkInputs = [
+    pytestCheckHook
+    exdown
+  ];
   pythonImportsCheck = [ "termplotlib" ];
 
-  # there seems to be a newline in the very front of the output
-  # which causes the test to fail, since it apparently doesn't
-  # strip whitespace. might be a gnuplot choice? sigh...
-  disabledTests = [ "test_plot_lim" ];
+  propagatedBuildInputs = [ numpy ];
+
+  patches = [
+    (substituteAll {
+      src = ./gnuplot-subprocess.patch;
+      gnuplot = "${gnuplot.out}/bin/gnuplot";
+    })
+  ];
+
+  # The current gnuplot version renders slightly different test
+  # graphs, with emphasis on slightly. The plots are still correct.
+  # Tests pass on gnuplot 5.4.1, but fail on 5.4.2.
+  disabledTests = [
+    "test_plot"
+    "test_nolabel"
+  ];
 
   meta = with lib; {
     description = "matplotlib for your terminal";
diff --git a/pkgs/development/python-modules/termplotlib/gnuplot-subprocess.patch b/pkgs/development/python-modules/termplotlib/gnuplot-subprocess.patch
new file mode 100644
index 0000000000000..5935dbda12652
--- /dev/null
+++ b/pkgs/development/python-modules/termplotlib/gnuplot-subprocess.patch
@@ -0,0 +1,26 @@
+diff --git a/src/termplotlib/helpers.py b/src/termplotlib/helpers.py
+index 4b67fd0..38a2242 100644
+--- a/src/termplotlib/helpers.py
++++ b/src/termplotlib/helpers.py
+@@ -32,7 +32,7 @@ def is_unicode_standard_output():
+ 
+ 
+ def get_gnuplot_version():
+-    out = subprocess.check_output(["gnuplot", "--version"]).decode()
++    out = subprocess.check_output(["@gnuplot@", "--version"]).decode()
+     m = re.match("gnuplot (\\d).(\\d) patchlevel (\\d)\n", out)
+     if m is None:
+         raise RuntimeError("Couldn't get gnuplot version")
+diff --git a/src/termplotlib/plot.py b/src/termplotlib/plot.py
+index 0f46b87..1418fd1 100644
+--- a/src/termplotlib/plot.py
++++ b/src/termplotlib/plot.py
+@@ -17,7 +17,7 @@ def plot(
+     ticks_scale: int = 0,
+ ):
+     p = subprocess.Popen(
+-        ["gnuplot"],
++        ["@gnuplot@"],
+         stdout=subprocess.PIPE,
+         stdin=subprocess.PIPE,
+         stderr=subprocess.PIPE,
diff --git a/pkgs/development/python-modules/tweepy/default.nix b/pkgs/development/python-modules/tweepy/default.nix
index 7892975a45d9c..a98911da58d5a 100644
--- a/pkgs/development/python-modules/tweepy/default.nix
+++ b/pkgs/development/python-modules/tweepy/default.nix
@@ -12,7 +12,7 @@
 
 buildPythonPackage rec {
   pname = "tweepy";
-  version = "4.3.0";
+  version = "4.4.0";
   format = "setuptools";
 
   disabled = pythonOlder "3.6";
@@ -21,7 +21,7 @@ buildPythonPackage rec {
     owner = pname;
     repo = pname;
     rev = "v${version}";
-    sha256 = "sha256-lS/98DRpJH1UGGNzwqVVUJOeul+BX+I3e+ysmC0oL3I=";
+    sha256 = "sha256-GUo8uvShyIOWWcO5T1JvV7DMC1W70YILx/hvHIGQg0o=";
   };
 
   propagatedBuildInputs = [
diff --git a/pkgs/development/python-modules/ukkonen/default.nix b/pkgs/development/python-modules/ukkonen/default.nix
new file mode 100644
index 0000000000000..dfdcf3515220c
--- /dev/null
+++ b/pkgs/development/python-modules/ukkonen/default.nix
@@ -0,0 +1,41 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, cffi
+, pytestCheckHook
+, pythonOlder
+}:
+
+buildPythonPackage rec {
+  pname = "ukkonen";
+  version = "1.0.1";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.6";
+
+  src = fetchFromGitHub {
+    owner = "asottile";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "jG6VP/P5sadrdrmneH36/ExSld9blyMAAG963QS9+p0=";
+  };
+
+  nativeBuildInputs = [
+    cffi
+  ];
+
+  checkInputs = [
+    pytestCheckHook
+  ];
+
+  pythonImportsCheck = [
+    "ukkonen"
+  ];
+
+  meta = with lib; {
+    description = "Python implementation of bounded Levenshtein distance (Ukkonen)";
+    homepage = "https://github.com/asottile/ukkonen";
+    license = licenses.mit;
+    maintainers = with maintainers; [ fab ];
+  };
+}
diff --git a/pkgs/development/python-modules/unicorn/default.nix b/pkgs/development/python-modules/unicorn/default.nix
index c9043afa85d9d..1f2876bdc693f 100644
--- a/pkgs/development/python-modules/unicorn/default.nix
+++ b/pkgs/development/python-modules/unicorn/default.nix
@@ -19,12 +19,22 @@ buildPythonPackage rec {
     ln -s ${unicorn-emu}/lib/libunicorn.a prebuilt/
   '';
 
+  # needed on non-x86 linux
+  setupPyBuildFlags = lib.optionals stdenv.isLinux [ "--plat-name" "linux" ];
+
   propagatedBuildInputs = [
     setuptools
   ];
 
-  # No tests present
-  doCheck = false;
+  checkPhase = ''
+    runHook preCheck
+
+    mv unicorn unicorn.hidden
+    patchShebangs sample_*.py shellcode.py
+    sh -e sample_all.sh
+
+    runHook postCheck
+  '';
 
   pythonImportsCheck = [
     "unicorn"
diff --git a/pkgs/development/python-modules/uonet-request-signer-hebe/default.nix b/pkgs/development/python-modules/uonet-request-signer-hebe/default.nix
new file mode 100644
index 0000000000000..19d4bba0b9745
--- /dev/null
+++ b/pkgs/development/python-modules/uonet-request-signer-hebe/default.nix
@@ -0,0 +1,37 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, pythonOlder
+, pyopenssl
+}:
+
+buildPythonPackage rec {
+  pname = "uonet-request-signer-hebe";
+  version = "0.1.1";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.6";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "fidopnpAt5CXPsLbx+V8wrJCQQ/WIO6AqxpsYLDv8qM=";
+  };
+
+  propagatedBuildInputs = [
+    pyopenssl
+  ];
+
+  # Source is not tagged
+  doCheck = false;
+
+  pythonImportsCheck = [
+    "uonet_request_signer_hebe"
+  ];
+
+  meta = with lib; {
+    description = "UONET+ (hebe) request signer for Python";
+    homepage = "https://github.com/wulkanowy/uonet-request-signer";
+    license = licenses.mit;
+    maintainers = with maintainers; [ fab ];
+  };
+}
diff --git a/pkgs/development/python-modules/vulcan-api/default.nix b/pkgs/development/python-modules/vulcan-api/default.nix
new file mode 100644
index 0000000000000..6355e37bd64da
--- /dev/null
+++ b/pkgs/development/python-modules/vulcan-api/default.nix
@@ -0,0 +1,57 @@
+{ lib
+, aenum
+, aiodns
+, aiohttp
+, buildPythonPackage
+, cchardet
+, fetchFromGitHub
+, pyopenssl
+, pythonOlder
+, pytz
+, related
+, requests
+, uonet-request-signer-hebe
+, yarl
+}:
+
+buildPythonPackage rec {
+  pname = "vulcan-api";
+  version = "2.0.3";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.6";
+
+  src = fetchFromGitHub {
+    owner = "kapi2289";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "YLt9yufOBlWRyo+le7HcaFD/s7V5WpvhMUrHJqyC3pY=";
+  };
+
+  propagatedBuildInputs = [
+    aenum
+    aiodns
+    aiohttp
+    cchardet
+    pyopenssl
+    pytz
+    related
+    requests
+    uonet-request-signer-hebe
+    yarl
+  ];
+
+  # Project has no tests
+  doCheck = false;
+
+  pythonImportsCheck = [
+    "vulcan"
+  ];
+
+  meta = with lib; {
+    description = "Python library for UONET+ e-register API";
+    homepage = "https://vulcan-api.readthedocs.io/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ fab ];
+  };
+}
diff --git a/pkgs/development/python-modules/xmlschema/default.nix b/pkgs/development/python-modules/xmlschema/default.nix
index 19667d833faad..3ddcfee9dfb51 100644
--- a/pkgs/development/python-modules/xmlschema/default.nix
+++ b/pkgs/development/python-modules/xmlschema/default.nix
@@ -8,7 +8,7 @@
 }:
 
 buildPythonPackage rec {
-  version = "1.8.1";
+  version = "1.8.2";
   pname = "xmlschema";
 
   disabled = pythonOlder "3.6";
@@ -17,7 +17,7 @@ buildPythonPackage rec {
     owner = "sissaschool";
     repo = "xmlschema";
     rev = "v${version}";
-    sha256 = "0vs4d9bnms4krxvplzf2p69g673pdw31z8p5alzj3pqnaw83rg1z";
+    sha256 = "sha256-d7f19T17aAwdtNDjCrsXXY39u0aRgQo4vFPnxFNs2PQ=";
   };
 
   propagatedBuildInputs = [
diff --git a/pkgs/development/tools/analysis/checkov/default.nix b/pkgs/development/tools/analysis/checkov/default.nix
index e4123a8f105e8..a2fc83bc2b213 100644
--- a/pkgs/development/tools/analysis/checkov/default.nix
+++ b/pkgs/development/tools/analysis/checkov/default.nix
@@ -56,13 +56,13 @@ with py.pkgs;
 
 buildPythonApplication rec {
   pname = "checkov";
-  version = "2.0.587";
+  version = "2.0.591";
 
   src = fetchFromGitHub {
     owner = "bridgecrewio";
     repo = pname;
     rev = version;
-    sha256 = "sha256-uLH3g3UeWdIZsMsUwCYpTehgxDKGraPBlENdTz+QYLI=";
+    sha256 = "sha256-p8pEw3vH3W62MmlZsSqWoUKf7QjEQhlV5bSjYr1Wwm0=";
   };
 
   nativeBuildInputs = with py.pkgs; [
diff --git a/pkgs/development/tools/database/prisma-engines/default.nix b/pkgs/development/tools/database/prisma-engines/default.nix
index 91681a5a9a0bc..b05b0c2e47f1e 100644
--- a/pkgs/development/tools/database/prisma-engines/default.nix
+++ b/pkgs/development/tools/database/prisma-engines/default.nix
@@ -10,19 +10,19 @@
 
 rustPlatform.buildRustPackage rec {
   pname = "prisma-engines";
-  version = "3.4.0";
+  version = "3.5.0";
 
   src = fetchFromGitHub {
     owner = "prisma";
     repo = "prisma-engines";
     rev = version;
-    sha256 = "sha256-EuGGGTHBXm6crnoh5h0DYZZHUtzY4W0wlNgMAxbEb5w=";
+    sha256 = "sha256-c4t7r9Os0nmQEBpNeZ+XdTPc/5X6Dyw0dd7J4pw5s88=";
   };
 
   # Use system openssl.
   OPENSSL_NO_VENDOR = 1;
 
-  cargoSha256 = "sha256-CwNe4Qsswh+jMFMpg7DEM9Hq2YeEMcN4UTFMd8AEekw=";
+  cargoSha256 = "sha256-rjqFEY7GXXWzlw5E6Wg4KPz25BbvQPuLW5m8+3CbcRw=";
 
   nativeBuildInputs = [ pkg-config ];
 
diff --git a/pkgs/development/tools/misc/ccache/default.nix b/pkgs/development/tools/misc/ccache/default.nix
index 6e6f71b6fbea7..10e11391cd35c 100644
--- a/pkgs/development/tools/misc/ccache/default.nix
+++ b/pkgs/development/tools/misc/ccache/default.nix
@@ -15,13 +15,13 @@
 
 let ccache = stdenv.mkDerivation rec {
   pname = "ccache";
-  version = "4.5";
+  version = "4.5.1";
 
   src = fetchFromGitHub {
     owner = pname;
     repo = pname;
     rev = "v${version}";
-    hash = "sha256-RRQso5j249PinoWznix4x4/NURe3TrwYlKOF4q8dc5U=";
+    sha256 = "sha256-AmzfBuase3RDoRVswyIgBnyL5TK0LXEGmYIpDzsCwgs=";
   };
 
   outputs = [ "out" "man" ];
diff --git a/pkgs/development/tools/misc/creduce/default.nix b/pkgs/development/tools/misc/creduce/default.nix
index 0ae900060b973..77493bd166471 100644
--- a/pkgs/development/tools/misc/creduce/default.nix
+++ b/pkgs/development/tools/misc/creduce/default.nix
@@ -8,11 +8,11 @@
 
 stdenv.mkDerivation rec {
   pname = "creduce";
-  version = "2.9.0";
+  version = "2.10.0";
 
   src = fetchurl {
     url = "https://embed.cs.utah.edu/${pname}/${pname}-${version}.tar.gz";
-    sha256 = "1b833z0g1hich68kzbkpfc26xb8w2phfl5savy8c6ir9ihwy1a8w";
+    sha256 = "2xwPEjln8k1iCwQM69UwAb89zwPkAPeFVqL/LhH+oGM=";
   };
 
   nativeBuildInputs = [ cmake makeWrapper llvm.dev ];
diff --git a/pkgs/development/tools/rust/cargo-msrv/default.nix b/pkgs/development/tools/rust/cargo-msrv/default.nix
index 18b432df7b4dd..33e9fca441fb5 100644
--- a/pkgs/development/tools/rust/cargo-msrv/default.nix
+++ b/pkgs/development/tools/rust/cargo-msrv/default.nix
@@ -3,10 +3,12 @@
 , fetchFromGitHub
 , nix-update-script
 , pkg-config
+, rustup
 , openssl
 , stdenv
 , libiconv
 , Security
+, makeWrapper
 }:
 
 rustPlatform.buildRustPackage rec {
@@ -35,7 +37,12 @@ rustPlatform.buildRustPackage rec {
     then [ libiconv Security ]
     else [ openssl ];
 
-  nativeBuildInputs = [ pkg-config ];
+  nativeBuildInputs = [ pkg-config makeWrapper ];
+
+  # Depends at run-time on having rustup in PATH
+  postInstall = ''
+    wrapProgram $out/bin/cargo-msrv --prefix PATH : ${lib.makeBinPath [ rustup ]};
+  '';
 
   meta = with lib; {
     description = "Cargo subcommand \"msrv\": assists with finding your minimum supported Rust version (MSRV)";
diff --git a/pkgs/games/openrct2/default.nix b/pkgs/games/openrct2/default.nix
index cafa51c8342f6..ade022cefe9d7 100644
--- a/pkgs/games/openrct2/default.nix
+++ b/pkgs/games/openrct2/default.nix
@@ -5,32 +5,37 @@
 }:
 
 let
-  version = "0.3.4.1";
+  openrct2-version = "0.3.5";
+
+  # Those versions MUST match the pinned versions within the CMakeLists.txt
+  # file. The REPLAYS repository from the CMakeLists.txt is not necessary.
+  objects-version = "1.0.21";
+  title-sequences-version = "0.1.2c";
 
   openrct2-src = fetchFromGitHub {
     owner = "OpenRCT2";
     repo = "OpenRCT2";
-    rev = "v${version}";
-    sha256 = "0zjqn47pbgd2nrrbdl3lqk1mcdvwvvpjby2g0gfv6ssfw72fji7d";
+    rev = "v${openrct2-version}";
+    sha256 = "0xmj0qs49d1xlc8lbspr1vg66i0jdjlhcfxci72x6knjvd0vcgz0";
   };
 
   objects-src = fetchFromGitHub {
     owner = "OpenRCT2";
     repo = "objects";
-    rev = "v1.0.21";
+    rev = "v${objects-version}";
     sha256 = "0r2vp2y67jc1mpfl4j83sx5khvvaddx7xs26ppkigmr2d1xpxgr7";
   };
 
   title-sequences-src = fetchFromGitHub {
     owner = "OpenRCT2";
     repo = "title-sequences";
-    rev = "v0.1.2c";
+    rev = "v${title-sequences-version}";
     sha256 = "1qdrm4q75bznmgdrpjdaiqvbf3q4vwbkkmls45izxvyg1djrpsdf";
   };
 in
 stdenv.mkDerivation {
   pname = "openrct2";
-  inherit version;
+  version = openrct2-version;
 
   src = openrct2-src;
 
@@ -68,6 +73,15 @@ stdenv.mkDerivation {
     cp -r ${title-sequences-src} $sourceRoot/data/sequence
   '';
 
+  preConfigure = ''
+    # Verify that the correct version of the third party repositories is used.
+
+    grep -q '^set(OBJECTS_VERSION "${objects-version}")$' CMakeLists.txt \
+      || (echo "OBJECTS_VERSION differs!"; exit 1)
+    grep -q '^set(TITLE_SEQUENCE_VERSION "${title-sequences-version}")$' CMakeLists.txt \
+      || (echo "TITLE_SEQUENCE_VERSION differs!"; exit 1)
+  '';
+
   preFixup = "ln -s $out/share/openrct2 $out/bin/data";
 
   meta = with lib; {
diff --git a/pkgs/misc/drivers/foo2zjs/default.nix b/pkgs/misc/drivers/foo2zjs/default.nix
index 6e4a38ed171e5..ca50ad2f1cc95 100644
--- a/pkgs/misc/drivers/foo2zjs/default.nix
+++ b/pkgs/misc/drivers/foo2zjs/default.nix
@@ -11,7 +11,14 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ foomatic-filters bc ghostscript systemd vim ];
 
-  patches = [ ./no-hardcode-fw.diff ];
+  patches = [
+    ./no-hardcode-fw.diff
+    # Support HBPL1 printers https://www.dechifro.org/hbpl/
+    ./hbpl1.patch
+    # Fix "Unimplemented paper code" error for hbpl1 printers
+    # https://github.com/mikerr/foo2zjs/pull/2
+    ./papercode-format-fix.patch
+  ];
 
   makeFlags = [
     "PREFIX=$(out)"
diff --git a/pkgs/misc/drivers/foo2zjs/hbpl1.patch b/pkgs/misc/drivers/foo2zjs/hbpl1.patch
new file mode 100644
index 0000000000000..7372e164affae
--- /dev/null
+++ b/pkgs/misc/drivers/foo2zjs/hbpl1.patch
@@ -0,0 +1,4676 @@
+--- foo2zjs/ChangeLog	2021-09-27 16:25:00.735904476 +0200
++++ foo2zjs/ChangeLog	2021-09-27 16:34:10.661647070 +0200
+@@ -89,10 +89,35 @@
+ 2014-04-08	Rick Richardson <rick.richardson@comcast.net>
+ 	* Upgrade to JBIGKIT 2.1
+ 
++2014-04-04	Dave Coffin <dcoffin@cybercom.net>
++	* fixed all known bugs in foo2hbpl1.c.  It now print multi-page
++	  color and grayscale documents without resetting printer.
++
+ 2014-04-01	Rick Richardson <rick.richardson@comcast.net>
+-	* foo2hbpl2 foomatic-db files and PPDs:
++	* foo2hbpl1, foo2hbpl2 foomatic-db files and PPDs:
+ 	    Bug with default PageSize.
+-	    PLEASE delete and recreate the foo2hbpl2 printers.
++	    PLEASE delete and recreate the foo2hbpl1, foo2hbpl2 printers.
++
++2014-03-30	Rick Richardson <rick.richardson@comcast.net>
++	* foo2hbpl1.c: Cleanup the code
++
++2014-03-25	Rick Richardson <rick.richardson@comcast.net>
++	* foomatic and PPD stuff for foo2hbpl1 printers: Halftone and ICM
++
++2014-03-24	Rick Richardson <rick.richardson@comcast.net>
++	* foomatic and PPD stuff for foo2hbpl1 printers
++	    preliminary for: Dell 1250c, Dell C1660w, Dell C1760nw,
++	    Epson AcuLaser C1700, Fuji-Xerox DocuPrint CP105b
++	* foo2hbpl1-wrapper: allow for gs 7.x or gs 8.x
++
++2014-03-24	Dave Coffin <dcoffin@cybercom.net>
++	* foo2hbpl1, foo2hbpl1-wrapper, et al: first cut at revision 1
++	    stuff.  Color works, mono doesn't. No multiple pages. Printer
++	    shows:
++		        Restart Printer
++			Contact Support
++			IfMessageReturns
++			016-313
+ 
+ 2014-03-22	Rick Richardson <rick.richardson@comcast.net>
+ 	* hbpldecode: another redundancy from Dave Coffin
+--- foo2zjs/Makefile	2020-11-27 20:57:33.000000000 +0100
++++ foo2zjs/Makefile	2021-09-27 16:56:23.363346705 +0200
+@@ -148,6 +148,8 @@
+ 		foo2hiperc.c \
+ 		foo2hiperc.1in \
+ 		hbpl.h \
++		foo2hbpl1.c \
++		foo2hbpl1.1in \
+ 		foo2hbpl2.c \
+ 		foo2hbpl2.1in \
+ 		foo2ddst.c \
+@@ -187,6 +189,8 @@
+ 		foo2slx-wrapper.1in \
+ 		foo2hiperc-wrapper.in \
+ 		foo2hiperc-wrapper.1in \
++		foo2hbpl1-wrapper.in \
++		foo2hbpl1-wrapper.1in \
+ 		foo2hbpl2-wrapper.in \
+ 		foo2hbpl2-wrapper.1in \
+ 		foo2ddst-wrapper.in \
+@@ -267,7 +271,7 @@
+ PROGS+=		foo2oak oakdecode
+ PROGS+=		foo2slx slxdecode
+ PROGS+=		foo2hiperc hipercdecode
+-PROGS+=		foo2hbpl2 hbpldecode
++PROGS+=		foo2hbpl1 foo2hbpl2 hbpldecode
+ PROGS+=		gipddecode
+ PROGS+=		foo2ddst ddstdecode
+ ifneq ($(CUPS_SERVERBIN),)
+@@ -279,7 +283,7 @@
+ endif
+ SHELLS=		foo2zjs-wrapper foo2oak-wrapper foo2hp2600-wrapper \
+ 		foo2xqx-wrapper foo2lava-wrapper foo2qpdl-wrapper \
+-		foo2slx-wrapper foo2hiperc-wrapper foo2hbpl2-wrapper \
++		foo2slx-wrapper foo2hiperc-wrapper foo2hbpl1-wrapper foo2hbpl2-wrapper \
+ 		foo2ddst-wrapper
+ SHELLS+=	foo2zjs-pstops
+ SHELLS+=	printer-profile
+@@ -291,7 +295,7 @@
+ MANPAGES+=	foo2qpdl-wrapper.1 foo2qpdl.1 qpdldecode.1
+ MANPAGES+=	foo2slx-wrapper.1 foo2slx.1 slxdecode.1
+ MANPAGES+=	foo2hiperc-wrapper.1 foo2hiperc.1 hipercdecode.1
+-MANPAGES+=	foo2hbpl2-wrapper.1 foo2hbpl2.1 hbpldecode.1
++MANPAGES+=	foo2hbpl1-wrapper.1 foo2hbpl1.1 foo2hbpl2-wrapper.1 foo2hbpl2.1 hbpldecode.1
+ MANPAGES+=	foo2ddst-wrapper.1 foo2ddst.1 ddstdecode.1
+ MANPAGES+=	gipddecode.1
+ MANPAGES+=	foo2zjs-pstops.1 arm2hpdl.1 usb_printerid.1
+@@ -485,6 +489,9 @@
+ foo2ddst: foo2ddst.o $(LIBJBG)
+ 	$(CC) $(CFLAGS) -o $@ foo2ddst.o $(LIBJBG)
+ 
++foo2hbpl1: foo2hbpl1.o
++	$(CC) $(CFLAGS) -o $@ foo2hbpl1.o
++
+ foo2hbpl2: foo2hbpl2.o $(LIBJBG)
+ 	$(CC) $(CFLAGS) -o $@ foo2hbpl2.o $(LIBJBG)
+ 
+@@ -519,6 +526,12 @@
+ 	    -e 's@^PREFIX=.*@PREFIX=$(PREFIX)@' || (rm -f $@ && exit 1)
+ 	chmod 555 $@
+ 
++foo2hbpl1-wrapper: foo2hbpl1-wrapper.in Makefile
++	[ ! -f $@ ] || chmod +w $@
++	sed < $@.in > $@ \
++	    -e 's@^PREFIX=.*@PREFIX=$(PREFIX)@' || (rm -f $@ && exit 1)
++	chmod 555 $@
++
+ foo2hbpl2-wrapper: foo2hbpl2-wrapper.in Makefile
+ 	[ ! -f $@ ] || chmod +w $@
+ 	sed < $@.in > $@ \
+@@ -1231,6 +1244,7 @@
+ 	-rm -f /usr/bin/foo2slx-wrapper /usr/bin/foo2slx /usr/bin/slxdecode
+ 	-rm -f /usr/bin/foo2hiperc-wrapper /usr/bin/foo2hiperc
+ 	-rm -f /usr/bin/hipercdecode
++	-rm -f /usr/bin/foo2hbpl1-wrapper /usr/bin/foo2hbpl1
+ 	-rm -f /usr/bin/foo2hbpl2-wrapper /usr/bin/foo2hbpl2
+ 	-rm -f /usr/bin/hbpldecode
+ 	-rm -f /usr/bin/foo2ddst-wrapper /usr/bin/foo2ddst /usr/bin/ddstdecode
+@@ -1265,7 +1279,7 @@
+ 	-rm -f foo2qpdl.o qpdldecode.o
+ 	-rm -f foo2slx.o slxdecode.o
+ 	-rm -f foo2hiperc.o hipercdecode.o
+-	-rm -f foo2hbpl2.o hbpldecode.o
++	-rm -f foo2hbpl1.o foo2hbpl2.o hbpldecode.o
+ 	-rm -f opldecode.o gipddecode.o
+ 	-rm -f foo2dsst.o ddstdecode.o
+ 	-rm -f command2foo2lava-pjl.o
+@@ -1513,6 +1527,10 @@
+ 	    *C3530*)	        driver=foo2hiperc;; \
+ 	    *C5[12568][05]0*)   driver=foo2hiperc;; \
+ 	    *CLP*|*CLX*|*6110*) driver=foo2qpdl;; \
++	    *1250*)		driver=foo2hbpl1;; \
++	    *1660*|*1760*)	driver=foo2hbpl1;; \
++	    *C1700*)		driver=foo2hbpl1;; \
++	    *CP105*)		driver=foo2hbpl1;; \
+ 	    *ML-167*)		driver=foo2qpdl;; \
+ 	    *6015*|*1355*)	driver=foo2hbpl2;; \
+ 	    *C1765*)		driver=foo2hbpl2;; \
+@@ -1607,6 +1625,8 @@
+ 	$(INSTALL) -c -m 644 foo2hiperc.1 $(MANDIR)/man1/
+ 	$(INSTALL) -c -m 644 foo2hiperc-wrapper.1 $(MANDIR)/man1/
+ 	$(INSTALL) -c -m 644 hipercdecode.1 $(MANDIR)/man1/
++	$(INSTALL) -c -m 644 foo2hbpl1.1 $(MANDIR)/man1/
++	$(INSTALL) -c -m 644 foo2hbpl1-wrapper.1 $(MANDIR)/man1/
+ 	$(INSTALL) -c -m 644 foo2hbpl2.1 $(MANDIR)/man1/
+ 	$(INSTALL) -c -m 644 foo2hbpl2-wrapper.1 $(MANDIR)/man1/
+ 	$(INSTALL) -c -m 644 hbpldecode.1 $(MANDIR)/man1/
+--- foo2zjs/PPD/Dell-1250c.ppd	1970-01-01 00:00:00.000000000 +0000
++++ foo2zjs/PPD/Dell-1250c.ppd	2014-04-01 11:06:30.000000000 +0000
+@@ -0,0 +1,433 @@
++*PPD-Adobe: "4.3"
++*%
++*% For information on using this, and to obtain the required backend
++*% script, consult http://www.openprinting.org/
++*%
++*% This file is published under the GNU General Public License
++*%
++*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with 
++*% all programs and environments which use PPD files for dealing with
++*% printer capability information. The printer must be configured with the
++*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This 
++*% file and "foomatic-rip" work together to support PPD-controlled printer
++*% driver option access with arbitrary free software printer drivers and
++*% printing spoolers.
++*%
++*% To save this file on your disk, wait until the download has completed
++*% (the animation of the browser logo must stop) and then use the
++*% "Save as..." command in the "File" menu of your browser or in the 
++*% pop-up manu when you click on this document with the right mouse button.
++*% DO NOT cut and paste this file into an editor with your mouse. This can
++*% introduce additional line breaks which lead to unexpected results.
++*%
++*% You may save this file as 'Dell-1250c-foo2hbpl1.ppd'
++*%
++*%
++*FormatVersion:	"4.3"
++*FileVersion:	"1.1"
++*LanguageVersion: English 
++*LanguageEncoding: ISOLatin1
++*PCFileName:	"FOO2HBPL.PPD"
++*Manufacturer:	"Dell"
++*Product:	"(1250c)"
++*cupsVersion:	1.0
++*cupsManualCopies: True
++*cupsModelNumber:  2
++*cupsFilter:	"application/vnd.cups-postscript 0 foomatic-rip"
++*%pprRIP:        foomatic-rip other
++*ModelName:     "Dell 1250c"
++*ShortNickName: "Dell 1250c foo2hbpl1"
++*NickName:      "Dell 1250c Foomatic/foo2hbpl1 (recommended)"
++*PSVersion:	"(3010.000) 550"
++*PSVersion:	"(3010.000) 651"
++*PSVersion:	"(3010.000) 652"
++*PSVersion:	"(3010.000) 653"
++*PSVersion:	"(3010.000) 704"
++*PSVersion:	"(3010.000) 705"
++*PSVersion:	"(3010.000) 800"
++*LanguageLevel:	"3"
++*ColorDevice:	True
++*DefaultColorSpace: RGB
++*FileSystem:	False
++*Throughput:	"1"
++*LandscapeOrientation: Plus90
++*TTRasterizer:	Type42
++*1284DeviceID: "DRV:Dfoo2hbpl1,R1,M0,TF;"
++
++*driverName foo2hbpl1/foo2hbpl1: ""
++*driverType F/Filter: ""
++*driverUrl: "http://foo2hbpl.rkkda.com/"
++*driverObsolete: False
++
++
++
++
++*HWMargins: 9 12.00 9 12
++*VariablePaperSize: True
++*MaxMediaWidth: 100000
++*MaxMediaHeight: 100000
++*NonUIOrderDependency: 135 AnySetup *CustomPageSize
++*CustomPageSize True: "pop pop pop pop pop
++%% FoomaticRIPOptionSetting: PageSize=Custom"
++*End
++*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
++*ParamCustomPageSize Width: 1 points 36 100000
++*ParamCustomPageSize Height: 2 points 36 100000
++*ParamCustomPageSize Orientation: 3 int 0 0
++*ParamCustomPageSize WidthOffset: 4 points 0 0
++*ParamCustomPageSize HeightOffset: 5 points 0 0
++
++*FoomaticIDs: Dell-1250c foo2hbpl1
++*FoomaticRIPCommandLine: "foo2hbpl1-wrapper %A"
++
++*OpenGroup: General/General
++
++*OpenUI *Quality/Printing Quality: PickOne
++*FoomaticRIPOption Quality: enum CmdLine A
++*OrderDependency: 110 AnySetup *Quality
++*DefaultQuality: normal
++*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
++*FoomaticRIPOptionSetting Quality=draft: " -t  "
++*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
++*FoomaticRIPOptionSetting Quality=normal: "  "
++*CloseUI: *Quality
++
++*OpenUI *ColorMode/Color Mode: PickOne
++*FoomaticRIPOption ColorMode: enum CmdLine A
++*OrderDependency: 120 AnySetup *ColorMode
++*DefaultColorMode: Monochrome
++*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
++*FoomaticRIPOptionSetting ColorMode=Color: "-c "
++*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
++*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
++*CloseUI: *ColorMode
++
++*OpenUI *PageSize/Page Size: PickOne
++*FoomaticRIPOption PageSize: enum CmdLine A
++*OrderDependency: 135 AnySetup *PageSize
++*DefaultPageSize: Letter
++*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
++*FoomaticRIPOptionSetting PageSize=Letter: "-p4 "
++*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
++*FoomaticRIPOptionSetting PageSize=A4: "-p1 "
++*PageSize B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
++*FoomaticRIPOptionSetting PageSize=B5jis: "-p2 "
++*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
++*FoomaticRIPOptionSetting PageSize=Env10: "-p9 "
++*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
++*FoomaticRIPOptionSetting PageSize=EnvC5: "-p11 "
++*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
++*FoomaticRIPOptionSetting PageSize=EnvDL: "-p12 "
++*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
++*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p10 "
++*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
++*FoomaticRIPOptionSetting PageSize=Executive: "-p5 "
++*PageSize FanfoldGermanLegal/Fanfold German Legal: "%% FoomaticRIPOptionSetting: PageSize=FanfoldGermanLegal"
++*FoomaticRIPOptionSetting PageSize=FanfoldGermanLegal: "-p6 "
++*PageSize Folio/Folio: "%% FoomaticRIPOptionSetting: PageSize=Folio"
++*FoomaticRIPOptionSetting PageSize=Folio: "-p6 "
++*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
++*FoomaticRIPOptionSetting PageSize=Legal: "-p7 "
++*CloseUI: *PageSize
++
++*OpenUI *PageRegion: PickOne
++*OrderDependency: 135 AnySetup *PageRegion
++*DefaultPageRegion: Letter
++*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
++*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
++*PageRegion B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
++*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
++*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
++*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
++*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
++*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
++*PageRegion FanfoldGermanLegal/Fanfold German Legal: "%% FoomaticRIPOptionSetting: PageSize=FanfoldGermanLegal"
++*PageRegion Folio/Folio: "%% FoomaticRIPOptionSetting: PageSize=Folio"
++*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
++*CloseUI: *PageRegion
++
++*DefaultImageableArea: Letter
++*ImageableArea Letter/Letter: "9 12.00 603 780.00"
++*ImageableArea A4/A4: "9 12.00 586 830.00"
++*ImageableArea B5jis/B5 (JIS): "9 12.00 509 715.00"
++*ImageableArea Env10/Env #10: "9 12.00 288 672.00"
++*ImageableArea EnvC5/Env C5: "9 12.00 450 637.00"
++*ImageableArea EnvDL/Env DL: "9 12.00 302 611.00"
++*ImageableArea EnvMonarch/Env Monarch: "9 12.00 270 528.00"
++*ImageableArea Executive/Executive: "9 12.00 513 744.00"
++*ImageableArea FanfoldGermanLegal/Fanfold German Legal: "9 12.00 603 996.00"
++*ImageableArea Folio/Folio: "9 12.00 603 924.00"
++*ImageableArea Legal/Legal: "9 12.00 603 996.00"
++
++*DefaultPaperDimension: Letter
++*PaperDimension Letter/Letter: "612 792"
++*PaperDimension A4/A4: "595 842"
++*PaperDimension B5jis/B5 (JIS): "518 727"
++*PaperDimension Env10/Env #10: "297 684"
++*PaperDimension EnvC5/Env C5: "459 649"
++*PaperDimension EnvDL/Env DL: "311 623"
++*PaperDimension EnvMonarch/Env Monarch: "279 540"
++*PaperDimension Executive/Executive: "522 756"
++*PaperDimension FanfoldGermanLegal/Fanfold German Legal: "612 1008"
++*PaperDimension Folio/Folio: "612 936"
++*PaperDimension Legal/Legal: "612 1008"
++
++*OpenUI *MediaType/Media Type: PickOne
++*FoomaticRIPOption MediaType: enum CmdLine A
++*OrderDependency: 150 AnySetup *MediaType
++*DefaultMediaType: plain
++*MediaType plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=plain"
++*FoomaticRIPOptionSetting MediaType=plain: "-m1 "
++*MediaType plain2/Plain Paper Side 2: "%% FoomaticRIPOptionSetting: MediaType=plain2"
++*FoomaticRIPOptionSetting MediaType=plain2: "-m8 "
++*MediaType bond/Bond: "%% FoomaticRIPOptionSetting: MediaType=bond"
++*FoomaticRIPOptionSetting MediaType=bond: "-m2 "
++*MediaType bond2/Bond Side 2: "%% FoomaticRIPOptionSetting: MediaType=bond2"
++*FoomaticRIPOptionSetting MediaType=bond2: "-m9 "
++*MediaType envelope/Envelope: "%% FoomaticRIPOptionSetting: MediaType=envelope"
++*FoomaticRIPOptionSetting MediaType=envelope: "-m6 "
++*MediaType labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=labels"
++*FoomaticRIPOptionSetting MediaType=labels: "-m5 "
++*MediaType lwcard/Light Weight Card: "%% FoomaticRIPOptionSetting: MediaType=lwcard"
++*FoomaticRIPOptionSetting MediaType=lwcard: "-m3 "
++*MediaType lwcard2/Light Weight Card Side 2: "%% FoomaticRIPOptionSetting: MediaType=lwcard2"
++*FoomaticRIPOptionSetting MediaType=lwcard2: "-m10 "
++*MediaType lwgcard/Light Weight Glossy Card: "%% FoomaticRIPOptionSetting: MediaType=lwgcard"
++*FoomaticRIPOptionSetting MediaType=lwgcard: "-m4 "
++*MediaType lwgcard2/Light Weight Glossy Card Side 2: "%% FoomaticRIPOptionSetting: MediaType=lwgcard2"
++*FoomaticRIPOptionSetting MediaType=lwgcard2: "-m11 "
++*MediaType recycled/Recycled Paper: "%% FoomaticRIPOptionSetting: MediaType=recycled"
++*FoomaticRIPOptionSetting MediaType=recycled: "-m7 "
++*MediaType recycled2/Recycled Paper Side 2: "%% FoomaticRIPOptionSetting: MediaType=recycled2"
++*FoomaticRIPOptionSetting MediaType=recycled2: "-m12 "
++*CloseUI: *MediaType
++
++*OpenUI *Copies/Copies: PickOne
++*FoomaticRIPOption Copies: int CmdLine A
++*FoomaticRIPOptionPrototype Copies: "-n%s "
++*FoomaticRIPOptionRange Copies: 1 100
++*OrderDependency: 220 AnySetup *Copies
++*DefaultCopies: 1
++*FoomaticRIPDefaultCopies: 1
++*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
++*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
++*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
++*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
++*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
++*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
++*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
++*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
++*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
++*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
++*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
++*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
++*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
++*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
++*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
++*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
++*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
++*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
++*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
++*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
++*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
++*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
++*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
++*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
++*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
++*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
++*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
++*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
++*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
++*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
++*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
++*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
++*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
++*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
++*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
++*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
++*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
++*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
++*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
++*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
++*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
++*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
++*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
++*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
++*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
++*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
++*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
++*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
++*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
++*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
++*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
++*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
++*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
++*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
++*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
++*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
++*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
++*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
++*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
++*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
++*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
++*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
++*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
++*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
++*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
++*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
++*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
++*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
++*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
++*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
++*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
++*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
++*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
++*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
++*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
++*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
++*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
++*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
++*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
++*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
++*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
++*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
++*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
++*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
++*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
++*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
++*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
++*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
++*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
++*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
++*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
++*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
++*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
++*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
++*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
++*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
++*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
++*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
++*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
++*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
++*CloseUI: *Copies
++
++*CloseGroup: General
++
++*OpenGroup: Adjustment/Adjustment
++
++*OpenUI *halftone/Halftone Algorithm: PickOne
++*FoomaticRIPOption halftone: enum CmdLine A
++*OrderDependency: 110 AnySetup *halftone
++*Defaulthalftone: default
++*halftone default/Default: "%% FoomaticRIPOptionSetting: halftone=default"
++*FoomaticRIPOptionSetting halftone=default: "  "
++*halftone as/Accurate Screens (better): "%% FoomaticRIPOptionSetting: halftone=as"
++*FoomaticRIPOptionSetting halftone=as: " -qas  "
++*halftone standard/Standard: "%% FoomaticRIPOptionSetting: halftone=standard"
++*FoomaticRIPOptionSetting halftone=standard: " -q1  "
++*halftone wts/Well Tempered Screens (best): "%% FoomaticRIPOptionSetting: halftone=wts"
++*FoomaticRIPOptionSetting halftone=wts: " -qwts  "
++*CloseUI: *halftone
++
++*OpenUI *ICM/ICM Color Profile: PickOne
++*FoomaticRIPOption ICM: enum CmdLine A
++*OrderDependency: 300 AnySetup *ICM
++*DefaultICM: none
++*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
++*FoomaticRIPOptionSetting ICM=none: "-C10 -Gnone.icm "
++*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
++*FoomaticRIPOptionSetting ICM=testing: "-C10 -Gtesting.icm "
++*ICM testing2/File testing2.icm: "%% FoomaticRIPOptionSetting: ICM=testing2"
++*FoomaticRIPOptionSetting ICM=testing2: "-C10 -Gtesting2.icm "
++*ICM testing3/File testing3.icm: "%% FoomaticRIPOptionSetting: ICM=testing3"
++*FoomaticRIPOptionSetting ICM=testing3: "-C10 -Gtesting3.icm "
++*CloseUI: *ICM
++
++*CloseGroup: Adjustment
++
++*OpenGroup: Miscellaneous/Miscellaneous
++
++*OpenUI *NupOrient/N-up Orientation: PickOne
++*FoomaticRIPOption NupOrient: enum CmdLine A
++*OrderDependency: 200 AnySetup *NupOrient
++*DefaultNupOrient: port
++*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
++*FoomaticRIPOptionSetting NupOrient=land: "-ol "
++*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
++*FoomaticRIPOptionSetting NupOrient=port: " "
++*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
++*FoomaticRIPOptionSetting NupOrient=sea: "-os "
++*CloseUI: *NupOrient
++
++*OpenUI *NupPages/N-up Printing: PickOne
++*FoomaticRIPOption NupPages: enum CmdLine A
++*OrderDependency: 200 AnySetup *NupPages
++*DefaultNupPages: 1up
++*NupPages 1up/1-up: "%% FoomaticRIPOptionSetting: NupPages=1up"
++*FoomaticRIPOptionSetting NupPages=1up: " "
++*NupPages 2up/2-up: "%% FoomaticRIPOptionSetting: NupPages=2up"
++*FoomaticRIPOptionSetting NupPages=2up: "-2 "
++*NupPages 3up/3-up: "%% FoomaticRIPOptionSetting: NupPages=3up"
++*FoomaticRIPOptionSetting NupPages=3up: "-3 "
++*NupPages 4up/4-up: "%% FoomaticRIPOptionSetting: NupPages=4up"
++*FoomaticRIPOptionSetting NupPages=4up: "-4 "
++*NupPages 6up/6-up: "%% FoomaticRIPOptionSetting: NupPages=6up"
++*FoomaticRIPOptionSetting NupPages=6up: "-6 "
++*NupPages 8up/8-up: "%% FoomaticRIPOptionSetting: NupPages=8up"
++*FoomaticRIPOptionSetting NupPages=8up: "-8 "
++*NupPages 10up/10-up: "%% FoomaticRIPOptionSetting: NupPages=10up"
++*FoomaticRIPOptionSetting NupPages=10up: "-10 "
++*NupPages 12up/12-up: "%% FoomaticRIPOptionSetting: NupPages=12up"
++*FoomaticRIPOptionSetting NupPages=12up: "-12 "
++*NupPages 14up/14-up: "%% FoomaticRIPOptionSetting: NupPages=14up"
++*FoomaticRIPOptionSetting NupPages=14up: "-14 "
++*NupPages 15up/15-up: "%% FoomaticRIPOptionSetting: NupPages=15up"
++*FoomaticRIPOptionSetting NupPages=15up: "-15 "
++*NupPages 16up/16-up: "%% FoomaticRIPOptionSetting: NupPages=16up"
++*FoomaticRIPOptionSetting NupPages=16up: "-16 "
++*NupPages 18up/18-up: "%% FoomaticRIPOptionSetting: NupPages=18up"
++*FoomaticRIPOptionSetting NupPages=18up: "-18 "
++*CloseUI: *NupPages
++
++*CloseGroup: Miscellaneous
++
++
++*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
++
++*DefaultFont: Courier
++*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
++*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
++*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
++*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
++*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
++*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
++*Font Bookman-Light: Standard "(001.004S)" Standard ROM
++*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
++*Font Courier: Standard "(002.004S)" Standard ROM
++*Font Courier-Bold: Standard "(002.004S)" Standard ROM
++*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
++*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
++*Font Helvetica: Standard "(001.006S)" Standard ROM
++*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
++*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
++*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
++*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
++*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
++*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
++*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
++*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
++*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
++*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
++*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
++*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
++*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
++*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
++*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
++*Font Symbol: Special "(001.007S)" Special ROM
++*Font Times-Bold: Standard "(001.007S)" Standard ROM
++*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
++*Font Times-Italic: Standard "(001.007S)" Standard ROM
++*Font Times-Roman: Standard "(001.007S)" Standard ROM
++*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
++*Font ZapfDingbats: Special "(001.004S)" Standard ROM
++
+--- foo2zjs/PPD/Dell-C1660.ppd	1970-01-01 00:00:00.000000000 +0000
++++ foo2zjs/PPD/Dell-C1660.ppd	2014-04-01 11:06:30.000000000 +0000
+@@ -0,0 +1,433 @@
++*PPD-Adobe: "4.3"
++*%
++*% For information on using this, and to obtain the required backend
++*% script, consult http://www.openprinting.org/
++*%
++*% This file is published under the GNU General Public License
++*%
++*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with 
++*% all programs and environments which use PPD files for dealing with
++*% printer capability information. The printer must be configured with the
++*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This 
++*% file and "foomatic-rip" work together to support PPD-controlled printer
++*% driver option access with arbitrary free software printer drivers and
++*% printing spoolers.
++*%
++*% To save this file on your disk, wait until the download has completed
++*% (the animation of the browser logo must stop) and then use the
++*% "Save as..." command in the "File" menu of your browser or in the 
++*% pop-up manu when you click on this document with the right mouse button.
++*% DO NOT cut and paste this file into an editor with your mouse. This can
++*% introduce additional line breaks which lead to unexpected results.
++*%
++*% You may save this file as 'Dell-C1660-foo2hbpl1.ppd'
++*%
++*%
++*FormatVersion:	"4.3"
++*FileVersion:	"1.1"
++*LanguageVersion: English 
++*LanguageEncoding: ISOLatin1
++*PCFileName:	"FOO2HBPL.PPD"
++*Manufacturer:	"Dell"
++*Product:	"(C1660)"
++*cupsVersion:	1.0
++*cupsManualCopies: True
++*cupsModelNumber:  2
++*cupsFilter:	"application/vnd.cups-postscript 0 foomatic-rip"
++*%pprRIP:        foomatic-rip other
++*ModelName:     "Dell C1660"
++*ShortNickName: "Dell C1660 foo2hbpl1"
++*NickName:      "Dell C1660 Foomatic/foo2hbpl1 (recommended)"
++*PSVersion:	"(3010.000) 550"
++*PSVersion:	"(3010.000) 651"
++*PSVersion:	"(3010.000) 652"
++*PSVersion:	"(3010.000) 653"
++*PSVersion:	"(3010.000) 704"
++*PSVersion:	"(3010.000) 705"
++*PSVersion:	"(3010.000) 800"
++*LanguageLevel:	"3"
++*ColorDevice:	True
++*DefaultColorSpace: RGB
++*FileSystem:	False
++*Throughput:	"1"
++*LandscapeOrientation: Plus90
++*TTRasterizer:	Type42
++*1284DeviceID: "DRV:Dfoo2hbpl1,R1,M0,TF;"
++
++*driverName foo2hbpl1/foo2hbpl1: ""
++*driverType F/Filter: ""
++*driverUrl: "http://foo2hbpl.rkkda.com/"
++*driverObsolete: False
++
++
++
++
++*HWMargins: 9 12.00 9 12
++*VariablePaperSize: True
++*MaxMediaWidth: 100000
++*MaxMediaHeight: 100000
++*NonUIOrderDependency: 135 AnySetup *CustomPageSize
++*CustomPageSize True: "pop pop pop pop pop
++%% FoomaticRIPOptionSetting: PageSize=Custom"
++*End
++*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
++*ParamCustomPageSize Width: 1 points 36 100000
++*ParamCustomPageSize Height: 2 points 36 100000
++*ParamCustomPageSize Orientation: 3 int 0 0
++*ParamCustomPageSize WidthOffset: 4 points 0 0
++*ParamCustomPageSize HeightOffset: 5 points 0 0
++
++*FoomaticIDs: Dell-C1660 foo2hbpl1
++*FoomaticRIPCommandLine: "foo2hbpl1-wrapper %A"
++
++*OpenGroup: General/General
++
++*OpenUI *Quality/Printing Quality: PickOne
++*FoomaticRIPOption Quality: enum CmdLine A
++*OrderDependency: 110 AnySetup *Quality
++*DefaultQuality: normal
++*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
++*FoomaticRIPOptionSetting Quality=draft: " -t  "
++*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
++*FoomaticRIPOptionSetting Quality=normal: "  "
++*CloseUI: *Quality
++
++*OpenUI *ColorMode/Color Mode: PickOne
++*FoomaticRIPOption ColorMode: enum CmdLine A
++*OrderDependency: 120 AnySetup *ColorMode
++*DefaultColorMode: Monochrome
++*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
++*FoomaticRIPOptionSetting ColorMode=Color: "-c "
++*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
++*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
++*CloseUI: *ColorMode
++
++*OpenUI *PageSize/Page Size: PickOne
++*FoomaticRIPOption PageSize: enum CmdLine A
++*OrderDependency: 135 AnySetup *PageSize
++*DefaultPageSize: Letter
++*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
++*FoomaticRIPOptionSetting PageSize=Letter: "-p4 "
++*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
++*FoomaticRIPOptionSetting PageSize=A4: "-p1 "
++*PageSize B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
++*FoomaticRIPOptionSetting PageSize=B5jis: "-p2 "
++*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
++*FoomaticRIPOptionSetting PageSize=Env10: "-p9 "
++*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
++*FoomaticRIPOptionSetting PageSize=EnvC5: "-p11 "
++*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
++*FoomaticRIPOptionSetting PageSize=EnvDL: "-p12 "
++*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
++*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p10 "
++*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
++*FoomaticRIPOptionSetting PageSize=Executive: "-p5 "
++*PageSize FanfoldGermanLegal/Fanfold German Legal: "%% FoomaticRIPOptionSetting: PageSize=FanfoldGermanLegal"
++*FoomaticRIPOptionSetting PageSize=FanfoldGermanLegal: "-p6 "
++*PageSize Folio/Folio: "%% FoomaticRIPOptionSetting: PageSize=Folio"
++*FoomaticRIPOptionSetting PageSize=Folio: "-p6 "
++*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
++*FoomaticRIPOptionSetting PageSize=Legal: "-p7 "
++*CloseUI: *PageSize
++
++*OpenUI *PageRegion: PickOne
++*OrderDependency: 135 AnySetup *PageRegion
++*DefaultPageRegion: Letter
++*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
++*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
++*PageRegion B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
++*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
++*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
++*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
++*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
++*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
++*PageRegion FanfoldGermanLegal/Fanfold German Legal: "%% FoomaticRIPOptionSetting: PageSize=FanfoldGermanLegal"
++*PageRegion Folio/Folio: "%% FoomaticRIPOptionSetting: PageSize=Folio"
++*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
++*CloseUI: *PageRegion
++
++*DefaultImageableArea: Letter
++*ImageableArea Letter/Letter: "9 12.00 603 780.00"
++*ImageableArea A4/A4: "9 12.00 586 830.00"
++*ImageableArea B5jis/B5 (JIS): "9 12.00 509 715.00"
++*ImageableArea Env10/Env #10: "9 12.00 288 672.00"
++*ImageableArea EnvC5/Env C5: "9 12.00 450 637.00"
++*ImageableArea EnvDL/Env DL: "9 12.00 302 611.00"
++*ImageableArea EnvMonarch/Env Monarch: "9 12.00 270 528.00"
++*ImageableArea Executive/Executive: "9 12.00 513 744.00"
++*ImageableArea FanfoldGermanLegal/Fanfold German Legal: "9 12.00 603 996.00"
++*ImageableArea Folio/Folio: "9 12.00 603 924.00"
++*ImageableArea Legal/Legal: "9 12.00 603 996.00"
++
++*DefaultPaperDimension: Letter
++*PaperDimension Letter/Letter: "612 792"
++*PaperDimension A4/A4: "595 842"
++*PaperDimension B5jis/B5 (JIS): "518 727"
++*PaperDimension Env10/Env #10: "297 684"
++*PaperDimension EnvC5/Env C5: "459 649"
++*PaperDimension EnvDL/Env DL: "311 623"
++*PaperDimension EnvMonarch/Env Monarch: "279 540"
++*PaperDimension Executive/Executive: "522 756"
++*PaperDimension FanfoldGermanLegal/Fanfold German Legal: "612 1008"
++*PaperDimension Folio/Folio: "612 936"
++*PaperDimension Legal/Legal: "612 1008"
++
++*OpenUI *MediaType/Media Type: PickOne
++*FoomaticRIPOption MediaType: enum CmdLine A
++*OrderDependency: 150 AnySetup *MediaType
++*DefaultMediaType: plain
++*MediaType plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=plain"
++*FoomaticRIPOptionSetting MediaType=plain: "-m1 "
++*MediaType plain2/Plain Paper Side 2: "%% FoomaticRIPOptionSetting: MediaType=plain2"
++*FoomaticRIPOptionSetting MediaType=plain2: "-m8 "
++*MediaType bond/Bond: "%% FoomaticRIPOptionSetting: MediaType=bond"
++*FoomaticRIPOptionSetting MediaType=bond: "-m2 "
++*MediaType bond2/Bond Side 2: "%% FoomaticRIPOptionSetting: MediaType=bond2"
++*FoomaticRIPOptionSetting MediaType=bond2: "-m9 "
++*MediaType envelope/Envelope: "%% FoomaticRIPOptionSetting: MediaType=envelope"
++*FoomaticRIPOptionSetting MediaType=envelope: "-m6 "
++*MediaType labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=labels"
++*FoomaticRIPOptionSetting MediaType=labels: "-m5 "
++*MediaType lwcard/Light Weight Card: "%% FoomaticRIPOptionSetting: MediaType=lwcard"
++*FoomaticRIPOptionSetting MediaType=lwcard: "-m3 "
++*MediaType lwcard2/Light Weight Card Side 2: "%% FoomaticRIPOptionSetting: MediaType=lwcard2"
++*FoomaticRIPOptionSetting MediaType=lwcard2: "-m10 "
++*MediaType lwgcard/Light Weight Glossy Card: "%% FoomaticRIPOptionSetting: MediaType=lwgcard"
++*FoomaticRIPOptionSetting MediaType=lwgcard: "-m4 "
++*MediaType lwgcard2/Light Weight Glossy Card Side 2: "%% FoomaticRIPOptionSetting: MediaType=lwgcard2"
++*FoomaticRIPOptionSetting MediaType=lwgcard2: "-m11 "
++*MediaType recycled/Recycled Paper: "%% FoomaticRIPOptionSetting: MediaType=recycled"
++*FoomaticRIPOptionSetting MediaType=recycled: "-m7 "
++*MediaType recycled2/Recycled Paper Side 2: "%% FoomaticRIPOptionSetting: MediaType=recycled2"
++*FoomaticRIPOptionSetting MediaType=recycled2: "-m12 "
++*CloseUI: *MediaType
++
++*OpenUI *Copies/Copies: PickOne
++*FoomaticRIPOption Copies: int CmdLine A
++*FoomaticRIPOptionPrototype Copies: "-n%s "
++*FoomaticRIPOptionRange Copies: 1 100
++*OrderDependency: 220 AnySetup *Copies
++*DefaultCopies: 1
++*FoomaticRIPDefaultCopies: 1
++*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
++*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
++*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
++*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
++*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
++*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
++*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
++*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
++*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
++*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
++*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
++*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
++*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
++*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
++*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
++*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
++*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
++*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
++*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
++*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
++*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
++*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
++*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
++*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
++*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
++*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
++*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
++*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
++*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
++*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
++*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
++*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
++*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
++*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
++*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
++*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
++*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
++*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
++*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
++*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
++*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
++*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
++*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
++*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
++*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
++*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
++*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
++*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
++*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
++*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
++*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
++*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
++*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
++*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
++*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
++*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
++*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
++*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
++*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
++*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
++*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
++*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
++*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
++*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
++*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
++*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
++*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
++*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
++*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
++*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
++*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
++*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
++*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
++*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
++*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
++*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
++*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
++*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
++*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
++*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
++*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
++*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
++*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
++*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
++*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
++*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
++*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
++*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
++*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
++*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
++*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
++*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
++*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
++*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
++*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
++*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
++*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
++*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
++*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
++*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
++*CloseUI: *Copies
++
++*CloseGroup: General
++
++*OpenGroup: Adjustment/Adjustment
++
++*OpenUI *halftone/Halftone Algorithm: PickOne
++*FoomaticRIPOption halftone: enum CmdLine A
++*OrderDependency: 110 AnySetup *halftone
++*Defaulthalftone: default
++*halftone default/Default: "%% FoomaticRIPOptionSetting: halftone=default"
++*FoomaticRIPOptionSetting halftone=default: "  "
++*halftone as/Accurate Screens (better): "%% FoomaticRIPOptionSetting: halftone=as"
++*FoomaticRIPOptionSetting halftone=as: " -qas  "
++*halftone standard/Standard: "%% FoomaticRIPOptionSetting: halftone=standard"
++*FoomaticRIPOptionSetting halftone=standard: " -q1  "
++*halftone wts/Well Tempered Screens (best): "%% FoomaticRIPOptionSetting: halftone=wts"
++*FoomaticRIPOptionSetting halftone=wts: " -qwts  "
++*CloseUI: *halftone
++
++*OpenUI *ICM/ICM Color Profile: PickOne
++*FoomaticRIPOption ICM: enum CmdLine A
++*OrderDependency: 300 AnySetup *ICM
++*DefaultICM: none
++*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
++*FoomaticRIPOptionSetting ICM=none: "-C10 -Gnone.icm "
++*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
++*FoomaticRIPOptionSetting ICM=testing: "-C10 -Gtesting.icm "
++*ICM testing2/File testing2.icm: "%% FoomaticRIPOptionSetting: ICM=testing2"
++*FoomaticRIPOptionSetting ICM=testing2: "-C10 -Gtesting2.icm "
++*ICM testing3/File testing3.icm: "%% FoomaticRIPOptionSetting: ICM=testing3"
++*FoomaticRIPOptionSetting ICM=testing3: "-C10 -Gtesting3.icm "
++*CloseUI: *ICM
++
++*CloseGroup: Adjustment
++
++*OpenGroup: Miscellaneous/Miscellaneous
++
++*OpenUI *NupOrient/N-up Orientation: PickOne
++*FoomaticRIPOption NupOrient: enum CmdLine A
++*OrderDependency: 200 AnySetup *NupOrient
++*DefaultNupOrient: port
++*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
++*FoomaticRIPOptionSetting NupOrient=land: "-ol "
++*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
++*FoomaticRIPOptionSetting NupOrient=port: " "
++*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
++*FoomaticRIPOptionSetting NupOrient=sea: "-os "
++*CloseUI: *NupOrient
++
++*OpenUI *NupPages/N-up Printing: PickOne
++*FoomaticRIPOption NupPages: enum CmdLine A
++*OrderDependency: 200 AnySetup *NupPages
++*DefaultNupPages: 1up
++*NupPages 1up/1-up: "%% FoomaticRIPOptionSetting: NupPages=1up"
++*FoomaticRIPOptionSetting NupPages=1up: " "
++*NupPages 2up/2-up: "%% FoomaticRIPOptionSetting: NupPages=2up"
++*FoomaticRIPOptionSetting NupPages=2up: "-2 "
++*NupPages 3up/3-up: "%% FoomaticRIPOptionSetting: NupPages=3up"
++*FoomaticRIPOptionSetting NupPages=3up: "-3 "
++*NupPages 4up/4-up: "%% FoomaticRIPOptionSetting: NupPages=4up"
++*FoomaticRIPOptionSetting NupPages=4up: "-4 "
++*NupPages 6up/6-up: "%% FoomaticRIPOptionSetting: NupPages=6up"
++*FoomaticRIPOptionSetting NupPages=6up: "-6 "
++*NupPages 8up/8-up: "%% FoomaticRIPOptionSetting: NupPages=8up"
++*FoomaticRIPOptionSetting NupPages=8up: "-8 "
++*NupPages 10up/10-up: "%% FoomaticRIPOptionSetting: NupPages=10up"
++*FoomaticRIPOptionSetting NupPages=10up: "-10 "
++*NupPages 12up/12-up: "%% FoomaticRIPOptionSetting: NupPages=12up"
++*FoomaticRIPOptionSetting NupPages=12up: "-12 "
++*NupPages 14up/14-up: "%% FoomaticRIPOptionSetting: NupPages=14up"
++*FoomaticRIPOptionSetting NupPages=14up: "-14 "
++*NupPages 15up/15-up: "%% FoomaticRIPOptionSetting: NupPages=15up"
++*FoomaticRIPOptionSetting NupPages=15up: "-15 "
++*NupPages 16up/16-up: "%% FoomaticRIPOptionSetting: NupPages=16up"
++*FoomaticRIPOptionSetting NupPages=16up: "-16 "
++*NupPages 18up/18-up: "%% FoomaticRIPOptionSetting: NupPages=18up"
++*FoomaticRIPOptionSetting NupPages=18up: "-18 "
++*CloseUI: *NupPages
++
++*CloseGroup: Miscellaneous
++
++
++*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
++
++*DefaultFont: Courier
++*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
++*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
++*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
++*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
++*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
++*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
++*Font Bookman-Light: Standard "(001.004S)" Standard ROM
++*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
++*Font Courier: Standard "(002.004S)" Standard ROM
++*Font Courier-Bold: Standard "(002.004S)" Standard ROM
++*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
++*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
++*Font Helvetica: Standard "(001.006S)" Standard ROM
++*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
++*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
++*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
++*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
++*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
++*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
++*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
++*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
++*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
++*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
++*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
++*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
++*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
++*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
++*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
++*Font Symbol: Special "(001.007S)" Special ROM
++*Font Times-Bold: Standard "(001.007S)" Standard ROM
++*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
++*Font Times-Italic: Standard "(001.007S)" Standard ROM
++*Font Times-Roman: Standard "(001.007S)" Standard ROM
++*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
++*Font ZapfDingbats: Special "(001.004S)" Standard ROM
++
+--- foo2zjs/PPD/Dell-C1760.ppd	1970-01-01 00:00:00.000000000 +0000
++++ foo2zjs/PPD/Dell-C1760.ppd	2014-04-01 11:06:30.000000000 +0000
+@@ -0,0 +1,433 @@
++*PPD-Adobe: "4.3"
++*%
++*% For information on using this, and to obtain the required backend
++*% script, consult http://www.openprinting.org/
++*%
++*% This file is published under the GNU General Public License
++*%
++*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with 
++*% all programs and environments which use PPD files for dealing with
++*% printer capability information. The printer must be configured with the
++*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This 
++*% file and "foomatic-rip" work together to support PPD-controlled printer
++*% driver option access with arbitrary free software printer drivers and
++*% printing spoolers.
++*%
++*% To save this file on your disk, wait until the download has completed
++*% (the animation of the browser logo must stop) and then use the
++*% "Save as..." command in the "File" menu of your browser or in the 
++*% pop-up manu when you click on this document with the right mouse button.
++*% DO NOT cut and paste this file into an editor with your mouse. This can
++*% introduce additional line breaks which lead to unexpected results.
++*%
++*% You may save this file as 'Dell-C1760-foo2hbpl1.ppd'
++*%
++*%
++*FormatVersion:	"4.3"
++*FileVersion:	"1.1"
++*LanguageVersion: English 
++*LanguageEncoding: ISOLatin1
++*PCFileName:	"FOO2HBPL.PPD"
++*Manufacturer:	"Dell"
++*Product:	"(C1760)"
++*cupsVersion:	1.0
++*cupsManualCopies: True
++*cupsModelNumber:  2
++*cupsFilter:	"application/vnd.cups-postscript 0 foomatic-rip"
++*%pprRIP:        foomatic-rip other
++*ModelName:     "Dell C1760"
++*ShortNickName: "Dell C1760 foo2hbpl1"
++*NickName:      "Dell C1760 Foomatic/foo2hbpl1 (recommended)"
++*PSVersion:	"(3010.000) 550"
++*PSVersion:	"(3010.000) 651"
++*PSVersion:	"(3010.000) 652"
++*PSVersion:	"(3010.000) 653"
++*PSVersion:	"(3010.000) 704"
++*PSVersion:	"(3010.000) 705"
++*PSVersion:	"(3010.000) 800"
++*LanguageLevel:	"3"
++*ColorDevice:	True
++*DefaultColorSpace: RGB
++*FileSystem:	False
++*Throughput:	"1"
++*LandscapeOrientation: Plus90
++*TTRasterizer:	Type42
++*1284DeviceID: "DRV:Dfoo2hbpl1,R1,M0,TF;"
++
++*driverName foo2hbpl1/foo2hbpl1: ""
++*driverType F/Filter: ""
++*driverUrl: "http://foo2hbpl.rkkda.com/"
++*driverObsolete: False
++
++
++
++
++*HWMargins: 9 12.00 9 12
++*VariablePaperSize: True
++*MaxMediaWidth: 100000
++*MaxMediaHeight: 100000
++*NonUIOrderDependency: 135 AnySetup *CustomPageSize
++*CustomPageSize True: "pop pop pop pop pop
++%% FoomaticRIPOptionSetting: PageSize=Custom"
++*End
++*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
++*ParamCustomPageSize Width: 1 points 36 100000
++*ParamCustomPageSize Height: 2 points 36 100000
++*ParamCustomPageSize Orientation: 3 int 0 0
++*ParamCustomPageSize WidthOffset: 4 points 0 0
++*ParamCustomPageSize HeightOffset: 5 points 0 0
++
++*FoomaticIDs: Dell-C1760 foo2hbpl1
++*FoomaticRIPCommandLine: "foo2hbpl1-wrapper %A"
++
++*OpenGroup: General/General
++
++*OpenUI *Quality/Printing Quality: PickOne
++*FoomaticRIPOption Quality: enum CmdLine A
++*OrderDependency: 110 AnySetup *Quality
++*DefaultQuality: normal
++*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
++*FoomaticRIPOptionSetting Quality=draft: " -t  "
++*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
++*FoomaticRIPOptionSetting Quality=normal: "  "
++*CloseUI: *Quality
++
++*OpenUI *ColorMode/Color Mode: PickOne
++*FoomaticRIPOption ColorMode: enum CmdLine A
++*OrderDependency: 120 AnySetup *ColorMode
++*DefaultColorMode: Monochrome
++*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
++*FoomaticRIPOptionSetting ColorMode=Color: "-c "
++*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
++*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
++*CloseUI: *ColorMode
++
++*OpenUI *PageSize/Page Size: PickOne
++*FoomaticRIPOption PageSize: enum CmdLine A
++*OrderDependency: 135 AnySetup *PageSize
++*DefaultPageSize: Letter
++*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
++*FoomaticRIPOptionSetting PageSize=Letter: "-p4 "
++*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
++*FoomaticRIPOptionSetting PageSize=A4: "-p1 "
++*PageSize B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
++*FoomaticRIPOptionSetting PageSize=B5jis: "-p2 "
++*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
++*FoomaticRIPOptionSetting PageSize=Env10: "-p9 "
++*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
++*FoomaticRIPOptionSetting PageSize=EnvC5: "-p11 "
++*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
++*FoomaticRIPOptionSetting PageSize=EnvDL: "-p12 "
++*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
++*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p10 "
++*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
++*FoomaticRIPOptionSetting PageSize=Executive: "-p5 "
++*PageSize FanfoldGermanLegal/Fanfold German Legal: "%% FoomaticRIPOptionSetting: PageSize=FanfoldGermanLegal"
++*FoomaticRIPOptionSetting PageSize=FanfoldGermanLegal: "-p6 "
++*PageSize Folio/Folio: "%% FoomaticRIPOptionSetting: PageSize=Folio"
++*FoomaticRIPOptionSetting PageSize=Folio: "-p6 "
++*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
++*FoomaticRIPOptionSetting PageSize=Legal: "-p7 "
++*CloseUI: *PageSize
++
++*OpenUI *PageRegion: PickOne
++*OrderDependency: 135 AnySetup *PageRegion
++*DefaultPageRegion: Letter
++*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
++*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
++*PageRegion B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
++*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
++*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
++*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
++*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
++*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
++*PageRegion FanfoldGermanLegal/Fanfold German Legal: "%% FoomaticRIPOptionSetting: PageSize=FanfoldGermanLegal"
++*PageRegion Folio/Folio: "%% FoomaticRIPOptionSetting: PageSize=Folio"
++*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
++*CloseUI: *PageRegion
++
++*DefaultImageableArea: Letter
++*ImageableArea Letter/Letter: "9 12.00 603 780.00"
++*ImageableArea A4/A4: "9 12.00 586 830.00"
++*ImageableArea B5jis/B5 (JIS): "9 12.00 509 715.00"
++*ImageableArea Env10/Env #10: "9 12.00 288 672.00"
++*ImageableArea EnvC5/Env C5: "9 12.00 450 637.00"
++*ImageableArea EnvDL/Env DL: "9 12.00 302 611.00"
++*ImageableArea EnvMonarch/Env Monarch: "9 12.00 270 528.00"
++*ImageableArea Executive/Executive: "9 12.00 513 744.00"
++*ImageableArea FanfoldGermanLegal/Fanfold German Legal: "9 12.00 603 996.00"
++*ImageableArea Folio/Folio: "9 12.00 603 924.00"
++*ImageableArea Legal/Legal: "9 12.00 603 996.00"
++
++*DefaultPaperDimension: Letter
++*PaperDimension Letter/Letter: "612 792"
++*PaperDimension A4/A4: "595 842"
++*PaperDimension B5jis/B5 (JIS): "518 727"
++*PaperDimension Env10/Env #10: "297 684"
++*PaperDimension EnvC5/Env C5: "459 649"
++*PaperDimension EnvDL/Env DL: "311 623"
++*PaperDimension EnvMonarch/Env Monarch: "279 540"
++*PaperDimension Executive/Executive: "522 756"
++*PaperDimension FanfoldGermanLegal/Fanfold German Legal: "612 1008"
++*PaperDimension Folio/Folio: "612 936"
++*PaperDimension Legal/Legal: "612 1008"
++
++*OpenUI *MediaType/Media Type: PickOne
++*FoomaticRIPOption MediaType: enum CmdLine A
++*OrderDependency: 150 AnySetup *MediaType
++*DefaultMediaType: plain
++*MediaType plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=plain"
++*FoomaticRIPOptionSetting MediaType=plain: "-m1 "
++*MediaType plain2/Plain Paper Side 2: "%% FoomaticRIPOptionSetting: MediaType=plain2"
++*FoomaticRIPOptionSetting MediaType=plain2: "-m8 "
++*MediaType bond/Bond: "%% FoomaticRIPOptionSetting: MediaType=bond"
++*FoomaticRIPOptionSetting MediaType=bond: "-m2 "
++*MediaType bond2/Bond Side 2: "%% FoomaticRIPOptionSetting: MediaType=bond2"
++*FoomaticRIPOptionSetting MediaType=bond2: "-m9 "
++*MediaType envelope/Envelope: "%% FoomaticRIPOptionSetting: MediaType=envelope"
++*FoomaticRIPOptionSetting MediaType=envelope: "-m6 "
++*MediaType labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=labels"
++*FoomaticRIPOptionSetting MediaType=labels: "-m5 "
++*MediaType lwcard/Light Weight Card: "%% FoomaticRIPOptionSetting: MediaType=lwcard"
++*FoomaticRIPOptionSetting MediaType=lwcard: "-m3 "
++*MediaType lwcard2/Light Weight Card Side 2: "%% FoomaticRIPOptionSetting: MediaType=lwcard2"
++*FoomaticRIPOptionSetting MediaType=lwcard2: "-m10 "
++*MediaType lwgcard/Light Weight Glossy Card: "%% FoomaticRIPOptionSetting: MediaType=lwgcard"
++*FoomaticRIPOptionSetting MediaType=lwgcard: "-m4 "
++*MediaType lwgcard2/Light Weight Glossy Card Side 2: "%% FoomaticRIPOptionSetting: MediaType=lwgcard2"
++*FoomaticRIPOptionSetting MediaType=lwgcard2: "-m11 "
++*MediaType recycled/Recycled Paper: "%% FoomaticRIPOptionSetting: MediaType=recycled"
++*FoomaticRIPOptionSetting MediaType=recycled: "-m7 "
++*MediaType recycled2/Recycled Paper Side 2: "%% FoomaticRIPOptionSetting: MediaType=recycled2"
++*FoomaticRIPOptionSetting MediaType=recycled2: "-m12 "
++*CloseUI: *MediaType
++
++*OpenUI *Copies/Copies: PickOne
++*FoomaticRIPOption Copies: int CmdLine A
++*FoomaticRIPOptionPrototype Copies: "-n%s "
++*FoomaticRIPOptionRange Copies: 1 100
++*OrderDependency: 220 AnySetup *Copies
++*DefaultCopies: 1
++*FoomaticRIPDefaultCopies: 1
++*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
++*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
++*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
++*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
++*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
++*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
++*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
++*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
++*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
++*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
++*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
++*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
++*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
++*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
++*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
++*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
++*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
++*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
++*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
++*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
++*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
++*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
++*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
++*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
++*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
++*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
++*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
++*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
++*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
++*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
++*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
++*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
++*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
++*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
++*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
++*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
++*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
++*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
++*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
++*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
++*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
++*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
++*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
++*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
++*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
++*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
++*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
++*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
++*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
++*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
++*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
++*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
++*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
++*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
++*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
++*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
++*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
++*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
++*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
++*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
++*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
++*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
++*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
++*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
++*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
++*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
++*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
++*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
++*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
++*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
++*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
++*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
++*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
++*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
++*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
++*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
++*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
++*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
++*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
++*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
++*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
++*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
++*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
++*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
++*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
++*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
++*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
++*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
++*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
++*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
++*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
++*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
++*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
++*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
++*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
++*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
++*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
++*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
++*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
++*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
++*CloseUI: *Copies
++
++*CloseGroup: General
++
++*OpenGroup: Adjustment/Adjustment
++
++*OpenUI *halftone/Halftone Algorithm: PickOne
++*FoomaticRIPOption halftone: enum CmdLine A
++*OrderDependency: 110 AnySetup *halftone
++*Defaulthalftone: default
++*halftone default/Default: "%% FoomaticRIPOptionSetting: halftone=default"
++*FoomaticRIPOptionSetting halftone=default: "  "
++*halftone as/Accurate Screens (better): "%% FoomaticRIPOptionSetting: halftone=as"
++*FoomaticRIPOptionSetting halftone=as: " -qas  "
++*halftone standard/Standard: "%% FoomaticRIPOptionSetting: halftone=standard"
++*FoomaticRIPOptionSetting halftone=standard: " -q1  "
++*halftone wts/Well Tempered Screens (best): "%% FoomaticRIPOptionSetting: halftone=wts"
++*FoomaticRIPOptionSetting halftone=wts: " -qwts  "
++*CloseUI: *halftone
++
++*OpenUI *ICM/ICM Color Profile: PickOne
++*FoomaticRIPOption ICM: enum CmdLine A
++*OrderDependency: 300 AnySetup *ICM
++*DefaultICM: none
++*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
++*FoomaticRIPOptionSetting ICM=none: "-C10 -Gnone.icm "
++*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
++*FoomaticRIPOptionSetting ICM=testing: "-C10 -Gtesting.icm "
++*ICM testing2/File testing2.icm: "%% FoomaticRIPOptionSetting: ICM=testing2"
++*FoomaticRIPOptionSetting ICM=testing2: "-C10 -Gtesting2.icm "
++*ICM testing3/File testing3.icm: "%% FoomaticRIPOptionSetting: ICM=testing3"
++*FoomaticRIPOptionSetting ICM=testing3: "-C10 -Gtesting3.icm "
++*CloseUI: *ICM
++
++*CloseGroup: Adjustment
++
++*OpenGroup: Miscellaneous/Miscellaneous
++
++*OpenUI *NupOrient/N-up Orientation: PickOne
++*FoomaticRIPOption NupOrient: enum CmdLine A
++*OrderDependency: 200 AnySetup *NupOrient
++*DefaultNupOrient: port
++*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
++*FoomaticRIPOptionSetting NupOrient=land: "-ol "
++*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
++*FoomaticRIPOptionSetting NupOrient=port: " "
++*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
++*FoomaticRIPOptionSetting NupOrient=sea: "-os "
++*CloseUI: *NupOrient
++
++*OpenUI *NupPages/N-up Printing: PickOne
++*FoomaticRIPOption NupPages: enum CmdLine A
++*OrderDependency: 200 AnySetup *NupPages
++*DefaultNupPages: 1up
++*NupPages 1up/1-up: "%% FoomaticRIPOptionSetting: NupPages=1up"
++*FoomaticRIPOptionSetting NupPages=1up: " "
++*NupPages 2up/2-up: "%% FoomaticRIPOptionSetting: NupPages=2up"
++*FoomaticRIPOptionSetting NupPages=2up: "-2 "
++*NupPages 3up/3-up: "%% FoomaticRIPOptionSetting: NupPages=3up"
++*FoomaticRIPOptionSetting NupPages=3up: "-3 "
++*NupPages 4up/4-up: "%% FoomaticRIPOptionSetting: NupPages=4up"
++*FoomaticRIPOptionSetting NupPages=4up: "-4 "
++*NupPages 6up/6-up: "%% FoomaticRIPOptionSetting: NupPages=6up"
++*FoomaticRIPOptionSetting NupPages=6up: "-6 "
++*NupPages 8up/8-up: "%% FoomaticRIPOptionSetting: NupPages=8up"
++*FoomaticRIPOptionSetting NupPages=8up: "-8 "
++*NupPages 10up/10-up: "%% FoomaticRIPOptionSetting: NupPages=10up"
++*FoomaticRIPOptionSetting NupPages=10up: "-10 "
++*NupPages 12up/12-up: "%% FoomaticRIPOptionSetting: NupPages=12up"
++*FoomaticRIPOptionSetting NupPages=12up: "-12 "
++*NupPages 14up/14-up: "%% FoomaticRIPOptionSetting: NupPages=14up"
++*FoomaticRIPOptionSetting NupPages=14up: "-14 "
++*NupPages 15up/15-up: "%% FoomaticRIPOptionSetting: NupPages=15up"
++*FoomaticRIPOptionSetting NupPages=15up: "-15 "
++*NupPages 16up/16-up: "%% FoomaticRIPOptionSetting: NupPages=16up"
++*FoomaticRIPOptionSetting NupPages=16up: "-16 "
++*NupPages 18up/18-up: "%% FoomaticRIPOptionSetting: NupPages=18up"
++*FoomaticRIPOptionSetting NupPages=18up: "-18 "
++*CloseUI: *NupPages
++
++*CloseGroup: Miscellaneous
++
++
++*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
++
++*DefaultFont: Courier
++*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
++*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
++*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
++*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
++*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
++*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
++*Font Bookman-Light: Standard "(001.004S)" Standard ROM
++*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
++*Font Courier: Standard "(002.004S)" Standard ROM
++*Font Courier-Bold: Standard "(002.004S)" Standard ROM
++*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
++*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
++*Font Helvetica: Standard "(001.006S)" Standard ROM
++*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
++*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
++*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
++*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
++*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
++*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
++*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
++*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
++*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
++*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
++*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
++*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
++*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
++*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
++*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
++*Font Symbol: Special "(001.007S)" Special ROM
++*Font Times-Bold: Standard "(001.007S)" Standard ROM
++*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
++*Font Times-Italic: Standard "(001.007S)" Standard ROM
++*Font Times-Roman: Standard "(001.007S)" Standard ROM
++*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
++*Font ZapfDingbats: Special "(001.004S)" Standard ROM
++
+--- foo2zjs/PPD/Epson-AcuLaser_C1700.ppd	1970-01-01 00:00:00.000000000 +0000
++++ foo2zjs/PPD/Epson-AcuLaser_C1700.ppd	2014-04-01 11:06:31.000000000 +0000
+@@ -0,0 +1,433 @@
++*PPD-Adobe: "4.3"
++*%
++*% For information on using this, and to obtain the required backend
++*% script, consult http://www.openprinting.org/
++*%
++*% This file is published under the GNU General Public License
++*%
++*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with 
++*% all programs and environments which use PPD files for dealing with
++*% printer capability information. The printer must be configured with the
++*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This 
++*% file and "foomatic-rip" work together to support PPD-controlled printer
++*% driver option access with arbitrary free software printer drivers and
++*% printing spoolers.
++*%
++*% To save this file on your disk, wait until the download has completed
++*% (the animation of the browser logo must stop) and then use the
++*% "Save as..." command in the "File" menu of your browser or in the 
++*% pop-up manu when you click on this document with the right mouse button.
++*% DO NOT cut and paste this file into an editor with your mouse. This can
++*% introduce additional line breaks which lead to unexpected results.
++*%
++*% You may save this file as 'Epson-AcuLaser_C1700-foo2hbpl1.ppd'
++*%
++*%
++*FormatVersion:	"4.3"
++*FileVersion:	"1.1"
++*LanguageVersion: English 
++*LanguageEncoding: ISOLatin1
++*PCFileName:	"FOO2HBPL.PPD"
++*Manufacturer:	"Epson"
++*Product:	"(AcuLaser C1700)"
++*cupsVersion:	1.0
++*cupsManualCopies: True
++*cupsModelNumber:  2
++*cupsFilter:	"application/vnd.cups-postscript 0 foomatic-rip"
++*%pprRIP:        foomatic-rip other
++*ModelName:     "Epson AcuLaser C1700"
++*ShortNickName: "Epson AcuLaser C1700 foo2hbpl1"
++*NickName:      "Epson AcuLaser C1700 Foomatic/foo2hbpl1 (recommended)"
++*PSVersion:	"(3010.000) 550"
++*PSVersion:	"(3010.000) 651"
++*PSVersion:	"(3010.000) 652"
++*PSVersion:	"(3010.000) 653"
++*PSVersion:	"(3010.000) 704"
++*PSVersion:	"(3010.000) 705"
++*PSVersion:	"(3010.000) 800"
++*LanguageLevel:	"3"
++*ColorDevice:	True
++*DefaultColorSpace: RGB
++*FileSystem:	False
++*Throughput:	"1"
++*LandscapeOrientation: Plus90
++*TTRasterizer:	Type42
++*1284DeviceID: "DRV:Dfoo2hbpl1,R1,M0,TF;"
++
++*driverName foo2hbpl1/foo2hbpl1: ""
++*driverType F/Filter: ""
++*driverUrl: "http://foo2hbpl.rkkda.com/"
++*driverObsolete: False
++
++
++
++
++*HWMargins: 9 12.00 9 12
++*VariablePaperSize: True
++*MaxMediaWidth: 100000
++*MaxMediaHeight: 100000
++*NonUIOrderDependency: 135 AnySetup *CustomPageSize
++*CustomPageSize True: "pop pop pop pop pop
++%% FoomaticRIPOptionSetting: PageSize=Custom"
++*End
++*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
++*ParamCustomPageSize Width: 1 points 36 100000
++*ParamCustomPageSize Height: 2 points 36 100000
++*ParamCustomPageSize Orientation: 3 int 0 0
++*ParamCustomPageSize WidthOffset: 4 points 0 0
++*ParamCustomPageSize HeightOffset: 5 points 0 0
++
++*FoomaticIDs: Epson-AcuLaser_C1700 foo2hbpl1
++*FoomaticRIPCommandLine: "foo2hbpl1-wrapper %A"
++
++*OpenGroup: General/General
++
++*OpenUI *Quality/Printing Quality: PickOne
++*FoomaticRIPOption Quality: enum CmdLine A
++*OrderDependency: 110 AnySetup *Quality
++*DefaultQuality: normal
++*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
++*FoomaticRIPOptionSetting Quality=draft: " -t  "
++*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
++*FoomaticRIPOptionSetting Quality=normal: "  "
++*CloseUI: *Quality
++
++*OpenUI *ColorMode/Color Mode: PickOne
++*FoomaticRIPOption ColorMode: enum CmdLine A
++*OrderDependency: 120 AnySetup *ColorMode
++*DefaultColorMode: Monochrome
++*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
++*FoomaticRIPOptionSetting ColorMode=Color: "-c "
++*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
++*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
++*CloseUI: *ColorMode
++
++*OpenUI *PageSize/Page Size: PickOne
++*FoomaticRIPOption PageSize: enum CmdLine A
++*OrderDependency: 135 AnySetup *PageSize
++*DefaultPageSize: Letter
++*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
++*FoomaticRIPOptionSetting PageSize=Letter: "-p4 "
++*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
++*FoomaticRIPOptionSetting PageSize=A4: "-p1 "
++*PageSize B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
++*FoomaticRIPOptionSetting PageSize=B5jis: "-p2 "
++*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
++*FoomaticRIPOptionSetting PageSize=Env10: "-p9 "
++*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
++*FoomaticRIPOptionSetting PageSize=EnvC5: "-p11 "
++*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
++*FoomaticRIPOptionSetting PageSize=EnvDL: "-p12 "
++*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
++*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p10 "
++*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
++*FoomaticRIPOptionSetting PageSize=Executive: "-p5 "
++*PageSize FanfoldGermanLegal/Fanfold German Legal: "%% FoomaticRIPOptionSetting: PageSize=FanfoldGermanLegal"
++*FoomaticRIPOptionSetting PageSize=FanfoldGermanLegal: "-p6 "
++*PageSize Folio/Folio: "%% FoomaticRIPOptionSetting: PageSize=Folio"
++*FoomaticRIPOptionSetting PageSize=Folio: "-p6 "
++*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
++*FoomaticRIPOptionSetting PageSize=Legal: "-p7 "
++*CloseUI: *PageSize
++
++*OpenUI *PageRegion: PickOne
++*OrderDependency: 135 AnySetup *PageRegion
++*DefaultPageRegion: Letter
++*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
++*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
++*PageRegion B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
++*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
++*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
++*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
++*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
++*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
++*PageRegion FanfoldGermanLegal/Fanfold German Legal: "%% FoomaticRIPOptionSetting: PageSize=FanfoldGermanLegal"
++*PageRegion Folio/Folio: "%% FoomaticRIPOptionSetting: PageSize=Folio"
++*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
++*CloseUI: *PageRegion
++
++*DefaultImageableArea: Letter
++*ImageableArea Letter/Letter: "9 12.00 603 780.00"
++*ImageableArea A4/A4: "9 12.00 586 830.00"
++*ImageableArea B5jis/B5 (JIS): "9 12.00 509 715.00"
++*ImageableArea Env10/Env #10: "9 12.00 288 672.00"
++*ImageableArea EnvC5/Env C5: "9 12.00 450 637.00"
++*ImageableArea EnvDL/Env DL: "9 12.00 302 611.00"
++*ImageableArea EnvMonarch/Env Monarch: "9 12.00 270 528.00"
++*ImageableArea Executive/Executive: "9 12.00 513 744.00"
++*ImageableArea FanfoldGermanLegal/Fanfold German Legal: "9 12.00 603 996.00"
++*ImageableArea Folio/Folio: "9 12.00 603 924.00"
++*ImageableArea Legal/Legal: "9 12.00 603 996.00"
++
++*DefaultPaperDimension: Letter
++*PaperDimension Letter/Letter: "612 792"
++*PaperDimension A4/A4: "595 842"
++*PaperDimension B5jis/B5 (JIS): "518 727"
++*PaperDimension Env10/Env #10: "297 684"
++*PaperDimension EnvC5/Env C5: "459 649"
++*PaperDimension EnvDL/Env DL: "311 623"
++*PaperDimension EnvMonarch/Env Monarch: "279 540"
++*PaperDimension Executive/Executive: "522 756"
++*PaperDimension FanfoldGermanLegal/Fanfold German Legal: "612 1008"
++*PaperDimension Folio/Folio: "612 936"
++*PaperDimension Legal/Legal: "612 1008"
++
++*OpenUI *MediaType/Media Type: PickOne
++*FoomaticRIPOption MediaType: enum CmdLine A
++*OrderDependency: 150 AnySetup *MediaType
++*DefaultMediaType: plain
++*MediaType plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=plain"
++*FoomaticRIPOptionSetting MediaType=plain: "-m1 "
++*MediaType plain2/Plain Paper Side 2: "%% FoomaticRIPOptionSetting: MediaType=plain2"
++*FoomaticRIPOptionSetting MediaType=plain2: "-m8 "
++*MediaType bond/Bond: "%% FoomaticRIPOptionSetting: MediaType=bond"
++*FoomaticRIPOptionSetting MediaType=bond: "-m2 "
++*MediaType bond2/Bond Side 2: "%% FoomaticRIPOptionSetting: MediaType=bond2"
++*FoomaticRIPOptionSetting MediaType=bond2: "-m9 "
++*MediaType envelope/Envelope: "%% FoomaticRIPOptionSetting: MediaType=envelope"
++*FoomaticRIPOptionSetting MediaType=envelope: "-m6 "
++*MediaType labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=labels"
++*FoomaticRIPOptionSetting MediaType=labels: "-m5 "
++*MediaType lwcard/Light Weight Card: "%% FoomaticRIPOptionSetting: MediaType=lwcard"
++*FoomaticRIPOptionSetting MediaType=lwcard: "-m3 "
++*MediaType lwcard2/Light Weight Card Side 2: "%% FoomaticRIPOptionSetting: MediaType=lwcard2"
++*FoomaticRIPOptionSetting MediaType=lwcard2: "-m10 "
++*MediaType lwgcard/Light Weight Glossy Card: "%% FoomaticRIPOptionSetting: MediaType=lwgcard"
++*FoomaticRIPOptionSetting MediaType=lwgcard: "-m4 "
++*MediaType lwgcard2/Light Weight Glossy Card Side 2: "%% FoomaticRIPOptionSetting: MediaType=lwgcard2"
++*FoomaticRIPOptionSetting MediaType=lwgcard2: "-m11 "
++*MediaType recycled/Recycled Paper: "%% FoomaticRIPOptionSetting: MediaType=recycled"
++*FoomaticRIPOptionSetting MediaType=recycled: "-m7 "
++*MediaType recycled2/Recycled Paper Side 2: "%% FoomaticRIPOptionSetting: MediaType=recycled2"
++*FoomaticRIPOptionSetting MediaType=recycled2: "-m12 "
++*CloseUI: *MediaType
++
++*OpenUI *Copies/Copies: PickOne
++*FoomaticRIPOption Copies: int CmdLine A
++*FoomaticRIPOptionPrototype Copies: "-n%s "
++*FoomaticRIPOptionRange Copies: 1 100
++*OrderDependency: 220 AnySetup *Copies
++*DefaultCopies: 1
++*FoomaticRIPDefaultCopies: 1
++*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
++*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
++*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
++*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
++*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
++*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
++*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
++*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
++*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
++*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
++*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
++*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
++*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
++*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
++*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
++*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
++*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
++*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
++*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
++*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
++*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
++*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
++*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
++*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
++*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
++*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
++*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
++*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
++*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
++*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
++*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
++*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
++*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
++*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
++*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
++*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
++*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
++*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
++*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
++*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
++*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
++*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
++*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
++*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
++*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
++*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
++*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
++*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
++*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
++*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
++*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
++*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
++*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
++*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
++*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
++*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
++*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
++*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
++*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
++*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
++*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
++*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
++*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
++*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
++*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
++*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
++*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
++*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
++*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
++*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
++*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
++*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
++*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
++*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
++*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
++*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
++*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
++*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
++*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
++*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
++*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
++*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
++*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
++*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
++*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
++*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
++*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
++*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
++*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
++*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
++*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
++*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
++*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
++*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
++*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
++*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
++*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
++*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
++*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
++*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
++*CloseUI: *Copies
++
++*CloseGroup: General
++
++*OpenGroup: Adjustment/Adjustment
++
++*OpenUI *halftone/Halftone Algorithm: PickOne
++*FoomaticRIPOption halftone: enum CmdLine A
++*OrderDependency: 110 AnySetup *halftone
++*Defaulthalftone: default
++*halftone default/Default: "%% FoomaticRIPOptionSetting: halftone=default"
++*FoomaticRIPOptionSetting halftone=default: "  "
++*halftone as/Accurate Screens (better): "%% FoomaticRIPOptionSetting: halftone=as"
++*FoomaticRIPOptionSetting halftone=as: " -qas  "
++*halftone standard/Standard: "%% FoomaticRIPOptionSetting: halftone=standard"
++*FoomaticRIPOptionSetting halftone=standard: " -q1  "
++*halftone wts/Well Tempered Screens (best): "%% FoomaticRIPOptionSetting: halftone=wts"
++*FoomaticRIPOptionSetting halftone=wts: " -qwts  "
++*CloseUI: *halftone
++
++*OpenUI *ICM/ICM Color Profile: PickOne
++*FoomaticRIPOption ICM: enum CmdLine A
++*OrderDependency: 300 AnySetup *ICM
++*DefaultICM: none
++*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
++*FoomaticRIPOptionSetting ICM=none: "-C10 -Gnone.icm "
++*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
++*FoomaticRIPOptionSetting ICM=testing: "-C10 -Gtesting.icm "
++*ICM testing2/File testing2.icm: "%% FoomaticRIPOptionSetting: ICM=testing2"
++*FoomaticRIPOptionSetting ICM=testing2: "-C10 -Gtesting2.icm "
++*ICM testing3/File testing3.icm: "%% FoomaticRIPOptionSetting: ICM=testing3"
++*FoomaticRIPOptionSetting ICM=testing3: "-C10 -Gtesting3.icm "
++*CloseUI: *ICM
++
++*CloseGroup: Adjustment
++
++*OpenGroup: Miscellaneous/Miscellaneous
++
++*OpenUI *NupOrient/N-up Orientation: PickOne
++*FoomaticRIPOption NupOrient: enum CmdLine A
++*OrderDependency: 200 AnySetup *NupOrient
++*DefaultNupOrient: port
++*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
++*FoomaticRIPOptionSetting NupOrient=land: "-ol "
++*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
++*FoomaticRIPOptionSetting NupOrient=port: " "
++*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
++*FoomaticRIPOptionSetting NupOrient=sea: "-os "
++*CloseUI: *NupOrient
++
++*OpenUI *NupPages/N-up Printing: PickOne
++*FoomaticRIPOption NupPages: enum CmdLine A
++*OrderDependency: 200 AnySetup *NupPages
++*DefaultNupPages: 1up
++*NupPages 1up/1-up: "%% FoomaticRIPOptionSetting: NupPages=1up"
++*FoomaticRIPOptionSetting NupPages=1up: " "
++*NupPages 2up/2-up: "%% FoomaticRIPOptionSetting: NupPages=2up"
++*FoomaticRIPOptionSetting NupPages=2up: "-2 "
++*NupPages 3up/3-up: "%% FoomaticRIPOptionSetting: NupPages=3up"
++*FoomaticRIPOptionSetting NupPages=3up: "-3 "
++*NupPages 4up/4-up: "%% FoomaticRIPOptionSetting: NupPages=4up"
++*FoomaticRIPOptionSetting NupPages=4up: "-4 "
++*NupPages 6up/6-up: "%% FoomaticRIPOptionSetting: NupPages=6up"
++*FoomaticRIPOptionSetting NupPages=6up: "-6 "
++*NupPages 8up/8-up: "%% FoomaticRIPOptionSetting: NupPages=8up"
++*FoomaticRIPOptionSetting NupPages=8up: "-8 "
++*NupPages 10up/10-up: "%% FoomaticRIPOptionSetting: NupPages=10up"
++*FoomaticRIPOptionSetting NupPages=10up: "-10 "
++*NupPages 12up/12-up: "%% FoomaticRIPOptionSetting: NupPages=12up"
++*FoomaticRIPOptionSetting NupPages=12up: "-12 "
++*NupPages 14up/14-up: "%% FoomaticRIPOptionSetting: NupPages=14up"
++*FoomaticRIPOptionSetting NupPages=14up: "-14 "
++*NupPages 15up/15-up: "%% FoomaticRIPOptionSetting: NupPages=15up"
++*FoomaticRIPOptionSetting NupPages=15up: "-15 "
++*NupPages 16up/16-up: "%% FoomaticRIPOptionSetting: NupPages=16up"
++*FoomaticRIPOptionSetting NupPages=16up: "-16 "
++*NupPages 18up/18-up: "%% FoomaticRIPOptionSetting: NupPages=18up"
++*FoomaticRIPOptionSetting NupPages=18up: "-18 "
++*CloseUI: *NupPages
++
++*CloseGroup: Miscellaneous
++
++
++*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
++
++*DefaultFont: Courier
++*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
++*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
++*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
++*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
++*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
++*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
++*Font Bookman-Light: Standard "(001.004S)" Standard ROM
++*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
++*Font Courier: Standard "(002.004S)" Standard ROM
++*Font Courier-Bold: Standard "(002.004S)" Standard ROM
++*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
++*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
++*Font Helvetica: Standard "(001.006S)" Standard ROM
++*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
++*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
++*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
++*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
++*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
++*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
++*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
++*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
++*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
++*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
++*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
++*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
++*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
++*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
++*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
++*Font Symbol: Special "(001.007S)" Special ROM
++*Font Times-Bold: Standard "(001.007S)" Standard ROM
++*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
++*Font Times-Italic: Standard "(001.007S)" Standard ROM
++*Font Times-Roman: Standard "(001.007S)" Standard ROM
++*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
++*Font ZapfDingbats: Special "(001.004S)" Standard ROM
++
+--- foo2zjs/PPD/Fuji_Xerox-DocuPrint_CP105.ppd	1970-01-01 00:00:00.000000000 +0000
++++ foo2zjs/PPD/Fuji_Xerox-DocuPrint_CP105.ppd	2014-04-01 11:06:31.000000000 +0000
+@@ -0,0 +1,433 @@
++*PPD-Adobe: "4.3"
++*%
++*% For information on using this, and to obtain the required backend
++*% script, consult http://www.openprinting.org/
++*%
++*% This file is published under the GNU General Public License
++*%
++*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with 
++*% all programs and environments which use PPD files for dealing with
++*% printer capability information. The printer must be configured with the
++*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This 
++*% file and "foomatic-rip" work together to support PPD-controlled printer
++*% driver option access with arbitrary free software printer drivers and
++*% printing spoolers.
++*%
++*% To save this file on your disk, wait until the download has completed
++*% (the animation of the browser logo must stop) and then use the
++*% "Save as..." command in the "File" menu of your browser or in the 
++*% pop-up manu when you click on this document with the right mouse button.
++*% DO NOT cut and paste this file into an editor with your mouse. This can
++*% introduce additional line breaks which lead to unexpected results.
++*%
++*% You may save this file as 'Fuji_Xerox-DocuPrint_CP105-foo2hbpl1.ppd'
++*%
++*%
++*FormatVersion:	"4.3"
++*FileVersion:	"1.1"
++*LanguageVersion: English 
++*LanguageEncoding: ISOLatin1
++*PCFileName:	"FOO2HBPL.PPD"
++*Manufacturer:	"Fuji Xerox"
++*Product:	"(DocuPrint CP105)"
++*cupsVersion:	1.0
++*cupsManualCopies: True
++*cupsModelNumber:  2
++*cupsFilter:	"application/vnd.cups-postscript 0 foomatic-rip"
++*%pprRIP:        foomatic-rip other
++*ModelName:     "Fuji Xerox DocuPrint CP105"
++*ShortNickName: "Fuji Xerox D.P. CP105 foo2hbpl1"
++*NickName:      "Fuji Xerox DocuPrint CP105 Foomatic/foo2hbpl1 (recommended)"
++*PSVersion:	"(3010.000) 550"
++*PSVersion:	"(3010.000) 651"
++*PSVersion:	"(3010.000) 652"
++*PSVersion:	"(3010.000) 653"
++*PSVersion:	"(3010.000) 704"
++*PSVersion:	"(3010.000) 705"
++*PSVersion:	"(3010.000) 800"
++*LanguageLevel:	"3"
++*ColorDevice:	True
++*DefaultColorSpace: RGB
++*FileSystem:	False
++*Throughput:	"1"
++*LandscapeOrientation: Plus90
++*TTRasterizer:	Type42
++*1284DeviceID: "DRV:Dfoo2hbpl1,R1,M0,TF;"
++
++*driverName foo2hbpl1/foo2hbpl1: ""
++*driverType F/Filter: ""
++*driverUrl: "http://foo2hbpl.rkkda.com/"
++*driverObsolete: False
++
++
++
++
++*HWMargins: 9 12.00 9 12
++*VariablePaperSize: True
++*MaxMediaWidth: 100000
++*MaxMediaHeight: 100000
++*NonUIOrderDependency: 135 AnySetup *CustomPageSize
++*CustomPageSize True: "pop pop pop pop pop
++%% FoomaticRIPOptionSetting: PageSize=Custom"
++*End
++*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
++*ParamCustomPageSize Width: 1 points 36 100000
++*ParamCustomPageSize Height: 2 points 36 100000
++*ParamCustomPageSize Orientation: 3 int 0 0
++*ParamCustomPageSize WidthOffset: 4 points 0 0
++*ParamCustomPageSize HeightOffset: 5 points 0 0
++
++*FoomaticIDs: Fuji_Xerox-DocuPrint_CP105 foo2hbpl1
++*FoomaticRIPCommandLine: "foo2hbpl1-wrapper %A"
++
++*OpenGroup: General/General
++
++*OpenUI *Quality/Printing Quality: PickOne
++*FoomaticRIPOption Quality: enum CmdLine A
++*OrderDependency: 110 AnySetup *Quality
++*DefaultQuality: normal
++*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
++*FoomaticRIPOptionSetting Quality=draft: " -t  "
++*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
++*FoomaticRIPOptionSetting Quality=normal: "  "
++*CloseUI: *Quality
++
++*OpenUI *ColorMode/Color Mode: PickOne
++*FoomaticRIPOption ColorMode: enum CmdLine A
++*OrderDependency: 120 AnySetup *ColorMode
++*DefaultColorMode: Monochrome
++*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
++*FoomaticRIPOptionSetting ColorMode=Color: "-c "
++*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
++*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
++*CloseUI: *ColorMode
++
++*OpenUI *PageSize/Page Size: PickOne
++*FoomaticRIPOption PageSize: enum CmdLine A
++*OrderDependency: 135 AnySetup *PageSize
++*DefaultPageSize: Letter
++*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
++*FoomaticRIPOptionSetting PageSize=Letter: "-p4 "
++*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
++*FoomaticRIPOptionSetting PageSize=A4: "-p1 "
++*PageSize B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
++*FoomaticRIPOptionSetting PageSize=B5jis: "-p2 "
++*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
++*FoomaticRIPOptionSetting PageSize=Env10: "-p9 "
++*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
++*FoomaticRIPOptionSetting PageSize=EnvC5: "-p11 "
++*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
++*FoomaticRIPOptionSetting PageSize=EnvDL: "-p12 "
++*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
++*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p10 "
++*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
++*FoomaticRIPOptionSetting PageSize=Executive: "-p5 "
++*PageSize FanfoldGermanLegal/Fanfold German Legal: "%% FoomaticRIPOptionSetting: PageSize=FanfoldGermanLegal"
++*FoomaticRIPOptionSetting PageSize=FanfoldGermanLegal: "-p6 "
++*PageSize Folio/Folio: "%% FoomaticRIPOptionSetting: PageSize=Folio"
++*FoomaticRIPOptionSetting PageSize=Folio: "-p6 "
++*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
++*FoomaticRIPOptionSetting PageSize=Legal: "-p7 "
++*CloseUI: *PageSize
++
++*OpenUI *PageRegion: PickOne
++*OrderDependency: 135 AnySetup *PageRegion
++*DefaultPageRegion: Letter
++*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
++*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
++*PageRegion B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
++*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
++*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
++*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
++*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
++*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
++*PageRegion FanfoldGermanLegal/Fanfold German Legal: "%% FoomaticRIPOptionSetting: PageSize=FanfoldGermanLegal"
++*PageRegion Folio/Folio: "%% FoomaticRIPOptionSetting: PageSize=Folio"
++*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
++*CloseUI: *PageRegion
++
++*DefaultImageableArea: Letter
++*ImageableArea Letter/Letter: "9 12.00 603 780.00"
++*ImageableArea A4/A4: "9 12.00 586 830.00"
++*ImageableArea B5jis/B5 (JIS): "9 12.00 509 715.00"
++*ImageableArea Env10/Env #10: "9 12.00 288 672.00"
++*ImageableArea EnvC5/Env C5: "9 12.00 450 637.00"
++*ImageableArea EnvDL/Env DL: "9 12.00 302 611.00"
++*ImageableArea EnvMonarch/Env Monarch: "9 12.00 270 528.00"
++*ImageableArea Executive/Executive: "9 12.00 513 744.00"
++*ImageableArea FanfoldGermanLegal/Fanfold German Legal: "9 12.00 603 996.00"
++*ImageableArea Folio/Folio: "9 12.00 603 924.00"
++*ImageableArea Legal/Legal: "9 12.00 603 996.00"
++
++*DefaultPaperDimension: Letter
++*PaperDimension Letter/Letter: "612 792"
++*PaperDimension A4/A4: "595 842"
++*PaperDimension B5jis/B5 (JIS): "518 727"
++*PaperDimension Env10/Env #10: "297 684"
++*PaperDimension EnvC5/Env C5: "459 649"
++*PaperDimension EnvDL/Env DL: "311 623"
++*PaperDimension EnvMonarch/Env Monarch: "279 540"
++*PaperDimension Executive/Executive: "522 756"
++*PaperDimension FanfoldGermanLegal/Fanfold German Legal: "612 1008"
++*PaperDimension Folio/Folio: "612 936"
++*PaperDimension Legal/Legal: "612 1008"
++
++*OpenUI *MediaType/Media Type: PickOne
++*FoomaticRIPOption MediaType: enum CmdLine A
++*OrderDependency: 150 AnySetup *MediaType
++*DefaultMediaType: plain
++*MediaType plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=plain"
++*FoomaticRIPOptionSetting MediaType=plain: "-m1 "
++*MediaType plain2/Plain Paper Side 2: "%% FoomaticRIPOptionSetting: MediaType=plain2"
++*FoomaticRIPOptionSetting MediaType=plain2: "-m8 "
++*MediaType bond/Bond: "%% FoomaticRIPOptionSetting: MediaType=bond"
++*FoomaticRIPOptionSetting MediaType=bond: "-m2 "
++*MediaType bond2/Bond Side 2: "%% FoomaticRIPOptionSetting: MediaType=bond2"
++*FoomaticRIPOptionSetting MediaType=bond2: "-m9 "
++*MediaType envelope/Envelope: "%% FoomaticRIPOptionSetting: MediaType=envelope"
++*FoomaticRIPOptionSetting MediaType=envelope: "-m6 "
++*MediaType labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=labels"
++*FoomaticRIPOptionSetting MediaType=labels: "-m5 "
++*MediaType lwcard/Light Weight Card: "%% FoomaticRIPOptionSetting: MediaType=lwcard"
++*FoomaticRIPOptionSetting MediaType=lwcard: "-m3 "
++*MediaType lwcard2/Light Weight Card Side 2: "%% FoomaticRIPOptionSetting: MediaType=lwcard2"
++*FoomaticRIPOptionSetting MediaType=lwcard2: "-m10 "
++*MediaType lwgcard/Light Weight Glossy Card: "%% FoomaticRIPOptionSetting: MediaType=lwgcard"
++*FoomaticRIPOptionSetting MediaType=lwgcard: "-m4 "
++*MediaType lwgcard2/Light Weight Glossy Card Side 2: "%% FoomaticRIPOptionSetting: MediaType=lwgcard2"
++*FoomaticRIPOptionSetting MediaType=lwgcard2: "-m11 "
++*MediaType recycled/Recycled Paper: "%% FoomaticRIPOptionSetting: MediaType=recycled"
++*FoomaticRIPOptionSetting MediaType=recycled: "-m7 "
++*MediaType recycled2/Recycled Paper Side 2: "%% FoomaticRIPOptionSetting: MediaType=recycled2"
++*FoomaticRIPOptionSetting MediaType=recycled2: "-m12 "
++*CloseUI: *MediaType
++
++*OpenUI *Copies/Copies: PickOne
++*FoomaticRIPOption Copies: int CmdLine A
++*FoomaticRIPOptionPrototype Copies: "-n%s "
++*FoomaticRIPOptionRange Copies: 1 100
++*OrderDependency: 220 AnySetup *Copies
++*DefaultCopies: 1
++*FoomaticRIPDefaultCopies: 1
++*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
++*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
++*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
++*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
++*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
++*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
++*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
++*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
++*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
++*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
++*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
++*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
++*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
++*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
++*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
++*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
++*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
++*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
++*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
++*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
++*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
++*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
++*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
++*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
++*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
++*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
++*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
++*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
++*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
++*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
++*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
++*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
++*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
++*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
++*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
++*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
++*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
++*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
++*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
++*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
++*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
++*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
++*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
++*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
++*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
++*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
++*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
++*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
++*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
++*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
++*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
++*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
++*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
++*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
++*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
++*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
++*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
++*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
++*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
++*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
++*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
++*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
++*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
++*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
++*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
++*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
++*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
++*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
++*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
++*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
++*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
++*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
++*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
++*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
++*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
++*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
++*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
++*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
++*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
++*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
++*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
++*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
++*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
++*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
++*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
++*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
++*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
++*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
++*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
++*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
++*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
++*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
++*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
++*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
++*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
++*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
++*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
++*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
++*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
++*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
++*CloseUI: *Copies
++
++*CloseGroup: General
++
++*OpenGroup: Adjustment/Adjustment
++
++*OpenUI *halftone/Halftone Algorithm: PickOne
++*FoomaticRIPOption halftone: enum CmdLine A
++*OrderDependency: 110 AnySetup *halftone
++*Defaulthalftone: default
++*halftone default/Default: "%% FoomaticRIPOptionSetting: halftone=default"
++*FoomaticRIPOptionSetting halftone=default: "  "
++*halftone as/Accurate Screens (better): "%% FoomaticRIPOptionSetting: halftone=as"
++*FoomaticRIPOptionSetting halftone=as: " -qas  "
++*halftone standard/Standard: "%% FoomaticRIPOptionSetting: halftone=standard"
++*FoomaticRIPOptionSetting halftone=standard: " -q1  "
++*halftone wts/Well Tempered Screens (best): "%% FoomaticRIPOptionSetting: halftone=wts"
++*FoomaticRIPOptionSetting halftone=wts: " -qwts  "
++*CloseUI: *halftone
++
++*OpenUI *ICM/ICM Color Profile: PickOne
++*FoomaticRIPOption ICM: enum CmdLine A
++*OrderDependency: 300 AnySetup *ICM
++*DefaultICM: none
++*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
++*FoomaticRIPOptionSetting ICM=none: "-C10 -Gnone.icm "
++*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
++*FoomaticRIPOptionSetting ICM=testing: "-C10 -Gtesting.icm "
++*ICM testing2/File testing2.icm: "%% FoomaticRIPOptionSetting: ICM=testing2"
++*FoomaticRIPOptionSetting ICM=testing2: "-C10 -Gtesting2.icm "
++*ICM testing3/File testing3.icm: "%% FoomaticRIPOptionSetting: ICM=testing3"
++*FoomaticRIPOptionSetting ICM=testing3: "-C10 -Gtesting3.icm "
++*CloseUI: *ICM
++
++*CloseGroup: Adjustment
++
++*OpenGroup: Miscellaneous/Miscellaneous
++
++*OpenUI *NupOrient/N-up Orientation: PickOne
++*FoomaticRIPOption NupOrient: enum CmdLine A
++*OrderDependency: 200 AnySetup *NupOrient
++*DefaultNupOrient: port
++*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
++*FoomaticRIPOptionSetting NupOrient=land: "-ol "
++*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
++*FoomaticRIPOptionSetting NupOrient=port: " "
++*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
++*FoomaticRIPOptionSetting NupOrient=sea: "-os "
++*CloseUI: *NupOrient
++
++*OpenUI *NupPages/N-up Printing: PickOne
++*FoomaticRIPOption NupPages: enum CmdLine A
++*OrderDependency: 200 AnySetup *NupPages
++*DefaultNupPages: 1up
++*NupPages 1up/1-up: "%% FoomaticRIPOptionSetting: NupPages=1up"
++*FoomaticRIPOptionSetting NupPages=1up: " "
++*NupPages 2up/2-up: "%% FoomaticRIPOptionSetting: NupPages=2up"
++*FoomaticRIPOptionSetting NupPages=2up: "-2 "
++*NupPages 3up/3-up: "%% FoomaticRIPOptionSetting: NupPages=3up"
++*FoomaticRIPOptionSetting NupPages=3up: "-3 "
++*NupPages 4up/4-up: "%% FoomaticRIPOptionSetting: NupPages=4up"
++*FoomaticRIPOptionSetting NupPages=4up: "-4 "
++*NupPages 6up/6-up: "%% FoomaticRIPOptionSetting: NupPages=6up"
++*FoomaticRIPOptionSetting NupPages=6up: "-6 "
++*NupPages 8up/8-up: "%% FoomaticRIPOptionSetting: NupPages=8up"
++*FoomaticRIPOptionSetting NupPages=8up: "-8 "
++*NupPages 10up/10-up: "%% FoomaticRIPOptionSetting: NupPages=10up"
++*FoomaticRIPOptionSetting NupPages=10up: "-10 "
++*NupPages 12up/12-up: "%% FoomaticRIPOptionSetting: NupPages=12up"
++*FoomaticRIPOptionSetting NupPages=12up: "-12 "
++*NupPages 14up/14-up: "%% FoomaticRIPOptionSetting: NupPages=14up"
++*FoomaticRIPOptionSetting NupPages=14up: "-14 "
++*NupPages 15up/15-up: "%% FoomaticRIPOptionSetting: NupPages=15up"
++*FoomaticRIPOptionSetting NupPages=15up: "-15 "
++*NupPages 16up/16-up: "%% FoomaticRIPOptionSetting: NupPages=16up"
++*FoomaticRIPOptionSetting NupPages=16up: "-16 "
++*NupPages 18up/18-up: "%% FoomaticRIPOptionSetting: NupPages=18up"
++*FoomaticRIPOptionSetting NupPages=18up: "-18 "
++*CloseUI: *NupPages
++
++*CloseGroup: Miscellaneous
++
++
++*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
++
++*DefaultFont: Courier
++*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
++*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
++*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
++*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
++*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
++*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
++*Font Bookman-Light: Standard "(001.004S)" Standard ROM
++*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
++*Font Courier: Standard "(002.004S)" Standard ROM
++*Font Courier-Bold: Standard "(002.004S)" Standard ROM
++*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
++*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
++*Font Helvetica: Standard "(001.006S)" Standard ROM
++*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
++*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
++*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
++*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
++*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
++*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
++*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
++*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
++*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
++*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
++*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
++*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
++*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
++*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
++*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
++*Font Symbol: Special "(001.007S)" Special ROM
++*Font Times-Bold: Standard "(001.007S)" Standard ROM
++*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
++*Font Times-Italic: Standard "(001.007S)" Standard ROM
++*Font Times-Roman: Standard "(001.007S)" Standard ROM
++*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
++*Font ZapfDingbats: Special "(001.004S)" Standard ROM
++
+--- foo2zjs/README	2014-04-03 19:49:11.000000000 +0000
++++ foo2zjs/README	2014-03-25 10:49:40.000000000 +0000
+@@ -128,6 +128,17 @@
+ 	- Oki C5100n/C5150n/C5200n
+ 	- Oki C5500n/C5600n/C5800n
+ 
++    FOO2HBPL1
++    ---------
++    foo2hbpl1 converts Ghostscript pbmraw, pgmraw, ppmraw, or pamcmyk32
++    output formats to monochrome or color HBPL version 1 streams.
++
++	- Dell 1250c
++	- Dell C1660
++	- Dell C1760
++	- Epson AcuLaser C1700
++	- Fuji-Xerox DocuPrint CP105
++
+     FOO2HBPL2
+     ---------
+     foo2hbpl2 converts Ghostscript pbmraw, bitcmyk, or pksmraw output  for‐
+--- foo2zjs/README.in	2014-04-03 19:43:10.000000000 +0000
++++ foo2zjs/README.in	2014-03-25 10:49:27.000000000 +0000
+@@ -128,6 +128,17 @@
+ 	- Oki C5100n/C5150n/C5200n
+ 	- Oki C5500n/C5600n/C5800n
+ 
++    FOO2HBPL1
++    ---------
++    foo2hbpl1 converts Ghostscript pbmraw, pgmraw, ppmraw, or pamcmyk32
++    output formats to monochrome or color HBPL version 1 streams.
++
++	- Dell 1250c
++	- Dell C1660
++	- Dell C1760
++	- Epson AcuLaser C1700
++	- Fuji-Xerox DocuPrint CP105
++
+     FOO2HBPL2
+     ---------
+     foo2hbpl2 converts Ghostscript pbmraw, bitcmyk, or pksmraw output  for‐
+--- foo2zjs/foo2hbpl1-wrapper.1in	1970-01-01 00:00:00.000000000 +0000
++++ foo2zjs/foo2hbpl1-wrapper.1in	2014-03-24 12:30:14.000000000 +0000
+@@ -0,0 +1,240 @@
++'\" t
++.TH foo2hbpl1-wrapper 1 "${MODpage}" "foo2hbpl1-wrapper ${MODver}"
++#ifndef OLDGROFF
++#include "macros.man"
++#endif
++'\"==========================================================================
++'\"	MANUAL PAGE SOURCE
++'\"==========================================================================
++.SH NAME
++foo2hbpl1-wrapper \- Convert Postscript into a ZJS printer stream
++.SH SYNOPSIS
++.B foo2hbpl1-wrapper
++.RI [ options "] [" ps-file ]
++.SH DESCRIPTION
++.B foo2hbpl1-wrapper
++is a Foomatic compatible printer wrapper for the \fBfoo2hbpl1\fP printer driver.
++This script reads a Postscript \fIps-file\fP or standard input
++and converts it to Zenographics ZjStream printer format
++for driving the
++Dell 1250c, Dell C1660w, Dell C1760w,
++Epson AcuLaser C1700,
++and Fuji-Xerox CP105b printers.
++.P
++This script can be used in a standalone fashion, but is intended to
++be called from a printer spooler system which uses the Foomatic
++printer database.
++
++.SH COMMAND LINE OPTIONS
++.SS Normal Options
++These are the options used to select the parameters of a
++print job that are usually controlled on a per job basis.
++.TP
++.BI \-c
++Print in color (else monochrome).
++.TP
++.BI \-C\0 colormode
++Color correction mode [0].
++.TS
++n l .
++10	ICM color profile (using -G *.icm file)
++.TE
++.TP
++.BI \-d\0 duplex
++Duplex code to send to printer [1].
++.TS
++| n l | n l | n l .
++1	off	2	long edge	3	short edge
++.TE
++.TP
++.BI \-m\0 media
++Media code to send to printer [1].
++.TS
++l r.
++_
++Media	HBPL
++_
++plain	1
++bond	2
++lwcard	3
++lwgcard	4
++labels	5
++envelope	6
++recycled	7
++plain2	8
++bond2	9
++lwcard2	10
++lwgcard2	11
++recycled2	12
++.TE
++.TP
++.BI \-p\0 paper
++Paper size code to send to printer [1].
++.TS
++l r.
++_
++Paper	HBPL
++_
++A4	1
++B5jis	2
++letter	4
++executive	5
++fanfold german legal	6
++folio	6
++legal	7
++env#10	9
++envMonarch	10
++envC5	11
++envDL	12
++.TE
++.TP
++.BI \-n\0 copies
++Number of copies [1].
++.TP
++.BI \-r\0 xres x yres
++Set device resolution in pixels/inch [1200x600].
++.TP
++.BI \-s\0 source
++Source (Input Slot) code to send to printer [7].
++.TS
++| n l | n l.
++1	upper	4	manual
++2	lower	7	auto
++.TE
++.TP
++.BI \-t
++Draft mode.  Every other pixel is white.
++.TP
++.BI \-T\0 density
++Print density (1-5).  The default is 3 (medium).
++.TP
++.BI "\-2 \-3 \-4 \-5 \-6 \-8 \-9 \-10 \-12 \-14 \-15 \-16 \-18"
++Print in N-up.  Requires the \fBpsutils\fP package.
++.TP
++.BI \-o\0 orient
++Orientation used for N-up.
++.TS
++l l l.
++Portrait	-op	(normal)
++Landscape	-ol	(rotated 90 degrees anticlockwise)
++Seascape	-os	(rotated 90 degrees clockwise)
++.TE
++.SS Printer Tweaking Options
++These are the options used to customize the operation of \fBfoo2hbpl1\fP
++for a particular printer.
++.TP
++.BI \-u\0 xoff x yoff
++Set the offset of the start of the printable region from the
++upper left corner, in pixels [varies with paper size].
++The defaults should work on the 2200DL and 2300DL, and have not
++been tested on any other printers.
++.TP
++.BI \-l\0 xoff x yoff
++Set the offset of the end of the printable region from the
++lower right corner, in pixels [varies with paper size].
++The defaults should work on the 2200DL and 2300DL, and have not
++been tested on any other printers.
++.TP
++.BI \-L\0 mask
++Send the logical clipping values from -u/-l in the ZjStream.
++\fBfoo2hbpl1-wrapper\fP always runs Ghostscript with the ideal page dimensions,
++so that the scale of the image is correct,
++regardless whether or not the printer has unprintable regions.
++This option is used to move the position of the clipped image
++back to where it belongs on the page.  The default is to send
++the amount which was clipped by -u and -l, and should be
++good in most cases.
++.TS
++l l.
++0	don't send any logical clipping amounts
++1	only send Y clipping amount
++2	only send X clipping amount
++3	send both X and Y clipping amounts
++.TE
++.TP
++.BI \-P
++Do not send START_PLANE codes on monochrome output.  May be
++needed by some monochrome-only printers, such as the
++HP LaserJet 1000.
++.TP
++.BI \-X\0 padlen
++Add extra zero padding to the end of BID segments.  The default is
++16 bytes.  Padding 16 bytes of zeroes
++is needed for older ZjStream printers, such as the Minolta 2200DL
++and HP LaserJet 1000, and seems harmless to newer ones, such as
++the Minolta 2300DL.  So the default should be good for all cases.
++.SS Color Tweaking Options
++These are the options used to control the quality of color output.
++Color correction is currently a WORK IN PROGRESS.
++.TP
++.BI \-g\0 gsopts
++Additional options to pass to Ghostscript, such as -g\(lq-dDITHERPPI=nnn\(rq,
++etc.  This option may appear more than once.
++.TP
++.BI \-G\0 profile.icm
++Convert \fIprofile.icm\fP to a Postscript color rendering
++dictionary (CRD) using \fBfoo2zjs-icc2ps\fP and
++adjust the printer colors by using the Postscript \fBsetcolorrendering\fP
++operator.  (WORK IN PROGRESS).
++.TP
++.BI \-G\0 gamma-file.ps
++Prepend \fIgamma-file.ps\fP to the Postscript input to perform
++color correction using the \fBsetcolortransfer\fP Postscript operator.
++For example, the file might contain:
++.br
++{0.333 exp} {0.333 exp} {0.333 exp} {0.333 exp} setcolortransfer
++.TP
++.BI \-I\0 intent
++Select profile intent from the ICM file.
++0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute.
++Default is 0 (perceptual).
++.SS Debugging Options
++These options are used for debugging \fBfoo2hbpl1\fP and its wrapper.
++.TP
++.BI \-S\0 plane
++Output just a single color plane from a color print and print it
++on the black plane.  The default is to output all color planes.
++.TS
++l l.
++1	Cyan
++2	Magenta
++3	Yellow
++4	Black
++.TE
++.TP
++.BI \-D\0 level
++Set Debug level [0].
++
++.SH EXAMPLES
++Create a monochrome ZjStream from a Postscript document,
++examine it, and then print it using a RAW print queue:
++
++.RS
++.nf
++foo2hbpl1-wrapper testpage.ps > testpage.prn
++hbpl1decode < testpage.prn
++lpr -P raw testpage.prn
++.fi
++.RE
++.P
++Create a color ZjStream stream from a Postscript document:
++
++.RS
++.nf
++foo2hbpl1-wrapper -c testpage.ps > testpage.prn
++.fi
++.RE
++
++.SH FILES
++.BR /usr/bin/foo2hbpl1-wrapper
++.SH SEE ALSO
++.BR foo2hbpl1 (1),
++.BR hbpldecode (1)
++.SH "AUTHOR"
++Rick Richardson <rick.richardson@comcast.net>
++.br
++${URLHBPL}/
++'\"
++'\"
++'\"
++.em pdf_outline
+--- foo2zjs/foo2hbpl1-wrapper.in	1970-01-01 00:00:00.000000000 +0000
++++ foo2zjs/foo2hbpl1-wrapper.in	2014-04-04 19:06:24.048060000 +0000
+@@ -0,0 +1,577 @@
++#!/bin/sh
++
++#* Copyright (C) 2013 Rick Richardson
++#*
++#* This program is free software; you can redistribute it and/or modify
++#* it under the terms of the GNU General Public License as published by
++#* the Free Software Foundation; either version 2 of the License, or
++#* (at your option) any later version.
++#*
++#* This program is distributed in the hope that it will be useful,
++#* but WITHOUT ANY WARRANTY; without even the implied warranty of
++#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++#* GNU General Public License for more details.
++#*
++#* You should have received a copy of the GNU General Public License
++#* along with this program; if not, write to the Free Software
++#* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++#*
++#* Authors: Rick Richardson <rick.richardson@comcast.net>
++
++VERSION='$Id: foo2hbpl1-wrapper.in,v 1.3 2014/03/24 23:14:24 rick Exp $'
++
++#
++# Printer Notes:
++#
++# Dell 1250c
++# Dell C1660w
++# Dell C1760w
++# Epson AcuLaser C1700
++# Fuji-Xerox DocuPrint CP105b
++#
++
++PROGNAME="$0"
++BASENAME=`basename $PROGNAME`
++PREFIX=/usr
++SHARE=$PREFIX/share/foo2hbpl
++PATH=$PATH:/sw/bin:/opt/local/bin
++
++#
++#	Log the command line, for debugging and problem reports
++#
++if [ -x /usr/bin/logger -o -x /bin/logger ]; then
++    logger -t "$BASENAME" -p lpr.info -- "$BASENAME $@" </dev/null
++fi
++
++usage() {
++	cat <<EOF
++Usage:
++	$BASENAME [options] [ps-file]
++
++	Foomatic printer wrapper for the foo2hbpl1 printer driver.
++	This script reads a Postscript ps-file or standard input
++	and converts it to a Xerox HBPL version 1 stream.
++
++Normal Options:
++-c		  Print in color (else monochrome)
++-C colormode	  Colormode [$COLORMODE]
++		    10=ICM RGB color profile (using -G *.icm file)
++-m media	  Media code to send to printer [$MEDIA]
++		    1=plain, 2=bond, 3=lwcard, 4=lwgcard, 5=labels,
++		    6=envelope, 7=recycled, 8=plain2, 9=bond2,
++		    10=lwcard2, 11=lwgcard2, 12=recycled2
++-p paper	  Paper code [$PAPER]
++		    letter, legal, a4, executive, env10, monarch,
++		    c5, envDL, isob5, jisb5, a5, folio, CustomWxH
++-n copies	  Number of copies [$COPIES]
++		  Resolution is always 600x600
++-t		  Draft mode.  Every other pixel is white.
++-2/-3/-4/-6/-8/-10/-12/-14/-15/-16/-18
++		  Print with N-up (requires psutils)
++-o orient	  For N-up: -op is portrait, -ol is landscape, -os is seascape.
++
++Printer Tweaking Options:
++-u left,top,right,bottom
++		  Clip (i.e. white-out) margins of specified width
++
++Color Tweaking Options:
++-g gsopts	  Additional options to pass to Ghostscript, such as
++		  -dDITHERPPI=nnn, etc.  May appear more than once. []
++-G profile.icm	  Convert profile.icm to a Postscript CRD using icc2ps and
++		  adjust colors using the setcolorrendering PS operator.
++		  $SHARE/icm/ will be searched for profile.icm.
++-I intent	  Select profile intent from ICM file [$INTENT]
++		  0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute
++-G gamma-file.ps  Prepend gamma-file to the Postscript input to perform
++		  color correction using the setcolortransfer PS operator.
++
++Debugging Options:
++-D lvl		  Set Debug level [$DEBUG]
++-V		  $VERSION
++EOF
++
++	exit 1
++}
++
++#
++#       Report an error and exit
++#
++error() {
++	echo "$BASENAME: $1" >&2
++	exit 1
++}
++
++dbgcmd() {
++	if [ $DEBUG -ge 1 ]; then
++	    echo "$@" >&2
++	fi
++	"$@"
++}
++
++#
++#	N-up-ify the job.  Requires psnup from psutils package
++#
++nup() {
++    case "$NUP" in
++    [2368]|1[0458])
++	tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.3in -p$paper -q
++	;;
++    [49]|1[26])
++	tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.5in -p$paper -q
++	;;
++    *)
++	error "Illegal call to nup()."
++	;;
++    esac
++}
++
++#
++#       Process the options
++#
++
++# Try to use a local copy of GhostScript 8.54, if available.  Otherwise,
++# fallback to whatever the Linux distro has installed (usually 7.07)
++#
++# N.B. := operator used here, when :- would be better, because "ash"
++# doesn't have :-
++if eval gs.foo -v >/dev/null 2>&1; then
++        GSBIN=${GSBIN:-gs.foo}
++else
++        GSBIN=${GSBIN:-gs}
++fi
++
++CMDLINE="$*"
++DEBUG=0
++COLOR=
++COLORMODE=default
++MODEL=0
++MEDIA=1		# plain
++COPIES=1
++PAPER=letter
++RES=600x600	# do not change this
++SOURCE=1
++NUP=
++CLIP_ALL=
++BC=
++AIB=
++NOPLANES=
++COLOR2MONO=
++GAMMAFILE=default
++INTENT=0
++GSOPTS=
++EXTRAPAD=
++SAVETONER=
++NUP_ORIENT=
++GSDEV=-sDEVICE=pgmraw
++# What mode to use if the user wants us to pick the "best" mode
++case `$GSBIN --version` in
++7*)	DEFAULTCOLORMODE=10
++	DEFAULTCOLORMODE=1
++	;;
++8.1*)
++	DEFAULTCOLORMODE=1
++	QUALITY=1
++	;;
++*)	DEFAULTCOLORMODE=1
++	;;
++esac
++while getopts "1:23456789o:b:cC:d:g:l:u:L:m:n:p:q:s:tz:ABS:D:G:I:PX:Vh?" opt
++do
++	case $opt in
++	b)	GSBIN="$OPTARG";;
++	c)	COLOR=-c;;
++	d)	DUPLEX="$OPTARG";;
++	g)	GSOPTS="$GSOPTS $OPTARG";;
++	m)	MEDIA="$OPTARG";;
++	n)	COPIES="$OPTARG";;
++	p)	PAPER="$OPTARG";;
++	q)	QUALITY="$OPTARG";;
++	s)	SOURCE="$OPTARG";;
++	t)	SAVETONER="-t";;
++	z)	MODEL="$OPTARG";;
++	u)	CLIP_ALL="-u $OPTARG";;
++	A)	AIB=-A;;
++	B)	BC=-B;;
++	C)	COLORMODE="$OPTARG";;
++	S)	COLOR2MONO="-S$OPTARG";;
++	D)	DEBUG="$OPTARG";;
++	G)	GAMMAFILE="$OPTARG";;
++	I)	INTENT="$OPTARG";;
++	P)	NOPLANES=-P;;
++	X)	EXTRAPAD="-X $OPTARG";;
++	[234689])	NUP="$opt";;
++	[57])	error "Can't find acceptable layout for $opt-up";;
++	1)	case "$OPTARG" in
++		[024568])	NUP="1$OPTARG";;
++		*)	error "Can't find acceptable layout for 1$OPTARG-up";;
++		esac
++		;;
++	o)	case "$OPTARG" in
++		l*)	NUP_ORIENT=-l;;
++		s*)	NUP_ORIENT=-r;;
++		p*|*)	NUP_ORIENT=;;
++		esac;;
++	V)	echo "$VERSION"; foo2hbpl -V; foo2zjs-pstops -V; exit 0;;
++	h|\?)
++		if [ "$CMDLINE" != "-?" -a "$CMDLINE" != -h ]; then
++		    echo "Illegal command:"
++		    echo "	$0 $CMDLINE"
++		    echo
++		fi
++		usage;;
++	esac
++done
++shift `expr $OPTIND - 1`
++
++#
++# If there is an argument left, take it as the file to print.
++# Else, the input comes from stdin.
++#
++if [ $# -ge 1 ]; then
++    if [ "$LPJOB" = "" ]; then
++	: # LPJOB="$1"
++    fi
++    exec < $1
++fi
++
++#
++#	Validate media code
++#
++case "$MEDIA" in
++1|plain)	MEDIA=1;;
++2|bond)		MEDIA=2;;
++3|lwcard)	MEDIA=3;;
++4|lwgcard)	MEDIA=4;;
++5|labels)	MEDIA=5;;
++6|envelope)	MEDIA=6;;
++7|recycled)	MEDIA=7;;
++8|plain2)	MEDIA=8;;
++9|bond2)	MEDIA=9;;
++10|lwcard2)	MEDIA=10;;
++11|lwgcard2)	MEDIA=11;;
++12|recycled2)	MEDIA=12;;
++[0-9]*)		;;
++*)		error "Unknown media code $MEDIA";;
++esac
++
++#
++#	Validate source (InputSlot) code
++#
++case "$SOURCE" in
++1|auto)		SOURCE=1;;
++2|manual)	SOURCE=2;;
++3|multi)	SOURCE=3;;
++4|tray1)	SOURCE=4;;
++[0-9]*)		;;
++*)		error "Unknown source code $SOURCE";;
++esac
++
++#
++#	Figure out the paper dimensions in pixels/inch, and set the
++#	default clipping region.  Unfortunately, this is a trouble
++#	area for ZjStream printers.  Various versions of ZjS print
++#	engines react differently when asked to print into their
++#	unprintable regions.
++#
++set_clipping() {
++
++    # Set clipping region if it isn't already set
++    if [ "$CLIP_ALL" = "" ]; then
++	CLIP_ALL="-u $1,$2,$3,$4"
++    fi
++}
++
++case "$PAPER" in
++Custom*x*)
++		# Command line only
++		XDIM=`echo "$PAPER" | sed -e "s/Custom.//" -e "s/x.*//" `
++		YDIM=`echo "$PAPER" | sed -e "s/.*x//" `
++		if [ "$XDIM" = "" -o "$YDIM" = "" ]; then
++		    error "Custom page size '$PAPER' != 1-99999"
++		fi
++		if [ "$XDIM" -eq 0 -o "$YDIM" -eq 0 ]; then
++		    error "Custom page size '$PAPER' != 1-99999"
++		fi
++		XDIM=`dc -e "$XDIM 600* 72/p"`
++		YDIM=`dc -e "$YDIM 600* 72/p"`
++		PAPER=21;        paper=letter;
++		DIM="${XDIM}x${YDIM}"
++		;;
++Custom*)
++		#%%BeginFeature: *CustomPageSize True
++		#216
++		#360
++		#0
++		#0
++		#0
++		#pop pop pop pop pop
++
++		#%%BeginFeature: *CustomPageSize True
++		#792.000000 612.000000 1 0.000000 0.000000
++		#pop pop pop pop pop
++
++		if [ $DEBUG = 0 ]; then
++		    TMPFILE=/tmp/cus$$
++		else
++		    TMPFILE=/tmp/custom.ps
++		fi
++		cat >$TMPFILE
++		exec <$TMPFILE
++
++		tmp=`head -n 10000 $TMPFILE \
++		    | sed -n '/CustomPageSize/{n;p;n;p;}' \
++		    | tr '\n' ' '`
++		case "$tmp" in
++		[0-9]*\ [0-9]*)
++		    XDIM=`echo "$tmp" | sed 's/ .*//'`
++		    YDIM=`echo "$tmp" | sed -e 's/^[^ ]* //' -e 's/ .*//'`
++		    ;;
++		*)
++		    if [ $DEBUG = 0 ]; then rm -f $TMPFILE; fi
++		    error "Custom page size [XY]DIM != 1-99999"
++		    ;;
++		esac
++		XDIM=`dc -e "$XDIM 600* 72/p"`
++		YDIM=`dc -e "$YDIM 600* 72/p"`
++		PAPER=21;        paper=letter;
++		DIM="${XDIM}x${YDIM}"
++		;;
++
++# Use names that Ghostscript recognizes, referring to
++# /usr/share/ghostscript/9.10/Resource/Init/gs_statd.ps
++# foo2hbpl1 will provide the appropriate numeric value
++
++letter)		DIM=5100x6600  ;;
++legal)		DIM=5100x8400  ;;
++a4)		DIM=4961x7016  ;;
++executive)	DIM=4350x6300  ;;
++env10)		DIM=2475x5700  ;;
++monarch)	DIM=2325x4500  ;;
++c5)		DIM=3827x5409  ;;
++envDL)		DIM=2599x5197  ;;
++isob5|b5)	DIM=4158x5906  ;;
++jisb5)		DIM=4299x6071  ;;
++a5)		DIM=3496x4961  ;;
++folio)		DIM=5100x7800  ;;
++pa4)		DIM=4961x6600  ;;
++archA)		DIM=5400x7200  ;;
++*)		error "Unimplemented paper code $PAPER";;
++esac
++
++#set_clipping 47 48 51 46	# exact values for Dell C1660w on letter paper
++ set_clipping 51 51 51 51	# default is 0.085 inches all around
++
++PAPERSIZE="-sPAPERSIZE=$PAPER";
++
++#
++# Filter thru psnup if N-up printing has been requested
++#
++case $NUP in
++[234689]|1[024568])	PREFILTER="nup";;
++*)			PREFILTER=cat;;
++esac
++if [ "$DEBUG" -ge 9 ]; then
++    PREFILTER="tee /tmp/$BASENAME.ps"
++fi
++
++#
++#	Overload -G.  If the file name ends with ".icm" or ".ICM"
++#	then convert the ICC color profile to a Postscript CRD,
++#	then prepend it to the users job.  Select the intent
++#	using the -I option.
++#
++
++create_crd() {
++    #
++    # Create a Postscript CRD
++    #
++    ICC2PS=$PREFIX/bin/foo2zjs-icc2ps
++    if [ -x $ICC2PS ]; then
++	case "$GAMMAFILE" in
++	none | none.icm | */none.icm)
++	    ;;
++	*)
++	    if [ -x /usr/bin/logger ]; then
++		logger -t "$BASENAME" -p lpr.info -- \
++		"`basename $ICC2PS` -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps"
++	    fi
++	    $ICC2PS -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps 2>$ICCTMP.log \
++		|| error "Problem converting .ICM file to Postscript"
++	    ;;
++	esac
++
++	PSTOPS_OPTS="$PSTOPS_OPTS -c"
++	cat > $ICCTMP.usecie.ps <<-EOF
++		%!PS-Adobe-3.0
++		<</UseCIEColor true>>setpagedevice
++	EOF
++	if [ "$QUALITY" = wts -o "$QUALITY" = as ]; then
++	    if [ "$QUALITY" = wts ]; then
++		cat >> $ICCTMP.usecie.ps <<-EOF
++		    << /UseWTS true >> setuserparams
++		EOF
++	    else
++		cat >> $ICCTMP.usecie.ps <<-EOF
++		    << /UseWTS false >> setuserparams
++		EOF
++	    fi
++	    cat >> $ICCTMP.usecie.ps <<-EOF
++		<<
++		    /AccurateScreens true
++		    /HalftoneType 1
++		    /HalftoneName (Round Dot Screen) cvn
++		    /SpotFunction { 180 mul cos exch 180 mul cos add 2 div}
++		    /Frequency 137
++		    /Angle 37
++		>> sethalftone
++		EOF
++	fi
++	cat > $ICCTMP.selcrd.ps <<-EOF
++		/Current /ColorRendering findresource setcolorrendering
++	EOF
++	case "$GAMMAFILE" in
++	none | none.icm | */none.icm) GAMMAFILE="$ICCTMP.usecie.ps";;
++	*)	GAMMAFILE="$ICCTMP.usecie.ps $ICCTMP.crd.ps $ICCTMP.selcrd.ps";;
++	esac
++    else
++	GAMMAFILE=
++    fi
++}
++
++if [ $DEBUG -gt 0 ]; then
++    ICCTMP=/tmp/icc
++else
++    ICCTMP=/tmp/icc$$
++fi
++
++if [ "" = "$COLOR" ]; then
++    COLORMODE=
++    GAMMAFILE=
++else
++    case "$COLORMODE" in
++    default)	COLORMODE=$DEFAULTCOLORMODE;;
++    esac
++    case "$GAMMAFILE" in
++    default)	GAMMAFILE=samclp300-0.icm;;
++    esac
++fi
++
++CRDBASE="$PREFIX/share/foo2hbpl/crd"
++case "$MODEL" in
++    0)	model=CLP-300;;
++    1)	model=CLP-600;;
++    2)	model=CLP-600;;
++    3)	model=CLP-600;;
++esac
++
++PSTOPS_OPTS="-n"
++
++case "$COLORMODE" in
++0|"")
++    # Monochrome
++    ;;
++10|icm)
++    # Use old ICM method
++    AIB=-A
++    BC=-B
++    case "$GAMMAFILE" in
++    none | none.icm | */none.icm)
++	create_crd
++	;;
++    *.icm|*.ICM|*.icc|*.ICC)
++	#
++	# Its really an .ICM file, not a gamma file.
++	#
++	# The file can be a full path name, or the name of a file in $SHARE/icm/
++	#
++	if [ -r "$GAMMAFILE" ]; then
++	    create_crd
++	elif [ -r "$SHARE/icm/$GAMMAFILE" ]; then
++	    GAMMAFILE="$SHARE/icm/$GAMMAFILE"
++	    create_crd
++	else
++	    GAMMAFILE=
++	fi
++	;;
++    esac
++    ;;
++1|crd)
++    # CRD
++    GAMMAFILE=""
++    GAMMAFILE="$GAMMAFILE $CRDBASE/${model}cms"
++    GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN"
++    # Black text...
++    TMPFILE2=/tmp/black$$
++    cat $CRDBASE/black-text.ps - >$TMPFILE2
++    exec <$TMPFILE2
++    ;;
++*.crd)
++    GAMMAFILE="$CRDBASE/prolog.ps"
++    if [ -f $COLORMODE ]; then
++	GAMMAFILE="$GAMMAFILE $COLORMODE"
++    elif [ -f $CRDBASE/$COLORMODE ]; then
++	GAMMAFILE="$GAMMAFILE $CRDBASE/$COLORMODE"
++    else
++	error "Can't find CRD '$COLORMODE' in . or in $CRDBASE"
++    fi
++    GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN"
++    ;;
++*)
++    error "Unknown color method '$COLORMODE'"
++    ;;
++esac
++
++if [ "" != "$COLOR" ]; then
++    GSDEV=-sDEVICE=pamcmyk32
++    $GSBIN --help | grep -q pamcmyk32 || GSDEV=-sDEVICE=ppmraw
++fi
++
++#
++#	Figure out USERNAME
++#
++if [ "$LPUSER" != "" ]; then
++    USER="$LPUSER@$LPHOST"
++else
++    USER=""
++fi
++
++#
++#	Main Program, just cobble together the pipeline and run it
++#
++#	The malarky with file descriptors 1 and 3 is to avoid a bug in
++#	(some versions?) of Ghostscript where Postscript's stdout gets
++#	intermingled with the printer drivers output, resulting in
++#	corrupted image data.
++#
++GS="$GSBIN -q -dBATCH -dSAFER -dQUIET -dNOPAUSE"
++
++foo2zjs-pstops $PSTOPS_OPTS | \
++$PREFILTER \
++| ($GS $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS \
++    -sOutputFile="|cat 1>&3" $GAMMAFILE -_ >/dev/null) 3>&1 \
++| foo2hbpl1 -m$MEDIA $CLIP_ALL -J "$LPJOB" -U "$USER"
++
++#
++#	Log the command line, for debugging and problem reports
++#
++if [ -x /usr/bin/logger ]; then
++    logger -t "$BASENAME" -p lpr.info -- \
++	"$GSBIN $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS $GAMMAFILE"
++    logger -t "$BASENAME" -p lpr.info -- \
++	"foo2hbpl1 -m$MEDIA $CLIP_ALL"
++fi
++
++#
++#	Remove cruft
++#
++if [ $DEBUG -eq 0 ]; then
++    for i in crd.ps log usecie.ps selcrd.ps
++    do
++	file="$ICCTMP.$i"
++	[ -f $file ] && rm -f $file
++    done
++    [ -f "$TMPFILE" ] && rm -f $TMPFILE
++    [ -f "$TMPFILE2" ] && rm -f $TMPFILE2
++fi
++
++exit 0
+--- foo2zjs/foo2hbpl1.1in	1970-01-01 00:00:00.000000000 +0000
++++ foo2zjs/foo2hbpl1.1in	2014-03-24 12:30:14.000000000 +0000
+@@ -0,0 +1,68 @@
++'\" t
++.TH foo2hbpl1 1 "${MODpage}" "foo2hbpl1 ${MODver}"
++#ifndef OLDGROFF
++#include "macros.man"
++#endif
++'\"==========================================================================
++'\"	MANUAL PAGE SOURCE
++'\"==========================================================================
++.SH NAME
++foo2hbpl1 \- Convert Ghostscript output to an HBPLv1 printer stream
++.SH SYNOPSIS
++.B foo2hbpl1
++.RI [ options "] <" pnm-or-pam-file " >" hbpl1-file
++.SH DESCRIPTION
++.B foo2hbpl1
++converts Ghostscript pbmraw, pgmraw, ppmraw, or pamcmyk32 output
++formats to monochrome or color HBPL version 1 streams, to drive the
++Dell 1250c, Dell C1660w, Dell C1760w,
++Epson AcuLaser C1700,
++and Fuji-Xerox CP105b printers.
++
++.SH COMMAND LINE OPTIONS
++.TP
++.BI \-J\0 filename
++Filename string to send to printer.
++.TP
++.BI \-U\0 username
++Username string to send to printer.
++.SH EXAMPLES
++Create a black and white ZJS stream:
++
++.RS
++.nf
++gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ 
++    -sPAPERSIZE=letter -r600x600 -sDEVICE=pgmraw \ 
++    -sOutputFile=- - < testpage.ps \ 
++| foo2hbpl1 >testpage.zm
++.fi
++.RE
++.P
++Create a color ZJS stream:
++
++.RS
++.nf
++gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ 
++    -sPAPERSIZE=letter -g5100x6600 -r600x600 -sDEVICE=pamcmyk32 \ 
++    -sOutputFile=- - < testpage.ps \ 
++| foo2hbpl1 >testpage.zc
++.fi
++.RE
++
++.SH FILES
++.BR /usr/bin/foo2hbpl1
++.SH SEE ALSO
++.BR foo2hbpl1-wrapper (1),
++.BR hbpldecode (1)
++.SH "AUTHOR"
++Rick Richardson <rick.richardson@comcast.net>
++.br
++Peter Korf <peter@niendo.de>
++.br
++Dave Coffin <dcoffin@cybercom.net>
++.br
++${URLHBPL}/
++'\"
++'\"
++'\"
++.em pdf_outline
+--- foo2zjs/foo2hbpl1.c	1970-01-01 00:00:00.000000000 +0000
++++ foo2zjs/foo2hbpl1.c	2014-04-04 18:18:29.692060000 +0000
+@@ -0,0 +1,692 @@
++/*
++
++GENERAL
++This program converts bilevel PBM, 8-bit PGM, 24-bit PPM, and 32-bit
++CMYK PAM files (output by Ghostscript as "pbmraw", "pgmraw", "ppmraw",
++and "pamcmyk32" respectively) to HBPL version 1 for the consumption
++of various Dell, Epson, and Fuji-Xerox printers.
++
++With this utility, you can print to some Dell and Fuji printers, such as these:
++    - Dell 1250c			B/W and Color
++    - Dell C1660			B/W and Color
++    - Dell C1760			B/W and Color
++    - Epson AcuLaser C1700		B/W and Color
++    - Fuji-Xerox DocuPrint CP105	B/W and Color
++
++AUTHORS
++This program was originally written by Dave Coffin in March 2014.
++
++LICENSE
++This program is free software; you can redistribute it and/or modify
++it under the terms of the GNU General Public License as published by
++the Free Software Foundation; either version 2 of the License, or (at
++your option) any later version.
++
++This program is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with this program; if not, write to the Free Software
++Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++
++If you want to use this program under different license conditions,
++then contact the author for an arrangement.
++
++*/
++
++static char Version[] = "$Id: foo2hbpl1.c,v 1.3 2014/03/30 05:08:32 rick Exp $";
++
++#include <time.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <ctype.h>
++#include <string.h>
++#include <unistd.h>
++#include <stdarg.h>
++#ifdef linux
++    #include <sys/utsname.h>
++#endif
++
++/*
++ * Command line options
++ */
++int	MediaCode = 0;
++char	*Username = NULL;
++char	*Filename = NULL;
++int	Clip[] = { 8,8,8,8 };
++
++void
++usage(void)
++{
++    fprintf(stderr,
++"Usage:\n"
++"   foo2hbpl1 [options] <pamcmyk32-file >hbpl-file\n"
++"\n"
++"	Convert Ghostscript pbmraw, pgmraw, ppmraw, or pamcmyk32\n"
++"	format to HBPLv1, for the Dell C1660w and other printers.\n"
++"\n"
++"	gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \\ \n"
++"		-sPAPERSIZE=letter -r600x600 -sDEVICE=pamcmyk32 \\ \n"
++"		-sOutputFile=- - < testpage.ps \\ \n"
++"	| foo2hbpl1 >testpage.zc\n"
++"\n"
++"Options:\n"
++"-m media	Media code to send to printer [1 or 6]\n"
++"		  1=plain, 2=bond, 3=lwcard, 4=lwgcard, 5=labels,\n"
++"		  6=envelope, 7=recycled, 8=plain2, 9=bond2,\n"
++"		  10=lwcard2, 11=lwgcard2, 12=recycled2\n"
++"-u left,top,right,bottom\n"
++"		Erase margins of specified width [%d,%d,%d,%d]\n"
++"-J filename	Filename string to send to printer\n"
++"-U username	Username string to send to printer\n"
++"-V		Version %s\n"
++	, Clip[0], Clip[1], Clip[2], Clip[3]
++	, Version);
++}
++
++void
++error(int fatal, char *fmt, ...)
++{
++    va_list ap;
++
++    va_start(ap, fmt);
++    vfprintf(stderr, fmt, ap);
++    va_end(ap);
++
++    if (fatal) exit(fatal);
++}
++
++struct stream
++{
++    unsigned char *buf;
++    int size, off, bits;
++};
++
++void
++putbits(struct stream *s, unsigned val, int nbits)
++{
++    if (s->off + 16 > s->size &&
++	!(s->buf = realloc(s->buf, s->size += 0x100000)))
++	    error (1, "Out of memory\n");
++    if (s->bits)
++    {
++	s->off--;
++	val |= s->buf[s->off] >> (8-s->bits) << nbits;
++	nbits += s->bits;
++    }
++    s->bits = nbits & 7;
++    while ((nbits -= 8) > 0)
++	s->buf[s->off++] = val >> nbits;
++    s->buf[s->off++] = val << -nbits;
++}
++
++/*
++   Runlengths are integers between 1 and 17057 encoded as follows:
++
++	1	00
++	2	01 0
++	3	01 1
++	4	100 0
++	5	100 1
++	6	101 00
++	7	101 01
++	8	101 10
++	9	101 11
++	10	110 0000
++	11	110 0001
++	12	110 0010
++	   ...
++	25	110 1111
++	26	111 000 000
++	27	111 000 001
++	28	111 000 010
++	29	111 000 011
++	   ...
++	33	111 000 111
++	34	111 001 000
++	   ...
++	41	111 001 111
++	42	111 010 000
++	50	111 011 0000
++	66	111 100 00000
++	98	111 101 000000
++	162	111 110 000000000
++	674	111 111 00000000000000
++	17057	111 111 11111111111111
++*/
++void
++put_len(struct stream *s, unsigned val)
++{
++    unsigned code[] =
++    {
++	  1, 0, 2,
++	  2, 2, 3,
++	  4, 8, 4,
++	  6, 0x14, 5,
++	 10, 0x60, 7,
++	 26, 0x1c0, 9,
++	 50, 0x3b0, 10,
++	 66, 0x780, 11,
++	 98, 0xf40, 12,
++	162, 0x7c00, 15,
++	674, 0xfc000, 20,
++	17058
++    };
++    int c = 0;
++
++    if (val < 1 || val > 17057) return;
++    while (val >= code[c+3]) c += 3;
++    putbits(s, val-code[c] + code[c+1], code[c+2]);
++}
++
++/*
++   CMYK byte differences are encoded as follows:
++
++	 0	000
++	+1	001
++	-1	010
++	 2	011s0	s = 0 for +, 1 for -
++	 3	011s1
++	 4	100s00
++	 5	100s01
++	 6	100s10
++	 7	100s11
++	 8	101s000
++	 9	101s001
++	    ...
++	 14	101s110
++	 15	101s111
++	 16	110s00000
++	 17	110s00001
++	 18	110s00010
++	    ...
++	 46	110s11110
++	 47	110s11111
++	 48	1110s00000
++	 49	1110s00001
++	    ...
++	 78	1110s11110
++	 79	1110s11111
++	 80	1111s000000
++	 81	1111s000001
++	    ...
++	 126	1111s101110
++	 127	1111s101111
++	 128	11111110000
++*/
++void
++put_diff(struct stream *s, signed char val)
++{
++    static unsigned short code[] =
++    {
++	 2,  3, 3, 1,
++	 4,  4, 3, 2,
++	 8,  5, 3, 3,
++	16,  6, 3, 5,
++	48, 14, 4, 5,
++	80, 15, 4, 6,
++	129
++    };
++    int sign, abs, c = 0;
++
++    switch (val)
++    {
++    case  0:  putbits(s, 0, 3);  return;
++    case  1:  putbits(s, 1, 3);  return;
++    case -1:  putbits(s, 2, 3);  return;
++    }
++    abs = ((sign = val < 0)) ? -val:val;
++    while (abs >= code[c+4]) c += 4;
++    putbits(s, code[c+1], code[c+2]);
++    putbits(s, sign, 1);
++    putbits(s, abs-code[c], code[c+3]);
++}
++
++void
++setle(unsigned char *c, int s, int i)
++{
++    while (s--)
++    {
++	*c++ = i;
++	i >>= 8;
++    }
++}
++
++void
++start_doc(int color)
++{
++    char reca[] = { 0x41,0x81,0xa1,0x00,0x82,0xa2,0x07,0x00,0x83,0xa2,0x01,0x00 };
++    time_t t;
++    struct tm *tmp;
++    char datestr[16], timestr[16];
++    char cname[128] = "My Computer";
++    char *mname[] =
++    {	"",
++	"NORMAL",
++	"THICK",
++	"HIGHQUALITY",
++	"COAT2",
++	"LABEL",
++	"ENVELOPE",
++	"RECYCLED",
++	"NORMALREV",
++	"THICKSIDE2",
++	"HIGHQUALITYREV",
++	"COATEDPAPER2REV",
++	"RECYCLEREV",
++    };
++
++    t = time(NULL);
++    tmp = localtime(&t);
++    strftime(datestr, sizeof datestr, "%m/%d/%Y", tmp);
++    strftime(timestr, sizeof timestr, "%H:%M:%S", tmp);
++
++    #ifdef linux
++    {
++	struct utsname u;
++
++	uname(&u);
++	strncpy(cname, u.nodename, 128);
++	cname[127] = 0;
++    }
++    #endif
++
++/* Lines end with \n, not \r\n */
++
++    printf(
++	"\033%%-12345X@PJL SET STRINGCODESET=UTF8\n"
++	"@PJL COMMENT DATE=%s\n"
++	"@PJL COMMENT TIME=%s\n"
++	"@PJL COMMENT DNAME=%s\n"
++	"@PJL JOB MODE=PRINTER\n"
++	"@PJL SET JOBATTR=\"@LUNA=%s\"\n"
++	"@PJL SET JOBATTR=\"@TRCH=OFF\"\n"
++	"@PJL SET DUPLEX=OFF\n"
++	"@PJL SET BINDING=LONGEDGE\n"
++	"@PJL SET IWAMANUALDUP=OFF\n"
++	"@PJL SET JOBATTR=\"@MSIP=%s\"\n"
++	"@PJL SET RENDERMODE=%s\n"
++	"@PJL SET ECONOMODE=OFF\n"
++	"@PJL SET RET=ON\n"
++	"@PJL SET JOBATTR=\"@IREC=OFF\"\n"
++	"@PJL SET JOBATTR=\"@TRAP=ON\"\n"
++	"@PJL SET JOBATTR=\"@JOAU=%s\"\n"
++	"@PJL SET JOBATTR=\"@CNAM=%s\"\n"
++	"@PJL SET COPIES=1\n"
++	"@PJL SET QTY=1\n"
++	"@PJL SET PAPERDIRECTION=SEF\n"
++	"@PJL SET RESOLUTION=600\n"
++	"@PJL SET BITSPERPIXEL=8\n"
++	"@PJL SET JOBATTR=\"@DRDM=XRC\"\n"
++	"@PJL SET JOBATTR=\"@TSCR=11\"\n"
++	"@PJL SET JOBATTR=\"@GSCR=11\"\n"
++	"@PJL SET JOBATTR=\"@ISCR=12\"\n"
++	"@PJL SET JOBATTR=\"@TTRC=11\"\n"
++	"@PJL SET JOBATTR=\"@GTRC=11\"\n"
++	"@PJL SET JOBATTR=\"@ITRC=12\"\n"
++	"@PJL SET JOBATTR=\"@TCPR=11\"\n"
++	"@PJL SET JOBATTR=\"@GCPR=11\"\n"
++	"@PJL SET JOBATTR=\"@ICPR=12\"\n"
++	"@PJL SET JOBATTR=\"@TUCR=11\"\n"
++	"@PJL SET JOBATTR=\"@GUCR=11\"\n"
++	"@PJL SET JOBATTR=\"@IUCR=12\"\n"
++	"@PJL SET JOBATTR=\"@BSPM=OFF\"\n"
++	"@PJL SET JOBATTR=\"@TDFT=0\"\n"
++	"@PJL SET JOBATTR=\"@GDFT=0\"\n"
++	"@PJL SET JOBATTR=\"@IDFT=0\"\n"
++	"@PJL ENTER LANGUAGE=HBPL\n"
++	, datestr, timestr
++	, Filename ? Filename : ""
++	, Username ? Username : ""
++	, mname[MediaCode]
++	, color ? "COLOR" : "GRAYSCALE"
++	, Username ? Username : ""
++	, cname);
++    fwrite (reca, 1, sizeof reca, stdout);
++}
++
++#define IP (((int *)image) + off)
++#define CP (((char *)image) + off)
++#define DP (((char *)image) + off*deep)
++#define BP(x) ((blank[(off+x) >> 3] << ((off+x) & 7)) & 128)
++#define put_token(s,x) putbits(s, huff[hsel][x] >> 4, huff[hsel][x] & 15)
++
++void
++encode_page(int color, int width, int height, char *image)
++{
++    unsigned char head[90] =
++    {
++	0x43,0x91,0xa1,0x00,0x92,0xa1,0x01,0x93,0xa1,0x01,0x94,0xa1,
++	0x00,0x95,0xc2,0x00,0x00,0x00,0x00,0x96,0xa1,0x00,0x97,0xc3,
++	0x00,0x00,0x00,0x00,0x98,0xa1,0x00,0x99,0xa4,0x01,0x00,0x00,
++	0x00,0x9a,0xc4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9b,
++	0xa1,0x00,0x9c,0xa1,0x01,0x9d,0xa1,0x00,0x9e,0xa1,0x02,0x9f,
++	0xa1,0x05,0xa0,0xa1,0x08,0xa1,0xa1,0x00,0xa2,0xc4,0x00,0x00,
++	0x00,0x00,0x00,0x00,0x00,0x00,0x51,0x52,0xa3,0xa1,0x00,0xa4,
++	0xb1,0xa4
++    };
++    unsigned char body[52] =
++    {
++	0x20,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x10,0x32,0x04,0x00,
++	0xa1,0x42,0x00,0x00,0x00,0x00,0xff
++    };
++    static short papers[] =
++    {	// Official sizes to nearest 1/600 inch
++	// will accept +-1.5mm (35/600 inch) tolerance
++	  0, 5100, 6600,	// Letter
++	  2, 5100, 8400,	// Legal
++	  4, 4961, 7016,	// A4
++	  6, 4350, 6300,	// Executive
++	 13, 2475, 5700,	// #10 envelope
++	 15, 2325, 4500,	// Monarch envelope
++	 17, 3827, 5409,	// C5 envelope
++	 19, 2599, 5197,	// DL envelope
++//	 ??, 4158, 5906,	// B5 ISO
++	 22, 4299, 6071,	// B5 JIS
++	 30, 3496, 4961,	// A5
++	410, 5100, 7800,	// Folio
++    };
++    static const unsigned short huff[2][8] =
++    {
++	{ 0x01,0x63,0x1c5,0x1d5,0x1e5,0x22,0x3e6 }, // for text & graphics
++	{ 0x22,0x63,0x1c5,0x1d5,0x1e5,0x01,0x3e6 }, // for images
++    };
++    unsigned char *blank;
++    static int pagenum = 0;
++    struct stream stream[5] = { { 0 } };
++    int dirs[] = { -1,0,-1,1,2 }, rotor[] = { 0,1,2,3,4 };
++    int i, j, row, col, deep, dir, run, try, bdir, brun, total;
++    int paper = 510, hsel = 0, off = 0, bit = 0, stat = 0;
++    int margin = width-96;
++
++    for (i = 0; i < sizeof papers / sizeof *papers; i++)
++	if (abs(width-papers[i+1]) < 36 && abs(height-papers[i+2]) < 36)
++	    paper = papers[i];
++    if (!MediaCode)
++	MediaCode = paper & 1 ? 6 : 1;
++    if (!pagenum)
++	start_doc(color);
++    head[12] = paper >> 1;
++    if (paper == 510)
++    {
++	setle (head+15, 2,  (width*254+300)/600);  // units of 0.1mm
++	setle (head+17, 2, (height*254+300)/600);
++	head[21] = 2;
++    }
++    width = -(-width & -8);
++    setle (head+33, 4, ++pagenum);
++    setle (head+39, 4, width);
++    setle (head+43, 4, height);
++    setle (head+70, 4, width);
++    setle (head+74, 4, height);
++    head[55] = 9 + color*130;
++    if (color)	body[6] = 1;
++    else	body[4] = 8;
++
++    deep = 1 + color*3;
++    for (i=1; i < 5; i++)
++	dirs[i] -= width;
++    if (!color) dirs[4] = -8;
++
++    blank = calloc(height+2, width/8);
++    memset (blank++, -color, width/8+1);
++    for (row = 1; row <= height; row++)
++    {
++	for (col = deep; col < deep*2; col++)
++	    image[row*width*deep + col] = -1;
++	for (col = 8; col < width*deep; col += 4)
++	    if (*(int *)(image + row*width*deep + col))
++	    {
++		for (col = 12; col < margin/8; col++)
++		    blank[row*(width/8)+col] = -1;
++		blank[row*(width/8)+col] = -2 << (~margin & 7);
++		break;
++	    }
++    }
++    memset (image, -color, (width+1)*deep);
++    image += (width+1)*deep;
++    blank += width/8;
++
++    while (off < width * height)
++    {
++	for (bdir = brun = dir = 0; dir < 5; dir++)
++	{
++	    try = dirs[rotor[dir]];
++	    for (run = 0; run < 17057; run++, try++)
++	    {
++		if (color)
++		{
++		    if (IP[run] != IP[try]) break;
++		}
++		else
++		    if (CP[run] != CP[try]) break;
++
++		if (BP(run) != BP(try)) break;
++	    }
++	    if (run > brun)
++	    {
++		bdir = dir;
++		brun = run;
++	    }
++	}
++	if (brun == 0)
++	{
++	    put_token(stream, 5);
++	    for (i = 0; i < deep; i++)
++		put_diff(stream+1+i, DP[i] - DP[i-deep]);
++	    bit = 0;
++	    off++;
++	    stat--;
++	    continue;
++	}
++	if (brun > width * height - off)
++	    brun = width * height - off;
++	if (bdir)
++	{
++	    j = rotor[bdir];
++	    for (i = bdir; i; i--)
++		rotor[i] = rotor[i-1];
++	    rotor[0] = j;
++	}
++	if ((off-1+brun)/width != (off-1)/width)
++	{
++	    if (abs(stat) > 8 && ((stat >> 31) & 1) != hsel)
++	    {
++		hsel ^= 1;
++		put_token(stream, 6);
++	    }
++	    stat = 0;
++	}
++	stat += bdir == bit;
++	put_token(stream, bdir - bit);
++	put_len(stream, brun);
++	bit = brun < 17057;
++	off += brun;
++    }
++
++    putbits(stream, 0xff, 8);
++    for (total = 48, i = 0; i <= deep; i++)
++    {
++	putbits(stream+i, 0xff, 8);
++	stream[i].off--;
++	setle (body+32 + i*4, 4, stream[i].off);
++	total += stream[i].off;
++    }
++    head[85] = 0xa2 + (total > 0xffff)*2;
++    setle (head+86, 4, total);
++    fwrite(head, 1, 88+(total > 0xffff)*2, stdout);
++    fwrite(body, 1, 48, stdout);
++    for (i = 0; i <= deep; i++)
++    {
++	fwrite(stream[i].buf, 1, stream[i].off, stdout);
++	free(stream[i].buf);
++    }
++    free(blank-width/8-1);
++    printf("SD");
++}
++#undef IP
++#undef CP
++#undef DP
++#undef BP
++#undef put_token
++
++int
++getint(FILE *fp)
++{
++    int c, ret;
++
++    for (;;)
++    {
++	while (isspace(c = fgetc(fp)));
++	if (c == '#')
++	    while (fgetc(fp) != '\n');
++	else break;
++    }
++    if (!isdigit(c)) return -1;
++    for (ret = c-'0'; isdigit(c = fgetc(fp)); )
++	ret = ret*10 + c-'0';
++    return ret;
++}
++
++void
++do_file(FILE *fp)
++{
++    int type, iwide, ihigh, ideep, imax, ibyte;
++    int wide, deep, byte, row, col, i, k;
++    char tupl[128], line[128];
++    unsigned char *image, *sp, *dp;
++
++    while ((type = fgetc(fp)) != EOF)
++    {
++	type = ((type - 'P') << 8) | fgetc(fp);
++	tupl[0] = iwide = ihigh = ideep = deep = imax = ibyte = -1;
++	switch (type)
++	{
++	case '4':
++	    deep = 1 + (ideep = 0);
++	    goto six;
++	case '5':
++	    deep = ideep = 1;
++	    goto six;
++	case '6':
++	    deep = 1 + (ideep = 3);
++six:	    iwide = getint(fp);
++	    ihigh = getint(fp);
++	    imax = type == '4' ? 255 : getint(fp);
++	    break;
++	case '7':
++	    do
++	    {
++		if (!fgets(line, 128, fp)) goto fail;
++		if (!strncmp(line, "WIDTH ",6))
++		    iwide = atoi(line + 6);
++		if (!strncmp(line, "HEIGHT ",7))
++		    ihigh = atoi(line + 7);
++		if (!strncmp(line, "DEPTH ",6))
++		    deep = ideep = atoi(line + 6);
++		if (!strncmp(line, "MAXVAL ",7))
++		    imax = atoi(line + 7);
++		if (!strncmp(line, "TUPLTYPE ",9))
++		    strcpy (tupl, line + 9);
++	    } while (strcmp(line, "ENDHDR\n"));
++	    if (ideep != 4 || strcmp(tupl, "CMYK\n")) goto fail;
++	    break;
++	default:
++	    goto fail;
++	}
++	if (iwide <= 0 || ihigh <= 0 || imax != 255) goto fail;
++	wide = -(-iwide & -8);
++        if (ideep)
++	    ibyte = iwide * ideep;
++	else
++	    ibyte = wide >> 3;
++	byte = wide * deep;
++	image = calloc (ihigh+2, byte);
++	for (row = 1; row <= ihigh; row++)
++	{
++	    i = fread (image, ibyte, 1, fp);
++	    sp = image;
++	    dp = image + row*byte;
++	    for (col = 0; col < iwide; col++)
++	    {
++		dp += deep;
++		switch (ideep)
++		{
++		case 0:
++		    *dp = ((image[col >> 3] >> (~col & 7)) & 1) * 255;
++		    break;
++		case 1:
++		    *dp = ~*sp;
++		    break;
++		case 3:
++		    for (k = sp[2], i = 0; i < 2; i++)
++			if (k < sp[i]) k = sp[i];
++		    *dp = ~k;
++		    for (i = 0; i < 3; i++)
++			dp[i+1] = k ? (k - sp[i]) * 255 / k : 255;
++		    break;
++		case 4:
++		    for (i=0; i < 4; i++)
++			dp[i] = sp[((i-1) & 3)];
++		    break;
++		}
++		sp += ideep;
++	    }
++	    for (i = 0; i < deep*Clip[0]; i++)
++		image[row*byte + deep+i] = 0;
++	    for (i = deep*(iwide-Clip[2]); i < byte; i++)
++		image[row*byte + deep+i] = 0;
++	}
++	memset(image+deep, 0, byte*(Clip[1]+1));
++	memset(image+deep + byte*(ihigh-Clip[3]+1), 0, byte*Clip[3]);
++	encode_page(deep > 1, iwide, ihigh, (char *) image);
++	free(image);
++    }
++    return;
++fail:
++    fprintf (stderr, "Not an acceptable PBM, PPM or PAM file!!!\n");
++}
++
++int
++main(int argc, char *argv[])
++{
++    int	c, i;
++
++    while ( (c = getopt(argc, argv, "m:u:J:U:V")) != EOF)
++	switch (c)
++	{
++	case 'm':  MediaCode = atoi(optarg); break;
++	case 'u':  if (sscanf(optarg, "%d,%d,%d,%d",
++			Clip, Clip+1, Clip+2, Clip+3) != 4)
++		      error(1, "Must specify four clipping margins!\n");
++		   break;
++	case 'J':  if (optarg[0]) Filename = optarg; break;
++	case 'U':  if (optarg[0]) Username = optarg; break;
++	case 'V':  printf("%s\n", Version); return 0;
++	default:   usage(); return 1;
++	}
++
++    argc -= optind;
++    argv += optind;
++
++    if (argc == 0)
++    {
++	do_file(stdin);
++    }
++    else
++    {
++	for (i = 0; i < argc; ++i)
++	{
++	    FILE *ifp;
++
++	    if (!(ifp = fopen(argv[i], "r")))
++		error(1, "Can't open '%s' for reading\n", argv[i]);
++	    do_file(ifp);
++	    fclose(ifp);
++	}
++    }
++    puts("B\033%-12345X@PJL EOJ");
++    return 0;
++}
+--- foo2zjs/foomatic-db/driver/foo2hbpl1.xml	1970-01-01 00:00:00.000000000 +0000
++++ foo2zjs/foomatic-db/driver/foo2hbpl1.xml	2014-03-24 16:18:13.000000000 +0000
+@@ -0,0 +1,21 @@
++<driver id="driver/foo2hbpl1">
++    <name>foo2hbpl1</name>
++    <url>http://foo2hbpl.rkkda.com/</url>
++    <execution>
++	<filter />
++	<prototype>foo2hbpl1-wrapper %A</prototype>
++    </execution>
++    <comments> <en>
++
++	This is a driver developed for the Dell 1250c, Dell C1660, Dell C1760,
++	Epson AcuLaser C1700, and the Fuji-Xerox DocuPrint cp105.
++
++    </en> </comments>
++    <printers>
++	<printer><id>printer/Dell-1250c</id></printer>
++	<printer><id>printer/Dell-C1660</id></printer>
++	<printer><id>printer/Dell-C1760</id></printer>
++	<printer><id>printer/Epson-AcuLaser_C1700</id></printer>
++	<printer><id>printer/Fuji_Xerox-DocuPrint_CP105</id></printer>
++    </printers>
++</driver>
+--- foo2zjs/foomatic-db/opt/foo2hbpl1-ColorMode.xml	1970-01-01 00:00:00.000000000 +0000
++++ foo2zjs/foomatic-db/opt/foo2hbpl1-ColorMode.xml	2014-03-24 15:31:46.000000000 +0000
+@@ -0,0 +1,38 @@
++<option type="enum" id="opt/foo2hbpl1-ColorMode">
++    <!-- A multilingual <comments> block can appear here, too;
++       it should be treated as documentation for the user. -->
++    <arg_longname> <en>Color Mode</en> </arg_longname>
++    <arg_shortname> <en>ColorMode</en> </arg_shortname>
++    <arg_execution>
++	<arg_group>General</arg_group>
++	<arg_order>120</arg_order>
++	<arg_spot>A</arg_spot>
++	<arg_required />
++	<arg_substitution />
++	<arg_proto>%s </arg_proto>
++    </arg_execution>
++    <constraints>
++	<constraint sense="true">
++	<driver>foo2hbpl1</driver>
++	<arg_defval>ev/foo2hbpl1-ColorMode-mono</arg_defval>
++	</constraint>
++    </constraints>
++    <enum_vals>
++	<enum_val id="ev/foo2hbpl1-ColorMode-mono">
++	    <ev_longname> <en>Monochrome</en> </ev_longname>
++	    <comments><en>
++		Prints in monochrome only
++	    </en></comments>
++	    <ev_shortname> <en>Monochrome</en> </ev_shortname>
++	    <ev_driverval></ev_driverval>
++	</enum_val>
++	<enum_val id="ev/foo2hbpl1-ColorMode-color">
++	    <ev_longname> <en>Color</en> </ev_longname>
++	    <comments><en>
++		Prints in color using the best compromise setting.
++	    </en></comments>
++	    <ev_shortname> <en>Color</en> </ev_shortname>
++	    <ev_driverval>-c</ev_driverval>
++	</enum_val>
++    </enum_vals>
++</option>
+--- foo2zjs/foomatic-db/opt/foo2hbpl1-ICM.xml	1970-01-01 00:00:00.000000000 +0000
++++ foo2zjs/foomatic-db/opt/foo2hbpl1-ICM.xml	2014-03-25 10:14:22.000000000 +0000
+@@ -0,0 +1,52 @@
++<option type="enum" id="opt/foo2hbpl1-ICM">
++    <comments>
++	<en>
++	This option controls which .ICM file to use for color correction.
++	ICM files are stored in directory /usr/share/foo2hbpl/icm/.
++	</en>
++    </comments>
++    <arg_longname> <en>ICM Color Profile</en> </arg_longname>
++    <arg_shortname> <en>ICM</en> </arg_shortname>
++    <arg_execution>
++	<arg_group>Adjustment</arg_group>
++	<arg_order>300</arg_order>
++	<arg_spot>A</arg_spot>
++	<arg_required />
++	<arg_substitution />
++	<arg_proto>%s </arg_proto>
++    </arg_execution>
++    <constraints>
++	<constraint sense="true">
++	    <driver>foo2hbpl1</driver>
++	    <arg_defval>ev/foo2hbpl1-ICM-none</arg_defval>
++	</constraint>
++    </constraints>
++    <enum_vals>
++	<enum_val id="ev/foo2hbpl1-ICM-none">
++	    <ev_longname> <en>No ICM color correction</en> </ev_longname>
++		<!-- A multilingual <comments> block can appear here, too;
++		 it should be treated as documentation for the user. -->
++	    <ev_shortname> <en>none</en> </ev_shortname>
++	    <ev_driverval>-C10 -Gnone.icm</ev_driverval>
++	</enum_val>
++
++        <enum_val id="ev/foo2hbpl1-ICM-testing">
++            <ev_longname> <en>File testing.icm</en> </ev_longname>
++            <ev_shortname> <en>testing</en> </ev_shortname>
++            <ev_driverval>-C10 -Gtesting.icm</ev_driverval>
++        </enum_val>
++
++        <enum_val id="ev/foo2hbpl1-ICM-testing2">
++            <ev_longname> <en>File testing2.icm</en> </ev_longname>
++            <ev_shortname> <en>testing2</en> </ev_shortname>
++            <ev_driverval>-C10 -Gtesting2.icm</ev_driverval>
++        </enum_val>
++
++        <enum_val id="ev/foo2hbpl1-ICM-testing3">
++            <ev_longname> <en>File testing3.icm</en> </ev_longname>
++            <ev_shortname> <en>testing3</en> </ev_shortname>
++            <ev_driverval>-C10 -Gtesting3.icm</ev_driverval>
++        </enum_val>
++
++    </enum_vals>
++</option>
+--- foo2zjs/foomatic-db/opt/foo2hbpl1-MediaType.xml	1970-01-01 00:00:00.000000000 +0000
++++ foo2zjs/foomatic-db/opt/foo2hbpl1-MediaType.xml	2014-03-24 15:50:56.000000000 +0000
+@@ -0,0 +1,82 @@
++<option type="enum" id="opt/foo2hbpl1-MediaType">
++    <!-- A multilingual <comments> block can appear here, too;
++       it should be treated as documentation for the user. -->
++    <arg_longname> <en>Media Type</en> </arg_longname>
++    <arg_shortname> <en>MediaType</en> </arg_shortname>
++    <arg_execution>
++	<arg_group>General</arg_group>
++	<arg_order>150</arg_order>
++	<arg_spot>A</arg_spot>
++	<arg_required />
++	<arg_substitution />
++	<arg_proto>-m%s </arg_proto>
++    </arg_execution>
++    <constraints>
++	<constraint sense="true">
++	<driver>foo2hbpl1</driver>
++	<arg_defval>ev/foo2hbpl1-MediaType-1</arg_defval>
++	</constraint>
++    </constraints>
++    <enum_vals>
++	<enum_val id="ev/foo2hbpl1-MediaType-1">
++	    <ev_longname> <en>Plain Paper</en> </ev_longname>
++	    <ev_shortname> <en>plain</en> </ev_shortname>
++	    <ev_driverval>1</ev_driverval>
++	</enum_val>
++	<enum_val id="ev/foo2hbpl1-MediaType-2">
++	    <ev_longname> <en>Bond</en> </ev_longname>
++	    <ev_shortname> <en>bond</en> </ev_shortname>
++	    <ev_driverval>2</ev_driverval>
++	</enum_val>
++	<enum_val id="ev/foo2hbpl1-MediaType-3">
++	    <ev_longname> <en>Light Weight Card</en> </ev_longname>
++	    <ev_shortname> <en>lwcard</en> </ev_shortname>
++	    <ev_driverval>3</ev_driverval>
++	</enum_val>
++	<enum_val id="ev/foo2hbpl1-MediaType-4">
++	    <ev_longname> <en>Light Weight Glossy Card</en> </ev_longname>
++	    <ev_shortname> <en>lwgcard</en> </ev_shortname>
++	    <ev_driverval>4</ev_driverval>
++	</enum_val>
++	<enum_val id="ev/foo2hbpl1-MediaType-5">
++	    <ev_longname> <en>Labels</en> </ev_longname>
++	    <ev_shortname> <en>labels</en> </ev_shortname>
++	    <ev_driverval>5</ev_driverval>
++	</enum_val>
++	<enum_val id="ev/foo2hbpl1-MediaType-6">
++	    <ev_longname> <en>Envelope</en> </ev_longname>
++	    <ev_shortname> <en>envelope</en> </ev_shortname>
++	    <ev_driverval>6</ev_driverval>
++	</enum_val>
++	<enum_val id="ev/foo2hbpl1-MediaType-7">
++	    <ev_longname> <en>Recycled Paper</en> </ev_longname>
++	    <ev_shortname> <en>recycled</en> </ev_shortname>
++	    <ev_driverval>7</ev_driverval>
++	</enum_val>
++	<enum_val id="ev/foo2hbpl1-MediaType-8">
++	    <ev_longname> <en>Plain Paper Side 2</en> </ev_longname>
++	    <ev_shortname> <en>plain2</en> </ev_shortname>
++	    <ev_driverval>8</ev_driverval>
++	</enum_val>
++	<enum_val id="ev/foo2hbpl1-MediaType-9">
++	    <ev_longname> <en>Bond Side 2</en> </ev_longname>
++	    <ev_shortname> <en>bond2</en> </ev_shortname>
++	    <ev_driverval>9</ev_driverval>
++	</enum_val>
++	<enum_val id="ev/foo2hbpl1-MediaType-10">
++	    <ev_longname> <en>Light Weight Card Side 2</en> </ev_longname>
++	    <ev_shortname> <en>lwcard2</en> </ev_shortname>
++	    <ev_driverval>10</ev_driverval>
++	</enum_val>
++	<enum_val id="ev/foo2hbpl1-MediaType-11">
++	    <ev_longname> <en>Light Weight Glossy Card Side 2</en></ev_longname>
++	    <ev_shortname> <en>lwgcard2</en> </ev_shortname>
++	    <ev_driverval>11</ev_driverval>
++	</enum_val>
++	<enum_val id="ev/foo2hbpl1-MediaType-12">
++	    <ev_longname> <en>Recycled Paper Side 2</en> </ev_longname>
++	    <ev_shortname> <en>recycled2</en> </ev_shortname>
++	    <ev_driverval>12</ev_driverval>
++	</enum_val>
++    </enum_vals>
++</option>
+--- foo2zjs/foomatic-db/opt/foo2hbpl1-PageSize.xml	1970-01-01 00:00:00.000000000 +0000
++++ foo2zjs/foomatic-db/opt/foo2hbpl1-PageSize.xml	2014-04-01 11:05:46.000000000 +0000
+@@ -0,0 +1,80 @@
++<option type="enum" id="opt/foo2hbpl1-PageSize">
++    <arg_longname> <en>Page Size</en> </arg_longname>
++    <arg_shortname> <en>PageSize</en> </arg_shortname>
++    <arg_execution>
++	<arg_group>General</arg_group>
++	<arg_order>135</arg_order>
++	<arg_spot>A</arg_spot>
++	<arg_required />
++	<arg_substitution />
++	<arg_proto>-p%s </arg_proto>
++    </arg_execution>
++    <constraints>
++	<constraint sense="true">
++	<driver>foo2hbpl1</driver>
++	<arg_defval>ev/foo2hbpl1-PageSize-4</arg_defval>
++	</constraint>
++    </constraints>
++    <enum_vals>
++	<enum_val id="ev/foo2hbpl1-PageSize-1">
++	    <ev_longname> <en>A4</en> </ev_longname>
++	    <ev_shortname> <en>A4</en> </ev_shortname>
++	    <ev_driverval>1</ev_driverval>
++	</enum_val>
++	<enum_val id="ev/foo2hbpl1-PageSize-2">
++	    <ev_longname> <en>B5 (JIS)</en> </ev_longname>
++	    <ev_shortname> <en>B5jis</en> </ev_shortname>
++	    <ev_driverval>2</ev_driverval>
++	</enum_val>
++	<enum_val id="ev/foo2hbpl1-PageSize-4">
++	    <ev_longname> <en>Letter</en> </ev_longname>
++	    <ev_shortname> <en>Letter</en> </ev_shortname>
++	    <ev_driverval>4</ev_driverval>
++	</enum_val>
++	<enum_val id="ev/foo2hbpl1-PageSize-5">
++	    <ev_longname> <en>Executive</en> </ev_longname>
++	    <ev_shortname> <en>Executive</en> </ev_shortname>
++	    <ev_driverval>5</ev_driverval>
++	</enum_val>
++	<enum_val id="ev/foo2hbpl1-PageSize-6">
++	    <ev_longname> <en>Fanfold German Legal</en> </ev_longname>
++	    <ev_shortname> <en>FanfoldGermanLegal</en> </ev_shortname>
++	    <ev_driverval>6</ev_driverval>
++	</enum_val>
++	<enum_val id="ev/foo2hbpl1-PageSize-6-alt">
++	    <ev_longname> <en>Folio</en> </ev_longname>
++	    <ev_shortname> <en>Folio</en> </ev_shortname>
++	    <ev_driverval>6</ev_driverval>
++	</enum_val>
++	<enum_val id="ev/foo2hbpl1-PageSize-7">
++	    <ev_longname> <en>Legal</en> </ev_longname>
++	    <ev_shortname> <en>Legal</en> </ev_shortname>
++	    <ev_driverval>7</ev_driverval>
++	</enum_val>
++	<enum_val id="ev/foo2hbpl1-PageSize-9">
++	    <ev_longname> <en>Env #10</en> </ev_longname>
++	    <ev_shortname> <en>Env10</en> </ev_shortname>
++	    <ev_driverval>9</ev_driverval>
++	</enum_val>
++	<enum_val id="ev/foo2hbpl1-PageSize-10">
++	    <ev_longname> <en>Env Monarch</en> </ev_longname>
++	    <ev_shortname> <en>EnvMonarch</en> </ev_shortname>
++	    <ev_driverval>10</ev_driverval>
++	</enum_val>
++	<enum_val id="ev/foo2hbpl1-PageSize-11">
++	    <ev_longname> <en>Env C5</en> </ev_longname>
++	    <ev_shortname> <en>EnvC5</en> </ev_shortname>
++	    <ev_driverval>11</ev_driverval>
++	</enum_val>
++	<enum_val id="ev/foo2hbpl1-PageSize-12">
++	    <ev_longname> <en>Env DL</en> </ev_longname>
++	    <ev_shortname> <en>EnvDL</en> </ev_shortname>
++	    <ev_driverval>12</ev_driverval>
++	</enum_val>
++	<enum_val id="ev/foo2hbpl1-PageSize-Custom">
++	    <ev_longname> <en>Custom</en> </ev_longname>
++	    <ev_shortname> <en>Custom</en> </ev_shortname>
++	    <ev_driverval>Custom.%0x%1</ev_driverval>
++	</enum_val>
++    </enum_vals>
++</option>
+--- foo2zjs/foomatic-db/opt/foo2xxx-Copies.xml	2014-04-03 22:23:27.000000000 +0000
++++ foo2zjs/foomatic-db/opt/foo2xxx-Copies.xml	2014-03-24 15:32:48.000000000 +0000
+@@ -65,6 +65,10 @@
+ 	    <arg_defval>1</arg_defval>
+ 	</constraint>
+ 	<constraint sense="true">
++	    <driver>foo2hbpl1</driver>
++	    <arg_defval>1</arg_defval>
++	</constraint>
++	<constraint sense="true">
+ 	    <driver>foo2hbpl2</driver>
+ 	    <arg_defval>1</arg_defval>
+ 	</constraint>
+--- foo2zjs/foomatic-db/opt/foo2xxx-Halftone.xml	2014-04-03 22:23:40.000000000 +0000
++++ foo2zjs/foomatic-db/opt/foo2xxx-Halftone.xml	2014-03-25 10:16:58.000000000 +0000
+@@ -68,6 +68,10 @@
+ 	    <arg_defval>ev/foo2xxx-Halftone-Default</arg_defval>
+ 	</constraint>
+ 	<constraint sense="true">
++	    <driver>foo2hbpl1</driver>
++	    <arg_defval>ev/foo2xxx-Halftone-Default</arg_defval>
++	</constraint>
++	<constraint sense="true">
+ 	    <driver>foo2hbpl2</driver>
+ 	    <arg_defval>ev/foo2xxx-Halftone-Default</arg_defval>
+ 	</constraint>
+--- foo2zjs/foomatic-db/opt/foo2xxx-Nup.xml	2014-04-03 22:24:01.000000000 +0000
++++ foo2zjs/foomatic-db/opt/foo2xxx-Nup.xml	2014-03-24 15:34:43.000000000 +0000
+@@ -65,6 +65,10 @@
+ 	    <arg_defval>ev/foo2xxx-Nup-1</arg_defval>
+ 	</constraint>
+ 	<constraint sense="true">
++	    <driver>foo2hbpl1</driver>
++	    <arg_defval>ev/foo2xxx-Nup-1</arg_defval>
++	</constraint>
++	<constraint sense="true">
+ 	    <driver>foo2hbpl2</driver>
+ 	    <arg_defval>ev/foo2xxx-Nup-1</arg_defval>
+ 	</constraint>
+--- foo2zjs/foomatic-db/opt/foo2xxx-NupOrient.xml	2014-04-03 22:23:50.000000000 +0000
++++ foo2zjs/foomatic-db/opt/foo2xxx-NupOrient.xml	2014-03-24 15:35:10.000000000 +0000
+@@ -65,6 +65,10 @@
+ 	    <arg_defval>ev/foo2xxx-NupOrient-port</arg_defval>
+ 	</constraint>
+ 	<constraint sense="true">
++	    <driver>foo2hbpl1</driver>
++	    <arg_defval>ev/foo2xxx-NupOrient-port</arg_defval>
++	</constraint>
++	<constraint sense="true">
+ 	    <driver>foo2hbpl2</driver>
+ 	    <arg_defval>ev/foo2xxx-NupOrient-port</arg_defval>
+ 	</constraint>
+--- foo2zjs/foomatic-db/opt/foo2xxx-Quality.xml	2014-04-03 22:24:12.000000000 +0000
++++ foo2zjs/foomatic-db/opt/foo2xxx-Quality.xml	2014-03-24 15:35:36.000000000 +0000
+@@ -68,6 +68,10 @@
+ 	    <arg_defval>ev/foo2xxx-Quality-Normal</arg_defval>
+ 	</constraint>
+ 	<constraint sense="true">
++	    <driver>foo2hbpl1</driver>
++	    <arg_defval>ev/foo2xxx-Quality-Normal</arg_defval>
++	</constraint>
++	<constraint sense="true">
+ 	    <driver>foo2hbpl2</driver>
+ 	    <arg_defval>ev/foo2xxx-Quality-Normal</arg_defval>
+ 	</constraint>
+--- foo2zjs/foomatic-db/printer/Dell-1250c.xml	1970-01-01 00:00:00.000000000 +0000
++++ foo2zjs/foomatic-db/printer/Dell-1250c.xml	2014-03-24 15:58:32.000000000 +0000
+@@ -0,0 +1,70 @@
++<printer id="printer/Dell-1250c">
++    <make>Dell</make>
++    <model>1250c</model>
++    <mechanism>
++	<laser/>
++	<color/>
++	<resolution>
++	    <dpi>
++		<x>600</x>
++		<y>600</y>
++	    </dpi>
++	</resolution>
++	<margins>
++	    <general>
++		<unit>inch</unit>
++		<top>0.085</top>
++		<bottom>0.085</bottom>
++		<left>0.085</left>
++		<right>0.085</right>
++	    </general>
++	</margins>
++<!--
++	<consumables>
++	    <comments> <en>
++		Toner Cyan (1000 prints) - $45
++		Toner Magenta (1000 prints) - $45
++		Toner Yellow (1000 prints) - $45
++		Toner Black (2000 prints) - $54
++		Waste Toner (5000 prints) - $10
++		Drum Kit (20000 prints) - $159
++	    </en> </comments>
++	    <partno>106R01271</partno>
++	    <partno>106R01272</partno>
++	    <partno>106R01273</partno>
++	    <partno>106R01274</partno>
++	    <partno>108R00722</partno>
++	    <partno>108R00744</partno>
++	</consumables>
++-->
++    </mechanism>
++    <url>http://www.pcmag.com/article2/0,2817,2380920,00.asp</url>
++    <lang>
++	<proprietary/>
++	<!--no pjl--><!--No "text"?-->
++    </lang>
++    <autodetect>
++<!--
++        <parallel>
++            <ieee1284>MFG:Xerox;CMD:SPLC;MDL:Phaser 6110;CLS:PRINTER;STATUS:BUSY;</ieee1284>
++            <manufacturer>Xerox</manufacturer>
++            <model>Phaser 6110</model>
++            <commandset>SPLC</commandset>
++        </parallel>
++-->
++	<snmp>
++	    <description>Dell 1250c</description>
++	</snmp>
++    </autodetect>
++    <functionality>C</functionality>
++    <driver>foo2hbpl1</driver>
++    <!--not "unverified"--><!--no "contrib_url"-->
++    <comments> <en>
++
++	The Dell 1250c is color printer with a 2014 street price of $200.
++
++	These printers are supported by the foo2hbpl1 open software printer
++	driver.
++
++    </en> </comments>
++</printer>
+--- foo2zjs/foomatic-db/printer/Dell-C1660.xml	1970-01-01 00:00:00.000000000 +0000
++++ foo2zjs/foomatic-db/printer/Dell-C1660.xml	2014-03-24 15:27:13.000000000 +0000
+@@ -0,0 +1,70 @@
++<printer id="printer/Dell-C1660">
++    <make>Dell</make>
++    <model>C1660</model>
++    <mechanism>
++	<laser/>
++	<color/>
++	<resolution>
++	    <dpi>
++		<x>600</x>
++		<y>600</y>
++	    </dpi>
++	</resolution>
++	<margins>
++	    <general>
++		<unit>inch</unit>
++		<top>0.085</top>
++		<bottom>0.085</bottom>
++		<left>0.085</left>
++		<right>0.085</right>
++	    </general>
++	</margins>
++<!--
++	<consumables>
++	    <comments> <en>
++		Toner Cyan (1000 prints) - $45
++		Toner Magenta (1000 prints) - $45
++		Toner Yellow (1000 prints) - $45
++		Toner Black (2000 prints) - $54
++		Waste Toner (5000 prints) - $10
++		Drum Kit (20000 prints) - $159
++	    </en> </comments>
++	    <partno>106R01271</partno>
++	    <partno>106R01272</partno>
++	    <partno>106R01273</partno>
++	    <partno>106R01274</partno>
++	    <partno>108R00722</partno>
++	    <partno>108R00744</partno>
++	</consumables>
++-->
++    </mechanism>
++    <url>http://accessories.us.dell.com/sna/productdetail.aspx?c=us&amp;cs=04&amp;l=en&amp;s=bsd&amp;sku=225-411</url>
++    <lang>
++	<proprietary/>
++	<!--no pjl--><!--No "text"?-->
++    </lang>
++    <autodetect>
++<!--
++        <parallel>
++            <ieee1284>MFG:Xerox;CMD:SPLC;MDL:Phaser 6110;CLS:PRINTER;STATUS:BUSY;</ieee1284>
++            <manufacturer>Xerox</manufacturer>
++            <model>Phaser 6110</model>
++            <commandset>SPLC</commandset>
++        </parallel>
++-->
++	<snmp>
++	    <description>Dell C1660</description>
++	</snmp>
++    </autodetect>
++    <functionality>C</functionality>
++    <driver>foo2hbpl1</driver>
++    <!--not "unverified"--><!--no "contrib_url"-->
++    <comments> <en>
++
++	The Dell C1660 is color printer with a 2014 street price of $200.
++
++	These printers are supported by the foo2hbpl1 open software printer
++	driver.
++
++    </en> </comments>
++</printer>
+--- foo2zjs/foomatic-db/printer/Dell-C1760.xml	1970-01-01 00:00:00.000000000 +0000
++++ foo2zjs/foomatic-db/printer/Dell-C1760.xml	2014-03-24 16:04:23.000000000 +0000
+@@ -0,0 +1,70 @@
++<printer id="printer/Dell-C1760">
++    <make>Dell</make>
++    <model>C1760</model>
++    <mechanism>
++	<laser/>
++	<color/>
++	<resolution>
++	    <dpi>
++		<x>600</x>
++		<y>600</y>
++	    </dpi>
++	</resolution>
++	<margins>
++	    <general>
++		<unit>inch</unit>
++		<top>0.085</top>
++		<bottom>0.085</bottom>
++		<left>0.085</left>
++		<right>0.085</right>
++	    </general>
++	</margins>
++<!--
++	<consumables>
++	    <comments> <en>
++		Toner Cyan (1000 prints) - $45
++		Toner Magenta (1000 prints) - $45
++		Toner Yellow (1000 prints) - $45
++		Toner Black (2000 prints) - $54
++		Waste Toner (5000 prints) - $10
++		Drum Kit (20000 prints) - $159
++	    </en> </comments>
++	    <partno>106R01271</partno>
++	    <partno>106R01272</partno>
++	    <partno>106R01273</partno>
++	    <partno>106R01274</partno>
++	    <partno>108R00722</partno>
++	    <partno>108R00744</partno>
++	</consumables>
++-->
++    </mechanism>
++    <url>http://accessories.us.dell.com/sna/productdetail.aspx?c=us&amp;cs=04&amp;l=en&amp;s=bsd&amp;sku=225-4111</url>
++    <lang>
++	<proprietary/>
++	<!--no pjl--><!--No "text"?-->
++    </lang>
++    <autodetect>
++<!--
++        <parallel>
++            <ieee1284>MFG:Xerox;CMD:SPLC;MDL:Phaser 6110;CLS:PRINTER;STATUS:BUSY;</ieee1284>
++            <manufacturer>Xerox</manufacturer>
++            <model>Phaser 6110</model>
++            <commandset>SPLC</commandset>
++        </parallel>
++-->
++	<snmp>
++	    <description>Dell C1760</description>
++	</snmp>
++    </autodetect>
++    <functionality>C</functionality>
++    <driver>foo2hbpl1</driver>
++    <!--not "unverified"--><!--no "contrib_url"-->
++    <comments> <en>
++
++	The Dell C1760 is color printer with a 2014 street price of $300.
++
++	These printers are supported by the foo2hbpl1 open software printer
++	driver.
++
++    </en> </comments>
++</printer>
+--- foo2zjs/foomatic-db/printer/Epson-AcuLaser_C1700.xml	1970-01-01 00:00:00.000000000 +0000
++++ foo2zjs/foomatic-db/printer/Epson-AcuLaser_C1700.xml	2014-03-24 16:13:45.000000000 +0000
+@@ -0,0 +1,71 @@
++<printer id="printer/Epson-AcuLaser_C1700">
++    <make>Epson</make>
++    <model>AcuLaser C1700</model>
++    <mechanism>
++	<laser/>
++	<color/>
++	<resolution>
++	    <dpi>
++		<x>600</x>
++		<y>600</y>
++	    </dpi>
++	</resolution>
++	<margins>
++	    <general>
++		<unit>inch</unit>
++		<top>0.085</top>
++		<bottom>0.085</bottom>
++		<left>0.085</left>
++		<right>0.085</right>
++	    </general>
++	</margins>
++<!--
++	<consumables>
++	    <comments> <en>
++		Toner Cyan (1000 prints) - $45
++		Toner Magenta (1000 prints) - $45
++		Toner Yellow (1000 prints) - $45
++		Toner Black (2000 prints) - $54
++		Waste Toner (5000 prints) - $10
++		Drum Kit (20000 prints) - $159
++	    </en> </comments>
++	    <partno>106R01271</partno>
++	    <partno>106R01272</partno>
++	    <partno>106R01273</partno>
++	    <partno>106R01274</partno>
++	    <partno>108R00722</partno>
++	    <partno>108R00744</partno>
++	</consumables>
++-->
++    </mechanism>
++    <url>http://www.epson.co.uk/gb/en/viewcon/corporatesite/products/mainunits/overview/10816</url>
++    <lang>
++	<proprietary/>
++	<!--no pjl--><!--No "text"?-->
++    </lang>
++    <autodetect>
++<!--
++        <parallel>
++            <ieee1284>MFG:Xerox;CMD:SPLC;MDL:Phaser 6110;CLS:PRINTER;STATUS:BUSY;</ieee1284>
++            <manufacturer>Xerox</manufacturer>
++            <model>Phaser 6110</model>
++            <commandset>SPLC</commandset>
++        </parallel>
++-->
++	<snmp>
++	    <description>Epson AcuLaser C1700</description>
++	</snmp>
++    </autodetect>
++    <functionality>C</functionality>
++    <driver>foo2hbpl1</driver>
++    <!--not "unverified"--><!--no "contrib_url"-->
++    <comments> <en>
++
++	The Epson AcuLaser C1700 is color printer with a 2014 street price
++	of $200.
++
++	These printers are supported by the foo2hbpl1 open software printer
++	driver.
++
++    </en> </comments>
++</printer>
+--- foo2zjs/foomatic-db/printer/Fuji_Xerox-DocuPrint_CP105.xml	1970-01-01 00:00:00.000000000 +0000
++++ foo2zjs/foomatic-db/printer/Fuji_Xerox-DocuPrint_CP105.xml	2014-03-24 16:17:06.000000000 +0000
+@@ -0,0 +1,71 @@
++<printer id="printer/Fuji_Xerox-DocuPrint_CP105">
++    <make>Fuji Xerox</make>
++    <model>DocuPrint CP105</model>
++    <mechanism>
++	<laser/>
++	<color/>
++	<resolution>
++	    <dpi>
++		<x>600</x>
++		<y>600</y>
++	    </dpi>
++	</resolution>
++	<margins>
++	    <general>
++		<unit>inch</unit>
++		<top>0.085</top>
++		<bottom>0.085</bottom>
++		<left>0.085</left>
++		<right>0.085</right>
++	    </general>
++	</margins>
++<!--
++	<consumables>
++	    <comments> <en>
++		Toner Cyan (1000 prints) - $45
++		Toner Magenta (1000 prints) - $45
++		Toner Yellow (1000 prints) - $45
++		Toner Black (2000 prints) - $54
++		Waste Toner (5000 prints) - $10
++		Drum Kit (20000 prints) - $159
++	    </en> </comments>
++	    <partno>106R01271</partno>
++	    <partno>106R01272</partno>
++	    <partno>106R01273</partno>
++	    <partno>106R01274</partno>
++	    <partno>108R00722</partno>
++	    <partno>108R00744</partno>
++	</consumables>
++-->
++    </mechanism>
++    <url>http://accessories.us.dell.com/sna/productdetail.aspx?c=us&amp;cs=04&amp;l=en&amp;s=bsd&amp;sku=225-411</url>
++    <lang>
++	<proprietary/>
++	<!--no pjl--><!--No "text"?-->
++    </lang>
++    <autodetect>
++<!--
++        <parallel>
++            <ieee1284>MFG:Xerox;CMD:SPLC;MDL:Phaser 6110;CLS:PRINTER;STATUS:BUSY;</ieee1284>
++            <manufacturer>Xerox</manufacturer>
++            <model>Phaser 6110</model>
++            <commandset>SPLC</commandset>
++        </parallel>
++-->
++	<snmp>
++	    <description>Fuji Xerox DocuPrint CP105</description>
++	</snmp>
++    </autodetect>
++    <functionality>C</functionality>
++    <driver>foo2hbpl1</driver>
++    <!--not "unverified"--><!--no "contrib_url"-->
++    <comments> <en>
++
++	The Fuji-Xerox DocuPrint CP105 is color printer with a 2014 street
++	price of $200.
++
++	These printers are supported by the foo2hbpl1 open software printer
++	driver.
++
++    </en> </comments>
++</printer>
diff --git a/pkgs/misc/drivers/foo2zjs/papercode-format-fix.patch b/pkgs/misc/drivers/foo2zjs/papercode-format-fix.patch
new file mode 100644
index 0000000000000..fb38fc206c982
--- /dev/null
+++ b/pkgs/misc/drivers/foo2zjs/papercode-format-fix.patch
@@ -0,0 +1,101 @@
+From 29ac95ac76a9d9977561cef352f8b803579fea2a Mon Sep 17 00:00:00 2001
+From: Shinbar <richard.shine@gmail.com>
+Date: Thu, 26 Mar 2020 19:33:39 +0000
+Subject: [PATCH 1/3] PPDs (e.g. Del-1660.ppd) are specifying paper sizes as
+ parameters e.g. -p1 which are then being picked up as an invalid paper size
+ In cups error_log manifesting as: foo2hbpl1-wrapper: Unimplemented paper code
+ 1
+
+Have amended foo2hbpl1-wrapper.in to intepret paper sizes
+paper parameters are also now being interpreted.
+This has fixed for a Dell 1660w printer, running on Ubuntu 18.04
+---
+ foo2hbpl1-wrapper.in | 28 ++++++++++++++--------------
+ 1 file changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/foo2hbpl1-wrapper.in b/foo2hbpl1-wrapper.in
+index 567e891..bb20ed5 100644
+--- a/foo2hbpl1-wrapper.in
++++ b/foo2hbpl1-wrapper.in
+@@ -341,20 +341,20 @@ Custom*)
+ # /usr/share/ghostscript/9.10/Resource/Init/gs_statd.ps
+ # foo2hbpl1 will provide the appropriate numeric value
+ 
+-letter)		DIM=5100x6600  ;;
+-legal)		DIM=5100x8400  ;;
+-a4)		DIM=4961x7016  ;;
+-executive)	DIM=4350x6300  ;;
+-env10)		DIM=2475x5700  ;;
+-monarch)	DIM=2325x4500  ;;
+-c5)		DIM=3827x5409  ;;
+-envDL)		DIM=2599x5197  ;;
+-isob5|b5)	DIM=4158x5906  ;;
+-jisb5)		DIM=4299x6071  ;;
+-a5)		DIM=3496x4961  ;;
+-folio)		DIM=5100x7800  ;;
+-pa4)		DIM=4961x6600  ;;
+-archA)		DIM=5400x7200  ;;
++4|letter|Letter)	DIM=5100x6600  ;;
++7|legal|Legal)		DIM=5100x8400  ;;
++1|a4|A4)		DIM=4961x7016  ;;
++5|executive|Executive)	DIM=4350x6300  ;;
++9|env10|Env10)		DIM=2475x5700  ;;
++10|monarch|EnvMonarch)	DIM=2325x4500  ;;
++11|c5|EnvC5)		DIM=3827x5409  ;;
++12|envDL|EnvDL)		DIM=2599x5197  ;;
++isob5|b5)		DIM=4158x5906  ;;
++2|jisb5|B5jis)		DIM=4299x6071  ;;
++a5)			DIM=3496x4961  ;;
++6|folio|Folio)		DIM=5100x7800  ;;
++pa4)			DIM=4961x6600  ;;
++archA)			DIM=5400x7200  ;;
+ *)		error "Unimplemented paper code $PAPER";;
+ esac
+ 
+
+From 289d55ded5af7d84a91b0ecf26bbea18f3cb2d9e Mon Sep 17 00:00:00 2001
+From: Shinbar <richard.shine@gmail.com>
+Date: Fri, 27 Mar 2020 09:19:40 +0000
+Subject: [PATCH 2/3] Added A5 paper size parameter
+
+---
+ foo2hbpl1-wrapper.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/foo2hbpl1-wrapper.in b/foo2hbpl1-wrapper.in
+index bb20ed5..474972d 100644
+--- a/foo2hbpl1-wrapper.in
++++ b/foo2hbpl1-wrapper.in
+@@ -351,7 +351,7 @@ Custom*)
+ 12|envDL|EnvDL)		DIM=2599x5197  ;;
+ isob5|b5)		DIM=4158x5906  ;;
+ 2|jisb5|B5jis)		DIM=4299x6071  ;;
+-a5)			DIM=3496x4961  ;;
++3|a5|A5)		DIM=3496x4961  ;;
+ 6|folio|Folio)		DIM=5100x7800  ;;
+ pa4)			DIM=4961x6600  ;;
+ archA)			DIM=5400x7200  ;;
+
+From 393f7a7c70bbf9fa0c39ac1504b220793670d201 Mon Sep 17 00:00:00 2001
+From: Shinbar <richard.shine@gmail.com>
+Date: Sun, 29 Mar 2020 10:01:31 +0100
+Subject: [PATCH 3/3] Makefile now works in FreeBSD
+
+---
+ osx-hotplug/Makefile | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/osx-hotplug/Makefile b/osx-hotplug/Makefile
+index 4165085..a9aa06a 100644
+--- a/osx-hotplug/Makefile
++++ b/osx-hotplug/Makefile
+@@ -64,8 +64,5 @@ clean:
+ 	rm -f *.o *.1
+ 
+ uninstall:
+-	( \
+-		echo "g/osx-hplj-hotplug/d"; \
+-		echo "w"; \
+-	) | ex $(RC)
++	-(echo "g/osx-hplj-hotplug/d"; echo "w") | ex $(RC)
+ 	-rm -f $(BIN)/osx-hplj-hotplug
diff --git a/pkgs/misc/emulators/retroarch/0001-Disable-menu_show_core_updater.patch b/pkgs/misc/emulators/retroarch/0001-Disable-menu_show_core_updater.patch
new file mode 100644
index 0000000000000..75018dc8c4d1e
--- /dev/null
+++ b/pkgs/misc/emulators/retroarch/0001-Disable-menu_show_core_updater.patch
@@ -0,0 +1,25 @@
+From 546b343294209abbb193883ab76b679b7f99c6d3 Mon Sep 17 00:00:00 2001
+From: Thiago Kenji Okada <thiagokokada@gmail.com>
+Date: Sat, 20 Nov 2021 16:03:50 -0300
+Subject: [PATCH 1/2] Disable "menu_show_core_updater"
+
+---
+ retroarch.cfg | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/retroarch.cfg b/retroarch.cfg
+index cdcb199c9f..ab72f3920f 100644
+--- a/retroarch.cfg
++++ b/retroarch.cfg
+@@ -681,7 +681,7 @@
+ # menu_show_online_updater = true
+ 
+ # If disabled, will hide the ability to update cores (and core info files) inside the menu.
+-# menu_show_core_updater = true
++menu_show_core_updater = false
+ 
+ # If disabled, the libretro core will keep running in the background when we
+ # are in the menu.
+-- 
+2.31.1
+
diff --git a/pkgs/misc/emulators/retroarch/0002-Use-fixed-paths-on-libretro_info_path.patch b/pkgs/misc/emulators/retroarch/0002-Use-fixed-paths-on-libretro_info_path.patch
new file mode 100644
index 0000000000000..9aa8db6ab048b
--- /dev/null
+++ b/pkgs/misc/emulators/retroarch/0002-Use-fixed-paths-on-libretro_info_path.patch
@@ -0,0 +1,80 @@
+From 6788718299e1aba3ff8b31cd6ef012e8d3643bd3 Mon Sep 17 00:00:00 2001
+From: Thiago Kenji Okada <thiagokokada@gmail.com>
+Date: Sat, 20 Nov 2021 15:59:23 -0300
+Subject: [PATCH 2/2] Use fixed paths on "libretro_info_path"
+
+This patch sets "libretro_info_path" to `handle = false`, so instead of
+using the values from `retroarch.cfg`, it will always use the default.
+
+Also, it patches the default "libretro_info_path" to the
+`@libretro_info_path` string, so we can substitute it with the full path
+to it during build.
+---
+ configuration.c                    | 2 +-
+ frontend/drivers/platform_darwin.m | 9 ++-------
+ frontend/drivers/platform_unix.c   | 8 ++++----
+ 3 files changed, 7 insertions(+), 12 deletions(-)
+
+diff --git a/configuration.c b/configuration.c
+index e6a3841324..afb1d6e2ce 100644
+--- a/configuration.c
++++ b/configuration.c
+@@ -1456,7 +1456,7 @@ static struct config_path_setting *populate_settings_path(
+    SETTING_PATH("core_options_path",
+          settings->paths.path_core_options, false, NULL, true);
+    SETTING_PATH("libretro_info_path",
+-         settings->paths.path_libretro_info, false, NULL, true);
++         settings->paths.path_libretro_info, false, NULL, false);
+    SETTING_PATH("content_database_path",
+          settings->paths.path_content_database, false, NULL, true);
+    SETTING_PATH("cheat_database_path",
+diff --git a/frontend/drivers/platform_darwin.m b/frontend/drivers/platform_darwin.m
+index f922e50c55..52732f65ae 100644
+--- a/frontend/drivers/platform_darwin.m
++++ b/frontend/drivers/platform_darwin.m
+@@ -383,14 +383,9 @@ static void frontend_darwin_get_env(int *argc, char *argv[],
+          home_dir_buf, "shaders_glsl",
+          sizeof(g_defaults.dirs[DEFAULT_DIR_SHADER]));
+ #endif
+-#ifdef HAVE_UPDATE_CORES
+     fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE],
+-		    home_dir_buf, "cores", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE]));
+-#else
+-    fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE],
+-		    bundle_path_buf, "modules", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE]));
+-#endif
+-   fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_INFO], home_dir_buf, "info", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_INFO]));
++		    "@libretro_directory@", "", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE]));
++   fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_INFO], "@libretro_info_path@", "", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_INFO]));
+    fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_OVERLAY], home_dir_buf, "overlays", sizeof(g_defaults.dirs[DEFAULT_DIR_OVERLAY]));
+ #ifdef HAVE_VIDEO_LAYOUT
+    fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT], home_dir_buf, "layouts", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_LAYOUT]));
+diff --git a/frontend/drivers/platform_unix.c b/frontend/drivers/platform_unix.c
+index 722e1c595c..d87e01cf12 100644
+--- a/frontend/drivers/platform_unix.c
++++ b/frontend/drivers/platform_unix.c
+@@ -1815,8 +1815,8 @@ static void frontend_unix_get_env(int *argc,
+       strcpy_literal(base_path, "retroarch");
+ #endif
+ 
+-   fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE], base_path,
+-         "cores", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE]));
++   fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE], "@libretro_directory@",
++         "", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE]));
+ #if defined(DINGUX)
+    /* On platforms that require manual core installation/
+     * removal, placing core info files in the same directory
+@@ -1825,8 +1825,8 @@ static void frontend_unix_get_env(int *argc,
+    fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_INFO], base_path,
+          "core_info", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_INFO]));
+ #else
+-   fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_INFO], base_path,
+-         "cores", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_INFO]));
++   fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_INFO], "@libretro_info_path@",
++         "", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_INFO]));
+ #endif
+    fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_AUTOCONFIG], base_path,
+          "autoconfig", sizeof(g_defaults.dirs[DEFAULT_DIR_AUTOCONFIG]));
+-- 
+2.31.1
+
diff --git a/pkgs/misc/emulators/retroarch/cores.nix b/pkgs/misc/emulators/retroarch/cores.nix
index c7b94e29589a5..ab13e041139c4 100644
--- a/pkgs/misc/emulators/retroarch/cores.nix
+++ b/pkgs/misc/emulators/retroarch/cores.nix
@@ -91,6 +91,8 @@ let
             --add-flags "-L $COREDIR/${d2u core}_libretro${stdenv.hostPlatform.extensions.sharedLibrary} $@"
         '';
 
+        enableParallelBuilding = true;
+
         passthru = {
           inherit core;
           libretroCore = "/lib/retroarch/cores";
@@ -427,7 +429,6 @@ in
     core = "mame";
     description = "Port of MAME to libretro";
     license = with lib.licenses; [ bsd3 gpl2Plus ];
-
     extraBuildInputs = [ alsa-lib libGLU libGL portaudio python3 xorg.libX11 ];
     postPatch = ''
       # Prevent the failure during the parallel building of:
@@ -443,6 +444,7 @@ in
     license = "MAME";
     makefile = "Makefile";
     makeFlags = lib.optional (!stdenv.hostPlatform.isx86) "IS_X86=0";
+    enableParallelBuilding = false;
   };
 
   mame2003 = mkLibRetroCore {
@@ -450,6 +452,7 @@ in
     description = "Port of MAME ~2003 to libretro";
     license = "MAME";
     makefile = "Makefile";
+    enableParallelBuilding = false;
   };
 
   mame2003-plus = mkLibRetroCore {
@@ -457,6 +460,7 @@ in
     description = "Port of MAME ~2003+ to libretro";
     license = "MAME";
     makefile = "Makefile";
+    enableParallelBuilding = false;
   };
 
   mame2010 = mkLibRetroCore {
@@ -465,6 +469,7 @@ in
     license = "MAME";
     makefile = "Makefile";
     makeFlags = lib.optionals stdenv.hostPlatform.isAarch64 [ "PTR64=1" "ARM_ENABLED=1" "X86_SH2DRC=0" "FORCE_DRC_C_BACKEND=1" ];
+    enableParallelBuilding = false;
   };
 
   mame2015 = mkLibRetroCore {
@@ -474,6 +479,7 @@ in
     extraNativeBuildInputs = [ python27 ];
     extraBuildInputs = [ alsa-lib ];
     makefile = "Makefile";
+    enableParallelBuilding = false;
   };
 
   mame2016 = mkLibRetroCore {
@@ -494,6 +500,7 @@ in
       # make -C 3rdparty/genie/build/gmake.linux -f genie.make obj/Release/src/host/lua-5.3.0/src/lgc.o
       mkdir -p 3rdparty/genie/build/gmake.linux/obj/Release/src/host/lua-5.3.0/src
     '';
+    enableParallelBuilding = false;
   };
 
   mesen = mkLibRetroCore {
@@ -523,7 +530,6 @@ in
     src = getCoreSrc "mupen64plus";
     description = "Libretro port of Mupen64 Plus, GL only";
     license = lib.licenses.gpl3Only;
-
     extraBuildInputs = [ libGLU libGL libpng nasm xorg.libX11 ];
     makefile = "Makefile";
   };
diff --git a/pkgs/misc/emulators/retroarch/default.nix b/pkgs/misc/emulators/retroarch/default.nix
index 21cbcb801616a..b2621ba8cc133 100644
--- a/pkgs/misc/emulators/retroarch/default.nix
+++ b/pkgs/misc/emulators/retroarch/default.nix
@@ -55,21 +55,21 @@ stdenv.mkDerivation rec {
   };
 
   patches = [
-    # FIXME: The `retroarch.cfg` file is created once in the first run and only
-    # updated when needed. However, the file may have out-of-date paths
-    # In case of issues (e.g.: cores are not loading), please delete the
-    # `$XDG_CONFIG_HOME/retroarch/retroarch.cfg` file
-    # See: https://github.com/libretro/RetroArch/issues/13251
-    ./fix-config.patch
+    ./0001-Disable-menu_show_core_updater.patch
+    ./0002-Use-fixed-paths-on-libretro_info_path.patch
   ];
 
   postPatch = ''
-    substituteInPlace retroarch.cfg \
+    substituteInPlace "frontend/drivers/platform_unix.c" \
       --replace "@libretro_directory@" "$out/lib" \
-      --replace "@libretro_info_path@" "$out/share/libretro/info" \
+      --replace "@libretro_info_path@" "$out/share/libretro/info"
+    substituteInPlace "frontend/drivers/platform_darwin.m" \
+      --replace "@libretro_directory@" "$out/lib" \
+      --replace "@libretro_info_path@" "$out/share/libretro/info"
   '';
 
-  nativeBuildInputs = [ pkg-config wayland ] ++
+  nativeBuildInputs = [ pkg-config ] ++
+    optional stdenv.isLinux wayland ++
     optional withVulkan makeWrapper;
 
   buildInputs = [ ffmpeg freetype libxml2 libGLU libGL python3 SDL2 which ] ++
@@ -110,5 +110,8 @@ stdenv.mkDerivation rec {
     license = licenses.gpl3Plus;
     platforms = platforms.all;
     maintainers = with maintainers; [ MP2E edwtjo matthewbauer kolbycrouch thiagokokada ];
+    # FIXME: exits with error on macOS:
+    # No Info.plist file in application bundle or no NSPrincipalClass in the Info.plist file, exiting
+    broken = stdenv.isDarwin;
   };
 }
diff --git a/pkgs/misc/emulators/retroarch/disable-menu-show-core-updater.patch b/pkgs/misc/emulators/retroarch/disable-menu-show-core-updater.patch
new file mode 100644
index 0000000000000..34fea554ef71e
--- /dev/null
+++ b/pkgs/misc/emulators/retroarch/disable-menu-show-core-updater.patch
@@ -0,0 +1,13 @@
+diff --git a/retroarch.cfg b/retroarch.cfg
+index cdcb199c9f..ab72f3920f 100644
+--- a/retroarch.cfg
++++ b/retroarch.cfg
+@@ -681,7 +681,7 @@
+ # menu_show_online_updater = true
+ 
+ # If disabled, will hide the ability to update cores (and core info files) inside the menu.
+-# menu_show_core_updater = true
++menu_show_core_updater = false
+ 
+ # If disabled, the libretro core will keep running in the background when we
+ # are in the menu.
diff --git a/pkgs/misc/emulators/retroarch/fix-libretro-paths.patch b/pkgs/misc/emulators/retroarch/fix-libretro-paths.patch
new file mode 100644
index 0000000000000..203ce836533d5
--- /dev/null
+++ b/pkgs/misc/emulators/retroarch/fix-libretro-paths.patch
@@ -0,0 +1,28 @@
+diff --git a/configuration.c b/configuration.c
+index e6a3841324..afb1d6e2ce 100644
+--- a/configuration.c
++++ b/configuration.c
+@@ -1456,7 +1456,7 @@ static struct config_path_setting *populate_settings_path(
+    SETTING_PATH("core_options_path",
+          settings->paths.path_core_options, false, NULL, true);
+    SETTING_PATH("libretro_info_path",
+-         settings->paths.path_libretro_info, false, NULL, true);
++         settings->paths.path_libretro_info, false, NULL, false);
+    SETTING_PATH("content_database_path",
+          settings->paths.path_content_database, false, NULL, true);
+    SETTING_PATH("cheat_database_path",
+diff --git a/frontend/drivers/platform_unix.c b/frontend/drivers/platform_unix.c
+index 722e1c595c..e7313ee038 100644
+--- a/frontend/drivers/platform_unix.c
++++ b/frontend/drivers/platform_unix.c
+@@ -1825,8 +1825,8 @@ static void frontend_unix_get_env(int *argc,
+    fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_INFO], base_path,
+          "core_info", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_INFO]));
+ #else
+-   fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_INFO], base_path,
+-         "cores", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_INFO]));
++   fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_INFO], "@libretro_info_path@",
++         "", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_INFO]));
+ #endif
+    fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_AUTOCONFIG], base_path,
+          "autoconfig", sizeof(g_defaults.dirs[DEFAULT_DIR_AUTOCONFIG]));
diff --git a/pkgs/misc/emulators/retroarch/kodi-advanced-launchers.nix b/pkgs/misc/emulators/retroarch/kodi-advanced-launchers.nix
index ee97e6f7493cb..9d83c46396c37 100644
--- a/pkgs/misc/emulators/retroarch/kodi-advanced-launchers.nix
+++ b/pkgs/misc/emulators/retroarch/kodi-advanced-launchers.nix
@@ -1,6 +1,4 @@
-{ stdenv, pkgs, lib, cores, runtimeShell }:
-
-assert cores != [];
+{ stdenv, pkgs, lib, runtimeShell, cores ? [ ] }:
 
 let
 
diff --git a/pkgs/misc/emulators/wine/cert-path-6.21.patch b/pkgs/misc/emulators/wine/cert-path-6.21.patch
new file mode 100644
index 0000000000000..f0727f422f8c8
--- /dev/null
+++ b/pkgs/misc/emulators/wine/cert-path-6.21.patch
@@ -0,0 +1,15 @@
+diff --git a/dlls/crypt32/unixlib.c b/dlls/crypt32/unixlib.c
+index 7cb521eb98b..5804b88be84 100644
+--- a/dlls/crypt32/unixlib.c
++++ b/dlls/crypt32/unixlib.c
+@@ -654,6 +654,10 @@ static void load_root_certs(void)
+ 
+     for (i = 0; i < ARRAY_SIZE(CRYPT_knownLocations) && list_empty(&root_cert_list); i++)
+         import_certs_from_path( CRYPT_knownLocations[i], TRUE );
++
++    char *nix_cert_file = getenv("NIX_SSL_CERT_FILE");
++    if (nix_cert_file != NULL)
++        import_certs_from_path(nix_cert_file, TRUE);
+ }
+ 
+ static NTSTATUS enum_root_certs( void *args )
diff --git a/pkgs/misc/emulators/wine/sources.nix b/pkgs/misc/emulators/wine/sources.nix
index 647185c8b9ba2..df50f068cf225 100644
--- a/pkgs/misc/emulators/wine/sources.nix
+++ b/pkgs/misc/emulators/wine/sources.nix
@@ -44,9 +44,9 @@ in rec {
 
   unstable = fetchurl rec {
     # NOTE: Don't forget to change the SHA256 for staging as well.
-    version = "6.20";
+    version = "6.22";
     url = "https://dl.winehq.org/wine/source/6.x/wine-${version}.tar.xz";
-    sha256 = "0wc4a8slb3k859sdw9wwy92zc4pq7xw1kbq4frnxbzbvkiz26a20";
+    sha256 = "sha256-gmBCoYGph5cyo9rLv4FnYF8wUpG/z6r16qDslSXXZO8=";
     inherit (stable) gecko32 gecko64;
 
     ## see http://wiki.winehq.org/Mono
@@ -58,14 +58,14 @@ in rec {
 
     patches = [
       # Also look for root certificates at $NIX_SSL_CERT_FILE
-      ./cert-path.patch
+      ./cert-path-6.21.patch
      ];
   };
 
   staging = fetchFromGitHub rec {
     # https://github.com/wine-staging/wine-staging/releases
     inherit (unstable) version;
-    sha256 = "12fvfn77rsqwdprkxiylq09jc81lq34bm8p1zhhn85q6yawpjlbn";
+    sha256 = "sha256-dGyaos6xITiAQdU65/PJQKRl5Rr5xBpgQhXii9iwb+E=";
     owner = "wine-staging";
     repo = "wine-staging";
     rev = "v${version}";
diff --git a/pkgs/misc/vscode-extensions/default.nix b/pkgs/misc/vscode-extensions/default.nix
index f1107d866cc27..f8f892613bac1 100644
--- a/pkgs/misc/vscode-extensions/default.nix
+++ b/pkgs/misc/vscode-extensions/default.nix
@@ -866,8 +866,8 @@ let
         mktplcRef = {
           name = "haskell";
           publisher = "haskell";
-          version = "1.6.1";
-          sha256 = "1l6nrbqkq1p62dkmzs4sy0rxbid3qa1104s3fd9fzkmc1sldzgsn";
+          version = "1.7.1";
+          sha256 = "sha256-UWdj2J5z5cTUsfvlU++LRil0tEiAH2AFb1AwBsfMvoY=";
         };
         meta = with lib; {
           license = licenses.mit;
diff --git a/pkgs/os-specific/linux/fbterm/default.nix b/pkgs/os-specific/linux/fbterm/default.nix
index 4fdbb06c52175..ecf1b5e2b3142 100644
--- a/pkgs/os-specific/linux/fbterm/default.nix
+++ b/pkgs/os-specific/linux/fbterm/default.nix
@@ -9,7 +9,7 @@ let
       sha256 = "0pciv5by989vzvjxsv1jsv4bdp4m8j0nfbl29jm5fwi12w4603vj";
     };
   buildInputs = [ gpm freetype fontconfig ncurses ]
-    ++ lib.optional (stdenv.isi686 || stdenv.isx86_64) libx86;
+    ++ lib.optional stdenv.hostPlatform.isx86 libx86;
 in
 stdenv.mkDerivation {
   inherit (s) pname version;
diff --git a/pkgs/os-specific/linux/firmware/fwupd/default.nix b/pkgs/os-specific/linux/firmware/fwupd/default.nix
index 0333a9e431058..e6c43c0aa6e43 100644
--- a/pkgs/os-specific/linux/firmware/fwupd/default.nix
+++ b/pkgs/os-specific/linux/firmware/fwupd/default.nix
@@ -58,7 +58,7 @@ let
     setuptools
   ]);
 
-  isx86 = stdenv.isx86_64 || stdenv.isi686;
+  isx86 = stdenv.hostPlatform.isx86;
 
   # Dell isn't supported on Aarch64
   haveDell = isx86;
diff --git a/pkgs/os-specific/linux/nmon/default.nix b/pkgs/os-specific/linux/nmon/default.nix
index 18adf9c690570..9372018f5b708 100644
--- a/pkgs/os-specific/linux/nmon/default.nix
+++ b/pkgs/os-specific/linux/nmon/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "nmon";
-  version = "16m";
+  version = "16n";
 
   src = fetchurl {
     url = "mirror://sourceforge/nmon/lmon${version}.c";
-    sha256 = "1hazgrq3m01dzv05639yis1mypcp0jf167n9gqwd3wgxzm2lvv9b";
+    sha256 = "1wpm2f30414b87kpbr9hbidblr5cmfby5skwqd0fkpi5v712q0f0";
   };
 
   buildInputs = [ ncurses ];
diff --git a/pkgs/os-specific/linux/plymouth/default.nix b/pkgs/os-specific/linux/plymouth/default.nix
index 8cb2a00987e13..62950b0852580 100644
--- a/pkgs/os-specific/linux/plymouth/default.nix
+++ b/pkgs/os-specific/linux/plymouth/default.nix
@@ -15,8 +15,8 @@
 }:
 
 stdenv.mkDerivation rec {
-  pname = "plymouth-unstable";
-  version = "2020-12-07";
+  pname = "plymouth";
+  version = "unstable-2021-10-18";
 
   outputs = [
     "out"
@@ -27,8 +27,8 @@ stdenv.mkDerivation rec {
     domain = "gitlab.freedesktop.org";
     owner = "plymouth";
     repo = "plymouth";
-    rev = "c4ced2a2d70edea7fbb95274aa1d01d95928df1b";
-    sha256 = "7CPuKMA0fTt8DBsaA4Td74kHT/O7PW8N3awP04nUnOI=";
+    rev = "18363cd887dbfe7e82a2f4cc1a49ef9513919142";
+    sha256 = "sha256-+AP4ALOFdYFt/8MDXjMaHptkogCwK1iXKuza1zfMaws=";
   };
 
   nativeBuildInputs = [
@@ -47,15 +47,6 @@ stdenv.mkDerivation rec {
     systemd
   ];
 
-  patches = [
-    # KillMode=none is deprecated
-    # https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/123
-    (fetchpatch {
-      url = "https://gitlab.freedesktop.org/plymouth/plymouth/-/commit/b406b0895a95949db2adfedaeda451f36f2b51c3.patch";
-      sha256 = "/UBImNuFO0G/oxlttjGIXon8YXMXlc9XU8uVuR9QuxY=";
-    })
-  ];
-
   postPatch = ''
     sed -i \
       -e "s#plymouthplugindir=.*#plymouthplugindir=/etc/plymouth/plugins/#" \
diff --git a/pkgs/os-specific/linux/powertop/default.nix b/pkgs/os-specific/linux/powertop/default.nix
index b8a0487bc7e77..2b498d9ddc918 100644
--- a/pkgs/os-specific/linux/powertop/default.nix
+++ b/pkgs/os-specific/linux/powertop/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, gettext, libnl, ncurses, pciutils
+{ lib, stdenv, fetchFromGitHub, fetchpatch, gettext, libnl, ncurses, pciutils
 , pkg-config, zlib, autoreconfHook }:
 
 stdenv.mkDerivation rec {
@@ -12,6 +12,15 @@ stdenv.mkDerivation rec {
     sha256 = "1zkr2y5nb1nr22nq8a3zli87iyfasfq6489p7h1k428pv8k45w4f";
   };
 
+  patches = [
+    # Pull upstream patch for ncurses-6.3 compatibility
+    (fetchpatch {
+      name = "ncurses-6.3.patch";
+      url = "https://github.com/fenrus75/powertop/commit/9ef1559a1582f23d599c149601c3a8e06809296c.patch";
+      sha256 = "0qx69f3bwhxgsga9nas8lgrclf1rxvr7fq7fd2n8dv3x4lsb46j1";
+    })
+  ];
+
   outputs = [ "out" "man" ];
 
   nativeBuildInputs = [ pkg-config autoreconfHook ];
diff --git a/pkgs/os-specific/linux/read-edid/default.nix b/pkgs/os-specific/linux/read-edid/default.nix
index 24ad067497663..7f6d224ff4d5b 100644
--- a/pkgs/os-specific/linux/read-edid/default.nix
+++ b/pkgs/os-specific/linux/read-edid/default.nix
@@ -10,9 +10,9 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ cmake ];
-  buildInputs = lib.optional (stdenv.isi686 || stdenv.isx86_64) libx86;
+  buildInputs = lib.optional stdenv.hostPlatform.isx86 libx86;
 
-  cmakeFlags = [ "-DCLASSICBUILD=${if stdenv.isi686 || stdenv.isx86_64 then "ON" else "OFF"}" ];
+  cmakeFlags = [ "-DCLASSICBUILD=${if stdenv.hostPlatform.isx86 then "ON" else "OFF"}" ];
 
   patchPhase = ''
     substituteInPlace CMakeLists.txt --replace 'COPYING' 'LICENSE'
diff --git a/pkgs/os-specific/linux/rtl8812au/default.nix b/pkgs/os-specific/linux/rtl8812au/default.nix
index 1aab3e03cd953..b385b9a27da09 100644
--- a/pkgs/os-specific/linux/rtl8812au/default.nix
+++ b/pkgs/os-specific/linux/rtl8812au/default.nix
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
   makeFlags = [
     "ARCH=${stdenv.hostPlatform.linuxArch}"
     "KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
-    ("CONFIG_PLATFORM_I386_PC=" + (if (stdenv.hostPlatform.isi686 || stdenv.hostPlatform.isx86_64) then "y" else "n"))
+    ("CONFIG_PLATFORM_I386_PC=" + (if stdenv.hostPlatform.isx86 then "y" else "n"))
     ("CONFIG_PLATFORM_ARM_RPI=" + (if (stdenv.hostPlatform.isAarch32 || stdenv.hostPlatform.isAarch64) then "y" else "n"))
   ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [
     "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
diff --git a/pkgs/os-specific/linux/tiptop/default.nix b/pkgs/os-specific/linux/tiptop/default.nix
index c6870d2a4c447..bb9fa28598245 100644
--- a/pkgs/os-specific/linux/tiptop/default.nix
+++ b/pkgs/os-specific/linux/tiptop/default.nix
@@ -9,11 +9,20 @@ stdenv.mkDerivation rec {
     sha256 = "10j1138y3cj3hsmfz4w0bmk90523b0prqwi9nhb4z8xvjnf49i2i";
   };
 
-  patches = [(fetchpatch {
-    name = "reproducibility.patch";
-    url = "https://salsa.debian.org/debian/tiptop/raw/debian/2.3.1-1/debian/patches/0001-fix-reproducibility-of-build-process.patch";
-    sha256 = "116l7n3nl9lj691i7j8x0d0za1i6zpqgghw5d70qfpb17c04cblp";
-  })];
+  patches = [
+    (fetchpatch {
+      name = "reproducibility.patch";
+      url = "https://salsa.debian.org/debian/tiptop/raw/debian/2.3.1-1/debian/patches/0001-fix-reproducibility-of-build-process.patch";
+      sha256 = "116l7n3nl9lj691i7j8x0d0za1i6zpqgghw5d70qfpb17c04cblp";
+    })
+
+    # Pull upstream patch for ncurses-6.3
+    (fetchpatch {
+      name = "ncurses-6.3.patch";
+      url = "https://gitlab.inria.fr/rohou/tiptop/-/commit/a78234c27fdd62fed09430d998950e49e11a1832.patch";
+      sha256 = "1k55agdri7iw3gwm4snj3ps62qzmxlqr6s0868l8qamjw38z9g00";
+    })
+  ];
 
   postPatch = ''
     substituteInPlace ./configure --replace -lcurses -lncurses
diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix
index a84ad21775fc5..1d10fa3f796e6 100644
--- a/pkgs/servers/home-assistant/component-packages.nix
+++ b/pkgs/servers/home-assistant/component-packages.nix
@@ -2,7 +2,7 @@
 # Do not edit!
 
 {
-  version = "2021.11.4";
+  version = "2021.11.5";
   components = {
     "abode" = ps: with ps; [ abodepy ];
     "accuweather" = ps: with ps; [ accuweather ];
@@ -559,7 +559,7 @@
     "nanoleaf" = ps: with ps; [ aionanoleaf ];
     "neato" = ps: with ps; [ aiohttp-cors pybotvac ];
     "nederlandse_spoorwegen" = ps: with ps; [ nsapi ];
-    "ness_alarm" = ps: with ps; [ ]; # missing inputs: nessclient
+    "ness_alarm" = ps: with ps; [ nessclient ];
     "nest" = ps: with ps; [ aiohttp-cors ha-ffmpeg python-nest ]; # missing inputs: google-nest-sdm
     "netatmo" = ps: with ps; [ pyturbojpeg aiohttp-cors hass-nabucasa pyatmo ];
     "netdata" = ps: with ps; [ netdata ];
@@ -572,7 +572,7 @@
     "nextbus" = ps: with ps; [ ]; # missing inputs: py_nextbusnext
     "nextcloud" = ps: with ps; [ nextcloudmonitor ];
     "nfandroidtv" = ps: with ps; [ ]; # missing inputs: notifications-android-tv
-    "nightscout" = ps: with ps; [ ]; # missing inputs: py-nightscout
+    "nightscout" = ps: with ps; [ py-nightscout ];
     "niko_home_control" = ps: with ps; [ niko-home-control ];
     "nilu" = ps: with ps; [ niluclient ];
     "nissan_leaf" = ps: with ps; [ pycarwings2 ];
@@ -945,7 +945,7 @@
     "vivotek" = ps: with ps; [ ]; # missing inputs: libpyvivotek
     "vizio" = ps: with ps; [ pyvizio ];
     "vlc" = ps: with ps; [ python-vlc ];
-    "vlc_telnet" = ps: with ps; [ ]; # missing inputs: aiovlc
+    "vlc_telnet" = ps: with ps; [ aiovlc ];
     "voicerss" = ps: with ps; [ ];
     "volkszaehler" = ps: with ps; [ volkszaehler ];
     "volumio" = ps: with ps; [ pyvolumio ];
diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix
index 688afc5baa0ac..0ee7fcd6b3155 100644
--- a/pkgs/servers/home-assistant/default.nix
+++ b/pkgs/servers/home-assistant/default.nix
@@ -152,7 +152,7 @@ let
   extraBuildInputs = extraPackages py.pkgs;
 
   # Don't forget to run parse-requirements.py after updating
-  hassVersion = "2021.11.4";
+  hassVersion = "2021.11.5";
 
 in with py.pkgs; buildPythonApplication rec {
   pname = "homeassistant";
@@ -169,7 +169,7 @@ in with py.pkgs; buildPythonApplication rec {
     owner = "home-assistant";
     repo = "core";
     rev = version;
-    sha256 = "sha256-411oqzC8VTD7CM9vM/M3m4zW0Ygf2g2hoAXAxGBv7iw=";
+    sha256 = "sha256-5MxArJLzOg9dU4Q2c6BDjvEzR2u7UVumNZjwE84+br8=";
   };
 
   # leave this in, so users don't have to constantly update their downstream patch handling
@@ -536,8 +536,10 @@ in with py.pkgs; buildPythonApplication rec {
     "nam"
     "namecheapdns"
     "neato"
+    "ness_alarm"
     "netatmo"
     "nexia"
+    "nightscout"
     "no_ip"
     "notify"
     "notion"
@@ -723,6 +725,7 @@ in with py.pkgs; buildPythonApplication rec {
     "vesync"
     "vilfo"
     "vizio"
+    "vlc_telnet"
     "voicerss"
     "volumio"
     # disabled, becaused AttributeError: <class 'vultr.vultr.Vultr'> does not have the attribute 'server_list'
diff --git a/pkgs/servers/http/trafficserver/default.nix b/pkgs/servers/http/trafficserver/default.nix
index e7ce72e086e1c..eb4af7bf49184 100644
--- a/pkgs/servers/http/trafficserver/default.nix
+++ b/pkgs/servers/http/trafficserver/default.nix
@@ -63,6 +63,13 @@ stdenv.mkDerivation rec {
       url = "https://github.com/apache/trafficserver/commit/19d3af481cf74c91fbf713fc9d2f8b138ed5fbaf.diff";
       sha256 = "0z1ikgpp00rzrrcqh97931586yn9wbksgai9xlkcjd5cg8gq0150";
     })
+
+    # Fix build against ncurses-6.3:
+    #  https://github.com/apache/trafficserver/pull/8437
+    (fetchpatch {
+      url = "https://github.com/apache/trafficserver/commit/66c86c6b082903a92b9db33c60e3ed947e77d540.patch";
+      sha256 = "1hgpp80xnnjr4k5i6gcllrb7dw4q4xcdrkwxpc1xk2np5cbyxd16";
+    })
   ];
 
   # NOTE: The upstream README indicates that flex is needed for some features,
diff --git a/pkgs/servers/icingaweb2/default.nix b/pkgs/servers/icingaweb2/default.nix
index cf900ffd7fda4..3602f5b010475 100644
--- a/pkgs/servers/icingaweb2/default.nix
+++ b/pkgs/servers/icingaweb2/default.nix
@@ -2,13 +2,13 @@
 
 stdenvNoCC.mkDerivation rec {
   pname = "icingaweb2";
-  version = "2.9.3";
+  version = "2.9.4";
 
   src = fetchFromGitHub {
     owner = "Icinga";
     repo = "icingaweb2";
     rev = "v${version}";
-    sha256 = "sha256-nPzf/SGyjEXuy0Q/Lofe1rSbW+4E6LXKzyi4np3jvF4=";
+    sha256 = "sha256:1fd5d2vhiq3s7qr4hnvnh9vv4ns7dvqwq8s67av89hjf3sqgw13j";
   };
 
   nativeBuildInputs = [ makeWrapper ];
diff --git a/pkgs/servers/icingaweb2/ipl.nix b/pkgs/servers/icingaweb2/ipl.nix
index 20b29962b7c6e..7e67e645be911 100644
--- a/pkgs/servers/icingaweb2/ipl.nix
+++ b/pkgs/servers/icingaweb2/ipl.nix
@@ -2,13 +2,13 @@
 
 stdenvNoCC.mkDerivation rec {
   pname = "icingaweb2-ipl";
-  version = "0.6.1";
+  version = "0.7.0";
 
   src = fetchFromGitHub {
     owner = "Icinga";
     repo = "icinga-php-library";
     rev = "v${version}";
-    sha256 = "sha256-5xlvwB1o6d3mWd0TSybQW9s88q6A7KrledY1L8xaxLU=";
+    sha256 = "sha256:118bg9mxjxajm2ydbycgqdmdx8przwxblsaxc373r0g1dp1lv0fz";
   };
 
   installPhase = ''
diff --git a/pkgs/servers/mail/mailman/default.nix b/pkgs/servers/mail/mailman/default.nix
index 557a9d54c149c..8cd087f4174f7 100644
--- a/pkgs/servers/mail/mailman/default.nix
+++ b/pkgs/servers/mail/mailman/default.nix
@@ -1,10 +1,10 @@
-{ lib, python3, fetchPypi, fetchpatch, pythonOlder, postfix, lynx
+{ lib, buildPythonPackage, fetchPypi, fetchpatch, pythonOlder, python3, postfix, lynx
 }:
 
 let
-  py = python3.override {
+  # Mailman does not support sqlalchemy >= 1.4 https://gitlab.com/mailman/mailman/-/issues/845
+  pythonOverride = python3.override {
     packageOverrides = self: super: {
-      # https://gitlab.com/mailman/mailman/-/issues/845
       sqlalchemy = super.sqlalchemy.overridePythonAttrs (oldAttrs: rec {
         version = "1.3.24";
         src = oldAttrs.src.override {
@@ -14,11 +14,8 @@ let
       });
     };
   };
-
 in
 
-with py.pkgs;
-
 buildPythonPackage rec {
   pname = "mailman";
   version = "3.3.5";
@@ -29,7 +26,7 @@ buildPythonPackage rec {
     sha256 = "12mgxs1ndhdjjkydx48b95na9k9h0disfqgrr6wxx7vda6dqvcwz";
   };
 
-  propagatedBuildInputs = [
+  propagatedBuildInputs = with pythonOverride.pkgs; [
     aiosmtpd
     alembic
     authheaders
diff --git a/pkgs/servers/mail/mailman/hyperkitty.nix b/pkgs/servers/mail/mailman/hyperkitty.nix
index d0d7cbc7fbb68..4d4f714e74879 100644
--- a/pkgs/servers/mail/mailman/hyperkitty.nix
+++ b/pkgs/servers/mail/mailman/hyperkitty.nix
@@ -1,7 +1,7 @@
 { lib
 , buildPythonPackage
-, fetchFromGitLab
-, isPy3k
+, fetchPypi
+, pythonOlder
 
 # dependencies
 , defusedxml
@@ -32,18 +32,12 @@ buildPythonPackage rec {
   pname = "HyperKitty";
   # Note: Mailman core must be on the latest version before upgrading HyperKitty.
   # See: https://gitlab.com/mailman/postorius/-/issues/516#note_544571309
-  #
-  # Update to next stable version > 1.3.4 that has fixed tests, see
-  # https://gitlab.com/mailman/django-mailman3/-/issues/48
   version = "1.3.5";
-  disabled = !isPy3k;
+  disabled = pythonOlder "3.8";
 
-  src = fetchFromGitLab {
-    domain = "gitlab.com";
-    owner = "mailman";
-    repo = "hyperkitty";
-    rev = version;
-    sha256 = "0v70r0r6w0q56hk2hw1qp3ci0bwd9x8inf4gai6ybjqjfskqrxi4";
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "sha256-gmkiK8pIHfubbbxNdm/D6L2o722FptxYgINYdIUOn4Y=";
   };
 
   postPatch = ''
diff --git a/pkgs/servers/mail/mailman/postorius.nix b/pkgs/servers/mail/mailman/postorius.nix
index 57df52d0a0a6e..4022b6fe91c94 100644
--- a/pkgs/servers/mail/mailman/postorius.nix
+++ b/pkgs/servers/mail/mailman/postorius.nix
@@ -6,11 +6,11 @@ buildPythonPackage rec {
   pname = "postorius";
   # Note: Mailman core must be on the latest version before upgrading Postorious.
   # See: https://gitlab.com/mailman/postorius/-/issues/516#note_544571309
-  version = "1.3.5";
+  version = "1.3.6";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0f23c6542bf0f6e6364d678c094ee5804acfe59ecbcc0e944bc4c13834e24e80";
+    sha256 = "sha256-KwzEU9IfcQ6YPZu3jPuFrd6ux/3e2pzoLfTrak/aGmg=";
   };
 
   propagatedBuildInputs = [ django-mailman3 readme_renderer ];
diff --git a/pkgs/servers/mail/mailman/web.nix b/pkgs/servers/mail/mailman/web.nix
index 10adb49be84ff..c517cb3e4e30f 100644
--- a/pkgs/servers/mail/mailman/web.nix
+++ b/pkgs/servers/mail/mailman/web.nix
@@ -1,24 +1,18 @@
-{ buildPythonPackage, lib, fetchgit, isPy3k
-, git, makeWrapper, sassc, hyperkitty, postorius, whoosh, setuptools-scm
+{ buildPythonPackage, lib, fetchPypi, pythonOlder
+, sassc, hyperkitty, postorius, whoosh, setuptools-scm
 }:
 
 buildPythonPackage rec {
   pname = "mailman-web";
-  version = "unstable-2021-04-10";
-  disabled = !isPy3k;
-
-  src = fetchgit {
-    url = "https://gitlab.com/mailman/mailman-web";
-    rev = "19a7abe27dd3bc39c0250440de073f0adecd4da1";
-    sha256 = "0h25140n2jaisl0ri5x7gdmbypiys8vlq8dql1zmaxvq459ybxkn";
-    leaveDotGit = true;
+  version = "0.0.5";
+  disabled = pythonOlder "3.8";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "sha256-9pvs/VATAsMcGNrj58b/LifysEPTNhrAP57sfp4nX6Q=";
   };
 
   postPatch = ''
-    # This is just so people installing from pip also get uwsgi
-    # installed, AFAICT.
-    sed -i '/^  uwsgi$/d' setup.cfg
-
     # Django is depended on transitively by hyperkitty and postorius,
     # and mailman_web has overly restrictive version bounds on it, so
     # let's remove it.
@@ -32,16 +26,15 @@ buildPythonPackage rec {
         --replace /opt/mailman/web /var/lib/mailman-web
   '';
 
-  nativeBuildInputs = [ git makeWrapper setuptools-scm ];
+  nativeBuildInputs = [ setuptools-scm ];
   propagatedBuildInputs = [ hyperkitty postorius whoosh ];
 
   # Tries to check runtime configuration.
   doCheck = false;
 
-  postInstall = ''
-    wrapProgram $out/bin/mailman-web \
-        --suffix PATH : ${lib.makeBinPath [ sassc ]}
-  '';
+  makeWrapperArgs = [
+    "--suffix PATH : ${lib.makeBinPath [ sassc ]}"
+  ];
 
   meta = with lib; {
     description = "Django project for Mailman 3 web interface";
diff --git a/pkgs/servers/mautrix-facebook/default.nix b/pkgs/servers/mautrix-facebook/default.nix
index 2967af52740e5..b3fdef8698b04 100644
--- a/pkgs/servers/mautrix-facebook/default.nix
+++ b/pkgs/servers/mautrix-facebook/default.nix
@@ -7,13 +7,13 @@
 
 python3.pkgs.buildPythonPackage rec {
   pname = "mautrix-facebook";
-  version = "0.3.1";
+  version = "0.3.2";
 
   src = fetchFromGitHub {
     owner = "mautrix";
     repo = "facebook";
     rev = "v${version}";
-    sha256 = "0m7nznx3z6cg4wgvjybdivx22ifxcdri4i8501yibsri0jnpf0y2";
+    sha256 = "1n7gshm2nir6vgjkj36lq9m2bclkgy0y236xi8zvdlvfcb2m596f";
   };
 
   propagatedBuildInputs = with python3.pkgs; [
@@ -34,10 +34,6 @@ python3.pkgs.buildPythonPackage rec {
 
   doCheck = false;
 
-  postPatch = ''
-    sed -ie 's/^asyncpg.*/asyncpg>=0.20/' requirements.txt
-  '';
-
   postInstall = ''
     mkdir -p $out/bin
 
diff --git a/pkgs/servers/misc/navidrome/default.nix b/pkgs/servers/misc/navidrome/default.nix
index 19a89bbbf1cba..2bec7f6912e79 100644
--- a/pkgs/servers/misc/navidrome/default.nix
+++ b/pkgs/servers/misc/navidrome/default.nix
@@ -4,17 +4,17 @@ with lib;
 
 stdenv.mkDerivation rec {
   pname = "navidrome";
-  version = "0.45.1";
+  version = "0.47.0";
 
 
   src = fetchurl (if stdenv.hostPlatform.system == "x86_64-linux"
   then {
     url = "https://github.com/deluan/navidrome/releases/download/v${version}/navidrome_${version}_Linux_x86_64.tar.gz";
-    sha256 = "sha256-TZcXq51sKoeLPmcRpv4VILDmS6dsS7lxlJzTDH0tEWM=";
+    sha256 = "sha256-MoBv2dTCotLnGaZOUWLScYd1+gKSjPXTSkHAR6UircA=";
   }
   else {
     url = "https://github.com/deluan/navidrome/releases/download/v${version}/navidrome_${version}_Linux_arm64.tar.gz";
-    sha256 = "sha256-Va0DSmemj8hsaywoP6WKo/x+QQzSNwHCpU4VWs5lpbI=";
+    sha256 = "sha256-FIjrw+BBJXOjh1AoVdfPZIdcDyk5yS/zKD1O+u31YlE=";
   });
 
   nativeBuildInputs = [ makeWrapper ];
diff --git a/pkgs/servers/rippled/default.nix b/pkgs/servers/rippled/default.nix
index 0655668429a19..835307ae0a008 100644
--- a/pkgs/servers/rippled/default.nix
+++ b/pkgs/servers/rippled/default.nix
@@ -116,12 +116,12 @@ let
   };
 in stdenv.mkDerivation rec {
   pname = "rippled";
-  version = "1.7.0";
+  version = "1.7.3";
 
   src = fetchgit {
     url = "https://github.com/ripple/rippled.git";
     rev = version;
-    sha256 = "1rr5kxks9hsxyxrz90dw259b6fs9lywdlqv0bj2g21a6f7g60v2v";
+    sha256 = "008qzb138r2pi0cqj4d6d5f0grlb2gm87m8j0dj8b0giya22xv6s";
     leaveDotGit = true;
     fetchSubmodules = true;
   };
diff --git a/pkgs/servers/zookeeper/default.nix b/pkgs/servers/zookeeper/default.nix
index becd765fd8de1..f00c749557f15 100644
--- a/pkgs/servers/zookeeper/default.nix
+++ b/pkgs/servers/zookeeper/default.nix
@@ -1,5 +1,9 @@
-{ lib, stdenv, fetchurl, jre, makeWrapper, bash, coreutils }:
-
+{ lib, stdenv, fetchurl, jdk11_headless, makeWrapper, nixosTests, bash, coreutils }:
+let
+  # Latest supported LTS JDK for Zookeeper 3.6:
+  # https://zookeeper.apache.org/doc/r3.6.3/zookeeperAdmin.html#sc_requiredSoftware
+  jre = jdk11_headless;
+in
 stdenv.mkDerivation rec {
   pname = "zookeeper";
   version = "3.6.3";
@@ -33,6 +37,10 @@ stdenv.mkDerivation rec {
     runHook postInstall
   '';
 
+  passthru.tests = {
+    nixos = nixosTests.zookeeper;
+  };
+
   meta = with lib; {
     homepage = "https://zookeeper.apache.org";
     description = "Apache Zookeeper";
diff --git a/pkgs/shells/oil/default.nix b/pkgs/shells/oil/default.nix
index 3d9a2ec24e689..76680c3c3c439 100644
--- a/pkgs/shells/oil/default.nix
+++ b/pkgs/shells/oil/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "oil";
-  version = "0.9.3";
+  version = "0.9.4";
 
   src = fetchurl {
     url = "https://www.oilshell.org/download/oil-${version}.tar.xz";
-    sha256 = "sha256-YvNgcvafM3jgO3nY1SVcHRNglOwRQQ208W7oLxZg79o=";
+    sha256 = "sha256-+sYbzWtowLvy44aqhLEH8mUYUn1DJr9HOgKq3YXlPQI=";
   };
 
   postPatch = ''
@@ -32,6 +32,7 @@ stdenv.mkDerivation rec {
       asl20 # Licence for Oil itself
     ];
 
+    platforms = lib.platforms.all;
     maintainers = with lib.maintainers; [ lheckemann alva ];
     changelog = "https://www.oilshell.org/release/${version}/changelog.html";
   };
diff --git a/pkgs/tools/admin/trivy/default.nix b/pkgs/tools/admin/trivy/default.nix
index 60bf80653a4c8..4330e11bce618 100644
--- a/pkgs/tools/admin/trivy/default.nix
+++ b/pkgs/tools/admin/trivy/default.nix
@@ -1,22 +1,27 @@
-{ lib, buildGoModule, fetchFromGitHub }:
+{ lib
+, buildGoModule
+, fetchFromGitHub
+}:
 
 buildGoModule rec {
   pname = "trivy";
-  version = "0.20.2";
+  version = "0.21.0";
 
   src = fetchFromGitHub {
     owner = "aquasecurity";
     repo = pname;
     rev = "v${version}";
-    sha256 = "sha256-ittOVWsM+1IaILCLCJNOeLxRbRHiiMN4qgLTS9gxV0w=";
+    sha256 = "sha256-weLzW1pyv9q9VKvFxno+f/L29wlpvxlVUZJUwx6Gn2A=";
   };
 
-  vendorSha256 = "sha256-HrDj09gUJtkZhQ3nYfoj0K8+T62ib0CWAhhcuvg8cyc=";
+  vendorSha256 = "sha256-1kQ2m8gFBHKznbjNPtYN0BVrRbxyCs2H1f7+XZqgVvc=";
 
   excludedPackages = "misc";
 
   ldflags = [
-    "-s" "-w" "-X main.version=v${version}"
+    "-s"
+    "-w"
+    "-X main.version=v${version}"
   ];
 
   doInstallCheck = true;
diff --git a/pkgs/tools/archivers/arj/default.nix b/pkgs/tools/archivers/arj/default.nix
index e09e390fa4737..6f365e226e209 100644
--- a/pkgs/tools/archivers/arj/default.nix
+++ b/pkgs/tools/archivers/arj/default.nix
@@ -128,6 +128,11 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoreconfHook ];
 
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace environ.c \
+        --replace "  #include <sys/statfs.h>" "  #include <sys/mount.h>"
+  '';
+
   preAutoreconf = ''
     cd gnu
   '';
diff --git a/pkgs/tools/backup/grab-site/default.nix b/pkgs/tools/backup/grab-site/default.nix
index 2f2f01356b479..fe6496bf212b6 100644
--- a/pkgs/tools/backup/grab-site/default.nix
+++ b/pkgs/tools/backup/grab-site/default.nix
@@ -1,8 +1,15 @@
-{ lib, python37, fetchFromGitHub }:
+{ lib, python38, fetchFromGitHub }:
 let
-  python = python37.override {
+  python = python38.override {
     self = python;
     packageOverrides = self: super: {
+      sqlalchemy = super.sqlalchemy.overridePythonAttrs (oldAttrs: rec {
+        version = "1.3.24";
+        src = oldAttrs.src.override {
+          inherit version;
+          sha256 = "ebbb777cbf9312359b897bf81ba00dae0f5cb69fba2a18265dcc18a6f5ef7519";
+        };
+      });
       tornado = super.tornado_4;
     };
   };
@@ -10,18 +17,18 @@ let
 in
 with python.pkgs; buildPythonApplication rec {
   pname = "grab-site";
-  version = "2.2.0";
+  version = "2.2.2";
 
   src = fetchFromGitHub {
     rev = version;
     owner = "ArchiveTeam";
     repo = "grab-site";
-    sha256 = "1jxcv9dral6h7vfpfqkp1yif6plj0vspzakymkj8hfl75nh0wpv8";
+    sha256 = "0af53g703kqpxa6bn72mb2l5l0qrjknq5wqwl4wryyscdp4xabx4";
   };
 
   postPatch = ''
     substituteInPlace setup.py \
-      --replace '"wpull @ https://github.com/ArchiveTeam/ludios_wpull/tarball/master#egg=wpull-3.0.7"' '"wpull"'
+      --replace '"wpull @ https://github.com/ArchiveTeam/ludios_wpull/tarball/master#egg=wpull-${ludios_wpull.version}"' '"wpull"'
   '';
 
   propagatedBuildInputs = [
diff --git a/pkgs/tools/compression/bsdiff/CVE-2020-14315.patch b/pkgs/tools/compression/bsdiff/CVE-2020-14315.patch
new file mode 100644
index 0000000000000..bb7ff41284eb0
--- /dev/null
+++ b/pkgs/tools/compression/bsdiff/CVE-2020-14315.patch
@@ -0,0 +1,384 @@
+Description: patch for CVE-2020-14315
+ A memory corruption vulnerability is present in bspatch as shipped in
+ Colin Percival’s bsdiff tools version 4.3. Insufficient checks when
+ handling external inputs allows an attacker to bypass the sanity checks
+ in place and write out of a dynamically allocated buffer boundaries.
+Source: https://svnweb.freebsd.org/base/head/usr.bin/bsdiff/bspatch/bspatch.c?revision=352742&view=co
+Author: tony mancill <tmancill@debian.org>
+Comment: The patch was created by comparing the Debian sources to the
+ "Confirmed Patched Version" [1] documented in the
+ X41 D-SEC GmbH Security Advisory: X41-2020-006 [2].
+ References to FreeBSD capsicum have been dropped.  Definitions for
+ TYPE_MINIMUM and TYPE_MAXIMUM have been borrowed from the Debian
+ coreutils package sources but originate in gnulib [3] and are used to
+ define OFF_MIN and OFF_MAX (limits of off_t). Whitespace changes from
+ the confirmed patched version are also included and keep the difference
+ between the Debian sources and the confirmed patched version minimal.
+ .
+ [1] https://svnweb.freebsd.org/base/head/usr.bin/bsdiff/bspatch/bspatch.c?revision=352742&view=co
+ [2] https://www.openwall.com/lists/oss-security/2020/07/09/2
+ [3] https://www.gnu.org/software/gnulib/
+Last-Update: 2021-04-03
+Forwarded: not-needed
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=964796
+
+--- a/bspatch.c
++++ b/bspatch.c
+@@ -1,4 +1,6 @@
+ /*-
++ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
++ *
+  * Copyright 2003-2005 Colin Percival
+  * All rights reserved
+  *
+@@ -24,56 +26,148 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#include <sys/cdefs.h>
+ #if 0
+-__FBSDID("$FreeBSD: src/usr.bin/bsdiff/bspatch/bspatch.c,v 1.1 2005/08/06 01:59:06 cperciva Exp $");
++__FBSDID("$FreeBSD$");
+ #endif
+ 
+ #include <bzlib.h>
+-#include <stdlib.h>
++#include <err.h>
++#include <fcntl.h>
++#include <libgen.h>
++#include <limits.h>
++#include <stdint.h>
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <string.h>
+-#include <err.h>
+ #include <unistd.h>
+-#include <fcntl.h>
++
++#ifndef O_BINARY
++#define O_BINARY 0
++#endif
++#define HEADER_SIZE 32
++
++/* TYPE_MINIMUM and TYPE_MAXIMUM taken from coreutils */
++#ifndef TYPE_MINIMUM
++#define TYPE_MINIMUM(t) \
++  ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
++#endif
++#ifndef TYPE_MAXIMUM
++#define TYPE_MAXIMUM(t) \
++  ((t) ((t) 0 < (t) -1 \
++        ? (t) -1 \
++        : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
++#endif
++
++#ifndef OFF_MAX
++#define OFF_MAX TYPE_MAXIMUM(off_t)
++#endif
++
++#ifndef OFF_MIN
++#define OFF_MIN TYPE_MINIMUM(off_t)
++#endif
++
++static char *newfile;
++static int dirfd = -1;
++
++static void
++exit_cleanup(void)
++{
++
++	if (dirfd != -1 && newfile != NULL)
++		if (unlinkat(dirfd, newfile, 0))
++			warn("unlinkat");
++}
++
++static inline off_t
++add_off_t(off_t a, off_t b)
++{
++	off_t result;
++
++#if __GNUC__ >= 5
++	if (__builtin_add_overflow(a, b, &result))
++		errx(1, "Corrupt patch");
++#else
++	if ((b > 0 && a > OFF_MAX - b) || (b < 0 && a < OFF_MIN - b))
++		errx(1, "Corrupt patch");
++	result = a + b;
++#endif
++	return result;
++}
+ 
+ static off_t offtin(u_char *buf)
+ {
+ 	off_t y;
+ 
+-	y=buf[7]&0x7F;
+-	y=y*256;y+=buf[6];
+-	y=y*256;y+=buf[5];
+-	y=y*256;y+=buf[4];
+-	y=y*256;y+=buf[3];
+-	y=y*256;y+=buf[2];
+-	y=y*256;y+=buf[1];
+-	y=y*256;y+=buf[0];
++	y = buf[7] & 0x7F;
++	y = y * 256; y += buf[6];
++	y = y * 256; y += buf[5];
++	y = y * 256; y += buf[4];
++	y = y * 256; y += buf[3];
++	y = y * 256; y += buf[2];
++	y = y * 256; y += buf[1];
++	y = y * 256; y += buf[0];
+ 
+-	if(buf[7]&0x80) y=-y;
++	if (buf[7] & 0x80)
++		y = -y;
+ 
+-	return y;
++	return (y);
+ }
+ 
+-int main(int argc,char * argv[])
++static void
++usage(void)
+ {
+-	FILE * f, * cpf, * dpf, * epf;
+-	BZFILE * cpfbz2, * dpfbz2, * epfbz2;
++
++	fprintf(stderr, "usage: bspatch oldfile newfile patchfile\n");
++	exit(1);
++}
++
++int main(int argc, char *argv[])
++{
++	FILE *f, *cpf, *dpf, *epf;
++	BZFILE *cpfbz2, *dpfbz2, *epfbz2;
++	char *directory, *namebuf;
+ 	int cbz2err, dbz2err, ebz2err;
+-	int fd;
+-	ssize_t oldsize,newsize;
+-	ssize_t bzctrllen,bzdatalen;
+-	u_char header[32],buf[8];
++	int newfd, oldfd;
++	off_t oldsize, newsize;
++	off_t bzctrllen, bzdatalen;
++	u_char header[HEADER_SIZE], buf[8];
+ 	u_char *old, *new;
+-	off_t oldpos,newpos;
++	off_t oldpos, newpos;
+ 	off_t ctrl[3];
+-	off_t lenread;
+-	off_t i;
++	off_t i, lenread, offset;
+ 
+-	if(argc!=4) errx(1,"usage: %s oldfile newfile patchfile\n",argv[0]);
++	if (argc != 4)
++		usage();
+ 
+ 	/* Open patch file */
+-	if ((f = fopen(argv[3], "r")) == NULL)
++	if ((f = fopen(argv[3], "rb")) == NULL)
++		err(1, "fopen(%s)", argv[3]);
++	/* Open patch file for control block */
++	if ((cpf = fopen(argv[3], "rb")) == NULL)
++		err(1, "fopen(%s)", argv[3]);
++	/* open patch file for diff block */
++	if ((dpf = fopen(argv[3], "rb")) == NULL)
+ 		err(1, "fopen(%s)", argv[3]);
++	/* open patch file for extra block */
++	if ((epf = fopen(argv[3], "rb")) == NULL)
++		err(1, "fopen(%s)", argv[3]);
++	/* open oldfile */
++	if ((oldfd = open(argv[1], O_RDONLY | O_BINARY, 0)) < 0)
++		err(1, "open(%s)", argv[1]);
++	/* open directory where we'll write newfile */
++	if ((namebuf = strdup(argv[2])) == NULL ||
++	    (directory = dirname(namebuf)) == NULL ||
++	    (dirfd = open(directory, O_DIRECTORY)) < 0)
++		err(1, "open %s", argv[2]);
++	free(namebuf);
++	if ((newfile = basename(argv[2])) == NULL)
++		err(1, "basename");
++	/* open newfile */
++	if ((newfd = openat(dirfd, newfile,
++	    O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0666)) < 0)
++		err(1, "open(%s)", argv[2]);
++	atexit(exit_cleanup);
+ 
+ 	/*
+ 	File format:
+@@ -90,104 +185,104 @@
+ 	*/
+ 
+ 	/* Read header */
+-	if (fread(header, 1, 32, f) < 32) {
++	if (fread(header, 1, HEADER_SIZE, f) < HEADER_SIZE) {
+ 		if (feof(f))
+-			errx(1, "Corrupt patch\n");
++			errx(1, "Corrupt patch");
+ 		err(1, "fread(%s)", argv[3]);
+ 	}
+ 
+ 	/* Check for appropriate magic */
+ 	if (memcmp(header, "BSDIFF40", 8) != 0)
+-		errx(1, "Corrupt patch\n");
++		errx(1, "Corrupt patch");
+ 
+ 	/* Read lengths from header */
+-	bzctrllen=offtin(header+8);
+-	bzdatalen=offtin(header+16);
+-	newsize=offtin(header+24);
+-	if((bzctrllen<0) || (bzdatalen<0) || (newsize<0))
+-		errx(1,"Corrupt patch\n");
++	bzctrllen = offtin(header + 8);
++	bzdatalen = offtin(header + 16);
++	newsize = offtin(header + 24);
++	if (bzctrllen < 0 || bzctrllen > OFF_MAX - HEADER_SIZE ||
++	    bzdatalen < 0 || bzctrllen + HEADER_SIZE > OFF_MAX - bzdatalen ||
++	    newsize < 0 || newsize > SSIZE_MAX)
++		errx(1, "Corrupt patch");
+ 
+ 	/* Close patch file and re-open it via libbzip2 at the right places */
+ 	if (fclose(f))
+ 		err(1, "fclose(%s)", argv[3]);
+-	if ((cpf = fopen(argv[3], "r")) == NULL)
+-		err(1, "fopen(%s)", argv[3]);
+-	if (fseeko(cpf, 32, SEEK_SET))
+-		err(1, "fseeko(%s, %lld)", argv[3],
+-		    (long long)32);
++	offset = HEADER_SIZE;
++	if (fseeko(cpf, offset, SEEK_SET))
++		err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset);
+ 	if ((cpfbz2 = BZ2_bzReadOpen(&cbz2err, cpf, 0, 0, NULL, 0)) == NULL)
+ 		errx(1, "BZ2_bzReadOpen, bz2err = %d", cbz2err);
+-	if ((dpf = fopen(argv[3], "r")) == NULL)
+-		err(1, "fopen(%s)", argv[3]);
+-	if (fseeko(dpf, 32 + bzctrllen, SEEK_SET))
+-		err(1, "fseeko(%s, %lld)", argv[3],
+-		    (long long)(32 + bzctrllen));
++	offset = add_off_t(offset, bzctrllen);
++	if (fseeko(dpf, offset, SEEK_SET))
++		err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset);
+ 	if ((dpfbz2 = BZ2_bzReadOpen(&dbz2err, dpf, 0, 0, NULL, 0)) == NULL)
+ 		errx(1, "BZ2_bzReadOpen, bz2err = %d", dbz2err);
+-	if ((epf = fopen(argv[3], "r")) == NULL)
+-		err(1, "fopen(%s)", argv[3]);
+-	if (fseeko(epf, 32 + bzctrllen + bzdatalen, SEEK_SET))
+-		err(1, "fseeko(%s, %lld)", argv[3],
+-		    (long long)(32 + bzctrllen + bzdatalen));
++	offset = add_off_t(offset, bzdatalen);
++	if (fseeko(epf, offset, SEEK_SET))
++		err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset);
+ 	if ((epfbz2 = BZ2_bzReadOpen(&ebz2err, epf, 0, 0, NULL, 0)) == NULL)
+ 		errx(1, "BZ2_bzReadOpen, bz2err = %d", ebz2err);
+ 
+-	if(((fd=open(argv[1],O_RDONLY,0))<0) ||
+-		((oldsize=lseek(fd,0,SEEK_END))==-1) ||
+-		((old=malloc(oldsize+1))==NULL) ||
+-		(lseek(fd,0,SEEK_SET)!=0) ||
+-		(read(fd,old,oldsize)!=oldsize) ||
+-		(close(fd)==-1)) err(1,"%s",argv[1]);
+-	if((new=malloc(newsize+1))==NULL) err(1,NULL);
+-
+-	oldpos=0;newpos=0;
+-	while(newpos<newsize) {
++	if ((oldsize = lseek(oldfd, 0, SEEK_END)) == -1 ||
++	    oldsize > SSIZE_MAX ||
++	    (old = malloc(oldsize)) == NULL ||
++	    lseek(oldfd, 0, SEEK_SET) != 0 ||
++	    read(oldfd, old, oldsize) != oldsize ||
++	    close(oldfd) == -1)
++		err(1, "%s", argv[1]);
++	if ((new = malloc(newsize)) == NULL)
++		err(1, NULL);
++
++	oldpos = 0;
++	newpos = 0;
++	while (newpos < newsize) {
+ 		/* Read control data */
+-		for(i=0;i<=2;i++) {
++		for (i = 0; i <= 2; i++) {
+ 			lenread = BZ2_bzRead(&cbz2err, cpfbz2, buf, 8);
+ 			if ((lenread < 8) || ((cbz2err != BZ_OK) &&
+ 			    (cbz2err != BZ_STREAM_END)))
+-				errx(1, "Corrupt patch\n");
+-			ctrl[i]=offtin(buf);
+-		};
++				errx(1, "Corrupt patch");
++			ctrl[i] = offtin(buf);
++		}
+ 
+ 		/* Sanity-check */
+-		if ((ctrl[0] < 0) || (ctrl[1] < 0))
+-			errx(1,"Corrupt patch\n");
++		if (ctrl[0] < 0 || ctrl[0] > INT_MAX ||
++		    ctrl[1] < 0 || ctrl[1] > INT_MAX)
++			errx(1, "Corrupt patch");
+ 
+ 		/* Sanity-check */
+-		if(newpos+ctrl[0]>newsize)
+-			errx(1,"Corrupt patch\n");
++		if (add_off_t(newpos, ctrl[0]) > newsize)
++			errx(1, "Corrupt patch");
+ 
+ 		/* Read diff string */
+ 		lenread = BZ2_bzRead(&dbz2err, dpfbz2, new + newpos, ctrl[0]);
+ 		if ((lenread < ctrl[0]) ||
+ 		    ((dbz2err != BZ_OK) && (dbz2err != BZ_STREAM_END)))
+-			errx(1, "Corrupt patch\n");
++			errx(1, "Corrupt patch");
+ 
+ 		/* Add old data to diff string */
+-		for(i=0;i<ctrl[0];i++)
+-			if((oldpos+i>=0) && (oldpos+i<oldsize))
+-				new[newpos+i]+=old[oldpos+i];
++		for (i = 0; i < ctrl[0]; i++)
++			if (add_off_t(oldpos, i) < oldsize)
++				new[newpos + i] += old[oldpos + i];
+ 
+ 		/* Adjust pointers */
+-		newpos+=ctrl[0];
+-		oldpos+=ctrl[0];
++		newpos = add_off_t(newpos, ctrl[0]);
++		oldpos = add_off_t(oldpos, ctrl[0]);
+ 
+ 		/* Sanity-check */
+-		if(newpos+ctrl[1]>newsize)
+-			errx(1,"Corrupt patch\n");
++		if (add_off_t(newpos, ctrl[1]) > newsize)
++			errx(1, "Corrupt patch");
+ 
+ 		/* Read extra string */
+ 		lenread = BZ2_bzRead(&ebz2err, epfbz2, new + newpos, ctrl[1]);
+ 		if ((lenread < ctrl[1]) ||
+ 		    ((ebz2err != BZ_OK) && (ebz2err != BZ_STREAM_END)))
+-			errx(1, "Corrupt patch\n");
++			errx(1, "Corrupt patch");
+ 
+ 		/* Adjust pointers */
+-		newpos+=ctrl[1];
+-		oldpos+=ctrl[2];
+-	};
++		newpos = add_off_t(newpos, ctrl[1]);
++		oldpos = add_off_t(oldpos, ctrl[2]);
++	}
+ 
+ 	/* Clean up the bzip2 reads */
+ 	BZ2_bzReadClose(&cbz2err, cpfbz2);
+@@ -197,12 +292,13 @@
+ 		err(1, "fclose(%s)", argv[3]);
+ 
+ 	/* Write the new file */
+-	if(((fd=open(argv[2],O_CREAT|O_TRUNC|O_WRONLY,0666))<0) ||
+-		(write(fd,new,newsize)!=newsize) || (close(fd)==-1))
+-		err(1,"%s",argv[2]);
++	if (write(newfd, new, newsize) != newsize || close(newfd) == -1)
++		err(1, "%s", argv[2]);
++	/* Disable atexit cleanup */
++	newfile = NULL;
+ 
+ 	free(new);
+ 	free(old);
+ 
+-	return 0;
++	return (0);
+ }
diff --git a/pkgs/tools/compression/bsdiff/default.nix b/pkgs/tools/compression/bsdiff/default.nix
index 8f8818781ab4b..b8a86eae89bde 100644
--- a/pkgs/tools/compression/bsdiff/default.nix
+++ b/pkgs/tools/compression/bsdiff/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, bzip2 }:
+{ lib, stdenv, fetchurl, fetchpatch, bzip2 }:
 
 stdenv.mkDerivation rec {
   pname = "bsdiff";
@@ -10,7 +10,27 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ bzip2 ];
-  patches = [ ./include-systypes.patch ];
+  patches = [
+    (fetchpatch {
+      url = "https://sources.debian.org/data/main/b/bsdiff/4.3-22/debian/patches/20-CVE-2014-9862.patch";
+      sha256 = "sha256-3UuUfNvShQ8fLqxCKUTb/n4BmjL4+Nl7aEqCxYrrERQ=";
+    })
+    ./CVE-2020-14315.patch
+    ./include-systypes.patch
+  ] ++ lib.optional stdenv.hostPlatform.isLinux [
+    (fetchpatch {
+      url = "https://sources.debian.org/data/main/b/bsdiff/4.3-22/debian/patches/30-bug-632585-mmap-src-file-instead-of-malloc-read-it.patch";
+      sha256 = "sha256-esbhz2/efUiuQDuF7LGfSeEn3/f1WbqCxQpTs2A0ulI=";
+    })
+    (fetchpatch {
+      url = "https://sources.debian.org/data/main/b/bsdiff/4.3-22/debian/patches/31-bug-632585-mmap-dst-file-instead-of-malloc-read-it.patch";
+      sha256 = "sha256-Of4aOcI0rsgdRzPqyw2VRn2p9wQuo3hdlgDTBdXGzoc=";
+    })
+    (fetchpatch {
+      url = "https://sources.debian.org/data/main/b/bsdiff/4.3-22/debian/patches/32-bug-632585-use-int32_t-instead-off_t-for-file-size.patch";
+      sha256 = "sha256-SooFnFK4uKNXvXQb/LEcH8GocnRtkryExI4b3BZTsAY=";
+    })
+  ];
 
   buildPhase = ''
     $CC -O3 -lbz2 bspatch.c -o bspatch
diff --git a/pkgs/tools/compression/lrzip/default.nix b/pkgs/tools/compression/lrzip/default.nix
index 02f62c3e3c01e..4fe5512b4c6f0 100644
--- a/pkgs/tools/compression/lrzip/default.nix
+++ b/pkgs/tools/compression/lrzip/default.nix
@@ -1,17 +1,33 @@
-{ lib, stdenv, fetchurl, zlib, lzo, bzip2, lz4, nasm, perl }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, zlib, lzo, bzip2, lz4, nasm, perl }:
 
+let
+  inherit (stdenv.hostPlatform) isx86;
+in
 stdenv.mkDerivation rec {
   pname = "lrzip";
   version = "0.641";
 
-  src = fetchurl {
-    url = "http://ck.kolivas.org/apps/lrzip/${pname}-${version}.tar.xz";
-    sha256 = "0ziyanspd96dc3lp2qdcylc7aq8dhb511jhqrhxvlp502fjqjqrc";
+  src = fetchFromGitHub {
+    owner = "ckolivas";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-253CH6TiHWyr13C76y9PXjyB7gj2Bhd2VRgJ5r+cm/g=";
   };
 
-  buildInputs = [ zlib lzo bzip2 lz4 nasm perl ];
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    # Building the ASM/x86 directory creates an empty archive,
+    # which fails on darwin, so remove it
+    # https://github.com/ckolivas/lrzip/issues/193
+    # https://github.com/Homebrew/homebrew-core/pull/85360
+    substituteInPlace lzma/Makefile.am --replace "SUBDIRS = C ASM/x86" "SUBDIRS = C"
+    substituteInPlace configure.ac --replace "-f elf64" "-f macho64"
+  '';
 
-  configureFlags = [
+  nativeBuildInputs = [ autoreconfHook perl ] ++ lib.optionals isx86 [ nasm ];
+
+  buildInputs = [ zlib lzo bzip2 lz4 ];
+
+  configureFlags = lib.optionals (!isx86) [
     "--disable-asm"
   ];
 
diff --git a/pkgs/tools/filesystems/nilfs-utils/default.nix b/pkgs/tools/filesystems/nilfs-utils/default.nix
index ec227c95573fb..3c2dfaf2f1d3d 100644
--- a/pkgs/tools/filesystems/nilfs-utils/default.nix
+++ b/pkgs/tools/filesystems/nilfs-utils/default.nix
@@ -1,4 +1,5 @@
-{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, libuuid, libselinux }:
+{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, libuuid, libselinux
+, e2fsprogs }:
 
 stdenv.mkDerivation rec {
   pname = "nilfs-utils";
@@ -15,6 +16,17 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libuuid libselinux ];
 
+  postPatch = ''
+    # Fix up hardcoded paths.
+    substituteInPlace lib/cleaner_exec.c --replace /sbin/ $out/bin/
+    substituteInPlace sbin/mkfs/mkfs.c --replace /sbin/ ${lib.getBin e2fsprogs}/bin/
+  '';
+
+  # According to upstream, libmount should be detected automatically but the
+  # build system fails to do this. This is likely a bug with their build system
+  # hence it is explicitly enabled here.
+  configureFlags = [ "--with-libmount" ];
+
   installFlags = [
     "sysconfdir=${placeholder "out"}/etc"
     "root_sbindir=${placeholder "out"}/sbin"
diff --git a/pkgs/tools/graphics/pngquant/default.nix b/pkgs/tools/graphics/pngquant/default.nix
index bb0ef85812503..dd145d48fc1bc 100644
--- a/pkgs/tools/graphics/pngquant/default.nix
+++ b/pkgs/tools/graphics/pngquant/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   preConfigure = "patchShebangs .";
 
-  configureFlags = lib.optionals (!stdenv.isi686 && !stdenv.isx86_64) [ "--disable-sse" ];
+  configureFlags = lib.optionals (!stdenv.hostPlatform.isx86) [ "--disable-sse" ];
 
   nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libpng zlib lcms2 ];
diff --git a/pkgs/tools/misc/broot/default.nix b/pkgs/tools/misc/broot/default.nix
index 9817df780ea22..6a8ace3b2a981 100644
--- a/pkgs/tools/misc/broot/default.nix
+++ b/pkgs/tools/misc/broot/default.nix
@@ -15,14 +15,14 @@
 
 rustPlatform.buildRustPackage rec {
   pname = "broot";
-  version = "1.7.1";
+  version = "1.7.3";
 
   src = fetchCrate {
     inherit pname version;
-    sha256 = "sha256-Gg60jeDfHNKUYynJRgN4oLWhcdApWUdO5kRwl5hrFMM=";
+    sha256 = "sha256-qu8COcMuReV8zbDK5lm378SQY+TwDy/lo9T/ldNMfz0=";
   };
 
-  cargoHash = "sha256-xsTlFfgX3Np3M/RqmK30DZBCrY1OXnEkjqBDI+ffd/U=";
+  cargoHash = "sha256-ndFymXT2hA4ZztePDFhAYlMh8Iwxi1/ULZYGq+W5vpE=";
 
   nativeBuildInputs = [
     installShellFiles
diff --git a/pkgs/tools/misc/czkawka/default.nix b/pkgs/tools/misc/czkawka/default.nix
index 9ff6a7aaa9aa9..f2a046322d801 100644
--- a/pkgs/tools/misc/czkawka/default.nix
+++ b/pkgs/tools/misc/czkawka/default.nix
@@ -8,20 +8,22 @@
 , gdk-pixbuf
 , atk
 , gtk3
+, testVersion
+, czkawka
 }:
 
 rustPlatform.buildRustPackage rec {
   pname = "czkawka";
-  version = "3.2.0";
+  version = "3.3.0";
 
   src = fetchFromGitHub {
     owner = "qarmin";
-    repo = pname;
+    repo = "czkawka";
     rev = version;
-    sha256 = "sha256-OBe6nk5C3kO5Lkas9+G+VY3xAzY7SWx8W5CkSbaYJ9Y=";
+    sha256 = "0mikgnsqxj8dgapr2k7i9i8mmsza15kp4nasyd6l1vp2cqy8aki6";
   };
 
-  cargoSha256 = "sha256-Jghkf1mX5ic7zB2KmtOZbSxgF8C6KjRdGG1Yt+dzylI=";
+  cargoSha256 = "009zfy4lk8y51h1wi71mrjp6kc7xnk3r8jlbxvhyqslhqd9w10fv";
 
   nativeBuildInputs = [
     pkg-config
@@ -36,10 +38,15 @@ rustPlatform.buildRustPackage rec {
     gtk3
   ];
 
+  passthru.tests.version = testVersion {
+    package = czkawka;
+    command = "czkawka_cli --version";
+  };
+
   meta = with lib; {
     description = "A simple, fast and easy to use app to remove unnecessary files from your computer";
     homepage = "https://github.com/qarmin/czkawka";
     license = with licenses; [ mit ];
-    maintainers = with maintainers; [ yanganto ];
+    maintainers = with maintainers; [ yanganto _0x4A6F ];
   };
 }
diff --git a/pkgs/tools/misc/fluent-bit/default.nix b/pkgs/tools/misc/fluent-bit/default.nix
index 795e2b39b7b28..713b1df0c4e93 100644
--- a/pkgs/tools/misc/fluent-bit/default.nix
+++ b/pkgs/tools/misc/fluent-bit/default.nix
@@ -11,14 +11,17 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-b+MZuZQB/sl0HcioU1KCxH3TNiXYSPBfC9dBKqCVeXk=";
   };
 
+  patches = lib.optionals stdenv.isDarwin [
+    ./fix-cmetrics-darwin.patch
+    ./fix-luajit-darwin.patch
+  ];
+
   nativeBuildInputs = [ cmake flex bison ];
 
   buildInputs = lib.optionals stdenv.isLinux [ systemd ];
 
   cmakeFlags = [ "-DFLB_METRICS=ON" "-DFLB_HTTP_SERVER=ON" ];
 
-  patches = lib.optionals stdenv.isDarwin [ ./fix-luajit-darwin.patch ];
-
   # _FORTIFY_SOURCE requires compiling with optimization (-O)
   NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-O";
 
diff --git a/pkgs/tools/misc/fluent-bit/fix-cmetrics-darwin.patch b/pkgs/tools/misc/fluent-bit/fix-cmetrics-darwin.patch
new file mode 100644
index 0000000000000..8bd77605cbc07
--- /dev/null
+++ b/pkgs/tools/misc/fluent-bit/fix-cmetrics-darwin.patch
@@ -0,0 +1,23 @@
+diff --git i/lib/cmetrics/src/cmt_time.c w/lib/cmetrics/src/cmt_time.c
+--- i/lib/cmetrics/src/cmt_time.c
++++ w/lib/cmetrics/src/cmt_time.c
+@@ -20,7 +20,7 @@
+ #include <cmetrics/cmt_info.h>
+ 
+ /* MacOS */
+-#ifdef FLB_HAVE_CLOCK_GET_TIME
++#ifdef CMT_HAVE_CLOCK_GET_TIME
+ #include <mach/clock.h>
+ #include <mach/mach.h>
+ #endif
+@@ -41,8 +41,8 @@
+     mach_timespec_t mts;
+     host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
+     clock_get_time(cclock, &mts);
+-    tm->tv_sec = mts.tv_sec;
+-    tm->tv_nsec = mts.tv_nsec;
++    tm.tv_sec = mts.tv_sec;
++    tm.tv_nsec = mts.tv_nsec;
+     mach_port_deallocate(mach_task_self(), cclock);
+ #else /* __STDC_VERSION__ */
+     clock_gettime(CLOCK_REALTIME, &tm);
diff --git a/pkgs/tools/misc/fluent-bit/fix-luajit-darwin.patch b/pkgs/tools/misc/fluent-bit/fix-luajit-darwin.patch
index 21d9c21f5b9b3..ef6be0f5ad354 100644
--- a/pkgs/tools/misc/fluent-bit/fix-luajit-darwin.patch
+++ b/pkgs/tools/misc/fluent-bit/fix-luajit-darwin.patch
@@ -1,14 +1,29 @@
 diff -Naur fluent-bit.old/cmake/luajit.cmake fluent-bit.new/cmake/luajit.cmake
 --- fluent-bit.old/cmake/luajit.cmake
 +++ fluent-bit.new/cmake/luajit.cmake
-@@ -11,10 +11,6 @@
- set(LUAJIT_SRC ${CMAKE_CURRENT_SOURCE_DIR}/${FLB_PATH_LIB_LUAJIT})
+@@ -12,15 +12,7 @@
  set(LUAJIT_DEST ${CMAKE_CURRENT_BINARY_DIR})
  
--if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
--  set(CFLAGS "${CFLAGS} -isysroot ${CMAKE_OSX_SYSROOT}")
--endif()
--
+ if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
+-  set(CFLAGS "${CFLAGS} -isysroot ${CMAKE_OSX_SYSROOT} -fno-stack-check")
+-  if (CMAKE_HOST_SYSTEM_VERSION VERSION_GREATER_EQUAL 20
+-      AND CMAKE_HOST_SYSTEM_VERSION VERSION_LESS 21)
+-    set(DEPLOYMENT_TARGET "MACOSX_DEPLOYMENT_TARGET=11.0")
+-  else()
+-    set(DEPLOYMENT_TARGET "MACOSX_DEPLOYMENT_TARGET=10.15")
+-  endif()
+-else()
+-  set(DEPLOYMENT_TARGET "")
++  set(CFLAGS "${CFLAGS} -fno-stack-check")
+ endif()
+ 
  # luajit (UNIX)
- # =============
- ExternalProject_Add(luajit
+@@ -30,7 +22,7 @@
+   EXCLUDE_FROM_ALL TRUE
+   SOURCE_DIR ${LUAJIT_SRC}
+   CONFIGURE_COMMAND ./configure
+-  BUILD_COMMAND $(MAKE) CROSS=${CROSS_PREFIX} CFLAGS=${CFLAGS} BUILD_MODE=static "XCFLAGS=-fPIC" ${DEPLOYMENT_TARGET}
++  BUILD_COMMAND $(MAKE) DEFAULT_CC=cc CROSS=${CROSS_PREFIX} CFLAGS=${CFLAGS} BUILD_MODE=static "XCFLAGS=-fPIC"
+   INSTALL_COMMAND cp src/libluajit.a "${LUAJIT_DEST}/lib/libluajit.a")
+ 
+ # luajit (Windows)
diff --git a/pkgs/tools/misc/gotify-desktop/default.nix b/pkgs/tools/misc/gotify-desktop/default.nix
index 350f29ec52b04..1da729c706d4a 100644
--- a/pkgs/tools/misc/gotify-desktop/default.nix
+++ b/pkgs/tools/misc/gotify-desktop/default.nix
@@ -21,6 +21,6 @@ rustPlatform.buildRustPackage rec {
     description = "Small Gotify daemon to send messages as desktop notifications";
     homepage = "https://github.com/desbma/gotify-desktop";
     license = licenses.gpl3Plus;
-    maintainers = [ maintainers.bryanasdev000 ];
+    maintainers = with maintainers; [ bryanasdev000 genofire ];
   };
 }
diff --git a/pkgs/tools/misc/ipxe/default.nix b/pkgs/tools/misc/ipxe/default.nix
index 70b1ae48ae9c0..76ce66e568645 100644
--- a/pkgs/tools/misc/ipxe/default.nix
+++ b/pkgs/tools/misc/ipxe/default.nix
@@ -9,7 +9,7 @@ let
     "bin-x86_64-efi/ipxe.efi" = null;
     "bin-x86_64-efi/ipxe.efirom" = null;
     "bin-x86_64-efi/ipxe.usb" = "ipxe-efi.usb";
-  } // lib.optionalAttrs (stdenv.isi686 || stdenv.isx86_64) {
+  } // lib.optionalAttrs stdenv.hostPlatform.isx86 {
     "bin/ipxe.dsk" = null;
     "bin/ipxe.usb" = null;
     "bin/ipxe.iso" = null;
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
   pname = "ipxe";
   version = "1.21.1";
 
-  nativeBuildInputs = [ perl cdrkit xz openssl gnu-efi mtools ] ++ lib.optional (stdenv.isi686 || stdenv.isx86_64) syslinux;
+  nativeBuildInputs = [ perl cdrkit xz openssl gnu-efi mtools ] ++ lib.optional stdenv.hostPlatform.isx86 syslinux;
 
   src = fetchFromGitHub {
     owner = "ipxe";
@@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
 
   makeFlags =
     [ "ECHO_E_BIN_ECHO=echo" "ECHO_E_BIN_ECHO_E=echo" # No /bin/echo here.
-    ] ++ lib.optionals (stdenv.isi686 || stdenv.isx86_64) [
+    ] ++ lib.optionals stdenv.hostPlatform.isx86 [
       "ISOLINUX_BIN_LIST=${syslinux}/share/syslinux/isolinux.bin"
       "LDLINUX_C32=${syslinux}/share/syslinux/ldlinux.c32"
     ] ++ lib.optional (embedScript != null) "EMBED=${embedScript}";
diff --git a/pkgs/tools/misc/vector/default.nix b/pkgs/tools/misc/vector/default.nix
index 9f06c858b48ae..ab75f4349ccd8 100644
--- a/pkgs/tools/misc/vector/default.nix
+++ b/pkgs/tools/misc/vector/default.nix
@@ -28,7 +28,7 @@
 
 let
   pname = "vector";
-  version = "0.17.3";
+  version = "0.18.0";
 in
 rustPlatform.buildRustPackage {
   inherit pname version;
@@ -37,10 +37,10 @@ rustPlatform.buildRustPackage {
     owner = "timberio";
     repo = pname;
     rev = "v${version}";
-    sha256 = "sha256-1Z2GtzWkS7cxzCs+RBKMtWbzIIt4aeS1Iy9kMBEeDMw=";
+    sha256 = "sha256-vkiTvJevslXEF2lDTr2IL2vFBQ+dj1N636Livncsso4=";
   };
 
-  cargoSha256 = "sha256-UEGdvyRPPh5Kb9+0qFyv8UBFslOKn5/R/ineawFA91w=";
+  cargoSha256 = "sha256-u7GzqQex5pqU7DuueMfbxMSOpAzd+uLQTZ2laG/aC+4=";
   nativeBuildInputs = [ pkg-config ];
   buildInputs = [ oniguruma openssl protobuf rdkafka zstd ]
     ++ lib.optionals stdenv.isDarwin [ Security libiconv coreutils CoreServices ];
diff --git a/pkgs/tools/networking/cdpr/default.nix b/pkgs/tools/networking/cdpr/default.nix
index 6ac69b95dba63..0b92fd7aa45c3 100644
--- a/pkgs/tools/networking/cdpr/default.nix
+++ b/pkgs/tools/networking/cdpr/default.nix
@@ -9,6 +9,10 @@ stdenv.mkDerivation rec {
     sha256 = "1idyvyafkk0ifcbi7mc65b60qia6hpsdb6s66j4ggqp7if6vblrj";
   };
 
+  postPatch = ''
+    substituteInPlace Makefile --replace 'gcc' '"$$CC"'
+  '';
+
   buildInputs = [ libpcap ];
 
   installPhase = ''
diff --git a/pkgs/tools/networking/fastd/default.nix b/pkgs/tools/networking/fastd/default.nix
index 8d1594b8187d5..47007e1646ee1 100644
--- a/pkgs/tools/networking/fastd/default.nix
+++ b/pkgs/tools/networking/fastd/default.nix
@@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
   ];
 
   # some options are only available on x86
-  mesonFlags = lib.optionals (!stdenv.isx86_64 && !stdenv.isi686) [
+  mesonFlags = lib.optionals (!stdenv.hostPlatform.isx86) [
     "-Dcipher_salsa20_xmm=disabled"
     "-Dcipher_salsa2012_xmm=disabled"
     "-Dmac_ghash_pclmulqdq=disabled"
diff --git a/pkgs/tools/networking/kail/default.nix b/pkgs/tools/networking/kail/default.nix
index ae431b329eaf3..7777c129dbf5d 100644
--- a/pkgs/tools/networking/kail/default.nix
+++ b/pkgs/tools/networking/kail/default.nix
@@ -1,27 +1,23 @@
-{ lib, buildGoPackage, fetchFromGitHub }:
+{ lib, buildGoModule, fetchFromGitHub }:
 
-buildGoPackage rec {
+buildGoModule rec {
   pname = "kail";
-  version = "0.8.0";
+  version = "0.15.0";
 
-  goPackagePath = "github.com/boz/kail";
+  ldflags = [
+    "-s"
+    "-w"
+    "-X main.version=${version}"
+  ];
 
   src = fetchFromGitHub {
     owner = "boz";
     repo = "kail";
     rev = "v${version}";
-    sha256 = "0ibk7j40pj6f2086qcnwp998wld61d2gvrv7yiy6hlkalhww2pq7";
+    sha256 = "0b4abzk8lc5qa04ywkl8b5hb9jmxhyi2dpgbl27gmw81525wjnj7";
   };
 
-  # regenerate deps.nix using following steps:
-  #
-  # go get -u github.com/boz/kail
-  # cd $GOPATH/src/github.com/boz/kail
-  # git checkout <version>
-  # dep init
-  # dep2nix
-  deleteVendor = true;
-  goDeps = ./deps.nix;
+  vendorSha256 = "09s7sq23hglcb2rsi9igzql39zs4238f3jfmvxz9a8v41da225np";
 
   meta = with lib; {
     description = "Kubernetes log viewer";
diff --git a/pkgs/tools/networking/kail/deps.nix b/pkgs/tools/networking/kail/deps.nix
deleted file mode 100644
index b6d9c3e9cf34c..0000000000000
--- a/pkgs/tools/networking/kail/deps.nix
+++ /dev/null
@@ -1,408 +0,0 @@
-# file generated from Gopkg.lock using dep2nix (https://github.com/nixcloud/dep2nix)
-[
-  {
-    goPackagePath  = "cloud.google.com/go";
-    fetch = {
-      type = "git";
-      url = "https://code.googlesource.com/gocloud";
-      rev =  "06f11fffc537c4aef126d9fd3a92e2d7968f118f";
-      sha256 = "1zhr1pyzk44zb95r2bcs4kkngvmzdr5bac55315nnzl3adx4y4dn";
-    };
-  }
-  {
-    goPackagePath  = "github.com/Azure/go-autorest";
-    fetch = {
-      type = "git";
-      url = "https://github.com/Azure/go-autorest";
-      rev =  "1ff28809256a84bb6966640ff3d0371af82ccba4";
-      sha256 = "0sxvj2j1833bqwxvhq3wq3jgq73rnb81pnzvl0x3y1m0hzpaf2zv";
-    };
-  }
-  {
-    goPackagePath  = "github.com/alecthomas/template";
-    fetch = {
-      type = "git";
-      url = "https://github.com/alecthomas/template";
-      rev =  "a0175ee3bccc567396460bf5acd36800cb10c49c";
-      sha256 = "0qjgvvh26vk1cyfq9fadyhfgdj36f1iapbmr5xp6zqipldz8ffxj";
-    };
-  }
-  {
-    goPackagePath  = "github.com/alecthomas/units";
-    fetch = {
-      type = "git";
-      url = "https://github.com/alecthomas/units";
-      rev =  "2efee857e7cfd4f3d0138cc3cbb1b4966962b93a";
-      sha256 = "1j65b91qb9sbrml9cpabfrcf07wmgzzghrl7809hjjhrmbzri5bl";
-    };
-  }
-  {
-    goPackagePath  = "github.com/boz/go-lifecycle";
-    fetch = {
-      type = "git";
-      url = "https://github.com/boz/go-lifecycle";
-      rev =  "c39961a5a0ce6b046f15d62bcbed79701666a9e0";
-      sha256 = "12xzjzgi0pspb28xrcmp4v33jij2bbg609z1kpq1pql9mxs6h31k";
-    };
-  }
-  {
-    goPackagePath  = "github.com/boz/go-logutil";
-    fetch = {
-      type = "git";
-      url = "https://github.com/boz/go-logutil";
-      rev =  "9d21a9e4757dbc497f947fe5253f9570c34562fa";
-      sha256 = "0rhhyvvz1lvjalv3hx4yvyh90jqfia27nzx9m54m0i7d0znrwpbj";
-    };
-  }
-  {
-    goPackagePath  = "github.com/boz/kcache";
-    fetch = {
-      type = "git";
-      url = "https://github.com/boz/kcache";
-      rev =  "a012826955254d3f31548911e75a9dbd817f9470";
-      sha256 = "0xqw4mgz0scjrcfsyfwfdhggq1q80dv4mdqgdaryy5ir18srg15l";
-    };
-  }
-  {
-    goPackagePath  = "github.com/davecgh/go-spew";
-    fetch = {
-      type = "git";
-      url = "https://github.com/davecgh/go-spew";
-      rev =  "adab96458c51a58dc1783b3335dcce5461522e75";
-      sha256 = "1y743w875aqqwggrh4lwlmqyx7ls5m1bnw5y4vr3zps4ib3gb4n5";
-    };
-  }
-  {
-    goPackagePath  = "github.com/dgrijalva/jwt-go";
-    fetch = {
-      type = "git";
-      url = "https://github.com/dgrijalva/jwt-go";
-      rev =  "06ea1031745cb8b3dab3f6a236daf2b0aa468b7e";
-      sha256 = "08m27vlms74pfy5z79w67f9lk9zkx6a9jd68k3c4msxy75ry36mp";
-    };
-  }
-  {
-    goPackagePath  = "github.com/fatih/color";
-    fetch = {
-      type = "git";
-      url = "https://github.com/fatih/color";
-      rev =  "67c513e5729f918f5e69786686770c27141a4490";
-      sha256 = "045i2y2h1a6ml7fm1b3if4692320kjgg3cpxn7chlmpq7z1bmrrn";
-    };
-  }
-  {
-    goPackagePath  = "github.com/ghodss/yaml";
-    fetch = {
-      type = "git";
-      url = "https://github.com/ghodss/yaml";
-      rev =  "0ca9ea5df5451ffdf184b4428c902747c2c11cd7";
-      sha256 = "0skwmimpy7hlh7pva2slpcplnm912rp3igs98xnqmn859kwa5v8g";
-    };
-  }
-  {
-    goPackagePath  = "github.com/gogo/protobuf";
-    fetch = {
-      type = "git";
-      url = "https://github.com/gogo/protobuf";
-      rev =  "1c2b16bc280d6635de6c52fc1471ab962dc36ec9";
-      sha256 = "0h9vkfy3ydz0d6x72853yg49r9k54cgjnlv6a7v12gzqw47p941i";
-    };
-  }
-  {
-    goPackagePath  = "github.com/golang/glog";
-    fetch = {
-      type = "git";
-      url = "https://github.com/golang/glog";
-      rev =  "23def4e6c14b4da8ac2ed8007337bc5eb5007998";
-      sha256 = "0jb2834rw5sykfr937fxi8hxi2zy80sj2bdn9b3jb4b26ksqng30";
-    };
-  }
-  {
-    goPackagePath  = "github.com/golang/protobuf";
-    fetch = {
-      type = "git";
-      url = "https://github.com/golang/protobuf";
-      rev =  "1909bc2f63dc92bb931deace8b8312c4db72d12f";
-      sha256 = "0d4pknkgp5qlbfpw8xp81dqgrfm0na1pfi2ll559nwvjz5vc90g5";
-    };
-  }
-  {
-    goPackagePath  = "github.com/google/btree";
-    fetch = {
-      type = "git";
-      url = "https://github.com/google/btree";
-      rev =  "316fb6d3f031ae8f4d457c6c5186b9e3ded70435";
-      sha256 = "1fyj10cy2d37mpfk73hjfjwpsgpnmdzf2mrkkvzyx0d41sf46xfd";
-    };
-  }
-  {
-    goPackagePath  = "github.com/google/gofuzz";
-    fetch = {
-      type = "git";
-      url = "https://github.com/google/gofuzz";
-      rev =  "24818f796faf91cd76ec7bddd72458fbced7a6c1";
-      sha256 = "0cq90m2lgalrdfrwwyycrrmn785rgnxa3l3vp9yxkvnv88bymmlm";
-    };
-  }
-  {
-    goPackagePath  = "github.com/googleapis/gnostic";
-    fetch = {
-      type = "git";
-      url = "https://github.com/googleapis/gnostic";
-      rev =  "57b0290873708074edf87ad921eccec8bef5f8ec";
-      sha256 = "14raxxsx2bww4f0am0yygv64h950avkswm7bdvq6k4d4lry6dgg8";
-    };
-  }
-  {
-    goPackagePath  = "github.com/gophercloud/gophercloud";
-    fetch = {
-      type = "git";
-      url = "https://github.com/gophercloud/gophercloud";
-      rev =  "b4c2377fa77951a0e08163f52dc9b3e206355194";
-      sha256 = "00j9ny59zlf3ajwydf2k41n3l92kl2hf0ljx9x73jcfkdkn2xv5k";
-    };
-  }
-  {
-    goPackagePath  = "github.com/gregjones/httpcache";
-    fetch = {
-      type = "git";
-      url = "https://github.com/gregjones/httpcache";
-      rev =  "c1f8028e62adb3d518b823a2f8e6a95c38bdd3aa";
-      sha256 = "1v7fb4ix2xg0plx5p1f7xd1srvimyss7v7ppn3j7py9ycl560qhr";
-    };
-  }
-  {
-    goPackagePath  = "github.com/imdario/mergo";
-    fetch = {
-      type = "git";
-      url = "https://github.com/imdario/mergo";
-      rev =  "e3000cb3d28c72b837601cac94debd91032d19fe";
-      sha256 = "1bsz1aj0h266x7g08jj7f3nd3d5islbad0cygb5vh37hjgzirg4d";
-    };
-  }
-  {
-    goPackagePath  = "github.com/json-iterator/go";
-    fetch = {
-      type = "git";
-      url = "https://github.com/json-iterator/go";
-      rev =  "ab8a2e0c74be9d3be70b3184d9acc634935ded82";
-      sha256 = "1x3wz44p1238gpyzkiiilvvrq9q8dwjdm9kdidq65yjq0zcn0sq4";
-    };
-  }
-  {
-    goPackagePath  = "github.com/mattn/go-colorable";
-    fetch = {
-      type = "git";
-      url = "https://github.com/mattn/go-colorable";
-      rev =  "6df6d4d004b64986bbb0d1b25945f42b44787e90";
-      sha256 = "0ha2biq708is9i3hqc30vihcpajak3qawn0rnacb9k1gyxsxwb60";
-    };
-  }
-  {
-    goPackagePath  = "github.com/mattn/go-isatty";
-    fetch = {
-      type = "git";
-      url = "https://github.com/mattn/go-isatty";
-      rev =  "fc9e8d8ef48496124e79ae0df75490096eccf6fe";
-      sha256 = "1r5f9gkavkb1w6sr0qs5kj16706xirl3qnlq3hqpszkw9w27x65a";
-    };
-  }
-  {
-    goPackagePath  = "github.com/modern-go/concurrent";
-    fetch = {
-      type = "git";
-      url = "https://github.com/modern-go/concurrent";
-      rev =  "bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94";
-      sha256 = "0s0fxccsyb8icjmiym5k7prcqx36hvgdwl588y0491gi18k5i4zs";
-    };
-  }
-  {
-    goPackagePath  = "github.com/modern-go/reflect2";
-    fetch = {
-      type = "git";
-      url = "https://github.com/modern-go/reflect2";
-      rev =  "94122c33edd36123c84d5368cfb2b69df93a0ec8";
-      sha256 = "06a3sablw53n1dqqbr2f53jyksbxdmmk8axaas4yvnhyfi55k4lf";
-    };
-  }
-  {
-    goPackagePath  = "github.com/petar/GoLLRB";
-    fetch = {
-      type = "git";
-      url = "https://github.com/petar/GoLLRB";
-      rev =  "53be0d36a84c2a886ca057d34b6aa4468df9ccb4";
-      sha256 = "01xp3lcamqkvl91jg6ly202gdsgf64j39rkrcqxi6v4pbrcv7hz0";
-    };
-  }
-  {
-    goPackagePath  = "github.com/peterbourgon/diskv";
-    fetch = {
-      type = "git";
-      url = "https://github.com/peterbourgon/diskv";
-      rev =  "5f041e8faa004a95c88a202771f4cc3e991971e6";
-      sha256 = "1mxpa5aad08x30qcbffzk80g9540wvbca4blc1r2qyzl65b8929b";
-    };
-  }
-  {
-    goPackagePath  = "github.com/pkg/errors";
-    fetch = {
-      type = "git";
-      url = "https://github.com/pkg/errors";
-      rev =  "2b3a18b5f0fb6b4f9190549597d3f962c02bc5eb";
-      sha256 = "07fd392kqyaj7fnl4sgzy7fcs0sw4jx3mx2khhgk64n9j9i37l59";
-    };
-  }
-  {
-    goPackagePath  = "github.com/pmezard/go-difflib";
-    fetch = {
-      type = "git";
-      url = "https://github.com/pmezard/go-difflib";
-      rev =  "792786c7400a136282c1664665ae0a8db921c6c2";
-      sha256 = "0c1cn55m4rypmscgf0rrb88pn58j3ysvc2d0432dp3c6fqg6cnzw";
-    };
-  }
-  {
-    goPackagePath  = "github.com/sirupsen/logrus";
-    fetch = {
-      type = "git";
-      url = "https://github.com/sirupsen/logrus";
-      rev =  "181d419aa9e2223811b824e8f0b4af96f9ba9302";
-      sha256 = "08ff47w4clnkym3l0v4hhhfq21zvvwzpljvs0qvki5k0azv7siyc";
-    };
-  }
-  {
-    goPackagePath  = "github.com/spf13/pflag";
-    fetch = {
-      type = "git";
-      url = "https://github.com/spf13/pflag";
-      rev =  "e57e3eeb33f795204c1ca35f56c44f83227c6e66";
-      sha256 = "13mhx4i913jil32j295m3a36jzvq1y64xig0naadiz7q9ja011r2";
-    };
-  }
-  {
-    goPackagePath  = "github.com/stretchr/testify";
-    fetch = {
-      type = "git";
-      url = "https://github.com/stretchr/testify";
-      rev =  "2aa2c176b9dab406a6970f6a55f513e8a8c8b18f";
-      sha256 = "1j92x4291flz3i4pk6bi3y59nnsi6lj34zmyfp7axf68fd8vm5ml";
-    };
-  }
-  {
-    goPackagePath  = "golang.org/x/crypto";
-    fetch = {
-      type = "git";
-      url = "https://go.googlesource.com/crypto";
-      rev =  "b176d7def5d71bdd214203491f89843ed217f420";
-      sha256 = "1ayi4iagsxhf193rx93j6y2rb48730hgm2qbahiq9lawm5g3vc14";
-    };
-  }
-  {
-    goPackagePath  = "golang.org/x/net";
-    fetch = {
-      type = "git";
-      url = "https://go.googlesource.com/net";
-      rev =  "1c05540f6879653db88113bc4a2b70aec4bd491f";
-      sha256 = "0h8yqb0vcqgllgydrf9d3rzp83w8wlr8f0nm6r1rwf2qg30pq1pd";
-    };
-  }
-  {
-    goPackagePath  = "golang.org/x/oauth2";
-    fetch = {
-      type = "git";
-      url = "https://go.googlesource.com/oauth2";
-      rev =  "9a379c6b3e95a790ffc43293c2a78dee0d7b6e20";
-      sha256 = "156wff8s9g3sxni2z80wky4v688pvdgfzxbpfp5rmqjvgqnifxkf";
-    };
-  }
-  {
-    goPackagePath  = "golang.org/x/sys";
-    fetch = {
-      type = "git";
-      url = "https://go.googlesource.com/sys";
-      rev =  "2d3e384235de683634e9080b58f757466840aa48";
-      sha256 = "1w8zrcjv4sfi3skchdbvbixgwzp5n1g0vny8r20dlapnqbazah0x";
-    };
-  }
-  {
-    goPackagePath  = "golang.org/x/text";
-    fetch = {
-      type = "git";
-      url = "https://go.googlesource.com/text";
-      rev =  "b19bf474d317b857955b12035d2c5acb57ce8b01";
-      sha256 = "0wc8csaafp0ps9jb2hdk8d6xpyw1axhk1np73h0z17x09zk3ylcr";
-    };
-  }
-  {
-    goPackagePath  = "golang.org/x/time";
-    fetch = {
-      type = "git";
-      url = "https://go.googlesource.com/time";
-      rev =  "fbb02b2291d28baffd63558aa44b4b56f178d650";
-      sha256 = "0jjqcv6rzihlgg4i797q80g1f6ch5diz2kxqh6488gwkb6nds4h4";
-    };
-  }
-  {
-    goPackagePath  = "google.golang.org/appengine";
-    fetch = {
-      type = "git";
-      url = "https://github.com/golang/appengine";
-      rev =  "d9a072cfa7b9736e44311ef77b3e09d804bfa599";
-      sha256 = "07x7s65q9pydpaniga6zf259kw7qs40q6554wb22inq423wcs0nb";
-    };
-  }
-  {
-    goPackagePath  = "gopkg.in/alecthomas/kingpin.v2";
-    fetch = {
-      type = "git";
-      url = "https://github.com/alecthomas/kingpin";
-      rev =  "1087e65c9441605df944fb12c33f0fe7072d18ca";
-      sha256 = "18llqzkdqf62qbqcv2fd3j0igl6cwwn4dissf5skkvxrcxjcmmj0";
-    };
-  }
-  {
-    goPackagePath  = "gopkg.in/inf.v0";
-    fetch = {
-      type = "git";
-      url = "https://github.com/go-inf/inf";
-      rev =  "3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4";
-      sha256 = "0rf3vwyb8aqnac9x9d6ax7z5526c45a16yjm2pvkijr6qgqz8b82";
-    };
-  }
-  {
-    goPackagePath  = "gopkg.in/yaml.v2";
-    fetch = {
-      type = "git";
-      url = "https://github.com/go-yaml/yaml";
-      rev =  "eb3733d160e74a9c7e442f435eb3bea458e1d19f";
-      sha256 = "1srhvcaa9db3a6xj29mkjr5kg33y71pclrlx4vcwz5m1lgb5c7q6";
-    };
-  }
-  {
-    goPackagePath  = "k8s.io/api";
-    fetch = {
-      type = "git";
-      url = "https://github.com/kubernetes/api";
-      rev =  "2d6f90ab1293a1fb871cf149423ebb72aa7423aa";
-      sha256 = "1cwrwdm104xd3608b1a5mw6a19w45532p647xdwnyn62rw2f08jx";
-    };
-  }
-  {
-    goPackagePath  = "k8s.io/apimachinery";
-    fetch = {
-      type = "git";
-      url = "https://github.com/kubernetes/apimachinery";
-      rev =  "103fd098999dc9c0c88536f5c9ad2e5da39373ae";
-      sha256 = "04navnpm59d75dhlz07rmay7m2izrf4m0i9xklxzqg7mlk9g20jc";
-    };
-  }
-  {
-    goPackagePath  = "k8s.io/client-go";
-    fetch = {
-      type = "git";
-      url = "https://github.com/kubernetes/client-go";
-      rev =  "1f13a808da65775f22cbf47862c4e5898d8f4ca1";
-      sha256 = "1vkcjg80l49hxiadqmkkd031kj6kc10m8mwcnla3k1ml8fv4qna9";
-    };
-  }
-]
diff --git a/pkgs/tools/networking/ookla-speedtest/default.nix b/pkgs/tools/networking/ookla-speedtest/default.nix
index 6f377a0a4bf7c..3834355528e90 100644
--- a/pkgs/tools/networking/ookla-speedtest/default.nix
+++ b/pkgs/tools/networking/ookla-speedtest/default.nix
@@ -19,7 +19,7 @@ in
 stdenv.mkDerivation rec {
   inherit pname version;
 
-  src = srcs.${stdenv.hostPlatform.system};
+  src = srcs.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
 
   setSourceRoot = ''
     sourceRoot=$PWD
diff --git a/pkgs/tools/security/fprintd/tod.nix b/pkgs/tools/security/fprintd/tod.nix
new file mode 100644
index 0000000000000..4900124f8d19a
--- /dev/null
+++ b/pkgs/tools/security/fprintd/tod.nix
@@ -0,0 +1,21 @@
+{ fetchFromGitLab
+, fprintd
+, libfprint-tod
+}:
+
+(fprintd.override { libfprint = libfprint-tod; }).overrideAttrs (oldAttrs:
+  let
+    pname = "fprintd-tod";
+    version = "1.90.9";
+  in
+  {
+    inherit pname version;
+
+    src = fetchFromGitLab {
+      domain = "gitlab.freedesktop.org";
+      owner = "libfprint";
+      repo = "${oldAttrs.pname}";
+      rev = "v${version}";
+      sha256 = "sha256-rOTVThHOY/Q2IIu2RGiv26UE2V/JFfWWnfKZQfKl5Mg=";
+    };
+  })
diff --git a/pkgs/tools/security/masscan/default.nix b/pkgs/tools/security/masscan/default.nix
index 46bae3c20c51a..b7924936d6caf 100644
--- a/pkgs/tools/security/masscan/default.nix
+++ b/pkgs/tools/security/masscan/default.nix
@@ -17,6 +17,11 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-mnGC/moQANloR5ODwRjzJzBa55OEZ9QU+9WpAHxQE/g=";
   };
 
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    # Fix broken install command
+    substituteInPlace Makefile --replace "-pm755" "-pDm755"
+  '';
+
   nativeBuildInputs = [ makeWrapper installShellFiles ];
 
   makeFlags = [
diff --git a/pkgs/tools/security/mkp224o/default.nix b/pkgs/tools/security/mkp224o/default.nix
index dc17cc6027645..17d8e8ad4ffbb 100644
--- a/pkgs/tools/security/mkp224o/default.nix
+++ b/pkgs/tools/security/mkp224o/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
       variants = [
         { suffix = "ref10";         configureFlags = ["--enable-ref10"]; }
         { suffix = "donna";         configureFlags = ["--enable-donna"]; }
-      ] ++ lib.optionals (stdenv.isi686 || stdenv.isx86_64) [
+      ] ++ lib.optionals stdenv.hostPlatform.isx86 [
         { suffix = "donna-sse2";    configureFlags = ["--enable-donna-sse2"]; }
       ] ++ lib.optionals stdenv.isx86_64 [
         { suffix = "amd64-51-30k";  configureFlags = ["--enable-amd64-51-30k"]; }
diff --git a/pkgs/tools/system/plan9port/default.nix b/pkgs/tools/system/plan9port/default.nix
index 6b22dd5fe5ce5..88c786e30b6e9 100644
--- a/pkgs/tools/system/plan9port/default.nix
+++ b/pkgs/tools/system/plan9port/default.nix
@@ -101,7 +101,8 @@ stdenv.mkDerivation {
       kovirobi
     ];
     platforms = platforms.unix;
-    broken = stdenv.isDarwin;
+    # TODO: revisit this when the sdk situation on x86_64-darwin changes
+    broken = stdenv.isDarwin && stdenv.isx86_64;
   };
 }
 # TODO: investigate the mouse chording support patch
diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix
index 2453aa9220867..99e365540a518 100644
--- a/pkgs/top-level/aliases.nix
+++ b/pkgs/top-level/aliases.nix
@@ -787,9 +787,10 @@ mapAliases ({
   qt-3 = throw "qt-3 has been removed from nixpkgs, as it's unmaintained and insecure"; # added 2021-02-15
   rfkill = throw "rfkill has been removed, as it's included in util-linux"; # added 2020-08-23
   riak-cs = throw "riak-cs is not maintained anymore"; # added 2020-10-14
-  ring-daemon = jami-daemon; #added 2021-10-26
+  ring-daemon = jami-daemon; # added 2021-10-26
   radare2-cutter = cutter; # added 2021-03-30
   redkite = throw "redkite was archived by upstream"; # added 2021-04-12
+  retroArchCores = throw "retroArchCores has been removed. Please use overrides instead, e.g.: `retroarch.override { cores = with libretro; [ ... ]; }`"; # added 2021-11-19
   rkt = throw "rkt was archived by upstream"; # added 2020-05-16
   rpiboot-unstable = rpiboot; # added 2021-07-30
   rtv = throw "rtv was archived by upstream. Consider using tuir, an actively maintained fork"; # added 2021-08-08
@@ -992,6 +993,7 @@ mapAliases ({
   wireshark-gtk = throw "wireshark-gtk is not supported anymore. Use wireshark-qt or wireshark-cli instead."; # added 2019-11-18
   wireguard = wireguard-tools; # added 2018-05-19
   morituri = whipper; # added 2018-09-13
+  xbmc-retroarch-advanced-launchers = kodi-retroarch-advanced-launchers; # added 2021-11-19
   xp-pen-g430 = pentablet-driver; # added 2020-05-03
   xdg_utils = xdg-utils; # added 2021-02-01
   xfceUnstable = xfce4-14; # added 2019-09-17
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index ac159ccf3d4a2..e459bd49f3fa0 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -1281,7 +1281,9 @@ with pkgs;
 
   argyllcms = callPackage ../tools/graphics/argyllcms {};
 
-  arj = callPackage ../tools/archivers/arj { };
+  arj = callPackage ../tools/archivers/arj {
+    stdenv = gccStdenv;
+  };
 
   arp-scan = callPackage ../tools/misc/arp-scan { };
 
@@ -3266,9 +3268,7 @@ with pkgs;
 
   marlin-calc = callPackage ../tools/misc/marlin-calc {};
 
-  masscan = callPackage ../tools/security/masscan {
-    stdenv = gccStdenv;
-  };
+  masscan = callPackage ../tools/security/masscan { };
 
   massren = callPackage ../tools/misc/massren { };
 
@@ -5161,9 +5161,7 @@ with pkgs;
     icu = icu63;
   };
 
-  fluent-bit = callPackage ../tools/misc/fluent-bit {
-    stdenv = gccStdenv;
-  };
+  fluent-bit = callPackage ../tools/misc/fluent-bit { };
 
   flux = callPackage ../development/compilers/flux { };
 
@@ -5307,9 +5305,7 @@ with pkgs;
 
   fprintd = callPackage ../tools/security/fprintd { };
 
-  fprintd-tod = callPackage ../tools/security/fprintd {
-    libfprint = libfprint-tod;
-  };
+  fprintd-tod = callPackage ../tools/security/fprintd/tod.nix { };
 
   ferdi = callPackage ../applications/networking/instant-messengers/ferdi {
     mkFranzDerivation = callPackage ../applications/networking/instant-messengers/franz/generic.nix { };
@@ -6539,6 +6535,7 @@ with pkgs;
   isl_0_14 = callPackage ../development/libraries/isl/0.14.1.nix { };
   isl_0_17 = callPackage ../development/libraries/isl/0.17.1.nix { };
   isl_0_20 = callPackage ../development/libraries/isl/0.20.0.nix { };
+  isl_0_24 = callPackage ../development/libraries/isl/0.24.0.nix { };
 
   ispike = callPackage ../development/libraries/science/robotics/ispike { };
 
@@ -8834,9 +8831,7 @@ with pkgs;
     inherit (darwin.apple_sdk.frameworks) Carbon Cocoa IOKit;
   };
 
-  rig = callPackage ../tools/misc/rig {
-    stdenv = gccStdenv;
-  };
+  rig = callPackage ../tools/misc/rig { };
 
   riseup-vpn = libsForQt5.callPackage ../tools/networking/bitmask-vpn {
     provider = "riseup";
@@ -9627,7 +9622,7 @@ with pkgs;
 
   synapse-admin = callPackage ../tools/admin/synapse-admin {};
 
-  sl = callPackage ../tools/misc/sl { stdenv = gccStdenv; };
+  sl = callPackage ../tools/misc/sl { };
 
   socat = callPackage ../tools/networking/socat { };
 
@@ -11607,7 +11602,7 @@ with pkgs;
     if ccWrapper.isGNU then ccWrapper.overrideAttrs(old: {
       cc = old.cc.override {
         reproducibleBuild = false;
-        profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64));
+        profiledCompiler = with stdenv; (!isDarwin && hostPlatform.isx86);
       };
     }) else ccWrapper;
 
@@ -12062,6 +12057,8 @@ with pkgs;
 
   purescript-psa = nodePackages.purescript-psa;
 
+  purenix = haskell.lib.compose.justStaticExecutables haskellPackages.purenix;
+
   spago = callPackage ../development/tools/purescript/spago { };
 
   pulp = nodePackages.pulp;
@@ -13615,6 +13612,10 @@ with pkgs;
     stdenv = if stdenv.isDarwin then stdenv else gcc7Stdenv;
     inherit (darwin.apple_sdk.frameworks) CoreFoundation;
   };
+  racket_7_9 = callPackage ../development/interpreters/racket/racket_7_9.nix {
+    stdenv = if stdenv.isDarwin then stdenv else gcc7Stdenv;
+    inherit (darwin.apple_sdk.frameworks) CoreFoundation;
+  };
   racket-minimal = callPackage ../development/interpreters/racket/minimal.nix { };
 
   rakudo = callPackage ../development/interpreters/rakudo {};
@@ -14319,7 +14320,7 @@ with pkgs;
   credstash = with python3Packages; toPythonApplication credstash;
 
   creduce = callPackage ../development/tools/misc/creduce {
-    inherit (llvmPackages_7) llvm libclang;
+    inherit (llvmPackages_8) llvm libclang;
   };
 
   cscope = callPackage ../development/tools/misc/cscope { };
@@ -21639,9 +21640,7 @@ with pkgs;
 
   xinetd = callPackage ../servers/xinetd { };
 
-  zookeeper = callPackage ../servers/zookeeper {
-    jre = jre8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731
-  };
+  zookeeper = callPackage ../servers/zookeeper { };
 
   zookeeper_mt = callPackage ../development/libraries/zookeeper_mt { };
 
@@ -23554,6 +23553,8 @@ with pkgs;
 
   rime-data = callPackage ../data/misc/rime-data { };
 
+  rose-pine-gtk-theme = callPackage ../data/themes/rose-pine-gtk { };
+
   route159 = callPackage ../data/fonts/route159 { };
 
   sampradaya = callPackage ../data/fonts/sampradaya { };
@@ -29124,94 +29125,6 @@ with pkgs;
 
   wp-cli = callPackage ../development/tools/wp-cli { };
 
-  retroArchCores =
-    let
-      cfg = config.retroarch or {};
-      inherit (lib) optional;
-    in with libretro;
-      ([ ]
-      ++ optional (cfg.enableAtari800 or false) atari800
-      ++ optional (cfg.enableBeetleGBA or false) beetle-gba
-      ++ optional (cfg.enableBeetleLynx or false) beetle-lynx
-      ++ optional (cfg.enableBeetleNGP or false) beetle-ngp
-      ++ optional (cfg.enableBeetlePCEFast or false) beetle-pce-fast
-      ++ optional (cfg.enableBeetlePCFX or false) beetle-pcfx
-      ++ optional (cfg.enableBeetlePSX or false) beetle-psx
-      ++ optional (cfg.enableBeetlePSXHW or false) beetle-psx-hw
-      ++ optional (cfg.enableBeetleSaturn or false) beetle-saturn
-      ++ optional (cfg.enableBeetleSaturnHW or false) beetle-saturn-hw
-      ++ optional (cfg.enableBeetleSNES or false) beetle-snes
-      ++ optional (cfg.enableBeetleSuperGrafx or false) beetle-supergrafx
-      ++ optional (cfg.enableBeetleWswan or false) beetle-wswan
-      ++ optional (cfg.enableBeetleVB or false) beetle-vb
-      ++ optional (cfg.enableBlueMSX or false) bluemsx
-      ++ optional (cfg.enableBsnesMercury or false) bsnes-mercury
-      ++ optional (cfg.enableCitra or false) citra
-      ++ optional (cfg.enableDesmume or false) desmume
-      ++ optional (cfg.enableDesmume2015 or false) desmume2015
-      ++ optional (cfg.enableDolphin or false) dolphin
-      ++ optional (cfg.enableDOSBox or false) dosbox
-      ++ optional (cfg.enableEightyOne or false) eightyone
-      ++ optional (cfg.enableFBAlpha2012 or false) fbalpha2012
-      ++ optional (cfg.enableFBNeo or false) fbneo
-      ++ optional (cfg.enableFceumm or false) fceumm
-      ++ optional (cfg.enableFlycast or false) flycast
-      ++ optional (cfg.enableFMSX or false) fmsx
-      ++ optional (cfg.enableFreeIntv or false) freeintv
-      ++ optional (cfg.enableGambatte or false) gambatte
-      ++ optional (cfg.enableGenesisPlusGX or false) genesis-plus-gx
-      ++ optional (cfg.enableGpsp or false) gpsp
-      ++ optional (cfg.enableGW or false) gw
-      ++ optional (cfg.enableHandy or false) handy
-      ++ optional (cfg.enableHatari or false) hatari
-      ++ optional (cfg.enableMAME or false) mame
-      ++ optional (cfg.enableMAME2000 or false) mame2000
-      ++ optional (cfg.enableMAME2003 or false) mame2003
-      ++ optional (cfg.enableMAME2003Plus or false) mame2003-plus
-      ++ optional (cfg.enableMAME2010 or false) mame2010
-      ++ optional (cfg.enableMAME2015 or false) mame2015
-      ++ optional (cfg.enableMAME2016 or false) mame2016
-      ++ optional (cfg.enableMesen or false) mesen
-      ++ optional (cfg.enableMeteor or false) meteor
-      ++ optional (cfg.enableMGBA or false) mgba
-      ++ optional (cfg.enableMupen64Plus or false) mupen64plus
-      ++ optional (cfg.enableNeoCD or false) neocd
-      ++ optional (cfg.enableNestopia or false) nestopia
-      ++ optional (cfg.enableNP2kai or false) np2kai
-      ++ optional (cfg.enableO2EM or false) o2em
-      ++ optional (cfg.enableOpera or false) opera
-      ++ optional (cfg.enableParallelN64 or false) parallel-n64
-      ++ optional (cfg.enablePCSXRearmed or false) pcsx_rearmed
-      ++ optional (cfg.enablePicodrive or false) picodrive
-      ++ optional (cfg.enablePlay or false) play
-      ++ optional (cfg.enablePPSSPP or false) ppsspp
-      ++ optional (cfg.enablePrboom or false) prboom
-      ++ optional (cfg.enableProSystem or false) prosystem
-      ++ optional (cfg.enableQuickNES or false) quicknes
-      ++ optional (cfg.enableSameBoy or false) sameboy
-      ++ optional (cfg.enableScummVM or false) scummvm
-      ++ optional (cfg.enableSMSPlusGX or false) smsplus-gx
-      ++ optional (cfg.enableSnes9x or false) snes9x
-      ++ optional (cfg.enableSnes9x2002 or false) snes9x2002
-      ++ optional (cfg.enableSnes9x2005 or false) snes9x2005
-      ++ optional (cfg.enableSnes9x2010 or false) snes9x2010
-      ++ optional (cfg.enableStella or false) stella
-      ++ optional (cfg.enableStella2014 or false) stella2014
-      ++ optional (cfg.enableTGBDual or false) tgbdual
-      ++ optional (cfg.enableThePowderToy or false) the-powder-toy
-      ++ optional (cfg.enableTIC80 or false) tic80
-      ++ optional (cfg.enableVbaNext or false) vba-next
-      ++ optional (cfg.enableVbaM or false) vba-m
-      ++ optional (cfg.enableVecx or false) vecx
-      ++ optional (cfg.enableVirtualJaguar or false) virtualjaguar
-      ++ optional (cfg.enableYabause or false) yabause
-      );
-
-  wrapRetroArch = { retroarch }: callPackage ../misc/emulators/retroarch/wrapper.nix {
-    inherit retroarch;
-    cores = retroArchCores;
-  };
-
   wsjtx = qt5.callPackage ../applications/radio/wsjtx { };
 
   wxhexeditor = callPackage ../applications/editors/wxhexeditor {
@@ -29291,10 +29204,7 @@ with pkgs;
   kodi-cli = callPackage ../tools/misc/kodi-cli { };
 
   kodi-retroarch-advanced-launchers =
-    callPackage ../misc/emulators/retroarch/kodi-advanced-launchers.nix {
-      cores = retroArchCores;
-  };
-  xbmc-retroarch-advanced-launchers = kodi-retroarch-advanced-launchers;
+    callPackage ../misc/emulators/retroarch/kodi-advanced-launchers.nix { };
 
   xca = libsForQt5.callPackage ../applications/misc/xca { };
 
@@ -32867,8 +32777,16 @@ with pkgs;
     inherit (darwin.apple_sdk.frameworks) AppKit Foundation;
   };
 
+  wrapRetroArch = { retroarch }: callPackage ../misc/emulators/retroarch/wrapper.nix {
+    inherit retroarch;
+  };
+
   retroarch = wrapRetroArch { retroarch = retroarchBare; };
 
+  retroarchFull = retroarch.override {
+    cores = builtins.filter (c: c ? libretroCore) (builtins.attrValues libretro);
+  };
+
   libretro = recurseIntoAttrs (callPackage ../misc/emulators/retroarch/cores.nix {
     retroarch = retroarchBare;
   });
diff --git a/pkgs/top-level/python-aliases.nix b/pkgs/top-level/python-aliases.nix
index 5ba2d5b0643eb..578803d0da735 100644
--- a/pkgs/top-level/python-aliases.nix
+++ b/pkgs/top-level/python-aliases.nix
@@ -48,6 +48,7 @@ mapAliases ({
   django_taggit = django-taggit; # added 2021-10-11
   dns = dnspython; # added 2017-12-10
   dogpile_cache = dogpile-cache; # added 2021-10-28
+  dogpile-core = throw "dogpile-core is no longer maintained, use dogpile-cache instead"; # added 2021-11-20
   faulthandler = throw "faulthandler is built into ${python.executable}"; # added 2021-07-12
   gitdb2 = throw "gitdb2 has been deprecated, use gitdb instead."; # added 2020-03-14
   glances = throw "glances has moved to pkgs.glances"; # added 2020-20-28
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 39cd8697e1694..eb9e8bf2ec5c0 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -317,6 +317,8 @@ in {
 
   aiohue = callPackage ../development/python-modules/aiohue { };
 
+  aiohwenergy = callPackage ../development/python-modules/aiohwenergy { };
+
   aioimaplib = callPackage ../development/python-modules/aioimaplib { };
 
   aioinflux = callPackage ../development/python-modules/aioinflux { };
@@ -399,6 +401,8 @@ in {
 
   aiounittest = callPackage ../development/python-modules/aiounittest { };
 
+  aiovlc = callPackage ../development/python-modules/aiovlc { };
+
   aiowatttime = callPackage ../development/python-modules/aiowatttime { };
 
   aiowinreg = callPackage ../development/python-modules/aiowinreg { };
@@ -2299,8 +2303,6 @@ in {
 
   dogpile-cache = callPackage ../development/python-modules/dogpile-cache { };
 
-  dogpile-core = callPackage ../development/python-modules/dogpile-core { };
-
   dogtail = callPackage ../development/python-modules/dogtail { };
 
   doit = callPackage ../development/python-modules/doit { };
@@ -4107,6 +4109,8 @@ in {
 
   jupytext = callPackage ../development/python-modules/jupytext { };
 
+  justbackoff = callPackage ../development/python-modules/justbackoff { };
+
   jwcrypto = callPackage ../development/python-modules/jwcrypto { };
 
   jxmlease = callPackage ../development/python-modules/jxmlease { };
@@ -4250,6 +4254,8 @@ in {
 
   lazy-object-proxy = callPackage ../development/python-modules/lazy-object-proxy { };
 
+  lc7001 = callPackage ../development/python-modules/lc7001 { };
+
   ldap = callPackage ../development/python-modules/ldap {
     inherit (pkgs) openldap cyrus_sasl;
   };
@@ -4539,6 +4545,8 @@ in {
 
   luftdaten = callPackage ../development/python-modules/luftdaten { };
 
+  luxtronik = callPackage ../development/python-modules/luxtronik { };
+
   lupa = callPackage ../development/python-modules/lupa { };
 
   lupupy = callPackage ../development/python-modules/lupupy { };
@@ -4970,6 +4978,8 @@ in {
 
   mutf8 = callPackage ../development/python-modules/mutf8 { };
 
+  mujson = callPackage ../development/python-modules/mujson { };
+
   mwclient = callPackage ../development/python-modules/mwclient { };
 
   mwdblib = callPackage ../development/python-modules/mwdblib { };
@@ -5068,6 +5078,8 @@ in {
 
   neo = callPackage ../development/python-modules/neo { };
 
+  nessclient = callPackage ../development/python-modules/nessclient { };
+
   nest-asyncio = callPackage ../development/python-modules/nest-asyncio { };
 
   nestedtext = callPackage ../development/python-modules/nestedtext { };
@@ -6121,6 +6133,8 @@ in {
 
   py-dmidecode = callPackage ../development/python-modules/py-dmidecode { };
 
+  py-nightscout = callPackage ../development/python-modules/py-nightscout { };
+
   py-synologydsm-api = callPackage ../development/python-modules/py-synologydsm-api { };
 
   py-ubjson = callPackage ../development/python-modules/py-ubjson { };
@@ -6372,6 +6386,8 @@ in {
 
   pydyf = callPackage ../development/python-modules/pydyf { };
 
+  pyebus = callPackage ../development/python-modules/pyebus { };
+
   pyechonest = callPackage ../development/python-modules/pyechonest { };
 
   pyeclib = callPackage ../development/python-modules/pyeclib { };
@@ -8092,6 +8108,8 @@ in {
 
   reikna = callPackage ../development/python-modules/reikna { };
 
+  related = callPackage ../development/python-modules/related { };
+
   relatorio = callPackage ../development/python-modules/relatorio { };
 
   remarshal = callPackage ../development/python-modules/remarshal { };
@@ -9584,6 +9602,8 @@ in {
 
   ujson = callPackage ../development/python-modules/ujson { };
 
+  ukkonen = callPackage ../development/python-modules/ukkonen { };
+
   ukpostcodeparser = callPackage ../development/python-modules/ukpostcodeparser { };
 
   umalqurra = callPackage ../development/python-modules/umalqurra { };
@@ -9638,6 +9658,8 @@ in {
 
   untokenize = callPackage ../development/python-modules/untokenize { };
 
+  uonet-request-signer-hebe = callPackage ../development/python-modules/uonet-request-signer-hebe { };
+
   upass = callPackage ../development/python-modules/upass { };
 
   upb-lib = callPackage ../development/python-modules/upb-lib { };
@@ -9809,6 +9831,8 @@ in {
     enablePython = true;
   });
 
+  vulcan-api = callPackage ../development/python-modules/vulcan-api { };
+
   vultr = callPackage ../development/python-modules/vultr { };
 
   vulture = callPackage ../development/python-modules/vulture { };