nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1# The standard set of gems in nixpkgs including potential fixes.
2#
3# The gemset is derived from two points of entry:
4# - An attrset describing a gem, including version, source and dependencies
5# This is just meta data, most probably automatically generated by a tool
6# like Bundix (https://github.com/aflatter/bundix).
7# {
8# name = "bundler";
9# version = "1.6.5";
10# sha256 = "1s4x0f5by9xs2y24jk6krq5ky7ffkzmxgr4z1nhdykdmpsi2zd0l";
11# dependencies = [ "rake" ];
12# }
13# - An optional derivation that may override how the gem is built. For popular
14# gems that don't behave correctly, fixes are already provided in the form of
15# derivations.
16#
17# This seperates "what to build" (the exact gem versions) from "how to build"
18# (to make gems behave if necessary).
19
20{ lib, fetchurl, writeScript, ruby, kerberos, libxml2, libxslt, python, stdenv, which
21, libiconv, postgresql, v8_3_16_14, clang, sqlite, zlib, imagemagick
22, pkgconfig , ncurses, xapian_1_2_22, gpgme, utillinux, fetchpatch, tzdata, icu, libffi
23, cmake, libssh2, openssl, mysql, darwin, git, perl, pcre, gecode_3, curl
24, libmsgpack, qt48, libsodium, snappy, libossp_uuid, lxc, libpcap, xlibs, gtk2, buildRubyGem
25, re2
26}@args:
27
28let
29 v8 = v8_3_16_14;
30
31 rainbow_rake = buildRubyGem {
32 name = "rake";
33 gemName = "rake";
34 remotes = ["https://rubygems.org"];
35 sha256 = "01j8fc9bqjnrsxbppncai05h43315vmz9fwg28qdsgcjw9ck1d7n";
36 type = "gem";
37 version = "12.0.0";
38 };
39in
40
41{
42 atk = attrs: { buildInputs = [ gtk2 pcre pkgconfig ]; };
43
44 bundler = attrs:
45 let
46 templates = "${attrs.ruby.gemPath}/gems/${attrs.gemName}-${attrs.version}/lib/bundler/templates/";
47 in {
48 # patching shebangs would fail on the templates/Executable file, so we
49 # temporarily remove the executable flag.
50 preFixup = "chmod -x $out/${templates}/Executable";
51 postFixup = ''
52 chmod +x $out/${templates}/Executable
53
54 # Allows to load another bundler version
55 sed -i -e "s/activate_bin_path/bin_path/g" $out/bin/bundle
56 '';
57 };
58
59 cairo = attrs: {
60 buildInputs = [ gtk2 pcre pkgconfig xlibs.libpthreadstubs xlibs.libXdmcp];
61 };
62
63 capybara-webkit = attrs: {
64 buildInputs = [ qt48 ];
65 };
66
67 charlock_holmes = attrs: {
68 buildInputs = [ which icu zlib ];
69 };
70
71 curb = attrs: {
72 buildInputs = [ curl ];
73 };
74
75 dep-selector-libgecode = attrs: {
76 USE_SYSTEM_GECODE = true;
77 postInstall = ''
78 installPath=$(cat $out/nix-support/gem-meta/install-path)
79 sed -i $installPath/lib/dep-selector-libgecode.rb -e 's@VENDORED_GECODE_DIR =.*@VENDORED_GECODE_DIR = "${gecode_3}"@'
80 '';
81 };
82
83 eventmachine = attrs: {
84 buildInputs = [ openssl ];
85 };
86
87 ffi = attrs: {
88 buildInputs = [ libffi pkgconfig ];
89 };
90
91 gpgme = attrs: {
92 buildInputs = [ gpgme ];
93 };
94
95 gio2 = attrs: { buildInputs = [ gtk2 pcre pkgconfig ]; };
96
97 gitlab-markup = attrs: { meta.priority = 1; };
98
99 glib2 = attrs: { buildInputs = [ gtk2 pcre pkgconfig ]; };
100
101 gtk2 = attrs: {
102 buildInputs = [ gtk2 pcre pkgconfig xlibs.libpthreadstubs xlibs.libXdmcp];
103 # CFLAGS must be set for this gem to detect gdkkeysyms.h correctly
104 CFLAGS = "-I${gtk2.dev}/include/gtk-2.0 -I/non-existent-path";
105 };
106
107 gobject-introspection = attrs: { buildInputs = [ gtk2 pcre pkgconfig ]; };
108
109 grpc = attrs: {
110 buildInputs = [ openssl pkgconfig ];
111 };
112
113 hitimes = attrs: {
114 buildInputs =
115 stdenv.lib.optionals stdenv.isDarwin
116 [ darwin.apple_sdk.frameworks.CoreServices ];
117 };
118
119 # disable bundle install as it can't install anything in addition to what is
120 # specified in pkgs/applications/misc/jekyll/Gemfile anyway. Also do chmod_R
121 # to compensate for read-only files in site_template in nix store.
122 jekyll = attrs: {
123 postInstall = ''
124 installPath=$(cat $out/nix-support/gem-meta/install-path)
125 sed -i $installPath/lib/jekyll/commands/new.rb \
126 -e 's@Exec.run("bundle", "install"@Exec.run("true"@' \
127 -e 's@FileUtils.cp_r site_template + "/.", path@FileUtils.cp_r site_template + "/.", path; FileUtils.chmod_R "u+w", path@'
128 '';
129 };
130
131 # note that you need version >= v3.16.14.8,
132 # otherwise the gem will fail to link to the libv8 binary.
133 # see: https://github.com/cowboyd/libv8/pull/161
134 libv8 = attrs: {
135 buildInputs = [ which v8 python ];
136 buildFlags = [ "--with-system-v8=true" ];
137 };
138
139 msgpack = attrs: {
140 buildInputs = [ libmsgpack ];
141 };
142
143 mysql = attrs: {
144 buildInputs = [ mysql.lib zlib openssl ];
145 };
146
147 mysql2 = attrs: {
148 buildInputs = [ mysql.lib zlib openssl ];
149 };
150
151 ncursesw = attrs: {
152 buildInputs = [ ncurses ];
153 buildFlags = [
154 "--with-cflags=-I${ncurses.dev}/include"
155 "--with-ldflags=-L${ncurses.out}/lib"
156 ];
157 };
158
159 nokogiri = attrs: {
160 buildFlags = [
161 "--use-system-libraries"
162 "--with-zlib-dir=${zlib.dev}"
163 "--with-xml2-lib=${libxml2.out}/lib"
164 "--with-xml2-include=${libxml2.dev}/include/libxml2"
165 "--with-xslt-lib=${libxslt.out}/lib"
166 "--with-xslt-include=${libxslt.dev}/include"
167 "--with-exslt-lib=${libxslt.out}/lib"
168 "--with-exslt-include=${libxslt.dev}/include"
169 ] ++ lib.optional stdenv.isDarwin "--with-iconv-dir=${libiconv}";
170 };
171
172 pango = attrs: {
173 buildInputs = [ gtk2 xlibs.libXdmcp pcre pkgconfig xlibs.libpthreadstubs ];
174 };
175
176 patron = attrs: {
177 buildInputs = [ curl ];
178 };
179
180 pcaprub = attrs: {
181 buildInputs = [ libpcap ];
182 };
183
184 pg = attrs: {
185 buildFlags = [
186 "--with-pg-config=${postgresql}/bin/pg_config"
187 ];
188 };
189
190 puma = attrs: {
191 buildInputs = [ openssl ];
192 };
193
194 rainbow = attrs: {
195 buildInputs = [ rainbow_rake ];
196 };
197
198 rbnacl = spec: {
199 postInstall = ''
200 sed -i $(cat $out/nix-support/gem-meta/install-path)/lib/rbnacl.rb -e "2a \
201 RBNACL_LIBSODIUM_GEM_LIB_PATH = '${libsodium.out}/lib/libsodium${stdenv.hostPlatform.extensions.sharedLibrary}'
202 "
203 '';
204 };
205
206 re2 = attrs: {
207 buildInputs = [ re2 ];
208 };
209
210 rmagick = attrs: {
211 buildInputs = [ imagemagick pkgconfig which ];
212 };
213
214 ruby-lxc = attrs: {
215 buildInputs = [ lxc ];
216 };
217
218 ruby-terminfo = attrs: {
219 buildInputs = [ ncurses ];
220 buildFlags = [
221 "--with-cflags=-I${ncurses.dev}/include"
222 "--with-ldflags=-L${ncurses.out}/lib"
223 ];
224 };
225 rugged = attrs: {
226 buildInputs = [ cmake pkgconfig openssl libssh2 zlib ];
227 };
228
229 scrypt = attrs:
230 if stdenv.isDarwin then {
231 dontBuild = false;
232 postPatch = ''
233 sed -i -e "s/-arch i386//" Rakefile ext/scrypt/Rakefile
234 '';
235 } else {};
236
237 sequel_pg = attrs: {
238 buildInputs = [ postgresql ];
239 };
240
241 snappy = attrs: {
242 buildInputs = [ args.snappy ];
243 };
244
245 sqlite3 = attrs: {
246 buildFlags = [
247 "--with-sqlite3-include=${sqlite.dev}/include"
248 "--with-sqlite3-lib=${sqlite.out}/lib"
249 ];
250 };
251
252 sup = attrs: {
253 dontBuild = false;
254 # prevent sup from trying to dynamically install `xapian-ruby`.
255 postPatch = ''
256 cp ${./mkrf_conf_xapian.rb} ext/mkrf_conf_xapian.rb
257
258 substituteInPlace lib/sup/crypto.rb \
259 --replace 'which gpg2' \
260 '${which}/bin/which gpg'
261 '';
262 };
263
264 rb-readline = attrs: {
265 dontBuild = false;
266 postPatch = ''
267 substituteInPlace lib/rbreadline.rb \
268 --replace 'infocmp' '${ncurses.dev}/bin/infocmp'
269 '';
270 };
271
272 timfel-krb5-auth = attrs: {
273 buildInputs = [ kerberos ];
274 };
275
276 therubyracer = attrs: {
277 buildFlags = [
278 "--with-v8-dir=${v8}"
279 "--with-v8-include=${v8}/include"
280 "--with-v8-lib=${v8}/lib"
281 ];
282 };
283
284 typhoeus = attrs: {
285 buildInputs = [ curl ];
286 };
287
288 tzinfo = attrs: lib.optionalAttrs (lib.versionAtLeast attrs.version "1.0") {
289 dontBuild = false;
290 postPatch = ''
291 substituteInPlace lib/tzinfo/zoneinfo_data_source.rb \
292 --replace "/usr/share/zoneinfo" "${tzdata}/share/zoneinfo"
293 '';
294 };
295
296 uuid4r = attrs: {
297 buildInputs = [ which libossp_uuid ];
298 };
299
300 xapian-ruby = attrs: {
301 # use the system xapian
302 dontBuild = false;
303 buildInputs = [ xapian_1_2_22 pkgconfig zlib ];
304 postPatch = ''
305 cp ${./xapian-Rakefile} Rakefile
306 '';
307 preInstall = ''
308 export XAPIAN_CONFIG=${xapian_1_2_22}/bin/xapian-config
309 '';
310 };
311
312}