Merge pull request #205201 from Artturin/lintfixes1

Lint fixes
This commit is contained in:
Artturi 2022-12-09 05:13:56 +02:00 committed by GitHub
commit 0aa0c46ef5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 65 additions and 54 deletions

View file

@ -156,7 +156,7 @@ stdenv.mkDerivation rec {
WITH_X11 = true; WITH_X11 = true;
}; };
NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin [ NIX_CFLAGS_COMPILE = lib.optionals stdenv.isDarwin [
"-DTARGET_OS_IPHONE=0" "-DTARGET_OS_IPHONE=0"
"-DTARGET_OS_WATCH=0" "-DTARGET_OS_WATCH=0"
"-include AudioToolbox/AudioToolbox.h" "-include AudioToolbox/AudioToolbox.h"

View file

@ -71,25 +71,27 @@ stdenv.mkDerivation rec {
] ++ lib.optionals withNetworkManager [ ] ++ lib.optionals withNetworkManager [
networkmanager networkmanager
glib glib
] ++ lib.optional withSensors [ ] ++ lib.optionals withSensors [
lm_sensors lm_sensors
]; ];
propagatedBuildInputs = [ propagatedBuildInputs = [
] ++ lib.optional withPython (python3.withPackages (ps: [ ] ++ lib.optionals withPython [
ps.numpy (python3.withPackages (ps: [
ps.protobuf ps.numpy
ps.pyserial ps.protobuf
ps.setuptools ps.pyserial
ps.websockets ps.setuptools
])); ps.websockets
]))
];
configureFlags = [ configureFlags = [
] ++ lib.optional (!withNetworkManager) [ ] ++ lib.optionals (!withNetworkManager) [
"--disable-libnm" "--disable-libnm"
] ++ lib.optional (!withPython) [ ] ++ lib.optionals (!withPython) [
"--disable-python-tools" "--disable-python-tools"
] ++ lib.optional (!withSensors) [ ] ++ lib.optionals (!withSensors) [
"--disable-lmsensors" "--disable-lmsensors"
]; ];

View file

@ -119,7 +119,7 @@ let
flatten flip flatten flip
concatMapStrings concatStringsSep concatMapStrings concatStringsSep
getDev getLib getDev getLib
optional optionals optionalString; optionals optionalString;
jre' = jre17_minimal.override { jre' = jre17_minimal.override {
modules = [ "java.base" "java.desktop" "java.logging" "java.sql" ]; modules = [ "java.base" "java.desktop" "java.logging" "java.sql" ];
@ -195,7 +195,7 @@ in
tar -xf ${srcs.translations} tar -xf ${srcs.translations}
''; '';
patches = optional (variant == "still") [ ./skip-failed-test-with-icu70.patch ./gpgme-1.18.patch ] patches = optionals (variant == "still") [ ./skip-failed-test-with-icu70.patch ./gpgme-1.18.patch ]
; ;
### QT/KDE ### QT/KDE

View file

@ -48,7 +48,7 @@ rec {
}; };
buildInputs = oldAttrs.buildInputs buildInputs = oldAttrs.buildInputs
++ lib.optional withSeccomp [ libseccomp ]; ++ lib.optionals withSeccomp [ libseccomp ];
}); });
docker-tini = tini.overrideAttrs (oldAttrs: { docker-tini = tini.overrideAttrs (oldAttrs: {

View file

@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
}; };
}; };
NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin [ NIX_CFLAGS_COMPILE = lib.optionals stdenv.isDarwin [
"-DTARGET_OS_IPHONE=0" "-DTARGET_OS_IPHONE=0"
"-DTARGET_OS_WATCH=0" "-DTARGET_OS_WATCH=0"
]; ];

View file

