Skip to content

Commit d0ac072

Browse files
committed
wol: fix build with GCC 14
1 parent 56dc1a3 commit d0ac072

File tree

2 files changed

+75
-2
lines changed

2 files changed

+75
-2
lines changed

pkgs/by-name/wo/wol/gcc-14.patch

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
diff -Naur wol-0.7.1-orig/configure.ac wol-0.7.1/configure.ac
2+
--- wol-0.7.1-orig/configure.ac 2024-12-25 13:52:38.209314369 +0900
3+
+++ wol-0.7.1/configure.ac 2024-12-25 14:49:28.351829162 +0900
4+
@@ -60,6 +60,14 @@
5+
dnl check data types
6+
AC_CHECK_SIZEOF(unsigned char, 1)
7+
8+
+
9+
+dnl config.h.in defines defaults
10+
+AC_DEFINE([HAVE_STRUCT_ETHER_ADDR], 0, [struct ether_addr])
11+
+AC_DEFINE([HAVE_STRUCT_ETHER_ADDR_ETHER_ADDR_OCTET], 0, [struct ether_addr.ether_addr_octet])
12+
+AC_DEFINE([HAVE_STRUCT_ETHER_ADDR_OCTET], 0, [struct ether_addr.octet])
13+
+AC_DEFINE([HAVE_ETHER_HOSTTON], 0, [ether_hostton])
14+
+
15+
+
16+
ether_includes=""
17+
AC_CHECK_TYPE([struct ether_addr], , , [#include <netinet/ether.h>]) dnl Linux
18+
if test "$ac_cv_type_struct_ether_addr" = "yes"; then
19+
@@ -241,13 +249,6 @@
20+
dnl fi
21+
22+
23+
-dnl config.h.in defines
24+
-AC_DEFINE([HAVE_STRUCT_ETHER_ADDR], 0, [struct ether_addr])
25+
-AC_DEFINE([HAVE_STRUCT_ETHER_ADDR_ETHER_ADDR_OCTET], 0, [struct ether_addr.ether_addr_octet])
26+
-AC_DEFINE([HAVE_STRUCT_ETHER_ADDR_OCTET], 0, [struct ether_addr.octet])
27+
-AC_DEFINE([HAVE_ETHER_HOSTTON], 0, [ether_hostton])
28+
-
29+
-
30+
dnl full featured warnings
31+
CFLAGS="$CFLAGS -W -Wall -Wpointer-arith -Wimplicit-function-declaration"
32+
33+
diff -Naur wol-0.7.1-orig/m4/getline.m4 wol-0.7.1/m4/getline.m4
34+
--- wol-0.7.1-orig/m4/getline.m4 2024-12-25 17:22:11.442627544 +0900
35+
+++ wol-0.7.1/m4/getline.m4 2024-12-25 19:50:39.282552640 +0900
36+
@@ -27,7 +27,7 @@
37+
if (!in)
38+
return 1;
39+
len = getline (&line, &siz, in);
40+
- exit ((len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1);
41+
+ return (len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1;
42+
}
43+
], am_cv_func_working_getline=yes dnl The library version works.
44+
, am_cv_func_working_getline=no dnl The library version does NOT work.
45+
diff -Naur wol-0.7.1-orig/m4/malloc.m4 wol-0.7.1/m4/malloc.m4
46+
--- wol-0.7.1-orig/m4/malloc.m4 2024-12-25 13:52:38.182314099 +0900
47+
+++ wol-0.7.1/m4/malloc.m4 2024-12-25 14:31:34.627556193 +0900
48+
@@ -14,7 +14,7 @@
49+
50+
AC_CACHE_CHECK([for working malloc], jm_cv_func_working_malloc,
51+
[AC_TRY_RUN([
52+
- char *malloc ();
53+
+ #include <stdlib.h>
54+
int
55+
main ()
56+
{
57+
diff -Naur wol-0.7.1-orig/m4/realloc.m4 wol-0.7.1/m4/realloc.m4
58+
--- wol-0.7.1-orig/m4/realloc.m4 2024-12-25 13:52:38.185314129 +0900
59+
+++ wol-0.7.1/m4/realloc.m4 2024-12-25 14:36:55.421560103 +0900
60+
@@ -14,7 +14,7 @@
61+
62+
AC_CACHE_CHECK([for working realloc], jm_cv_func_working_realloc,
63+
[AC_TRY_RUN([
64+
- char *realloc ();
65+
+ #include <stdlib.h>
66+
int
67+
main ()
68+
{

pkgs/by-name/wo/wol/package.nix

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
lib,
33
stdenv,
44
fetchurl,
5+
autoreconfHook,
56
perl,
67
}:
78

@@ -14,8 +15,12 @@ stdenv.mkDerivation rec {
1415
sha256 = "08i6l5lr14mh4n3qbmx6kyx7vjqvzdnh3j9yfvgjppqik2dnq270";
1516
};
1617

17-
# for pod2man in order to get a manpage
18-
nativeBuildInputs = [ perl ];
18+
patches = [ ./gcc-14.patch ];
19+
20+
nativeBuildInputs = [
21+
perl # for pod2man in order to get a manpage
22+
autoreconfHook # for the patch
23+
];
1924

2025
enableParallelBuilding = true;
2126

0 commit comments

Comments
 (0)