Commit graph

195 commits

Author SHA1 Message Date
Artturin fda61e9066 add docs for prependToVar and appendToVar 2022-12-10 04:22:11 +02:00
Valentin Gagarin 5b9b93b9be
Merge pull request #204257 from raboof/nixpkgs-manual-update-meta-attributes
manual: update meta-attributes section
2022-12-05 09:46:46 +01:00
Colin Arnott bac379f30a
doc: use sri hash syntax
The nixpkgs manual contains references to both sri hash and explicit
sha256 attributes. This is at best confusing to new users. Since the
final destination is exclusive use of sri hashes, see nixos/rfcs#131,
might as well push new users in that direction gently.

Notable exceptions to sri hash support are builtins.fetchTarball,
cataclysm-dda, coq, dockerTools.pullimage, elixir.override, and
fetchCrate. None, other than builtins.fetchTarball, are fundamentally
incompatible, but all currently accept explicit sha256 attributes as
input. Because adding backwards compatibility is out of scope for this
change, they have been left intact, but migration to sri format has been
made for any using old hash formats.

All hashes have been manually tested to be accurate, and updates were
only made for missing upstream artefacts or bugs.
2022-12-04 06:12:18 +00:00
Arnout Engelen cfdd900d66
manual: update meta-attributes section
Promote the `maintainers = with maintainers; [ ]` syntax as that is most common
in nixpkgs, and remove the `nix-env` example which doesn't work like that anymore.
2022-12-03 10:04:15 +00:00
Artturin 341e6fd558 splice.nix: start deprecating nativeDrv and crossDrv 2022-11-19 00:04:54 +02:00
John Ericson cd27a5b436
Merge pull request #82131 from Ericson2314/bsd-cross
FreeBSD packages: Init at 13.1
2022-11-13 21:35:17 -05:00
github-actions[bot] 4517d658d3
Merge master into staging-next 2022-11-08 18:01:16 +00:00
Ryan Mulligan 962a810513 nixpkgs/doc/stdenv: fix admonition class
Change to match the formatting of the other admonitions that use
classes.

This was breaking the mmdoc output.
2022-11-07 13:32:21 -08:00
John Ericson 66aa02f190 lib/systems: Support FreeBSD
A tricky thing about FreeBSD is that there is no stable ABI across
versions. That means that putting in the version as part of the config
string is paramount.

We have a parsed represenation that separates name versus version to
accomplish this. We include FreeBSD versions 12 and 13 to demonstrate
how it works.
2022-11-04 16:49:28 -04:00
Daniel Barter 77bd639c4c cc-wrapper: adding a cc-wrapper-hook to the cc-wrapper 2022-10-26 09:33:43 -07:00
Robert Hensing c1311d1223 doc/stdenv: Move Other hooks after all hooks 2022-10-13 21:15:19 +02:00
Robert Hensing 53088569de doc/stdenv: Clarify that the wrappers come with hooks 2022-10-13 21:14:21 +02:00
Robert Hensing f4c6286284 doc/stdenv: Improve language a bit 2022-10-13 21:14:04 +02:00
Robert Hensing 2db8de920e doc: Move non-stdenv hooks out of stdenv chapter 2022-10-13 15:40:27 +02:00
Robert Hensing 5b055190e3 doc/stdenv: Clarify status of the hooks 2022-10-13 13:36:47 +02:00
Robert Hensing 7f0d934f9a
Merge pull request #191540 from hercules-ci/nixosTest-modular
nixosTest: make modular
2022-09-28 10:27:45 +01:00
José Romildo 1f239257c5 maintainers/scripts/update.nix: make package name, pname and old version available to the update script 2022-09-26 22:16:19 -03:00
Robert Hensing 6205d37747 nixos/testing: Improve option docs 2022-09-24 17:38:10 +01:00
Marc Scholten 41de927b70 doc: Clarify default value of sourceRoot 2022-09-03 11:13:58 +02:00
Naïm Favier 2f88279ab9
doc: specify that longDescription should be Markdown
In the spirit of RFC 72, document that longDescription is in CommonMark.
2022-08-29 20:19:34 +02:00
Valentin Gagarin 16eb45c655 doc: add note about makeWrapper and PATH modification 2022-08-19 13:11:27 -05:00
Valentin Gagarin 163e81aac0
Merge pull request #184848 from jtojnar/mkder-rec-anchor
doc: Add anchor to Recursive attributes in `mkDerivation`
2022-08-03 11:18:36 +02:00
Jan Tojnar 4cb8aa1324 doc: Add anchor to Recursive attributes in mkDerivation
So that we can link to it stably.
2022-08-02 18:01:03 +02:00
Bernardo Meurer 88c63ca65a
Merge pull request #182513 from trofi/strip-for-host-and-target
gcc: enable stripping for cross-compilers
2022-07-28 00:30:49 -07:00
Sergei Trofimovich 0f45ce6e77 setup-hooks/strip.sh: add strip{All,Debug}ListTarget variables
This change mimics existing strip{All,Debug}List variables to
allow special stripping directories just for Target.

