From 4aa1a4d8a220cd937fab8eeb16d4fa9b82a030b3 Mon Sep 17 00:00:00 2001 From: Izorkin Date: Sun, 14 Nov 2021 18:06:50 +0300 Subject: [PATCH 01/14] quictls: init at v3.0.0+quic_unstable-2021-11-02 --- .../development/libraries/quictls/default.nix | 170 ++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 172 insertions(+) create mode 100644 pkgs/development/libraries/quictls/default.nix diff --git a/pkgs/development/libraries/quictls/default.nix b/pkgs/development/libraries/quictls/default.nix new file mode 100644 index 000000000000..a91015e1b8a7 --- /dev/null +++ b/pkgs/development/libraries/quictls/default.nix @@ -0,0 +1,170 @@ +{ lib, stdenv, fetchurl, buildPackages, perl, coreutils, fetchFromGitHub +, withCryptodev ? false, cryptodev +, enableSSL2 ? false +, enableSSL3 ? false +, static ? stdenv.hostPlatform.isStatic +# Used to avoid cross compiling perl, for example, in darwin bootstrap tools. +# This will cause c_rehash to refer to perl via the environment, but otherwise +# will produce a perfectly functional openssl binary and library. +, withPerl ? stdenv.hostPlatform == stdenv.buildPlatform +}: + +assert ( + lib.assertMsg (!withPerl -> stdenv.hostPlatform != stdenv.buildPlatform) + "withPerl should not be disabled unless cross compiling" +); + +stdenv.mkDerivation rec { + pname = "quictls"; + version = "3.0.0+quick_unstable-2021-11.02"; + + src = fetchFromGitHub { + owner = "quictls"; + repo = "openssl"; + rev = "62d4de00abfa82fc01efa2eba1982a86c4864f39"; + sha256 = "11mi4bkkyy4qd2wml6p7xcsbps0mabk3bp537rp7n43qnhwyg1g3"; + }; + + patches = [ + ../openssl/3.0/nix-ssl-cert-file.patch + + # openssl will only compile in KTLS if the current kernel supports it. + # This patch disables build-time detection. + ../openssl/3.0/openssl-disable-kernel-detection.patch + + (if stdenv.hostPlatform.isDarwin + then ../openssl/use-etc-ssl-certs-darwin.patch + else ../openssl/use-etc-ssl-certs.patch) + ]; + + postPatch = '' + patchShebangs Configure + '' + # config is a configure script which is not installed. + + '' + substituteInPlace config --replace '/usr/bin/env' '${buildPackages.coreutils}/bin/env' + '' + lib.optionalString stdenv.hostPlatform.isMusl '' + substituteInPlace crypto/async/arch/async_posix.h \ + --replace '!defined(__ANDROID__) && !defined(__OpenBSD__)' \ + '!defined(__ANDROID__) && !defined(__OpenBSD__) && 0' + ''; + + outputs = [ "bin" "dev" "out" "man" "doc" ]; + setOutputFlags = false; + separateDebugInfo = + !stdenv.hostPlatform.isDarwin && + !(stdenv.hostPlatform.useLLVM or false) && + stdenv.cc.isGNU; + + nativeBuildInputs = [ perl ]; + buildInputs = lib.optional withCryptodev cryptodev + # perl is included to allow the interpreter path fixup hook to set the + # correct interpreter in c_rehash. + ++ lib.optional withPerl perl; + + # TODO(@Ericson2314): Improve with mass rebuild + configurePlatforms = []; + configureScript = { + armv5tel-linux = "./Configure linux-armv4 -march=armv5te"; + armv6l-linux = "./Configure linux-armv4 -march=armv6"; + armv7l-linux = "./Configure linux-armv4 -march=armv7-a"; + x86_64-darwin = "./Configure darwin64-x86_64-cc"; + aarch64-darwin = "./Configure darwin64-arm64-cc"; + x86_64-linux = "./Configure linux-x86_64"; + x86_64-solaris = "./Configure solaris64-x86_64-gcc"; + riscv64-linux = "./Configure linux64-riscv64"; + }.${stdenv.hostPlatform.system} or ( + if stdenv.hostPlatform == stdenv.buildPlatform + then "./config" + else if stdenv.hostPlatform.isBSD && stdenv.hostPlatform.isx86_64 + then "./Configure BSD-x86_64" + else if stdenv.hostPlatform.isBSD && stdenv.hostPlatform.isx86_32 + then "./Configure BSD-x86" + lib.optionalString (stdenv.hostPlatform.parsed.kernel.execFormat.name == "elf") "-elf" + else if stdenv.hostPlatform.isBSD + then "./Configure BSD-generic${toString stdenv.hostPlatform.parsed.cpu.bits}" + else if stdenv.hostPlatform.isMinGW + then "./Configure mingw${lib.optionalString + (stdenv.hostPlatform.parsed.cpu.bits != 32) + (toString stdenv.hostPlatform.parsed.cpu.bits)}" + else if stdenv.hostPlatform.isLinux + then "./Configure linux-generic${toString stdenv.hostPlatform.parsed.cpu.bits}" + else if stdenv.hostPlatform.isiOS + then "./Configure ios${toString stdenv.hostPlatform.parsed.cpu.bits}-cross" + else + throw "Not sure what configuration to use for ${stdenv.hostPlatform.config}" + ); + + # OpenSSL doesn't like the `--enable-static` / `--disable-shared` flags. + dontAddStaticConfigureFlags = true; + configureFlags = [ + "shared" # "shared" builds both shared and static libraries + "--libdir=lib" + "--openssldir=etc/ssl" + "enable-ktls" + ] ++ lib.optionals withCryptodev [ + "-DHAVE_CRYPTODEV" + "-DUSE_CRYPTODEV_DIGESTS" + ] ++ lib.optional enableSSL2 "enable-ssl2" + ++ lib.optional enableSSL3 "enable-ssl3" + ++ lib.optional stdenv.hostPlatform.isAarch64 "no-afalgeng" + # OpenSSL needs a specific `no-shared` configure flag. + # See https://wiki.openssl.org/index.php/Compilation_and_Installation#Configure_Options + # for a comprehensive list of configuration options. + ++ lib.optional static "no-shared"; + + makeFlags = [ + "MANDIR=$(man)/share/man" + # This avoids conflicts between man pages of openssl subcommands (for + # example 'ts' and 'err') man pages and their equivalent top-level + # command in other packages (respectively man-pages and moreutils). + # This is done in ubuntu and archlinux, and possiibly many other distros. + "MANSUFFIX=ssl" + ]; + + enableParallelBuilding = true; + + postInstall = lib.optionalString (!static) '' + # If we're building dynamic libraries, then don't install static + # libraries. + if [ -n "$(echo $out/lib/*.so $out/lib/*.dylib $out/lib/*.dll)" ]; then + rm "$out/lib/"*.a + fi + '' + lib.optionalString (!stdenv.hostPlatform.isWindows) + # Fix bin/c_rehash's perl interpreter line + # + # - openssl 1_0_2: embeds a reference to buildPackages.perl + # - openssl 1_1: emits "#!/usr/bin/env perl" + # + # In the case of openssl_1_0_2, reset the invalid reference and let the + # interpreter hook take care of it. + # + # In both cases, if withPerl = false, the intepreter line is expected be + # "#!/usr/bin/env perl" + '' + substituteInPlace $out/bin/c_rehash --replace ${buildPackages.perl}/bin/perl "/usr/bin/env perl" + '' + '' + mkdir -p $bin + mv $out/bin $bin/bin + mkdir $dev + mv $out/include $dev/ + # remove dependency on Perl at runtime + rm -r $out/etc/ssl/misc + rmdir $out/etc/ssl/{certs,private} + ''; + + postFixup = lib.optionalString (!stdenv.hostPlatform.isWindows) '' + # Check to make sure the main output doesn't depend on perl + if grep -r '${buildPackages.perl}' $out; then + echo "Found an erroneous dependency on perl ^^^" >&2 + exit 1 + fi + ''; + + meta = with lib; { + homepage = "https://quictls.github.io/openssl/"; + description = "TLS/SSL and crypto library with QUIC APIs"; + license = licenses.openssl; + platforms = platforms.all; + maintainers = with maintainers; [ izorkin ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 76ca8774dcfe..3d0139a65376 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8948,6 +8948,8 @@ with pkgs; quickserve = callPackage ../tools/networking/quickserve { }; + quictls = callPackage ../development/libraries/quictls { }; + quicktun = callPackage ../tools/networking/quicktun { }; quilt = callPackage ../development/tools/quilt { }; From 955e944d95cfc34ffe941afebdd2894f7641b13d Mon Sep 17 00:00:00 2001 From: Izorkin Date: Sun, 14 Nov 2021 18:12:35 +0300 Subject: [PATCH 02/14] nghttp3: init at unstable-2021-11-10 --- .../development/libraries/nghttp3/default.nix | 34 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/libraries/nghttp3/default.nix diff --git a/pkgs/development/libraries/nghttp3/default.nix b/pkgs/development/libraries/nghttp3/default.nix new file mode 100644 index 000000000000..85a66f940658 --- /dev/null +++ b/pkgs/development/libraries/nghttp3/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchFromGitHub +, autoreconfHook, pkg-config +, cunit, file +}: + +stdenv.mkDerivation rec { + pname = "nghttp3"; + version = "unstable-2021-11-10"; + + src = fetchFromGitHub { + owner = "ngtcp2"; + repo = pname; + rev = "270e75447ed9e2a05b78ba89d0699d076230ea60"; + sha256 = "01cla03cv8nd2rf5p77h0xzvn9f8sfwn8pp3r2jshvqp9ipa8065"; + }; + + nativeBuildInputs = [ autoreconfHook pkg-config cunit file ]; + + preConfigure = '' + substituteInPlace ./configure --replace /usr/bin/file ${file}/bin/file + ''; + + outputs = [ "out" "dev" ]; + + doCheck = true; + + meta = with lib; { + homepage = "https://github.com/ngtcp2/nghttp3"; + description = "nghttp3 is an implementation of HTTP/3 mapping over QUIC and QPACK in C."; + license = licenses.mit; + platforms = platforms.linux; + maintainers = with maintainers; [ izorkin ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3d0139a65376..924f47c7fcc7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18829,7 +18829,7 @@ with pkgs; nghttp2 = callPackage ../development/libraries/nghttp2 { }; libnghttp2 = nghttp2.lib; - nix-plugins = callPackage ../development/libraries/nix-plugins { }; + nghttp3 = callPackage ../development/libraries/nghttp3 { }; nika-fonts = callPackage ../data/fonts/nika-fonts { }; From 89dd3384d1e011916130961c6499f1f90ad3d8a2 Mon Sep 17 00:00:00 2001 From: Izorkin Date: Sun, 14 Nov 2021 18:17:29 +0300 Subject: [PATCH 03/14] ngtcp2: init at unstable-2021-11-10 --- pkgs/development/libraries/ngtcp2/default.nix | 36 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 +++ 2 files changed, 40 insertions(+) create mode 100644 pkgs/development/libraries/ngtcp2/default.nix diff --git a/pkgs/development/libraries/ngtcp2/default.nix b/pkgs/development/libraries/ngtcp2/default.nix new file mode 100644 index 000000000000..0d4002ca10d7 --- /dev/null +++ b/pkgs/development/libraries/ngtcp2/default.nix @@ -0,0 +1,36 @@ +{ lib, stdenv, fetchFromGitHub +, autoreconfHook, pkg-config +, cunit, file +, jemalloc, libev, nghttp3, quictls +}: + +stdenv.mkDerivation rec { + pname = "ngtcp2"; + version = "unstable-2021-11-10"; + + src = fetchFromGitHub { + owner = "ngtcp2"; + repo = pname; + rev = "7039808c044152c14b44046468bd16249b4d7048"; + sha256 = "1cjsky24f6fazw9b1r6w9cgp09vi8wp99sv76gg2b1r8ic3hgq23"; + }; + + nativeBuildInputs = [ autoreconfHook pkg-config cunit file ]; + buildInputs = [ jemalloc libev nghttp3 quictls ]; + + preConfigure = '' + substituteInPlace ./configure --replace /usr/bin/file ${file}/bin/file + ''; + + outputs = [ "out" "dev" ]; + + doCheck = true; + + meta = with lib; { + homepage = "https://github.com/ngtcp2/ngtcp2"; + description = "ngtcp2 project is an effort to implement QUIC protocol which is now being discussed in IETF QUICWG for its standardization."; + license = licenses.mit; + platforms = platforms.linux; + maintainers = with maintainers; [ izorkin ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 924f47c7fcc7..341779c42cc1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18831,6 +18831,10 @@ with pkgs; nghttp3 = callPackage ../development/libraries/nghttp3 { }; + ngtcp2 = callPackage ../development/libraries/ngtcp2 { }; + + nix-plugins = callPackage ../development/libraries/nix-plugins { }; + nika-fonts = callPackage ../data/fonts/nika-fonts { }; nikto = callPackage ../tools/networking/nikto { }; From a75207e966c24b2c5d9a57e9fbea4dcc70f1742e Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 27 Nov 2021 17:31:48 +0100 Subject: [PATCH 04/14] python3Packages.socid-extractor: init at 0.0.22 --- .../socid-extractor/default.nix | 43 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 45 insertions(+) create mode 100644 pkgs/development/python-modules/socid-extractor/default.nix diff --git a/pkgs/development/python-modules/socid-extractor/default.nix b/pkgs/development/python-modules/socid-extractor/default.nix new file mode 100644 index 000000000000..34c0c20e075a --- /dev/null +++ b/pkgs/development/python-modules/socid-extractor/default.nix @@ -0,0 +1,43 @@ +{ lib +, beautifulsoup4 +, buildPythonPackage +, fetchFromGitHub +, python-dateutil +, pythonOlder +, requests +}: + +buildPythonPackage rec { + pname = "socid-extractor"; + version = "0.0.22"; + format = "setuptools"; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "soxoj"; + repo = pname; + rev = "v${version}"; + sha256 = "kHF9CBlUKrD/DRVwJveenpFMr7pIrxEBNkFHHLa46KQ="; + }; + + propagatedBuildInputs = [ + beautifulsoup4 + python-dateutil + requests + ]; + + # Test require network access + doCheck = false; + + pythonImportsCheck = [ + "socid_extractor" + ]; + + meta = with lib; { + description = "Python module to extract details from personal pages"; + homepage = "https://github.com/soxoj/socid-extractor"; + license = with licenses; [ gpl3Only ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6002b1220813..0e434b6a9b1c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8803,6 +8803,8 @@ in { socialscan = callPackage ../development/python-modules/socialscan { }; + socid-extractor = callPackage ../development/python-modules/socid-extractor { }; + sockjs = callPackage ../development/python-modules/sockjs { }; sockjs-tornado = callPackage ../development/python-modules/sockjs-tornado { }; From 1f2c16475455fb4a83465e152886d400cb211d30 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 27 Nov 2021 17:58:48 +0100 Subject: [PATCH 05/14] python3Packages.xmind: init at 1.2.0 --- .../python-modules/xmind/default.nix | 34 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 pkgs/development/python-modules/xmind/default.nix diff --git a/pkgs/development/python-modules/xmind/default.nix b/pkgs/development/python-modules/xmind/default.nix new file mode 100644 index 000000000000..ab12f26a72df --- /dev/null +++ b/pkgs/development/python-modules/xmind/default.nix @@ -0,0 +1,34 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonOlder +}: + +buildPythonPackage rec { + pname = "xmind"; + version = "1.2.0"; + format = "setuptools"; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "zhuifengshen"; + repo = pname; + rev = "v${version}"; + sha256 = "xC1WpHz2eHb5+xShM/QUQAIYnJNyK1EKWbTXJKhDwbQ="; + }; + + # Projec thas no tests + doCheck = false; + + pythonImportsCheck = [ + "xmind" + ]; + + meta = with lib; { + description = "Python module to create mindmaps"; + homepage = "https://github.com/zhuifengshen/xmind"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0e434b6a9b1c..7bf6e52459c7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10147,6 +10147,8 @@ in { xlwt = callPackage ../development/python-modules/xlwt { }; + xmind = callPackage ../development/python-modules/xmind { }; + xml2rfc = callPackage ../development/python-modules/xml2rfc { }; xmldiff = callPackage ../development/python-modules/xmldiff { }; From cd959d22517bebb1d767a91c758f626e16337536 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 27 Nov 2021 17:59:11 +0100 Subject: [PATCH 06/14] maigret: init at 0.3.1 --- pkgs/tools/security/maigret/default.nix | 92 +++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 94 insertions(+) create mode 100644 pkgs/tools/security/maigret/default.nix diff --git a/pkgs/tools/security/maigret/default.nix b/pkgs/tools/security/maigret/default.nix new file mode 100644 index 000000000000..08ef82ff9d6e --- /dev/null +++ b/pkgs/tools/security/maigret/default.nix @@ -0,0 +1,92 @@ +{ lib +, fetchFromGitHub +, python3 +}: + +python3.pkgs.buildPythonApplication rec { + pname = "maigret"; + version = "0.3.1"; + + src = fetchFromGitHub { + owner = "soxoj"; + repo = pname; + rev = "v${version}"; + sha256 = "cq7pATICVQa2yTx2uiP58OBTn4B6iCjIB6LMmpaQfx0="; + }; + + propagatedBuildInputs = with python3.pkgs; [ + aiodns + aiohttp + aiohttp-socks + arabic-reshaper + async-timeout + attrs + beautifulsoup4 + certifi + chardet + colorama + future + html5lib + idna + jinja2 + lxml + markupsafe + mock + multidict + networkx + pycountry + pypdf2 + pysocks + python-bidi + pyvis + requests + requests-futures + six + socid-extractor + soupsieve + stem + torrequest + tqdm + typing-extensions + webencodings + xhtml2pdf + xmind + yarl + ]; + + checkInputs = with python3.pkgs; [ + pytest-httpserver + pytest-asyncio + pytestCheckHook + ]; + + postPatch = '' + # Remove all version pinning + sed -i -e "s/==[0-9.]*//" requirements.txt + # We are not build for Python < 3.7 + sed -i -e '/future-annotations/d' requirements.txt + # We can't work with dummy packages + sed -i -e 's/bs4/beautifulsoup4/g' requirements.txt + ''; + + disabledTests = [ + # Tests require network access + "test_extract_ids_from_page" + "test_import_aiohttp_cookies" + "test_maigret_results" + "test_pdf_report" + "test_self_check_db_negative_enabled" + "test_self_check_db_positive_enable" + ]; + + pythonImportsCheck = [ + "maigret" + ]; + + meta = with lib; { + description = "Tool to collect details about an username"; + homepage = "https://maigret.readthedocs.io"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 96cea130180a..406f301b40f4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3278,6 +3278,8 @@ with pkgs; lynis = callPackage ../tools/security/lynis { }; + maigret = callPackage ../tools/security/maigret { }; + mapcidr = callPackage ../tools/misc/mapcidr { }; mapproxy = callPackage ../applications/misc/mapproxy { }; From eefac98f1a0e3363a57288703fa1961ea554d13e Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Mon, 29 Nov 2021 23:19:07 +0000 Subject: [PATCH 07/14] python3Packages.pyvex: fix build for aarch64-linux --- pkgs/development/python-modules/pyvex/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pyvex/default.nix b/pkgs/development/python-modules/pyvex/default.nix index 2d5a83da3957..d054a0c8e8f7 100644 --- a/pkgs/development/python-modules/pyvex/default.nix +++ b/pkgs/development/python-modules/pyvex/default.nix @@ -22,6 +22,8 @@ buildPythonPackage rec { substituteInPlace vex/Makefile-gcc --replace '/usr/bin/ar' 'ar' ''; + setupPyBuildFlags = lib.optionals stdenv.isLinux [ "--plat-name" "linux" ]; + propagatedBuildInputs = [ archinfo bitstring @@ -45,7 +47,5 @@ buildPythonPackage rec { homepage = "https://github.com/angr/pyvex"; license = with licenses; [ bsd2 gpl3Plus lgpl3Plus ]; maintainers = with maintainers; [ fab ]; - # ERROR: pyvex-X-py3-none-manylinux1_aarch64.whl is not a supported wheel on this platform. - broken = stdenv.isAarch64; }; } From 6f968f15727cbf39adbb0d60623f2c11f56eab6b Mon Sep 17 00:00:00 2001 From: Ben Darwin Date: Mon, 29 Nov 2021 20:00:16 -0500 Subject: [PATCH 08/14] python3Packages.ignite: remove optional pynvml dependency --- pkgs/development/python-modules/ignite/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/ignite/default.nix b/pkgs/development/python-modules/ignite/default.nix index 177fd8915607..da5dfddcfb13 100644 --- a/pkgs/development/python-modules/ignite/default.nix +++ b/pkgs/development/python-modules/ignite/default.nix @@ -8,7 +8,6 @@ , matplotlib , mock , pytorch -, pynvml , scikit-learn , tqdm }: @@ -25,7 +24,7 @@ buildPythonPackage rec { }; checkInputs = [ pytestCheckHook matplotlib mock pytest-xdist torchvision ]; - propagatedBuildInputs = [ pytorch scikit-learn tqdm pynvml ]; + propagatedBuildInputs = [ pytorch scikit-learn tqdm ]; # runs succesfully in 3.9, however, async isn't correctly closed so it will fail after test suite. doCheck = pythonOlder "3.9"; @@ -51,6 +50,7 @@ buildPythonPackage rec { "idist" "mlflow" "tensorboard" + "test_gpu_info" # needs pynvml "test_integration" "test_output_handler" # needs mlflow "test_pbar" # slight output differences From c60adb947e363a915e057244cfd1c2d61fa22d9a Mon Sep 17 00:00:00 2001 From: iury fukuda Date: Wed, 17 Nov 2021 19:42:30 -0300 Subject: [PATCH 09/14] kuma: init at 1.4.0 --- .../networking/cluster/kuma/default.nix | 65 +++++++++++++++++++ .../networking/cluster/kumactl/default.nix | 34 ---------- pkgs/top-level/all-packages.nix | 23 ++++++- 3 files changed, 87 insertions(+), 35 deletions(-) create mode 100644 pkgs/applications/networking/cluster/kuma/default.nix delete mode 100644 pkgs/applications/networking/cluster/kumactl/default.nix diff --git a/pkgs/applications/networking/cluster/kuma/default.nix b/pkgs/applications/networking/cluster/kuma/default.nix new file mode 100644 index 000000000000..d7a58f09b4e7 --- /dev/null +++ b/pkgs/applications/networking/cluster/kuma/default.nix @@ -0,0 +1,65 @@ +{ lib +, fetchFromGitHub +, buildGoModule +, coredns +, installShellFiles +, isFull ? false +, enableGateway ? false +, pname ? "kuma" +, components ? lib.optionals isFull [ + "kumactl" + "kuma-cp" + "kuma-prometheus-sd" + "kuma-dp" + ] +}: + +buildGoModule rec { + inherit pname ; + version = "1.4.0"; + tags = lib.optionals enableGateway ["gateway"]; + vendorSha256 = "1fc5psvbd9bpc6c3y2cpx5dx8cgr2fcp7nln3kwfgbryahq2y8wl"; + + src = fetchFromGitHub { + owner = "kumahq"; + repo = "kuma"; + rev = version; + sha256 = "0agib3w5s270n5rhg54m3p4f21s5fhdrhaks374j7l21njs7xhqb"; + }; + + doCheck = false; + + nativeBuildInputs = [installShellFiles] ++ lib.optionals isFull [coredns]; + + preBuild = '' + export HOME=$TMPDIR + ''; + + subPackages = map (p: "app/" + p) components; + + postInstall = lib.concatMapStringsSep "\n" (p: '' + installShellCompletion --cmd ${p} \ + --bash <($out/bin/${p} completion bash) \ + --fish <($out/bin/${p} completion fish) \ + --zsh <($out/bin/${p} completion zsh) + '') components + lib.optionalString isFull '' + ln -sLf ${coredns}/bin/coredns $out/bin + ''; + + ldflags = let + prefix = "github.com/kumahq/kuma/pkg/version"; + in [ + "-s" "-w" + "-X ${prefix}.version=${version}" + "-X ${prefix}.gitTag=${version}" + "-X ${prefix}.gitCommit=${version}" + "-X ${prefix}.buildDate=${version}" + ]; + + meta = with lib; { + description = "Service mesh controller"; + homepage = "https://kuma.io/"; + license = licenses.asl20; + maintainers = with maintainers; [ zbioe ]; + }; +} diff --git a/pkgs/applications/networking/cluster/kumactl/default.nix b/pkgs/applications/networking/cluster/kumactl/default.nix deleted file mode 100644 index d13db27444fb..000000000000 --- a/pkgs/applications/networking/cluster/kumactl/default.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ lib, fetchFromGitHub, buildGoModule }: - -buildGoModule rec { - pname = "kumactl"; - version = "1.3.1"; - - src = fetchFromGitHub { - owner = "kumahq"; - repo = "kuma"; - rev = version; - sha256 = "0b554cngg2j3wnadpqwhq3dv3la8vvvzyww2diw4il4gl4j6xj0j"; - }; - - vendorSha256 = "0r26h4vp11wbl7nk3y7c22p60q7lspy8nr58khxyczdqjk6wrdjp"; - - subPackages = [ "app/kumactl" ]; - - ldflags = let - prefix = "github.com/kumahq/kuma/pkg/version"; - in [ - "-s" "-w" - "-X ${prefix}.version=${version}" - "-X ${prefix}.gitTag=${version}" - "-X ${prefix}.gitCommit=${version}" - "-X ${prefix}.buildDate=${version}" - ]; - - meta = with lib; { - description = "Kuma service mesh controller"; - homepage = "https://kuma.io/"; - license = licenses.asl20; - maintainers = with maintainers; [ zbioe ]; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4c6b850e8f57..0b40bb0bb1cc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -26275,7 +26275,28 @@ with pkgs; linkerd_edge = callPackage ../applications/networking/cluster/linkerd/edge.nix { }; linkerd_stable = linkerd; - kumactl = callPackage ../applications/networking/cluster/kumactl { }; + kuma = callPackage ../applications/networking/cluster/kuma { isFull = true; }; + kuma-experimental = callPackage ../applications/networking/cluster/kuma { + isFull = true; + enableGateway = true; + pname = "kuma-experimental"; + }; + kumactl = callPackage ../applications/networking/cluster/kuma { + components = ["kumactl"]; + pname = "kumactl"; + }; + kuma-cp = callPackage ../applications/networking/cluster/kuma { + components = ["kuma-cp"]; + pname = "kuma-cp"; + }; + kuma-dp = callPackage ../applications/networking/cluster/kuma { + components = ["kuma-dp"]; + pname = "kuma-dp"; + }; + kuma-prometheus-sd = callPackage ../applications/networking/cluster/kuma { + components = ["kuma-prometheus-sd"]; + pname = "kuma-prometheus-sd"; + }; kile-wl = callPackage ../applications/misc/kile-wl { }; From 94d1b0d54154614c17be5e4c9465f05b45cf851d Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Tue, 30 Nov 2021 09:13:44 +0800 Subject: [PATCH 10/14] pantheon.elementary-files: 6.0.4 -> 6.1.0 --- .../apps/elementary-files/default.nix | 6 ++-- ...-portal-hardcode-gsettings-for-nixos.patch | 28 +++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/pkgs/desktops/pantheon/apps/elementary-files/default.nix b/pkgs/desktops/pantheon/apps/elementary-files/default.nix index dcd4591f1363..91dc48cf1c2f 100644 --- a/pkgs/desktops/pantheon/apps/elementary-files/default.nix +++ b/pkgs/desktops/pantheon/apps/elementary-files/default.nix @@ -32,7 +32,7 @@ stdenv.mkDerivation rec { pname = "elementary-files"; - version = "6.0.4"; + version = "6.1.0"; repoName = "files"; @@ -42,7 +42,7 @@ stdenv.mkDerivation rec { owner = "elementary"; repo = repoName; rev = version; - sha256 = "sha256-FH6EYtgKADp8jjBoCwsdRdknlKS9v3iOtPiT3CyEc/8="; + sha256 = "sha256-aGiFEeSvDV5rPD2Ll/BuDoWclEPhR1UuoCxUSS9CGmw="; }; passthru = { @@ -90,7 +90,7 @@ stdenv.mkDerivation rec { chmod +x meson/post_install.py patchShebangs meson/post_install.py - substituteInPlace filechooser-portal/LegacyFileChooserDialog.vala \ + substituteInPlace filechooser-portal/FileChooserDialog.vala \ --subst-var-by ELEMENTARY_FILES_GSETTINGS_PATH ${glib.makeSchemaPath "$out" "${pname}-${version}"} ''; diff --git a/pkgs/desktops/pantheon/apps/elementary-files/filechooser-portal-hardcode-gsettings-for-nixos.patch b/pkgs/desktops/pantheon/apps/elementary-files/filechooser-portal-hardcode-gsettings-for-nixos.patch index b04208cc8b86..9ad9ee542728 100644 --- a/pkgs/desktops/pantheon/apps/elementary-files/filechooser-portal-hardcode-gsettings-for-nixos.patch +++ b/pkgs/desktops/pantheon/apps/elementary-files/filechooser-portal-hardcode-gsettings-for-nixos.patch @@ -1,24 +1,24 @@ -From 726ab4c0ab01273cb2197e4c151a5b69ff0954b6 Mon Sep 17 00:00:00 2001 +From 256d80aa2ab2b84316260d0be5263b02fd5e796f Mon Sep 17 00:00:00 2001 From: Bobby Rong -Date: Fri, 16 Jul 2021 18:24:58 +0800 +Date: Tue, 30 Nov 2021 10:24:39 +0800 Subject: [PATCH] filechooser-portal: hardcode gsettings for nixos --- - filechooser-portal/LegacyFileChooserDialog.vala | 4 +++- + filechooser-portal/FileChooserDialog.vala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -diff --git a/filechooser-portal/LegacyFileChooserDialog.vala b/filechooser-portal/LegacyFileChooserDialog.vala -index 330718f..f383bb1 100644 ---- a/filechooser-portal/LegacyFileChooserDialog.vala -+++ b/filechooser-portal/LegacyFileChooserDialog.vala -@@ -60,7 +60,9 @@ public class Files.LegacyFileChooserDialog : Object { - /* If not local only during creation, strange bug occurs on fresh installs */ - chooser_dialog.local_only = true; +diff --git a/filechooser-portal/FileChooserDialog.vala b/filechooser-portal/FileChooserDialog.vala +index 4a84016db..4bf2b32a1 100755 +--- a/filechooser-portal/FileChooserDialog.vala ++++ b/filechooser-portal/FileChooserDialog.vala +@@ -160,7 +160,9 @@ public class Files.FileChooserDialog : Hdy.Window, Xdp.Request { + accept_button.grab_default (); + setup_chooser (); -- var chooser_settings = new Settings ("io.elementary.files.file-chooser"); +- var settings = new Settings ("io.elementary.files.file-chooser"); + SettingsSchemaSource sss = new SettingsSchemaSource.from_directory ("@ELEMENTARY_FILES_GSETTINGS_PATH@", SettingsSchemaSource.get_default (), true); + SettingsSchema chooser_schema = sss.lookup ("io.elementary.files.file-chooser", false); -+ var chooser_settings = new Settings.full (chooser_schema, null, null); - - action_area = (Gtk.ButtonBox) chooser_dialog.get_action_area (); ++ var settings = new Settings.full (chooser_schema, null, null); + int width, height; + settings.get ("window-size", "(ii)", out width, out height); From bc3eea0c68d0be91f7491d22df63f2665ec3e1dc Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Mon, 29 Nov 2021 03:26:46 -0600 Subject: [PATCH 11/14] chezmoi: 2.7.4 -> 2.9.0 --- pkgs/tools/misc/chezmoi/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/misc/chezmoi/default.nix b/pkgs/tools/misc/chezmoi/default.nix index d9ac3a894c67..debbe6c0a53b 100644 --- a/pkgs/tools/misc/chezmoi/default.nix +++ b/pkgs/tools/misc/chezmoi/default.nix @@ -2,16 +2,16 @@ buildGoModule rec { pname = "chezmoi"; - version = "2.7.4"; + version = "2.9.0"; src = fetchFromGitHub { owner = "twpayne"; repo = "chezmoi"; rev = "v${version}"; - sha256 = "sha256-RX9Hgjl/i/FWXHFp+yYWQEYDiOQijU+eiBnREu4K1Mg="; + sha256 = "sha256-jeg9XI2enNyZvv2D4URWluCaT+oD8QbHItx2etrGBpQ="; }; - vendorSha256 = "sha256-tz3Vcw/p7BKcgc3EsLsSPOKhwqN5kysOcmER7OoKQ+w="; + vendorSha256 = "sha256-jaEaVfPlYbmQ998KwZm8PUfbNlPEIr1lX5fx90jcqV4="; doCheck = false; From 0a989ec7caa63aabd47b4aff5aecd5a754cd6cea Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Tue, 30 Nov 2021 15:38:11 +0800 Subject: [PATCH 12/14] pantheon.elementary-files: drop filechooser-portal-hardcode-gsettings-for-nixos.patch --- .../apps/elementary-files/default.nix | 8 +------ ...-portal-hardcode-gsettings-for-nixos.patch | 24 ------------------- 2 files changed, 1 insertion(+), 31 deletions(-) delete mode 100644 pkgs/desktops/pantheon/apps/elementary-files/filechooser-portal-hardcode-gsettings-for-nixos.patch diff --git a/pkgs/desktops/pantheon/apps/elementary-files/default.nix b/pkgs/desktops/pantheon/apps/elementary-files/default.nix index 91dc48cf1c2f..747f9662680d 100644 --- a/pkgs/desktops/pantheon/apps/elementary-files/default.nix +++ b/pkgs/desktops/pantheon/apps/elementary-files/default.nix @@ -67,6 +67,7 @@ stdenv.mkDerivation rec { bamf elementary-dock elementary-icon-theme + glib granite gtk3 libcanberra @@ -82,16 +83,9 @@ stdenv.mkDerivation rec { zeitgeist ]; - patches = [ - ./filechooser-portal-hardcode-gsettings-for-nixos.patch - ]; - postPatch = '' chmod +x meson/post_install.py patchShebangs meson/post_install.py - - substituteInPlace filechooser-portal/FileChooserDialog.vala \ - --subst-var-by ELEMENTARY_FILES_GSETTINGS_PATH ${glib.makeSchemaPath "$out" "${pname}-${version}"} ''; meta = with lib; { diff --git a/pkgs/desktops/pantheon/apps/elementary-files/filechooser-portal-hardcode-gsettings-for-nixos.patch b/pkgs/desktops/pantheon/apps/elementary-files/filechooser-portal-hardcode-gsettings-for-nixos.patch deleted file mode 100644 index 9ad9ee542728..000000000000 --- a/pkgs/desktops/pantheon/apps/elementary-files/filechooser-portal-hardcode-gsettings-for-nixos.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 256d80aa2ab2b84316260d0be5263b02fd5e796f Mon Sep 17 00:00:00 2001 -From: Bobby Rong -Date: Tue, 30 Nov 2021 10:24:39 +0800 -Subject: [PATCH] filechooser-portal: hardcode gsettings for nixos - ---- - filechooser-portal/FileChooserDialog.vala | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/filechooser-portal/FileChooserDialog.vala b/filechooser-portal/FileChooserDialog.vala -index 4a84016db..4bf2b32a1 100755 ---- a/filechooser-portal/FileChooserDialog.vala -+++ b/filechooser-portal/FileChooserDialog.vala -@@ -160,7 +160,9 @@ public class Files.FileChooserDialog : Hdy.Window, Xdp.Request { - accept_button.grab_default (); - setup_chooser (); - -- var settings = new Settings ("io.elementary.files.file-chooser"); -+ SettingsSchemaSource sss = new SettingsSchemaSource.from_directory ("@ELEMENTARY_FILES_GSETTINGS_PATH@", SettingsSchemaSource.get_default (), true); -+ SettingsSchema chooser_schema = sss.lookup ("io.elementary.files.file-chooser", false); -+ var settings = new Settings.full (chooser_schema, null, null); - int width, height; - - settings.get ("window-size", "(ii)", out width, out height); From 9d3d02f9c1272f1845bcd3295a22f4a3acb6326a Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Tue, 30 Nov 2021 09:04:12 +0000 Subject: [PATCH 13/14] screen: disable parallel build (#147990) Parallel build fails for missing generated header dependencies: screen.h:48:10: fatal error: comm.h: No such file or directory 48 | #include "comm.h" | ^~~~~~~~ Upstream fixes are intermingled with added features and are not straightforward to backport. Let's disable parallelism until next release. --- pkgs/tools/misc/screen/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/tools/misc/screen/default.nix b/pkgs/tools/misc/screen/default.nix index d1e02e8b9a36..dd61b82d4080 100644 --- a/pkgs/tools/misc/screen/default.nix +++ b/pkgs/tools/misc/screen/default.nix @@ -39,6 +39,12 @@ stdenv.mkDerivation rec { buildInputs = [ ncurses ] ++ lib.optional stdenv.isLinux pam ++ lib.optional stdenv.isDarwin utmp; + # Build fails due to missing dependencies on autogenerated header: + # screen.h:48:10: fatal error: comm.h: No such file or directory + # It will be fixed in next screen-4.9.0 release. The patches are + # invasive. Disabling parallelism for 4.8.0. + enableParallelBuilding = false; + doCheck = true; meta = with lib; { From 716815ce2a1fcb135843c7441648a59d62fb6eb6 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Tue, 30 Nov 2021 09:33:42 +0000 Subject: [PATCH 14/14] re2: enable parallel builds (#147991) --- pkgs/development/libraries/re2/default.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/re2/default.nix b/pkgs/development/libraries/re2/default.nix index d2942e6be2a0..a70ad0f69e03 100644 --- a/pkgs/development/libraries/re2/default.nix +++ b/pkgs/development/libraries/re2/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub }: +{ lib, stdenv, fetchFromGitHub, fetchpatch }: stdenv.mkDerivation rec { pname = "re2"; @@ -11,6 +11,15 @@ stdenv.mkDerivation rec { sha256 = "1fyhypw345xz8zdh53gz6j1fwgrx0gszk1d349ja37dpxh4jp2jh"; }; + patches = [ + # Pull upstreal fix for parallel testing. + (fetchpatch { + name = "parallel-tests.patch"; + url = "https://github.com/google/re2/commit/9262284a7edc1b83e7172f4ec2d7967d695e7420.patch"; + sha256 = "1knhfx9cs4841r09jw4ha6mdx9qwpvlcxvd04i8vr84kd0lilqms"; + }) + ]; + preConfigure = '' substituteInPlace Makefile --replace "/usr/local" "$out" # we're using gnu sed, even on darwin @@ -19,6 +28,8 @@ stdenv.mkDerivation rec { buildFlags = lib.optionals stdenv.hostPlatform.isStatic [ "static" ]; + enableParallelBuilding = true; + preCheck = "patchShebangs runtests"; doCheck = true; checkTarget = "test";