mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-13 11:30:35 +08:00
1116 lines
48 KiB
Diff
1116 lines
48 KiB
Diff
diff --git a/nixos/modules/programs/ccache.nix b/nixos/modules/programs/ccache.nix
|
|
index 567c853e8c7d..a4ec23683b87 100644
|
|
--- a/nixos/modules/programs/ccache.nix
|
|
+++ b/nixos/modules/programs/ccache.nix
|
|
@@ -52,14 +52,18 @@ in {
|
|
# target configuration
|
|
(mkIf (cfg.packageNames != []) {
|
|
nixpkgs.overlays = [
|
|
- (self: super: genAttrs cfg.packageNames (pn: super.${pn}.override { stdenv = builtins.trace "with ccache: ${pn}" self.ccacheStdenv; }))
|
|
+ (self: super: genAttrs cfg.packageNames (pn: super.${pn}.override { stdenv = builtins.trace "with ccache: ${pn}" self.ccacheStdenv; }))];})
|
|
|
|
+ (mkIf cfg.enable {
|
|
+ nixpkgs.overlays = [
|
|
(self: super: {
|
|
ccacheWrapper = super.ccacheWrapper.override {
|
|
extraConfig = ''
|
|
- export CCACHE_COMPRESS=1
|
|
+ export CCACHE_NOCOMPRESS=true
|
|
export CCACHE_DIR="${cfg.cacheDir}"
|
|
export CCACHE_UMASK=007
|
|
+ export CCACHE_MAXSIZE=300G
|
|
+ CCACHE_SLOPPINESS=random_seed,time_macros
|
|
if [ ! -d "$CCACHE_DIR" ]; then
|
|
echo "====="
|
|
echo "Directory '$CCACHE_DIR' does not exist"
|
|
diff --git a/nixos/modules/services/databases/mysql.nix b/nixos/modules/services/databases/mysql.nix
|
|
index 128bb0862175..14e99c71ebb4 100644
|
|
--- a/nixos/modules/services/databases/mysql.nix
|
|
+++ b/nixos/modules/services/databases/mysql.nix
|
|
@@ -467,9 +467,9 @@ in
|
|
|
|
${concatMapStrings (user:
|
|
''
|
|
- ( echo "CREATE USER IF NOT EXISTS '${user.name}'@'localhost' IDENTIFIED WITH ${if isMariaDB then "unix_socket" else "auth_socket"};"
|
|
+ ( echo "CREATE USER IF NOT EXISTS '${user.name}' IDENTIFIED WITH ${if isMariaDB then "unix_socket" else "auth_socket"};"
|
|
${concatStringsSep "\n" (mapAttrsToList (database: permission: ''
|
|
- echo "GRANT ${permission} ON ${database} TO '${user.name}'@'localhost';"
|
|
+ echo "GRANT ${permission} ON ${database} TO '${user.name}';"
|
|
'') user.ensurePermissions)}
|
|
) | ${cfg.package}/bin/mysql -N
|
|
'') cfg.ensureUsers}
|
|
diff --git a/nixos/modules/services/web-apps/mastodon.nix b/nixos/modules/services/web-apps/mastodon.nix
|
|
index f28951dc65e6..6efec782c27c 100644
|
|
--- a/nixos/modules/services/web-apps/mastodon.nix
|
|
+++ b/nixos/modules/services/web-apps/mastodon.nix
|
|
@@ -116,10 +116,10 @@ let
|
|
threads = toString (if processCfg.threads == null then cfg.sidekiqThreads else processCfg.threads);
|
|
in {
|
|
after = [ "network.target" "mastodon-init-dirs.service" ]
|
|
- ++ lib.optional databaseActuallyCreateLocally "postgresql.service"
|
|
+ ++ lib.optional true "postgresql.service"
|
|
++ lib.optional cfg.automaticMigrations "mastodon-init-db.service";
|
|
requires = [ "mastodon-init-dirs.service" ]
|
|
- ++ lib.optional databaseActuallyCreateLocally "postgresql.service"
|
|
+ ++ lib.optional true "postgresql.service"
|
|
++ lib.optional cfg.automaticMigrations "mastodon-init-db.service";
|
|
description = "Mastodon sidekiq${jobClassLabel}";
|
|
wantedBy = [ "mastodon.target" ];
|
|
@@ -146,10 +146,10 @@ let
|
|
name = "mastodon-streaming-${toString i}";
|
|
value = {
|
|
after = [ "network.target" "mastodon-init-dirs.service" ]
|
|
- ++ lib.optional databaseActuallyCreateLocally "postgresql.service"
|
|
+ ++ lib.optional true "postgresql.service"
|
|
++ lib.optional cfg.automaticMigrations "mastodon-init-db.service";
|
|
requires = [ "mastodon-init-dirs.service" ]
|
|
- ++ lib.optional databaseActuallyCreateLocally "postgresql.service"
|
|
+ ++ lib.optional true "postgresql.service"
|
|
++ lib.optional cfg.automaticMigrations "mastodon-init-db.service";
|
|
wantedBy = [ "mastodon.target" "mastodon-streaming.target" ];
|
|
description = "Mastodon streaming ${toString i}";
|
|
@@ -744,17 +744,17 @@ in {
|
|
SystemCallFilter = [ ("~" + lib.concatStringsSep " " (systemCallsList ++ [ "@resources" ])) "@chown" "pipe" "pipe2" ];
|
|
} // cfgService;
|
|
after = [ "network.target" "mastodon-init-dirs.service" ]
|
|
- ++ lib.optional databaseActuallyCreateLocally "postgresql.service";
|
|
+ ++ lib.optional true "postgresql.service";
|
|
requires = [ "mastodon-init-dirs.service" ]
|
|
- ++ lib.optional databaseActuallyCreateLocally "postgresql.service";
|
|
+ ++ lib.optional true "postgresql.service";
|
|
};
|
|
|
|
systemd.services.mastodon-web = {
|
|
after = [ "network.target" "mastodon-init-dirs.service" ]
|
|
- ++ lib.optional databaseActuallyCreateLocally "postgresql.service"
|
|
+ ++ lib.optional true "postgresql.service"
|
|
++ lib.optional cfg.automaticMigrations "mastodon-init-db.service";
|
|
requires = [ "mastodon-init-dirs.service" ]
|
|
- ++ lib.optional databaseActuallyCreateLocally "postgresql.service"
|
|
+ ++ lib.optional true "postgresql.service"
|
|
++ lib.optional cfg.automaticMigrations "mastodon-init-db.service";
|
|
wantedBy = [ "mastodon.target" ];
|
|
description = "Mastodon web";
|
|
diff --git a/nixos/modules/services/web-servers/nginx/default.nix b/nixos/modules/services/web-servers/nginx/default.nix
|
|
index cf70dc325945..207d05c57841 100644
|
|
--- a/nixos/modules/services/web-servers/nginx/default.nix
|
|
+++ b/nixos/modules/services/web-servers/nginx/default.nix
|
|
@@ -103,6 +103,14 @@ let
|
|
proxy_set_header X-Forwarded-Server $host;
|
|
'';
|
|
|
|
+ recommendedProxyConfigNoHost = pkgs.writeText "nginx-recommended-proxy-headers-no-host.conf" ''
|
|
+ proxy_set_header X-Real-IP $remote_addr;
|
|
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
+ proxy_set_header X-Forwarded-Proto $scheme;
|
|
+ proxy_set_header X-Forwarded-Host $host;
|
|
+ proxy_set_header X-Forwarded-Server $host;
|
|
+ '';
|
|
+
|
|
proxyCachePathConfig = concatStringsSep "\n" (mapAttrsToList (name: proxyCachePath: ''
|
|
proxy_cache_path ${concatStringsSep " " [
|
|
"/var/cache/nginx/${name}"
|
|
@@ -452,6 +460,7 @@ let
|
|
${optionalString (config.return != null) "return ${config.return};"}
|
|
${config.extraConfig}
|
|
${optionalString (config.proxyPass != null && config.recommendedProxySettings) "include ${recommendedProxyConfig};"}
|
|
+ ${optionalString (config.proxyPass != null && config.recommendedProxySettingsNoHost) "include ${recommendedProxyConfigNoHost};"}
|
|
${mkBasicAuth "sublocation" config}
|
|
}
|
|
'') (sortProperties (mapAttrsToList (k: v: v // { location = k; }) locations)));
|
|
diff --git a/nixos/modules/services/web-servers/nginx/location-options.nix b/nixos/modules/services/web-servers/nginx/location-options.nix
|
|
index 2728852058ea..006c5601c8c1 100644
|
|
--- a/nixos/modules/services/web-servers/nginx/location-options.nix
|
|
+++ b/nixos/modules/services/web-servers/nginx/location-options.nix
|
|
@@ -137,5 +137,11 @@ with lib;
|
|
Enable recommended proxy settings.
|
|
'';
|
|
};
|
|
+
|
|
+ recommendedProxySettingsNoHost = mkOption {
|
|
+ type = types.bool;
|
|
+ default = false;
|
|
+ description = lib.mdDoc ''recommendedProxySettingsNoHost'';
|
|
+ };
|
|
};
|
|
}
|
|
diff --git a/nixos/modules/services/web-servers/ttyd.nix b/nixos/modules/services/web-servers/ttyd.nix
|
|
index 3b1d87ccb483..b4bbc49a45a3 100644
|
|
--- a/nixos/modules/services/web-servers/ttyd.nix
|
|
+++ b/nixos/modules/services/web-servers/ttyd.nix
|
|
@@ -20,7 +20,8 @@ let
|
|
++ optionals cfg.enableSSL [ "--ssl-cert" cfg.certFile
|
|
"--ssl-key" cfg.keyFile
|
|
"--ssl-ca" cfg.caFile ]
|
|
- ++ [ "--debug" (toString cfg.logLevel) ];
|
|
+ ++ [ "--debug" (toString cfg.logLevel) ]
|
|
+ ++ [ "--writable" ];
|
|
|
|
in
|
|
|
|
diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix
|
|
index 7097e1d83dca..92da2910e571 100644
|
|
--- a/nixos/modules/system/boot/loader/grub/grub.nix
|
|
+++ b/nixos/modules/system/boot/loader/grub/grub.nix
|
|
@@ -747,7 +747,7 @@ in
|
|
|
|
boot.loader.grub.extraPrepareConfig =
|
|
concatStrings (mapAttrsToList (n: v: ''
|
|
- ${pkgs.coreutils}/bin/install -Dp "${v}" "${efi.efiSysMountPoint}/"${escapeShellArg n}
|
|
+ ${pkgs.coreutils}/bin/install -Dp "${v}" "/boot/"${escapeShellArg n}
|
|
'') config.boot.loader.grub.extraFiles);
|
|
|
|
assertions = [
|
|
diff --git a/pkgs/applications/graphics/nomacs/default.nix b/pkgs/applications/graphics/nomacs/default.nix
|
|
index a5898a3ac007..543ac143ca3e 100644
|
|
--- a/pkgs/applications/graphics/nomacs/default.nix
|
|
+++ b/pkgs/applications/graphics/nomacs/default.nix
|
|
@@ -15,6 +15,10 @@
|
|
, libraw
|
|
, libtiff
|
|
, quazip
|
|
+
|
|
+, config
|
|
+, cudaSupport ? config.cudaSupport
|
|
+, cudatoolkit
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
@@ -34,7 +38,8 @@ stdenv.mkDerivation rec {
|
|
|
|
nativeBuildInputs = [cmake
|
|
pkg-config
|
|
- wrapQtAppsHook];
|
|
+ wrapQtAppsHook]
|
|
+ ++ lib.optional cudaSupport [cudatoolkit];
|
|
|
|
buildInputs = [qtbase
|
|
qttools
|
|
diff --git a/pkgs/applications/networking/remote/xrdp/default.nix b/pkgs/applications/networking/remote/xrdp/default.nix
|
|
index bf3b8b64f1e7..7bd575f8631b 100644
|
|
--- a/pkgs/applications/networking/remote/xrdp/default.nix
|
|
+++ b/pkgs/applications/networking/remote/xrdp/default.nix
|
|
@@ -1,31 +1,55 @@
|
|
-{ lib, stdenv, fetchFromGitHub, applyPatches, pkg-config, which, perl, autoconf, automake, libtool, openssl, systemd, pam, fuse, libjpeg, libopus, nasm, xorg }:
|
|
+{ lib, stdenv, fetchFromGitHub, applyPatches, pkg-config, which, perl, autoconf, automake, libtool, openssl, systemd, pam, fuse, libjpeg, libopus, nasm, xorg, variant ? null, nvidiaBusId ? null, nvidiaPackage ? null, fetchgit, mesa, libdrm, fdk_aac, lame, pixman, x264, libepoxy, libglvnd }:
|
|
|
|
let
|
|
version = "0.9.23.1";
|
|
patchedXrdpSrc = applyPatches {
|
|
- patches = [ ./dynamic_config.patch ];
|
|
+ patches = [ ./dynamic_config${lib.optionalString (variant == "nvidia") "_nvidia"}.patch ];
|
|
name = "xrdp-patched-${version}";
|
|
- src = fetchFromGitHub {
|
|
- owner = "neutrinolabs";
|
|
- repo = "xrdp";
|
|
- rev = "v${version}";
|
|
- fetchSubmodules = true;
|
|
- hash = "sha256-fJKSEHB5X5QydKgRPjIMJzNaAy1EVJifHETSGmlJttQ=";
|
|
- };
|
|
+ src = fetchFromGitHub
|
|
+ (
|
|
+ { repo = "xrdp"; fetchSubmodules = true; }
|
|
+ // (
|
|
+ if variant == "nvidia" then
|
|
+ {
|
|
+ owner = "Nexarian";
|
|
+ rev = "f5103aa482f1b4f41a856adb1694929ed5b4936f";
|
|
+ hash = "sha256-jA3/zwjhBmmf6HnzDFLfVyt9qz6AomKDCxiWogIGwBo=";
|
|
+ }
|
|
+ else
|
|
+ {
|
|
+ owner = "neutrinolabs";
|
|
+ rev = "v${version}";
|
|
+ hash = "sha256-fJKSEHB5X5QydKgRPjIMJzNaAy1EVJifHETSGmlJttQ=";
|
|
+ }
|
|
+ )
|
|
+ );
|
|
};
|
|
|
|
xorgxrdp = stdenv.mkDerivation rec {
|
|
pname = "xorgxrdp";
|
|
version = "0.9.19";
|
|
|
|
- src = fetchFromGitHub {
|
|
- owner = "neutrinolabs";
|
|
- repo = "xorgxrdp";
|
|
- rev = "v${version}";
|
|
- hash = "sha256-WI1KyJDQkmNHwweZMbNd2KUfawaieoGMDMQfeD12cZs=";
|
|
- };
|
|
-
|
|
- nativeBuildInputs = [ pkg-config autoconf automake which libtool nasm ];
|
|
+ src = fetchFromGitHub
|
|
+ (
|
|
+ { repo = "xorgxrdp"; }
|
|
+ // (
|
|
+ if variant == "nvidia" then
|
|
+ {
|
|
+ owner = "Nexarian";
|
|
+ rev = "3d30c7a6ad4f4a582efcb919966d8f1508aa2d31";
|
|
+ hash = "sha256-gs8y9ntEgCnFwFInB7vGHiOk0zLXwgL/qsPOAvYaHbY=";
|
|
+ }
|
|
+ else
|
|
+ {
|
|
+ owner = "neutrinolabs";
|
|
+ rev = "v${version}";
|
|
+ hash = "sha256-WI1KyJDQkmNHwweZMbNd2KUfawaieoGMDMQfeD12cZs=";
|
|
+ }
|
|
+ )
|
|
+ );
|
|
+
|
|
+ nativeBuildInputs = [ pkg-config autoconf automake which libtool nasm ]
|
|
+ ++ (lib.optionals (variant == "glamor") [ mesa ]);
|
|
|
|
buildInputs = [ xorg.xorgserver ];
|
|
|
|
@@ -37,11 +61,16 @@ let
|
|
substituteInPlace configure.ac \
|
|
--replace 'moduledir=`pkg-config xorg-server --variable=moduledir`' "moduledir=$out/lib/xorg/modules" \
|
|
--replace 'sysconfdir="/etc"' "sysconfdir=$out/etc"
|
|
- '';
|
|
+ '' + (lib.optionalString (variant == "nvidia") ''
|
|
+ sed -i 's|BusID ".*"|BusID "PCI:${nvidiaBusId}"|g' xrdpdev/xorg_nvidia.conf
|
|
+ '');
|
|
|
|
preConfigure = "./bootstrap";
|
|
+ configureFlags = (lib.optionals (variant == "nvidia") [ "--with-simd" "--enable-lrandr" ])
|
|
+ ++ (lib.optionals (variant == "glamor") [ "--enable-glamor" ]);
|
|
|
|
- configureFlags = [ "XRDP_CFLAGS=-I${patchedXrdpSrc}/common" ];
|
|
+ XRDP_CFLAGS = "-I${patchedXrdpSrc}/common"
|
|
+ + lib.optionalString (variant == "glamor") " -I${libdrm.dev}/include/libdrm";
|
|
|
|
enableParallelBuilding = true;
|
|
};
|
|
@@ -53,22 +82,27 @@ let
|
|
|
|
nativeBuildInputs = [ pkg-config autoconf automake which libtool nasm perl ];
|
|
|
|
- buildInputs = [ openssl systemd pam fuse libjpeg libopus xorg.libX11 xorg.libXfixes xorg.libXrandr ];
|
|
+ buildInputs = [ openssl systemd pam fuse libjpeg libopus xorg.libX11 xorg.libXfixes xorg.libXrandr ]
|
|
+ ++ (lib.optionals (variant == "nvidia") [ fdk_aac lame pixman x264 libepoxy.dev libglvnd.dev ]);
|
|
|
|
- postPatch = ''
|
|
- substituteInPlace sesman/xauth.c --replace "xauth -q" "${xorg.xauth}/bin/xauth -q"
|
|
- '';
|
|
+ postPatch =
|
|
+ let file = "sesman${lib.optionalString (variant == "nvidia") "/sesexec"}/xauth.c";
|
|
+ in ''substituteInPlace ${file} --replace "xauth -q" "${xorg.xauth}/bin/xauth -q"'';
|
|
|
|
preConfigure = ''
|
|
(cd librfxcodec && ./bootstrap && ./configure --prefix=$out --enable-static --disable-shared)
|
|
./bootstrap
|
|
'';
|
|
dontDisableStatic = true;
|
|
- configureFlags = [ "--with-systemdsystemunitdir=/var/empty" "--enable-ipv6" "--enable-jpeg" "--enable-fuse" "--enable-rfxcodec" "--enable-opus" "--enable-pam-config=unix" ];
|
|
+ configureFlags = [ "--with-systemdsystemunitdir=/var/empty" "--enable-ipv6" "--enable-jpeg" "--enable-fuse" "--enable-rfxcodec" "--enable-opus" "--enable-pam-config=unix" ]
|
|
+ ++ lib.optionals (variant == "nvidia") [ "--enable-pixman" "--enable-mp3lame" "--enable-nvenc" "--enable-sound" "--enable-fdkaac" "--enable-x264" ];
|
|
|
|
installFlags = [ "DESTDIR=$(out)" "prefix=" ];
|
|
|
|
- postInstall = ''
|
|
+ postInstall =
|
|
+ let nvidiaModule = lib.optionalString (variant == "nvidia") ",${nvidiaPackage.bin}/lib/xorg/modules";
|
|
+ in
|
|
+ ''
|
|
# remove generated keys (as non-deterministic)
|
|
rm $out/etc/xrdp/{rsakeys.ini,key.pem,cert.pem}
|
|
|
|
@@ -87,9 +121,9 @@ let
|
|
[Xorg]
|
|
param=${xorg.xorgserver}/bin/Xorg
|
|
param=-modulepath
|
|
- param=${xorgxrdp}/lib/xorg/modules,${xorg.xorgserver}/lib/xorg/modules
|
|
+ param=${xorgxrdp}/lib/xorg/modules,${xorg.xorgserver}/lib/xorg/modules${nvidiaModule}
|
|
param=-config
|
|
- param=${xorgxrdp}/etc/X11/xrdp/xorg.conf
|
|
+ param=${xorgxrdp}/etc/X11/xrdp/xorg${lib.optionalString (variant == "nvidia") "_nvidia"}.conf
|
|
param=-noreset
|
|
param=-nolisten
|
|
param=tcp
|
|
diff --git a/pkgs/applications/networking/remote/xrdp/dynamic_config_nvidia.patch b/pkgs/applications/networking/remote/xrdp/dynamic_config_nvidia.patch
|
|
new file mode 100644
|
|
index 000000000000..f0d6dd8d4678
|
|
--- /dev/null
|
|
+++ b/pkgs/applications/networking/remote/xrdp/dynamic_config_nvidia.patch
|
|
@@ -0,0 +1,373 @@
|
|
+diff --git a/common/xrdp_client_info.h b/common/xrdp_client_info.h
|
|
+index f45195e8..b87ae64e 100644
|
|
+--- a/common/xrdp_client_info.h
|
|
++++ b/common/xrdp_client_info.h
|
|
+@@ -148,6 +148,9 @@ struct xrdp_client_info
|
|
+
|
|
+ char certificate[1024];
|
|
+ char key_file[1024];
|
|
++ char rsakeys_ini_file[256];
|
|
++ char xrdp_keyboard_ini_file[256];
|
|
++ char keymaps_path[256];
|
|
+
|
|
+ /* X11 keyboard layout - inferred from keyboard type/subtype */
|
|
+ char model[16];
|
|
+diff --git a/libxrdp/xrdp_rdp.c b/libxrdp/xrdp_rdp.c
|
|
+index d08f068a..cc7a173d 100644
|
|
+--- a/libxrdp/xrdp_rdp.c
|
|
++++ b/libxrdp/xrdp_rdp.c
|
|
+@@ -27,6 +27,7 @@
|
|
+ #include "log.h"
|
|
+ #include "ssl_calls.h"
|
|
+ #include "string_calls.h"
|
|
++#include <string.h>
|
|
+
|
|
+ #if defined(XRDP_NEUTRINORDP)
|
|
+ #include <freerdp/codec/rfx.h>
|
|
+@@ -46,10 +47,21 @@ xrdp_rdp_read_config(const char *xrdp_ini, struct xrdp_client_info *client_info)
|
|
+ struct list *values = (struct list *)NULL;
|
|
+ char *item = NULL;
|
|
+ char *value = NULL;
|
|
++ char cfg_dir[256];
|
|
+ int pos;
|
|
+ char *tmp = NULL;
|
|
+ int tmp_length = 0;
|
|
+
|
|
++ g_strncpy(cfg_dir, xrdp_ini, 255);
|
|
++ *(strrchr(cfg_dir, '/')) = 0;
|
|
++
|
|
++ /* default location is next to xrdp.ini */
|
|
++ g_snprintf(client_info->certificate, 1023, "%s/cert.pem", cfg_dir);
|
|
++ g_snprintf(client_info->key_file, 1023, "%s/key.pem", cfg_dir);
|
|
++ g_snprintf(client_info->xrdp_keyboard_ini_file, 255, "%s/xrdp_keyboard.ini", cfg_dir);
|
|
++ g_snprintf(client_info->rsakeys_ini_file, 255, "%s/rsakeys.ini", cfg_dir);
|
|
++ g_snprintf(client_info->keymaps_path, 255, "%s", cfg_dir);
|
|
++
|
|
+ client_info->xrdp_keyboard_overrides.type = -1;
|
|
+ client_info->xrdp_keyboard_overrides.subtype = -1;
|
|
+ client_info->xrdp_keyboard_overrides.layout = -1;
|
|
+@@ -253,14 +265,14 @@ xrdp_rdp_read_config(const char *xrdp_ini, struct xrdp_client_info *client_info)
|
|
+ if (g_strlen(value) == 0)
|
|
+ {
|
|
+ /* default key_file path */
|
|
+- g_snprintf(client_info->key_file, 1023, "%s/key.pem", XRDP_CFG_PATH);
|
|
++ g_snprintf(client_info->key_file, 1023, "%s/key.pem", cfg_dir);
|
|
+ LOG(LOG_LEVEL_INFO, "Using default X.509 key file: %s",
|
|
+ client_info->key_file);
|
|
+ }
|
|
+ else if (value[0] != '/')
|
|
+ {
|
|
+ /* default key_file path */
|
|
+- g_snprintf(client_info->key_file, 1023, "%s/key.pem", XRDP_CFG_PATH);
|
|
++ g_snprintf(client_info->key_file, 1023, "%s/key.pem", cfg_dir);
|
|
+ LOG(LOG_LEVEL_WARNING,
|
|
+ "X.509 key file should use absolute path, using "
|
|
+ "default instead: %s", client_info->key_file);
|
|
+@@ -277,6 +289,51 @@ xrdp_rdp_read_config(const char *xrdp_ini, struct xrdp_client_info *client_info)
|
|
+ client_info->key_file, g_get_strerror());
|
|
+ }
|
|
+ }
|
|
++ else if (g_strcasecmp(item, "rsakeys_ini") == 0)
|
|
++ {
|
|
++ if (value[0] != '/')
|
|
++ {
|
|
++ g_snprintf(client_info->rsakeys_ini_file, 255, "%s/rsakeys.ini", cfg_dir);
|
|
++ log_message(LOG_LEVEL_WARNING,
|
|
++ "rsakeys.ini file should use absolute path, using "
|
|
++ "default instead: %s", client_info->rsakeys_ini_file);
|
|
++ }
|
|
++ else
|
|
++ {
|
|
++ /* use user defined rsakeys.ini */
|
|
++ g_strncpy(client_info->rsakeys_ini_file, value, 255);
|
|
++ }
|
|
++ }
|
|
++ else if (g_strcasecmp(item, "xrdp_keyboard_ini") == 0)
|
|
++ {
|
|
++ if (value[0] != '/')
|
|
++ {
|
|
++ g_snprintf(client_info->xrdp_keyboard_ini_file, 255, "%s/xrdp_keyboard.ini", cfg_dir);
|
|
++ log_message(LOG_LEVEL_WARNING,
|
|
++ "xrdp_keyboard.ini file should use absolute path, using "
|
|
++ "default instead: %s", client_info->xrdp_keyboard_ini_file);
|
|
++ }
|
|
++ else
|
|
++ {
|
|
++ /* use user defined xrdp_keyboard.ini */
|
|
++ g_strncpy(client_info->xrdp_keyboard_ini_file, value, 255);
|
|
++ }
|
|
++ }
|
|
++ else if (g_strcasecmp(item, "keymaps_path") == 0)
|
|
++ {
|
|
++ if (value[0] != '/')
|
|
++ {
|
|
++ g_snprintf(client_info->keymaps_path, 255, "%s", cfg_dir);
|
|
++ log_message(LOG_LEVEL_WARNING,
|
|
++ "keymaps_path should use absolute path, using "
|
|
++ "default instead: %s", client_info->keymaps_path);
|
|
++ }
|
|
++ else
|
|
++ {
|
|
++ /* use user defined xrdp_keyboard.ini */
|
|
++ g_strncpy(client_info->keymaps_path, value, 255);
|
|
++ }
|
|
++ }
|
|
+ else if (g_strcasecmp(item, "domain_user_separator") == 0
|
|
+ && g_strlen(value) > 0)
|
|
+ {
|
|
+diff --git a/libxrdp/xrdp_sec.c b/libxrdp/xrdp_sec.c
|
|
+index 8fa34aea..da94cf95 100644
|
|
+--- a/libxrdp/xrdp_sec.c
|
|
++++ b/libxrdp/xrdp_sec.c
|
|
+@@ -371,7 +371,6 @@ xrdp_load_keyboard_layout(struct xrdp_client_info *client_info)
|
|
+ char *item = (char *)NULL;
|
|
+ char *value = (char *)NULL;
|
|
+ char *q = (char *)NULL;
|
|
+- char keyboard_cfg_file[256] = { 0 };
|
|
+ char rdp_layout[256] = { 0 };
|
|
+
|
|
+ const struct xrdp_keyboard_overrides *ko =
|
|
+@@ -419,10 +418,9 @@ xrdp_load_keyboard_layout(struct xrdp_client_info *client_info)
|
|
+ client_info->keyboard_subtype = 1;
|
|
+ }
|
|
+
|
|
+- g_snprintf(keyboard_cfg_file, 255, "%s/xrdp_keyboard.ini", XRDP_CFG_PATH);
|
|
+- LOG(LOG_LEVEL_DEBUG, "keyboard_cfg_file %s", keyboard_cfg_file);
|
|
++ LOG(LOG_LEVEL_DEBUG, "keyboard_cfg_file %s", client_info->xrdp_keyboard_ini_file);
|
|
+
|
|
+- fd = g_file_open_ro(keyboard_cfg_file);
|
|
++ fd = g_file_open_ro(client_info->xrdp_keyboard_ini_file);
|
|
+
|
|
+ if (fd >= 0)
|
|
+ {
|
|
+@@ -594,7 +592,7 @@ xrdp_load_keyboard_layout(struct xrdp_client_info *client_info)
|
|
+ else
|
|
+ {
|
|
+ LOG(LOG_LEVEL_ERROR, "xrdp_load_keyboard_layout: error opening %s",
|
|
+- keyboard_cfg_file);
|
|
++ client_info->xrdp_keyboard_ini_file);
|
|
+ }
|
|
+ }
|
|
+
|
|
+@@ -2759,7 +2757,6 @@ xrdp_sec_incoming(struct xrdp_sec *self)
|
|
+ int index = 0;
|
|
+ char *item = NULL;
|
|
+ char *value = NULL;
|
|
+- char key_file[256];
|
|
+
|
|
+ iso = self->mcs_layer->iso_layer;
|
|
+
|
|
+@@ -2805,19 +2802,17 @@ xrdp_sec_incoming(struct xrdp_sec *self)
|
|
+ LOG(LOG_LEVEL_DEBUG, "Using RDP security, and "
|
|
+ "reading the server configuration");
|
|
+
|
|
+- g_memset(key_file, 0, sizeof(char) * 256);
|
|
+ g_random(self->server_random, 32);
|
|
+ items = list_create();
|
|
+ items->auto_free = 1;
|
|
+ values = list_create();
|
|
+ values->auto_free = 1;
|
|
+- g_snprintf(key_file, 255, "%s/rsakeys.ini", XRDP_CFG_PATH);
|
|
+
|
|
+- if (file_by_name_read_section(key_file, "keys", items, values) != 0)
|
|
++ if (file_by_name_read_section(self->rdp_layer->client_info.rsakeys_ini_file, "keys", items, values) != 0)
|
|
+ {
|
|
+ /* this is a show stopper */
|
|
+ LOG(LOG_LEVEL_ERROR, "XRDP cannot read file: %s "
|
|
+- "(check permissions)", key_file);
|
|
++ "(check permissions)", self->rdp_layer->client_info.rsakeys_ini_file);
|
|
+ list_delete(items);
|
|
+ list_delete(values);
|
|
+ return 1;
|
|
+diff --git a/sesman/libsesman/sesman_config.c b/sesman/libsesman/sesman_config.c
|
|
+index 9e3d9e72..1f064731 100644
|
|
+--- a/sesman/libsesman/sesman_config.c
|
|
++++ b/sesman/libsesman/sesman_config.c
|
|
+@@ -39,6 +39,7 @@
|
|
+ #include "string_calls.h"
|
|
+ //#include "chansrv/chansrv_common.h"
|
|
+ #include "scp.h"
|
|
++#include <string.h>
|
|
+
|
|
+ #define SESMAN_CFG_GLOBALS "Globals"
|
|
+ #define SESMAN_CFG_DEFWM "DefaultWindowManager"
|
|
+@@ -171,7 +172,7 @@ config_output_policy_string(unsigned int value,
|
|
+ *
|
|
+ */
|
|
+ static int
|
|
+-config_read_globals(int file, struct config_sesman *cf, struct list *param_n,
|
|
++config_read_globals(const char *base_dir, int file, struct config_sesman *cf, struct list *param_n,
|
|
+ struct list *param_v)
|
|
+ {
|
|
+ int i;
|
|
+@@ -249,14 +250,12 @@ config_read_globals(int file, struct config_sesman *cf, struct list *param_n,
|
|
+ cf->default_wm = g_strdup("startwm.sh");
|
|
+ }
|
|
+ /* if default_wm doesn't begin with '/', it's a relative path to
|
|
+- * XRDP_CFG_PATH */
|
|
++ * base_dir */
|
|
+ if (cf->default_wm[0] != '/')
|
|
+ {
|
|
+ /* sizeof operator returns string length including null terminator */
|
|
+- int length = (sizeof(XRDP_CFG_PATH) +
|
|
+- g_strlen(cf->default_wm) + 1); /* '/' */
|
|
+- char *buf = (char *)g_malloc(length, 0);
|
|
+- g_sprintf(buf, "%s/%s", XRDP_CFG_PATH, cf->default_wm);
|
|
++ char *buf = (char *)g_malloc(g_strlen(base_dir) + 1 + g_strlen(cf->default_wm) + 1, 0);
|
|
++ g_sprintf(buf, "%s/%s", base_dir, cf->default_wm);
|
|
+ g_free(cf->default_wm);
|
|
+ cf->default_wm = buf;
|
|
+ }
|
|
+@@ -270,11 +269,8 @@ config_read_globals(int file, struct config_sesman *cf, struct list *param_n,
|
|
+ * XRDP_CFG_PATH */
|
|
+ if (cf->reconnect_sh[0] != '/')
|
|
+ {
|
|
+- /* sizeof operator returns string length including null terminator */
|
|
+- int length = (sizeof(XRDP_CFG_PATH) +
|
|
+- g_strlen(cf->reconnect_sh) + 1); /* '/' */
|
|
+- char *buf = (char *)g_malloc(length, 0);
|
|
+- g_sprintf(buf, "%s/%s", XRDP_CFG_PATH, cf->reconnect_sh);
|
|
++ char *buf = (char *)g_malloc(g_strlen(base_dir) + 1 + g_strlen(cf->reconnect_sh) + 1, 0);
|
|
++ g_sprintf(buf, "%s/%s", base_dir, cf->reconnect_sh);
|
|
+ g_free(cf->reconnect_sh);
|
|
+ cf->reconnect_sh = buf;
|
|
+ }
|
|
+@@ -580,6 +576,7 @@ struct config_sesman *
|
|
+ config_read(const char *sesman_ini)
|
|
+ {
|
|
+ struct config_sesman *cfg;
|
|
++ char cfg_dir[256];
|
|
+ int all_ok = 0;
|
|
+
|
|
+ if ((cfg = g_new0(struct config_sesman, 1)) != NULL)
|
|
+@@ -602,8 +599,9 @@ config_read(const char *sesman_ini)
|
|
+ all_ok = 1;
|
|
+
|
|
+ /* read global config */
|
|
+- config_read_globals(fd, cfg, param_n, param_v);
|
|
+-
|
|
++ g_strcpy(cfg_dir, sesman_ini);
|
|
++ *(strrchr(cfg_dir, '/')) = 0; // cfg_file validated to contain '/'
|
|
++ config_read_globals(cfg_dir, fd, cfg, param_n, param_v);
|
|
+ /* read Xvnc/Xorg parameter list */
|
|
+ config_read_vnc_params(fd, cfg, param_n, param_v);
|
|
+ config_read_xorg_params(fd, cfg, param_n, param_v);
|
|
+diff --git a/xrdp/lang.c b/xrdp/lang.c
|
|
+index e4c18077..06f92997 100644
|
|
+--- a/xrdp/lang.c
|
|
++++ b/xrdp/lang.c
|
|
+@@ -229,7 +229,7 @@ km_read_section(int fd, const char *section_name, struct xrdp_key_info *keymap)
|
|
+
|
|
+ /*****************************************************************************/
|
|
+ int
|
|
+-get_keymaps(int keylayout, struct xrdp_keymap *keymap)
|
|
++get_keymaps(const char* keymaps_path, int keylayout, struct xrdp_keymap *keymap)
|
|
+ {
|
|
+ int fd;
|
|
+ int basic_key_layout = keylayout & 0x0000ffff;
|
|
+@@ -239,21 +239,21 @@ get_keymaps(int keylayout, struct xrdp_keymap *keymap)
|
|
+ filename = (char *)g_malloc(256, 0);
|
|
+
|
|
+ /* check if there is a keymap file e.g. km-e00100411.ini */
|
|
+- g_snprintf(filename, 255, "%s/km-%08x.ini", XRDP_CFG_PATH, keylayout);
|
|
++ g_snprintf(filename, 255, "%s/km-%08x.ini", keymaps_path, keylayout);
|
|
+
|
|
+ /* if the file does not exist, use only lower 16 bits instead */
|
|
+ if (!g_file_exist(filename))
|
|
+ {
|
|
+ LOG(LOG_LEVEL_WARNING, "Cannot find keymap file %s", filename);
|
|
+ /* e.g. km-00000411.ini */
|
|
+- g_snprintf(filename, 255, "%s/km-%08x.ini", XRDP_CFG_PATH, basic_key_layout);
|
|
++ g_snprintf(filename, 255, "%s/km-%08x.ini", keymaps_path, basic_key_layout);
|
|
+ }
|
|
+
|
|
+ /* finally, use 'en-us' */
|
|
+ if (!g_file_exist(filename))
|
|
+ {
|
|
+ LOG(LOG_LEVEL_WARNING, "Cannot find keymap file %s", filename);
|
|
+- g_snprintf(filename, 255, "%s/km-00000409.ini", XRDP_CFG_PATH);
|
|
++ g_snprintf(filename, 255, "%s/km-00000409.ini", keymaps_path);
|
|
+ }
|
|
+
|
|
+ if (g_file_exist(filename))
|
|
+diff --git a/xrdp/xrdp.c b/xrdp/xrdp.c
|
|
+index e91672fb..37cef0c0 100644
|
|
+--- a/xrdp/xrdp.c
|
|
++++ b/xrdp/xrdp.c
|
|
+@@ -384,7 +384,6 @@ xrdp_sanity_check(void)
|
|
+ {
|
|
+ int intval = 1;
|
|
+ int host_be;
|
|
+- const char *key_file = XRDP_CFG_PATH "/rsakeys.ini";
|
|
+
|
|
+ /* check compiled endian with actual endian */
|
|
+ host_be = !((int)(*(unsigned char *)(&intval)));
|
|
+@@ -429,12 +428,6 @@ xrdp_sanity_check(void)
|
|
+ return 1;
|
|
+ }
|
|
+
|
|
+- if (!g_file_exist(key_file))
|
|
+- {
|
|
+- g_writeln("File %s is missing, create it using xrdp-keygen", key_file);
|
|
+- return 1;
|
|
+- }
|
|
+-
|
|
+ return 0;
|
|
+ }
|
|
+
|
|
+diff --git a/xrdp/xrdp.h b/xrdp/xrdp.h
|
|
+index 36d8f87a..687b9dd5 100644
|
|
+--- a/xrdp/xrdp.h
|
|
++++ b/xrdp/xrdp.h
|
|
+@@ -380,7 +380,7 @@ get_char_from_scan_code(int device_flags, int scan_code, int *keys,
|
|
+ int caps_lock, int num_lock, int scroll_lock,
|
|
+ struct xrdp_keymap *keymap);
|
|
+ int
|
|
+-get_keymaps(int keylayout, struct xrdp_keymap *keymap);
|
|
++get_keymaps(const char* keymaps_path, int keylayout, struct xrdp_keymap *keymap);
|
|
+
|
|
+ /* xrdp_login_wnd.c */
|
|
+ int
|
|
+diff --git a/xrdp/xrdp.ini.in b/xrdp/xrdp.ini.in
|
|
+index 3b6340f8..c05e2930 100644
|
|
+--- a/xrdp/xrdp.ini.in
|
|
++++ b/xrdp/xrdp.ini.in
|
|
+@@ -52,6 +52,12 @@ crypt_level=high
|
|
+ ; openssl req -x509 -newkey rsa:2048 -nodes -keyout key.pem -out cert.pem -days 365
|
|
+ certificate=
|
|
+ key_file=
|
|
++;directory with km-*.ini files; default is the directory of xrdp.ini
|
|
++#keymaps_path=
|
|
++;location of xrdp_keyboard_ini; default next to xrdp.ini
|
|
++#xrdp_keyboard_ini=
|
|
++;location of rsakeys.ini; default next to xrdp.ini
|
|
++#rsakeys_ini=
|
|
+
|
|
+ ; set SSL protocols
|
|
+ ; can be comma separated list of 'SSLv3', 'TLSv1', 'TLSv1.1', 'TLSv1.2', 'TLSv1.3'
|
|
+diff --git a/xrdp/xrdp_wm.c b/xrdp/xrdp_wm.c
|
|
+index 94691582..602b3ca6 100644
|
|
+--- a/xrdp/xrdp_wm.c
|
|
++++ b/xrdp/xrdp_wm.c
|
|
+@@ -64,7 +64,7 @@ xrdp_wm_create(struct xrdp_process *owner,
|
|
+ self->mm = xrdp_mm_create(self);
|
|
+ self->default_font = xrdp_font_create(self);
|
|
+ /* this will use built in keymap or load from file */
|
|
+- get_keymaps(self->session->client_info->keylayout, &(self->keymap));
|
|
++ get_keymaps(client_info->keymaps_path, self->session->client_info->keylayout, &(self->keymap));
|
|
+ xrdp_wm_set_login_state(self, WMLS_RESET);
|
|
+ self->target_surface = self->screen;
|
|
+ self->current_surface_index = 0xffff; /* screen */
|
|
+diff --git a/xup/xup.c b/xup/xup.c
|
|
+index e67d9477..8bc718a0 100644
|
|
+--- a/xup/xup.c
|
|
++++ b/xup/xup.c
|
|
+@@ -318,7 +318,7 @@ lib_mod_event(struct mod *mod, int msg, tbus param1, tbus param2,
|
|
+ msg param1 param2 param3 param4
|
|
+ 15 0 65507 29 0
|
|
+ 16 0 65507 29 49152 */
|
|
+- init_stream(s, 8192);
|
|
++ init_stream(s, (int)sizeof(mod->client_info) < 8192 ? 8192 : (int)sizeof(mod->client_info));
|
|
+ s_push_layer(s, iso_hdr, 4);
|
|
+ out_uint16_le(s, 103);
|
|
+ out_uint32_le(s, 16); /* key up */
|
|
diff --git a/pkgs/applications/office/libreoffice/default.nix b/pkgs/applications/office/libreoffice/default.nix
|
|
index 6be1d11ae3b6..107fe8efd91c 100644
|
|
--- a/pkgs/applications/office/libreoffice/default.nix
|
|
+++ b/pkgs/applications/office/libreoffice/default.nix
|
|
@@ -396,6 +396,8 @@ in stdenv.mkDerivation (finalAttrs: {
|
|
sed -e '/CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pPage3Objs->size());/d' -i './sw/qa/core/text/porrst.cxx'
|
|
sed -e '/CPPUNIT_ASSERT(pPage4Objs);/d' -i './sw/qa/core/text/porrst.cxx'
|
|
sed -e '/CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pPage4Objs->size());/d' -i './sw/qa/core/text/porrst.cxx'
|
|
+ '' + optionalString (builtins.elem stdenv.hostPlatform.gcc.arch or null [ "skylake" "znver3" ]) ''
|
|
+ sed -e '/CPPUNIT_TEST(testDubiousArrayFormulasFODS);/d' -i './sc/qa/unit/functions_array.cxx'
|
|
'';
|
|
|
|
makeFlags = [ "SHELL=${bash}/bin/bash" ];
|
|
diff --git a/pkgs/development/haskell-modules/hackage-packages.nix b/pkgs/development/haskell-modules/hackage-packages.nix
|
|
index 98b41b222c4e..bd58a1f8d523 100644
|
|
--- a/pkgs/development/haskell-modules/hackage-packages.nix
|
|
+++ b/pkgs/development/haskell-modules/hackage-packages.nix
|
|
@@ -77035,7 +77035,7 @@ self: {
|
|
"crypton" = callPackage
|
|
({ mkDerivation, base, basement, bytestring, deepseq, gauge
|
|
, ghc-prim, integer-gmp, memory, random, tasty, tasty-hunit
|
|
- , tasty-kat, tasty-quickcheck
|
|
+ , tasty-kat, tasty-quickcheck, stdenv
|
|
}:
|
|
mkDerivation {
|
|
pname = "crypton";
|
|
@@ -77052,6 +77052,7 @@ self: {
|
|
];
|
|
description = "Cryptography Primitives sink";
|
|
license = lib.licenses.bsd3;
|
|
+ configureFlags = if stdenv.hostPlatform.avx2Support then [ "--ghc-option=-optc-mno-avx2" ] else [];
|
|
}) {};
|
|
|
|
"crypton_0_34" = callPackage
|
|
@@ -77202,7 +77203,7 @@ self: {
|
|
"cryptonite" = callPackage
|
|
({ mkDerivation, base, basement, bytestring, deepseq, gauge
|
|
, ghc-prim, integer-gmp, memory, random, tasty, tasty-hunit
|
|
- , tasty-kat, tasty-quickcheck
|
|
+ , tasty-kat, tasty-quickcheck, stdenv
|
|
}:
|
|
mkDerivation {
|
|
pname = "cryptonite";
|
|
@@ -77219,6 +77220,7 @@ self: {
|
|
];
|
|
description = "Cryptography Primitives sink";
|
|
license = lib.licenses.bsd3;
|
|
+ configureFlags = if stdenv.hostPlatform.avx2Support then [ "--ghc-option=-optc-mno-avx2" ] else [];
|
|
}) {};
|
|
|
|
"cryptonite-cd" = callPackage
|
|
diff --git a/pkgs/development/libraries/fflas-ffpack/default.nix b/pkgs/development/libraries/fflas-ffpack/default.nix
|
|
index 7dadbcb39502..540d1177684a 100644
|
|
--- a/pkgs/development/libraries/fflas-ffpack/default.nix
|
|
+++ b/pkgs/development/libraries/fflas-ffpack/default.nix
|
|
@@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
|
|
"--${if stdenv.hostPlatform.fmaSupport then "enable" else "disable"}-fma"
|
|
"--${if stdenv.hostPlatform.fma4Support then "enable" else "disable"}-fma4"
|
|
];
|
|
- doCheck = true;
|
|
+ doCheck = stdenv.hostPlatform.gcc.arch or null != "silvermont";
|
|
|
|
meta = with lib; {
|
|
broken = stdenv.isDarwin;
|
|
diff --git a/pkgs/development/libraries/gdal/default.nix b/pkgs/development/libraries/gdal/default.nix
|
|
index 28f083c31b10..b64589691db1 100644
|
|
--- a/pkgs/development/libraries/gdal/default.nix
|
|
+++ b/pkgs/development/libraries/gdal/default.nix
|
|
@@ -246,6 +246,8 @@ stdenv.mkDerivation (finalAttrs: {
|
|
"test_ogr_parquet_write_crs_without_id_in_datum_ensemble_members"
|
|
] ++ lib.optionals (!usePoppler) [
|
|
"test_pdf_jpx_compression"
|
|
+ ] ++ lib.optionals (builtins.elem stdenv.hostPlatform.gcc.arch or null [ "skylake" "znver3" ]) [
|
|
+ "test_jp2openjpeg_22"
|
|
];
|
|
postCheck = ''
|
|
popd # autotest
|
|
diff --git a/pkgs/development/libraries/lib2geom/default.nix b/pkgs/development/libraries/lib2geom/default.nix
|
|
index a223fc38fb9a..5d80b97dad44 100644
|
|
--- a/pkgs/development/libraries/lib2geom/default.nix
|
|
+++ b/pkgs/development/libraries/lib2geom/default.nix
|
|
@@ -77,7 +77,7 @@ stdenv.mkDerivation rec {
|
|
# TODO: Update cmake hook to make it simpler to selectively disable cmake tests: #113829
|
|
checkPhase = let
|
|
disabledTests =
|
|
- lib.optionals stdenv.isAarch64 [
|
|
+ lib.optionals (stdenv.isAarch64 || builtins.elem stdenv.hostPlatform.gcc.arch or null [ "skylake" "znver3" ]) [
|
|
# Broken on all platforms, test just accidentally passes on some.
|
|
# https://gitlab.com/inkscape/lib2geom/-/issues/63
|
|
"elliptical-arc-test"
|
|
diff --git a/pkgs/development/libraries/linbox/default.nix b/pkgs/development/libraries/linbox/default.nix
|
|
index 6367b93b1a21..90415c9adf17 100644
|
|
--- a/pkgs/development/libraries/linbox/default.nix
|
|
+++ b/pkgs/development/libraries/linbox/default.nix
|
|
@@ -55,7 +55,7 @@ stdenv.mkDerivation rec {
|
|
# https://github.com/linbox-team/linbox/issues/304
|
|
hardeningDisable = [ "fortify3" ];
|
|
|
|
- doCheck = true;
|
|
+ doCheck = stdenv.hostPlatform.gcc.arch or null != "silvermont";
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
diff --git a/pkgs/development/libraries/opencolorio/default.nix b/pkgs/development/libraries/opencolorio/default.nix
|
|
index 496d68c33018..8f23393e69fb 100644
|
|
--- a/pkgs/development/libraries/opencolorio/default.nix
|
|
+++ b/pkgs/development/libraries/opencolorio/default.nix
|
|
@@ -84,7 +84,8 @@ stdenv.mkDerivation rec {
|
|
++ lib.optional (!buildApps) "-DOCIO_BUILD_APPS=OFF";
|
|
|
|
# precision issues on non-x86
|
|
- doCheck = stdenv.isx86_64;
|
|
+ #TODO: use upcoming ctest hook
|
|
+ doCheck = stdenv.isx86_64 && !builtins.elem stdenv.hostPlatform.gcc.arch or null [ "skylake" "znver3" ];
|
|
# Tends to fail otherwise.
|
|
enableParallelChecking = false;
|
|
|
|
diff --git a/pkgs/development/libraries/xdg-desktop-portal/default.nix b/pkgs/development/libraries/xdg-desktop-portal/default.nix
|
|
index 75a5669adf70..cd54510989e2 100644
|
|
--- a/pkgs/development/libraries/xdg-desktop-portal/default.nix
|
|
+++ b/pkgs/development/libraries/xdg-desktop-portal/default.nix
|
|
@@ -72,7 +72,8 @@ stdenv.mkDerivation (finalAttrs: {
|
|
pkg-config
|
|
wrapGAppsHook
|
|
xmlto
|
|
- ];
|
|
+ ] ++ lib.optionals (builtins.elem stdenv.hostPlatform.gcc.arch or null [ "skylake" "silvermont" "znver4" ])
|
|
+ finalAttrs.nativeCheckInputs;
|
|
|
|
buildInputs = [
|
|
flatpak
|
|
@@ -112,7 +113,8 @@ stdenv.mkDerivation (finalAttrs: {
|
|
"-Dgeoclue=disabled"
|
|
];
|
|
|
|
- doCheck = true;
|
|
+ # TODO: only disable failed test
|
|
+ doCheck = !(builtins.elem stdenv.hostPlatform.gcc.arch or null [ "skylake" "silvermont" "znver4" ]);
|
|
|
|
preCheck = ''
|
|
# For test_trash_file
|
|
diff --git a/pkgs/development/python-modules/eventlet/default.nix b/pkgs/development/python-modules/eventlet/default.nix
|
|
index 3a91424c6f27..74edb1031c98 100644
|
|
--- a/pkgs/development/python-modules/eventlet/default.nix
|
|
+++ b/pkgs/development/python-modules/eventlet/default.nix
|
|
@@ -73,7 +73,15 @@ buildPythonPackage rec {
|
|
"test_sendall_timeout"
|
|
# broken on aarch64 and when using march in gcc
|
|
"test_fork_after_monkey_patch"
|
|
- ];
|
|
+ ]
|
|
+ ++ lib.optionals
|
|
+ (builtins.elem stdenv.hostPlatform.gcc.arch or null
|
|
+ [ "sandybridge" "silvermont" "broadwell" "skylake" "znver3" "znver4" ])
|
|
+ [
|
|
+ "test_invalid_connection"
|
|
+ "test_nonblocking_accept_mark_as_reopened"
|
|
+ "test_full_duplex"
|
|
+ ];
|
|
|
|
disabledTestPaths = [
|
|
# Tests are out-dated
|
|
diff --git a/pkgs/development/python-modules/pandas/default.nix b/pkgs/development/python-modules/pandas/default.nix
|
|
index 588dae7b7840..e9137aa84f56 100644
|
|
--- a/pkgs/development/python-modules/pandas/default.nix
|
|
+++ b/pkgs/development/python-modules/pandas/default.nix
|
|
@@ -222,9 +222,18 @@ buildPythonPackage rec {
|
|
"test_binops"
|
|
# These tests are unreliable on aarch64-darwin. See https://github.com/pandas-dev/pandas/issues/38921.
|
|
"test_rolling"
|
|
- ] ++ lib.optional stdenv.is32bit [
|
|
+ ] ++ lib.optional (stdenv.is32bit || builtins.elem stdenv.hostPlatform.gcc.arch or null
|
|
+ [ "skylake" "broadwell" "znver3" ] ) [
|
|
# https://github.com/pandas-dev/pandas/issues/37398
|
|
"test_rolling_var_numerical_issues"
|
|
+ ] ++ lib.optional (builtins.elem stdenv.hostPlatform.gcc.arch or null [ "znver4" ]) [
|
|
+ "test_quantile_datetime"
|
|
+ "test_datelike_numeric_only"
|
|
+ "test_idxmin_idxmax_returns_int_types"
|
|
+ "test_iloc_setitem_multicolumn_to_datetime"
|
|
+ "test_combine_first_dt64"
|
|
+ "test_guess_datetime_format_with_parseable_formats"
|
|
+ "test_nsmallest_nlargest"
|
|
];
|
|
|
|
# Tests have relative paths, and need to reference compiled C extensions
|
|
diff --git a/pkgs/development/python-modules/scipy/default.nix b/pkgs/development/python-modules/scipy/default.nix
|
|
index 2c5ecd42585c..74d14591c460 100644
|
|
--- a/pkgs/development/python-modules/scipy/default.nix
|
|
+++ b/pkgs/development/python-modules/scipy/default.nix
|
|
@@ -74,7 +74,8 @@ in buildPythonPackage {
|
|
"doc/source/dev/contributor/meson_advanced.rst"
|
|
];
|
|
})
|
|
- ];
|
|
+ ] ++ lib.optionals (builtins.elem stdenv.hostPlatform.gcc.arch or null [ "skylake" "broadwell" ])
|
|
+ [ ./disable-failed-tests.patch ];
|
|
|
|
# Relax deps a bit
|
|
postPatch = ''
|
|
diff --git a/pkgs/development/python-modules/scipy/disable-failed-tests.patch b/pkgs/development/python-modules/scipy/disable-failed-tests.patch
|
|
new file mode 100644
|
|
index 000000000000..8f1a2a5b14e8
|
|
--- /dev/null
|
|
+++ b/pkgs/development/python-modules/scipy/disable-failed-tests.patch
|
|
@@ -0,0 +1,79 @@
|
|
+diff --color -ur /var/cache/nix/nix-build-python3.10-scipy-1.11.1.drv-0/source/scipy/optimize/tests/test_optimize.py source/scipy/optimize/tests/test_optimize.py
|
|
+--- /var/cache/nix/nix-build-python3.10-scipy-1.11.1.drv-0/source/scipy/optimize/tests/test_optimize.py 1980-01-02 08:00:00.000000000 +0800
|
|
++++ source/scipy/optimize/tests/test_optimize.py 2023-08-29 12:30:51.928840728 +0800
|
|
+@@ -2804,75 +2804,6 @@
|
|
+ eb_data = setup_test_equal_bounds()
|
|
+
|
|
+
|
|
+-# This test is about handling fixed variables, not the accuracy of the solvers
|
|
+-@pytest.mark.xfail_on_32bit("Failures due to floating point issues, not logic")
|
|
+-@pytest.mark.parametrize('method', eb_data["methods"])
|
|
+-@pytest.mark.parametrize('kwds', eb_data["kwds"])
|
|
+-@pytest.mark.parametrize('bound_type', eb_data["bound_types"])
|
|
+-@pytest.mark.parametrize('constraints', eb_data["constraints"])
|
|
+-@pytest.mark.parametrize('callback', eb_data["callbacks"])
|
|
+-def test_equal_bounds(method, kwds, bound_type, constraints, callback):
|
|
+- """
|
|
+- Tests that minimizers still work if (bounds.lb == bounds.ub).any()
|
|
+- gh12502 - Divide by zero in Jacobian numerical differentiation when
|
|
+- equality bounds constraints are used
|
|
+- """
|
|
+- # GH-15051; slightly more skips than necessary; hopefully fixed by GH-14882
|
|
+- if (platform.machine() == 'aarch64' and method == "TNC"
|
|
+- and kwds["jac"] is False and callback is not None):
|
|
+- pytest.skip('Tolerance violation on aarch')
|
|
+-
|
|
+- lb, ub = eb_data["lb"], eb_data["ub"]
|
|
+- x0, i_eb = eb_data["x0"], eb_data["i_eb"]
|
|
+-
|
|
+- test_constraints, reference_constraints = constraints
|
|
+- if test_constraints and not method == 'SLSQP':
|
|
+- pytest.skip('Only SLSQP supports nonlinear constraints')
|
|
+- # reference constraints always have analytical jacobian
|
|
+- # if test constraints are not the same, we'll need finite differences
|
|
+- fd_needed = (test_constraints != reference_constraints)
|
|
+-
|
|
+- bounds = bound_type(lb, ub) # old- or new-style
|
|
+-
|
|
+- kwds.update({"x0": x0, "method": method, "bounds": bounds,
|
|
+- "constraints": test_constraints, "callback": callback})
|
|
+- res = optimize.minimize(**kwds)
|
|
+-
|
|
+- expected = optimize.minimize(optimize.rosen, x0, method=method,
|
|
+- jac=optimize.rosen_der, bounds=bounds,
|
|
+- constraints=reference_constraints)
|
|
+-
|
|
+- # compare the output of a solution with FD vs that of an analytic grad
|
|
+- assert res.success
|
|
+- assert_allclose(res.fun, expected.fun, rtol=1e-6)
|
|
+- assert_allclose(res.x, expected.x, rtol=5e-4)
|
|
+-
|
|
+- if fd_needed or kwds['jac'] is False:
|
|
+- expected.jac[i_eb] = np.nan
|
|
+- assert res.jac.shape[0] == 4
|
|
+- assert_allclose(res.jac[i_eb], expected.jac[i_eb], rtol=1e-6)
|
|
+-
|
|
+- if not (kwds['jac'] or test_constraints or isinstance(bounds, Bounds)):
|
|
+- # compare the output to an equivalent FD minimization that doesn't
|
|
+- # need factorization
|
|
+- def fun(x):
|
|
+- new_x = np.array([np.nan, 2, np.nan, -1])
|
|
+- new_x[[0, 2]] = x
|
|
+- return optimize.rosen(new_x)
|
|
+-
|
|
+- fd_res = optimize.minimize(fun,
|
|
+- x0[[0, 2]],
|
|
+- method=method,
|
|
+- bounds=bounds[::2])
|
|
+- assert_allclose(res.fun, fd_res.fun)
|
|
+- # TODO this test should really be equivalent to factorized version
|
|
+- # above, down to res.nfev. However, testing found that when TNC is
|
|
+- # called with or without a callback the output is different. The two
|
|
+- # should be the same! This indicates that the TNC callback may be
|
|
+- # mutating something when it should't.
|
|
+- assert_allclose(res.x[[0, 2]], fd_res.x, rtol=2e-6)
|
|
+-
|
|
+-
|
|
+ @pytest.mark.parametrize('method', eb_data["methods"])
|
|
+ def test_all_bounds_equal(method):
|
|
+ # this only tests methods that have parameters factored out when lb==ub
|
|
diff --git a/pkgs/os-specific/linux/firmware/fwupd/default.nix b/pkgs/os-specific/linux/firmware/fwupd/default.nix
|
|
index e96902a13029..4e062286ed77 100644
|
|
--- a/pkgs/os-specific/linux/firmware/fwupd/default.nix
|
|
+++ b/pkgs/os-specific/linux/firmware/fwupd/default.nix
|
|
@@ -233,7 +233,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|
# TODO: wrapGAppsHook wraps efi capsule even though it is not ELF
|
|
dontWrapGApps = true;
|
|
|
|
- doCheck = true;
|
|
+ doCheck = stdenv.hostPlatform.gcc.arch or null != "silvermont";
|
|
|
|
# Environment variables
|
|
|
|
diff --git a/pkgs/os-specific/linux/nvidia-x11/default.nix b/pkgs/os-specific/linux/nvidia-x11/default.nix
|
|
index bff844841dfa..f2280819e988 100644
|
|
--- a/pkgs/os-specific/linux/nvidia-x11/default.nix
|
|
+++ b/pkgs/os-specific/linux/nvidia-x11/default.nix
|
|
@@ -51,12 +51,12 @@ rec {
|
|
};
|
|
|
|
latest = selectHighestVersion production (generic {
|
|
- version = "545.29.02";
|
|
- sha256_64bit = "sha256-RncPlaSjhvBFUCOzWdXSE3PAfRPCIrWAXyJMdLPKuIU=";
|
|
- sha256_aarch64 = "sha256-Y2RDOuDtiIclr06gmLrPDfE5VFmFamXxiIIKtKAewro=";
|
|
- openSha256 = "sha256-PukpOBtG5KvZKWYfJHVQO6SuToJUd/rkjpOlEi8pSmk=";
|
|
- settingsSha256 = "sha256-zj173HCZJaxAbVV/A2sbJ9IPdT1+3yrwyxD+AQdkSD8=";
|
|
- persistencedSha256 = "sha256-mmMi2pfwzI1WYOffMVdD0N1HfbswTGg7o57x9/IiyVU=";
|
|
+ version = "545.29.06";
|
|
+ sha256_64bit = "sha256-grxVZ2rdQ0FsFG5wxiTI3GrxbMBMcjhoDFajDgBFsXs=";
|
|
+ sha256_aarch64 = "sha256-o6ZSjM4gHcotFe+nhFTePPlXm0+RFf64dSIDt+RmeeQ=";
|
|
+ openSha256 = "sha256-h4CxaU7EYvBYVbbdjiixBhKf096LyatU6/V6CeY9NKE=";
|
|
+ settingsSha256 = "sha256-YBaKpRQWSdXG8Usev8s3GYHCPqL8PpJeF6gpa2droWY=";
|
|
+ persistencedSha256 = "sha256-AiYrrOgMagIixu3Ss2rePdoL24CKORFvzgZY3jlNbwM=";
|
|
|
|
patches = [ rcu_patch linux_6_8_patch ];
|
|
|
|
diff --git a/pkgs/os-specific/linux/nvidia-x11/open.nix b/pkgs/os-specific/linux/nvidia-x11/open.nix
|
|
index 0625985c908f..a6795c3fd5e7 100644
|
|
--- a/pkgs/os-specific/linux/nvidia-x11/open.nix
|
|
+++ b/pkgs/os-specific/linux/nvidia-x11/open.nix
|
|
@@ -1,7 +1,6 @@
|
|
{ stdenv
|
|
, lib
|
|
, fetchFromGitHub
|
|
-, fetchpatch
|
|
, kernel
|
|
, nvidia_x11
|
|
, hash
|
|
@@ -19,13 +18,6 @@ stdenv.mkDerivation ({
|
|
inherit hash;
|
|
};
|
|
|
|
- patches = lib.optionals (nvidia_x11.version == "545.29.02")[
|
|
- (fetchpatch {
|
|
- url = "https://github.com/NVIDIA/open-gpu-kernel-modules/files/13310810/0001-nvkms-initialize-brightnessType-in-_BACKLIGHT_BRIGHT.patch.txt";
|
|
- hash = "sha256-9N+DbyT4VmGNTHXWf23PJU4YWZS+0JK7yqkmkpnINPk=";
|
|
- })
|
|
- ];
|
|
-
|
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
|
|
|
makeFlags = kernel.makeFlags ++ [
|
|
diff --git a/pkgs/servers/nosql/redis/default.nix b/pkgs/servers/nosql/redis/default.nix
|
|
index 8fd23ae186c4..b32aed27255e 100644
|
|
--- a/pkgs/servers/nosql/redis/default.nix
|
|
+++ b/pkgs/servers/nosql/redis/default.nix
|
|
@@ -51,7 +51,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isClang [ "-std=c11" ]);
|
|
|
|
# darwin currently lacks a pure `pgrep` which is extensively used here
|
|
- doCheck = !stdenv.isDarwin;
|
|
+ doCheck = !(stdenv.isDarwin || stdenv.hostPlatform.gcc.arch or null == "silvermont");
|
|
nativeCheckInputs = [ which tcl ps ] ++ lib.optionals stdenv.hostPlatform.isStatic [ getconf ];
|
|
checkPhase = ''
|
|
runHook preCheck
|
|
diff --git a/pkgs/tools/archivers/zip/fix-utf8-buffer-overflow.patch b/pkgs/tools/archivers/zip/fix-utf8-buffer-overflow.patch
|
|
new file mode 100644
|
|
index 000000000000..2ee3fff0db54
|
|
--- /dev/null
|
|
+++ b/pkgs/tools/archivers/zip/fix-utf8-buffer-overflow.patch
|
|
@@ -0,0 +1,12 @@
|
|
+diff -urp zip30/fileio.c zip30/fileio.c
|
|
+--- zip30/fileio.c 2008-05-29 03:13:24.000000000 +0300
|
|
++++ zip30/fileio.c 2023-05-02 12:19:50.488314853 +0300
|
|
+@@ -3502,7 +3502,7 @@ zwchar *local_to_wide_string(local_strin
|
|
+ if ((wc_string = (wchar_t *)malloc((wsize + 1) * sizeof(wchar_t))) == NULL) {
|
|
+ ZIPERR(ZE_MEM, "local_to_wide_string");
|
|
+ }
|
|
+- wsize = mbstowcs(wc_string, local_string, strlen(local_string) + 1);
|
|
++ wsize = mbstowcs(wc_string, local_string, wsize + 1);
|
|
+ wc_string[wsize] = (wchar_t) 0;
|
|
+
|
|
+ /* in case wchar_t is not zwchar */
|
|
diff --git a/pkgs/tools/typesetting/tex/texlive/tlpdb.nix b/pkgs/tools/typesetting/tex/texlive/tlpdb.nix
|
|
index 75501b601051..24f7215ad95d 100644
|
|
--- a/pkgs/tools/typesetting/tex/texlive/tlpdb.nix
|
|
+++ b/pkgs/tools/typesetting/tex/texlive/tlpdb.nix
|
|
@@ -7395,7 +7395,6 @@ collection-bibtexextra = {
|
|
"chicago-annote"
|
|
"chicagoa"
|
|
"chscite"
|
|
- "citation-style-language"
|
|
"citeall"
|
|
"citeref"
|
|
"collection-latex"
|
|
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
|
|
index c4a0285fc9a5..f8d43468946c 100644
|
|
--- a/pkgs/top-level/all-packages.nix
|
|
+++ b/pkgs/top-level/all-packages.nix
|
|
@@ -21340,7 +21340,10 @@ with pkgs;
|
|
|
|
flatcc = callPackage ../development/libraries/flatcc { };
|
|
|
|
- flint = callPackage ../development/libraries/flint { };
|
|
+ flint = callPackage ../development/libraries/flint {
|
|
+ blas = blas.override { blasProvider = openblas; };
|
|
+ lapack = lapack.override { lapackProvider = openblas; };
|
|
+ };
|
|
|
|
flite = callPackage ../development/libraries/flite { };
|
|
|