Skip to content

Commit

Permalink
Merge commit 'refs/top-bases/experimental/imap-sync-update' into expe…
Browse files Browse the repository at this point in the history
…rimental/imap-sync-update

* commit 'refs/top-bases/experimental/imap-sync-update': (1515 commits)
  fixup the previous: got renamed to sessionVariables
  nixos/opengl: add LD_LIBRARY_PATH to systemVariables instead
  scala: cosmetic fix for syntax highlighting in Emacs
  fixes NixOS#2926
  sweethome3d: remove '.' at end of description
  Adding SweetHome3D, TexturesLibraryEditor, FurnitureLibraryEditor
  xtrace:  fix build and update to 1.3.1
  e17.terminology:  0.4.0 -> 0.5.1
  Update haskell-hspec2 to version 0.3.4
  liboping: new package
  libmodbus: new package
  pyrtlsdr: new package
  Allow specifying allowUnfreePredicate instead of allowUnfree. The predicate will have access to the arguments of mkDerivation call. Should be an improvement for NixOS#2188
  Update Sauerbraten to a fresh revision 5000. Apparently fixes the build. Probably fixes NixOS#995.
  Add haskell-hspec-wai
  Update haskell-aeson-qq to version 0.7.1
  Ur/Web compiler: new release, 20140426 -> 20140531
  Update GlusterFS to 3.4.3
  Update Wine unstable version
  Update CL-Launch
  ...
  • Loading branch information
