From 285632320dda85775699eba6b7eedcc47188bd3a Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Tue, 25 May 2021 10:53:04 +0200 Subject: [PATCH 01/15] lib.types.enum: Improve description for lengths 0 and 1 --- lib/types.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/types.nix b/lib/types.nix index f47a1f92de7..c35f055e17f 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -581,7 +581,17 @@ rec { in mkOptionType rec { name = "enum"; - description = "one of ${concatMapStringsSep ", " show values}"; + description = + # Length 0 or 1 enums may occur in a design pattern with type merging + # where an "interface" module declares an empty enum and other modules + # provide implementations, each extending the enum with their own + # identifier. + if values == [] then + "impossible (empty enum)" + else if builtins.length values == 1 then + "value ${show (builtins.head values)} (singular enum)" + else + "one of ${concatMapStringsSep ", " show values}"; check = flip elem values; merge = mergeEqualOption; functor = (defaultFunctor name) // { payload = values; binOp = a: b: unique (a ++ b); }; From a18b422fda67703786ee6101affd604d8debc5c3 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Mon, 5 Jul 2021 01:44:27 +0000 Subject: [PATCH 02/15] kodiPackages.pvr-hdhomerun: 7.1.0 -> 7.1.1 --- .../video/kodi-packages/pvr-hdhomerun/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/video/kodi-packages/pvr-hdhomerun/default.nix b/pkgs/applications/video/kodi-packages/pvr-hdhomerun/default.nix index ba1a0241ffe..7cdc5a0c635 100644 --- a/pkgs/applications/video/kodi-packages/pvr-hdhomerun/default.nix +++ b/pkgs/applications/video/kodi-packages/pvr-hdhomerun/default.nix @@ -2,13 +2,13 @@ buildKodiBinaryAddon rec { pname = "pvr-hdhomerun"; namespace = "pvr.hdhomerun"; - version = "7.1.0"; + version = "7.1.1"; src = fetchFromGitHub { owner = "kodi-pvr"; repo = "pvr.hdhomerun"; rev = "${version}-${rel}"; - sha256 = "0gbwjssnd319csq2kwlyjj1rskg19m1dxac5dl2dymvx5hn3zrgm"; + sha256 = "sha256-mQeeeCOxhUTiUcOJ1OiIiJ+7envAIGO67Bp4EAf4sIE="; }; extraBuildInputs = [ jsoncpp libhdhomerun ]; From 63c241d6a7fd1dfd9d6951f41a7d6d9e97040608 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Tue, 13 Jul 2021 18:16:35 +0200 Subject: [PATCH 03/15] neo4j: Fix JAVA_HOME --- pkgs/servers/nosql/neo4j/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/servers/nosql/neo4j/default.nix b/pkgs/servers/nosql/neo4j/default.nix index d9c9ddf8752..0ca16988c87 100644 --- a/pkgs/servers/nosql/neo4j/default.nix +++ b/pkgs/servers/nosql/neo4j/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { makeWrapper "$out/share/neo4j/bin/$NEO4J_SCRIPT" \ "$out/bin/$NEO4J_SCRIPT" \ --prefix PATH : "${lib.makeBinPath [ jre8 which gawk ]}" \ - --set JAVA_HOME "$jre8" + --set JAVA_HOME "${jre8}" done ''; From c43213bb6784af05faa7155e591400f7435797eb Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Tue, 13 Jul 2021 18:24:13 +0200 Subject: [PATCH 04/15] neo4j: Clean up and make jre easy to override Convention is to use `jre` and make it specific in the callPackage call. This way users can override it regardless of changes to the default neo4j jre. --- pkgs/servers/nosql/neo4j/default.nix | 8 +++----- pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/servers/nosql/neo4j/default.nix b/pkgs/servers/nosql/neo4j/default.nix index 0ca16988c87..9147de6d4a1 100644 --- a/pkgs/servers/nosql/neo4j/default.nix +++ b/pkgs/servers/nosql/neo4j/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, makeWrapper, jre8, which, gawk }: +{ lib, stdenv, fetchurl, makeWrapper, jre, which, gawk }: with lib; @@ -12,8 +12,6 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ makeWrapper ]; - buildInputs = [ jre8 which gawk ]; - installPhase = '' mkdir -p "$out/share/neo4j" @@ -24,8 +22,8 @@ stdenv.mkDerivation rec { do makeWrapper "$out/share/neo4j/bin/$NEO4J_SCRIPT" \ "$out/bin/$NEO4J_SCRIPT" \ - --prefix PATH : "${lib.makeBinPath [ jre8 which gawk ]}" \ - --set JAVA_HOME "${jre8}" + --prefix PATH : "${lib.makeBinPath [ jre which gawk ]}" \ + --set JAVA_HOME "${jre}" done ''; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 280283e0761..5bde6bda1b8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19911,7 +19911,9 @@ in check_systemd = callPackage ../servers/monitoring/nagios/plugins/check_systemd.nix { }; - neo4j = callPackage ../servers/nosql/neo4j { }; + neo4j = callPackage ../servers/nosql/neo4j { + jre = jre8; + }; neo4j-desktop = callPackage ../applications/misc/neo4j-desktop { }; From 2ed8c5f4a901c80e0cbf8f930f37022a02be608a Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Tue, 13 Jul 2021 18:25:30 +0200 Subject: [PATCH 05/15] neo4j: Use jre8 -> jre8_headless --- pkgs/top-level/all-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5bde6bda1b8..f0aeb9dda9c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19912,7 +19912,7 @@ in check_systemd = callPackage ../servers/monitoring/nagios/plugins/check_systemd.nix { }; neo4j = callPackage ../servers/nosql/neo4j { - jre = jre8; + jre = jre8_headless; }; neo4j-desktop = callPackage ../applications/misc/neo4j-desktop { }; From fede9e9ca84abf954bee9314a52c8eead133421c Mon Sep 17 00:00:00 2001 From: Danielle Lancashire Date: Fri, 16 Jul 2021 01:15:26 +0200 Subject: [PATCH 06/15] python3Packages.docker: 4.4.4 -> 5.0.0 --- pkgs/development/python-modules/docker/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/docker/default.nix b/pkgs/development/python-modules/docker/default.nix index 5e5071e9308..3c41ccd1732 100644 --- a/pkgs/development/python-modules/docker/default.nix +++ b/pkgs/development/python-modules/docker/default.nix @@ -14,11 +14,11 @@ buildPythonPackage rec { pname = "docker"; - version = "4.4.4"; + version = "5.0.0"; src = fetchPypi { inherit pname version; - sha256 = "d3393c878f575d3a9ca3b94471a3c89a6d960b35feb92f033c0de36cc9d934db"; + sha256 = "sha256-PovEdTTgypMx1ywy8ogbsTuT3tC83qs8gz+3z2HAqaU="; }; nativeBuildInputs = lib.optional isPy27 mock; From 8fd04c7261ef3a7b7a84f3be0da1b1e3a8998114 Mon Sep 17 00:00:00 2001 From: Danielle Lancashire Date: Fri, 16 Jul 2021 01:16:24 +0200 Subject: [PATCH 07/15] docker-compose: 1.28.6 -> 1.29.2 --- pkgs/applications/virtualization/docker-compose/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/virtualization/docker-compose/default.nix b/pkgs/applications/virtualization/docker-compose/default.nix index cc893680674..fd67aa554f0 100644 --- a/pkgs/applications/virtualization/docker-compose/default.nix +++ b/pkgs/applications/virtualization/docker-compose/default.nix @@ -8,12 +8,12 @@ }: buildPythonApplication rec { - version = "1.28.6"; + version = "1.29.2"; pname = "docker-compose"; src = fetchPypi { inherit pname version; - sha256 = "1d44906f7ab738ba2d1785130ed31b16111eee6dc5a1dbd7252091dae48c5281"; + sha256 = "sha256-TIzZ0h0jdBJ5PRi9MxEASe6a+Nqz/iwhO70HM5WbCbc="; }; # lots of networking and other fails From 97031a5fad7679b1a2b7562f61f69765c57ce8c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Silva?= Date: Fri, 16 Jul 2021 22:14:41 +0100 Subject: [PATCH 08/15] ledger-live-desktop: 2.29.0 -> 2.30.0 --- pkgs/applications/blockchains/ledger-live-desktop/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/blockchains/ledger-live-desktop/default.nix b/pkgs/applications/blockchains/ledger-live-desktop/default.nix index 0692f40e35f..1c6c41a0e72 100644 --- a/pkgs/applications/blockchains/ledger-live-desktop/default.nix +++ b/pkgs/applications/blockchains/ledger-live-desktop/default.nix @@ -2,12 +2,12 @@ let pname = "ledger-live-desktop"; - version = "2.29.0"; + version = "2.30.0"; name = "${pname}-${version}"; src = fetchurl { url = "https://github.com/LedgerHQ/${pname}/releases/download/v${version}/${pname}-${version}-linux-x86_64.AppImage"; - sha256 = "1y4xvnwh2mqbc39pmnpgjg8mlx208s2pipm7dazq4bgmay7k9zh0"; + sha256 = "0xh28m3slzg6bp0fm183m62ydzqkvj384j4dwsfalgz4ndwvy595"; }; appimageContents = appimageTools.extractType2 { From 43260afeea3f461d28d899585432cdc8019c7138 Mon Sep 17 00:00:00 2001 From: figsoda Date: Fri, 16 Jul 2021 22:22:37 -0400 Subject: [PATCH 09/15] vimPlugins.null-ls-nvim: init at 2021-07-14 --- pkgs/misc/vim-plugins/generated.nix | 12 ++++++++++++ pkgs/misc/vim-plugins/overrides.nix | 4 ++++ pkgs/misc/vim-plugins/vim-plugin-names | 1 + 3 files changed, 17 insertions(+) diff --git a/pkgs/misc/vim-plugins/generated.nix b/pkgs/misc/vim-plugins/generated.nix index 9eb3b04dd7f..734b5b2bcc4 100644 --- a/pkgs/misc/vim-plugins/generated.nix +++ b/pkgs/misc/vim-plugins/generated.nix @@ -3418,6 +3418,18 @@ final: prev: meta.homepage = "https://github.com/jlesquembre/nterm.nvim/"; }; + null-ls-nvim = buildVimPluginFrom2Nix { + pname = "null-ls-nvim"; + version = "2021-07-14"; + src = fetchFromGitHub { + owner = "jose-elias-alvarez"; + repo = "null-ls.nvim"; + rev = "56d4b76203d2b442353e25c247f49fa5ca70f42e"; + sha256 = "0kmgln5ra2lpdvj9866a11l9h04zc1dmvxcw8gbra6f72ars3jwr"; + }; + meta.homepage = "https://github.com/jose-elias-alvarez/null-ls.nvim/"; + }; + numb-nvim = buildVimPluginFrom2Nix { pname = "numb-nvim"; version = "2021-07-12"; diff --git a/pkgs/misc/vim-plugins/overrides.nix b/pkgs/misc/vim-plugins/overrides.nix index 6c2063e0a97..3e19a289117 100644 --- a/pkgs/misc/vim-plugins/overrides.nix +++ b/pkgs/misc/vim-plugins/overrides.nix @@ -399,6 +399,10 @@ self: super: { dependencies = with self; [ plenary-nvim ]; }); + null-ls-nvim = super.null-ls-nvim.overrideAttrs (old: { + path = "null-ls.nvim"; + }); + nvim-lsputils = super.nvim-lsputils.overrideAttrs (old: { dependencies = with self; [ popfix ]; }); diff --git a/pkgs/misc/vim-plugins/vim-plugin-names b/pkgs/misc/vim-plugins/vim-plugin-names index 02280936740..943a27f3604 100644 --- a/pkgs/misc/vim-plugins/vim-plugin-names +++ b/pkgs/misc/vim-plugins/vim-plugin-names @@ -258,6 +258,7 @@ jonsmithers/vim-html-template-literals joonty/vim-xdebug josa42/coc-lua josa42/vim-lightline-coc +jose-elias-alvarez/null-ls.nvim@main joshdick/onedark.vim@main jpalardy/vim-slime@main jparise/vim-graphql From aabf5dd5f7a122b33ea601bf5546acf4e2909c81 Mon Sep 17 00:00:00 2001 From: Babbaj Date: Sat, 17 Jul 2021 23:22:17 -0400 Subject: [PATCH 10/15] looking-glass-client: B3 -> B4 --- ...ore-maybe-uninitialized-when-O3-is-i.patch | 45 ---------------- .../looking-glass-client/default.nix | 52 ++++++++++++------- 2 files changed, 33 insertions(+), 64 deletions(-) delete mode 100644 pkgs/applications/virtualization/looking-glass-client/0001-client-all-fix-more-maybe-uninitialized-when-O3-is-i.patch diff --git a/pkgs/applications/virtualization/looking-glass-client/0001-client-all-fix-more-maybe-uninitialized-when-O3-is-i.patch b/pkgs/applications/virtualization/looking-glass-client/0001-client-all-fix-more-maybe-uninitialized-when-O3-is-i.patch deleted file mode 100644 index 82ce050b587..00000000000 --- a/pkgs/applications/virtualization/looking-glass-client/0001-client-all-fix-more-maybe-uninitialized-when-O3-is-i.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 95a7293b30ff7b89d615daea00269ed32f4b70a2 Mon Sep 17 00:00:00 2001 -From: Geoffrey McRae -Date: Tue, 23 Feb 2021 20:25:30 +1100 -Subject: [PATCH] [client] all: fix more `maybe-uninitialized` when `-O3` is in - use - -Closes #475 ---- - client/renderers/EGL/egl.c | 3 ++- - client/src/main.c | 5 +++-- - 2 files changed, 5 insertions(+), 3 deletions(-) - -diff --git a/client/renderers/EGL/egl.c b/client/renderers/EGL/egl.c -index b7a5644..72ce50d 100644 ---- a/client/renderers/EGL/egl.c -+++ b/client/renderers/EGL/egl.c -@@ -271,7 +271,8 @@ static void egl_calc_mouse_size(struct Inst * this) - if (!this->formatValid) - return; - -- int w, h; -+ int w = 0, h = 0; -+ - switch(this->format.rotate) - { - case LG_ROTATE_0: -diff --git a/client/src/main.c b/client/src/main.c -index f05e929..f5d6fad 100644 ---- a/client/src/main.c -+++ b/client/src/main.c -@@ -186,8 +186,9 @@ static void updatePositionInfo(void) - if (!g_state.haveSrcSize) - goto done; - -- float srcW; -- float srcH; -+ float srcW = 0.0f; -+ float srcH = 0.0f; -+ - switch(params.winRotate) - { - case LG_ROTATE_0: --- -2.30.1 - diff --git a/pkgs/applications/virtualization/looking-glass-client/default.nix b/pkgs/applications/virtualization/looking-glass-client/default.nix index 345018bbe4e..0d158cc3f96 100644 --- a/pkgs/applications/virtualization/looking-glass-client/default.nix +++ b/pkgs/applications/virtualization/looking-glass-client/default.nix @@ -1,40 +1,54 @@ -{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, SDL2, SDL2_ttf, spice-protocol -, fontconfig, libX11, freefont_ttf, nettle, libpthreadstubs, libXau, libXdmcp -, libXi, libXext, wayland, wayland-protocols, libffi, libGLU, libXScrnSaver -, expat, libbfd + +{ stdenv, lib, fetchFromGitHub, fetchpatch, makeDesktopItem, cmake, pkg-config +, SDL, SDL2_ttf, freefont_ttf, spice-protocol, nettle, libbfd, fontconfig +, libXi, libXScrnSaver, libXinerama +, wayland, wayland-protocols }: +let + desktopItem = makeDesktopItem { + name = "looking-glass-client"; + desktopName = "Looking Glass Client"; + type = "Application"; + exec = "looking-glass-client"; + icon = "lg-logo"; + terminal = true; + }; +in stdenv.mkDerivation rec { pname = "looking-glass-client"; - version = "B3"; + version = "B4"; src = fetchFromGitHub { owner = "gnif"; repo = "LookingGlass"; rev = version; - sha256 = "1vmabjzn85p0brdian9lbpjq39agzn8k0limn8zjm713lh3n3c0f"; + sha256 = "0fwmz0l1dcfwklgvxmv0galgj2q3nss90kc3jwgf6n80x27rsnhf"; fetchSubmodules = true; }; nativeBuildInputs = [ cmake pkg-config ]; buildInputs = [ - SDL2 SDL2_ttf spice-protocol fontconfig libX11 freefont_ttf nettle - libpthreadstubs libXau libXdmcp libXi libXext wayland wayland-protocols - libffi libGLU libXScrnSaver expat libbfd + SDL SDL2_ttf freefont_ttf spice-protocol + libbfd nettle fontconfig + libXi libXScrnSaver libXinerama + wayland wayland-protocols ]; - patches = [ - # error: ‘h’ may be used uninitialized in this function [-Werror=maybe-uninitialized] - # Fixed upstream in master in 8771103abbfd04da9787dea760405364af0d82de, but not in B3. - # Including our own patch here since upstream commit patch doesnt apply cleanly on B3 - ./0001-client-all-fix-more-maybe-uninitialized-when-O3-is-i.patch - ]; - patchFlags = "-p2"; - - sourceRoot = "source/client"; NIX_CFLAGS_COMPILE = "-mavx"; # Fix some sort of AVX compiler problem. + postUnpack = '' + echo $version > source/VERSION + export sourceRoot="source/client" + ''; + + postInstall = '' + mkdir -p $out/share/pixmaps + ln -s ${desktopItem}/share/applications $out/share/ + cp $src/resources/lg-logo.png $out/share/pixmaps + ''; + meta = with lib; { description = "A KVM Frame Relay (KVMFR) implementation"; longDescription = '' @@ -46,7 +60,7 @@ stdenv.mkDerivation rec { ''; homepage = "https://looking-glass.io/"; license = licenses.gpl2Plus; - maintainers = with maintainers; [ alexbakker ]; + maintainers = with maintainers; [ alexbakker babbaj ]; platforms = [ "x86_64-linux" ]; }; } From 6ec2fcefd296afd0bd6952e11589662b7e9415d0 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Sun, 18 Jul 2021 12:26:11 +0200 Subject: [PATCH 11/15] python3Packages.h2: fix typo (pythonImportCheck -> pythonImportsCheck) --- pkgs/development/python-modules/h2/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/h2/default.nix b/pkgs/development/python-modules/h2/default.nix index fccc1643216..fcd28362149 100644 --- a/pkgs/development/python-modules/h2/default.nix +++ b/pkgs/development/python-modules/h2/default.nix @@ -39,7 +39,7 @@ buildPythonPackage rec { hypothesis ]; - pythonImportCheck = [ + pythonImportsCheck = [ "h2.connection" "h2.config" ]; From 986862fc8f3dfce7c67efd4efe016987d3654534 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Sun, 18 Jul 2021 12:26:49 +0200 Subject: [PATCH 12/15] python3Packages.flask-restx: fix typo (pythonImportCheck -> pythonImportsCheck) --- pkgs/development/python-modules/flask-restx/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/flask-restx/default.nix b/pkgs/development/python-modules/flask-restx/default.nix index 4d0d89d0f14..556317ed41f 100644 --- a/pkgs/development/python-modules/flask-restx/default.nix +++ b/pkgs/development/python-modules/flask-restx/default.nix @@ -49,7 +49,7 @@ buildPythonPackage rec { "--deselect=tests/test_logging.py::LoggingTest::test_override_app_level" ]; - pythonImportCheck = [ "flask_restx" ]; + pythonImportsCheck = [ "flask_restx" ]; meta = with lib; { homepage = "https://flask-restx.readthedocs.io/en/${version}/"; From 703b9b144c5b1ed5bc5057c9277c85f00e801d78 Mon Sep 17 00:00:00 2001 From: Luflosi Date: Wed, 14 Jul 2021 18:04:05 +0200 Subject: [PATCH 13/15] nodePackages.postcss-cli: add passthru.tests --- pkgs/development/node-packages/default.nix | 5 +++ .../package-tests/postcss-cli.nix | 45 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 pkgs/development/node-packages/package-tests/postcss-cli.nix diff --git a/pkgs/development/node-packages/default.nix b/pkgs/development/node-packages/default.nix index c25f3a801ff..498f41bc1b3 100644 --- a/pkgs/development/node-packages/default.nix +++ b/pkgs/development/node-packages/default.nix @@ -276,6 +276,11 @@ let --prefix NODE_PATH : ${self.postcss}/lib/node_modules \ --prefix NODE_PATH : ${self.autoprefixer}/lib/node_modules ''; + passthru.tests = { + simple-execution = pkgs.callPackage ./package-tests/postcss-cli.nix { + inherit (self) postcss-cli; + }; + }; meta.mainProgram = "postcss"; }; diff --git a/pkgs/development/node-packages/package-tests/postcss-cli.nix b/pkgs/development/node-packages/package-tests/postcss-cli.nix new file mode 100644 index 00000000000..521509e7f43 --- /dev/null +++ b/pkgs/development/node-packages/package-tests/postcss-cli.nix @@ -0,0 +1,45 @@ +{ runCommand, postcss-cli }: + +let + inherit (postcss-cli) packageName version; +in + +runCommand "${packageName}-tests" { meta.timeout = 60; } + '' + # get version of installed program and compare with package version + claimed_version="$(${postcss-cli}/bin/postcss --version)" + if [[ "$claimed_version" != "${version}" ]]; then + echo "Error: program version does not match package version ($claimed_version != ${version})" + exit 1 + fi + + # run basic help command + ${postcss-cli}/bin/postcss --help > /dev/null + + # basic autoprefixer test + config_dir="$(mktemp -d)" + clean_up() { + rm -rf "$config_dir" + } + trap clean_up EXIT + echo " + module.exports = { + plugins: { + 'autoprefixer': { overrideBrowserslist: 'chrome 40' }, + }, + } + " > "$config_dir/postcss.config.js" + input='a{ user-select: none; }' + expected_output='a{ -webkit-user-select: none; user-select: none; }' + actual_output="$(echo $input | ${postcss-cli}/bin/postcss --no-map --config $config_dir)" + if [[ "$actual_output" != "$expected_output" ]]; then + echo "Error: autoprefixer did not output the correct CSS:" + echo "$actual_output" + echo "!=" + echo "$expected_output" + exit 1 + fi + + # needed for Nix to register the command as successful + touch $out + '' From 23dd37dd5ed22cc0ad296698330a9ecd1e26c16c Mon Sep 17 00:00:00 2001 From: Romanos Skiadas Date: Sat, 17 Jul 2021 18:02:45 +0300 Subject: [PATCH 14/15] rustPlatform.importCargoLock: add an assert for old Cargo.locks near the end of 2019, the default Cargo.lock format was changed to [[package]] checksum = ... This is what importCargoLock assumes. If the crate had not been `cargo update`'d with a more recent toolchain than the one with the new format as default, importCargoLock would fail when trying to access pkg.checksum. I ran into such a case (shamefully, in my own crate) and it took me a while to figure out what was going on, so here is an assert with a more user friendly message and a hint. --- pkgs/build-support/rust/import-cargo-lock.nix | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/pkgs/build-support/rust/import-cargo-lock.nix b/pkgs/build-support/rust/import-cargo-lock.nix index 244572f79e8..83f4e0df4f2 100644 --- a/pkgs/build-support/rust/import-cargo-lock.nix +++ b/pkgs/build-support/rust/import-cargo-lock.nix @@ -63,11 +63,19 @@ let # We can't use the existing fetchCrate function, since it uses a # recursive hash of the unpacked crate. - fetchCrate = pkg: fetchurl { - name = "crate-${pkg.name}-${pkg.version}.tar.gz"; - url = "https://crates.io/api/v1/crates/${pkg.name}/${pkg.version}/download"; - sha256 = pkg.checksum; - }; + fetchCrate = pkg: + assert lib.assertMsg (pkg ? checksum) '' + Package ${pkg.name} does not have a checksum. + Please note that the Cargo.lock format where checksums used to be listed + under [metadata] is not supported. + If that is the case, running `cargo update` with a recent toolchain will + automatically update the format along with the crate's depenendencies. + ''; + fetchurl { + name = "crate-${pkg.name}-${pkg.version}.tar.gz"; + url = "https://crates.io/api/v1/crates/${pkg.name}/${pkg.version}/download"; + sha256 = pkg.checksum; + }; # Fetch and unpack a crate. mkCrate = pkg: From b3d80503cfa3e5b8513d47f91ac1a2025e81141c Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Sun, 18 Jul 2021 21:24:03 +0800 Subject: [PATCH 15/15] du-dust: add meta.mainProgram --- pkgs/tools/misc/dust/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/tools/misc/dust/default.nix b/pkgs/tools/misc/dust/default.nix index dc8dc5af97c..97b98eea4f9 100644 --- a/pkgs/tools/misc/dust/default.nix +++ b/pkgs/tools/misc/dust/default.nix @@ -25,5 +25,6 @@ rustPlatform.buildRustPackage rec { homepage = "https://github.com/bootandy/dust"; license = licenses.asl20; maintainers = with maintainers; [ infinisil SuperSandro2000 ]; + mainProgram = "dust"; }; }