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 8, 2021
2 parents 01bf147 + 2af2325 commit e21fb16
Show file tree
Hide file tree
Showing 26 changed files with 442 additions and 317 deletions.
12 changes: 12 additions & 0 deletions lib/meta.nix
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,16 @@ rec {
then { system = elem; }
else { parsed = elem; };
in lib.matchAttrs pattern platform;

/* Check if a package is available on a given platform.
A package is available on a platform if both
1. One of `meta.platforms` pattern matches the given platform.
2. None of `meta.badPlatforms` pattern matches the given platform.
*/
availableOn = platform: pkg:
lib.any (platformMatch platform) pkg.meta.platforms &&
lib.all (elem: !platformMatch platform elem) (pkg.meta.badPlatforms or []);
}
8 changes: 4 additions & 4 deletions lib/types.nix
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,14 @@ rec {
};
u8 = unsign 8 256;
u16 = unsign 16 65536;
# the biggest int a 64-bit Nix accepts is 2^63 - 1 (9223372036854775808), for a 32-bit Nix it is 2^31 - 1 (2147483647)
# the smallest int a 64-bit Nix accepts is -2^63 (-9223372036854775807), for a 32-bit Nix it is -2^31 (-2147483648)
# u32 = unsign 32 4294967296;
# the biggest int Nix accepts is 2^63 - 1 (9223372036854775808)
# the smallest int Nix accepts is -2^63 (-9223372036854775807)
u32 = unsign 32 4294967296;
# u64 = unsign 64 18446744073709551616;

s8 = sign 8 256;
s16 = sign 16 65536;
# s32 = sign 32 4294967296;
s32 = sign 32 4294967296;
};

# Alias of u16 for a port number
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/system/boot/kexec.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ pkgs, lib, ... }:

