From a2570d040d7caf341ff2dc3737f9eafa67948c6d Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Fri, 10 Nov 2023 00:10:04 +0100 Subject: [PATCH 1/6] gnulib: 20210702 -> 20231109 --- pkgs/development/tools/gnulib/default.nix | 14 +++++++------- pkgs/top-level/all-packages.nix | 12 +----------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/pkgs/development/tools/gnulib/default.nix b/pkgs/development/tools/gnulib/default.nix index a55589c5a634..5a69915c161c 100644 --- a/pkgs/development/tools/gnulib/default.nix +++ b/pkgs/development/tools/gnulib/default.nix @@ -1,13 +1,13 @@ -{ lib, stdenv, fetchgit, python3 }: +{ lib, stdenv, fetchFromSavannah, python3 }: -stdenv.mkDerivation { +stdenv.mkDerivation rec { pname = "gnulib"; - version = "20210702"; + version = "20231109"; - src = fetchgit { - url = "https://git.savannah.gnu.org/r/gnulib.git"; - rev = "901694b904cd861adc2529b2e05a3fb33f9b534f"; - sha256 = "1f5znlv2wjziglw9vlygdgm4jfbsz34h2dz6w4h90bl4hm0ycb1w"; + src = fetchFromSavannah { + repo = "gnulib"; + rev = "2dd1a7984c6b3e6056cef7e3f9933e0039c21634"; + hash = "sha256-QtWf3mljEnr0TTogkoKN63Y5HTm14A2e/sIXX3xe2SE="; }; postPatch = '' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 67b62f9e2e1f..7ca188fd43b5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14942,17 +14942,7 @@ with pkgs; wget = callPackage ../tools/networking/wget { }; - wget2 = callPackage ../tools/networking/wget2 { - # update breaks grub2 - gnulib = pkgs.gnulib.overrideAttrs { - version = "20210208"; - src = fetchgit { - url = "https://git.savannah.gnu.org/r/gnulib.git"; - rev = "0b38e1d69f03d3977d7ae7926c1efeb461a8a971"; - hash = "sha256-9z/Vg3/g5WRWHH9I0QR6BZ5JCJBo+lEMLAM6xpFPchk="; - }; - }; - }; + wget2 = callPackage ../tools/networking/wget2 { }; wgpu-utils = callPackage ../tools/graphics/wgpu-utils { inherit (darwin.apple_sdk.frameworks) QuartzCore; From 07b8ca7ea175152787c4d3448e6098dd5c2de2b5 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Fri, 10 Nov 2023 00:14:09 +0100 Subject: [PATCH 2/6] gnulib: add meta.changelog --- pkgs/development/tools/gnulib/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/tools/gnulib/default.nix b/pkgs/development/tools/gnulib/default.nix index 5a69915c161c..be6719c3512c 100644 --- a/pkgs/development/tools/gnulib/default.nix +++ b/pkgs/development/tools/gnulib/default.nix @@ -40,6 +40,7 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Central location for code to be shared among GNU packages"; homepage = "https://www.gnu.org/software/gnulib/"; + changelog = "https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=ChangeLog"; license = licenses.gpl3Plus; mainProgram = "gnulib-tool"; platforms = platforms.unix; From 28b9e1a3258c14d91ec77090587efd53441a35c1 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Fri, 10 Nov 2023 01:00:21 +0100 Subject: [PATCH 3/6] xprintidle-ng: fix build Fixes the config.h include error during build: ```console In file included from src/xprintidle-ng.c:36: lib/time.h:28:3: error: #error "Please include config.h first." 28 | #error "Please include config.h first." | ^~~~~ ``` Introduced since gnulib upgrade: * https://github.com/coreutils/gnulib/commit/8ad7bc6 * https://lists.gnu.org/archive/html/bug-gnulib/2023-04/msg00088.html * https://www.gnu.org/software/gnulib/manual/html_node/Source-changes.html The last version of gnulib now checks that config.h is the first include in every compilation unit. This is not the case with the xprintidle-ng source code, so this patch moves these `config.h` inclusions to be first. --- pkgs/tools/X11/xprintidle-ng/default.nix | 4 ++ ...ix-config_h-includes-should-be-first.patch | 62 +++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 pkgs/tools/X11/xprintidle-ng/fix-config_h-includes-should-be-first.patch diff --git a/pkgs/tools/X11/xprintidle-ng/default.nix b/pkgs/tools/X11/xprintidle-ng/default.nix index fdb3b7c58a56..076323a4cab2 100644 --- a/pkgs/tools/X11/xprintidle-ng/default.nix +++ b/pkgs/tools/X11/xprintidle-ng/default.nix @@ -27,6 +27,10 @@ stdenv.mkDerivation rec { sha256 = "0a5024vimpfrpj6w60j1ad8qvjkrmxiy8w1yijxfwk917ag9rkpq"; }; + patches = [ + ./fix-config_h-includes-should-be-first.patch + ]; + postPatch = '' substituteInPlace configure.ac \ --replace "AC_PREREQ([2.62])" "AC_PREREQ([2.64])" diff --git a/pkgs/tools/X11/xprintidle-ng/fix-config_h-includes-should-be-first.patch b/pkgs/tools/X11/xprintidle-ng/fix-config_h-includes-should-be-first.patch new file mode 100644 index 000000000000..01b4b5d63bdd --- /dev/null +++ b/pkgs/tools/X11/xprintidle-ng/fix-config_h-includes-should-be-first.patch @@ -0,0 +1,62 @@ +Fixes the config.h include error during build: + +```console +In file included from src/xprintidle-ng.c:36: +lib/time.h:28:3: error: #error "Please include config.h first." + 28 | #error "Please include config.h first." + | ^~~~~ +``` + +Introduced since gnulib upgrade: +* https://github.com/coreutils/gnulib/commit/8ad7bc6 +* https://lists.gnu.org/archive/html/bug-gnulib/2023-04/msg00088.html +* https://www.gnu.org/software/gnulib/manual/html_node/Source-changes.html + +The last version of gnulib now checks that config.h is the first include +in every compilation unit. + +This is not the case with the xprintidle-ng source code, so this patch +moves these `config.h` inclusions to be first. + +--- + src/time-format.c | 2 +- + src/xprintidle-ng.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/time-format.c b/src/time-format.c +index 3a46749..4c0a4d2 100644 +--- a/src/time-format.c ++++ b/src/time-format.c +@@ -18,10 +18,10 @@ + // 51 Franklin Street, Fifth Floor + // Boston, MA 02110-1301, USA. + ++#include + #include + #include + #include +-#include + #include "system.h" + #include "xalloc.h" + +diff --git a/src/xprintidle-ng.c b/src/xprintidle-ng.c +index 5156adf..ca69b2d 100644 +--- a/src/xprintidle-ng.c ++++ b/src/xprintidle-ng.c +@@ -28,13 +28,13 @@ + // Eivind Magnus Hvidevold . + // kpowersave is licensed under the GNU GPL, version 2 _only_. + ++#include + #include + #include + #include + #include + #include + #include +-#include + #include "system.h" + #include "errno.h" + #include "error.h" +-- +2.42.0 From 17585610ebead132f2a83af2e0e92b5fd82e3d65 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Fri, 10 Nov 2023 01:15:58 +0100 Subject: [PATCH 4/6] xprintidle-ng: fix meta.{homepage,license} --- pkgs/tools/X11/xprintidle-ng/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/X11/xprintidle-ng/default.nix b/pkgs/tools/X11/xprintidle-ng/default.nix index 076323a4cab2..ec8a2ed459d3 100644 --- a/pkgs/tools/X11/xprintidle-ng/default.nix +++ b/pkgs/tools/X11/xprintidle-ng/default.nix @@ -63,8 +63,8 @@ stdenv.mkDerivation rec { meta = { inherit version; description = "A command-line tool to print idle time from libXss"; - homepage = "http://taktoa.me/xprintidle-ng/"; - license = lib.licenses.gpl2; + homepage = "https://github.com/taktoa/xprintidle-ng"; + license = lib.licenses.gpl2Only; maintainers = [ lib.maintainers.raskin ]; platforms = lib.platforms.linux; }; From 4da6bff3af773699bc17cf862cb16c5e31e38b81 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Fri, 10 Nov 2023 09:39:47 +0100 Subject: [PATCH 5/6] wget2: fix build for darwin --- pkgs/tools/networking/wget2/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/networking/wget2/default.nix b/pkgs/tools/networking/wget2/default.nix index 03eb6135ccd9..9b77133de565 100644 --- a/pkgs/tools/networking/wget2/default.nix +++ b/pkgs/tools/networking/wget2/default.nix @@ -10,6 +10,7 @@ # libraries , brotli , bzip2 +, darwin , gpgme , libhsts , libidn2 @@ -65,7 +66,11 @@ stdenv.mkDerivation rec { xz zlib zstd - ] ++ lib.optional sslSupport openssl; + ] ++ lib.optionals sslSupport [ + openssl + ] ++ lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.CoreServices + ]; # TODO: include translation files autoreconfPhase = '' From 74800f5720f4e6142fee09dbb9173a67b99d6221 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Fri, 10 Nov 2023 12:07:59 +0100 Subject: [PATCH 6/6] idutils: fix build for darwin --- pkgs/tools/misc/idutils/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/idutils/default.nix b/pkgs/tools/misc/idutils/default.nix index 6a4fa8961615..cbdf1b761049 100644 --- a/pkgs/tools/misc/idutils/default.nix +++ b/pkgs/tools/misc/idutils/default.nix @@ -1,4 +1,4 @@ -{ fetchurl, lib, stdenv, emacs, gnulib, autoconf, bison, automake, gettext, gperf, texinfo, perl, rsync}: +{ fetchurl, lib, stdenv, emacs, gnulib, autoconf, bison, automake, gettext, gperf, texinfo, perl, rsync, darwin }: stdenv.mkDerivation rec { pname = "idutils"; @@ -16,7 +16,12 @@ stdenv.mkDerivation rec { ./bootstrap --force --gnulib-srcdir=${gnulib} --skip-po --bootstrap-sync --no-git ''; - buildInputs = lib.optional stdenv.isLinux emacs; + buildInputs = lib.optionals stdenv.isLinux [ + emacs + ] ++ lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.CoreServices + ]; + nativeBuildInputs = [ gnulib autoconf bison automake gettext gperf texinfo perl rsync ]; doCheck = !stdenv.isDarwin;