2014-08-31 19:32:34 +02:00
|
|
|
# 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-09 00:10:07 +02: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 02:47:45 +02:00
|
|
|
, cmake, libssh2, openssl, mysql, darwin, git, perl, pcre, gecode_3, curl
|
2018-03-13 11:16:03 +01:00
|
|
|
, libmsgpack, qt48, libsodium, snappy, libossp_uuid, lxc, libpcap, xorg, gtk2, buildRubyGem
|
2017-10-31 05:33:52 +01:00
|
|
|
, cairo, re2, rake, gobjectIntrospection, gdk_pixbuf
|
2016-09-21 14:29:12 +02:00
|
|
|
}@args:
|
2014-08-31 19:32:34 +02:00
|
|
|
|
|
|
|
let
|
|
|
|
v8 = v8_3_16_14;
|
2017-05-12 14:52:18 +02:00
|
|
|
|
|
|
|
rainbow_rake = buildRubyGem {
|
|
|
|
name = "rake";
|
|
|
|
gemName = "rake";
|
2017-10-05 10:10:57 +02:00
|
|
|
source.sha256 = "01j8fc9bqjnrsxbppncai05h43315vmz9fwg28qdsgcjw9ck1d7n";
|
2017-05-12 14:52:18 +02:00
|
|
|
type = "gem";
|
|
|
|
version = "12.0.0";
|
|
|
|
};
|
2014-10-28 05:16:14 +01:00
|
|
|
in
|
2014-08-31 19:32:34 +02:00
|
|
|
|
2014-10-28 05:16:14 +01:00
|
|
|
{
|
2017-09-06 00:03:42 +02:00
|
|
|
atk = attrs: {
|
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2017-10-31 05:33:52 +01:00
|
|
|
buildInputs = [ gtk2 pcre rake ];
|
2017-09-06 00:03:42 +02:00
|
|
|
};
|
2017-05-18 02:47:45 +02:00
|
|
|
|
2016-08-26 15:08:39 +02: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 02:47:45 +02:00
|
|
|
cairo = attrs: {
|
2017-09-06 00:03:42 +02:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2018-03-13 11:16:03 +01:00
|
|
|
buildInputs = [ gtk2 pcre xorg.libpthreadstubs xorg.libXdmcp];
|
2017-05-18 02:47:45 +02:00
|
|
|
};
|
|
|
|
|
2017-10-31 05:33:52 +01:00
|
|
|
cairo-gobject = attrs: {
|
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2018-03-13 11:16:03 +01:00
|
|
|
buildInputs = [ cairo pcre xorg.libpthreadstubs xorg.libXdmcp ];
|
2017-10-31 05:33:52 +01:00
|
|
|
};
|
|
|
|
|
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 22:01:48 +01:00
|
|
|
charlock_holmes = attrs: {
|
2015-04-16 01:24:04 +02:00
|
|
|
buildInputs = [ which icu zlib ];
|
2015-01-25 22:01:48 +01:00
|
|
|
};
|
2017-10-31 05:33:52 +01:00
|
|
|
|
2017-09-21 08:53:25 +02:00
|
|
|
curb = attrs: {
|
|
|
|
buildInputs = [ curl ];
|
|
|
|
};
|
2015-01-25 22:01:48 +01:00
|
|
|
|
ruby: new bundler infrastructure
This improves our Bundler integration (i.e. `bundlerEnv`).
Before describing the implementation differences, I'd like to point a
breaking change: buildRubyGem now expects `gemName` and `version` as
arguments, rather than a `name` attribute in the form of
"<gem-name>-<version>".
Now for the differences in implementation.
The previous implementation installed all gems at once in a single
derivation. This was made possible by using a set of monkey-patches to
prevent Bundler from downloading gems impurely, and to help Bundler
find and activate all required gems prior to installation. This had
several downsides:
* The patches were really hard to understand, and required subtle
interaction with the rest of the build environment.
* A single install failure would cause the entire derivation to fail.
The new implementation takes a different approach: we install gems into
separate derivations, and then present Bundler with a symlink forest
thereof. This has a couple benefits over the existing approach:
* Fewer patches are required, with less interplay with the rest of the
build environment.
* Changes to one gem no longer cause a rebuild of the entire dependency
graph.
* Builds take 20% less time (using gitlab as a reference).
It's unfortunate that we still have to muck with Bundler's internals,
though it's unavoidable with the way that Bundler is currently designed.
There are a number improvements that could be made in Bundler that would
simplify our packaging story:
* Bundler requires all installed gems reside within the same prefix
(GEM_HOME), unlike RubyGems which allows for multiple prefixes to
be specified through GEM_PATH. It would be ideal if Bundler allowed
for packages to be installed and sourced from multiple prefixes.
* Bundler installs git sources very differently from how RubyGems
installs gem packages, and, unlike RubyGems, it doesn't provide a
public interface (CLI or programmatic) to guide the installation of a
single gem. We are presented with the options of either
reimplementing a considerable portion Bundler, or patch and use parts
of its internals; I choose the latter. Ideally, there would be a way
to install gems from git sources in a manner similar to how we drive
`gem` to install gem packages.
* When a bundled program is executed (via `bundle exec` or a
binstub that does `require 'bundler/setup'`), the setup process reads
the Gemfile.lock, activates the dependencies, re-serializes the lock
file it read earlier, and then attempts to overwrite the Gemfile.lock
if the contents aren't bit-identical. I think the reasoning is that
by merely running an application with a newer version of Bundler, you'll
automatically keep the Gemfile.lock up-to-date with any changes in the
format. Unfortunately, that doesn't play well with any form of
packaging, because bundler will immediately cause the application to
abort when it attempts to write to the read-only Gemfile.lock in the
store. We work around this by normalizing the Gemfile.lock with the
version of Bundler that we'll use at runtime before we copy it into
the store. This feels fragile, but it's the best we can do without
changes upstream, or resorting to more delicate hacks.
With all of the challenges in using Bundler, one might wonder why we
can't just cut Bundler out of the picture and use RubyGems. After all,
Nix provides most of the isolation that Bundler is used for anyway.
The problem, however, is that almost every Rails application calls
`Bundler::require` at startup (by way of the default project templates).
Because bundler will then, by default, `require` each gem listed in the
Gemfile, Rails applications are almost always written such that none of
the source files explicitly require their dependencies. That leaves us
with two options: support and use Bundler, or maintain massive patches
for every Rails application that we package.
Closes #8612
2015-11-15 03:17:29 +01: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}"@'
|
|
|
|
'';
|
|
|
|
};
|
2018-03-13 11:16:03 +01:00
|
|
|
|
2018-02-19 22:56:17 +01:00
|
|
|
ethon = attrs: {
|
|
|
|
dontBuild = false;
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace lib/ethon/curls/settings.rb \
|
2018-02-20 11:29:07 +01:00
|
|
|
--replace "libcurl" "${curl.out}/lib/libcurl${stdenv.hostPlatform.extensions.sharedLibrary}"
|
2018-02-19 22:56:17 +01:00
|
|
|
'';
|
2018-03-13 11:16:03 +01:00
|
|
|
};
|
ruby: new bundler infrastructure
This improves our Bundler integration (i.e. `bundlerEnv`).
Before describing the implementation differences, I'd like to point a
breaking change: buildRubyGem now expects `gemName` and `version` as
arguments, rather than a `name` attribute in the form of
"<gem-name>-<version>".
Now for the differences in implementation.
The previous implementation installed all gems at once in a single
derivation. This was made possible by using a set of monkey-patches to
prevent Bundler from downloading gems impurely, and to help Bundler
find and activate all required gems prior to installation. This had
several downsides:
* The patches were really hard to understand, and required subtle
interaction with the rest of the build environment.
* A single install failure would cause the entire derivation to fail.
The new implementation takes a different approach: we install gems into
separate derivations, and then present Bundler with a symlink forest
thereof. This has a couple benefits over the existing approach:
* Fewer patches are required, with less interplay with the rest of the
build environment.
* Changes to one gem no longer cause a rebuild of the entire dependency
graph.
* Builds take 20% less time (using gitlab as a reference).
It's unfortunate that we still have to muck with Bundler's internals,
though it's unavoidable with the way that Bundler is currently designed.
There are a number improvements that could be made in Bundler that would
simplify our packaging story:
* Bundler requires all installed gems reside within the same prefix
(GEM_HOME), unlike RubyGems which allows for multiple prefixes to
be specified through GEM_PATH. It would be ideal if Bundler allowed
for packages to be installed and sourced from multiple prefixes.
* Bundler installs git sources very differently from how RubyGems
installs gem packages, and, unlike RubyGems, it doesn't provide a
public interface (CLI or programmatic) to guide the installation of a
single gem. We are presented with the options of either
reimplementing a considerable portion Bundler, or patch and use parts
of its internals; I choose the latter. Ideally, there would be a way
to install gems from git sources in a manner similar to how we drive
`gem` to install gem packages.
* When a bundled program is executed (via `bundle exec` or a
binstub that does `require 'bundler/setup'`), the setup process reads
the Gemfile.lock, activates the dependencies, re-serializes the lock
file it read earlier, and then attempts to overwrite the Gemfile.lock
if the contents aren't bit-identical. I think the reasoning is that
by merely running an application with a newer version of Bundler, you'll
automatically keep the Gemfile.lock up-to-date with any changes in the
format. Unfortunately, that doesn't play well with any form of
packaging, because bundler will immediately cause the application to
abort when it attempts to write to the read-only Gemfile.lock in the
store. We work around this by normalizing the Gemfile.lock with the
version of Bundler that we'll use at runtime before we copy it into
the store. This feels fragile, but it's the best we can do without
changes upstream, or resorting to more delicate hacks.
With all of the challenges in using Bundler, one might wonder why we
can't just cut Bundler out of the picture and use RubyGems. After all,
Nix provides most of the isolation that Bundler is used for anyway.
The problem, however, is that almost every Rails application calls
`Bundler::require` at startup (by way of the default project templates).
Because bundler will then, by default, `require` each gem listed in the
Gemfile, Rails applications are almost always written such that none of
the source files explicitly require their dependencies. That leaves us
with two options: support and use Bundler, or maintain massive patches
for every Rails application that we package.
Closes #8612
2015-11-15 03:17:29 +01:00
|
|
|
|
2016-01-25 11:22:00 +01:00
|
|
|
eventmachine = attrs: {
|
|
|
|
buildInputs = [ openssl ];
|
|
|
|
};
|
|
|
|
|
2015-01-25 22:01:48 +01:00
|
|
|
ffi = attrs: {
|
2017-09-05 23:26:13 +02:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
buildInputs = [ libffi ];
|
2015-01-25 22:01:48 +01:00
|
|
|
};
|
|
|
|
|
2017-10-31 05:33:52 +01:00
|
|
|
gdk_pixbuf2 = attrs: {
|
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
buildInputs = [ rake gdk_pixbuf ];
|
|
|
|
};
|
|
|
|
|
2015-01-22 02:33:19 +01:00
|
|
|
gpgme = attrs: {
|
|
|
|
buildInputs = [ gpgme ];
|
|
|
|
};
|
|
|
|
|
2017-09-06 00:03:42 +02:00
|
|
|
gio2 = attrs: {
|
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2017-12-17 07:35:42 +01:00
|
|
|
buildInputs = [ gtk2 pcre gobjectIntrospection ];
|
2017-09-06 00:03:42 +02:00
|
|
|
};
|
2017-05-18 02:47:45 +02:00
|
|
|
|
2017-09-03 15:38:28 +02:00
|
|
|
gitlab-markup = attrs: { meta.priority = 1; };
|
|
|
|
|
2017-09-06 00:03:42 +02:00
|
|
|
glib2 = attrs: {
|
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
buildInputs = [ gtk2 pcre ];
|
|
|
|
};
|
2017-05-18 02:47:45 +02:00
|
|
|
|
|
|
|
gtk2 = attrs: {
|
2017-09-06 00:03:42 +02:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2018-03-13 11:16:03 +01:00
|
|
|
buildInputs = [ gtk2 pcre xorg.libpthreadstubs xorg.libXdmcp];
|
2017-05-18 02:47:45 +02:00
|
|
|
# CFLAGS must be set for this gem to detect gdkkeysyms.h correctly
|
|
|
|
CFLAGS = "-I${gtk2.dev}/include/gtk-2.0 -I/non-existent-path";
|
|
|
|
};
|
|
|
|
|
2017-10-31 05:33:52 +01:00
|
|
|
gobject-introspection = attrs: {
|
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
buildInputs = [ gobjectIntrospection gtk2 pcre ];
|
|
|
|
};
|
2017-05-18 02:47:45 +02:00
|
|
|
|
2017-07-05 23:53:31 +02:00
|
|
|
grpc = attrs: {
|
2018-03-01 11:44:22 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2017-09-05 23:26:13 +02:00
|
|
|
buildInputs = [ openssl ];
|
2018-03-01 11:44:22 +01:00
|
|
|
NIX_CFLAGS_COMPILE = [ "-Wno-error=stringop-overflow" "-Wno-error=implicit-fallthrough" ];
|
2017-07-05 23:53:31 +02:00
|
|
|
};
|
|
|
|
|
2016-05-05 00:41:44 +02:00
|
|
|
hitimes = attrs: {
|
|
|
|
buildInputs =
|
|
|
|
stdenv.lib.optionals stdenv.isDarwin
|
|
|
|
[ darwin.apple_sdk.frameworks.CoreServices ];
|
|
|
|
};
|
|
|
|
|
2017-03-04 03:09:04 +01:00
|
|
|
# disable bundle install as it can't install anything in addition to what is
|
2017-03-04 05:05:37 +01: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-04 03:09:04 +01:00
|
|
|
jekyll = attrs: {
|
|
|
|
postInstall = ''
|
|
|
|
installPath=$(cat $out/nix-support/gem-meta/install-path)
|
2017-03-04 05:05:37 +01: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-04 03:09:04 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
ruby: new bundler infrastructure
This improves our Bundler integration (i.e. `bundlerEnv`).
Before describing the implementation differences, I'd like to point a
breaking change: buildRubyGem now expects `gemName` and `version` as
arguments, rather than a `name` attribute in the form of
"<gem-name>-<version>".
Now for the differences in implementation.
The previous implementation installed all gems at once in a single
derivation. This was made possible by using a set of monkey-patches to
prevent Bundler from downloading gems impurely, and to help Bundler
find and activate all required gems prior to installation. This had
several downsides:
* The patches were really hard to understand, and required subtle
interaction with the rest of the build environment.
* A single install failure would cause the entire derivation to fail.
The new implementation takes a different approach: we install gems into
separate derivations, and then present Bundler with a symlink forest
thereof. This has a couple benefits over the existing approach:
* Fewer patches are required, with less interplay with the rest of the
build environment.
* Changes to one gem no longer cause a rebuild of the entire dependency
graph.
* Builds take 20% less time (using gitlab as a reference).
It's unfortunate that we still have to muck with Bundler's internals,
though it's unavoidable with the way that Bundler is currently designed.
There are a number improvements that could be made in Bundler that would
simplify our packaging story:
* Bundler requires all installed gems reside within the same prefix
(GEM_HOME), unlike RubyGems which allows for multiple prefixes to
be specified through GEM_PATH. It would be ideal if Bundler allowed
for packages to be installed and sourced from multiple prefixes.
* Bundler installs git sources very differently from how RubyGems
installs gem packages, and, unlike RubyGems, it doesn't provide a
public interface (CLI or programmatic) to guide the installation of a
single gem. We are presented with the options of either
reimplementing a considerable portion Bundler, or patch and use parts
of its internals; I choose the latter. Ideally, there would be a way
to install gems from git sources in a manner similar to how we drive
`gem` to install gem packages.
* When a bundled program is executed (via `bundle exec` or a
binstub that does `require 'bundler/setup'`), the setup process reads
the Gemfile.lock, activates the dependencies, re-serializes the lock
file it read earlier, and then attempts to overwrite the Gemfile.lock
if the contents aren't bit-identical. I think the reasoning is that
by merely running an application with a newer version of Bundler, you'll
automatically keep the Gemfile.lock up-to-date with any changes in the
format. Unfortunately, that doesn't play well with any form of
packaging, because bundler will immediately cause the application to
abort when it attempts to write to the read-only Gemfile.lock in the
store. We work around this by normalizing the Gemfile.lock with the
version of Bundler that we'll use at runtime before we copy it into
the store. This feels fragile, but it's the best we can do without
changes upstream, or resorting to more delicate hacks.
With all of the challenges in using Bundler, one might wonder why we
can't just cut Bundler out of the picture and use RubyGems. After all,
Nix provides most of the isolation that Bundler is used for anyway.
The problem, however, is that almost every Rails application calls
`Bundler::require` at startup (by way of the default project templates).
Because bundler will then, by default, `require` each gem listed in the
Gemfile, Rails applications are almost always written such that none of
the source files explicitly require their dependencies. That leaves us
with two options: support and use Bundler, or maintain massive patches
for every Rails application that we package.
Closes #8612
2015-11-15 03:17:29 +01: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 05:16:14 +01:00
|
|
|
libv8 = attrs: {
|
|
|
|
buildInputs = [ which v8 python ];
|
ruby: new bundler infrastructure
This improves our Bundler integration (i.e. `bundlerEnv`).
Before describing the implementation differences, I'd like to point a
breaking change: buildRubyGem now expects `gemName` and `version` as
arguments, rather than a `name` attribute in the form of
"<gem-name>-<version>".
Now for the differences in implementation.
The previous implementation installed all gems at once in a single
derivation. This was made possible by using a set of monkey-patches to
prevent Bundler from downloading gems impurely, and to help Bundler
find and activate all required gems prior to installation. This had
several downsides:
* The patches were really hard to understand, and required subtle
interaction with the rest of the build environment.
* A single install failure would cause the entire derivation to fail.
The new implementation takes a different approach: we install gems into
separate derivations, and then present Bundler with a symlink forest
thereof. This has a couple benefits over the existing approach:
* Fewer patches are required, with less interplay with the rest of the
build environment.
* Changes to one gem no longer cause a rebuild of the entire dependency
graph.
* Builds take 20% less time (using gitlab as a reference).
It's unfortunate that we still have to muck with Bundler's internals,
though it's unavoidable with the way that Bundler is currently designed.
There are a number improvements that could be made in Bundler that would
simplify our packaging story:
* Bundler requires all installed gems reside within the same prefix
(GEM_HOME), unlike RubyGems which allows for multiple prefixes to
be specified through GEM_PATH. It would be ideal if Bundler allowed
for packages to be installed and sourced from multiple prefixes.
* Bundler installs git sources very differently from how RubyGems
installs gem packages, and, unlike RubyGems, it doesn't provide a
public interface (CLI or programmatic) to guide the installation of a
single gem. We are presented with the options of either
reimplementing a considerable portion Bundler, or patch and use parts
of its internals; I choose the latter. Ideally, there would be a way
to install gems from git sources in a manner similar to how we drive
`gem` to install gem packages.
* When a bundled program is executed (via `bundle exec` or a
binstub that does `require 'bundler/setup'`), the setup process reads
the Gemfile.lock, activates the dependencies, re-serializes the lock
file it read earlier, and then attempts to overwrite the Gemfile.lock
if the contents aren't bit-identical. I think the reasoning is that
by merely running an application with a newer version of Bundler, you'll
automatically keep the Gemfile.lock up-to-date with any changes in the
format. Unfortunately, that doesn't play well with any form of
packaging, because bundler will immediately cause the application to
abort when it attempts to write to the read-only Gemfile.lock in the
store. We work around this by normalizing the Gemfile.lock with the
version of Bundler that we'll use at runtime before we copy it into
the store. This feels fragile, but it's the best we can do without
changes upstream, or resorting to more delicate hacks.
With all of the challenges in using Bundler, one might wonder why we
can't just cut Bundler out of the picture and use RubyGems. After all,
Nix provides most of the isolation that Bundler is used for anyway.
The problem, however, is that almost every Rails application calls
`Bundler::require` at startup (by way of the default project templates).
Because bundler will then, by default, `require` each gem listed in the
Gemfile, Rails applications are almost always written such that none of
the source files explicitly require their dependencies. That leaves us
with two options: support and use Bundler, or maintain massive patches
for every Rails application that we package.
Closes #8612
2015-11-15 03:17:29 +01:00
|
|
|
buildFlags = [ "--with-system-v8=true" ];
|
2015-01-22 02:33:19 +01:00
|
|
|
};
|
|
|
|
|
2016-01-25 11:22:00 +01:00
|
|
|
msgpack = attrs: {
|
|
|
|
buildInputs = [ libmsgpack ];
|
|
|
|
};
|
2017-03-06 20:23:02 +01:00
|
|
|
|
2016-11-04 01:19:25 +01:00
|
|
|
mysql = attrs: {
|
2017-07-09 17:43:03 +02:00
|
|
|
buildInputs = [ mysql.connector-c zlib openssl ];
|
2016-11-04 01:19:25 +01:00
|
|
|
};
|
2016-01-25 11:22:00 +01:00
|
|
|
|
2015-01-25 22:01:48 +01:00
|
|
|
mysql2 = attrs: {
|
2017-07-09 17:43:03 +02:00
|
|
|
buildInputs = [ mysql.connector-c zlib openssl ];
|
2015-01-25 22:01:48 +01:00
|
|
|
};
|
|
|
|
|
2015-01-22 02:33:19 +01:00
|
|
|
ncursesw = attrs: {
|
|
|
|
buildInputs = [ ncurses ];
|
|
|
|
buildFlags = [
|
2015-10-05 20:32:54 +02:00
|
|
|
"--with-cflags=-I${ncurses.dev}/include"
|
2016-02-01 18:16:50 +01:00
|
|
|
"--with-ldflags=-L${ncurses.out}/lib"
|
2015-01-22 02:33:19 +01:00
|
|
|
];
|
2014-10-28 05:16:14 +01:00
|
|
|
};
|
2014-08-31 19:32:34 +02:00
|
|
|
|
2014-10-28 05:16:14 +01:00
|
|
|
nokogiri = attrs: {
|
|
|
|
buildFlags = [
|
|
|
|
"--use-system-libraries"
|
2016-04-16 19:50:01 +02:00
|
|
|
"--with-zlib-dir=${zlib.dev}"
|
2015-10-05 13:23:01 +02:00
|
|
|
"--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-22 04:38:29 +01:00
|
|
|
] ++ lib.optional stdenv.isDarwin "--with-iconv-dir=${libiconv}";
|
2014-10-29 02:16:02 +01:00
|
|
|
};
|
|
|
|
|
2017-05-18 02:47:45 +02:00
|
|
|
pango = attrs: {
|
2017-09-05 23:26:13 +02:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2018-03-13 11:16:03 +01:00
|
|
|
buildInputs = [ gtk2 xorg.libXdmcp pcre xorg.libpthreadstubs ];
|
2017-05-18 02:47:45 +02:00
|
|
|
};
|
|
|
|
|
ruby: new bundler infrastructure
This improves our Bundler integration (i.e. `bundlerEnv`).
Before describing the implementation differences, I'd like to point a
breaking change: buildRubyGem now expects `gemName` and `version` as
arguments, rather than a `name` attribute in the form of
"<gem-name>-<version>".
Now for the differences in implementation.
The previous implementation installed all gems at once in a single
derivation. This was made possible by using a set of monkey-patches to
prevent Bundler from downloading gems impurely, and to help Bundler
find and activate all required gems prior to installation. This had
several downsides:
* The patches were really hard to understand, and required subtle
interaction with the rest of the build environment.
* A single install failure would cause the entire derivation to fail.
The new implementation takes a different approach: we install gems into
separate derivations, and then present Bundler with a symlink forest
thereof. This has a couple benefits over the existing approach:
* Fewer patches are required, with less interplay with the rest of the
build environment.
* Changes to one gem no longer cause a rebuild of the entire dependency
graph.
* Builds take 20% less time (using gitlab as a reference).
It's unfortunate that we still have to muck with Bundler's internals,
though it's unavoidable with the way that Bundler is currently designed.
There are a number improvements that could be made in Bundler that would
simplify our packaging story:
* Bundler requires all installed gems reside within the same prefix
(GEM_HOME), unlike RubyGems which allows for multiple prefixes to
be specified through GEM_PATH. It would be ideal if Bundler allowed
for packages to be installed and sourced from multiple prefixes.
* Bundler installs git sources very differently from how RubyGems
installs gem packages, and, unlike RubyGems, it doesn't provide a
public interface (CLI or programmatic) to guide the installation of a
single gem. We are presented with the options of either
reimplementing a considerable portion Bundler, or patch and use parts
of its internals; I choose the latter. Ideally, there would be a way
to install gems from git sources in a manner similar to how we drive
`gem` to install gem packages.
* When a bundled program is executed (via `bundle exec` or a
binstub that does `require 'bundler/setup'`), the setup process reads
the Gemfile.lock, activates the dependencies, re-serializes the lock
file it read earlier, and then attempts to overwrite the Gemfile.lock
if the contents aren't bit-identical. I think the reasoning is that
by merely running an application with a newer version of Bundler, you'll
automatically keep the Gemfile.lock up-to-date with any changes in the
format. Unfortunately, that doesn't play well with any form of
packaging, because bundler will immediately cause the application to
abort when it attempts to write to the read-only Gemfile.lock in the
store. We work around this by normalizing the Gemfile.lock with the
version of Bundler that we'll use at runtime before we copy it into
the store. This feels fragile, but it's the best we can do without
changes upstream, or resorting to more delicate hacks.
With all of the challenges in using Bundler, one might wonder why we
can't just cut Bundler out of the picture and use RubyGems. After all,
Nix provides most of the isolation that Bundler is used for anyway.
The problem, however, is that almost every Rails application calls
`Bundler::require` at startup (by way of the default project templates).
Because bundler will then, by default, `require` each gem listed in the
Gemfile, Rails applications are almost always written such that none of
the source files explicitly require their dependencies. That leaves us
with two options: support and use Bundler, or maintain massive patches
for every Rails application that we package.
Closes #8612
2015-11-15 03:17:29 +01:00
|
|
|
patron = attrs: {
|
|
|
|
buildInputs = [ curl ];
|
|
|
|
};
|
|
|
|
|
2017-05-14 23:07:26 +02:00
|
|
|
pcaprub = attrs: {
|
|
|
|
buildInputs = [ libpcap ];
|
|
|
|
};
|
|
|
|
|
2014-10-29 02:16:02 +01:00
|
|
|
pg = attrs: {
|
|
|
|
buildFlags = [
|
|
|
|
"--with-pg-config=${postgresql}/bin/pg_config"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
ruby: new bundler infrastructure
This improves our Bundler integration (i.e. `bundlerEnv`).
Before describing the implementation differences, I'd like to point a
breaking change: buildRubyGem now expects `gemName` and `version` as
arguments, rather than a `name` attribute in the form of
"<gem-name>-<version>".
Now for the differences in implementation.
The previous implementation installed all gems at once in a single
derivation. This was made possible by using a set of monkey-patches to
prevent Bundler from downloading gems impurely, and to help Bundler
find and activate all required gems prior to installation. This had
several downsides:
* The patches were really hard to understand, and required subtle
interaction with the rest of the build environment.
* A single install failure would cause the entire derivation to fail.
The new implementation takes a different approach: we install gems into
separate derivations, and then present Bundler with a symlink forest
thereof. This has a couple benefits over the existing approach:
* Fewer patches are required, with less interplay with the rest of the
build environment.
* Changes to one gem no longer cause a rebuild of the entire dependency
graph.
* Builds take 20% less time (using gitlab as a reference).
It's unfortunate that we still have to muck with Bundler's internals,
though it's unavoidable with the way that Bundler is currently designed.
There are a number improvements that could be made in Bundler that would
simplify our packaging story:
* Bundler requires all installed gems reside within the same prefix
(GEM_HOME), unlike RubyGems which allows for multiple prefixes to
be specified through GEM_PATH. It would be ideal if Bundler allowed
for packages to be installed and sourced from multiple prefixes.
* Bundler installs git sources very differently from how RubyGems
installs gem packages, and, unlike RubyGems, it doesn't provide a
public interface (CLI or programmatic) to guide the installation of a
single gem. We are presented with the options of either
reimplementing a considerable portion Bundler, or patch and use parts
of its internals; I choose the latter. Ideally, there would be a way
to install gems from git sources in a manner similar to how we drive
`gem` to install gem packages.
* When a bundled program is executed (via `bundle exec` or a
binstub that does `require 'bundler/setup'`), the setup process reads
the Gemfile.lock, activates the dependencies, re-serializes the lock
file it read earlier, and then attempts to overwrite the Gemfile.lock
if the contents aren't bit-identical. I think the reasoning is that
by merely running an application with a newer version of Bundler, you'll
automatically keep the Gemfile.lock up-to-date with any changes in the
format. Unfortunately, that doesn't play well with any form of
packaging, because bundler will immediately cause the application to
abort when it attempts to write to the read-only Gemfile.lock in the
store. We work around this by normalizing the Gemfile.lock with the
version of Bundler that we'll use at runtime before we copy it into
the store. This feels fragile, but it's the best we can do without
changes upstream, or resorting to more delicate hacks.
With all of the challenges in using Bundler, one might wonder why we
can't just cut Bundler out of the picture and use RubyGems. After all,
Nix provides most of the isolation that Bundler is used for anyway.
The problem, however, is that almost every Rails application calls
`Bundler::require` at startup (by way of the default project templates).
Because bundler will then, by default, `require` each gem listed in the
Gemfile, Rails applications are almost always written such that none of
the source files explicitly require their dependencies. That leaves us
with two options: support and use Bundler, or maintain massive patches
for every Rails application that we package.
Closes #8612
2015-11-15 03:17:29 +01:00
|
|
|
puma = attrs: {
|
|
|
|
buildInputs = [ openssl ];
|
|
|
|
};
|
|
|
|
|
2017-05-12 14:52:18 +02: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 \
|
2017-09-12 21:36:41 +02:00
|
|
|
RBNACL_LIBSODIUM_GEM_LIB_PATH = '${libsodium.out}/lib/libsodium${stdenv.hostPlatform.extensions.sharedLibrary}'
|
2016-06-16 19:33:12 +02:00
|
|
|
"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2017-08-06 16:27:54 +02:00
|
|
|
re2 = attrs: {
|
|
|
|
buildInputs = [ re2 ];
|
|
|
|
};
|
|
|
|
|
2014-10-29 02:16:02 +01:00
|
|
|
rmagick = attrs: {
|
2017-09-05 23:26:13 +02:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
buildInputs = [ imagemagick which ];
|
2014-10-29 02:16:02 +01:00
|
|
|
};
|
|
|
|
|
2016-12-18 19:27:48 +01:00
|
|
|
ruby-lxc = attrs: {
|
|
|
|
buildInputs = [ lxc ];
|
|
|
|
};
|
|
|
|
|
2015-10-16 00:50:38 +02:00
|
|
|
ruby-terminfo = attrs: {
|
|
|
|
buildInputs = [ ncurses ];
|
|
|
|
buildFlags = [
|
|
|
|
"--with-cflags=-I${ncurses.dev}/include"
|
|
|
|
"--with-ldflags=-L${ncurses.out}/lib"
|
|
|
|
];
|
|
|
|
};
|
2015-01-25 22:01:48 +01:00
|
|
|
rugged = attrs: {
|
2018-03-10 12:59:06 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2017-09-05 23:26:13 +02:00
|
|
|
buildInputs = [ cmake openssl libssh2 zlib ];
|
2018-03-10 12:59:06 +01:00
|
|
|
dontUseCmakeConfigure = true;
|
2015-01-25 22:01:48 +01:00
|
|
|
};
|
|
|
|
|
2016-11-03 01:24:10 +01:00
|
|
|
scrypt = attrs:
|
|
|
|
if stdenv.isDarwin then {
|
|
|
|
dontBuild = false;
|
|
|
|
postPatch = ''
|
|
|
|
sed -i -e "s/-arch i386//" Rakefile ext/scrypt/Rakefile
|
|
|
|
'';
|
|
|
|
} else {};
|
|
|
|
|
2016-12-16 11:36:05 +01:00
|
|
|
sequel_pg = attrs: {
|
|
|
|
buildInputs = [ postgresql ];
|
|
|
|
};
|
|
|
|
|
2016-09-21 14:29:12 +02:00
|
|
|
snappy = attrs: {
|
|
|
|
buildInputs = [ args.snappy ];
|
|
|
|
};
|
|
|
|
|
2014-10-29 02:16:02 +01: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 05:16:14 +01:00
|
|
|
];
|
|
|
|
};
|
2014-08-31 19:32:34 +02:00
|
|
|
|
2015-01-22 02:33:19 +01:00
|
|
|
sup = attrs: {
|
ruby: new bundler infrastructure
This improves our Bundler integration (i.e. `bundlerEnv`).
Before describing the implementation differences, I'd like to point a
breaking change: buildRubyGem now expects `gemName` and `version` as
arguments, rather than a `name` attribute in the form of
"<gem-name>-<version>".
Now for the differences in implementation.
The previous implementation installed all gems at once in a single
derivation. This was made possible by using a set of monkey-patches to
prevent Bundler from downloading gems impurely, and to help Bundler
find and activate all required gems prior to installation. This had
several downsides:
* The patches were really hard to understand, and required subtle
interaction with the rest of the build environment.
* A single install failure would cause the entire derivation to fail.
The new implementation takes a different approach: we install gems into
separate derivations, and then present Bundler with a symlink forest
thereof. This has a couple benefits over the existing approach:
* Fewer patches are required, with less interplay with the rest of the
build environment.
* Changes to one gem no longer cause a rebuild of the entire dependency
graph.
* Builds take 20% less time (using gitlab as a reference).
It's unfortunate that we still have to muck with Bundler's internals,
though it's unavoidable with the way that Bundler is currently designed.
There are a number improvements that could be made in Bundler that would
simplify our packaging story:
* Bundler requires all installed gems reside within the same prefix
(GEM_HOME), unlike RubyGems which allows for multiple prefixes to
be specified through GEM_PATH. It would be ideal if Bundler allowed
for packages to be installed and sourced from multiple prefixes.
* Bundler installs git sources very differently from how RubyGems
installs gem packages, and, unlike RubyGems, it doesn't provide a
public interface (CLI or programmatic) to guide the installation of a
single gem. We are presented with the options of either
reimplementing a considerable portion Bundler, or patch and use parts
of its internals; I choose the latter. Ideally, there would be a way
to install gems from git sources in a manner similar to how we drive
`gem` to install gem packages.
* When a bundled program is executed (via `bundle exec` or a
binstub that does `require 'bundler/setup'`), the setup process reads
the Gemfile.lock, activates the dependencies, re-serializes the lock
file it read earlier, and then attempts to overwrite the Gemfile.lock
if the contents aren't bit-identical. I think the reasoning is that
by merely running an application with a newer version of Bundler, you'll
automatically keep the Gemfile.lock up-to-date with any changes in the
format. Unfortunately, that doesn't play well with any form of
packaging, because bundler will immediately cause the application to
abort when it attempts to write to the read-only Gemfile.lock in the
store. We work around this by normalizing the Gemfile.lock with the
version of Bundler that we'll use at runtime before we copy it into
the store. This feels fragile, but it's the best we can do without
changes upstream, or resorting to more delicate hacks.
With all of the challenges in using Bundler, one might wonder why we
can't just cut Bundler out of the picture and use RubyGems. After all,
Nix provides most of the isolation that Bundler is used for anyway.
The problem, however, is that almost every Rails application calls
`Bundler::require` at startup (by way of the default project templates).
Because bundler will then, by default, `require` each gem listed in the
Gemfile, Rails applications are almost always written such that none of
the source files explicitly require their dependencies. That leaves us
with two options: support and use Bundler, or maintain massive patches
for every Rails application that we package.
Closes #8612
2015-11-15 03:17:29 +01:00
|
|
|
dontBuild = false;
|
2015-01-22 02:33:19 +01:00
|
|
|
# prevent sup from trying to dynamically install `xapian-ruby`.
|
|
|
|
postPatch = ''
|
|
|
|
cp ${./mkrf_conf_xapian.rb} ext/mkrf_conf_xapian.rb
|
2014-08-31 19:32:34 +02:00
|
|
|
|
2015-01-22 02:33:19 +01:00
|
|
|
substituteInPlace lib/sup/crypto.rb \
|
|
|
|
--replace 'which gpg2' \
|
2017-08-10 11:43:48 +02:00
|
|
|
'${which}/bin/which gpg'
|
2014-10-28 05:16:14 +01:00
|
|
|
'';
|
2015-01-22 02:33:19 +01:00
|
|
|
};
|
2014-08-31 19:32:34 +02:00
|
|
|
|
2017-05-14 23:13:55 +02: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 ];
|
|
|
|
};
|
|
|
|
|
2015-01-22 02:33:19 +01:00
|
|
|
therubyracer = attrs: {
|
2014-10-28 05:16:14 +01:00
|
|
|
buildFlags = [
|
2015-01-22 02:33:19 +01:00
|
|
|
"--with-v8-dir=${v8}"
|
|
|
|
"--with-v8-include=${v8}/include"
|
2014-10-28 05:16:14 +01:00
|
|
|
"--with-v8-lib=${v8}/lib"
|
|
|
|
];
|
2014-08-31 19:32:34 +02:00
|
|
|
};
|
2015-01-22 02:33:19 +01: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") {
|
ruby: new bundler infrastructure
This improves our Bundler integration (i.e. `bundlerEnv`).
Before describing the implementation differences, I'd like to point a
breaking change: buildRubyGem now expects `gemName` and `version` as
arguments, rather than a `name` attribute in the form of
"<gem-name>-<version>".
Now for the differences in implementation.
The previous implementation installed all gems at once in a single
derivation. This was made possible by using a set of monkey-patches to
prevent Bundler from downloading gems impurely, and to help Bundler
find and activate all required gems prior to installation. This had
several downsides:
* The patches were really hard to understand, and required subtle
interaction with the rest of the build environment.
* A single install failure would cause the entire derivation to fail.
The new implementation takes a different approach: we install gems into
separate derivations, and then present Bundler with a symlink forest
thereof. This has a couple benefits over the existing approach:
* Fewer patches are required, with less interplay with the rest of the
build environment.
* Changes to one gem no longer cause a rebuild of the entire dependency
graph.
* Builds take 20% less time (using gitlab as a reference).
It's unfortunate that we still have to muck with Bundler's internals,
though it's unavoidable with the way that Bundler is currently designed.
There are a number improvements that could be made in Bundler that would
simplify our packaging story:
* Bundler requires all installed gems reside within the same prefix
(GEM_HOME), unlike RubyGems which allows for multiple prefixes to
be specified through GEM_PATH. It would be ideal if Bundler allowed
for packages to be installed and sourced from multiple prefixes.
* Bundler installs git sources very differently from how RubyGems
installs gem packages, and, unlike RubyGems, it doesn't provide a
public interface (CLI or programmatic) to guide the installation of a
single gem. We are presented with the options of either
reimplementing a considerable portion Bundler, or patch and use parts
of its internals; I choose the latter. Ideally, there would be a way
to install gems from git sources in a manner similar to how we drive
`gem` to install gem packages.
* When a bundled program is executed (via `bundle exec` or a
binstub that does `require 'bundler/setup'`), the setup process reads
the Gemfile.lock, activates the dependencies, re-serializes the lock
file it read earlier, and then attempts to overwrite the Gemfile.lock
if the contents aren't bit-identical. I think the reasoning is that
by merely running an application with a newer version of Bundler, you'll
automatically keep the Gemfile.lock up-to-date with any changes in the
format. Unfortunately, that doesn't play well with any form of
packaging, because bundler will immediately cause the application to
abort when it attempts to write to the read-only Gemfile.lock in the
store. We work around this by normalizing the Gemfile.lock with the
version of Bundler that we'll use at runtime before we copy it into
the store. This feels fragile, but it's the best we can do without
changes upstream, or resorting to more delicate hacks.
With all of the challenges in using Bundler, one might wonder why we
can't just cut Bundler out of the picture and use RubyGems. After all,
Nix provides most of the isolation that Bundler is used for anyway.
The problem, however, is that almost every Rails application calls
`Bundler::require` at startup (by way of the default project templates).
Because bundler will then, by default, `require` each gem listed in the
Gemfile, Rails applications are almost always written such that none of
the source files explicitly require their dependencies. That leaves us
with two options: support and use Bundler, or maintain massive patches
for every Rails application that we package.
Closes #8612
2015-11-15 03:17:29 +01:00
|
|
|
dontBuild = false;
|
2015-01-24 23:59:01 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace lib/tzinfo/zoneinfo_data_source.rb \
|
2015-01-25 22:01:48 +01:00
|
|
|
--replace "/usr/share/zoneinfo" "${tzdata}/share/zoneinfo"
|
2015-01-24 23:59:01 +01: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 23:59:01 +01:00
|
|
|
|
2015-01-22 02:33:19 +01:00
|
|
|
xapian-ruby = attrs: {
|
|
|
|
# use the system xapian
|
ruby: new bundler infrastructure
This improves our Bundler integration (i.e. `bundlerEnv`).
Before describing the implementation differences, I'd like to point a
breaking change: buildRubyGem now expects `gemName` and `version` as
arguments, rather than a `name` attribute in the form of
"<gem-name>-<version>".
Now for the differences in implementation.
The previous implementation installed all gems at once in a single
derivation. This was made possible by using a set of monkey-patches to
prevent Bundler from downloading gems impurely, and to help Bundler
find and activate all required gems prior to installation. This had
several downsides:
* The patches were really hard to understand, and required subtle
interaction with the rest of the build environment.
* A single install failure would cause the entire derivation to fail.
The new implementation takes a different approach: we install gems into
separate derivations, and then present Bundler with a symlink forest
thereof. This has a couple benefits over the existing approach:
* Fewer patches are required, with less interplay with the rest of the
build environment.
* Changes to one gem no longer cause a rebuild of the entire dependency
graph.
* Builds take 20% less time (using gitlab as a reference).
It's unfortunate that we still have to muck with Bundler's internals,
though it's unavoidable with the way that Bundler is currently designed.
There are a number improvements that could be made in Bundler that would
simplify our packaging story:
* Bundler requires all installed gems reside within the same prefix
(GEM_HOME), unlike RubyGems which allows for multiple prefixes to
be specified through GEM_PATH. It would be ideal if Bundler allowed
for packages to be installed and sourced from multiple prefixes.
* Bundler installs git sources very differently from how RubyGems
installs gem packages, and, unlike RubyGems, it doesn't provide a
public interface (CLI or programmatic) to guide the installation of a
single gem. We are presented with the options of either
reimplementing a considerable portion Bundler, or patch and use parts
of its internals; I choose the latter. Ideally, there would be a way
to install gems from git sources in a manner similar to how we drive
`gem` to install gem packages.
* When a bundled program is executed (via `bundle exec` or a
binstub that does `require 'bundler/setup'`), the setup process reads
the Gemfile.lock, activates the dependencies, re-serializes the lock
file it read earlier, and then attempts to overwrite the Gemfile.lock
if the contents aren't bit-identical. I think the reasoning is that
by merely running an application with a newer version of Bundler, you'll
automatically keep the Gemfile.lock up-to-date with any changes in the
format. Unfortunately, that doesn't play well with any form of
packaging, because bundler will immediately cause the application to
abort when it attempts to write to the read-only Gemfile.lock in the
store. We work around this by normalizing the Gemfile.lock with the
version of Bundler that we'll use at runtime before we copy it into
the store. This feels fragile, but it's the best we can do without
changes upstream, or resorting to more delicate hacks.
With all of the challenges in using Bundler, one might wonder why we
can't just cut Bundler out of the picture and use RubyGems. After all,
Nix provides most of the isolation that Bundler is used for anyway.
The problem, however, is that almost every Rails application calls
`Bundler::require` at startup (by way of the default project templates).
Because bundler will then, by default, `require` each gem listed in the
Gemfile, Rails applications are almost always written such that none of
the source files explicitly require their dependencies. That leaves us
with two options: support and use Bundler, or maintain massive patches
for every Rails application that we package.
Closes #8612
2015-11-15 03:17:29 +01:00
|
|
|
dontBuild = false;
|
2017-09-05 23:26:13 +02:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
buildInputs = [ xapian_1_2_22 zlib ];
|
2015-01-22 02:33:19 +01: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-22 02:33:19 +01:00
|
|
|
'';
|
|
|
|
};
|
2016-04-17 22:36:40 +02:00
|
|
|
|
2014-10-28 05:16:14 +01:00
|
|
|
}
|