Skip to content

Commit

Permalink
Merge master into staging-next
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored May 23, 2022
2 parents 107b604 + bc38fca commit ba51228
Show file tree
Hide file tree
Showing 75 changed files with 401 additions and 197 deletions.
7 changes: 4 additions & 3 deletions doc/languages-frameworks/python.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -982,12 +982,13 @@ in python.withPackages(ps: [ps.blaze])).env
#### Optional extra dependencies

Some packages define optional dependencies for additional features. With
`setuptools` this is called `extras_require` and `flit` calls it `extras-require`. A
`setuptools` this is called `extras_require` and `flit` calls it
`extras-require`, while PEP 621 calls these `optional-dependencies`. A
method for supporting this is by declaring the extras of a package in its
`passthru`, e.g. in case of the package `dask`

```nix
passthru.extras-require = {
passthru.optional-dependencies = {
complete = [ distributed ];
};
```
Expand All @@ -997,7 +998,7 @@ and letting the package requiring the extra add the list to its dependencies
```nix
propagatedBuildInputs = [
...
] ++ dask.extras-require.complete;
] ++ dask.optional-dependencies.complete;
```

Note this method is preferred over adding parameters to builders, as that can
Expand Down
1 change: 1 addition & 0 deletions nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ in
nginx = handleTest ./nginx.nix {};
nginx-auth = handleTest ./nginx-auth.nix {};
nginx-etag = handleTest ./nginx-etag.nix {};
nginx-http3 = handleTest ./nginx-http3.nix {};
nginx-modsecurity = handleTest ./nginx-modsecurity.nix {};
nginx-pubhtml = handleTest ./nginx-pubhtml.nix {};
nginx-sandbox = handleTestOn ["x86_64-linux"] ./nginx-sandbox.nix {};
Expand Down
90 changes: 90 additions & 0 deletions nixos/tests/nginx-http3.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import ./make-test-python.nix ({lib, pkgs, ...}:
let
hosts = ''
192.168.2.101 acme.test
'';

in
{
name = "nginx-http3";
meta.maintainers = with pkgs.lib.maintainers; [ izorkin ];

nodes = {
server = { pkgs, ... }: {
networking = {
interfaces.eth1 = {
ipv4.addresses = [
{ address = "192.168.2.101"; prefixLength = 24; }
];
};
extraHosts = hosts;
firewall.allowedTCPPorts = [ 443 ];
firewall.allowedUDPPorts = [ 443 ];
};

security.pki.certificates = [
(builtins.readFile ./common/acme/server/ca.cert.pem)
];

services.nginx = {
enable = true;
package = pkgs.nginxQuic;

virtualHosts."acme.test" = {
onlySSL = true;
sslCertificate = ./common/acme/server/acme.test.cert.pem;
sslCertificateKey = ./common/acme/server/acme.test.key.pem;
http2 = true;
http3 = true;
reuseport = true;
root = lib.mkForce (pkgs.runCommandLocal "testdir2" {} ''
mkdir "$out"
cat > "$out/index.html" <<EOF
<html><body>Hello World!</body></html>
EOF
cat > "$out/example.txt" <<EOF
Check http3 protocol.
EOF
'');
};
};
};

client = { pkgs, ... }: {
environment.systemPackages = [ pkgs.curlHTTP3 ];
networking = {
interfaces.eth1 = {
ipv4.addresses = [
{ address = "192.168.2.201"; prefixLength = 24; }
];
};
extraHosts = hosts;
};

security.pki.certificates = [
(builtins.readFile ./common/acme/server/ca.cert.pem)
];
};
};

testScript = ''
start_all()
# Check http connections
client.succeed("curl --verbose --http3 https://acme.test | grep 'Hello World!'")
# Check downloadings
client.succeed("curl --verbose --http3 https://acme.test/example.txt --output /tmp/example.txt")
client.succeed("cat /tmp/example.txt | grep 'Check http3 protocol.'")
# Check header reading
client.succeed("curl --verbose --http3 --head https://acme.test | grep 'content-type'")
# Check change User-Agent
client.succeed("curl --verbose --http3 --user-agent 'Curl test 3.0' https://acme.test")
server.succeed("cat /var/log/nginx/access.log | grep 'Curl test 3.0'")
server.shutdown()
client.shutdown()
'';
})
11 changes: 11 additions & 0 deletions pkgs/applications/misc/openambit/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ cmake
, fetchFromGitHub
, fetchpatch
, lib
, libusb1
, mkDerivation
Expand All @@ -21,6 +22,16 @@ mkDerivation rec {
sha256 = "1074kvkamwnlkwdajsw1799wddcfkjh2ay6l842r0s4cvrxrai85";
};

patches = [
# Pull upstream patch for -fno-common toolchain support:
# https://github.com/openambitproject/openambit/pull/244
(fetchpatch {
name = "fno-common.patch";
url = "https://github.com/openambitproject/openambit/commit/b6d97eab417977b6dbe355e0b071d0a56cc3df6b.patch";
sha256 = "1p0dg902mlcfjvs01dxl9wv2b50ayp4330p38d14q87mn0c2xl5d";
})
];