MarcWeber committed Jun 16, 2014
2 parents f30cbf3 + 51daa5a commit ce66b66
Show file tree
Hide file tree
Showing 1,356 changed files with 31,088 additions and 8,289 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Nixpkgs is a collection of packages for [Nix](http://nixos.org/nix/) package
manager. Nixpkgs also includes [NixOS](http://nixos.org/nixos/) linux distribution source code.

* [NixOS installation instructions](http://nixos.org/nixos/manual/#installing-nixos)
* [NixOS installation instructions](http://nixos.org/nixos/manual/#ch-installation)
* [Manual (How to write packages for Nix)](http://nixos.org/nixpkgs/manual/)
* [Manual (NixOS)](http://nixos.org/nixos/manual/)
* [Continuous build](http://hydra.nixos.org/jobset/nixos/trunk-combined)
Expand Down
2 changes: 1 addition & 1 deletion doc/release-notes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ xlink:href='http://nixos.org/releases/nix/nix-0.10/'>Nix
<literal>stdenv</literal>; the formed changes the C compiler, and
the latter adds additional packages to the front of
<literal>stdenv</literal>’s initial <envar>PATH</envar>, allowing
tools to be overriden.</para>
tools to be overridden.</para>

<para>For instance, the package <varname>strategoxt</varname>
doesn’t build with the GNU Make in <literal>stdenv</literal>
Expand Down
4 changes: 2 additions & 2 deletions doc/stdenv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ details.)</para>
<para>Often it is necessary to override or modify some aspect of the
build. To make this easier, the standard environment breaks the
package build into a number of <emphasis>phases</emphasis>, all of
which can be overriden or modified individually: unpacking the
which can be overridden or modified individually: unpacking the
sources, applying patches, configuring, building, and installing.
(There are some others; see <xref linkend="ssec-stdenv-phases"/>.)
For instance, a package that doesn’t supply a makefile but instead has
Expand Down Expand Up @@ -233,7 +233,7 @@ specific parts of the build (e.g., unpacking the sources or installing
the binaries). Furthermore, it allows a nicer presentation of build
logs in the Nix build farm.</para>

<para>Each phase can be overriden in its entirety either by setting
<para>Each phase can be overridden in its entirety either by setting
the environment variable
<varname><replaceable>name</replaceable>Phase</varname> to a string
containing some shell commands to be executed, or by redefining the
Expand Down
77 changes: 68 additions & 9 deletions lib/composable-derivation.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,74 @@
{lib, pkgs} :
let inherit (lib) nv nvs; in
{
# see for example:
# - development/interpreters/php_configurable/default.nix
# - .. search composableDerivation in all-packages.nix ..
#
# You should be able to override anything you like easily
# grep the mailinglist by title "python proposal" (dec 08)
# -> http://mail.cs.uu.nl/pipermail/nix-dev/2008-December/001571.html
# to see why this got complicated when using all its features
# TODO add newer example using new syntax (kernel derivation proposal -> mailinglist)

# composableDerivation basically mixes these features:
# - fix function
# - mergeAttrBy
# - provides shortcuts for "options" such as "--enable-foo" and adding
# buildInputs, see php example
#
# It predates styles which are common today, such as
# * the config attr
# * mkDerivation.override feature
# * overrideDerivation (lib/customization.nix)
#
# Some of the most more important usage examples (which could be rewritten if it was important):
# * php
# * postgis
# * vim_configurable
#
# A minimal example illustrating most features would look like this:
# let base = composableDerivation { (fixed : let inherit (fixed.fixed) name in {
# src = fetchurl {
# }
# buildInputs = [A];
# preConfigre = "echo ${name}";
# # attention, "name" attr is missing, thus you cannot instantiate "base".
# }
# in {
# # These all add name attribute, thus you can instantiate those:
# v1 = base.merge ({ name = "foo-add-B"; buildInputs = [B]; }); // B gets merged into buildInputs
# v2 = base.merge ({ name = "mix-in-pre-configure-lines" preConfigre = ""; });
# v3 = base.replace ({ name = "foo-no-A-only-B;" buildInputs = [B]; });
# }
#
# So yes, you can think about it being something like nixos modules, and
# you'd be merging "features" in one at a time using .merge or .replace
# Thanks Shea for telling me that I rethink the documentation ..
#
# issues:
# * its complicated to understand
# * some "features" such as exact merge behaviour are burried in mergeAttrBy
# and defaultOverridableDelayableArgs assuming the default behaviour does
# the right thing in the common case
# * Eelco once said using such fix style functions are slow to evaluate
# * Too quick & dirty. Hard to understand for others. The benefit was that
# you were able to create a kernel builder like base derivation and replace
# / add patches the way you want without having to declare function arguments
#
# nice features:
# declaring "optional featuers" is modular. For instance:
# flags.curl = {
# configureFlags = ["--with-curl=${curl}" "--with-curlwrappers"];
# buildInputs = [curl openssl];
# };
# flags.other = { .. }
# (Example taken from PHP)
#
# alternative styles / related features:
# * Eg see function supporting building the kernel
# * versionedDerivation (discussion about this is still going on - or ended)
# * composedArgsAndFun
# * mkDerivation.override
# * overrideDerivation
# * using { .., *Support ? false }: like configurable options.
# To find those examples use grep
#
# To sum up: It exists for historical reasons - and for most commonly used
# tasks the alternatives should be used
#
# If you have questions about this code ping Marc Weber.
composableDerivation = {
mkDerivation ? pkgs.stdenv.mkDerivation,

Expand Down
6 changes: 6 additions & 0 deletions lib/licenses.nix
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,12 @@
url = https://www.mozilla.org/MPL/2.0;
};

ofl = {
shortName = "OFL";
fullName = "SIL Open Font License";
url = "http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL_web";
};

openssl = {
shortName = "openssl";
fullName = "OpenSSL license";
Expand Down
11 changes: 10 additions & 1 deletion lib/maintainers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@
AndersonTorres = "Anderson Torres <[email protected]>";
andres = "Andres Loeh <[email protected]>";
antono = "Antono Vasiljev <[email protected]>";
arobyn = "Alexei Robyn <[email protected]>";
astsmtl = "Alexander Tsamutali <[email protected]>";
aszlig = "aszlig <[email protected]>";
auntie = "Jonathan Glines <[email protected]>";
bbenoist = "Baptist BENOIST <[email protected]>";
bennofs = "Benno Fünfstück <[email protected]>";
berdario = "Dario Bertini <[email protected]>";
bjg = "Brian Gough <[email protected]>";
bjornfor = "Bjørn Forsman <[email protected]>";
bluescreen303 = "Mathijs Kwik <[email protected]>";
Expand All @@ -28,9 +31,10 @@
coconnor = "Corey O'Connor <[email protected]>";
coroa = "Jonas Hörsch <[email protected]>";
cstrahan = "Charles Strahan <[email protected]>";
ederoyd46 = "Matthew Brown <[email protected]>";
edwtjo = "Edward Tjörnhammar <[email protected]>";
eelco = "Eelco Dolstra <[email protected]>";
emery = "Emery Hemingawy <[email protected]>";
emery = "Emery Hemingway <[email protected]>";
ertes = "Ertugrul Söylemez <[email protected]>";
falsifian = "James Cook <[email protected]>";
fuuzetsu = "Mateusz Kowalczyk <[email protected]>";
Expand All @@ -42,6 +46,8 @@
iElectric = "Domen Kozar <[email protected]>";
iyzsong = "Song Wenwu <[email protected]>";
jcumming = "Jack Cummings <[email protected]>";
joamaki = "Jussi Maki <[email protected]>";
joelteon = "Joel Taylor <[email protected]>";
jwiegley = "John Wiegley <[email protected]>";
kkallio = "Karn Kallio <[email protected]>";
ktosiek = "Tomasz Kontusz <[email protected]>";
Expand All @@ -63,10 +69,12 @@
pierron = "Nicolas B. Pierron <[email protected]>";
piotr = "Piotr Pietraszkiewicz <[email protected]>";
pkmx = "Chih-Mao Chen <[email protected]>";
plcplc = "Philip Lykke Carlsen <[email protected]>";
pSub = "Pascal Wittmann <[email protected]>";
qknight = "Joachim Schiele <[email protected]>";
raskin = "Michael Raskin <[email protected]>";
redbaron = "Maxim Ivanov <[email protected]>";
relrod = "Ricky Elrod <[email protected]>";
rickynils = "Rickard Nilsson <[email protected]>";
rob = "Rob Vermaas <[email protected]>";
roconnor = "Russell O'Connor <[email protected]>";
Expand All @@ -91,6 +99,7 @@
vlstill = "Vladimír Štill <[email protected]>";
winden = "Antonio Vargas Gonzalez <[email protected]>";
wizeman = "Ricardo M. Correia <[email protected]>";
wmertens = "Wout Mertens <[email protected]>";
z77z = "Marco Maggesi <[email protected]>";
zef = "Zef Hemel <[email protected]>";
zimbatm = "zimbatm <[email protected]>";
Expand Down
2 changes: 2 additions & 0 deletions lib/modules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ rec {
mkForce = mkOverride 50;
mkVMOverride = mkOverride 10; # used by ‘nixos-rebuild build-vm’

mkStrict = builtins.trace "`mkStrict' is obsolete; use `mkOverride 0' instead." (mkOverride 0);

mkFixStrictness = id; # obsolete, no-op

mkOrder = priority: content:
Expand Down
37 changes: 27 additions & 10 deletions lib/strings.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,15 @@ rec {
optionalString = cond: string: if cond then string else "";


# Determine whether a filename ends in the given suffix.
hasSuffix = ext: fileName:
let lenFileName = stringLength fileName;
lenExt = stringLength ext;
in !(lessThan lenFileName lenExt) &&
substring (sub lenFileName lenExt) lenFileName fileName == ext;
# Determine whether a string has given prefix/suffix.
hasPrefix = pref: str:
eqStrings (substring 0 (stringLength pref) str) pref;
hasSuffix = suff: str:
let
lenStr = stringLength str;
lenSuff = stringLength suff;
in lenStr >= lenSuff &&
eqStrings (substring (lenStr - lenSuff) lenStr str) suff;


# Convert a string to a list of characters (i.e. singleton strings).
Expand Down Expand Up @@ -116,17 +119,21 @@ rec {
toLower = replaceChars upperChars lowerChars;
toUpper = replaceChars lowerChars upperChars;

# Appends string context from another string
addContextFrom = a: b: (substring 0 0 a)+b;

# Compares strings not requiring context equality
# Obviously, a workaround but works on all Nix versions
eqStrings = a: b: (a+(substring 0 0 b)) == ((substring 0 0 a)+b);
eqStrings = a: b: addContextFrom b a == addContextFrom a b;


# Cut a string with a separator and produces a list of strings which were
# separated by this separator. e.g.,
# `splitString "." "foo.bar.baz"' returns ["foo" "bar" "baz"].
splitString = sep: s:
splitString = _sep: _s:
let
sep = addContextFrom _s _sep;
s = addContextFrom _sep _s;
sepLen = stringLength sep;
sLen = stringLength s;
lastSearch = sub sLen sepLen;
Expand Down Expand Up @@ -155,8 +162,18 @@ rec {
preLen = stringLength pre;
sLen = stringLength s;
in
if pre == substring 0 preLen s then
substring preLen (sub sLen preLen) s
if hasPrefix pre s then
substring preLen (sLen - preLen) s
else
s;

removeSuffix = suf: s:
let
sufLen = stringLength suf;
sLen = stringLength s;
in
if sufLen <= sLen && eqStrings suf (substring (sLen - sufLen) sufLen s) then
substring 0 (sLen - sufLen) s
else
s;

Expand Down
3 changes: 3 additions & 0 deletions maintainers/scripts/copy-tarballs.pl
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,7 @@

my $sha256 = hashFile("sha256", 0, $storePath) or die;
symlink("../$fn", "$tarballsCache/sha256/$sha256");

$sha256 = hashFile("sha256", 1, $storePath) or die;
symlink("../$fn", "$tarballsCache/sha256/$sha256");
}
2 changes: 1 addition & 1 deletion nixos/doc/manual/configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ Any package in Nixpkgs that depends on <literal>emacs</literal> will
be passed your customised instance. (However, the value
<literal>pkgs.emacs</literal> in
<varname>nixpkgs.config.packageOverrides</varname> refers to the
original rather than overriden instance, to prevent an infinite
original rather than overridden instance, to prevent an infinite
recursion.)</para>

</section>
Expand Down
8 changes: 4 additions & 4 deletions nixos/doc/manual/containers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ $ ping -c1 10.233.4.2
<para>Networking is implemented using a pair of virtual Ethernet
devices. The network interface in the container is called
<literal>eth0</literal>, while the matching interface in the host is
called <literal>c-<replaceable>container-name</replaceable></literal>
(e.g., <literal>c-foo</literal>). The container has its own network
called <literal>ve-<replaceable>container-name</replaceable></literal>
(e.g., <literal>ve-foo</literal>). The container has its own network
namespace and the <literal>CAP_NET_ADMIN</literal> capability, so it
can perform arbitrary network configuration such as setting up
firewall rules, without affecting or having access to the host’s
Expand All @@ -228,11 +228,11 @@ on the host:

<programlisting>
networking.nat.enable = true;
networking.nat.internalInterfaces = ["c-+"];
networking.nat.internalInterfaces = ["ve-+"];
networking.nat.externalInterface = "eth0";
</programlisting>
where <literal>eth0</literal> should be replaced with the desired
external interface. Note that <literal>c-+</literal> is a wildcard
external interface. Note that <literal>ve-+</literal> is a wildcard
that matches all container interfaces.</para>

</section>
Expand Down
4 changes: 2 additions & 2 deletions nixos/doc/manual/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ let
declarations = map (fn: stripPrefix fn) opt.declarations;
});

prefix = toString pkgs.path;
prefix = toString ../../..;

stripPrefix = fn:
if substring 0 (stringLength prefix) fn == prefix then
substring (add (stringLength prefix) 1) 1000 fn
substring (stringLength prefix + 1) 1000 fn
else
fn;

Expand Down
46 changes: 40 additions & 6 deletions nixos/doc/manual/development.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,37 @@ This will check out the latest NixOS sources to
and the Nixpkgs sources to
<filename><replaceable>/my/sources</replaceable>/nixpkgs</filename>.
(The NixOS source tree lives in a subdirectory of the Nixpkgs
repository.) If you want to rebuild your system using your (modified)
repository.)</para>

<para>It’s often inconvenient to develop directly on the master
branch, since if somebody has just committed (say) a change to GCC,
then the binary cache may not have caught up yet and you’ll have to
rebuild everything from source. So you may want to create a local
branch based on your current NixOS version:

<screen>
$ nixos-version
14.04.273.ea1952b (Baboon)

$ git checkout -b local ea1952b
</screen>

Or, to base your local branch on the latest version available in the
NixOS channel:

<screen>
$ curl -sI http://nixos.org/channels/nixos-unstable/ | grep Location
Location: http://releases.nixos.org/nixos/unstable/nixos-14.10pre43986.acaf4a6/

$ git checkout -b local acaf4a6
</screen>

You can then use <command>git rebase</command> to sync your local
branch with the upstream branch, and use <command>git
cherry-pick</command> to copy commits from your local branch to the
upstream branch.</para>

<para>If you want to rebuild your system using your (modified)
sources, you need to tell <command>nixos-rebuild</command> about them
using the <option>-I</option> flag:

Expand Down Expand Up @@ -729,18 +759,22 @@ $ mount -o loop -t iso9660 ./result/iso/cd.iso /mnt/iso</screen>

<title>Testing the installer</title>

<para>Building, burning, and
booting from an installation CD is rather
<para>Building, burning, and booting from an installation CD is rather
tedious, so here is a quick way to see if the installer works
properly:

<screen>
$ nix-build -A config.system.build.nixos-install
$ dd if=/dev/zero of=diskimage seek=2G count=0 bs=1
$ yes | mke2fs -j diskimage
$ mount -o loop diskimage /mnt
$ mount -t tmpfs none /mnt
$ ./result/bin/nixos-install</screen>

To start a login shell in the new NixOS installation in
<filename>/mnt</filename>:

<screen>
$ ./result/bin/nixos-install --chroot
</screen>

</para>

</section>
Expand Down
Loading

0 comments on commit ce66b66

Please sign in to comment.