rubyPackages.rdiscount: use lib from pkgs.discount

This commit is contained in:
Vincent Haupert 2022-01-18 16:27:04 +01:00
parent 57fd0ad582
commit c859908cd6
2 changed files with 26 additions and 1 deletions

View File

@ -26,7 +26,7 @@
, file, libvirt, glib, vips, taglib, libopus, linux-pam, libidn, protobuf, fribidi, harfbuzz
, bison, flex, pango, python3, patchelf, binutils, freetds, wrapGAppsHook, atk
, bundler, libsass, libexif, libselinux, libsepol, shared-mime-info, libthai, libdatrie
, CoreServices, DarwinTools, cctools, libtool
, CoreServices, DarwinTools, cctools, libtool, discount
}@args:
let
@ -135,6 +135,17 @@ in
hardeningDisable = [ "format" ];
};
rdiscount = attrs: {
# Use discount from nixpkgs instead of vendored version
dontBuild = false;
buildInputs = [ discount ];
patches = [
# Adapted from Debian:
# https://sources.debian.org/data/main/r/ruby-rdiscount/2.1.8-1/debian/patches/01_use-system-libmarkdown.patch
./rdiscount-use-nixpkgs-libmarkdown.patch
];
};
ethon = attrs: {
dontBuild = false;
postPatch = ''

View File

@ -0,0 +1,14 @@
diff --git a/ext/extconf.rb b/ext/extconf.rb
index 30764cb..b87ac2b 100644
--- a/ext/extconf.rb
+++ b/ext/extconf.rb
@@ -46,4 +46,9 @@ if /mswin/.match RbConfig::CONFIG['host_os']
$defs.push("-Dinline=__inline")
end
+$srcs = %w[
+ rdiscount.c
+]
+have_library('markdown')
+
create_makefile('rdiscount')