Files
nixpkgs/pkgs/development/ruby-modules/gem-config/default.nix
T

298 lines
7.8 KiB
Nix
Raw Normal View History

# The standard set of gems in nixpkgs including potential fixes.
#
# The gemset is derived from two points of entry:
# - An attrset describing a gem, including version, source and dependencies
# This is just meta data, most probably automatically generated by a tool
# like Bundix (https://github.com/aflatter/bundix).
# {
# name = "bundler";
# version = "1.6.5";
# sha256 = "1s4x0f5by9xs2y24jk6krq5ky7ffkzmxgr4z1nhdykdmpsi2zd0l";
# dependencies = [ "rake" ];
# }
# - An optional derivation that may override how the gem is built. For popular
# gems that don't behave correctly, fixes are already provided in the form of
# derivations.
#
# This seperates "what to build" (the exact gem versions) from "how to build"
# (to make gems behave if necessary).
2015-10-21 19:48:56 +02:00
{ lib, fetchurl, writeScript, ruby, kerberos, libxml2, libxslt, python, stdenv, which
2015-07-08 15:10:07 -07:00
, libiconv, postgresql, v8_3_16_14, clang, sqlite, zlib, imagemagick
2017-03-06 20:23:02 +01:00
, pkgconfig , ncurses, xapian_1_2_22, gpgme, utillinux, fetchpatch, tzdata, icu, libffi
2017-05-18 09:47:45 +09:00
, cmake, libssh2, openssl, mysql, darwin, git, perl, pcre, gecode_3, curl
, libmsgpack, qt48, libsodium, snappy, libossp_uuid, lxc, libpcap, xlibs, gtk2, buildRubyGem
2016-09-21 14:29:12 +02:00
}@args:
let
v8 = v8_3_16_14;
2017-05-12 08:52:18 -04:00
rainbow_rake = buildRubyGem {
name = "rake";
gemName = "rake";
remotes = ["https://rubygems.org"];
sha256 = "01j8fc9bqjnrsxbppncai05h43315vmz9fwg28qdsgcjw9ck1d7n";
type = "gem";
version = "12.0.0";
};
2014-10-28 04:16:14 +00:00
in
2014-10-28 04:16:14 +00:00
{
2017-05-18 09:47:45 +09:00
atk = attrs: { buildInputs = [ gtk2 pcre pkgconfig ]; };
2016-08-26 14:08:39 +01:00
bundler = attrs:
let
templates = "${attrs.ruby.gemPath}/gems/${attrs.gemName}-${attrs.version}/lib/bundler/templates/";
in {
# patching shebangs would fail on the templates/Executable file, so we
# temporarily remove the executable flag.
preFixup = "chmod -x $out/${templates}/Executable";
postFixup = ''
chmod +x $out/${templates}/Executable
# Allows to load another bundler version
sed -i -e "s/activate_bin_path/bin_path/g" $out/bin/bundle
'';
};
2017-05-18 09:47:45 +09:00
cairo = attrs: {
buildInputs = [ gtk2 pcre pkgconfig xlibs.libpthreadstubs xlibs.libXdmcp];
};
2016-03-21 12:01:37 +01:00
capybara-webkit = attrs: {
2016-04-17 22:35:04 +02:00
buildInputs = [ qt48 ];
2016-03-21 12:01:37 +01:00
};
2015-01-25 16:01:48 -05:00
charlock_holmes = attrs: {
2015-04-15 19:24:04 -04:00
buildInputs = [ which icu zlib ];
2015-01-25 16:01:48 -05:00
};
2015-11-14 21:17:29 -05:00
dep-selector-libgecode = attrs: {
USE_SYSTEM_GECODE = true;
postInstall = ''
installPath=$(cat $out/nix-support/gem-meta/install-path)
sed -i $installPath/lib/dep-selector-libgecode.rb -e 's@VENDORED_GECODE_DIR =.*@VENDORED_GECODE_DIR = "${gecode_3}"@'
'';
};
2016-01-25 10:22:00 +00:00
eventmachine = attrs: {
buildInputs = [ openssl ];
};
2015-01-25 16:01:48 -05:00
ffi = attrs: {
buildInputs = [ libffi pkgconfig ];
};
2015-01-21 20:33:19 -05:00
gpgme = attrs: {
buildInputs = [ gpgme ];
};
2017-05-18 09:47:45 +09:00
gio2 = attrs: { buildInputs = [ gtk2 pcre pkgconfig ]; };
glib2 = attrs: { buildInputs = [ gtk2 pcre pkgconfig ]; };
gtk2 = attrs: {
buildInputs = [ gtk2 pcre pkgconfig xlibs.libpthreadstubs xlibs.libXdmcp];
# CFLAGS must be set for this gem to detect gdkkeysyms.h correctly
CFLAGS = "-I${gtk2.dev}/include/gtk-2.0 -I/non-existent-path";
};
gobject-introspection = attrs: { buildInputs = [ gtk2 pcre pkgconfig ]; };
2016-05-04 16:41:44 -06:00
hitimes = attrs: {
buildInputs =
stdenv.lib.optionals stdenv.isDarwin
[ darwin.apple_sdk.frameworks.CoreServices ];
};
2017-03-03 21:09:04 -05:00
# disable bundle install as it can't install anything in addition to what is
2017-03-03 23:05:37 -05:00
# specified in pkgs/applications/misc/jekyll/Gemfile anyway. Also do chmod_R
# to compensate for read-only files in site_template in nix store.
2017-03-03 21:09:04 -05:00
jekyll = attrs: {
postInstall = ''
installPath=$(cat $out/nix-support/gem-meta/install-path)
2017-03-03 23:05:37 -05:00
sed -i $installPath/lib/jekyll/commands/new.rb \
-e 's@Exec.run("bundle", "install"@Exec.run("true"@' \
-e 's@FileUtils.cp_r site_template + "/.", path@FileUtils.cp_r site_template + "/.", path; FileUtils.chmod_R "u+w", path@'
2017-03-03 21:09:04 -05:00
'';
};
2015-11-14 21:17:29 -05:00
# note that you need version >= v3.16.14.8,
# otherwise the gem will fail to link to the libv8 binary.
# see: https://github.com/cowboyd/libv8/pull/161
2014-10-28 04:16:14 +00:00
libv8 = attrs: {
buildInputs = [ which v8 python ];
2015-11-14 21:17:29 -05:00
buildFlags = [ "--with-system-v8=true" ];
2015-01-21 20:33:19 -05:00
};
2016-01-25 10:22:00 +00:00
msgpack = attrs: {
buildInputs = [ libmsgpack ];
};
2017-03-06 20:23:02 +01:00
2016-11-03 17:19:25 -07:00
mysql = attrs: {
buildInputs = [ mysql.lib zlib openssl ];
};
2016-01-25 10:22:00 +00:00
2015-01-25 16:01:48 -05:00
mysql2 = attrs: {
buildInputs = [ mysql.lib zlib openssl ];
2015-01-25 16:01:48 -05:00
};
2015-01-21 20:33:19 -05:00
ncursesw = attrs: {
buildInputs = [ ncurses ];
buildFlags = [
2015-10-05 20:32:54 +02:00
"--with-cflags=-I${ncurses.dev}/include"
2016-02-01 11:16:50 -06:00
"--with-ldflags=-L${ncurses.out}/lib"
2015-01-21 20:33:19 -05:00
];
2014-10-28 04:16:14 +00:00
};
nokogiri = attrs: {
buildFlags = [
"--use-system-libraries"
"--with-zlib-dir=${zlib.dev}"
"--with-xml2-lib=${libxml2.out}/lib"
"--with-xml2-include=${libxml2.dev}/include/libxml2"
"--with-xslt-lib=${libxslt.out}/lib"
"--with-xslt-include=${libxslt.dev}/include"
"--with-exslt-lib=${libxslt.out}/lib"
"--with-exslt-include=${libxslt.dev}/include"
2015-01-21 22:38:29 -05:00
] ++ lib.optional stdenv.isDarwin "--with-iconv-dir=${libiconv}";
2014-10-29 01:16:02 +00:00
};
2017-05-18 09:47:45 +09:00
pango = attrs: {
buildInputs = [ gtk2 xlibs.libXdmcp pcre pkgconfig xlibs.libpthreadstubs ];
};
2015-11-14 21:17:29 -05:00
patron = attrs: {
buildInputs = [ curl ];
};
2017-05-14 22:07:26 +01:00
pcaprub = attrs: {
buildInputs = [ libpcap ];
};
2014-10-29 01:16:02 +00:00
pg = attrs: {
buildFlags = [
"--with-pg-config=${postgresql}/bin/pg_config"
];
};
2015-11-14 21:17:29 -05:00
puma = attrs: {
buildInputs = [ openssl ];
};
2017-05-12 08:52:18 -04:00
rainbow = attrs: {
buildInputs = [ rainbow_rake ];
};
2016-06-16 19:33:12 +02:00
rbnacl = spec: {
postInstall = ''
sed -i $(cat $out/nix-support/gem-meta/install-path)/lib/rbnacl.rb -e "2a \
RBNACL_LIBSODIUM_GEM_LIB_PATH = '${libsodium.out}/lib/libsodium.${if stdenv.isDarwin then "dylib" else "so"}'
"
'';
};
2014-10-29 01:16:02 +00:00
rmagick = attrs: {
buildInputs = [ imagemagick pkgconfig which ];
2014-10-29 01:16:02 +00:00
};
ruby-lxc = attrs: {
buildInputs = [ lxc ];
};
2015-10-16 04:20:38 +05:30
ruby-terminfo = attrs: {
buildInputs = [ ncurses ];
buildFlags = [
"--with-cflags=-I${ncurses.dev}/include"
"--with-ldflags=-L${ncurses.out}/lib"
];
};
2015-01-25 16:01:48 -05:00
rugged = attrs: {
buildInputs = [ cmake pkgconfig openssl libssh2 zlib ];
};
scrypt = attrs:
if stdenv.isDarwin then {
dontBuild = false;
postPatch = ''
sed -i -e "s/-arch i386//" Rakefile ext/scrypt/Rakefile
'';
} else {};
sequel_pg = attrs: {
buildInputs = [ postgresql ];
};
2016-09-21 14:29:12 +02:00
snappy = attrs: {
buildInputs = [ args.snappy ];
};
2014-10-29 01:16:02 +00:00
sqlite3 = attrs: {
buildFlags = [
2015-10-13 22:30:30 +02:00
"--with-sqlite3-include=${sqlite.dev}/include"
"--with-sqlite3-lib=${sqlite.out}/lib"
2014-10-28 04:16:14 +00:00
];
};
2015-01-21 20:33:19 -05:00
sup = attrs: {
2015-11-14 21:17:29 -05:00
dontBuild = false;
2015-01-21 20:33:19 -05:00
# prevent sup from trying to dynamically install `xapian-ruby`.
postPatch = ''
cp ${./mkrf_conf_xapian.rb} ext/mkrf_conf_xapian.rb
substituteInPlace lib/sup/crypto.rb \
--replace 'which gpg2' \
'${which}/bin/which gpg2'
'';
};
2017-05-14 22:13:55 +01:00
rb-readline = attrs: {
dontBuild = false;
postPatch = ''
substituteInPlace lib/rbreadline.rb \
--replace 'infocmp' '${ncurses.dev}/bin/infocmp'
'';
};
2015-10-21 19:48:56 +02:00
timfel-krb5-auth = attrs: {
buildInputs = [ kerberos ];
};
2014-10-28 04:16:14 +00:00
therubyracer = attrs: {
buildFlags = [
2015-01-21 20:33:19 -05:00
"--with-v8-dir=${v8}"
"--with-v8-include=${v8}/include"
2014-10-28 04:16:14 +00:00
"--with-v8-lib=${v8}/lib"
];
};
2015-01-21 20:33:19 -05:00
2016-06-16 11:43:21 +02:00
typhoeus = attrs: {
buildInputs = [ curl ];
};
2017-04-06 16:14:45 +02:00
tzinfo = attrs: lib.optionalAttrs (lib.versionAtLeast attrs.version "1.0") {
2015-11-14 21:17:29 -05:00
dontBuild = false;
2015-01-24 17:59:01 -05:00
postPatch = ''
substituteInPlace lib/tzinfo/zoneinfo_data_source.rb \
2015-01-25 16:01:48 -05:00
--replace "/usr/share/zoneinfo" "${tzdata}/share/zoneinfo"
2015-01-24 17:59:01 -05:00
'';
};
2017-03-06 20:23:02 +01:00
2016-11-21 13:41:05 +01:00
uuid4r = attrs: {
buildInputs = [ which libossp_uuid ];
};
2015-01-24 17:59:01 -05:00
2015-01-21 20:33:19 -05:00
xapian-ruby = attrs: {
# use the system xapian
2015-11-14 21:17:29 -05:00
dontBuild = false;
2017-03-06 20:23:02 +01:00
buildInputs = [ xapian_1_2_22 pkgconfig zlib ];
2015-01-21 20:33:19 -05:00
postPatch = ''
cp ${./xapian-Rakefile} Rakefile
'';
preInstall = ''
2017-03-06 20:23:02 +01:00
export XAPIAN_CONFIG=${xapian_1_2_22}/bin/xapian-config
2015-01-21 20:33:19 -05:00
'';
};
2016-04-17 22:36:40 +02:00
2014-10-28 04:16:14 +00:00
}