The primary use case in mind is gcc where package has to install
both host and target ELFs. They have to be stripped by their own
strip tools accordingly.

Co-authored-by: Rick van Schijndel <Mindavi@users.noreply.github.com>
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2022-07-25 11:06:45 +01:00
Artturi 79e8669003
Merge pull request #179603 from Artturin/subplacemultiple 2022-07-24 04:14:09 +03:00
github-actions[bot] 97f117148f
Merge staging-next into staging 2022-07-17 00:02:54 +00:00
aiotter dbd75e3229 doc: update cmake doc for better readability 2022-07-16 19:10:31 +09:00
github-actions[bot] eb2dfaed06
Merge staging-next into staging 2022-07-13 12:01:56 +00:00
Robert Hensing 3c1447f807
Merge pull request #121015 from fricklerhandwerk/docs-patch-shebangs
docs: expand explanation of patchShebangs hook
2022-07-13 12:17:11 +02:00
Valentin Gagarin b7b86c4f54
add stable anchor
Co-authored-by: Jan Tojnar <jtojnar@gmail.com>
2022-07-13 10:19:23 +01:00
Artturi 4427b7dfab
Merge pull request #177538 from Artturin/fixcross3 2022-07-12 16:14:46 +03:00
Artturin 2cbce6b012 mesonEmulatorHook: check if the target binaries can be executed
this prevents having to bring in the emulator when compiling e.g. pkgsStatic
2022-07-07 21:29:53 +03:00
Randy Eckenrode 25ccd71ff8
doc: update Darwin platform doc regarding the 11.0 SDK 2022-07-07 07:52:36 -04:00
Artturin ba1efa71ae stdenv: substituteInPlace: accept multiple filenames
I don't know if getopt is available everywhere, so I did not use it.

in any case, it can be changed to use getopt in the future if
needed.
2022-06-29 22:03:19 +03:00
Artturin 6e6292279e meson: add mesonEmulatorHook
fixes building documentation while cross-compiling and other issues
Exec format error: './gdk3-scan'

added some simple documentation
2022-06-11 04:51:04 +03:00
Valentin Gagarin c3ea8c4dd9 do not mention trivial builders 2022-06-10 11:43:57 +02:00
Valentin Gagarin e132e6be3c
fix heading level 2022-06-09 13:43:21 +02:00
Valentin Gagarin f70073d72d
remove specifics on where build inputs come from in PATH
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2022-06-08 11:43:32 +02:00
Adam Joseph 81bc106e08 meta.sourceProvenance documentation: clarify it is unaffected by changes to meta.license
This commit clarifies that the meaning of the `meta.sourceProvenance`
field is independent of and unaffected by the value of the
`meta.license` field.  This is based on the intent of the RFC author
as expressed here:

  https://github.com/NixOS/nixpkgs/pull/161098#issuecomment-1081270201

This clarification is added for two reasons:

1. If in the future there should be some disagreement about what
   `sourceProvenance` to assign to a package, this may help resolve
   the disagreement.  Any interpretation of `sourceProvenance` which
   is influenced by the `meta.license` is clearly an incorrect
   interpretation.

2. If it should turn out that it is impossible to disentangle
   `sourceProvenance` from `meta.license`, this would indicate the
   need for changes to the `sourceProvenance` scheme.  That change
   might be as simple as replacing the sentence added by this commit
   with some other sentence explaining how the two fields influence
   each other.

