ruby-modules/gem-config: patch h3 gem to use h3 from nixpkgs

This commit is contained in:
Diogo Correia
2026-01-12 12:56:24 +00:00
parent 8ad44a38da
commit 3fd55724a0
@@ -91,6 +91,7 @@
fribidi,
harfbuzz,
bison,
h3_3,
flex,
pango,
python3,
@@ -639,6 +640,21 @@ in
'';
};
h3 = attrs: {
# This gem attempts to build h3 using cmake, but fails because that is not in the path
# Use h3 from nixpkgs instead, and reduce closure size by deleting the h3 source code
dontBuild = false; # allow applying patches
postPatch = ''
substituteInPlace ext/h3/Makefile \
--replace-fail 'cd src; cmake . -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DBUILD_SHARED_LIBS=true -DBUILD_FILTERS=OFF -DBUILD_BENCHMARKS=OFF -DENABLE_LINTING=OFF; make' ':'
substituteInPlace lib/h3/bindings/base.rb \
--replace-fail '__dir__ + "/../../../ext/h3/src/lib"' '"${h3_3}/lib"'
'';
postInstall = ''
rm -rf $out/${ruby.gemPath}/gems/h3-${attrs.version}/ext/h3/src
'';
};
hiredis-client = attrs: {
buildInputs = [
openssl