Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
FRidh committed Aug 9, 2017
2 parents c00a95b + 345b35c commit 7a6d4f4
Show file tree
Hide file tree
Showing 45 changed files with 3,821 additions and 4,079 deletions.
44 changes: 36 additions & 8 deletions doc/languages-frameworks/python.md
Expand Up @@ -423,7 +423,7 @@ and in this case the `python35` interpreter is automatically used.
### Interpreters

Versions 2.7, 3.3, 3.4, 3.5 and 3.6 of the CPython interpreter are available as
respectively `python27`, `python33`, `python34`, `python35` and `python36`. The PyPy interpreter
respectively `python27`, `python34`, `python35` and `python36`. The PyPy interpreter
is available as `pypy`. The aliases `python2` and `python3` correspond to respectively `python27` and
`python35`. The default interpreter, `python`, maps to `python2`.
The Nix expressions for the interpreters can be found in
Expand Down Expand Up @@ -469,7 +469,6 @@ sets are

* `pkgs.python26Packages`
* `pkgs.python27Packages`
* `pkgs.python33Packages`
* `pkgs.python34Packages`
* `pkgs.python35Packages`
* `pkgs.python36Packages`
Expand Down Expand Up @@ -546,6 +545,35 @@ All parameters from `mkDerivation` function are still supported.
* `catchConflicts` If `true`, abort package build if a package name appears more than once in dependency tree. Default is `true`.
* `checkInputs` Dependencies needed for running the `checkPhase`. These are added to `buildInputs` when `doCheck = true`.

##### Overriding Python packages

The `buildPythonPackage` function has a `overridePythonPackage` method that
can be used to override the package. In the following example we create an
environment where we have the `blaze` package using an older version of `pandas`.
We override first the Python interpreter and pass
`packageOverrides` which contains the overrides for packages in the package set.

```nix
with import <nixpkgs> {};
(let
python = let
packageOverrides = self: super: {
pandas = super.pandas.overridePythonPackage(old: rec {
version = "0.19.1";
name = "pandas-${version}";
src = super.fetchPypi {
pname = "pandas";
inherit version;
sha256 = "08blshqj9zj1wyjhhw3kl2vas75vhhicvv72flvf1z3jvapgw295";
};
});
};
in pkgs.python3.override {inherit packageOverrides;};
in python.withPackages(ps: [ps.blaze])).env
```

#### `buildPythonApplication` function

The `buildPythonApplication` function is practically the same as `buildPythonPackage`.
Expand Down Expand Up @@ -622,7 +650,7 @@ attribute. The `shell.nix` file from the previous section can thus be also writt
```nix
with import <nixpkgs> {};
(python33.withPackages (ps: [ps.numpy ps.requests])).env
(python36.withPackages (ps: [ps.numpy ps.requests])).env
```

In contrast to `python.buildEnv`, `python.withPackages` does not support the more advanced options
Expand Down Expand Up @@ -755,17 +783,17 @@ In the following example we rename the `pandas` package and build it.
```nix
with import <nixpkgs> {};
let
(let
python = let
packageOverrides = self: super: {
pandas = super.pandas.override {name="foo";};
pandas = super.pandas.overridePythonPackage(old: {name="foo";});
};
in pkgs.python35.override {inherit packageOverrides;};
in python.pkgs.pandas
in python.withPackages(ps: [ps.pandas])).env
```
Using `nix-build` on this expression will build the package `pandas`
but with the new name `foo`.
Using `nix-build` on this expression will build an environment that contains the
package `pandas` but with the new name `foo`.

