From febadf8ddb400fe9d327322a92732506b1b95468 Mon Sep 17 00:00:00 2001 From: rht Date: Sat, 10 Nov 2018 18:13:00 +0000 Subject: [PATCH] Use RFC 2119 convention to describe package naming convention --- doc/coding-conventions.xml | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/doc/coding-conventions.xml b/doc/coding-conventions.xml index 3e8a0ea4a70..2d2018c72d2 100644 --- a/doc/coding-conventions.xml +++ b/doc/coding-conventions.xml @@ -191,6 +191,23 @@ args.stdenv.mkDerivation (args // {
Package naming + + The key words + must, + must not, + required, + shall, + shall not, + should, + should not, + recommended, + may, + and optional in this section + are to be interpreted as described in + RFC 2119. + Only emphasized words are to be interpreted in this way. + + In Nixpkgs, there are generally three different names associated with a package: @@ -231,14 +248,15 @@ args.stdenv.mkDerivation (args // { - Generally, try to stick to the upstream package name. + The name attribute should + be identical to the upstream package name. - Don’t use uppercase letters in the name attribute - — e.g., "mplayer-1.0rc2" instead of - "MPlayer-1.0rc2". + The name attribute must not + contain uppercase letters — e.g., "mplayer-1.0rc2" + instead of "MPlayer-1.0rc2". @@ -252,14 +270,14 @@ args.stdenv.mkDerivation (args // { If a package is not a release but a commit from a repository, then the version part of the name must be the date of that - (fetched) commit. The date must be in "YYYY-MM-DD" + (fetched) commit. The date must be in "YYYY-MM-DD" format. Also append "unstable" to the name - e.g., "pkgname-unstable-2014-09-23". - Dashes in the package name should be preserved in new variable names, + Dashes in the package name should be preserved in new variable names, rather than converted to underscores or camel cased — e.g., http-parser instead of http_parser or httpParser. The hyphenated style is preferred in @@ -268,7 +286,7 @@ args.stdenv.mkDerivation (args // { - If there are multiple versions of a package, this should be reflected in + If there are multiple versions of a package, this should be reflected in the variable names in all-packages.nix, e.g. json-c-0-9 and json-c-0-11. If there is an obvious “default” version, make an attribute like