···4545 </listitem>
4646 <listitem>
4747 <para>
4848+ Grub is updated to 2.04, adding support for booting from F2FS filesystems and
4949+ Btrfs volumes using zstd compression. Note that some users have been unable
5050+to boot after upgrading to 2.04 - for more information, please see <link
5151+xlink:href="https://github.com/NixOS/nixpkgs/issues/61718#issuecomment-617618503">this
5252+ discussion</link>.
5353+ </para>
5454+ </listitem>
5555+ <listitem>
5656+ <para>
4857 Postgresql for NixOS service now defaults to v11.
4958 </para>
5059 </listitem>
···5858 # "libgcc_s.so.1 must be installed for pthread_cancel to work".
59596060 # don't have "libgcc_s.so.1" on darwin
6161- LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s";
6161+ LDFLAGS = stdenv.lib.optionalString
6262+ (!stdenv.isDarwin && !stdenv.hostPlatform.isStatic) "-lgcc_s";
62636364 configureFlags = [ "--with-libreadline-prefix=${readline.dev}" ]
6465 ++ stdenv.lib.optionals stdenv.isSunOS [
+6
pkgs/development/interpreters/wasmer/default.nix
···22222323 nativeBuildInputs = [ cmake pkg-config ];
24242525+ # Since wasmer 0.17 no backends are enabled by default. Backends are now detected
2626+ # using the [makefile](https://github.com/wasmerio/wasmer/blob/master/Makefile).
2727+ # Enabling cranelift as this used to be the old default. At least one backend is
2828+ # needed for the run subcommand to work.
2929+ cargoBuildFlags = [ "--features 'backend-cranelift'" ];
3030+2531 LIBCLANG_PATH = "${llvmPackages.libclang}/lib";
26322733 meta = with lib; {
+26
pkgs/development/libraries/bashup-events/3.2.nix
···11+{ callPackage, fetchFromGitHub }:
22+33+callPackage ./generic.nix {
44+ variant = "3.2";
55+ version = "2019-07-27";
66+ branch = "master";
77+ src = fetchFromGitHub {
88+ owner = "bashup";
99+ repo = "events";
1010+ rev = "83744c21bf720afb8325343674c62ab46a8f3d94";
1111+ hash = "sha256-0VDjd+1T1JBmSDGovWOOecUZmNztlwG32UcstfdigbI=";
1212+ };
1313+ fake = {
1414+ # Note: __ev.encode is actually defined, but it happens in a
1515+ # quoted arg to eval, which resholve currently doesn't (and may
1616+ # never) parse into. See abathur/resholve/issues/2.
1717+ function = [ "__ev.encode" ];
1818+ };
1919+ keep = {
2020+ # allow vars in eval
2121+ eval = [ "e" "f" "q" "r" ];
2222+ # allow vars executed as commands
2323+ "$f" = true;
2424+ "$n" = true;
2525+ };
2626+}
···6677> Fair warning: resholve does *not* aspire to resolving all valid Shell
88> scripts. It depends on the OSH/Oil parser, which aims to support most (but
99-> not all) Bash, and aims to be a ~90% sort of solution.
99+> not all) Bash. resholve aims to be a ~90% sort of solution.
10101111-Let's start with a simple example from one of my own projects:
1111+## API Concepts
1212+1313+The main difference between `resholvePackage` and other builder functions
1414+is the `solutions` attrset, which describes which scripts to resolve and how.
1515+Each "solution" (k=v pair) in this attrset describes one resholve invocation.
1616+1717+> NOTE: For most shell packages, one invocation will probably be enough:
1818+> - Packages with a single script will only need one solution.
1919+> - Packages with multiple scripts can still use one solution if the scripts
2020+> don't require conflicting directives.
2121+> - Packages with scripts that require conflicting directives can use multiple
2222+> solutions to resolve the scripts separately, but produce a single package.
2323+2424+## Basic Example
2525+2626+Here's a simple example from one of my own projects, with annotations:
2727+<!--
2828+TODO: ideally this will use a nixpkgs example; but we don't have any IN yet
2929+and the first package PR (bashup-events) is too complex for this context.
3030+-->
12311332```nix
1433{ stdenv, lib, resholvePackage, fetchFromGitHub, bashup-events44, bashInteractive_5, doCheck ? true, shellcheck }:
···2241 };
23422443 solutions = {
4444+ # Give each solution a short name. This is what you'd use to
4545+ # override its settings, and it shows in (some) error messages.
2546 profile = {
2626- # the only *required* arguments
4747+ # the only *required* arguments are the 3 below
4848+4949+ # Specify 1 or more $out-relative script paths. Unlike many
5050+ # builders, resholvePackage modifies the output files during
5151+ # fixup (to correctly resolve in-package sourcing).
2752 scripts = [ "bin/shellswain.bash" ];
5353+5454+ # "none" for no shebang, "${bash}/bin/bash" for bash, etc.
2855 interpreter = "none";
5656+5757+ # packages resholve should resolve executables from
2958 inputs = [ bashup-events44 ];
3059 };
3160 };
···3968}
4069```
41704242-I'll focus on the `solutions` attribute, since this is the only part
4343-that differs from other derivations.
4444-4545-Each "solution" (k=v pair)
4646-describes one resholve invocation. For most shell packages, one
4747-invocation will probably be enough. resholve will make you be very
4848-explicit about your script's dependencies, and it may also need your
4949-help sorting out some references or problems that it can't safely
5050-handle on its own.
7171+## Options
51725252-If you have more than one script, and your scripts need conflicting
5353-directives, you can specify more than one solution to resolve the
5454-scripts separately, but still produce a single package.
7373+`resholvePackage` maps Nix types/idioms into the flags and environment variables
7474+that the `resholve` CLI expects. Here's an overview:
55755656-Let's take a closer look:
7676+| Option | Type | Containing |
7777+| ------------- | ------- | ----------------------------------------------------- |
7878+| scripts | list | $out-relative string paths to resolve |
7979+| inputs | list | packages to resolve executables from |
8080+| interpreter | string | 'none' or abspath for shebang |
8181+| prologue | file | text to insert before the first code-line |
8282+| epilogue | file | text to isnert after the last code-line |
8383+| flags | list | strings to pass as flags |
8484+| fake | attrset | [directives](#controlling-resolution-with-directives) |
8585+| fix | attrset | [directives](#controlling-resolution-with-directives) |
8686+| keep | attrset | [directives](#controlling-resolution-with-directives) |
57875858-```nix
5959- solutions = {
6060- # each solution has a short name; this is what you'd use to
6161- # override the settings of this solution, and it may also show up
6262- # in (some) error messages.
6363- profile = {
6464- # specify one or more $out-relative script paths (unlike many
6565- # builders, resholve will modify the output files during fixup
6666- # to correctly resolve scripts that source within the package)
6767- scripts = [ "bin/shellswain.bash" ];
6868- # "none" for no shebang, "${bash}/bin/bash" for bash, etc.
6969- interpreter = "none";
7070- # packages resholve should resolve executables from
7171- inputs = [ bashup-events44 ];
7272- };
7373- };
7474-```
8888+## Controlling resolution with directives
75897676-resholve has a (growing) number of options for handling more complex
7777-scripts. I won't cover these in excruciating detail here. You can find
7878-more information about these in `man resholve` via `nixpkgs.resholve`.
9090+In order to resolve a script, resholve will make you disambiguate how it should
9191+handle any potential problems it encounters with directives. There are currently
9292+3 types:
9393+1. `fake` directives tell resholve to pretend it knows about an identifier
9494+ such as a function, builtin, external command, etc. if there's a good reason
9595+ it doesn't already know about it. Common examples:
9696+ - builtins for a non-bash shell
9797+ - loadable builtins
9898+ - platform-specific external commands in cross-platform conditionals
9999+2. `fix` directives give resholve permission to fix something that it can't
100100+ safely fix automatically. Common examples:
101101+ - resolving commands in aliases (this is appropriate for standalone scripts
102102+ that use aliases non-interactively--but it would prevent profile/rc
103103+ scripts from using the latest current-system symlinks.)
104104+ - resolve commands in a variable definition
105105+ - resolve an absolute command path from inputs as if it were a bare reference
106106+3. `keep` directives tell resholve not to raise an error (i.e., ignore)
107107+ something it would usually object to. Common examples:
108108+ - variables used as/within the first word of a command
109109+ - pre-existing absolute or user-relative (~) command paths
110110+ - dynamic (variable) arguments to commands known to accept/run other commands
791118080-Instead, we'll look at the general form of the solutions attrset:
112112+> NOTE: resholve has a (growing) number of directives detailed in `man resholve`
113113+> via `nixpkgs.resholve`.
811148282-```nix
8383-solutions = {
8484- shortname = {
8585- # required
8686- # $out-relative paths to try resolving
8787- scripts = [ "bin/shunit2" ];
8888- # packages to resolve executables from
8989- inputs = [ coreutils gnused gnugrep findutils ];
9090- # path for shebang, or 'none' to omit shebang
9191- interpreter = "${bash}/bin/bash";
115115+Each of these 3 types is represented by its own attrset, where you can think
116116+of the key as a scope. The value should be:
117117+- `true` for any directives that the resholve CLI accepts as a single word
118118+- a list of strings for all other options
119119+<!--
120120+TODO: these should be fully-documented here, but I'm already maintaining
121121+more copies of their specification/behavior than I like, and continuing to
122122+add more at this early date will only ensure that I spend more time updating
123123+docs and less time filling in feature gaps.
921249393- # optional
9494- fake = { fake directives };
9595- fix = { fix directives };
9696- keep = { keep directives };
9797- # file to inject before first code-line of script
9898- prologue = file;
9999- # file to inject after last code-line of script
100100- epilogue = file;
101101- # extra command-line flags passed to resholve; generally this API
102102- # should align with what resholve supports, but flags may help if
103103- # you need to override the version of resholve.
104104- flags = [ ];
105105- };
106106-};
107107-```
125125+Full documentation may be greatly accellerated if someone can help me sort out
126126+single-sourcing. See: https://github.com/abathur/resholve/issues/19
127127+-->
108128109109-The main way you'll adjust how resholve handles your scripts are the
110110-fake, fix, and keep directives. The manpage covers their purpose and
111111-how to format them on the command-line, so I'll focus on how you'll
112112-need to translate them into Nix types.
129129+This will hopefully make more sense when you see it. Here are CLI examples
130130+from the manpage, and the Nix equivalents:
113131114132```nix
115133# --fake 'f:setUp;tearDown builtin:setopt source:/etc/bashrc'
116134fake = {
117117- function = [ "setUp" "tearDown" ];
118118- builtin = [ "setopt" ];
119119- source = [ "/etc/bashrc" ];
135135+ # fake accepts the initial of valid identifier types as a CLI convienience.
136136+ # Use full names in the Nix API.
137137+ function = [ "setUp" "tearDown" ];
138138+ builtin = [ "setopt" ];
139139+ source = [ "/etc/bashrc" ];
120140};
121141122142# --fix 'aliases xargs:ls $GIT:gix'
123143fix = {
124124- # all single-word directives use `true` as value
125125- aliases = true;
126126- xargs = [ "ls" ];
127127- "$GIT" = [ "gix" ];
144144+ # all single-word directives use `true` as value
145145+ aliases = true;
146146+ xargs = [ "ls" ];
147147+ "$GIT" = [ "gix" ];
128148};
129149130150# --keep 'which:git;ls .:$HOME $LS:exa /etc/bashrc ~/.bashrc'
131151keep = {
132132- which = [ "git" "ls" ];
133133- "." = [ "$HOME" ];
134134- "$LS" = [ "exa" ];
135135- "/etc/bashrc" = true;
136136- "~/.bashrc" = true;
152152+ which = [ "git" "ls" ];
153153+ "." = [ "$HOME" ];
154154+ "$LS" = [ "exa" ];
155155+ "/etc/bashrc" = true;
156156+ "~/.bashrc" = true;
137157};
138158```