{
config = lib.mkIf (lib.any (lib.meta.platformMatch pkgs.stdenv.hostPlatform) pkgs.kexectools.meta.platforms) {
config = lib.mkIf (lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.kexectools) {
environment.systemPackages = [ pkgs.kexectools ];

systemd.services.prepare-kexec =
Expand Down
7 changes: 4 additions & 3 deletions pkgs/applications/graphics/pick-colour-picker/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@

buildPythonPackage rec {
pname = "pick-colour-picker";
version = "unstable-2019-10-11"; # "1.5.0-3ec940"
version = "unstable-2021-01-19";

src = fetchFromGitHub {
owner = "stuartlangridge";
repo = "ColourPicker";
rev = "3ec9406d787ce373f6db0d520ed38a921edb9473";
sha256 = "04l8ch9297nhkgcmyhsbg0il424c8vy0isns1c7aypn0zp0dc4zd";
rev = "dec8f144918aa7964aaf86a346161beb7e997f09";
sha256 = "hW2rarfchZ3M0JVfz5RbJRvMhv2PpyLNEMyMAp2gC+o=";
fetchSubmodules = false;
};

nativeBuildInputs = [
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/misc/dasel/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

buildGoModule rec {
pname = "dasel";
version = "1.14.1";
version = "1.15.0";

src = fetchFromGitHub {
owner = "TomWright";
repo = pname;
rev = "v${version}";
sha256 = "0nxdyd0zg4w1zr8p9z2x88h36vbn7ryk7160zszdiwh5qmdlv47v";
sha256 = "sha256-XJSWdXGa1qkkMfETUV8xx9oaMdNVFdO27/GvDvczjG8=";
};

vendorSha256 = "sha256-BdX4DO77mIf/+aBdkNVFUzClsIml1UMcgvikDbbdgcY=";
Expand Down
11 changes: 6 additions & 5 deletions pkgs/applications/window-managers/dwm/dwm-status.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ in

rustPlatform.buildRustPackage rec {
pname = "dwm-status";
version = "1.7.1";
version = "unstable-2021-05-04";

src = fetchFromGitHub {
owner = "Gerschtli";
repo = "dwm-status";
rev = version;
sha256 = "172qkzbi37j6wx81pyqqffi9wxbg3bf8nis7d15ncn1yfd5r4gqh";
repo = pname;
rev = "c5b1fda78a8175cb53df9d31ae037c58279df810";
sha256 = "sha256-dJUQ7vuz9OC6eU00Snbbza63j01ms54sXO1kqheun+8=";
};

nativeBuildInputs = [ makeWrapper pkg-config ];
buildInputs = [ dbus gdk-pixbuf libnotify xorg.libX11 ];

cargoSha256 = "041sd9zm1c3v6iihnwjcya2xg5yxb2y4biyxpjlfblz2srxa15dm";
cargoSha256 = "sha256-zSt6iNZ9hmvAgFEXzqfovRsMryVyFWHm68G7J3SMztY=";

postInstall = lib.optionalString (bins != []) ''
wrapProgram $out/bin/dwm-status --prefix "PATH" : "${lib.makeBinPath bins}"
Expand All @@ -32,6 +32,7 @@ rustPlatform.buildRustPackage rec {
homepage = "https://github.com/Gerschtli/dwm-status";
license = with licenses; [ mit ];
maintainers = with maintainers; [ gerschtli ];
mainProgram = pname;
platforms = platforms.linux;
};
}
2 changes: 1 addition & 1 deletion pkgs/development/compilers/ghc/8.10.4.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

, # If enabled, GHC will be built with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library.
enableIntegerSimple ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
enableIntegerSimple ? !(lib.meta.availableOn stdenv.hostPlatform gmp), gmp

, # If enabled, use -fPIC when compiling static libs.
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/ghc/8.8.4.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

, # If enabled, GHC will be built with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library.
enableIntegerSimple ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
enableIntegerSimple ? !(lib.meta.availableOn stdenv.hostPlatform gmp), gmp

, # If enabled, use -fPIC when compiling static libs.
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/ghc/9.0.1.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

, # If enabled, GHC will be built with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library.
enableIntegerSimple ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
enableIntegerSimple ? !(lib.meta.availableOn stdenv.hostPlatform gmp), gmp

, # If enabled, use -fPIC when compiling static libs.
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/ghc/head.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

, # If enabled, GHC will be built with the GPL-free but slightly slower native
# bignum backend instead of the faster but GPLed gmp backend.
enableNativeBignum ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms)
enableNativeBignum ? !(lib.meta.availableOn stdenv.hostPlatform gmp)
, gmp

, # If enabled, use -fPIC when compiling static libs.
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/wiredtiger/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let
mkEnable = mkFlag "enable-" "disable-";
mkWith = mkFlag "with-" "without-";

shouldUsePkg = pkg: if pkg != null && lib.any (lib.meta.platformMatch stdenv.hostPlatform) pkg.meta.platforms then pkg else null;
shouldUsePkg = pkg: if pkg != null && lib.meta.availableOn stdenv.hostPlatform pkg then pkg else null;

optLz4 = shouldUsePkg lz4;
optSnappy = shouldUsePkg snappy;
Expand Down
27 changes: 16 additions & 11 deletions pkgs/development/python-modules/databases/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,46 @@
, sqlalchemy
, aiocontextvars
, isPy27
, pytest
, pytestCheckHook
, pymysql
, asyncpg
, aiomysql
, aiosqlite
}:

buildPythonPackage rec {
pname = "databases";
version = "0.2.6";
version = "0.4.3";
disabled = isPy27;

src = fetchFromGitHub {
owner = "encode";
repo = pname;
rev = version;
sha256 = "0cdb4vln4zdmqbbcj7711b81b2l64jg1miihqcg8gpi35v404h2q";
sha256 = "0aq88k7d9036cy6qvlfv9p2dxd6p6fic3j0az43gn6k1ardhdsgf";
};

propagatedBuildInputs = [
sqlalchemy
aiocontextvars
sqlalchemy
];

checkInputs = [
pytest
asyncpg
aiomysql
aiosqlite
asyncpg
pymysql
pytestCheckHook
];

# big chunk to tests depend on existing posgresql and mysql databases
# some tests are better than no tests
checkPhase = ''
pytest --ignore=tests/test_integration.py --ignore=tests/test_databases.py
'';
disabledTestPaths = [
# ModuleNotFoundError: No module named 'aiopg'
"tests/test_connection_options.py"
# circular dependency on starlette
"tests/test_integration.py"
# TEST_DATABASE_URLS is not set.
"tests/test_databases.py"
];

meta = with lib; {
description = "Async database support for Python";
Expand Down
38 changes: 38 additions & 0 deletions pkgs/development/python-modules/pyjwt/1.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{ lib
, buildPythonPackage
, fetchPypi
, cryptography
, pytestCheckHook
}:

buildPythonPackage rec {
pname = "PyJWT";
version = "1.7.1";

src = fetchPypi {
inherit pname version;
sha256 = "15hflax5qkw1v6nssk1r0wkj83jgghskcmn875m3wgvpzdvajncd";
};

postPatch = ''
substituteInPlace setup.py --replace "pytest>=4.0.1,<5.0.0" "pytest"
# drop coverage
sed -i '/pytest-cov/d' setup.py
sed -i '/--cov/d' setup.cfg
'';

propagatedBuildInputs = [
cryptography
];

checkInputs = [
pytestCheckHook
];

meta = with lib; {
description = "JSON Web Token implementation in Python";
homepage = "https://github.com/jpadilla/pyjwt";
license = licenses.mit;
};
}
2 changes: 1 addition & 1 deletion pkgs/misc/jackaudio/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
with lib;
let
inherit (python3Packages) python dbus-python;
shouldUsePkg = pkg: if pkg != null && lib.any (lib.meta.platformMatch stdenv.hostPlatform) pkg.meta.platforms then pkg else null;
shouldUsePkg = pkg: if pkg != null && lib.meta.availableOn stdenv.hostPlatform pkg then pkg else null;

libOnly = prefix == "lib";

Expand Down
2 changes: 1 addition & 1 deletion pkgs/misc/jackaudio/jack1.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
}:

let
shouldUsePkg = pkg: if pkg != null && lib.any (lib.meta.platformMatch stdenv.hostPlatform) pkg.meta.platforms then pkg else null;
shouldUsePkg = pkg: if pkg != null && lib.meta.availableOn stdenv.hostPlatform pkg then pkg else null;

optAlsaLib = shouldUsePkg alsaLib;
optDb = shouldUsePkg db;
Expand Down
Loading

0 comments on commit e21fb16

Please sign in to comment.