From 97e35935225a6cba799900caaeb017612f2f568e Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Thu, 20 May 2021 22:16:32 -0700 Subject: [PATCH 01/16] python3Packages.xdg: 5.0.1 -> 5.0.2 --- pkgs/development/python-modules/xdg/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/xdg/default.nix b/pkgs/development/python-modules/xdg/default.nix index e47a91fb993b..2ea4e5bedf8b 100644 --- a/pkgs/development/python-modules/xdg/default.nix +++ b/pkgs/development/python-modules/xdg/default.nix @@ -5,7 +5,7 @@ }: buildPythonPackage rec { - version = "5.0.1"; + version = "5.0.2"; pname = "xdg"; disabled = isPy27; format = "pyproject"; @@ -14,7 +14,7 @@ buildPythonPackage rec { owner = "srstevenson"; repo = pname; rev = version; - sha256 = "sha256-WMY9Hs9SbErTp8hVBoCWTz4dLQhuzqTRpXFEyE7+woo="; + sha256 = "sha256-wZfihMrq83Bye5CE5p7bTlI9Z7CsCkSd8Art5ws4vsY="; }; nativeBuildInputs = [ poetry-core ]; From d0755bdb5f7eb1b3f13da3b3ce5be3d1c57c2ce8 Mon Sep 17 00:00:00 2001 From: timput Date: Fri, 21 May 2021 21:07:55 -0600 Subject: [PATCH 02/16] freecad: add openscad file support --- pkgs/applications/graphics/freecad/default.nix | 2 ++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 3 insertions(+) diff --git a/pkgs/applications/graphics/freecad/default.nix b/pkgs/applications/graphics/freecad/default.nix index 25a945824312..ac4050fc8c5b 100644 --- a/pkgs/applications/graphics/freecad/default.nix +++ b/pkgs/applications/graphics/freecad/default.nix @@ -23,6 +23,7 @@ , opencascade-occt , pivy , pkg-config +, ply , pycollada , pyside2 , pyside2-tools @@ -80,6 +81,7 @@ mkDerivation rec { ode opencascade-occt pivy + ply # for openSCAD file support pycollada pyside2 pyside2-tools diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index edc547a7964a..9b11bc832870 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23548,6 +23548,7 @@ in boost matplotlib pivy + ply pycollada pyside2 pyside2-tools From af60121cf553bfad984e4d442007bcebf3c3ce19 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 22 May 2021 07:05:02 +0200 Subject: [PATCH 03/16] nixos-generators: 1.2.0 -> 1.3.0 --- pkgs/tools/nix/nixos-generators/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/nix/nixos-generators/default.nix b/pkgs/tools/nix/nixos-generators/default.nix index 871e223eb4be..004a73475221 100644 --- a/pkgs/tools/nix/nixos-generators/default.nix +++ b/pkgs/tools/nix/nixos-generators/default.nix @@ -2,12 +2,12 @@ stdenv.mkDerivation rec { pname = "nixos-generators"; - version = "1.2.0"; + version = "1.3.0"; src = fetchFromGitHub { owner = "nix-community"; repo = "nixos-generators"; rev = version; - sha256 = "1iwc39hzvzzyndxwbnl3fck7phxnjpnhy8zn4nyp8is1fiw0648v"; + sha256 = "1gbj2jw7zv3mnq1lyj4q53jpfj642jy7lvg0kp060znvhws3370y"; }; nativeBuildInputs = [ makeWrapper ]; installFlags = [ "PREFIX=$(out)" ]; From aeeee447bcc181d57a19d348f857326f4e1959fe Mon Sep 17 00:00:00 2001 From: Vika Date: Sun, 8 Nov 2020 09:40:27 +0300 Subject: [PATCH 04/16] nixos/nix-daemon: fix sandbox-paths option In newer versions of Nix (at least on 2.4pre20201102_550e11f) the `extra-` prefix for config options received a special meaning and the option `extra-sandbox-paths` isn't recognized anymore. This commit fixes it. It doesn't cause a behavior change when using older versions of Nix but does cause an extra newline to appear in the config, thus changing the hash. --- nixos/modules/services/misc/nix-daemon.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/misc/nix-daemon.nix b/nixos/modules/services/misc/nix-daemon.nix index 133e96da0ec8..df745fa7168b 100644 --- a/nixos/modules/services/misc/nix-daemon.nix +++ b/nixos/modules/services/misc/nix-daemon.nix @@ -12,6 +12,8 @@ let isNix23 = versionAtLeast nixVersion "2.3pre"; + isNix24 = versionAtLeast nixVersion "2.4pre"; + makeNixBuildUser = nr: { name = "nixbld${toString nr}"; value = { @@ -41,7 +43,11 @@ let max-jobs = ${toString (cfg.maxJobs)} cores = ${toString (cfg.buildCores)} sandbox = ${if (builtins.isBool cfg.useSandbox) then boolToString cfg.useSandbox else cfg.useSandbox} - extra-sandbox-paths = ${toString cfg.sandboxPaths} + ${if isNix24 then '' + sandbox-paths = ${toString cfg.sandboxPaths} + '' else '' + extra-sandbox-paths = ${toString cfg.sandboxPaths} + ''} substituters = ${toString cfg.binaryCaches} trusted-substituters = ${toString cfg.trustedBinaryCaches} trusted-public-keys = ${toString cfg.binaryCachePublicKeys} From 04cb517e7d635cd163fdc626adc8b310a8b9542d Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Sat, 22 May 2021 06:36:22 +0000 Subject: [PATCH 05/16] lab: 0.21.0 -> 0.22.0 --- .../version-management/git-and-tools/lab/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/version-management/git-and-tools/lab/default.nix b/pkgs/applications/version-management/git-and-tools/lab/default.nix index 856ee616efb7..a373d3dbf897 100644 --- a/pkgs/applications/version-management/git-and-tools/lab/default.nix +++ b/pkgs/applications/version-management/git-and-tools/lab/default.nix @@ -2,18 +2,18 @@ buildGoModule rec { pname = "lab"; - version = "0.21.0"; + version = "0.22.0"; src = fetchFromGitHub { owner = "zaquestion"; repo = "lab"; rev = "v${version}"; - sha256 = "sha256-mkhJmrKpIISd0m0m8fQ9vKuEr6h23BBxK6yo5fB+xcA="; + sha256 = "sha256-CyXEmlsc40JtwDjRYNWqN+3cuoG8K07jAQdd1rktvS8="; }; subPackages = [ "." ]; - vendorSha256 = "sha256-cf+DVnGjSNV2eZ8S/Vk+VPlykoSjngrQuPeA9IshBUg="; + vendorSha256 = "sha256-PSS7OPbM+XsylqDlWc4h+oZrOua2kSWKLEuyjqo/cxM="; doCheck = false; From be7b132bf5a32d874b0bf84e0b632a011eaa2444 Mon Sep 17 00:00:00 2001 From: Joe Hermaszewski Date: Sat, 22 May 2021 16:14:27 +0800 Subject: [PATCH 06/16] haskellPackages.hnix: Patch to fix broken location annotations Also reenable tests for update-nix-fetchgit --- .../haskell-modules/configuration-common.nix | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 693a5b61fbc4..f293048e8179 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -203,6 +203,13 @@ self: super: { sha256 = "0pqmijfkysjixg3gb4kmrqdif7s2saz8qi6k337jf15i0npzln8d"; revert = true; }) + # fix broken location annotations (necessary for update-nix-fetchgit). + # Can be removed on the next hnix release after + # https://github.com/haskell-nix/hnix/pull/936 is merged. + (pkgs.fetchpatch { + url = "https://github.com/expipiplus1/hnix/commit/7cd998426ab7d930d288a1d6e266dc4e85cece3d.patch"; + sha256 = "19ay6vxa90ykgdd0fis2djvki2kpgfsq7z55iyqg965m583vsfr6"; + }) ] ++ (drv.patches or []); })); @@ -1405,10 +1412,7 @@ self: super: { }" ''; - # 2021-04-09: test failure - # PR pending https://github.com/expipiplus1/update-nix-fetchgit/pull/60 - doCheck = false; - + # These can both be removed upon the release of update-nix-fetchgit-0.2.7 patches = [ # 2021-05-17 compile with hnix >= 0.13 # https://github.com/expipiplus1/update-nix-fetchgit/pull/64 @@ -1416,6 +1420,12 @@ self: super: { url = "https://github.com/expipiplus1/update-nix-fetchgit/commit/bc28c8b26c38093aa950574802012c0cd8447ce8.patch"; sha256 = "1dwd1jdsrx3ss6ql1bk2ch7ln74mkq6jy9ms8vi8kmf3gbg8l9fg"; }) + # Fix test failure + # https://github.com/expipiplus1/update-nix-fetchgit/pull/60 + (pkgs.fetchpatch { + url = "https://github.com/expipiplus1/update-nix-fetchgit/commit/4a43e1ea4e7e1c18de81e3f9fe0b86faa70865f5.patch"; + sha256 = "1z74c1blgwr4q37m1rhlj7534qbnp3nnxf63m8j2b7iz0ljgm0m9"; + }) ] ++ (drv.patches or []); })); From 290fa04d05cc9942daecea6f15dcf07b1192d89c Mon Sep 17 00:00:00 2001 From: fortuneteller2k Date: Sat, 22 May 2021 16:40:31 +0800 Subject: [PATCH 07/16] fetchutils: init at unstable-2021-03-16 --- pkgs/tools/misc/fetchutils/default.nix | 29 ++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 31 insertions(+) create mode 100644 pkgs/tools/misc/fetchutils/default.nix diff --git a/pkgs/tools/misc/fetchutils/default.nix b/pkgs/tools/misc/fetchutils/default.nix new file mode 100644 index 000000000000..bda9175724f1 --- /dev/null +++ b/pkgs/tools/misc/fetchutils/default.nix @@ -0,0 +1,29 @@ +{ lib, stdenvNoCC, fetchFromGitHub, bash, scdoc }: + +stdenvNoCC.mkDerivation rec { + pname = "fetchutils"; + version = "unstable-2021-03-16"; + + src = fetchFromGitHub { + owner = "lptstr"; + repo = pname; + rev = "882781a297e86f4ad4eaf143e0777fb3e7c69526"; + sha256 = "sha256-ONrVZC6GBV5v3TeBekW9ybZjDHF3FNyXw1rYknqKRbk="; + }; + + buildInputs = [ bash scdoc ]; + + installFlags = [ "DESTDIR=$(out)" "PREFIX=" ]; + + postPatch = '' + patchShebangs --host src/* + ''; + + meta = with lib; { + description = "A collection of small shell utilities to fetch system information"; + homepage = "https://github.com/lptstr/fetchutils"; + license = licenses.mit; + platforms = platforms.unix; + maintainers = with maintainers; [ fortuneteller2k ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index edc547a7964a..a3ec346ad4b2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -381,6 +381,8 @@ in etBook = callPackage ../data/fonts/et-book { }; + fetchutils = callPackage ../tools/misc/fetchutils { }; + fet-sh = callPackage ../tools/misc/fet-sh { }; fetchbower = callPackage ../build-support/fetchbower { From 89a3768f04f79147b529335ed7341154641fb015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 22 May 2021 10:49:38 +0200 Subject: [PATCH 08/16] qstopmotion: use ffmpeg instead of ffmpeg_3 (#123477) FFmpeg isn't linked against, but the executable is used for rendering. --- pkgs/applications/video/qstopmotion/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/video/qstopmotion/default.nix b/pkgs/applications/video/qstopmotion/default.nix index 9a5bb5eb4620..469ba5b8eaa6 100644 --- a/pkgs/applications/video/qstopmotion/default.nix +++ b/pkgs/applications/video/qstopmotion/default.nix @@ -6,7 +6,7 @@ , qtquickcontrols , qtimageformats , qtxmlpatterns -, ffmpeg_3 +, ffmpeg , guvcview , cmake , ninja @@ -40,7 +40,6 @@ mkDerivation rec { v4l-utils libv4l pcre - ffmpeg_3 guvcview qwt ]; @@ -64,6 +63,10 @@ mkDerivation rec { grep -rl 'qwt' . | xargs sed -i 's@@@g' ''; + qtWrapperArgs = [ + "--prefix" "PATH" ":" (lib.makeBinPath [ ffmpeg ]) + ]; + meta = with lib; { homepage = "http://www.qstopmotion.org"; description = "Create stopmotion animation with a (web)camera"; From dfc7d100c7ea75e5d54e6ea0766a8038975c0d24 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Sat, 22 May 2021 10:31:14 +0000 Subject: [PATCH 09/16] twitterBootstrap: 5.0.0 -> 5.0.1 --- pkgs/development/web/twitter-bootstrap/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/web/twitter-bootstrap/default.nix b/pkgs/development/web/twitter-bootstrap/default.nix index b8a7e6a4b8f8..65625ca7d21f 100644 --- a/pkgs/development/web/twitter-bootstrap/default.nix +++ b/pkgs/development/web/twitter-bootstrap/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "bootstrap"; - version = "5.0.0"; + version = "5.0.1"; src = fetchurl { url = "https://github.com/twbs/bootstrap/releases/download/v${version}/${pname}-${version}-dist.zip"; - sha256 = "sha256-CsPvq8exUL2k/b/QK9c2S68DIsDDR8qxho0WgDJ3/Vs="; + sha256 = "sha256-eep9s1YxTHeDDh+WhDMENho/N3AfJHVitis22bIGa6w="; }; nativeBuildInputs = [ unzip ]; From be01cb8b97bc0e449e44da7a79e1dabde204fd8c Mon Sep 17 00:00:00 2001 From: sohalt Date: Mon, 5 Apr 2021 18:44:06 +0200 Subject: [PATCH 10/16] nixos/spacenavd: run as user service --- nixos/modules/services/hardware/spacenavd.nix | 3 +- .../libspnav/configure-socket-path.patch | 47 +++++++ .../libraries/libspnav/default.nix | 6 + .../spacenavd/configure-socket-path.patch | 118 ++++++++++++++++++ pkgs/misc/drivers/spacenavd/default.nix | 3 + 5 files changed, 175 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/libraries/libspnav/configure-socket-path.patch create mode 100644 pkgs/misc/drivers/spacenavd/configure-socket-path.patch diff --git a/nixos/modules/services/hardware/spacenavd.nix b/nixos/modules/services/hardware/spacenavd.nix index cecc4d6f029b..74725dd23d25 100644 --- a/nixos/modules/services/hardware/spacenavd.nix +++ b/nixos/modules/services/hardware/spacenavd.nix @@ -13,13 +13,12 @@ in { }; config = mkIf cfg.enable { - systemd.services.spacenavd = { + systemd.user.services.spacenavd = { description = "Daemon for the Spacenavigator 6DOF mice by 3Dconnexion"; after = [ "syslog.target" ]; wantedBy = [ "graphical.target" ]; serviceConfig = { ExecStart = "${pkgs.spacenavd}/bin/spacenavd -d -l syslog"; - StandardError = "syslog"; }; }; }; diff --git a/pkgs/development/libraries/libspnav/configure-socket-path.patch b/pkgs/development/libraries/libspnav/configure-socket-path.patch new file mode 100644 index 000000000000..9a8ef0d49811 --- /dev/null +++ b/pkgs/development/libraries/libspnav/configure-socket-path.patch @@ -0,0 +1,47 @@ +diff --git a/spnav.c b/spnav.c +index f9e10f8..27149f7 100644 +--- a/spnav.c ++++ b/spnav.c +@@ -36,7 +36,7 @@ OF SUCH DAMAGE. + #include + #include "spnav.h" + +-#define SPNAV_SOCK_PATH "/var/run/spnav.sock" ++#define DEFAULT_SPNAV_SOCK_PATH "/run/spnav.sock" + + #ifdef USE_X11 + #include +@@ -70,6 +70,24 @@ static struct event_node *ev_queue, *ev_queue_tail; + /* AF_UNIX socket used for alternative communication with daemon */ + static int sock = -1; + ++static char *spath = NULL; ++ ++static char *socket_path() ++{ ++ char *xdg_runtime_dir; ++ if((xdg_runtime_dir = getenv("XDG_RUNTIME_DIR"))) { ++ if ( spath == NULL ) { ++ spath = malloc(strlen(xdg_runtime_dir) + strlen("/spnav.sock") + 1); ++ if ( spath != NULL ) { ++ sprintf(spath, "%s/spnav.sock", xdg_runtime_dir); ++ } ++ } ++ if(access(spath, F_OK) != -1){ ++ return spath; ++ } ++ } ++ return DEFAULT_SPNAV_SOCK_PATH; ++} + + int spnav_open(void) + { +@@ -92,7 +110,7 @@ int spnav_open(void) + + memset(&addr, 0, sizeof addr); + addr.sun_family = AF_UNIX; +- strncpy(addr.sun_path, SPNAV_SOCK_PATH, sizeof(addr.sun_path)); ++ strncpy(addr.sun_path, socket_path(), sizeof(addr.sun_path)); + + + if(connect(s, (struct sockaddr*)&addr, sizeof addr) == -1) { diff --git a/pkgs/development/libraries/libspnav/default.nix b/pkgs/development/libraries/libspnav/default.nix index 53aad1019b30..99f2a64d7b12 100644 --- a/pkgs/development/libraries/libspnav/default.nix +++ b/pkgs/development/libraries/libspnav/default.nix @@ -14,6 +14,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = lib.optional stdenv.isDarwin fixDarwinDylibNames; buildInputs = [ libX11 ]; + patches = [ + # Changes the socket path from /run/spnav.sock to $XDG_RUNTIME_DIR/spnav.sock + # to allow for a user service + ./configure-socket-path.patch + ]; + configureFlags = [ "--disable-debug"]; makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; diff --git a/pkgs/misc/drivers/spacenavd/configure-socket-path.patch b/pkgs/misc/drivers/spacenavd/configure-socket-path.patch new file mode 100644 index 000000000000..c59987dcc051 --- /dev/null +++ b/pkgs/misc/drivers/spacenavd/configure-socket-path.patch @@ -0,0 +1,118 @@ +diff --git a/src/proto_unix.c b/src/proto_unix.c +index 998f234..d38452c 100644 +--- a/src/proto_unix.c ++++ b/src/proto_unix.c +@@ -36,11 +36,14 @@ enum { + + static int lsock = -1; + ++static char *spath = NULL; ++ + int init_unix(void) + { + int s; + mode_t prev_umask; + struct sockaddr_un addr; ++ char *sock_path; + + if(lsock >= 0) return 0; + +@@ -49,16 +52,18 @@ int init_unix(void) + return -1; + } + +- unlink(SOCK_NAME); /* in case it already exists */ ++ sock_path = socket_path(); ++ ++ unlink(sock_path); /* in case it already exists */ + + memset(&addr, 0, sizeof addr); + addr.sun_family = AF_UNIX; +- strcpy(addr.sun_path, SOCK_NAME); ++ strcpy(addr.sun_path, sock_path); + + prev_umask = umask(0); + + if(bind(s, (struct sockaddr*)&addr, sizeof addr) == -1) { +- logmsg(LOG_ERR, "failed to bind unix socket: %s: %s\n", SOCK_NAME, strerror(errno)); ++ logmsg(LOG_ERR, "failed to bind unix socket: %s: %s\n", sock_path, strerror(errno)); + close(s); + return -1; + } +@@ -68,7 +73,7 @@ int init_unix(void) + if(listen(s, 8) == -1) { + logmsg(LOG_ERR, "listen failed: %s\n", strerror(errno)); + close(s); +- unlink(SOCK_NAME); ++ unlink(sock_path); + return -1; + } + +@@ -82,7 +87,7 @@ void close_unix(void) + close(lsock); + lsock = -1; + +- unlink(SOCK_NAME); ++ unlink(socket_path()); + } + } + +@@ -173,3 +178,19 @@ int handle_uevents(fd_set *rset) + + return 0; + } ++ ++char *socket_path(void) ++{ ++ char *xdg_runtime_dir; ++ if((xdg_runtime_dir = getenv("XDG_RUNTIME_DIR"))) { ++ if ( spath == NULL ) { ++ spath = malloc(strlen(xdg_runtime_dir) + strlen("/spnav.sock") + 1); ++ if ( spath != NULL ) { ++ sprintf(spath, "%s/spnav.sock", xdg_runtime_dir); ++ } ++ }; ++ return spath; ++ } else { ++ return DEFAULT_SOCK_NAME; ++ } ++} +diff --git a/src/proto_unix.h b/src/proto_unix.h +index 045b379..ec4509c 100644 +--- a/src/proto_unix.h ++++ b/src/proto_unix.h +@@ -23,6 +23,7 @@ along with this program. If not, see . + #include "event.h" + #include "client.h" + ++char *socket_path(void); + int init_unix(void); + void close_unix(void); + int get_unix_socket(void); +diff --git a/src/spnavd.c b/src/spnavd.c +index cbea191..03080da 100644 +--- a/src/spnavd.c ++++ b/src/spnavd.c +@@ -344,7 +344,7 @@ static int find_running_daemon(void) + } + memset(&addr, 0, sizeof addr); + addr.sun_family = AF_UNIX; +- strncpy(addr.sun_path, SOCK_NAME, sizeof addr.sun_path); ++ strncpy(addr.sun_path, socket_path(), sizeof addr.sun_path); + + if(connect(s, (struct sockaddr*)&addr, sizeof addr) == -1) { + close(s); +diff --git a/src/spnavd.h b/src/spnavd.h +index fa0a916..2d1c48b 100644 +--- a/src/spnavd.h ++++ b/src/spnavd.h +@@ -26,8 +26,8 @@ along with this program. If not, see . + #define DEF_CFGFILE "/etc/spnavrc" + #define DEF_LOGFILE "/var/log/spnavd.log" + +-#define SOCK_NAME "/var/run/spnav.sock" + #define PIDFILE "/var/run/spnavd.pid" ++#define DEFAULT_SOCK_NAME "/run/spnav.sock" + #define SYSLOG_ID "spnavd" + + /* Multiple devices support */ diff --git a/pkgs/misc/drivers/spacenavd/default.nix b/pkgs/misc/drivers/spacenavd/default.nix index fe6d206c3e98..9970c9778097 100644 --- a/pkgs/misc/drivers/spacenavd/default.nix +++ b/pkgs/misc/drivers/spacenavd/default.nix @@ -17,6 +17,9 @@ stdenv.mkDerivation rec { url = "https://github.com/FreeSpacenav/spacenavd/commit/d6a25d5c3f49b9676d039775efc8bf854737c43c.patch"; sha256 = "02pdgcvaqc20qf9hi3r73nb9ds7yk2ps9nnxaj0x9p50xjnhfg5c"; }) + # Changes the socket path from /run/spnav.sock to $XDG_RUNTIME_DIR/spnav.sock + # to allow for a user service + ./configure-socket-path.patch ]; buildInputs = [ libX11 ] From dfb36eed7694f46c7eaf5a04c2a774a81715df65 Mon Sep 17 00:00:00 2001 From: sohalt Date: Tue, 6 Apr 2021 19:21:21 +0200 Subject: [PATCH 11/16] spacenavd: pidfile in $XDG_RUNTIME_DIR --- .../spacenavd/configure-pidfile-path.patch | 82 +++++++++++++++++++ pkgs/misc/drivers/spacenavd/default.nix | 3 + 2 files changed, 85 insertions(+) create mode 100644 pkgs/misc/drivers/spacenavd/configure-pidfile-path.patch diff --git a/pkgs/misc/drivers/spacenavd/configure-pidfile-path.patch b/pkgs/misc/drivers/spacenavd/configure-pidfile-path.patch new file mode 100644 index 000000000000..bc2cad9784cb --- /dev/null +++ b/pkgs/misc/drivers/spacenavd/configure-pidfile-path.patch @@ -0,0 +1,82 @@ +diff --git a/src/spnavd.c b/src/spnavd.c +index 03080da..2d4eca6 100644 +--- a/src/spnavd.c ++++ b/src/spnavd.c +@@ -42,12 +42,14 @@ static void cleanup(void); + static void daemonize(void); + static int write_pid_file(void); + static int find_running_daemon(void); ++static char *pidfile_path(void); + static void handle_events(fd_set *rset); + static void sig_handler(int s); + static char *fix_path(char *str); + + static char *cfgfile = DEF_CFGFILE; + static char *logfile = DEF_LOGFILE; ++static char *pidpath = NULL; + + int main(int argc, char **argv) + { +@@ -270,7 +272,7 @@ static void cleanup(void) + remove_device(tmp); + } + +- remove(PIDFILE); ++ remove(pidfile_path()); + } + + static void daemonize(void) +@@ -314,7 +316,7 @@ static int write_pid_file(void) + FILE *fp; + int pid = getpid(); + +- if(!(fp = fopen(PIDFILE, "w"))) { ++ if(!(fp = fopen(pidfile_path(), "w"))) { + return -1; + } + fprintf(fp, "%d\n", pid); +@@ -329,7 +331,7 @@ static int find_running_daemon(void) + struct sockaddr_un addr; + + /* try to open the pid-file */ +- if(!(fp = fopen(PIDFILE, "r"))) { ++ if(!(fp = fopen(pidfile_path(), "r"))) { + return -1; + } + if(fscanf(fp, "%d\n", &pid) != 1) { +@@ -356,6 +358,22 @@ static int find_running_daemon(void) + return pid; + } + ++char *pidfile_path(void) ++{ ++ char *xdg_runtime_dir; ++ if((xdg_runtime_dir = getenv("XDG_RUNTIME_DIR"))) { ++ if ( pidpath == NULL ) { ++ pidpath = malloc(strlen(xdg_runtime_dir) + strlen("/spnavd.pid") + 1); ++ if ( pidpath != NULL ) { ++ sprintf(pidpath, "%s/spnavd.pid", xdg_runtime_dir); ++ } ++ }; ++ return pidpath; ++ } else { ++ return DEFAULT_PIDFILE; ++ } ++} ++ + static void handle_events(fd_set *rset) + { + int dev_fd, hotplug_fd; +diff --git a/src/spnavd.h b/src/spnavd.h +index 2d1c48b..17d22d3 100644 +--- a/src/spnavd.h ++++ b/src/spnavd.h +@@ -26,7 +26,7 @@ along with this program. If not, see . + #define DEF_CFGFILE "/etc/spnavrc" + #define DEF_LOGFILE "/var/log/spnavd.log" + +-#define PIDFILE "/var/run/spnavd.pid" ++#define DEFAULT_PIDFILE "/run/spnavd.pid" + #define DEFAULT_SOCK_NAME "/run/spnav.sock" + #define SYSLOG_ID "spnavd" + diff --git a/pkgs/misc/drivers/spacenavd/default.nix b/pkgs/misc/drivers/spacenavd/default.nix index 9970c9778097..feb00c8b3992 100644 --- a/pkgs/misc/drivers/spacenavd/default.nix +++ b/pkgs/misc/drivers/spacenavd/default.nix @@ -20,6 +20,9 @@ stdenv.mkDerivation rec { # Changes the socket path from /run/spnav.sock to $XDG_RUNTIME_DIR/spnav.sock # to allow for a user service ./configure-socket-path.patch + # Changes the pidfile path from /run/spnavd.pid to $XDG_RUNTIME_DIR/spnavd.pid + # to allow for a user service + ./configure-pidfile-path.patch ]; buildInputs = [ libX11 ] From c66caa6a90bd856ca630f6ad4dd876dbf3313d59 Mon Sep 17 00:00:00 2001 From: sohalt Date: Tue, 20 Apr 2021 20:41:56 +0200 Subject: [PATCH 12/16] spaacenavd: config file in $XDG_CONFIG_HOME --- .../spacenavd/configure-cfgfile-path.patch | 63 +++++++++++++++++++ pkgs/misc/drivers/spacenavd/default.nix | 3 + 2 files changed, 66 insertions(+) create mode 100644 pkgs/misc/drivers/spacenavd/configure-cfgfile-path.patch diff --git a/pkgs/misc/drivers/spacenavd/configure-cfgfile-path.patch b/pkgs/misc/drivers/spacenavd/configure-cfgfile-path.patch new file mode 100644 index 000000000000..268282e96eae --- /dev/null +++ b/pkgs/misc/drivers/spacenavd/configure-cfgfile-path.patch @@ -0,0 +1,63 @@ +diff --git a/src/spnavd.c b/src/spnavd.c +index 2d4eca6..a5227ed 100644 +--- a/src/spnavd.c ++++ b/src/spnavd.c +@@ -27,6 +27,8 @@ along with this program. If not, see . + #include + #include + #include ++#include ++#include + #include "spnavd.h" + #include "logger.h" + #include "dev.h" +@@ -47,13 +49,39 @@ static void handle_events(fd_set *rset); + static void sig_handler(int s); + static char *fix_path(char *str); + +-static char *cfgfile = DEF_CFGFILE; ++static char* config_path; ++char* cfg_path() ++{ ++ char* buf; ++ if((buf = getenv("XDG_CONFIG_HOME"))) { ++ if(config_path == NULL) { ++ config_path = malloc(strlen(buf) + strlen("/spnavrc") + 1); ++ if ( config_path != NULL) { ++ sprintf(config_path, "%s/spnavrc", buf); ++ } ++ }; ++ return config_path; ++ } else { ++ if (!(buf = getenv("HOME"))) { ++ struct passwd *pw = getpwuid(getuid()); ++ buf = pw->pw_dir; ++ } ++ config_path = malloc(strlen(buf) + strlen("/.config/spnavrc") + 1); ++ if ( config_path != NULL) { ++ sprintf(config_path, "%s/.config/spnavrc", buf); ++ } ++ return config_path; ++ } ++} ++ ++static char *cfgfile = NULL; + static char *logfile = DEF_LOGFILE; + static char *pidpath = NULL; + + int main(int argc, char **argv) + { + int i, pid, ret, become_daemon = 1; ++ cfgfile = cfg_path(); + + for(i=1; i: config file path (default: " DEF_CFGFILE ")\n"); ++ printf(" -c : config file path (default: %s)\n", cfg_path()); + printf(" -l |syslog: log file path or log to syslog (default: " DEF_LOGFILE ")\n"); + printf(" -v: verbose output\n"); + printf(" -V,-version: print version number and exit\n"); diff --git a/pkgs/misc/drivers/spacenavd/default.nix b/pkgs/misc/drivers/spacenavd/default.nix index feb00c8b3992..5cc1b4601332 100644 --- a/pkgs/misc/drivers/spacenavd/default.nix +++ b/pkgs/misc/drivers/spacenavd/default.nix @@ -23,6 +23,9 @@ stdenv.mkDerivation rec { # Changes the pidfile path from /run/spnavd.pid to $XDG_RUNTIME_DIR/spnavd.pid # to allow for a user service ./configure-pidfile-path.patch + # Changes the config file path from /etc/spnavrc to $XDG_CONFIG_HOME/spnavrc or $HOME/.config/spnavrc + # to allow for a user service + ./configure-cfgfile-path.patch ]; buildInputs = [ libX11 ] From 6172e51fa99d3a6bebca3801c764e9aa76526f8a Mon Sep 17 00:00:00 2001 From: sohalt Date: Tue, 20 Apr 2021 20:46:08 +0200 Subject: [PATCH 13/16] spnavcfg: pidfile in $XDG_RUNTIME_DIR --- .../spnavcfg/configure-pidfile-path.patch | 40 +++++++++++++++++++ pkgs/applications/misc/spnavcfg/default.nix | 6 +++ 2 files changed, 46 insertions(+) create mode 100644 pkgs/applications/misc/spnavcfg/configure-pidfile-path.patch diff --git a/pkgs/applications/misc/spnavcfg/configure-pidfile-path.patch b/pkgs/applications/misc/spnavcfg/configure-pidfile-path.patch new file mode 100644 index 000000000000..a420fcbc07b8 --- /dev/null +++ b/pkgs/applications/misc/spnavcfg/configure-pidfile-path.patch @@ -0,0 +1,40 @@ +diff --git a/back.c b/back.c +index f364e31..c1810dc 100644 +--- a/back.c ++++ b/back.c +@@ -26,7 +26,6 @@ along with this program. If not, see . + #include "cmd.h" + + #define CFGFILE "/etc/spnavrc" +-#define PIDFILE "/var/run/spnavd.pid" + + int get_daemon_pid(void); + static int update_cfg(void); +@@ -97,11 +96,26 @@ int get_daemon_pid(void) + { + FILE *fp; + char buf[64]; ++ char* xdg_runtime_dir; ++ char* pidfile; + +- if(!(fp = fopen(PIDFILE, "r"))) { ++ if(!(xdg_runtime_dir = getenv("XDG_RUNTIME_DIR"))){ ++ fprintf(stderr, "XDG_RUNTIME_DIR not set, can't find spacenav pid file\n"); ++ return -1; ++ } ++ pidfile = malloc(strlen(xdg_runtime_dir) + strlen("/spnavd.pid") + 1); ++ if (pidfile == NULL) { ++ fprintf(stderr, "failed to allocate memory\n"); ++ return -1; ++ } ++ sprintf(pidfile, "%s/spnavd.pid", xdg_runtime_dir); ++ ++ if(!(fp = fopen(pidfile, "r"))) { + fprintf(stderr, "no spacenav pid file, can't find daemon\n"); ++ free(pidfile); + return -1; + } ++ free(pidfile); + if(!fgets(buf, sizeof buf, fp) || !isdigit(buf[0])) { + fprintf(stderr, "corrupted pidfile, can't find the daemon\n"); + fclose(fp); diff --git a/pkgs/applications/misc/spnavcfg/default.nix b/pkgs/applications/misc/spnavcfg/default.nix index 253549099de8..1d01b99a4afb 100644 --- a/pkgs/applications/misc/spnavcfg/default.nix +++ b/pkgs/applications/misc/spnavcfg/default.nix @@ -11,6 +11,12 @@ stdenv.mkDerivation rec { sha256 = "180mkdis15gxs79rr3f7hpwa1p6v81bybw37pzzdjnmqwqrc08a0"; }; + patches = [ + # Changes the pidfile path from /run/spnavd.pid to $XDG_RUNTIME_DIR/spnavd.pid + # to allow for a user service + ./configure-pidfile-path.patch + ]; + postPatch = '' sed -i s/4775/775/ Makefile.in ''; From 547d8ee029b46080fe56927c3f1bd7f75514feb7 Mon Sep 17 00:00:00 2001 From: sohalt Date: Tue, 20 Apr 2021 20:54:00 +0200 Subject: [PATCH 14/16] spnavcfg: config file in $XDG_CONFIG_HOME --- .../spnavcfg/configure-cfgfile-path.patch | 100 ++++++++++++++++++ pkgs/applications/misc/spnavcfg/default.nix | 3 + 2 files changed, 103 insertions(+) create mode 100644 pkgs/applications/misc/spnavcfg/configure-cfgfile-path.patch diff --git a/pkgs/applications/misc/spnavcfg/configure-cfgfile-path.patch b/pkgs/applications/misc/spnavcfg/configure-cfgfile-path.patch new file mode 100644 index 000000000000..22db2ee66ce3 --- /dev/null +++ b/pkgs/applications/misc/spnavcfg/configure-cfgfile-path.patch @@ -0,0 +1,100 @@ +diff --git a/back.c b/back.c +index c1810dc..75416fb 100644 +--- a/back.c ++++ b/back.c +@@ -25,7 +25,6 @@ along with this program. If not, see . + #include "cfgfile.h" + #include "cmd.h" + +-#define CFGFILE "/etc/spnavrc" + + int get_daemon_pid(void); + static int update_cfg(void); +@@ -127,7 +126,7 @@ int get_daemon_pid(void) + + static int update_cfg(void) + { +- if(write_cfg(CFGFILE, &cfg) == -1) { ++ if(write_cfg(cfg_path(), &cfg) == -1) { + fprintf(stderr, "failed to update config file\n"); + return -1; + } +diff --git a/cfgfile.c b/cfgfile.c +index 5a9c502..2ea323d 100644 +--- a/cfgfile.c ++++ b/cfgfile.c +@@ -22,12 +22,40 @@ along with this program. If not, see . + #include + #include + #include ++#include ++#include ++#include + #include "cfgfile.h" + + enum {TX, TY, TZ, RX, RY, RZ}; + + static const int def_axmap[] = {0, 2, 1, 3, 5, 4}; + static const int def_axinv[] = {0, 1, 1, 0, 1, 1}; ++static char* config_path; ++ ++char* cfg_path() ++{ ++ char* buf; ++ if((buf = getenv("XDG_CONFIG_HOME"))) { ++ if(config_path == NULL) { ++ config_path = malloc(strlen(buf) + strlen("/spnavrc") + 1); ++ if ( config_path != NULL) { ++ sprintf(config_path, "%s/spnavrc", buf); ++ } ++ }; ++ return config_path; ++ } else { ++ if (!(buf = getenv("HOME"))) { ++ struct passwd *pw = getpwuid(getuid()); ++ buf = pw->pw_dir; ++ } ++ config_path = malloc(strlen(buf) + strlen("/.config/spnavrc") + 1); ++ if ( config_path != NULL) { ++ sprintf(config_path, "%s/.config/spnavrc", buf); ++ } ++ return config_path; ++ } ++} + + void default_cfg(struct cfg *cfg) + { +diff --git a/cfgfile.h b/cfgfile.h +index dfed8c9..5bb1b2c 100644 +--- a/cfgfile.h ++++ b/cfgfile.h +@@ -47,6 +47,7 @@ struct cfg { + int devid[MAX_CUSTOM][2]; /* custom USB vendor/product id list */ + }; + ++char* cfg_path(void); + void default_cfg(struct cfg *cfg); + int read_cfg(const char *fname, struct cfg *cfg); + int write_cfg(const char *fname, struct cfg *cfg); +diff --git a/front_gtk.c b/front_gtk.c +index e4c2cd7..6a800a0 100644 +--- a/front_gtk.c ++++ b/front_gtk.c +@@ -28,8 +28,6 @@ along with this program. If not, see . + #include "cmd.h" + #include "ui.h" + +-#define CFGFILE "/etc/spnavrc" +- + #define CHK_AXINV_TRANS_X "axinv_trans_x" + #define CHK_AXINV_TRANS_Y "axinv_trans_y" + #define CHK_AXINV_TRANS_Z "axinv_trans_z" +@@ -121,7 +119,7 @@ void frontend(int pfd) + + gtk_init(&argc, 0); + +- read_cfg(CFGFILE, &cfg); ++ read_cfg(cfg_path(), &cfg); + + create_ui(); + diff --git a/pkgs/applications/misc/spnavcfg/default.nix b/pkgs/applications/misc/spnavcfg/default.nix index 1d01b99a4afb..fcd4630e8039 100644 --- a/pkgs/applications/misc/spnavcfg/default.nix +++ b/pkgs/applications/misc/spnavcfg/default.nix @@ -15,6 +15,9 @@ stdenv.mkDerivation rec { # Changes the pidfile path from /run/spnavd.pid to $XDG_RUNTIME_DIR/spnavd.pid # to allow for a user service ./configure-pidfile-path.patch + # Changes the config file path from /etc/spnavrc to $XDG_CONFIG_HOME/spnavrc or $HOME/.config/spnavrc + # to allow for a user service + ./configure-cfgfile-path.patch ]; postPatch = '' From 0de023b4f9d4aeef16d5a46fa5c52b7e9352c881 Mon Sep 17 00:00:00 2001 From: wedens Date: Sat, 22 May 2021 12:32:32 +0700 Subject: [PATCH 15/16] rofimoji: 4.3.0 -> 5.1.0 --- pkgs/applications/misc/rofimoji/default.nix | 8 +++----- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/misc/rofimoji/default.nix b/pkgs/applications/misc/rofimoji/default.nix index 1e340697e76d..79a4d9fc7abe 100644 --- a/pkgs/applications/misc/rofimoji/default.nix +++ b/pkgs/applications/misc/rofimoji/default.nix @@ -6,7 +6,6 @@ , x11Support ? true , ConfigArgParse -, pyxdg , rofi , wl-clipboard , wtype @@ -16,18 +15,18 @@ buildPythonApplication rec { pname = "rofimoji"; - version = "4.3.0"; + version = "5.1.0"; src = fetchFromGitHub { owner = "fdw"; repo = "rofimoji"; rev = version; - sha256 = "08ayndpifr04njpijc5n5ii5nvibfpab39p6ngyyj0pb43792a8j"; + sha256 = "sha256-bLV0hYDjVH11euvNHUHZFcCVywuceRljkCqyX4aANVs="; }; # `rofi` and the `waylandSupport` and `x11Support` dependencies # contain binaries needed at runtime. - propagatedBuildInputs = with lib; [ ConfigArgParse pyxdg rofi ] + propagatedBuildInputs = with lib; [ ConfigArgParse rofi ] ++ optionals waylandSupport [ wl-clipboard wtype ] ++ optionals x11Support [ xdotool xsel ]; @@ -35,7 +34,6 @@ buildPythonApplication rec { # and has additional dependencies. postPatch = '' rm -rf extractors - substituteInPlace setup.py --replace 'pyxdg==0.26' 'pyxdg' ''; # no tests executed diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9b11bc832870..464f34d2fa92 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -26063,7 +26063,7 @@ in rofi-systemd = callPackage ../tools/system/rofi-systemd { }; rofimoji = callPackage ../applications/misc/rofimoji { - inherit (python3Packages) buildPythonApplication ConfigArgParse pyxdg; + inherit (python3Packages) buildPythonApplication ConfigArgParse; }; rootlesskit = callPackage ../tools/virtualization/rootlesskit {}; From 6a4ef962d352284696260986b9add804fdf42d8e Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Sat, 22 May 2021 12:20:22 +0200 Subject: [PATCH 16/16] signal-desktop: 5.2.0 -> 5.2.1 --- .../networking/instant-messengers/signal-desktop/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix b/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix index 49a0ae072ec4..0f95d1639e14 100644 --- a/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix +++ b/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix @@ -28,7 +28,7 @@ let else ""); in stdenv.mkDerivation rec { pname = "signal-desktop"; - version = "5.2.0"; # Please backport all updates to the stable channel. + version = "5.2.1"; # Please backport all updates to the stable channel. # All releases have a limited lifetime and "expire" 90 days after the release. # When releases "expire" the application becomes unusable until an update is # applied. The expiration date for the current release can be extracted with: @@ -38,7 +38,7 @@ in stdenv.mkDerivation rec { src = fetchurl { url = "https://updates.signal.org/desktop/apt/pool/main/s/signal-desktop/signal-desktop_${version}_amd64.deb"; - sha256 = "0jvimpmz1d0pg9zpnyzm7a3g7vzapq62cphmvjhh67dxv5jih37k"; + sha256 = "0hkl8h49565kncvczv5fv4gak55lycygwb8i8igkgc4my0ykzs2z"; }; nativeBuildInputs = [