nativeBuildInputs = [ cmake qttools ];
buildInputs = [ libusb1 python3 qtbase udev zlib ];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

python3.pkgs.buildPythonApplication rec {
pname = "deltachat-cursed";
version = "0.3.1";
version = "0.4.1";

src = fetchFromGitHub {
owner = "adbenitez";
repo = "deltachat-cursed";
rev = "v${version}";
hash = "sha256-IZrTPnj6eX1qgEPnEiD9qmVkwn1SMK38gVKAJFgZNfw=";
hash = "sha256-li6HsatiRJPVKKBBHyWhq2b8HhvDrOUiVT2tSupjuag=";
};

nativeBuildInputs = [
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/networking/syncplay/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildPythonApplication rec {
};

propagatedBuildInputs = [ twisted certifi ]
++ twisted.extras-require.tls
++ twisted.optional-dependencies.tls
++ lib.optional enableGUI pyside2;
nativeBuildInputs = lib.optionals enableGUI [ qt5.wrapQtAppsHook ];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/office/paperless-ngx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ py.pkgs.pythonPackages.buildPythonApplication rec {
threadpoolctl
tika
tqdm
twisted.extras-require.tls
twisted.optional-dependencies.tls
txaio
tzlocal
urllib3
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/version-management/gitea/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ with lib;

buildGoPackage rec {
pname = "gitea";
version = "1.16.7";
version = "1.16.8";

# not fetching directly from the git repo, because that lacks several vendor files for the web UI
src = fetchurl {
url = "https://github.com/go-gitea/gitea/releases/download/v${version}/gitea-src-${version}.tar.gz";
sha256 = "sha256-UVmbFtHC4W3WF+DptdHMMUoe8UE5TVgoM9QRuczSrEg=";
sha256 = "sha256-W/AbRfnEQfnTjXJ8wTKEFOTld4rFsBvJiXnYK8Ugoj0=";
};

unpackPhase = ''
Expand Down
27 changes: 17 additions & 10 deletions pkgs/development/compilers/crystal/build-package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
# Specify binaries to build in the form { foo.src = "src/foo.cr"; }
# The default `crystal build` options can be overridden with { foo.options = [ "--optionname" ]; }
, crystalBinaries ? { }
, enableParallelBuilding ? true
, ...
}@args:

Expand Down Expand Up @@ -51,6 +52,20 @@ let

buildDirectly = shardsFile == null || crystalBinaries != { };

mkCrystalBuildArgs = bin: attrs:
lib.concatStringsSep " " ([
"crystal"
"build"
] ++ lib.optionals enableParallelBuilding [
"--threads"
"$NIX_BUILD_CORES"
] ++ [
"-o"
bin
(attrs.src or (throw "No source file for crystal binary ${bin} provided"))
(lib.concatStringsSep " " (attrs.options or defaultOptions))
]);

in
stdenv.mkDerivation (mkDerivationArgs // {

Expand All @@ -72,6 +87,7 @@ stdenv.mkDerivation (mkDerivationArgs // {

PREFIX = placeholder "out";

inherit enableParallelBuilding;
strictDeps = true;
buildInputs = args.buildInputs or [ ] ++ [ crystal ];

Expand All @@ -88,16 +104,7 @@ stdenv.mkDerivation (mkDerivationArgs // {
"runHook preBuild"
] ++ lib.optional (format == "make")
"make \${buildTargets:-build} $makeFlags"
++ lib.optionals (format == "crystal") (lib.mapAttrsToList
(bin: attrs: ''
crystal ${lib.escapeShellArgs ([
"build"
"-o"
bin
(attrs.src or (throw "No source file for crystal binary ${bin} provided"))
] ++ (attrs.options or defaultOptions))}
'')
crystalBinaries)
++ lib.optionals (format == "crystal") (lib.mapAttrsToList mkCrystalBuildArgs crystalBinaries)
++ lib.optional (format == "shards")
"shards build --local --production ${lib.concatStringsSep " " (args.options or defaultOptions)}"
++ [ "runHook postBuild" ]));
Expand Down
5 changes: 5 additions & 0 deletions pkgs/development/compilers/miranda/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ stdenv.mkDerivation rec {
})
];

# Workaround build failure on -fno-common toolchains like upstream
# gcc-10. Otherwise build fails as:
# ld: types.o:(.bss+0x11b0): multiple definition of `current_file'; y.tab.o:(.bss+0x70): first defined here
NIX_CFLAGS_COMPILE = "-fcommon";

makeFlags = [
"CC=${stdenv.cc.targetPrefix}cc"
"CFLAGS=-O2"
Expand Down
40 changes: 15 additions & 25 deletions pkgs/development/embedded/platformio/core.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,13 @@
let
python = python3.override {
packageOverrides = self: super: {
semantic-version = super.semantic-version.overridePythonAttrs (oldAttrs: rec {
version = "2.9.0";
src = fetchPypi {
pname = "semantic_version";
version = version;
sha256 = "1chjd8019wnwb5mnd4x4jw9f8nhzg0xnapsdznk0fpiyamrlixdb";
};
});

starlette = super.starlette.overridePythonAttrs (oldAttrs: rec {
version = "0.18.0";
version = "0.20.0";
src = fetchFromGitHub {
owner = "encode";
repo = "starlette";
rev = version;
sha256 = "1dpj33cggjjvpd3qdf6hv04z5ckcn9f5dfn98p5a8hx262kgsr9p";
};
});

uvicorn = super.uvicorn.overridePythonAttrs (oldAttrs: rec {
version = "0.17.0";
src = fetchFromGitHub {
owner = "encode";
repo = "uvicorn";
rev = version;
sha256 = "142x8skb1yfys6gndfaay2r240j56dkr006p49pw4y9i0v85kynp";
sha256 = "sha256-bSgPjKqM262PSufz1LHwrdM+uU8xO55Mifv66HRN02Y=";
};
});
};
Expand Down Expand Up @@ -75,6 +56,8 @@ with python.pkgs; buildPythonApplication rec {
];

pytestFlagsArray = (map (e: "--deselect tests/${e}") [
"commands/pkg/test_exec.py::test_pkg_specified"
"commands/pkg/test_exec.py::test_unrecognized_options"
"commands/test_ci.py::test_ci_boards"
"commands/test_ci.py::test_ci_build_dir"
"commands/test_ci.py::test_ci_keep_build_dir"
Expand All @@ -84,6 +67,7 @@ with python.pkgs; buildPythonApplication rec {
"commands/test_init.py::test_init_duplicated_boards"
"commands/test_init.py::test_init_enable_auto_uploading"
"commands/test_init.py::test_init_ide_atom"
"commands/test_init.py::test_init_ide_clion"
"commands/test_init.py::test_init_ide_eclipse"
"commands/test_init.py::test_init_ide_vscode"
"commands/test_init.py::test_init_incorrect_board"
Expand Down Expand Up @@ -112,9 +96,6 @@ with python.pkgs; buildPythonApplication rec {
"commands/test_lib_complex.py::test_lib_show"
"commands/test_lib_complex.py::test_lib_stats"
"commands/test_lib_complex.py::test_search"
"commands/test_test.py::test_local_env"
"commands/test_test.py::test_multiple_env_build"
"commands/test_test.py::test_setup_teardown_are_compilable"
"package/test_manager.py::test_download"
"package/test_manager.py::test_install_force"
"package/test_manager.py::test_install_from_registry"
Expand All @@ -132,12 +113,21 @@ with python.pkgs; buildPythonApplication rec {
"test_misc.py::test_platformio_cli"
"test_pkgmanifest.py::test_packages"
]) ++ (map (e: "--ignore=tests/${e}") [
"commands/pkg/test_install.py"
"commands/pkg/test_list.py"
"commands/pkg/test_outdated.py"
"commands/pkg/test_search.py"
"commands/pkg/test_show.py"
"commands/pkg/test_uninstall.py"
"commands/pkg/test_update.py"
"commands/test_boards.py"
"commands/test_check.py"
"commands/test_platform.py"
"commands/test_run.py"
"commands/test_test.py"
"commands/test_update.py"
"test_maintenance.py"
"test_ino2cpp.py"
"test_maintenance.py"
]) ++ [
"tests"
];
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/embedded/platformio/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
let
callPackage = newScope self;

version = "5.2.5";
version = "6.0.1";

# pypi tarballs don't contain tests - https://github.com/platformio/platformio-core/issues/1964
src = fetchFromGitHub {
owner = "platformio";
repo = "platformio-core";
rev = "v${version}";
sha256 = "1x1jqprwzpb09ca953rqbh2jvizh7bz8yj30krphb6007bnjilwy";
sha256 = "sha256-noLdQctAaMNmfuxI3iybHFx3Q9aTr3gZaUZ+/uO+fnA=";
};

self = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ index 416dccfd..896c3649 100644
@staticmethod
@memoized(expire="1h")
def load_spdx_licenses():
- version = "3.16"
- version = "3.17"
- spdx_data_url = (
- "https://raw.githubusercontent.com/spdx/license-list-data/"
- "v%s/json/licenses.json" % version
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/interpreters/falcon/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ lib, gccStdenv, fetchFromGitHub, cmake, pkg-config, pcre, zlib, sqlite }:
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, pcre, zlib, sqlite }:

gccStdenv.mkDerivation {
stdenv.mkDerivation {
pname = "falcon";
version = "unstable-2018-10-23";

Expand Down
Loading

0 comments on commit ba51228

Please sign in to comment.