diff options
author | Profpatsch <mail@profpatsch.de> | 2021-01-10 22:30:22 +0100 |
---|---|---|
committer | Profpatsch <mail@profpatsch.de> | 2021-01-11 09:52:27 +0100 |
commit | b0c1583a0b606560a4a47322fc849cfc1cfa0090 (patch) | |
tree | 9aaa3f124d722c2e6231fd1f6bfa38e9d6d1fabc /doc/languages-frameworks | |
parent | 9ff73686ed0127d9cc65633053e6d7a554ff179a (diff) | |
download | nixpkgs-b0c1583a0b606560a4a47322fc849cfc1cfa0090.tar nixpkgs-b0c1583a0b606560a4a47322fc849cfc1cfa0090.tar.gz nixpkgs-b0c1583a0b606560a4a47322fc849cfc1cfa0090.tar.bz2 nixpkgs-b0c1583a0b606560a4a47322fc849cfc1cfa0090.tar.lz nixpkgs-b0c1583a0b606560a4a47322fc849cfc1cfa0090.tar.xz nixpkgs-b0c1583a0b606560a4a47322fc849cfc1cfa0090.tar.zst nixpkgs-b0c1583a0b606560a4a47322fc849cfc1cfa0090.zip |
doc: stdenv.lib -> lib
Part of: https://github.com/NixOS/nixpkgs/issues/108938 Changing the documentation to not refer to stdenv.lib is the first step to make people use it directly.
Diffstat (limited to 'doc/languages-frameworks')
-rw-r--r-- | doc/languages-frameworks/lua.section.md | 3 | ||||
-rw-r--r-- | doc/languages-frameworks/maven.section.md | 4 | ||||
-rw-r--r-- | doc/languages-frameworks/ocaml.section.md | 10 | ||||
-rw-r--r-- | doc/languages-frameworks/perl.section.md | 8 | ||||
-rw-r--r-- | doc/languages-frameworks/rust.section.md | 6 |
5 files changed, 15 insertions, 16 deletions
diff --git a/doc/languages-frameworks/lua.section.md b/doc/languages-frameworks/lua.section.md index 248e5971818..d81949c75f6 100644 --- a/doc/languages-frameworks/lua.section.md +++ b/doc/languages-frameworks/lua.section.md @@ -181,7 +181,7 @@ luaposix = buildLuarocksPackage { disabled = (luaOlder "5.1") || (luaAtLeast "5.4"); propagatedBuildInputs = [ bit32 lua std_normalize ]; - meta = with stdenv.lib; { + meta = with lib; { homepage = "https://github.com/luaposix/luaposix/"; description = "Lua bindings for POSIX"; maintainers = with maintainers; [ vyp lblasc ]; @@ -243,4 +243,3 @@ Following rules should be respected: * Make sure libraries build for all Lua interpreters. * Commit names of Lua libraries should reflect that they are Lua libraries, so write for example `luaPackages.luafilesystem: 1.11 -> 1.12`. - diff --git a/doc/languages-frameworks/maven.section.md b/doc/languages-frameworks/maven.section.md index 5f3979d69fd..7a863c500bc 100644 --- a/doc/languages-frameworks/maven.section.md +++ b/doc/languages-frameworks/maven.section.md @@ -116,7 +116,7 @@ The first step will be to build the Maven project as a fixed-output derivation i > Traditionally the Maven repository is at `~/.m2/repository`. We will override this to be the `$out` directory. ```nix -{ stdenv, maven }: +{ stdenv, lib, maven }: stdenv.mkDerivation { name = "maven-repository"; buildInputs = [ maven ]; @@ -139,7 +139,7 @@ stdenv.mkDerivation { outputHashAlgo = "sha256"; outputHashMode = "recursive"; # replace this with the correct SHA256 - outputHash = stdenv.lib.fakeSha256; + outputHash = lib.fakeSha256; } ``` diff --git a/doc/languages-frameworks/ocaml.section.md b/doc/languages-frameworks/ocaml.section.md index 1c5a5473a05..fa85a27e84f 100644 --- a/doc/languages-frameworks/ocaml.section.md +++ b/doc/languages-frameworks/ocaml.section.md @@ -7,7 +7,7 @@ Given that most of the OCaml ecosystem is now built with dune, nixpkgs includes Here is a simple package example. It defines an (optional) attribute `minimumOCamlVersion` that will be used to throw a descriptive evaluation error if building with an older OCaml is attempted. It uses the `fetchFromGitHub` fetcher to get its source. It sets the `doCheck` (optional) attribute to `true` which means that tests will be run with `dune runtest -p angstrom` after the build (`dune build -p angstrom`) is complete. It uses `alcotest` as a build input (because it is needed to run the tests) and `bigstringaf` and `result` as propagated build inputs (thus they will also be available to libraries depending on this library). The library will be installed using the `angstrom.install` file that dune generates. ```nix -{ stdenv +{ lib , fetchFromGitHub , buildDunePackage , alcotest @@ -35,8 +35,8 @@ buildDunePackage rec { meta = { homepage = "https://github.com/inhabitedtype/angstrom"; description = "OCaml parser combinators built for speed and memory efficiency"; - license = stdenv.lib.licenses.bsd3; - maintainers = with stdenv.lib.maintainers; [ sternenseemann ]; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ sternenseemann ]; }; } ``` @@ -44,7 +44,7 @@ buildDunePackage rec { Here is a second example, this time using a source archive generated with `dune-release`. It is a good idea to use this archive when it is available as it will usually contain substituted variables such as a `%%VERSION%%` field. This library does not depend on any other OCaml library and no tests are run after building it. ```nix -{ stdenv +{ lib , fetchurl , buildDunePackage }: @@ -60,7 +60,7 @@ buildDunePackage rec { sha256 = "1msg3vycd3k8qqj61sc23qks541cxpb97vrnrvrhjnqxsqnh6ygq"; }; - meta = with stdenv.lib; { + meta = with lib; { homepage = "https://github.com/flowtype/ocaml-wtf8"; description = "WTF-8 is a superset of UTF-8 that allows unpaired surrogates."; license = licenses.mit; diff --git a/doc/languages-frameworks/perl.section.md b/doc/languages-frameworks/perl.section.md index 2b31da84553..309d8ebcc2b 100644 --- a/doc/languages-frameworks/perl.section.md +++ b/doc/languages-frameworks/perl.section.md @@ -110,7 +110,7 @@ ClassC3Componentised = buildPerlPackage rec { On Darwin, if a script has too many `-Idir` flags in its first line (its “shebang line”), it will not run. This can be worked around by calling the `shortenPerlShebang` function from the `postInstall` phase: ```nix -{ stdenv, buildPerlPackage, fetchurl, shortenPerlShebang }: +{ stdenv, lib, buildPerlPackage, fetchurl, shortenPerlShebang }: ImageExifTool = buildPerlPackage { pname = "Image-ExifTool"; @@ -121,8 +121,8 @@ ImageExifTool = buildPerlPackage { sha256 = "0d8v48y94z8maxkmw1rv7v9m0jg2dc8xbp581njb6yhr7abwqdv3"; }; - buildInputs = stdenv.lib.optional stdenv.isDarwin shortenPerlShebang; - postInstall = stdenv.lib.optional stdenv.isDarwin '' + buildInputs = lib.optional stdenv.isDarwin shortenPerlShebang; + postInstall = lib.optional stdenv.isDarwin '' shortenPerlShebang $out/bin/exiftool ''; }; @@ -151,7 +151,7 @@ $ nix-generate-from-cpan XML::Simple propagatedBuildInputs = [ XMLNamespaceSupport XMLSAX XMLSAXExpat ]; meta = { description = "An API for simple XML files"; - license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ]; + license = with lib.licenses; [ artistic1 gpl1Plus ]; }; }; ``` diff --git a/doc/languages-frameworks/rust.section.md b/doc/languages-frameworks/rust.section.md index 231cbe900e7..092e84461b8 100644 --- a/doc/languages-frameworks/rust.section.md +++ b/doc/languages-frameworks/rust.section.md @@ -32,7 +32,7 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "03wf9r2csi6jpa7v5sw5lpxkrk4wfzwmzx7k3991q3bdjzcwnnwp"; - meta = with stdenv.lib; { + meta = with lib; { description = "A fast line-oriented regex search tool, similar to ag and ack"; homepage = "https://github.com/BurntSushi/ripgrep"; license = licenses.unlicense; @@ -58,13 +58,13 @@ then be taken from the failed build. A fake hash can be used for `cargoSha256` as follows: ``` - cargoSha256 = stdenv.lib.fakeSha256; + cargoSha256 = lib.fakeSha256; ``` For `cargoHash` you can use: ``` - cargoHash = stdenv.lib.fakeHash; + cargoHash = lib.fakeHash; ``` Per the instructions in the [Cargo Book](https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html) |