···192192193193If set to `true`, the package is marked as "broken", meaning that it won’t show up in `nix-env -qa`, and cannot be built or installed. Such packages should be removed from Nixpkgs eventually unless they are fixed.
194194195195-### `updateWalker` {#var-meta-updateWalker}
196196-197197-If set to `true`, the package is tested to be updated correctly by the `update-walker.sh` script without additional settings. Such packages have `meta.version` set and their homepage (or the page specified by `meta.downloadPage`) contains a direct link to the package tarball.
198198-199195## Licenses {#sec-meta-license}
200196201197The `meta.license` attribute should preferably contain a value from `lib.licenses` defined in [`nixpkgs/lib/licenses.nix`](https://github.com/NixOS/nixpkgs/blob/master/lib/licenses.nix), or in-place license description of the same format if the license is unlikely to be useful in another expression.
···11-Next to file.nix we get src-for-file.nix
22-src-for-file.nix should evaluate to a flat attribute set with
33-string values.
44-It is supposed to be imported in the main expression.
55-In the ideal world it can export url, hash, version.
66-77-src-for-file.nix generation is directed by
88-src-info-for-file.nix.
99-1010-Attributes:
1111-1212-src-info-for-file.nix:
1313-1414-downloadPage
1515-rev (for repos)
1616-baseName (default = unnamed-package)
1717-sourceRegexp (default = '.*[.]tar[.].*')
1818-choiceCommand (default = 'head -1')
1919-versionExtractorSedScript (default = 's/.*-([0-9.]+)[.].*/\1/')
2020-versionReferenceCreator (default = 's/-([0-9.]+)[.]/-${version}./')
2121-mirrorSedScript (default = none)
2222-2323-src-for-file.nix:
2424-2525-advertisedUrl (its match is the check for update presence)
2626-url
2727-hash
2828-version
2929-name
···11-{
22- a=1;
33- b="text";
44- c=''
55- text
66- '';
77- d=''
88- Multi-line text with special characters -
99- like \ (backslash) and ''${} (dollar +
1010- curly braces) and $ (dollar) and ' (quote)
1111- and " (double quote).
1212- '';
1313-}
···11-update-walker is an imperative semiautomated update helper.
22-33-It runs the X.upstream file to find the freshest version of the package in
44-the specified upstream source and updates the corresponding X.nix file.
55-66-77-88-The simplest available commands:
99-1010-url: set the upstream source list URL equal to $1; the default is
1111-meta.downloadPage with meta.homepage fallback
1212-1313-dl_url_re: set the regular expression used to select download links to $1; the
1414-default is meta.downloadURLRegexp or '[.]tar[.]([^./])+\$' if it is not set
1515-1616-target: specify target expression; default is to replace .upstream extension
1717-with .nix extension
1818-1919-name: specify the derivation name; default is the basename of the dirname
2020-of the .upstream file
2121-2222-attribute_name: specify the attribute name to evaluate for getting the current
2323-version from meta.version; default is to use the derivation name
2424-2525-minimize_overwrite: set config options that mean that only version= and
2626-sha256= have to be replaced; the default is to regenerate a full upstream
2727-description block with url, name, version, hash etc.
2828-2929-3030-3131-A lot of packages can be updated in a pseudo-declarative style using only
3232-the commands from the previous paragraph.
3333-3434-Some packages do not need any non-default settings, in these case just setting
3535-meta.updateWalker to true is enough, you can run update-walker directly on the
3636-.nix file afterwards. In this case minimize_overwrite it implied unless
3737-meta.fullRegenerate is set.
3838-3939-4040-4141-The packages that require more fine-grained control than the described options
4242-allow, you need to take into account the default control flow of the tool.
4343-4444-First, the definitions from update-walker script and additional definitions
4545-from update-walker-service-specific.sh are loaded. Then the config is executed
4646-as a shell script. Some of the commands it can use do remember whether they
4747-have been used. Afterwards the following steps happen:
4848-4949-attribute_name is set to name unless it has been already set
5050-5151-meta.version is read from the NixPkgs package called attribute_name
5252-5353-download URL regexp is set to default unless it has been already set in the
5454-updater script
5555-5656-the download page URL gets set to default value unless it has been set
5757-previously
5858-5959-if the action of getting the download page and choosing the freshest link by
6060-version has not yet been taken, it happens
6161-6262-if the version has not yet been extracted from the URL, it gets extracted
6363-6464-target nix expression to update gets set to the default value unless it has
6565-been set explicitly
6666-6767-if the URL version is fresher than the packaged version, the new file gets
6868-downloaded and its hash is calculated
6969-7070-do_overwrite function is called; the default calculates a big upstream data
7171-block and puts it after the '# Generated upstream information' marker (the
7272-marker can be changed by the command marker)
7373-7474-7575-7676-If the update needs some special logic, it is put into the updater script and
7777-the corresponding steps are skipped because the needed action has already been
7878-performed.
7979-8080-For example:
8181-8282-minimize_overwrite is exactly the same as
8383-8484-do_overwrite() { do_overwrite_just_version; }
8585-8686-redefinition. You can do a more complex do_overwrite redifinition, if needed.
8787-It can probably use ensure_hash to download the source and calculate the hash
8888-and set_var_value.
8989-9090-set_var_value alters the $3-th instance of assigning the $1 name in the
9191-expression to the value $2. $3 defaults to 1. It can modify $4 instead of the
9292-current target, it can put the value without quotes if $5 is 1.
9393-9494-9595-9696-Typical steps include:
9797-9898-ensure_choice: download current URL and find the freshest version link on the
9999-page, it is now the new URL
100100-101101-ensure_hash: download current URL and calculate the source package hash
102102-103103-ensure_version: extract version from the URL
104104-105105-SF_redirect: replace the current URL with a SourceForge.net mirror:// URL
106106-107107-SF_version_dir: assume SourceForge.net layout and choose the freshest
108108-version-named subdirectory in the file catalog; you can optionally specify $1
109109-as a directory name regexp (digits and periods will be required after it)
110110-111111-SF_version_tarball: assume SourceForge.net layout and choose the freshest
112112-tarball download link
113113-114114-version: apply replacement of $1 with $2 (extended regexp format) to extract
115115-the version from URL
116116-117117-version_link: choose the freshest versioned link, $1 is the regexp of
118118-acceptable links