nixpkgs/pkgs
Austin Seipp 2660037f8c
yosys: enable loading "out of band" plugins
By default, when yosys looks for plugins with the `-m` flag or `plugin`
command, it always looks in `YOSYS_PREFIX/share/yosys/plugins` for a
`.so` file, and loads that.

By design, this is intended to be a single, global, mutable location
such as `/usr/share/yosys/...` on disk, and plugins are supposed to
install their `.so` files here after yosys is installed, and they all
coexist together. Obviously, this won't work for us, but users might
expect these plugins to still work. More importantly, they won't want to
add special cases to their build systems.

Instead, to allow Nix users to use yosys plugins with the same UX (e.g.
natively call `plugin bluespec` or `-m ghdl`), we add a patch to yosys
that allows it to search a new `NIX_YOSYS_PLUGIN_DIRS` search path
environment variable. In tandem, we add a setup hook that adds to this
search path if a package has a `$out/share/yosys/plugins` directory.

Thus, it's enough to just include `yosys`, and any package that has a
yosys plugin in `$out/share/yosys/plugins`, and you can load it with
`-m` or the `plugin` command.

We could use a style like the haskellPackages set, where the set of
packages are "encased" in a lambda, and we pass packages that are
compatible with that version of the compiler:

    haskell.packages.ghc8102.ghcWithPackages (p: with p; [ ... ])

but, realistically, there will probably only ever be one version of
yosys and one set of compatible plugins, so this seems overdone.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2021-01-15 10:13:56 -06:00
..
applications gammastep: 2.0.6 -> 2.0.7 2021-01-15 14:17:42 +01:00
build-support dockerTools: typo 2021-01-15 14:23:51 +01:00
common-updater
data Revert "Merge pull request #105709 from CajuM/symbiflow" 2021-01-15 10:13:27 -06:00
desktops Merge pull request #109363 from rhoriguchi/gnome-shell-extension-clock-override 2021-01-15 02:56:37 +01:00
development yosys: enable loading "out of band" plugins 2021-01-15 10:13:56 -06:00
games Merge pull request #109339 from OmnipotentEntity/katago-1.8.0 2021-01-15 16:51:44 +01:00
misc Merge pull request #108225 from avnik/wine-update 2021-01-14 19:22:06 +00:00
os-specific Merge pull request #108866 from markuskowa/new-targetisns 2021-01-14 21:06:59 +01:00
pkgs-lib
servers Merge pull request #108663 from fabaff/geopy 2021-01-15 10:30:55 +01:00
shells oh-my-zsh: 2021-01-07 → 2021-01-14 2021-01-15 10:39:10 -05:00
stdenv make-bootstrap-tools: stdenv.lib -> lib 2021-01-15 14:24:03 +07:00
test
tools Merge pull request #109450 from msteen/patch-2 2021-01-15 16:55:33 +01:00
top-level Revert "Merge pull request #105709 from CajuM/symbiflow" 2021-01-15 10:13:27 -06:00