This commit implements the recommendation made in the paragraph of
this comments which begins with "Please say this explicitly...":

  https://github.com/NixOS/nixpkgs/pull/161098#issuecomment-1081309089
2022-05-30 16:27:34 +08:00
Robert Scott 9d0784829a add initial meta.sourceProvenance documentation 2022-05-30 16:27:34 +08:00
Artturin c1fffdfffb treewide: change some glibc to stdenv.cc.libc 2022-05-27 05:57:43 +03:00
Artturin 0c4d65b21e treewide: stdenv.glibc -> glibc 2022-05-25 15:51:20 +03:00
Naïm Favier 0d6bcb513b
makeBinaryWrapper: move into its own folder
The derivation is complex enough to warrant moving out of
all-packages.nix
2022-05-10 22:07:56 +02:00
Robert Hensing 0e00acafe9 stdenv.mkDerivation: public -> finalPackage 2022-05-02 08:49:33 +02:00
Robert Hensing ca83dd1ae7 stdenv.md: Clarify overrideAttrs sentence
I weirded my English.
2022-05-02 08:49:32 +02:00
Robert Hensing d629ba27d9 Use finalAttrs instead of self for mkDerivation "overlay" 2022-05-02 08:49:31 +02:00
Robert Hensing 6d7efb3a16 stdenv.mkDerivation: Make self more overlay-like; use self.public
`self` is now arguments, like `super`. The final package is in
`self.public`.
2022-05-02 08:49:31 +02:00
Robert Hensing 2f21bc2fdb doc/stdenv/meta: tests -> passthru.tests
Make the text understandable without knowing that these are identical.

Co-authored-by: Daniël de Kok <me@github.danieldk.eu>
2022-05-02 08:49:30 +02:00
Robert Hensing a4e7085227 stdenv.mkDerivation: Allow overriding of recursive definitions
See updated manual for further explanation.
2022-05-02 08:49:26 +02:00
Valentin Gagarin 311d322feb docs: sync patchShebangs comments with manual
this is not an actual sync, but rather the manual taking the leading role.
right now it does not make sense to actually change `patch-shebangs.sh`
as that would cause a rebuild of the entire universe.

we should figure out how to keep them aligned with minimal effort both
in terms of maintenance as well as navigation for readers.
2022-04-21 12:21:49 +02:00
Valentin Gagarin 9a2ed65370 fix wording, remove too much specificity
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2022-04-21 09:27:11 +02:00
fricklerhandwerk b4d9d682c8 docs: clean up and update links to source code 2022-04-21 09:27:11 +02:00
fricklerhandwerk e3883d2ce0 docs: clarify note on existing store paths 2022-04-21 09:27:10 +02:00
fricklerhandwerk b0fce27ce2 docs: expand explanation of patchShebangs hook
- clarify motivation and mechanism
- explain usage
- add interlinks
- add links to sources to enable research

based on https://discourse.nixos.org/t/what-is-the-patchshebangs-command-in-nix-build-expressions/12656
2022-04-21 09:27:09 +02:00
Samuel Ainsworth a7fc2f6392 autoPatchelfHook: more precise dependency ignorance 2022-04-11 01:28:55 +00:00
Adam Joseph 7dbe7487b6
Update doc/stdenv/cross-compilation.chapter.md
Co-authored-by: Ben Siraphob <bensiraphob@gmail.com>
2022-04-03 17:43:52 +00:00
Adam Joseph c9d66a7fff cross-compilation.chapter.md: give examples of all depFooBar cases
This commit describes the "->" notation for dependency types in
greater detail, and uses g++ to provide examples of all six cases
(although the host->target and target->target examples are a bit
artificial).

It also adds three more rows to the table for the "->*" dependency
types for non-compiler-like packages; these dependency types were
already present in the documentation but the "*" was not really
explained.

