Merge pull request #330053 from reckenrode/ruby-package-fixes

This commit is contained in:
Randy Eckenrode 2024-07-30 09:30:38 -04:00 committed by GitHub
commit 3d7db28279
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 75 additions and 6 deletions

View File

@ -17,11 +17,11 @@
# This separates "what to build" (the exact gem versions) from "how to build"
# (to make gems behave if necessary).
{ lib, fetchurl, writeScript, ruby, libkrb5, libxml2, libxslt, python2, stdenv, which
{ lib, fetchurl, fetchpatch2, writeScript, ruby, libkrb5, libxml2, libxslt, python2, stdenv, which
, libiconv, postgresql, nodejs, clang, sqlite, zlib, imagemagick, lasem
, pkg-config , ncurses, xapian, gpgme, util-linux, tzdata, icu, libffi
, cmake, libssh2, openssl, openssl_1_1, libmysqlclient, git, perl, pcre, pcre2, gecode_3, curl
, libsodium, snappy, libossp_uuid, lxc, libpcap, xorg, gtk2, gtk3, buildRubyGem
, libsodium, snappy, libossp_uuid, lxc, libpcap, xorg, gtk2, gtk3, lerc, buildRubyGem
, cairo, expat, re2, rake, gobject-introspection, gdk-pixbuf, zeromq, czmq, graphicsmagick, libcxx
, file, libvirt, glib, vips, taglib, libopus, linux-pam, libidn, protobuf, fribidi, harfbuzz
, bison, flex, pango, python3, patchelf, binutils, freetds, wrapGAppsHook3, atk
@ -126,7 +126,16 @@ in
};
curses = attrs: {
dontBuild = false;
buildInputs = [ ncurses ];
patches = lib.optionals (lib.versionOlder attrs.version "1.4.5") [
# Fixes incompatible function pointer type error with clang 16. Fixed in 1.4.5 and newer.
# Upstream issue: https://github.com/ruby/curses/issues/85
(fetchpatch2 {
url = "https://github.com/ruby/curses/commit/13e00d07c3aaed83d5f138cf268cc33c9f025d0e.patch?full_index=1";
hash = "sha256-ZJ2egqj3Uwmi4KrF79dtwczpwUqFCp52/xQYUymYDmc=";
})
];
};
dep-selector-libgecode = attrs: {
@ -379,6 +388,7 @@ in
gtk3
cairo
harfbuzz
lerc
libdatrie
libthai
pcre
@ -447,9 +457,20 @@ in
buildInputs = lib.optionals stdenv.isDarwin [ CoreServices ];
};
hpricot = attrs: {
dontBuild = false;
patches = [
# Fix incompatible function pointer conversion errors with clang 16
./hpricot-fix-incompatible-function-pointer-conversion.patch
];
};
iconv = attrs: {
dontBuild = false;
buildFlags = lib.optional stdenv.isDarwin "--with-iconv-dir=${libiconv}";
buildFlags = lib.optionals stdenv.isDarwin [
"--with-iconv-dir=${lib.getLib libiconv}"
"--with-iconv-include=${lib.getDev libiconv}/include"
];
patches = [
# Fix incompatible function pointer conversion errors with clang 16
./iconv-fix-incompatible-function-pointer-conversions.patch
@ -504,8 +525,8 @@ in
"--with-xml2-lib=${libxml2.out}/lib"
"--with-xml2-include=${libxml2.dev}/include/libxml2"
] ++ lib.optionals stdenv.isDarwin [
"--with-iconv-dir=${libiconv}"
"--with-opt-include=${libiconv}/include"
"--with-iconv-dir=${lib.getLib libiconv}"
"--with-opt-include=${lib.getDev libiconv}/include"
];
};

View File

@ -0,0 +1,48 @@
diff --git a/ext/fast_xs/fast_xs.c b/ext/fast_xs/fast_xs.c
index 11ef71f..d5eb8d8 100644
--- a/ext/fast_xs/fast_xs.c
+++ b/ext/fast_xs/fast_xs.c
@@ -144,7 +144,7 @@ static VALUE unpack_utf8(VALUE self)
return rb_funcall(self, unpack_id, 1, U_fmt);
}
-static VALUE unpack_uchar(VALUE self)
+static VALUE unpack_uchar(VALUE self, VALUE _exn)
{
return rb_funcall(self, unpack_id, 1, C_fmt);
}
diff --git a/ext/hpricot_scan/hpricot_scan.c b/ext/hpricot_scan/hpricot_scan.c
index f11cbb5..161ebd4 100644
--- a/ext/hpricot_scan/hpricot_scan.c
+++ b/ext/hpricot_scan/hpricot_scan.c
@@ -22,7 +22,7 @@ struct hpricot_struct {
#define RSTRING_PTR(str) RSTRING(str)->ptr
#endif
-VALUE hpricot_css(VALUE, VALUE, VALUE, VALUE, VALUE);
+VALUE hpricot_css(VALUE, VALUE, VALUE, VALUE);
#define NO_WAY_SERIOUSLY "*** This should not happen, please file a bug report with the HTML you're parsing at http://github.com/hpricot/hpricot/issues. So sorry!"
diff --git a/ext/hpricot_scan/hpricot_scan.rl b/ext/hpricot_scan/hpricot_scan.rl
index 0f17f11..8b00a38 100644
--- a/ext/hpricot_scan/hpricot_scan.rl
+++ b/ext/hpricot_scan/hpricot_scan.rl
@@ -20,7 +20,7 @@ struct hpricot_struct {
#define RSTRING_PTR(str) RSTRING(str)->ptr
#endif
-VALUE hpricot_css(VALUE, VALUE, VALUE, VALUE, VALUE);
+VALUE hpricot_css(VALUE, VALUE, VALUE, VALUE);
#define NO_WAY_SERIOUSLY "*** This should not happen, please file a bug report with the HTML you're parsing at http://github.com/hpricot/hpricot/issues. So sorry!"
@@ -806,7 +806,7 @@ make_hpricot_struct(VALUE members, VALUE (*alloc)(VALUE klass))
for (i = 0; i < len; i++) {
ID id = SYM2ID(rb_ary_entry(members, i));
const char* name = rb_id2name(id);
- int len = strlen(name);
+ size_t len = strlen(name);
memcpy(attr_set, name, strlen(name));
attr_set[len] = '=';

View File

@ -1244,7 +1244,7 @@
version = "2.0.24";
};
gtk3 = {
dependencies = ["atk" "gdk3"];
dependencies = ["atk" "cairo" "gdk3"];
groups = ["default"];
platforms = [];
source = {