Merge pull request #265287 from reckenrode/darwin-fixes-batch1

perlPackages.Gtk2, scheme48, smpeg, stfl: fix build with clang 16

authored by K900 and committed by GitHub d0a60851 2c3155e9

+125 -1
+9
pkgs/development/interpreters/scheme48/default.nix
··· 14 14 substituteInPlace build/build-usual-image --replace '"(made by $USER on $date)"' '""' 15 15 ''; 16 16 17 + # Silence warnings related to use of implicitly declared library functions and implicit ints. 18 + # TODO: Remove and/or fix with patches the next time this package is updated. 19 + env = lib.optionalAttrs stdenv.cc.isClang { 20 + NIX_CFLAGS_COMPILE = toString [ 21 + "-Wno-error=implicit-function-declaration" 22 + "-Wno-error=implicit-int" 23 + ]; 24 + }; 25 + 17 26 meta = with lib; { 18 27 homepage = "https://s48.org/"; 19 28 description = "Scheme 48 interpreter for R5RS";
+17 -1
pkgs/development/libraries/smpeg/default.nix
··· 1 - { lib, stdenv, fetchFromGitHub, SDL, autoconf, automake, libtool, gtk2, m4, pkg-config, libGLU, libGL, makeWrapper }: 1 + { lib, stdenv, fetchFromGitHub, fetchpatch, SDL, autoconf, automake, libtool, gtk2, m4, pkg-config, libGLU, libGL, makeWrapper }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "smpeg"; ··· 16 16 ./gcc6.patch 17 17 ./libx11.patch 18 18 ./gtk.patch 19 + # These patches remove use of the `register` storage class specifier, 20 + # allowing smpeg to build with clang 16, which defaults to C++17. 21 + (fetchpatch { 22 + url = "https://github.com/icculus/smpeg/commit/cc114ba0dd8644c0d6205bbce2384781daeff44b.patch"; 23 + hash = "sha256-GxSD82j05pw0r2SxmPYAe/BXX4iUc+iHWhB9Ap4GzfA="; 24 + }) 25 + (fetchpatch { 26 + url = "https://github.com/icculus/smpeg/commit/b369feca5bf99d6cff50d8eb316395ef48acf24f.patch"; 27 + hash = "sha256-U+a6dbc5cm249KlUcf4vi79yUiT4hgEvMv522K4PqUc="; 28 + }) 19 29 ]; 30 + 31 + postPatch = '' 32 + substituteInPlace video/gdith.cpp \ 33 + --replace 'register int' 'int' \ 34 + --replace 'register Uint16' 'Uint16' 35 + ''; 20 36 21 37 enableParallelBuilding = true; 22 38
+9
pkgs/development/libraries/stfl/default.nix
··· 13 13 14 14 buildInputs = [ ncurses libiconv ]; 15 15 16 + # Silence warnings related to use of implicitly declared library functions and implicit ints. 17 + # TODO: Remove and/or fix with patches the next time this package is updated. 18 + env = lib.optionalAttrs stdenv.cc.isClang { 19 + NIX_CFLAGS_COMPILE = toString [ 20 + "-Wno-error=implicit-function-declaration" 21 + "-Wno-error=implicit-int" 22 + ]; 23 + }; 24 + 16 25 preBuild = '' 17 26 sed -i s/gcc/cc/g Makefile 18 27 sed -i s%ncursesw/ncurses.h%ncurses.h% stfl_internals.h
+86
pkgs/development/perl-modules/Gtk2-fix-incompatible-pointer-conversion.patch
··· 1 + diff -ur a/gdk.typemap b/gdk.typemap 2 + --- a/gdk.typemap 2017-05-21 15:02:54.000000000 -0400 3 + +++ b/gdk.typemap 2023-11-03 13:17:43.717890172 -0400 4 + @@ -23,6 +23,7 @@ 5 + TYPEMAP 6 + 7 + # can be either a pointer or an integer, this handles both cases 8 + +uintptr_t T_UV 9 + GdkNativeWindow T_UV 10 + 11 + # GdkBitmap doesn't get its own type id, but needs to be treated separately. 12 + diff -ur a/xs/GdkDnd.xs b/xs/GdkDnd.xs 13 + --- a/xs/GdkDnd.xs 2017-05-21 15:02:54.000000000 -0400 14 + +++ b/xs/GdkDnd.xs 2023-11-03 13:23:22.478329089 -0400 15 + @@ -142,12 +142,12 @@ 16 + void 17 + gdk_drag_get_protocol_for_display (class, display, xid) 18 + GdkDisplay *display 19 + - guint32 xid 20 + + uintptr_t xid 21 + PREINIT: 22 + GdkDragProtocol protocol; 23 + - guint32 ret; 24 + + uintptr_t ret; 25 + PPCODE: 26 + - ret = gdk_drag_get_protocol_for_display (display, xid, &protocol); 27 + + ret = (uintptr_t)gdk_drag_get_protocol_for_display (display, INT2PTR(GdkNativeWindow, xid), &protocol); 28 + XPUSHs (sv_2mortal (newSVuv (ret))); 29 + XPUSHs (sv_2mortal (ret 30 + ? newSVGdkDragProtocol (protocol) 31 + @@ -184,12 +184,12 @@ 32 + =cut 33 + void 34 + gdk_drag_get_protocol (class, xid) 35 + - guint32 xid 36 + + uintptr_t xid 37 + PREINIT: 38 + GdkDragProtocol protocol; 39 + - guint32 ret; 40 + + uintptr_t ret; 41 + PPCODE: 42 + - ret = gdk_drag_get_protocol (xid, &protocol); 43 + + ret = (uintptr_t)gdk_drag_get_protocol (INT2PTR(GdkNativeWindow, xid), &protocol); 44 + XPUSHs (sv_2mortal (newSVuv (ret))); 45 + XPUSHs (sv_2mortal (newSVGdkDragProtocol (protocol))); 46 + 47 + diff -ur a/xs/GdkSelection.xs b/xs/GdkSelection.xs 48 + --- a/xs/GdkSelection.xs 2017-05-21 15:02:54.000000000 -0400 49 + +++ b/xs/GdkSelection.xs 2023-11-03 13:26:58.976888906 -0400 50 + @@ -147,7 +147,7 @@ 51 + ## void gdk_selection_send_notify (guint32 requestor, GdkAtom selection, GdkAtom target, GdkAtom property, guint32 time_) 52 + void 53 + gdk_selection_send_notify (class, requestor, selection, target, property, time_) 54 + - guint32 requestor 55 + + GdkNativeWindow requestor 56 + GdkAtom selection 57 + GdkAtom target 58 + GdkAtom property 59 + @@ -161,7 +161,7 @@ 60 + void 61 + gdk_selection_send_notify_for_display (class, display, requestor, selection, target, property, time_) 62 + GdkDisplay *display 63 + - guint32 requestor 64 + + GdkNativeWindow requestor 65 + GdkAtom selection 66 + GdkAtom target 67 + GdkAtom property 68 + diff -ur a/xs/GtkWindow.xs b/xs/GtkWindow.xs 69 + --- a/xs/GtkWindow.xs 2017-05-21 15:02:54.000000000 -0400 70 + +++ b/xs/GtkWindow.xs 2023-11-03 13:32:53.673168678 -0400 71 + @@ -581,13 +581,13 @@ 72 + void 73 + gtk_window_remove_embedded_xid (window, xid) 74 + GtkWindow * window 75 + - guint xid 76 + + GdkNativeWindow xid 77 + 78 + ## void gtk_window_add_embedded_xid (GtkWindow *window, guint xid) 79 + void 80 + gtk_window_add_embedded_xid (window, xid) 81 + GtkWindow * window 82 + - guint xid 83 + + GdkNativeWindow xid 84 + 85 + ##void gtk_window_reshow_with_initial_size (GtkWindow *window) 86 + void
+4
pkgs/top-level/perl-packages.nix
··· 11121 11121 url = "mirror://cpan/authors/id/X/XA/XAOC/Gtk2-1.24993.tar.gz"; 11122 11122 hash = "sha256-ScRDdDsu7+EadoACck9/akxI78lP8806VZ+357aTyWc="; 11123 11123 }; 11124 + patches = [ 11125 + # Fix incompatible function pointer conversion (assigning `GdkNativeWindow` to `guint32`). 11126 + ../development/perl-modules/Gtk2-fix-incompatible-pointer-conversion.patch 11127 + ]; 11124 11128 buildInputs = [ pkgs.gtk2 ]; 11125 11129 # https://rt.cpan.org/Public/Bug/Display.html?id=130742 11126 11130 # doCheck = !stdenv.isDarwin;