summary refs log tree commit diff
path: root/pkgs/development/ruby-modules
diff options
context:
space:
mode:
authorVincent Haupert <mail@vincent-haupert.de>2022-01-18 16:27:04 +0100
committerVincent Haupert <mail@vincent-haupert.de>2022-01-19 14:06:28 +0100
commitc859908cd68d842b6204d9fe6521e911f57e565e (patch)
treedd5e4908ece927d2fa00639dc653f1efd195ed98 /pkgs/development/ruby-modules
parent57fd0ad582bc15ca007106853f579824ca9ffb31 (diff)
downloadnixpkgs-c859908cd68d842b6204d9fe6521e911f57e565e.tar
nixpkgs-c859908cd68d842b6204d9fe6521e911f57e565e.tar.gz
nixpkgs-c859908cd68d842b6204d9fe6521e911f57e565e.tar.bz2
nixpkgs-c859908cd68d842b6204d9fe6521e911f57e565e.tar.lz
nixpkgs-c859908cd68d842b6204d9fe6521e911f57e565e.tar.xz
nixpkgs-c859908cd68d842b6204d9fe6521e911f57e565e.tar.zst
nixpkgs-c859908cd68d842b6204d9fe6521e911f57e565e.zip
rubyPackages.rdiscount: use lib from `pkgs.discount`
Diffstat (limited to 'pkgs/development/ruby-modules')
-rw-r--r--pkgs/development/ruby-modules/gem-config/default.nix13
-rw-r--r--pkgs/development/ruby-modules/gem-config/rdiscount-use-nixpkgs-libmarkdown.patch14
2 files changed, 26 insertions, 1 deletions
diff --git a/pkgs/development/ruby-modules/gem-config/default.nix b/pkgs/development/ruby-modules/gem-config/default.nix
index 64b9d9ca4c2..a3d787ad8e9 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 00000000000..3539b80ae37
--- /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')