All packages in the package set will use the renamed package.
A typical use case is to switch to another version of a certain package.
Expand Down
1 change: 0 additions & 1 deletion doc/languages-frameworks/ruby.xml
Expand Up @@ -111,7 +111,6 @@ the needed dependencies. For example, to make a derivation
in stdenv.mkDerivation {
name = "my-script";
buildInputs = [ env.wrappedRuby ];
phases = [ "installPhase" "fixupPhase" ];
script = ./my-script.rb;
buildCommand = ''
install -D -m755 $script $out/bin/my-script
Expand Down
1 change: 1 addition & 0 deletions lib/maintainers.nix
Expand Up @@ -293,6 +293,7 @@
khumba = "Bryan Gardiner <bog@khumba.net>";
KibaFox = "Kiba Fox <kiba.fox@foxypossibilities.com>";
kierdavis = "Kier Davis <kierdavis@gmail.com>";
kiloreux = "Kiloreux Emperex <kiloreux@gmail.com>";
kkallio = "Karn Kallio <tierpluspluslists@gmail.com>";
knedlsepp = "Josef Kemetmüller <josef.kemetmueller@gmail.com>";
konimex = "Muhammad Herdiansyah <herdiansyah@openmailbox.org>";
Expand Down
13 changes: 12 additions & 1 deletion nixos/modules/services/logging/fluentd.nix
Expand Up @@ -4,6 +4,8 @@ with lib;

let
cfg = config.services.fluentd;

pluginArgs = concatStringsSep " " (map (x: "-p ${x}") cfg.plugins);
in {
###### interface

Expand All @@ -28,6 +30,15 @@ in {
defaultText = "pkgs.fluentd";
description = "The fluentd package to use.";
};

plugins = mkOption {
type = types.listOf types.path;
default = [];
description = ''
A list of plugin paths to pass into fluentd. It will make plugins defined in ruby files
there available in your config.
'';
};
};
};

Expand All @@ -39,7 +50,7 @@ in {
description = "Fluentd Daemon";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${cfg.package}/bin/fluentd -c ${pkgs.writeText "fluentd.conf" cfg.config}";
ExecStart = "${cfg.package}/bin/fluentd -c ${pkgs.writeText "fluentd.conf" cfg.config} ${pluginArgs}";
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
};
};
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/services/networking/networkmanager.nix
Expand Up @@ -12,6 +12,7 @@ let
dns =
if cfg.useDnsmasq then "dnsmasq"
else if config.services.resolved.enable then "systemd-resolved"
else if config.services.unbound.enable then "unbound"
else "default";

