gem-config.mathematical: add lasem to rpath

Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
This commit is contained in:
James Kay 2020-05-14 18:52:05 +01:00 committed by Dylan Baker
parent f3b5f40c81
commit b81f7f91fa

View File

@ -18,7 +18,7 @@
# (to make gems behave if necessary). # (to make gems behave if necessary).
{ lib, fetchurl, writeScript, ruby, kerberos, libxml2, libxslt, python, stdenv, which { lib, fetchurl, writeScript, ruby, kerberos, libxml2, libxslt, python, stdenv, which
, libiconv, postgresql, v8, clang, sqlite, zlib, imagemagick , libiconv, postgresql, v8, clang, sqlite, zlib, imagemagick, lasem
, pkg-config , ncurses, xapian, gpgme, util-linux, tzdata, icu, libffi , pkg-config , ncurses, xapian, gpgme, util-linux, tzdata, icu, libffi
, cmake, libssh2, openssl, libmysqlclient, darwin, git, perl, pcre, gecode_3, curl , cmake, libssh2, openssl, libmysqlclient, darwin, git, perl, pcre, gecode_3, curl
, msgpack, libsodium, snappy, libossp_uuid, lxc, libpcap, xorg, gtk2, buildRubyGem , msgpack, libsodium, snappy, libossp_uuid, lxc, libpcap, xorg, gtk2, buildRubyGem
@ -332,6 +332,7 @@ in
flex flex
pkg-config pkg-config
python3 python3
patchelf
]; ];
buildInputs = [ buildInputs = [
@ -356,12 +357,13 @@ in
$out/${ruby.gemPath}/extensions/*/*/mathematical-${attrs.version}/gem_make.out $out/${ruby.gemPath}/extensions/*/*/mathematical-${attrs.version}/gem_make.out
''; '';
# For some reason 'mathematical.so' is missing cairo and glib in its RPATH, add them explicitly here # For some reason 'mathematical.so' is missing cairo, glib, and
# lasem in its RPATH, add them explicitly here
postFixup = lib.optionalString stdenv.isLinux '' postFixup = lib.optionalString stdenv.isLinux ''
soPath="$out/${ruby.gemPath}/gems/mathematical-${attrs.version}/lib/mathematical/mathematical.so" soPath="$out/${ruby.gemPath}/gems/mathematical-${attrs.version}/lib/mathematical/mathematical.so"
${patchelf}/bin/patchelf \ rpath="$(patchelf --print-rpath "$soPath")"
--set-rpath "${lib.makeLibraryPath [ glib cairo ]}:$(${patchelf}/bin/patchelf --print-rpath "$soPath")" \ patchelf --set-rpath "${lib.makeLibraryPath [ lasem glib cairo ]}:$rpath" "$soPath"
"$soPath" patchelf --replace-needed liblasem.so liblasem-0.4.so "$soPath"
''; '';
}; };