Lastly, this commit adds a hyperlink to the table from the place where
it is mentioned in the "specifying dependencies" chapter.
2022-04-02 19:41:49 -07:00
Jan Tojnar e61eec13a5
Merge pull request #159344 from symphorien/doc-remove-references-to
doc: document remove-references-to
2022-02-19 15:17:05 +01:00
Guillaume Girol f16a62bd63 doc: document remove-references-to 2022-02-19 12:00:00 +00:00
Guillaume Girol 02a8d5984c doc: discourage setting phases, document/encourage runHook instead.
Source:
https://matrix.to/#/!kjdutkOsheZdjqYmqp:nixos.org/$mff3KCoPY5sfgsUhKn0e4va7hnz7KMXARaO2_UaLNM4?via=nixos.org&via=matrix.org&via=nixos.dev
2022-02-12 12:00:00 +00:00
Robert Hensing c9b3d27be0
stdenv.md: Call out that genericBuild has correct order
Co-authored-by: Cole Helbling <cole.e.helbling@outlook.com>
2022-02-02 23:45:51 +01:00
Robert Hensing 0838f79f0b stdenv.md: Document genericBuild 2022-02-01 16:58:52 +01:00
Robert Hensing b08ee51cc7 stdenv.md: Remove off topic phase propaganda
Phases are cool, I get it, but the reader will enjoy it when they
see it. And they'll see it sooner if they don't have to read about
it.
2022-02-01 16:46:18 +01:00
Felix Buehler 7801f72b4c meta.updateWalker: remove, because it is not used 2022-01-26 21:46:07 +01:00
Robert Hensing 9fb7d91888
Merge pull request #124556 from bergkvist/bergkvist/make-c-wrapper
Generate tiny compiled binary for wrapping executables
2021-12-10 00:45:30 +01:00
Doron Behar ceffea674d
Small rephrase of wrapProgram documentation
Co-authored-by: Julian Stecklina <js@alien8.de>
2021-12-09 23:24:13 +02:00
Doron Behar c42e6741b2 Rephrase documentation for both makeWrapper implementations 2021-12-09 16:02:02 +02:00
Doron Behar 32d566e1b9 wrapProgramBinary -> binaryWrapProgram 2021-12-08 18:59:38 +02:00
Doron Behar 2b103ab8a1 Remove TODO in documentation 2021-12-02 10:43:47 +02:00
Jan Tojnar 23f71e9427
Merge pull request #136345 from Pamplemousse/doc
doc: clarification of dependencies related attributes
2021-10-26 09:52:37 +02:00
Doron Behar eb048d8fe2 Rephrase makeWrapper setup-hook 2021-10-20 08:59:29 +03:00
Doron Behar 6517e5b10f Improve explenations for wrap*Program 2021-10-19 17:33:02 +03:00
Doron Behar ba86a1916b makeBinaryWrapper: Document 2021-10-19 05:30:42 -07:00
laikq 6ef3c96ddf doc: reference sourceRoot in description of srcs 2021-10-05 08:47:08 +02:00
ppom 896623dbe9 patchelf: fix homepage 2021-09-21 13:04:09 +02:00
Pamplemousse f48c175fb2 doc: clarification of dependencies related attributes
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
2021-08-31 16:57:46 -07:00
figsoda 4b93f966c5 doc: stdenv: document meta.mainProgram 2021-08-19 14:00:04 -04:00
Arnout Engelen d09e0be1c4
nixpkgs-docs: when to prefer passthru.tests over installCheckPhase
And mention you can have either lightweight 'package' or
more heavyweight 'NixOS' (module) tests.

This was suggested at
https://github.com/ryantm/nixpkgs-update/issues/260#issuecomment-821287971
and discussed further at
https://github.com/NixOS/nixpkgs/pull/119731
2021-08-14 09:47:21 +02:00
Niklas Hambüchen 7cfaba911d manual: Hardening: Remove now-nonexistent ArchWiki link.
The page has been replaced by the much more general page
https://wiki.archlinux.org/title/Security#Packages
which is barely talking about hardening flags any more.
2021-07-05 22:57:52 +02:00
Niklas Hambüchen ac36a0f9eb manual: hardening: Fix disabled flags prose being in previous section
This confused the hell out of me, as I didn't spot the

> The following flags are disabled by default ...

when reading about `pie`, because that sentence was hidden in the
previous hardening flag's section.

Also explain that `pie` hardening is on by default on musl.
2021-07-05 16:32:55 +02:00
Alyssa Ross b0b5ef7286 stdenv: introduce dontAddStaticConfigureFlags
With removeUnknownConfigureFlags, it's impossible to express a package
that needs --enable-static, but will not accept --disable-shared,
without overriding the result of removeUnknownConfigureFlags _again_
in pkgs/top-level/static.nix.