@ -1,16 +1,18 @@
{ pkgs, lib, ... }: { stdenv, lib, cmake, qt4, fetchzip }:
pkgs.stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "smokegen"; pname = "smokegen";
version = "v4.14.3"; version = "4.14.3";
src = pkgs.fetchzip {
url = "https://invent.kde.org/unmaintained/${pname}/-/archive/${version}/${pname}-${version}.tar.gz"; src = fetchzip {
url = "https://invent.kde.org/unmaintained/${pname}/-/archive/v${version}/${pname}-v${version}.tar.gz";
hash = "sha256-finsoruPeJZLawIjNUJ25Pq54eaCByfALVraNQJPk7c="; hash = "sha256-finsoruPeJZLawIjNUJ25Pq54eaCByfALVraNQJPk7c=";
}; };
buildInputs = [ pkgs.cmake pkgs.qt4 ];
buildPhase = '' strictDeps = true;
cmake . nativeBuildInputs = [ cmake qt4 ];
''; buildInputs = [ qt4 ];
meta = with lib; { meta = with lib; {
description = "A general purpose C++ parser with a plugin infrastructure"; description = "A general purpose C++ parser with a plugin infrastructure";
homepage = "https://invent.kde.org/unmaintained/smokegen"; homepage = "https://invent.kde.org/unmaintained/smokegen";

View file

@ -1,16 +1,22 @@
{ pkgs, lib, ... }: { stdenv, lib, cmake, qt4, smokegen, fetchzip }:
pkgs.stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "smokeqt"; pname = "smokeqt";
version = "v4.14.3"; version = "4.14.3";
src = pkgs.fetchzip {
url = "https://invent.kde.org/unmaintained/${pname}/-/archive/${version}/${pname}-${version}.tar.gz"; src = fetchzip {
url = "https://invent.kde.org/unmaintained/${pname}/-/archive/v${version}/${pname}-v${version}.tar.gz";
hash = "sha256-8FiEGF8gduVw5I/bi2wExGUWmjIjYEhWpjpXKJGBNMg="; hash = "sha256-8FiEGF8gduVw5I/bi2wExGUWmjIjYEhWpjpXKJGBNMg=";
}; };
strictDeps = true;
nativeBuildInputs = [ cmake smokegen ];
buildInputs = [ qt4 ];
cmakeFlags = [ cmakeFlags = [
"-DCMAKE_CXX_STANDARD=98" "-DCMAKE_CXX_STANDARD=98"
]; ];
buildInputs = [ pkgs.cmake pkgs.qt4 pkgs.smokegen ];
meta = with lib; { meta = with lib; {
description = "Bindings for the Qt libraries"; description = "Bindings for the Qt libraries";
homepage = "https://invent.kde.org/unmaintained/smokeqt"; homepage = "https://invent.kde.org/unmaintained/smokeqt";

View file

@ -26,7 +26,7 @@ buildDunePackage rec {
}; };
propagatedBuildInputs = [ zed lwt_log lwt_react mew_vi ] propagatedBuildInputs = [ zed lwt_log lwt_react mew_vi ]
++ lib.optional (lib.versionAtLeast version "3.3.1") [ uucp logs ] ; ++ lib.optionals (lib.versionAtLeast version "3.3.1") [ uucp logs ] ;
meta = { meta = {
description = "Terminal manipulation library for OCaml"; description = "Terminal manipulation library for OCaml";

View file

@ -32,7 +32,7 @@ buildPythonPackage rec {
nativeBuildInputs = [ setuptools ]; nativeBuildInputs = [ setuptools ];
propagatedBuildInputs = [ propagatedBuildInputs = [
cryptography jinja2 Mako passlib pyyaml requests tomlkit librouteros cryptography jinja2 Mako passlib pyyaml requests tomlkit librouteros
] ++ lib.optional (pythonOlder "3.11") [ rtoml ]; ] ++ lib.optionals (pythonOlder "3.11") [ rtoml ];
pythonImportsCheck = [ "bundlewrap" ]; pythonImportsCheck = [ "bundlewrap" ];

View file

@ -40,7 +40,7 @@ buildPythonPackage rec {
babel babel
jupyter_server jupyter_server
tomli tomli
] ++ lib.optional (pythonOlder "3.10") [ ] ++ lib.optionals (pythonOlder "3.10") [
importlib-metadata importlib-metadata
]; ];

View file

@ -37,7 +37,7 @@ buildPythonPackage {
buildPackages."protobuf${lib.versions.major protobuf.version}_${lib.versions.minor protobuf.version}" buildPackages."protobuf${lib.versions.major protobuf.version}_${lib.versions.minor protobuf.version}"
]; ];
setupPyGlobalFlags = "--cpp_implementation"; setupPyGlobalFlags = [ "--cpp_implementation" ];
pythonImportsCheck = [ pythonImportsCheck = [
"google.protobuf" "google.protobuf"

View file

@ -35,7 +35,7 @@ buildPythonPackage rec {
]; ];
# `stripLen` does not seem to work here # `stripLen` does not seem to work here
patchFlags = "-p2"; patchFlags = [ "-p2" ];
sourceRoot = "${src.name}/src"; sourceRoot = "${src.name}/src";

View file

@ -133,7 +133,7 @@ buildPythonPackage rec {
# https://github.com/python-lsp/python-lsp-server/issues/243 # https://github.com/python-lsp/python-lsp-server/issues/243
"test_numpy_completions" "test_numpy_completions"
"test_workspace_loads_pycodestyle_config" "test_workspace_loads_pycodestyle_config"
] ++ lib.optional (stdenv.isDarwin && stdenv.isAarch64) [ ] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
# pyqt5 is broken on aarch64-darwin # pyqt5 is broken on aarch64-darwin
"test_pyqt_completion" "test_pyqt_completion"
]; ];

View file

@ -91,7 +91,7 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true; enableParallelBuilding = true;
sconsFlags = "platform=linuxbsd target=editor production=true"; sconsFlags = [ "platform=linuxbsd target=editor production=true" ];
preConfigure = '' preConfigure = ''
sconsFlags+=" ${ sconsFlags+=" ${
lib.concatStringsSep " " lib.concatStringsSep " "

View file

@ -397,7 +397,7 @@ lib.composeManyExtensions [
( (
old: { old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) nativeBuildInputs = (old.nativeBuildInputs or [ ])
++ lib.optional (lib.versionAtLeast old.version "3.4") [ self.setuptools-rust ] ++ lib.optionals (lib.versionAtLeast old.version "3.4") [ self.setuptools-rust ]
++ lib.optional (!self.isPyPy) pyBuildPackages.cffi ++ lib.optional (!self.isPyPy) pyBuildPackages.cffi
++ lib.optional (lib.versionAtLeast old.version "3.5" && !isWheel) ++ lib.optional (lib.versionAtLeast old.version "3.5" && !isWheel)
(with pkgs.rustPlatform; [ cargoSetupHook rust.cargo rust.rustc ]); (with pkgs.rustPlatform; [ cargoSetupHook rust.cargo rust.rustc ]);
@ -1078,9 +1078,9 @@ lib.composeManyExtensions [
buildInputs = old.buildInputs or [ ] ++ [ buildInputs = old.buildInputs or [ ] ++ [
pkgs.which pkgs.which
] ++ lib.optional enableGhostscript [ ] ++ lib.optionals enableGhostscript [
pkgs.ghostscript pkgs.ghostscript
] ++ lib.optional stdenv.isDarwin [ ] ++ lib.optionals stdenv.isDarwin [
Cocoa Cocoa
]; ];
@ -1097,7 +1097,7 @@ lib.composeManyExtensions [
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
pkg-config pkg-config
] ++ lib.optional (lib.versionAtLeast super.matplotlib.version "3.5.0") [ ] ++ lib.optionals (lib.versionAtLeast super.matplotlib.version "3.5.0") [
self.setuptools-scm self.setuptools-scm
self.setuptools-scm-git-archive self.setuptools-scm-git-archive
]; ];
@ -2111,8 +2111,8 @@ lib.composeManyExtensions [
if old.format != "wheel" then { if old.format != "wheel" then {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++
[ pkgs.gfortran ] ++ [ pkgs.gfortran ] ++
lib.optional (lib.versionAtLeast super.scipy.version "1.7.0") [ self.pythran ] ++ lib.optionals (lib.versionAtLeast super.scipy.version "1.7.0") [ self.pythran ] ++
lib.optional (lib.versionAtLeast super.scipy.version "1.9.0") [ self.meson-python pkg-config ]; lib.optionals (lib.versionAtLeast super.scipy.version "1.9.0") [ self.meson-python pkg-config ];
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.pybind11 ]; propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.pybind11 ];
setupPyBuildFlags = [ "--fcompiler='gnu95'" ]; setupPyBuildFlags = [ "--fcompiler='gnu95'" ];
enableParallelBuilding = true; enableParallelBuilding = true;

View file

@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
buildFlags = [ "module" ]; buildFlags = [ "module" ];
makeFlags = [ makeFlags = [
"ARCH=${stdenv.hostPlatform.linuxArch}" "ARCH=${stdenv.hostPlatform.linuxArch}"
] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [ ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"CROSS_COMPILE=${stdenv.cc.targetPrefix}" "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
]; ];

View file

@ -19,7 +19,7 @@ rustPlatform.buildRustPackage rec {
cargoSha256 = "sha256-uIr8aUDErHVUKML2l6nITSBpOxqg3h1Md0948BxvutI="; cargoSha256 = "sha256-uIr8aUDErHVUKML2l6nITSBpOxqg3h1Md0948BxvutI=";
buildInputs = lib.optional stdenv.isDarwin [ buildInputs = lib.optionals stdenv.isDarwin [
Security Security
]; ];

View file

@ -1,4 +1,4 @@
{ pkgs, lib, stdenv, fetchFromGitHub, fetchzip, substituteAll, nixosTests, iputils }: { pkgs, lib, stdenv, fetchFromGitHub, fetchzip, nixosTests, iputils, nodejs, makeWrapper }:
let let
deps = import ./composition.nix { inherit pkgs; }; deps = import ./composition.nix { inherit pkgs; };
in in
@ -28,7 +28,7 @@ stdenv.mkDerivation (finalAttrs: {
--replace "/sbin/ping" "${iputils}/bin/ping" --replace "/sbin/ping" "${iputils}/bin/ping"
''; '';
buildInputs = [ pkgs.makeWrapper ]; nativeBuildInputs = [ makeWrapper ];
installPhase = '' installPhase = ''
mkdir -p $out/share/ mkdir -p $out/share/
@ -41,7 +41,7 @@ stdenv.mkDerivation (finalAttrs: {
''; '';
postFixup = '' postFixup = ''
makeWrapper ${pkgs.nodejs}/bin/node $out/bin/uptime-kuma-server \ makeWrapper ${nodejs}/bin/node $out/bin/uptime-kuma-server \
--add-flags $out/share/server/server.js \ --add-flags $out/share/server/server.js \
--chdir $out/share/ --chdir $out/share/
''; '';

View file

@ -42,7 +42,7 @@ in
stdenv.mkDerivation { stdenv.mkDerivation {
inherit pname version; inherit pname version;
buildInputs = [ nativeBuildInputs = [
makeWrapper makeWrapper
]; ];

View file

@ -38,7 +38,7 @@ stdenv.mkDerivation (rec {
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [ makeWrapper ];
buildInputs = [ jre_headless util-linux ] buildInputs = [ jre_headless util-linux ]
++ optional enableUnfree [ zlib libxcrypt ]; ++ optionals enableUnfree [ zlib libxcrypt ];
installPhase = '' installPhase = ''
mkdir -p $out mkdir -p $out

View file

@ -44,7 +44,7 @@ stdenv.mkDerivation {
"--enable-pcre" "--enable-pcre"
"--enable-zprofile=${placeholder "out"}/etc/zprofile" "--enable-zprofile=${placeholder "out"}/etc/zprofile"
"--disable-site-fndir" "--disable-site-fndir"
] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform && !stdenv.hostPlatform.isStatic) [ ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform && !stdenv.hostPlatform.isStatic) [
# Also see: https://github.com/buildroot/buildroot/commit/2f32e668aa880c2d4a2cce6c789b7ca7ed6221ba # Also see: https://github.com/buildroot/buildroot/commit/2f32e668aa880c2d4a2cce6c789b7ca7ed6221ba
"zsh_cv_shared_environ=yes" "zsh_cv_shared_environ=yes"
"zsh_cv_shared_tgetent=yes" "zsh_cv_shared_tgetent=yes"

View file

@ -17,11 +17,12 @@ stdenv.mkDerivation rec {
sha256 = "sha256-laf1DEtdEs7q+rtp5Y5rb+7AGsKUv5T413CFWJiURWw="; sha256 = "sha256-laf1DEtdEs7q+rtp5Y5rb+7AGsKUv5T413CFWJiURWw=";
}; };
autoreconfFlags = "-if";
nativeBuildInputs = [ nativeBuildInputs = [
autoreconfHook pkg-config check autoreconfHook pkg-config check
]; ];
autoreconfFlags = [ "-if" ];
meta = with lib; { meta = with lib; {
description = "What would cron do? Read crontab entries from stdin and print time of next execution(s)"; description = "What would cron do? Read crontab entries from stdin and print time of next execution(s)";
homepage = "https://git.sr.ht/~bitfehler/wwcd"; homepage = "https://git.sr.ht/~bitfehler/wwcd";

View file

@ -25,8 +25,8 @@ stdenv.mkDerivation rec {
}; };
depsBuildBuild = [ pkg-config ]; depsBuildBuild = [ pkg-config ];
buildInputs = [ libdrm wayland wayland-protocols wl-clipboard libxkbcommon cmake libressl ];
nativeBuildInputs = [ meson ninja ]; nativeBuildInputs = [ meson ninja ];
buildInputs = [ libdrm wayland wayland-protocols wl-clipboard libxkbcommon libressl ];
postPatch = '' postPatch = ''
substituteInPlace waynergy.desktop --replace "Exec=/usr/bin/waynergy" "Exec=$out/bin/waynergy" substituteInPlace waynergy.desktop --replace "Exec=/usr/bin/waynergy" "Exec=$out/bin/waynergy"