Merge pull request #270725 from mfrischknecht/fix-mpdcron-build

mpdcron: fix build by correcting a C function conflict in nokogiri

authored by Silvan Mosberger and committed by GitHub c1121a93 094017d1

+35
+22
pkgs/tools/audio/mpdcron/fix-canonicalize-conflict-with-glibc.patch
···
··· 1 + diff --git a/ext/nokogiri/xml_document.c b/ext/nokogiri/xml_document.c 2 + index 1d2119c8..c1c87713 100644 3 + --- a/ext/nokogiri/xml_document.c 4 + +++ b/ext/nokogiri/xml_document.c 5 + @@ -492,7 +492,7 @@ static int block_caller(void * ctx, xmlNodePtr _node, xmlNodePtr _parent) 6 + * The block must return a non-nil, non-false value if the +obj+ passed in 7 + * should be included in the canonicalized document. 8 + */ 9 + -static VALUE canonicalize(int argc, VALUE* argv, VALUE self) 10 + +static VALUE nokogiri_xml_document_canonicalize(int argc, VALUE* argv, VALUE self) 11 + { 12 + VALUE mode; 13 + VALUE incl_ns; 14 + @@ -573,7 +573,7 @@ void init_xml_document() 15 + rb_define_method(klass, "encoding", encoding, 0); 16 + rb_define_method(klass, "encoding=", set_encoding, 1); 17 + rb_define_method(klass, "version", version, 0); 18 + - rb_define_method(klass, "canonicalize", canonicalize, -1); 19 + + rb_define_method(klass, "nokogiri_xml_document_canonicalize", canonicalize, -1); 20 + rb_define_method(klass, "dup", duplicate_document, -1); 21 + rb_define_method(klass, "url", url, 0); 22 + rb_define_method(klass, "create_entity", create_entity, -1);
+13
pkgs/tools/audio/mpdcron/gemset.nix
··· 18 sha256 = "02bjydih0j515szfv9mls195cvpyidh6ixm7dwbl3s2sbaxxk5s4"; 19 type = "gem"; 20 }; 21 version = "1.10.3"; 22 }; 23 }
··· 18 sha256 = "02bjydih0j515szfv9mls195cvpyidh6ixm7dwbl3s2sbaxxk5s4"; 19 type = "gem"; 20 }; 21 + 22 + dontBuild = false; 23 + patches = [ 24 + # Fixes a naming conflict of nokogiri's `canonicalize` function 25 + # with one defined in glibc. This has been fixed upstream in 2020 26 + # in a much newer version (1.15.5), but through the divergence 27 + # of the affected file, the commit isn't directly applicable to 28 + # the one packaged here: 29 + # 30 + # https://github.com/sparklemotion/nokogiri/pull/2106/commits/7a74cdbe4538e964023e5a0fdca58d8af708b91e 31 + # https://github.com/sparklemotion/nokogiri/issues/2105 32 + ./fix-canonicalize-conflict-with-glibc.patch 33 + ]; 34 version = "1.10.3"; 35 }; 36 }