summary refs log tree commit diff
path: root/pkgs/development/ruby-modules/gem-config/default.nix
diff options
context:
space:
mode:
authorMichael Peyton Jones <me@michaelpj.com>2019-07-04 12:39:29 +0100
committerMichael Peyton Jones <me@michaelpj.com>2019-07-04 13:16:03 +0100
commit5f0c43dea417cf3b3d8d4a5c268fc49fc4141296 (patch)
treec97b9820ebc38c09cf2def67fab7adff073931ba /pkgs/development/ruby-modules/gem-config/default.nix
parent73392e79aa62e406683d6a732eb4f4101f4732be (diff)
downloadnixpkgs-5f0c43dea417cf3b3d8d4a5c268fc49fc4141296.tar
nixpkgs-5f0c43dea417cf3b3d8d4a5c268fc49fc4141296.tar.gz
nixpkgs-5f0c43dea417cf3b3d8d4a5c268fc49fc4141296.tar.bz2
nixpkgs-5f0c43dea417cf3b3d8d4a5c268fc49fc4141296.tar.lz
nixpkgs-5f0c43dea417cf3b3d8d4a5c268fc49fc4141296.tar.xz
nixpkgs-5f0c43dea417cf3b3d8d4a5c268fc49fc4141296.tar.zst
nixpkgs-5f0c43dea417cf3b3d8d4a5c268fc49fc4141296.zip
asciidoctor: move mathematical gem config to default gemset config
This has two benefits:
- Anyone else using the `mathematical` gem will benefit from the config.
- The gem config overrides the default one, so we were losing the fixes
for other gems.

I had to change how the update script works. Now it looks at the `gems`
passthru from `bundlerApp`.
Diffstat (limited to 'pkgs/development/ruby-modules/gem-config/default.nix')
-rw-r--r--pkgs/development/ruby-modules/gem-config/default.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/pkgs/development/ruby-modules/gem-config/default.nix b/pkgs/development/ruby-modules/gem-config/default.nix
index 115739bd404..eb136d4c243 100644
--- a/pkgs/development/ruby-modules/gem-config/default.nix
+++ b/pkgs/development/ruby-modules/gem-config/default.nix
@@ -24,6 +24,7 @@
 , msgpack, qt59, libsodium, snappy, libossp_uuid, lxc, libpcap, xorg, gtk2, buildRubyGem
 , cairo, re2, rake, gobject-introspection, gdk_pixbuf, zeromq, czmq, graphicsmagick, libcxx
 , file, libvirt, glib, vips, taglib, libopus, linux-pam, libidn, protobuf, fribidi, harfbuzz
+, bison, flex, pango, python3, patchelf
 , libselinux ? null, libsepol ? null
 }@args:
 
@@ -245,6 +246,32 @@ in
     ];
   };
 
+  mathematical = attrs: {
+    buildInputs = [
+      cmake
+      bison
+      flex
+      glib
+      pkgconfig
+      cairo
+      pango
+      gdk_pixbuf
+      libxml2
+      python3
+    ];
+
+    # The ruby build script takes care of this
+    dontUseCmakeConfigure = true;
+
+    # For some reason 'mathematical.so' is missing cairo and glib in its RPATH, add them explicitly here
+    postFixup = lib.optionalString stdenv.isLinux ''
+      soPath="$out/${ruby.gemPath}/gems/mathematical-${attrs.version}/lib/mathematical/mathematical.so"
+      ${patchelf}/bin/patchelf \
+        --set-rpath "${lib.makeLibraryPath [ glib cairo ]}:$(${patchelf}/bin/patchelf --print-rpath "$soPath")" \
+        "$soPath"
+    '';
+  };
+
   magic = attrs: {
     buildInputs = [ file ];
     postInstall = ''