configFile = writeText "NetworkManager.conf" ''
Expand Down
4 changes: 3 additions & 1 deletion pkgs/applications/graphics/ImageMagick/default.nix
Expand Up @@ -85,7 +85,9 @@ stdenv.mkDerivation rec {
moveToOutput "bin/*-config" "$dev"
moveToOutput "lib/ImageMagick-*/config-Q16" "$dev" # includes configure params
for file in "$dev"/bin/*-config; do
substituteInPlace "$file" --replace pkg-config \
substituteInPlace "$file" --replace "${pkgconfig}/bin/pkg-config -config" \
${pkgconfig}/bin/pkg-config
substituteInPlace "$file" --replace ${pkgconfig}/bin/pkg-config \
"PKG_CONFIG_PATH='$dev/lib/pkgconfig' '${pkgconfig}/bin/pkg-config'"
done
'' + lib.optionalString (ghostscript != null) ''
Expand Down
Expand Up @@ -84,7 +84,7 @@ let
fteLibPath = makeLibraryPath [ stdenv.cc.cc gmp ];

# Upstream source
version = "7.0.3";
version = "7.0.4";

lang = "en-US";

Expand All @@ -94,15 +94,15 @@ let
"https://github.com/TheTorProject/gettorbrowser/releases/download/v${version}/tor-browser-linux64-${version}_${lang}.tar.xz"
"https://dist.torproject.org/torbrowser/${version}/tor-browser-linux64-${version}_${lang}.tar.xz"
];
sha256 = "1p91szx60xx3295bpap9w2ydgaibj0yn9lbdyhajal35bbhjxqhc";
sha256 = "17hz6nv7py80zbksk1dypmj8agr5jzsfrpjncphpsrflvbqzs2bx";
};

"i686-linux" = fetchurl {
urls = [
"https://github.com/TheTorProject/gettorbrowser/releases/download/v${version}/tor-browser-linux32-${version}_${lang}.tar.xz"
"https://dist.torproject.org/torbrowser/${version}/tor-browser-linux32-${version}_${lang}.tar.xz"
];
sha256 = "0p51dxiq3qxyc5n7xvh1hq039pvp7z730f6dks4h5p3sfqw6isfp";
sha256 = "0g8m5x891f4kdvb3fhmh98xfw569sbqd9wcadflabf9vc9bqv3al";
};
};
in
Expand Down
34 changes: 18 additions & 16 deletions pkgs/applications/networking/instant-messengers/discord/default.nix
@@ -1,44 +1,46 @@
{ stdenv, fetchurl, makeDesktopItem
{ stdenv, fetchurl, makeDesktopItem, makeWrapper
, alsaLib, atk, cairo, cups, dbus, expat, fontconfig, freetype, gdk_pixbuf
, glib, gnome2, gtk2, libnotify, libX11, libXcomposite, libXcursor, libXdamage
, libXext, libXfixes, libXi, libXrandr, libXrender, libXtst, nspr, nss, pango
, systemd, libXScrnSaver }:
, libXext, libXfixes, libXi, libXrandr, libXrender, libXtst, nspr, nss, libxcb
, pango, systemd, libXScrnSaver, libcxx }:

stdenv.mkDerivation rec {

pname = "discord";
version = "0.0.1";
version = "0.0.2";
name = "${pname}-${version}";

src = fetchurl {
url = "https://cdn.discordapp.com/apps/linux/${version}/${pname}-${version}.tar.gz";
sha256 = "10m3ixvhmxdw55awd84gx13m222qjykj7gcigbjabcvsgp2z63xs";
sha256 = "0sb7l0rrpqxzn4fndjr50r5xfiid1f81p22gda4mz943yv37mhfz";
};

nativeBuildInputs = [ makeWrapper ];

libPath = stdenv.lib.makeLibraryPath [
stdenv.cc.cc alsaLib atk cairo cups dbus expat fontconfig freetype
gdk_pixbuf glib gnome2.GConf gtk2 libnotify libX11 libXcomposite
libXcursor libXdamage libXext libXfixes libXi libXrandr libXrender
libXtst nspr nss pango systemd libXScrnSaver
libXtst nspr nss libxcb pango systemd libXScrnSaver
];

installPhase = ''
mkdir -p $out/{bin,share/pixmaps}
mv * $out
mkdir -p $out/{bin,opt,share/pixmaps}
mv * $out/opt
# Copying how adobe-reader does it,
# see pkgs/applications/misc/adobe-reader/builder.sh
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "$out:$libPath" \
$out/Discord
--set-rpath "$out/opt:$libPath" \
$out/opt/Discord
paxmark m $out/opt/Discord
paxmark m $out/Discord
wrapProgram $out/opt/Discord --prefix LD_LIBRARY_PATH : "$LD_LIBRARY_PATH:${libcxx}/lib:${systemd.lib}/lib"
ln -s $out/Discord $out/bin/
ln -s $out/discord.png $out/share/pixmaps
ln -s $out/opt/Discord $out/bin/
ln -s $out/opt/discord.png $out/share/pixmaps
# Putting udev in the path won't work :(
ln -s ${systemd.lib}/lib/libudev.so.1 $out
ln -s "${desktopItem}/share/applications" $out/share/
'';

Expand All @@ -56,7 +58,7 @@ stdenv.mkDerivation rec {
homepage = https://discordapp.com/;
downloadPage = "https://github.com/crmarsh/discord-linux-bugs";
license = licenses.unfree;
maintainers = [ maintainers.ldesgoui ];
maintainers = [ maintainers.ldesgoui maintainers.MP2E ];
platforms = [ "x86_64-linux" ];
};
}
@@ -0,0 +1,132 @@
diff -Nur wireshark-2.4.0/doc/udpdump.pod wireshark-2.4.0-p/doc/udpdump.pod
--- wireshark-2.4.0/doc/udpdump.pod 1970-01-01 01:00:00.000000000 +0100
+++ wireshark-2.4.0-p/doc/udpdump.pod 2017-08-01 10:48:40.551431319 +0200
@@ -0,0 +1,128 @@
+
+=head1 NAME
+
+udpdump - Provide an UDP receiver that gets packets from network devices (like Aruba routers) and exports them in PCAP format.
+
+=head1 SYNOPSIS
+
+B<udpdump>
+S<[ B<--help> ]>
+S<[ B<--version> ]>
+S<[ B<--extcap-interfaces> ]>
+S<[ B<--extcap-dlts> ]>
+S<[ B<--extcap-interface>=E<lt>interfaceE<gt> ]>
+S<[ B<--extcap-config> ]>
+S<[ B<--capture> ]>
+S<[ B<--fifo>=E<lt>path to file or pipeE<gt> ]>
+S<[ B<--port>=E<lt>portE<gt> ]>
+S<[ B<--payload>=E<lt>typeE<gt> ]>
+
+=head1 DESCRIPTION
+
+B<udpdump> is a extcap tool that provides an UDP receiver that listens for exported datagrams coming from
+any source (like Aruba routers) and exports them in PCAP format. This provides the user two basic
+functionalities: the first one is to have a listener that prevents the localhost to send back an ICMP
+port-unreachable packet. The second one is to strip out the lower layers (layer 2, IP, UDP) that are useless
+(are used just as export vector). The format of the exported datagrams are EXPORTED_PDU, as specified in
+https://code.wireshark.org/review/gitweb?p=wireshark.git;a=blob;f=epan/exported_pdu.h;hb=refs/heads/master
+
+=head1 OPTIONS
+
+=over 4
+
+=item --help
+
+Print program arguments.
+
+=item --version
+
+Print program version.
+
+=item --extcap-interfaces
+
+List available interfaces.
+
+=item --extcap-interface=E<lt>interfaceE<gt>
+
+Use specified interfaces.
+
+=item --extcap-dlts
+
+List DLTs of specified interface.
+
+=item --extcap-config
+
+List configuration options of specified interface.
+
+=item --capture
+
+Start capturing from specified interface save saved it in place specified by --fifo.
+
+=item --fifo=E<lt>path to file or pipeE<gt>
+
+Save captured packet to file or send it through pipe.
+
+=item --port=E<lt>portE<gt>
+
+Set the listerner port. Port 5555 is the default.
+
+=item --payload=E<lt>typeE<gt>
+
+Set the payload of the exported PDU. Default: data.
+
+=back
+
+=head1 EXAMPLES
+
+To see program arguments:
+
+ udpdump --help
+
+To see program version:
+
+ udpdump --version
+
+To see interfaces:
+
+ udpdump --extcap-interfaces
+
+ Example output:
+ interface {value=udpdump}{display=UDP Listener remote capture}
+
+To see interface DLTs:
+
+ udpdump --extcap-interface=udpdump --extcap-dlts
+
+ Example output:
+ dlt {number=252}{name=udpdump}{display=Exported PDUs}
+
+To see interface configuration options:
+
+ udpdump --extcap-interface=udpdump --extcap-config
+
+ Example output:
+ arg {number=0}{call=--port}{display=Listen port}{type=unsigned}{range=1,65535}{default=5555}{tooltip=The port the receiver listens on}
+
+To capture:
+
+ udpdump --extcap-interface=randpkt --fifo=/tmp/randpkt.pcapng --capture
+
+NOTE: To stop capturing CTRL+C/kill/terminate application.
+
+=head1 SEE ALSO
+
+wireshark(1), tshark(1), dumpcap(1), extcap(4)
+
+=head1 NOTES
+
+B<udpdump> is part of the B<Wireshark> distribution. The latest version
+of B<Wireshark> can be found at L<https://www.wireshark.org>.
+
+HTML versions of the Wireshark project man pages are available at:
+L<https://www.wireshark.org/docs/man-pages>.
+
+=head1 AUTHORS
+
+ Original Author
+ ---------------
+ Dario Lombardo <lomato[AT]gmail.com>

0 comments on commit 7a6d4f4

Please sign in to comment.