Merge pull request #234897 from figsoda/optionals

treewide: don't use lib.optional with a list
This commit is contained in:
Weijia Wang 2023-05-30 06:09:19 +03:00 committed by GitHub
commit 1e27109d4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 13 deletions

View file

@ -55,7 +55,7 @@ stdenv.mkDerivation rec {
"IPE_NO_SPELLCHECK=1" # qtSpell is not yet packaged "IPE_NO_SPELLCHECK=1" # qtSpell is not yet packaged
]; ];
qtWrapperArgs = lib.optional withTeXLive [ "--prefix PATH : ${lib.makeBinPath [ texlive ]}" ]; qtWrapperArgs = lib.optionals withTeXLive [ "--prefix PATH : ${lib.makeBinPath [ texlive ]}" ];
enableParallelBuilding = true; enableParallelBuilding = true;

View file

@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
configureFlags = lib.optional stdenv.hostPlatform.isSunOS "--disable-thread-safe" configureFlags = lib.optional stdenv.hostPlatform.isSunOS "--disable-thread-safe"
++ lib.optional stdenv.hostPlatform.is64bit "--with-pic" ++ lib.optional stdenv.hostPlatform.is64bit "--with-pic"
++ lib.optional stdenv.hostPlatform.isPower64 [ ++ lib.optionals stdenv.hostPlatform.isPower64 [
# Without this, the `tget_set_d128` test experiences a link # Without this, the `tget_set_d128` test experiences a link
# error due to missing `__dpd_trunctdkf`. # error due to missing `__dpd_trunctdkf`.
"--disable-decimal-float" "--disable-decimal-float"

View file

@ -133,7 +133,7 @@ buildPythonPackage rec {
"test_visual_zoom_all_rendering1" "test_visual_zoom_all_rendering1"
"test_visual_zoom_all_rendering2" "test_visual_zoom_all_rendering2"
"test_wgs84_inverse_forward" "test_wgs84_inverse_forward"
] ++ lib.optional stdenv.isDarwin [ ] ++ lib.optionals stdenv.isDarwin [
"test_passing_pycairo_context_pdf" "test_passing_pycairo_context_pdf"
]; ];

View file

@ -32,7 +32,7 @@ rustPlatform.buildRustPackage rec {
buildInputs = [ buildInputs = [
openssl openssl
] ++ lib.optional stdenv.isDarwin [ ] ++ lib.optionals stdenv.isDarwin [
curl curl
darwin.apple_sdk.frameworks.Security darwin.apple_sdk.frameworks.Security
libgit2_1_3_0 libgit2_1_3_0

View file

@ -60,7 +60,7 @@ let
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "ghostscript${lib.optionalString (x11Support) "-with-X"}"; pname = "ghostscript${lib.optionalString x11Support "-with-X"}";
version = "10.01.1"; version = "10.01.1";
src = fetchurl { src = fetchurl {
@ -112,7 +112,7 @@ stdenv.mkDerivation rec {
] ++ lib.optionals dynamicDrivers [ ] ++ lib.optionals dynamicDrivers [
"--enable-dynamic" "--enable-dynamic"
"--disable-hidden-visibility" "--disable-hidden-visibility"
] ++ lib.optional x11Support [ ] ++ lib.optionals x11Support [
"--with-x" "--with-x"
] ++ lib.optionals cupsSupport [ ] ++ lib.optionals cupsSupport [
"--enable-cups" "--enable-cups"

View file

@ -1,6 +1,6 @@
{ kernel, stdenv, kmod, lib, fetchzip, fetchpatch, dos2unix }: { kernel, stdenv, kmod, lib, fetchzip, dos2unix }:
stdenv.mkDerivation
{ stdenv.mkDerivation {
pname = "ax99100"; pname = "ax99100";
version = "1.8.0"; version = "1.8.0";
@ -26,9 +26,9 @@ stdenv.mkDerivation
patches = [ patches = [
./kernel-5.18-pci_free_consistent-pci_alloc_consistent.patch ./kernel-5.18-pci_free_consistent-pci_alloc_consistent.patch
./kernel-6.1-set_termios-const-ktermios.patch ./kernel-6.1-set_termios-const-ktermios.patch
] ++ (lib.optional (lib.versionAtLeast kernel.version "6.2") [ ] ++ lib.optionals (lib.versionAtLeast kernel.version "6.2") [
./kernel-6.2-fix-pointer-type.patch ./kernel-6.2-fix-pointer-type.patch
]); ];
patchFlags = [ "-p0" ]; patchFlags = [ "-p0" ];

View file

@ -1,5 +1,4 @@
{ fetchurl { fetchurl
, fetchpatch
, stdenv , stdenv
, installShellFiles , installShellFiles
, lib , lib
@ -22,7 +21,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkg-config installShellFiles ]; nativeBuildInputs = [ pkg-config installShellFiles ];
buildInputs = [ libftdi1 libusb1 ] buildInputs = [ libftdi1 libusb1 ]
++ lib.optional (!stdenv.isDarwin) [ pciutils ] ++ lib.optionals (!stdenv.isDarwin) [ pciutils ]
++ lib.optional jlinkSupport libjaylink; ++ lib.optional jlinkSupport libjaylink;
postPatch = '' postPatch = ''