diff --git a/pkgs/development/ruby-modules/gem-config/default.nix b/pkgs/development/ruby-modules/gem-config/default.nix index 64b9d9ca4c22..a3d787ad8e9f 100644 --- a/pkgs/development/ruby-modules/gem-config/default.nix +++ b/pkgs/development/ruby-modules/gem-config/default.nix @@ -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 = '' diff --git a/pkgs/development/ruby-modules/gem-config/rdiscount-use-nixpkgs-libmarkdown.patch b/pkgs/development/ruby-modules/gem-config/rdiscount-use-nixpkgs-libmarkdown.patch new file mode 100644 index 000000000000..3539b80ae374 --- /dev/null +++ b/pkgs/development/ruby-modules/gem-config/rdiscount-use-nixpkgs-libmarkdown.patch @@ -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')