From 4bd1d7cf092274312748ba26afe2e12265e9151a Mon Sep 17 00:00:00 2001 From: Louis Bettens Date: Wed, 24 Feb 2021 22:07:22 +0100 Subject: [PATCH 01/14] teck-programmer: init at 1.1.1 --- pkgs/development/node-packages/default.nix | 4 + .../node-packages/node-packages.json | 1 + .../node-packages/node-packages.nix | 117 ++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 4 files changed, 124 insertions(+) diff --git a/pkgs/development/node-packages/default.nix b/pkgs/development/node-packages/default.nix index b0bd2afd148b1..8d00e3595fecc 100644 --- a/pkgs/development/node-packages/default.nix +++ b/pkgs/development/node-packages/default.nix @@ -241,6 +241,10 @@ let ''; }; + teck-programmer = super.teck-programmer.override { + buildInputs = [ pkgs.libusb ]; + }; + vega-cli = super.vega-cli.override { nativeBuildInputs = [ pkgs.pkg-config ]; buildInputs = with pkgs; [ diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index 306c54e8e3ebc..2b8492d4b6259 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -220,6 +220,7 @@ , "svgo" , "swagger" , {"tedicross": "git+https://github.com/TediCross/TediCross.git#v0.8.7"} +, "teck-programmer" , "tern" , "textlint" , "textlint-plugin-latex" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index c9431e3ca31ab..7af60f9f781b5 100644 --- a/pkgs/development/node-packages/node-packages.nix +++ b/pkgs/development/node-packages/node-packages.nix @@ -40385,6 +40385,15 @@ let sha512 = "Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA=="; }; }; + "node-addon-api-3.0.2" = { + name = "node-addon-api"; + packageName = "node-addon-api"; + version = "3.0.2"; + src = fetchurl { + url = "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.0.2.tgz"; + sha512 = "+D4s2HCnxPd5PjjI0STKwncjXTUKKqm74MDMz9OPXavjsGmjkvwgLtA5yoxJUdmpj52+2u+RrXgPipahKczMKg=="; + }; + }; "node-addon-api-3.1.0" = { name = "node-addon-api"; packageName = "node-addon-api"; @@ -45797,6 +45806,15 @@ let sha512 = "aaLVANlj4HgZweKttFNUVNRxDukytuIuxeK2boIMHjagNJCiVKWFsKF4tCE3ql3GbrD2tExPQ7/pwtEJcHNZeg=="; }; }; + "prebuild-install-5.3.6" = { + name = "prebuild-install"; + packageName = "prebuild-install"; + version = "5.3.6"; + src = fetchurl { + url = "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.6.tgz"; + sha512 = "s8Aai8++QQGi4sSbs/M1Qku62PFK49Jm1CbgXklGz4nmHveDq0wzJkg7Na5QbnO1uNH8K7iqx2EQ/mV0MZEmOg=="; + }; + }; "prebuild-install-6.1.1" = { name = "prebuild-install"; packageName = "prebuild-install"; @@ -59820,6 +59838,15 @@ let sha1 = "23f89069a6c62f46cf3a1d3b00169cefb90be0c6"; }; }; + "usb-1.7.0" = { + name = "usb"; + packageName = "usb"; + version = "1.7.0"; + src = fetchurl { + url = "https://registry.npmjs.org/usb/-/usb-1.7.0.tgz"; + sha512 = "LHm9d389NCzZSMd0DnilxT5Lord4P2E3ETwP1LeuJcEBmI5uLJv8Sd18z/9bairUMbDnnNqX+Hi5Xkl93Kvdmw=="; + }; + }; "use-3.1.1" = { name = "use"; packageName = "use"; @@ -109967,6 +109994,96 @@ in bypassCache = true; reconstructLock = true; }; + teck-programmer = nodeEnv.buildNodePackage { + name = "teck-programmer"; + packageName = "teck-programmer"; + version = "1.1.1"; + src = fetchurl { + url = "https://registry.npmjs.org/teck-programmer/-/teck-programmer-1.1.1.tgz"; + sha1 = "bd2b3b1e3b88ad3c7471bdc8a5244255564b69e1"; + }; + dependencies = [ + sources."ansi-regex-2.1.1" + sources."aproba-1.2.0" + sources."are-we-there-yet-1.1.5" + sources."base64-js-1.5.1" + sources."bindings-1.5.0" + (sources."bl-4.1.0" // { + dependencies = [ + sources."readable-stream-3.6.0" + ]; + }) + sources."buffer-5.7.1" + sources."chownr-1.1.4" + sources."code-point-at-1.1.0" + sources."console-control-strings-1.1.0" + sources."core-util-is-1.0.2" + sources."decompress-response-4.2.1" + sources."deep-extend-0.6.0" + sources."delegates-1.0.0" + sources."detect-libc-1.0.3" + sources."end-of-stream-1.4.4" + sources."expand-template-2.0.3" + sources."file-uri-to-path-1.0.0" + sources."fs-constants-1.0.0" + sources."gauge-2.7.4" + sources."github-from-package-0.0.0" + sources."has-unicode-2.0.1" + sources."ieee754-1.2.1" + sources."inherits-2.0.4" + sources."ini-1.3.8" + sources."is-fullwidth-code-point-1.0.0" + sources."isarray-1.0.0" + sources."mimic-response-2.1.0" + sources."minimist-1.2.5" + sources."mkdirp-classic-0.5.3" + sources."napi-build-utils-1.0.2" + sources."node-abi-2.21.0" + sources."node-addon-api-3.0.2" + sources."noop-logger-0.1.1" + sources."npmlog-4.1.2" + sources."number-is-nan-1.0.1" + sources."object-assign-4.1.1" + sources."once-1.4.0" + sources."prebuild-install-5.3.6" + sources."process-nextick-args-2.0.1" + sources."pump-3.0.0" + sources."q-1.5.1" + sources."rc-1.2.8" + sources."readable-stream-2.3.7" + sources."safe-buffer-5.1.2" + sources."semver-5.7.1" + sources."set-blocking-2.0.0" + sources."signal-exit-3.0.3" + sources."simple-concat-1.0.1" + sources."simple-get-3.1.0" + sources."string-width-1.0.2" + sources."string_decoder-1.1.1" + sources."strip-ansi-3.0.1" + sources."strip-json-comments-2.0.1" + sources."tar-fs-2.1.1" + (sources."tar-stream-2.2.0" // { + dependencies = [ + sources."readable-stream-3.6.0" + ]; + }) + sources."tunnel-agent-0.6.0" + sources."usb-1.7.0" + sources."util-deprecate-1.0.2" + sources."which-pm-runs-1.0.0" + sources."wide-align-1.1.3" + sources."wrappy-1.0.2" + ]; + buildInputs = globalBuildInputs; + meta = { + description = "Programmer for TECK keyboards."; + homepage = "https://github.com/m-ou-se/teck-programmer"; + license = "GPL-3.0+"; + }; + production = true; + bypassCache = true; + reconstructLock = true; + }; tern = nodeEnv.buildNodePackage { name = "tern"; packageName = "tern"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4ecdfee0fb21e..4faf893a7db4a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8663,6 +8663,8 @@ in tea = callPackage ../tools/misc/tea { }; + inherit (nodePackages) teck-programmer; + ted = callPackage ../tools/typesetting/ted { }; teamviewer = libsForQt514.callPackage ../applications/networking/remote/teamviewer { }; From 7aecbba1789d1569c80fad4756112a2ed330237e Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Mon, 19 Apr 2021 18:16:41 +0200 Subject: [PATCH 02/14] qrcp: 0.7.0 -> 0.8.1 --- pkgs/tools/networking/qrcp/default.nix | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/networking/qrcp/default.nix b/pkgs/tools/networking/qrcp/default.nix index bf3b3936edd3c..fd6b79ecb216a 100644 --- a/pkgs/tools/networking/qrcp/default.nix +++ b/pkgs/tools/networking/qrcp/default.nix @@ -1,23 +1,34 @@ { lib , buildGoModule , fetchFromGitHub +, installShellFiles }: buildGoModule rec { pname = "qrcp"; - version = "0.7.0"; + version = "0.8.1"; src = fetchFromGitHub { owner = "claudiodangelis"; repo = "qrcp"; rev = version; - sha256 = "0rx0pzy7p3dklayr2lkmyfdc00x9v4pd5xnzydbjx12hncnkpw4l"; + sha256 = "001w15hj5xb7p9gpvw1216lp26g5018qdi8mq6i84akb7zfd2q01"; }; - vendorSha256 = "0iffy43x3njcahrxl99a71v8p7im102nzv8iqbvd5c6m14rsckqa"; + vendorSha256 = "1hn8c72fvih6ws1y2c4963pww3ld64m0yh3pmx62hwcy83bhb0v4"; subPackages = [ "." ]; + nativeBuildInputs = [ + installShellFiles + ]; + + postInstall = '' + installShellCompletion --bash --cmd qrcp <($out/bin/qrcp completion bash) + installShellCompletion --fish --cmd qrcp <($out/bin/qrcp completion fish) + installShellCompletion --zsh --cmd qrcp <($out/bin/qrcp completion zsh) + ''; + meta = with lib; { homepage = "https://claudiodangelis.com/qrcp/"; description = "Transfer files over wifi by scanning a QR code from your terminal"; From dd2c1dd5c864331394946d288b505ebf199ce149 Mon Sep 17 00:00:00 2001 From: pmenke Date: Mon, 19 Apr 2021 23:36:55 +0200 Subject: [PATCH 03/14] jetbrains.clion: add patchelf invocations for new binaries version 2021.1 of clion (introduced with 3839373) has introduced additional clang related binaries which need patching. clangd and clazy-standalone also need the provided libclazyPlugin.so on the rpath. --- pkgs/applications/editors/jetbrains/default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/editors/jetbrains/default.nix b/pkgs/applications/editors/jetbrains/default.nix index fff9c8a2de6ce..771c1f7317546 100644 --- a/pkgs/applications/editors/jetbrains/default.nix +++ b/pkgs/applications/editors/jetbrains/default.nix @@ -65,12 +65,19 @@ let --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib ]}:$gdbLibPath" \ bin/gdb/linux/bin/gdbserver + clangPath=$out/clion-${version}/bin/clang/linux/ patchelf --set-interpreter $interp \ - --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib zlib ]}" \ + --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib zlib ]}:$clangPath" \ bin/clang/linux/clangd patchelf --set-interpreter $interp \ --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib zlib ]}" \ bin/clang/linux/clang-tidy + patchelf --set-interpreter $interp \ + --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib zlib ]}" \ + bin/clang/linux/llvm-symbolizer + patchelf --set-interpreter $interp \ + --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib zlib ]}:$clangPath" \ + bin/clang/linux/clazy-standalone wrapProgram $out/bin/clion \ --set CL_JDK "${jdk}" From 3c0e1f309f6929fbce0a1edb9b622a941232ec99 Mon Sep 17 00:00:00 2001 From: Louis Bettens Date: Mon, 19 Apr 2021 13:25:19 +0200 Subject: [PATCH 04/14] teck-udev-rules: init --- .../linux/teck-udev-rules/default.nix | 22 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 24 insertions(+) create mode 100644 pkgs/os-specific/linux/teck-udev-rules/default.nix diff --git a/pkgs/os-specific/linux/teck-udev-rules/default.nix b/pkgs/os-specific/linux/teck-udev-rules/default.nix new file mode 100644 index 0000000000000..eec5eac344ef2 --- /dev/null +++ b/pkgs/os-specific/linux/teck-udev-rules/default.nix @@ -0,0 +1,22 @@ +{ lib, stdenv, teck-programmer }: + +stdenv.mkDerivation { + pname = "teck-udev-rules"; + version = lib.getVersion teck-programmer; + + inherit (teck-programmer) src; + + dontBuild = true; + + installPhase = '' + runHook preInstall + install 40-teck.rules -D -t $out/etc/udev/rules.d/ + runHook postInstall + ''; + + meta = { + description = "udev rules for TECK keyboards"; + inherit (teck-programmer.meta) license; + maintainers = [ lib.maintainers.lourkeur ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4faf893a7db4a..063a3b62ecfbe 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20769,6 +20769,8 @@ in # FIXME: `tcp-wrapper' is actually not OS-specific. tcp_wrappers = callPackage ../os-specific/linux/tcp-wrappers { }; + teck-udev-rules = callPackage ../os-specific/linux/teck-udev-rules { }; + tiptop = callPackage ../os-specific/linux/tiptop { }; tpacpi-bat = callPackage ../os-specific/linux/tpacpi-bat { }; From 10d375bde1b80f6097e68c25cba98d1f930d7c66 Mon Sep 17 00:00:00 2001 From: Louis Bettens Date: Mon, 19 Apr 2021 13:57:32 +0200 Subject: [PATCH 05/14] nixos/teck: init --- nixos/modules/hardware/keyboard/teck.nix | 16 ++++++++++++++++ nixos/modules/module-list.nix | 1 + 2 files changed, 17 insertions(+) create mode 100644 nixos/modules/hardware/keyboard/teck.nix diff --git a/nixos/modules/hardware/keyboard/teck.nix b/nixos/modules/hardware/keyboard/teck.nix new file mode 100644 index 0000000000000..091ddb81962e6 --- /dev/null +++ b/nixos/modules/hardware/keyboard/teck.nix @@ -0,0 +1,16 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.hardware.keyboard.teck; +in +{ + options.hardware.keyboard.teck = { + enable = mkEnableOption "non-root access to the firmware of TECK keyboards"; + }; + + config = mkIf cfg.enable { + services.udev.packages = [ pkgs.teck-udev-rules ]; + }; +} + diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index f72be732216ea..98ad8eb58401b 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -49,6 +49,7 @@ ./hardware/i2c.nix ./hardware/sensor/hddtemp.nix ./hardware/sensor/iio.nix + ./hardware/keyboard/teck.nix ./hardware/keyboard/zsa.nix ./hardware/ksm.nix ./hardware/ledger.nix From 110a062a7bf9b89a0a0d0675600e42d963713190 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 20 Apr 2021 12:05:13 +0200 Subject: [PATCH 06/14] jetbrains.clion: switch to autoPatchelfHook --- .../editors/jetbrains/default.nix | 59 ++++--------------- 1 file changed, 13 insertions(+), 46 deletions(-) diff --git a/pkgs/applications/editors/jetbrains/default.nix b/pkgs/applications/editors/jetbrains/default.nix index 771c1f7317546..a37028f3d45f6 100644 --- a/pkgs/applications/editors/jetbrains/default.nix +++ b/pkgs/applications/editors/jetbrains/default.nix @@ -1,6 +1,9 @@ { lib, stdenv, callPackage, fetchurl , jdk, cmake, libxml2, zlib, python3, ncurses5 , dotnet-sdk_3 +, autoPatchelfHook +, glib +, libdbusmenu-glib , vmopts ? null }: @@ -25,6 +28,15 @@ let platforms = platforms.linux; }; }).overrideAttrs (attrs: { + nativeBuildInputs = (attrs.nativeBuildInputs or []) ++ optional (stdenv.isLinux) [ + autoPatchelfHook + ]; + buildInputs = (attrs.buildInputs or []) ++ optional (stdenv.isLinux) [ + python3 + stdenv.cc.cc + libdbusmenu-glib + ]; + dontAutoPatchelf = true; postFixup = (attrs.postFixup or "") + optionalString (stdenv.isLinux) '' ( cd $out/clion-${version} @@ -32,52 +44,7 @@ let rm -rf bin/cmake/linux ln -s ${cmake} bin/cmake/linux - lldbLibPath=$out/clion-${version}/bin/lldb/linux/lib - interp="$(cat $NIX_CC/nix-support/dynamic-linker)" - ln -s ${ncurses5.out}/lib/libtinfo.so.5 $lldbLibPath/libtinfo.so.5 - - patchelf --set-interpreter $interp \ - --set-rpath "${lib.makeLibraryPath [ libxml2 zlib stdenv.cc.cc.lib ]}:$lldbLibPath" \ - bin/lldb/linux/bin/lldb-server - - for i in LLDBFrontend lldb lldb-argdumper; do - patchelf --set-interpreter $interp \ - --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib ]}:$lldbLibPath" \ - "bin/lldb/linux/bin/$i" - done - - patchelf \ - --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib ]}:$lldbLibPath" \ - bin/lldb/linux/lib/python3.*/lib-dynload/zlib.cpython-*-x86_64-linux-gnu.so - - patchelf \ - --set-rpath "${lib.makeLibraryPath [ libxml2 zlib stdenv.cc.cc.lib python3 ]}:$lldbLibPath" \ - bin/lldb/linux/lib/liblldb.so - - gdbLibPath=$out/clion-${version}/bin/gdb/linux/lib - patchelf \ - --set-rpath "$gdbLibPath" \ - bin/gdb/linux/lib/python3.*/lib-dynload/zlib.cpython-*-x86_64-linux-gnu.so - patchelf --set-interpreter $interp \ - --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib zlib ]}:$gdbLibPath" \ - bin/gdb/linux/bin/gdb - patchelf --set-interpreter $interp \ - --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib ]}:$gdbLibPath" \ - bin/gdb/linux/bin/gdbserver - - clangPath=$out/clion-${version}/bin/clang/linux/ - patchelf --set-interpreter $interp \ - --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib zlib ]}:$clangPath" \ - bin/clang/linux/clangd - patchelf --set-interpreter $interp \ - --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib zlib ]}" \ - bin/clang/linux/clang-tidy - patchelf --set-interpreter $interp \ - --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib zlib ]}" \ - bin/clang/linux/llvm-symbolizer - patchelf --set-interpreter $interp \ - --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib zlib ]}:$clangPath" \ - bin/clang/linux/clazy-standalone + autoPatchelf $PWD/bin wrapProgram $out/bin/clion \ --set CL_JDK "${jdk}" From a7a29f5ba01da512b1326efa86031c6370e3f073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 20 Apr 2021 15:18:44 +0200 Subject: [PATCH 07/14] jetbrains.clion: use libdbusmenu instead of alias --- pkgs/applications/editors/jetbrains/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/editors/jetbrains/default.nix b/pkgs/applications/editors/jetbrains/default.nix index a37028f3d45f6..63482762e7e8e 100644 --- a/pkgs/applications/editors/jetbrains/default.nix +++ b/pkgs/applications/editors/jetbrains/default.nix @@ -3,7 +3,7 @@ , dotnet-sdk_3 , autoPatchelfHook , glib -, libdbusmenu-glib +, libdbusmenu , vmopts ? null }: @@ -34,7 +34,7 @@ let buildInputs = (attrs.buildInputs or []) ++ optional (stdenv.isLinux) [ python3 stdenv.cc.cc - libdbusmenu-glib + libdbusmenu ]; dontAutoPatchelf = true; postFixup = (attrs.postFixup or "") + optionalString (stdenv.isLinux) '' From 460c08357f32b53504e6e8e515bbf4cc9e28e54a Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Tue, 20 Apr 2021 19:39:58 +0200 Subject: [PATCH 08/14] python3Packages.mysql-connector: 8.0.23 -> 8.0.24 and remove myself as maintainer (#119937) --- .../python-modules/mysql-connector/default.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/mysql-connector/default.nix b/pkgs/development/python-modules/mysql-connector/default.nix index 692c021a64ffe..0856b30758dc3 100644 --- a/pkgs/development/python-modules/mysql-connector/default.nix +++ b/pkgs/development/python-modules/mysql-connector/default.nix @@ -4,13 +4,13 @@ let py = python; in buildPythonPackage rec { pname = "mysql-connector"; - version = "8.0.23"; + version = "8.0.24"; src = fetchFromGitHub { owner = "mysql"; repo = "mysql-connector-python"; rev = version; - sha256 = "sha256-YVtcHbDsW1mTjbCY1YhqgtqWv4keKlLExn2AhlOzNEw="; + sha256 = "1zb5wf65rnpbk0lw31i4piy0bq09hqa62gx7bh241zc5310zccc7"; }; propagatedBuildInputs = with py.pkgs; [ protobuf dnspython ]; @@ -20,6 +20,8 @@ in buildPythonPackage rec { # But the library should be working as expected. doCheck = false; + pythonImportsCheck = [ "mysql" ]; + meta = { description = "A MySQL driver"; longDescription = '' @@ -28,7 +30,7 @@ in buildPythonPackage rec { ''; homepage = "https://github.com/mysql/mysql-connector-python"; changelog = "https://raw.githubusercontent.com/mysql/mysql-connector-python/${version}/CHANGES.txt"; - license = [ lib.licenses.gpl2 ]; - maintainers = with lib.maintainers; [ primeos ]; + license = [ lib.licenses.gpl2Only ]; + maintainers = with lib.maintainers; [ ]; }; } From d94d7c77147269308ef5fec24d6ae78a26f02ea2 Mon Sep 17 00:00:00 2001 From: pmenke Date: Tue, 20 Apr 2021 20:07:33 +0200 Subject: [PATCH 09/14] jetbrains.clion: use lib.optionals instead of lib.optional --- pkgs/applications/editors/jetbrains/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/editors/jetbrains/default.nix b/pkgs/applications/editors/jetbrains/default.nix index 63482762e7e8e..1da4a24b3eae6 100644 --- a/pkgs/applications/editors/jetbrains/default.nix +++ b/pkgs/applications/editors/jetbrains/default.nix @@ -28,10 +28,10 @@ let platforms = platforms.linux; }; }).overrideAttrs (attrs: { - nativeBuildInputs = (attrs.nativeBuildInputs or []) ++ optional (stdenv.isLinux) [ + nativeBuildInputs = (attrs.nativeBuildInputs or []) ++ optionals (stdenv.isLinux) [ autoPatchelfHook ]; - buildInputs = (attrs.buildInputs or []) ++ optional (stdenv.isLinux) [ + buildInputs = (attrs.buildInputs or []) ++ optionals (stdenv.isLinux) [ python3 stdenv.cc.cc libdbusmenu From 597f29e25430c199d773afe24a0107d64b3db255 Mon Sep 17 00:00:00 2001 From: Ryan Horiguchi Date: Tue, 20 Apr 2021 20:22:12 +0200 Subject: [PATCH 10/14] gnomeExtensions.unite: 51 -> 52 (#119924) Co-authored-by: Sandro --- pkgs/desktops/gnome-3/extensions/unite/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/desktops/gnome-3/extensions/unite/default.nix b/pkgs/desktops/gnome-3/extensions/unite/default.nix index 20acb214609f9..a2f4e81924ef0 100644 --- a/pkgs/desktops/gnome-3/extensions/unite/default.nix +++ b/pkgs/desktops/gnome-3/extensions/unite/default.nix @@ -1,13 +1,14 @@ { lib, stdenv, gnome3, fetchFromGitHub, xprop, glib }: + stdenv.mkDerivation rec { pname = "gnome-shell-extension-unite"; - version = "51"; + version = "52"; src = fetchFromGitHub { owner = "hardpixel"; repo = "unite-shell"; rev = "v${version}"; - sha256 = "0mic7h5l19ly79l02inm33992ffkxsh618d6zbr39gvn4405g6wk"; + sha256 = "1zahng79m2gw27fb2sw8zyk2n07qc0hbn02g5mfqzhwk62g97v4y"; }; uuid = "unite@hardpixel.eu"; From 41714bbcc864f02a8cf7e12a45ca609ba7b46064 Mon Sep 17 00:00:00 2001 From: Bryan Gardiner Date: Tue, 20 Apr 2021 11:45:01 -0700 Subject: [PATCH 11/14] featherpad: 0.10.0 -> 0.18.0 (#119675) Co-authored-by: Sandro --- pkgs/applications/editors/featherpad/default.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/editors/featherpad/default.nix b/pkgs/applications/editors/featherpad/default.nix index c73238ce36613..42c8e77ac68e5 100644 --- a/pkgs/applications/editors/featherpad/default.nix +++ b/pkgs/applications/editors/featherpad/default.nix @@ -1,23 +1,25 @@ -{ lib, mkDerivation, pkg-config, qmake, qttools, qtbase, qtsvg, qtx11extras, fetchFromGitHub }: +{ lib, mkDerivation, cmake, hunspell, pkg-config, qttools, qtbase, qtsvg, qtx11extras +, fetchFromGitHub }: + mkDerivation rec { pname = "featherpad"; - version = "0.10.0"; + version = "0.18.0"; src = fetchFromGitHub { owner = "tsujan"; repo = "FeatherPad"; rev = "V${version}"; - sha256 = "1wrbs6kni9s3x39cckm9kzpglryxn5vyarilvh9pafbzpc6rc57p"; + sha256 = "0av96yx9ir1ap5adn2cvr6n5y7qjrspk73and21m65dmpwlfdiqb"; }; - nativeBuildInputs = [ qmake pkg-config qttools ]; - buildInputs = [ qtbase qtsvg qtx11extras ]; + nativeBuildInputs = [ cmake pkg-config qttools ]; + buildInputs = [ hunspell qtbase qtsvg qtx11extras ]; meta = with lib; { description = "Lightweight Qt5 Plain-Text Editor for Linux"; homepage = "https://github.com/tsujan/FeatherPad"; platforms = platforms.linux; maintainers = [ maintainers.flosse ]; - license = licenses.gpl3; + license = licenses.gpl3Plus; }; } From 6a707e80e658d0db5c0a173281d7fb2c8e7ebe64 Mon Sep 17 00:00:00 2001 From: SCOTT-HAMILTON Date: Tue, 20 Apr 2021 20:45:44 +0200 Subject: [PATCH 12/14] srt-live-server: init at 1.4.8 (#119606) * srt-live-server: init at 1.4.8 * Update pkgs/applications/video/srt-live-server/default.nix * Update pkgs/applications/video/srt-live-server/default.nix Co-authored-by: Sandro --- .../video/srt-live-server/default.nix | 37 +++++++++++ .../fix-insecure-printfs.patch | 61 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 100 insertions(+) create mode 100644 pkgs/applications/video/srt-live-server/default.nix create mode 100644 pkgs/applications/video/srt-live-server/fix-insecure-printfs.patch diff --git a/pkgs/applications/video/srt-live-server/default.nix b/pkgs/applications/video/srt-live-server/default.nix new file mode 100644 index 0000000000000..e02d15a595bf6 --- /dev/null +++ b/pkgs/applications/video/srt-live-server/default.nix @@ -0,0 +1,37 @@ +{ lib +, fetchFromGitHub +, stdenv +, srt +, zlib +}: + +stdenv.mkDerivation rec { + pname = "srt-live-server"; + version = "1.4.8"; + + src = fetchFromGitHub { + owner = "Edward-Wu"; + repo = "srt-live-server"; + rev = "V${version}"; + sha256 = "0x48sxpgxznb1ymx8shw437pcgk76ka5rx0zhn9b3cyi9jlq1yld"; + }; + + patches = [ + # https://github.com/Edward-Wu/srt-live-server/pull/94 + ./fix-insecure-printfs.patch + ]; + + buildInputs = [ srt zlib ]; + + makeFlags = [ + "PREFIX=$(out)" + ]; + + meta = with lib; { + description = "srt live server for low latency"; + license = licenses.mit; + homepage = "https://github.com/Edward-Wu/srt-live-server"; + maintainers = with maintainers; [ shamilton ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/applications/video/srt-live-server/fix-insecure-printfs.patch b/pkgs/applications/video/srt-live-server/fix-insecure-printfs.patch new file mode 100644 index 0000000000000..8cc85549d13ed --- /dev/null +++ b/pkgs/applications/video/srt-live-server/fix-insecure-printfs.patch @@ -0,0 +1,61 @@ +diff --color -ur a/Makefile b/Makefile +--- a/Makefile 2021-04-16 13:02:41.416453040 +0200 ++++ b/Makefile 2021-04-16 13:21:23.020089623 +0200 +@@ -1,3 +1,4 @@ ++PREFIX = /usr/local + SHELL = /bin/sh + MAIN_NAME=sls + CLIENT_NAME=slc +@@ -64,3 +65,16 @@ + rm -f $(OUTPUT_PATH)/*.o + rm -rf $(BIN_PATH)/* + ++install: all ++ @echo installing executable files to ${DESTDIR}${PREFIX}/bin ++ @mkdir -p "${DESTDIR}${PREFIX}/bin" ++ @cp -f ${BIN_PATH}/${MAIN_NAME} "${DESTDIR}${PREFIX}/bin" ++ @chmod 755 "${DESTDIR}${PREFIX}/bin/${MAIN_NAME}" ++ @cp -f ${BIN_PATH}/${CLIENT_NAME} "${DESTDIR}${PREFIX}/bin" ++ @chmod 755 "${DESTDIR}${PREFIX}/bin/${CLIENT_NAME}" ++ ++uninstall: ++ @echo removing executable files from ${DESTDIR}${PREFIX}/bin ++ @rm -f "${DESTDIR}${PREFIX}/bin/${MAIN_NAME}" ++ @rm -f "${DESTDIR}${PREFIX}/bin/${CLIENT_NAME}" ++ +diff --color -ur a/slscore/HttpClient.cpp b/slscore/HttpClient.cpp +--- a/slscore/HttpClient.cpp 2021-04-16 13:02:41.416453040 +0200 ++++ b/slscore/HttpClient.cpp 2021-04-16 13:11:40.343866698 +0200 +@@ -90,7 +90,7 @@ + goto FUNC_END; + } + if (NULL != method && strlen(method) > 0) { +- sprintf(m_http_method, method); ++ strcpy(m_http_method, method); + } + + m_interval = interval; +diff --color -ur a/slscore/SLSLog.cpp b/slscore/SLSLog.cpp +--- a/slscore/SLSLog.cpp 2021-04-16 13:02:41.416453040 +0200 ++++ b/slscore/SLSLog.cpp 2021-04-16 13:08:16.836119519 +0200 +@@ -85,7 +85,7 @@ + vsnprintf (buf , 4095 , fmt , vl); + //sprintf(buf_info, "%s %s: %s\n" , cur_time, LOG_LEVEL_NAME[level], buf); + sprintf(buf_info, "%s:%03d %s %s: %s\n" , cur_time, cur_time_msec, APP_NAME, LOG_LEVEL_NAME[level], buf); +- printf(buf_info); ++ puts(buf_info); + + if (m_log_file) { + fwrite(buf_info, strlen(buf_info), 1, m_log_file); +diff --color -ur a/slscore/SLSSrt.cpp b/slscore/SLSSrt.cpp +--- a/slscore/SLSSrt.cpp 2021-04-16 13:02:41.417452995 +0200 ++++ b/slscore/SLSSrt.cpp 2021-04-16 13:10:11.004957820 +0200 +@@ -124,7 +124,7 @@ + std::map::iterator it; + for(it=map_error.begin(); it!=map_error.end(); ++it) { + sprintf(szBuf, "%d: %s\n", it->first, it->second.c_str()); +- printf(szBuf); ++ puts(szBuf); + } + printf("----------end------------\n"); + map_error.clear(); diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5cf60e2c3c84e..ccc5d2776efbb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8457,6 +8457,8 @@ in srcml = callPackage ../applications/version-management/srcml { }; + srt-live-server = callPackage ../applications/video/srt-live-server { }; + srt-to-vtt-cl = callPackage ../tools/cd-dvd/srt-to-vtt-cl { }; sourcehut = callPackage ../applications/version-management/sourcehut { }; From 7c08d644a0d5f503ecde1f4c07c9c912b29adebe Mon Sep 17 00:00:00 2001 From: David Arnold Date: Tue, 20 Apr 2021 12:26:59 -0500 Subject: [PATCH 13/14] init: devshell for hands-on onboarding --- devshell.toml | 19 +++++++++++++++++++ flake.nix | 5 +++++ shell.nix | 17 +++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 devshell.toml create mode 100644 shell.nix diff --git a/devshell.toml b/devshell.toml new file mode 100644 index 0000000000000..a39b209bc13df --- /dev/null +++ b/devshell.toml @@ -0,0 +1,19 @@ +[devshell] +name = "nixpkgs" +packages = [ + "fd", + "nixpkgs-fmt", +] + +[[commands]] +name = "fmt" +help = "Check Nix formatting" +category = "folder tree checks" +command = "nixpkgs-fmt ${@} ." + +[[commands]] +name = "evalnix" +help = "Check Nix parsing" +category = "folder tree checks" +command = "fd --extension nix --exec nix-instantiate --parse --quiet {} >/dev/null" + diff --git a/flake.nix b/flake.nix index 537f91ee5e711..a42e6f50fcfcd 100644 --- a/flake.nix +++ b/flake.nix @@ -63,6 +63,11 @@ }); checks.x86_64-linux.tarball = jobs.tarball; + devShell = { + x86_64-linux = import ./shell.nix { system = "x86_64-linux"; }; + x86_64-darwin = import ./shell.nix { system = "x86_64-darwin"; }; + aarch64-linux = import ./shell.nix { system = "aarch64-linux"; }; + }; htmlDocs = { nixpkgsManual = jobs.manual; diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000000000..219445ea6c18d --- /dev/null +++ b/shell.nix @@ -0,0 +1,17 @@ +{ system ? builtins.currentSystem }: +let + # nixpkgs / devshell is only used for development. Don't add it to the flake.lock. + devshellGitRev = "709fe4d04a9101c9d224ad83f73416dce71baf21"; + + nixpkgsSrc = ./.; + + devshellSrc = fetchTarball { + url = "https://github.com/numtide/devshell/archive/${devshellGitRev}.tar.gz"; + sha256 = "1px9cqfshfqs1b7ypyxch3s3ymr4xgycy1krrcg7b97rmmszvsqr"; + }; + + pkgs = import nixpkgsSrc { inherit system; }; + devshell = import devshellSrc { inherit system pkgs; }; + +in +devshell.fromTOML ./devshell.toml From b6ddceff3a82fea3d6be52739af81025e9fe9da7 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Tue, 20 Apr 2021 14:21:30 -0500 Subject: [PATCH 14/14] devshell: add (tiny) but useful pre-commit hook --- devshell.toml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/devshell.toml b/devshell.toml index a39b209bc13df..f1c762278fc02 100644 --- a/devshell.toml +++ b/devshell.toml @@ -1,10 +1,17 @@ +imports = [ "git.hooks" ] + [devshell] name = "nixpkgs" packages = [ "fd", "nixpkgs-fmt", + "editorconfig-checker", ] +[[commands]] +package = "editorconfig-checker" +category = "linters" + [[commands]] name = "fmt" help = "Check Nix formatting" @@ -17,3 +24,34 @@ help = "Check Nix parsing" category = "folder tree checks" command = "fd --extension nix --exec nix-instantiate --parse --quiet {} >/dev/null" +[git.hooks] +enable = true +pre-commit.text = """ +#!/usr/bin/env bash +set -eou pipefail +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=$(${git}/bin/git hash-object -t tree /dev/null) +fi + +diff="git diff-index --name-only --cached $against --diff-filter d" + +nix_files=($($diff -- '*.nix')) +all_files=($($diff)) + +# Format staged nix files. +if [[ -n "${nix_files[@]}" ]]; then + nixpkgs-fmt "${nix_files[@]}" + git add "${nix_files[@]}" +fi + +# check editorconfig +if ! editorconfig-checker -- "${all_files[@]}"; then + echo -e "\nCode is not aligned with .editorconfig +Review the output and commit your fixes" >&2 + exit 1 +fi +"""