It would be much better (and more in line with the rest of Nixpkgs) if
we encoded changes needed for static builds in package definitions
themselves, rather than in an ever-expanding list in static.nix.  This
is especially true when doing it in static.nix is going to require
multiple overrides to express what could be expressed with stdenv
options.

So as a step in that direction, and to fix the problem described
above, here I replace removeUnknownConfigureFlags with a new stdenv
option, dontAddStaticConfigureFlags.  With this mechanism, a package
that needs one but not both of the flags just needs to set
dontAddStaticConfigureFlags and then set up configureFlags manually
based on stdenv.hostPlatform.isStatic.
2021-06-11 14:16:05 -07:00
Jan Tojnar 3c78ad2561
doc: Use markdown syntax for xrefs
Syntax is taken from MyST:

https://myst-parser.readthedocs.io/en/latest/using/syntax.html#targets-and-cross-referencing
2021-06-07 06:34:59 +02:00
Jan Tojnar 6ecc641d08
doc: prepare for commonmark
We are still using Pandoc’s Markdown parser, which differs from CommonMark spec slightly.

Notably:
- Line breaks in lists behave differently.
- Admonitions do not support the simpler syntax https://github.com/jgm/commonmark-hs/issues/75
- The auto_identifiers uses a different algorithm – I made the previous ones explicit.
- Languages (classes) of code blocks cannot contain whitespace so we have to use “pycon” alias instead of Python “console” as GitHub’s linguist

While at it, I also fixed the following issues:
- ShellSesssion was used
- Removed some pointless docbook tags.
2021-06-07 06:34:59 +02:00
Emery Hemingway 29bc87e961 Fix "platfrom" typos 2021-04-10 17:10:50 +02:00
sternenseemann cf8da7eabd doc/stdenv/cross: fix typo 2021-04-02 10:03:00 +02:00
Jan Tojnar f854ee87f0
doc: Port stdenv to Markdown
Added the following ids to avoid possible id conflicts from ids auto-generated from titles:

- setup-hook-perl
- setup-hook-python
- setup-hook-pkg-config
- setup-hook-automake
- setup-hook-autoconf
- setup-hook-libxml2
- setup-hook-gdk-pixbuf
2021-03-14 02:18:52 +01:00
Jan Tojnar 53830ca04c
doc: Port stdenv/multiple-output to Markdown 2021-03-14 02:18:40 +01:00
Jan Tojnar 921d0269cc
doc: Port stdenv/meta to Markdown 2021-03-14 02:15:14 +01:00
Robert Hensing 7d551ead60 doc: Format 2021-03-04 18:10:57 +01:00
Sandro d83c76ef5b
Merge pull request #113062 from SuperSandro2000/outputs-update
doc: update multiple output section with more example paths
2021-03-03 01:27:20 +01:00
Ben Siraphob 251897b40d stdenv/cross-compilation: add section on avoiding cross-compiling GCC 2021-02-22 10:57:30 +07:00
Ben Siraphob 4550d6596b docs/stdenv/cross-compilation: add binutils command section to cookbook 2021-02-21 21:56:48 +07:00
Ben Siraphob 92d319d5d5
doc/stdenv/platform-notes: convert to markdown 2021-02-21 06:45:21 +01:00
Sandro Jäckel 061f514462
doc: update multiple output section with more example paths 2021-02-14 00:46:43 +01:00
Jan Tojnar f53e0e28c3 doc: Add anchors to meta attributes 2021-02-07 23:11:41 +01:00
Profpatsch b0c1583a0b 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.
2021-01-11 09:52:27 +01:00
Robert Hensing 3393e110a9
doc/stdenv/cross-compilation.chapter.md typo
Co-authored-by: John Ericson <git@JohnEricson.me>
2020-12-15 15:57:27 +01:00
Robert Hensing c7e5c02374
doc/cross-compilation: Remove confusing re-explanation
See https://github.com/NixOS/nixpkgs/issues/106950

> They way it's worded says buildInputs are for build-time and nativeBuildInputs are for run-time. The other documentation leads me to believe it is the other way around.
2020-12-15 11:45:38 +01:00
Ben Siraphob 71a7249a48 doc/stdenv/cross-compilation: convert to markdown 2020-12-13 19:49:39 +07:00