vde2: fix build with gcc15

- add "-std=gnu17" to `env.NIX_CFLAGS_COMPILE` similar to merged upstream
commit (patch from commit does not apply):
https://github.com/virtualsquare/vde-2/commit/fedcb99c5f44c397f459ed0951a8fba4f4effb73

Fixes build failure with gcc15:
```
libvdehist.c:39:27: error: initialization of 'ssize_fun' {aka 'long
int (*)(void)'} from incompatible pointer type
'ssize_t (*)(int,  void *, size_t)' {aka 'long int (>
   39 | ssize_fun vdehist_vderead=read;
      |                           ^~~~
In file included from /nix/store/gi4cz4ir3zlwhf1azqfgxqdnczfrwsr7-glibc-2.40-66-dev/include/unistd.h:1217,
                 from libvdehist.c:21:
/nix/store/gi4cz4ir3zlwhf1azqfgxqdnczfrwsr7-glibc-2.40-66-dev/include/bits/unistd.h:26:1:
note: 'read' declared here
   26 | read (int __fd, __fortify_clang_overload_arg0 (void *, ,__buf), size_t __nbytes)
      | ^~~~
libvdehist.c:38:20: note: 'ssize_fun' declared here
   38 | typedef ssize_t (* ssize_fun)();
      |                    ^~~~~~~~~
libvdehist.c: In function 'showexpand':
libvdehist.c:99:25: error: too many arguments to function 'vdehist_termwrite';
expected 0, have 3
   99 |                         vdehist_termwrite(termfd,buf,strlen(buf));
      |                         ^~~~~~~~~~~~~~~~~ ~~~~~~
libvdehist.c: In function 'vdehist_create_commandlist':
libvdehist.c:192:17: error: too many arguments to function 'vdehist_vdewrite';
expected 0, have 3
  192 |                 vdehist_vdewrite(vdefd,"help\n",5);
      |                 ^~~~~~~~~~~~~~~~ ~~~~~
libvdehist.c:323:27: error: too many arguments to function 'vdehist_vderead';
expected 0, have 3
  323 |                         n=vdehist_vderead(st->mgmtfd,buf,BUFSIZE);
      |                           ^~~~~~~~~~~~~~~ ~~~~~~~~~~
```
This commit is contained in:
ghpzin
2025-12-02 09:19:36 +03:00
parent 652fbedc6b
commit 19265f2a21
+4
View File
@@ -26,6 +26,10 @@ stdenv.mkDerivation rec {
})
];
# Fix build with gcc15
# https://github.com/virtualsquare/vde-2/commit/fedcb99c5f44c397f459ed0951a8fba4f4effb73
env.NIX_CFLAGS_COMPILE = "-std=gnu17";
preConfigure = lib.optionalString (lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11") ''
MACOSX_DEPLOYMENT_TARGET=10.16
'';