2014-08-31 18:32:34 +01: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).
|
|
|
|
|
2021-03-14 16:11:48 +00:00
|
|
|
{ lib, fetchurl, writeScript, ruby, libkrb5, libxml2, libxslt, python, stdenv, which
|
2020-05-14 18:52:05 +01:00
|
|
|
, libiconv, postgresql, v8, clang, sqlite, zlib, imagemagick, lasem
|
2020-12-31 07:48:55 +00:00
|
|
|
, pkg-config , ncurses, xapian, gpgme, util-linux, tzdata, icu, libffi
|
2019-09-22 08:38:09 +01:00
|
|
|
, cmake, libssh2, openssl, libmysqlclient, darwin, git, perl, pcre, gecode_3, curl
|
2019-11-11 23:30:24 +00:00
|
|
|
, msgpack, libsodium, snappy, libossp_uuid, lxc, libpcap, xorg, gtk2, buildRubyGem
|
2019-05-22 12:03:39 +01:00
|
|
|
, cairo, re2, rake, gobject-introspection, gdk-pixbuf, zeromq, czmq, graphicsmagick, libcxx
|
2019-05-03 11:48:14 +01:00
|
|
|
, file, libvirt, glib, vips, taglib, libopus, linux-pam, libidn, protobuf, fribidi, harfbuzz
|
2019-05-18 18:45:38 +01:00
|
|
|
, bison, flex, pango, python3, patchelf, binutils, freetds, wrapGAppsHook, atk
|
2021-04-07 15:52:15 +01:00
|
|
|
, bundler, libsass, libselinux ? null, libsepol ? null, shared-mime-info
|
2016-09-21 13:29:12 +01:00
|
|
|
}@args:
|
2014-08-31 18:32:34 +01:00
|
|
|
|
|
|
|
let
|
2017-05-12 13:52:18 +01:00
|
|
|
rainbow_rake = buildRubyGem {
|
2018-11-04 23:32:52 +00:00
|
|
|
pname = "rake";
|
2017-05-12 13:52:18 +01:00
|
|
|
gemName = "rake";
|
2017-10-05 09:10:57 +01:00
|
|
|
source.sha256 = "01j8fc9bqjnrsxbppncai05h43315vmz9fwg28qdsgcjw9ck1d7n";
|
2017-05-12 13:52:18 +01:00
|
|
|
type = "gem";
|
|
|
|
version = "12.0.0";
|
|
|
|
};
|
2014-10-28 04:16:14 +00:00
|
|
|
in
|
2014-08-31 18:32:34 +01:00
|
|
|
|
2014-10-28 04:16:14 +00:00
|
|
|
{
|
2017-09-05 23:03:42 +01:00
|
|
|
atk = attrs: {
|
2019-05-18 18:45:38 +01:00
|
|
|
dependencies = attrs.dependencies ++ [ "gobject-introspection" ];
|
2020-12-31 07:48:55 +00:00
|
|
|
nativeBuildInputs = [ rake bundler pkg-config ];
|
2019-05-18 18:45:38 +01:00
|
|
|
propagatedBuildInputs = [ gobject-introspection wrapGAppsHook atk ];
|
2017-09-05 23:03:42 +01:00
|
|
|
};
|
2017-05-18 01:47:45 +01:00
|
|
|
|
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 01:47:45 +01:00
|
|
|
cairo = attrs: {
|
2020-12-31 07:48:55 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2018-03-13 10:16:03 +00:00
|
|
|
buildInputs = [ gtk2 pcre xorg.libpthreadstubs xorg.libXdmcp];
|
2017-05-18 01:47:45 +01:00
|
|
|
};
|
|
|
|
|
2017-10-31 04:33:52 +00:00
|
|
|
cairo-gobject = attrs: {
|
2020-12-31 07:48:55 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2018-03-13 10:16:03 +00:00
|
|
|
buildInputs = [ cairo pcre xorg.libpthreadstubs xorg.libXdmcp ];
|
2017-10-31 04:33:52 +00:00
|
|
|
};
|
|
|
|
|
2015-01-25 21:01:48 +00:00
|
|
|
charlock_holmes = attrs: {
|
2015-04-16 00:24:04 +01:00
|
|
|
buildInputs = [ which icu zlib ];
|
2015-01-25 21:01:48 +00:00
|
|
|
};
|
2017-10-31 04:33:52 +00:00
|
|
|
|
2019-05-02 01:37:35 +01:00
|
|
|
cld3 = attrs: {
|
2020-12-31 07:48:55 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2019-05-02 01:37:35 +01:00
|
|
|
buildInputs = [ protobuf ];
|
|
|
|
};
|
|
|
|
|
2019-05-18 18:45:38 +01:00
|
|
|
cocoapods-acknowledgements = attrs: {
|
|
|
|
dependencies = attrs.dependencies ++ [ "cocoapods" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
cocoapods-deploy = attrs: {
|
|
|
|
dependencies = [ "cocoapods" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
cocoapods-disable-podfile-validations = attrs: {
|
|
|
|
dependencies = [ "cocoapods" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
cocoapods-generate = attrs: {
|
|
|
|
dependencies = attrs.dependencies ++ [ "cocoapods" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
cocoapods-git_url_rewriter = attrs: {
|
|
|
|
dependencies = [ "cocoapods" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
cocoapods-keys = attrs: {
|
|
|
|
dependencies = attrs.dependencies ++ [ "cocoapods" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
cocoapods-open = attrs: {
|
|
|
|
dependencies = [ "cocoapods" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
cocoapods-try-release-fix = attrs: {
|
|
|
|
dependencies = [ "cocoapods" ];
|
|
|
|
};
|
|
|
|
|
2017-09-21 07:53:25 +01:00
|
|
|
curb = attrs: {
|
|
|
|
buildInputs = [ curl ];
|
|
|
|
};
|
2015-01-25 21:01:48 +00:00
|
|
|
|
2018-08-15 14:32:50 +01:00
|
|
|
curses = attrs: {
|
|
|
|
buildInputs = [ ncurses ];
|
|
|
|
};
|
|
|
|
|
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 02:17:29 +00: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 10:16:03 +00:00
|
|
|
|
2019-01-18 10:48:48 +00:00
|
|
|
digest-sha3 = attrs: {
|
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
};
|
|
|
|
|
2018-02-19 21:56:17 +00:00
|
|
|
ethon = attrs: {
|
|
|
|
dontBuild = false;
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace lib/ethon/curls/settings.rb \
|
2018-02-20 10:29:07 +00:00
|
|
|
--replace "libcurl" "${curl.out}/lib/libcurl${stdenv.hostPlatform.extensions.sharedLibrary}"
|
2018-02-19 21:56:17 +00:00
|
|
|
'';
|
2018-03-13 10:16:03 +00: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 02:17:29 +00:00
|
|
|
|
2019-05-18 18:45:38 +01:00
|
|
|
fog-dnsimple = attrs:
|
|
|
|
lib.optionalAttrs (lib.versionOlder attrs.version "1.0.1") {
|
|
|
|
postInstall = ''
|
|
|
|
cd $(cat $out/nix-support/gem-meta/install-path)
|
|
|
|
rm {$out/bin,bin,../../bin}/{setup,console}
|
|
|
|
'';
|
|
|
|
};
|
2018-06-15 12:27:31 +01:00
|
|
|
|
|
|
|
redis-rack = attrs: {
|
|
|
|
dontBuild = false;
|
|
|
|
preBuild = ''
|
|
|
|
exec 3>&1
|
|
|
|
output="$(gem build $gemspec | tee >(cat - >&3))"
|
|
|
|
exec 3>&-
|
|
|
|
sed -i 's!"rake".freeze!!' $gemspec
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
ffi-rzmq-core = attrs: {
|
|
|
|
postInstall = ''
|
|
|
|
installPath=$(cat $out/nix-support/gem-meta/install-path)
|
|
|
|
sed -i $installPath/lib/ffi-rzmq-core/libzmq.rb -e 's@inside_gem =.*@inside_gem = "${zeromq}/lib"@'
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2021-04-07 15:52:15 +01:00
|
|
|
mimemagic = attrs: {
|
|
|
|
FREEDESKTOP_MIME_TYPES_PATH = "${shared-mime-info}/share/mime/packages/freedesktop.org.xml";
|
|
|
|
};
|
|
|
|
|
2018-06-15 12:27:31 +01:00
|
|
|
mini_magick = attrs: {
|
|
|
|
postInstall = ''
|
|
|
|
installPath=$(cat $out/nix-support/gem-meta/install-path)
|
|
|
|
echo -e "\nENV['PATH'] += ':${graphicsmagick}/bin'\n" >> $installPath/lib/mini_magick/configuration.rb
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2017-09-20 23:18:01 +01:00
|
|
|
do_sqlite3 = attrs: {
|
|
|
|
buildInputs = [ sqlite ];
|
|
|
|
};
|
|
|
|
|
2016-01-25 10:22:00 +00:00
|
|
|
eventmachine = attrs: {
|
|
|
|
buildInputs = [ openssl ];
|
|
|
|
};
|
|
|
|
|
2015-01-25 21:01:48 +00:00
|
|
|
ffi = attrs: {
|
2020-12-31 07:48:55 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2017-09-05 22:26:13 +01:00
|
|
|
buildInputs = [ libffi ];
|
2015-01-25 21:01:48 +00:00
|
|
|
};
|
|
|
|
|
2017-10-31 04:33:52 +00:00
|
|
|
gdk_pixbuf2 = attrs: {
|
2020-12-31 07:48:55 +00:00
|
|
|
nativeBuildInputs = [ pkg-config bundler rake ];
|
2019-05-18 18:45:38 +01:00
|
|
|
propagatedBuildInputs = [ gobject-introspection wrapGAppsHook gdk-pixbuf ];
|
2017-10-31 04:33:52 +00:00
|
|
|
};
|
|
|
|
|
2015-01-22 01:33:19 +00:00
|
|
|
gpgme = attrs: {
|
|
|
|
buildInputs = [ gpgme ];
|
2019-09-10 13:05:19 +01:00
|
|
|
buildFlags = [ "--use-system-libraries" ];
|
2015-01-22 01:33:19 +00:00
|
|
|
};
|
|
|
|
|
2017-09-05 23:03:42 +01:00
|
|
|
gio2 = attrs: {
|
2020-12-31 07:48:55 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-11-24 15:29:28 +00:00
|
|
|
buildInputs = [ gtk2 pcre gobject-introspection ] ++ lib.optionals stdenv.isLinux [ util-linux libselinux libsepol ];
|
2017-09-05 23:03:42 +01:00
|
|
|
};
|
2017-05-18 01:47:45 +01:00
|
|
|
|
2017-09-03 14:38:28 +01:00
|
|
|
gitlab-markup = attrs: { meta.priority = 1; };
|
|
|
|
|
2021-02-17 21:55:14 +00:00
|
|
|
gitlab-pg_query = attrs: lib.optionalAttrs (attrs.version == "1.3.1") {
|
2020-11-20 20:02:55 +00:00
|
|
|
dontBuild = false;
|
|
|
|
postPatch = ''
|
2021-02-17 21:55:14 +00:00
|
|
|
sed -i "s;'https://codeload.github.com.*';'${fetchurl {
|
|
|
|
url = "https://codeload.github.com/lfittl/libpg_query/tar.gz/10-1.0.3";
|
|
|
|
sha256 = "0jfij8apzxsdabl70j42xgd5f3ka1gdcrk764nccp66164gpcchk";
|
|
|
|
}}';" ext/pg_query/extconf.rb
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2021-04-02 05:50:24 +01:00
|
|
|
pg_query = attrs: lib.optionalAttrs (attrs.version == "2.0.2") {
|
2021-03-18 20:59:09 +00:00
|
|
|
dontBuild = false;
|
|
|
|
postPatch = ''
|
|
|
|
sed -i "s;'https://codeload.github.com.*';'${fetchurl {
|
2021-04-02 05:50:24 +01:00
|
|
|
url = "https://codeload.github.com/lfittl/libpg_query/tar.gz/13-2.0.2";
|
|
|
|
sha256 = "0ms2s6hmy8qyzv4g1hj4i2p5fws1v8lrj73b2knwbp2ipd45yj7y";
|
2021-03-18 20:59:09 +00:00
|
|
|
}}';" ext/pg_query/extconf.rb
|
|
|
|
'';
|
|
|
|
} // lib.optionalAttrs (attrs.version == "1.3.0") {
|
|
|
|
# Needed for gitlab
|
2021-02-17 21:55:14 +00:00
|
|
|
dontBuild = false;
|
|
|
|
postPatch = ''
|
|
|
|
sed -i "s;'https://codeload.github.com.*';'${fetchurl {
|
|
|
|
url = "https://codeload.github.com/lfittl/libpg_query/tar.gz/10-1.0.4";
|
|
|
|
sha256 = "0f0kshhai0pnkqj0w4kgz3fssnvwidllc31n1fysxjjzdqlr1k48";
|
|
|
|
}}';" ext/pg_query/extconf.rb
|
2020-11-20 20:02:55 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2017-09-05 23:03:42 +01:00
|
|
|
glib2 = attrs: {
|
2020-12-31 07:48:55 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2017-09-05 23:03:42 +01:00
|
|
|
buildInputs = [ gtk2 pcre ];
|
|
|
|
};
|
2017-05-18 01:47:45 +01:00
|
|
|
|
|
|
|
gtk2 = attrs: {
|
2019-05-18 18:45:38 +01:00
|
|
|
nativeBuildInputs = [
|
2020-12-31 07:48:55 +00:00
|
|
|
binutils pkg-config
|
2019-05-18 18:45:38 +01:00
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
2020-11-24 15:29:28 +00:00
|
|
|
util-linux libselinux libsepol
|
2019-05-18 18:45:38 +01:00
|
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
atk
|
|
|
|
gdk-pixbuf
|
2019-05-03 11:48:14 +01:00
|
|
|
fribidi
|
|
|
|
gobject-introspection
|
|
|
|
gtk2
|
|
|
|
harfbuzz
|
|
|
|
pcre
|
|
|
|
xorg.libpthreadstubs
|
|
|
|
xorg.libXdmcp
|
|
|
|
];
|
2017-05-18 01:47:45 +01:00
|
|
|
# CFLAGS must be set for this gem to detect gdkkeysyms.h correctly
|
2019-05-03 11:48:14 +01:00
|
|
|
# CFLAGS = "-I${gtk2.dev}/include/gtk-2.0 -I/non-existent-path";
|
2017-05-18 01:47:45 +01:00
|
|
|
};
|
|
|
|
|
2017-10-31 04:33:52 +00:00
|
|
|
gobject-introspection = attrs: {
|
2020-12-31 07:48:55 +00:00
|
|
|
nativeBuildInputs = [ pkg-config pcre ];
|
2019-05-18 18:45:38 +01:00
|
|
|
propagatedBuildInputs = [ gobject-introspection wrapGAppsHook glib ];
|
2017-10-31 04:33:52 +00:00
|
|
|
};
|
2017-05-18 01:47:45 +01:00
|
|
|
|
2017-07-05 22:53:31 +01:00
|
|
|
grpc = attrs: {
|
2020-12-31 07:48:55 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2017-09-05 22:26:13 +01:00
|
|
|
buildInputs = [ openssl ];
|
2018-04-25 23:14:38 +01:00
|
|
|
hardeningDisable = [ "format" ];
|
2019-10-27 13:03:25 +00:00
|
|
|
NIX_CFLAGS_COMPILE = toString [
|
2019-01-11 08:31:18 +00:00
|
|
|
"-Wno-error=stringop-overflow"
|
|
|
|
"-Wno-error=implicit-fallthrough"
|
|
|
|
"-Wno-error=sizeof-pointer-memaccess"
|
|
|
|
"-Wno-error=cast-function-type"
|
|
|
|
"-Wno-error=class-memaccess"
|
|
|
|
"-Wno-error=ignored-qualifiers"
|
2019-08-26 20:31:26 +01:00
|
|
|
"-Wno-error=tautological-compare"
|
2019-11-05 08:26:09 +00:00
|
|
|
"-Wno-error=stringop-truncation"
|
2019-01-11 08:31:18 +00:00
|
|
|
];
|
|
|
|
dontBuild = false;
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace '-Wno-invalid-source-encoding' ""
|
|
|
|
'';
|
2017-07-05 22:53:31 +01:00
|
|
|
};
|
|
|
|
|
2016-05-04 23:41:44 +01:00
|
|
|
hitimes = attrs: {
|
|
|
|
buildInputs =
|
2021-01-17 18:11:59 +00:00
|
|
|
lib.optionals stdenv.isDarwin
|
2016-05-04 23:41:44 +01:00
|
|
|
[ darwin.apple_sdk.frameworks.CoreServices ];
|
|
|
|
};
|
|
|
|
|
2018-11-08 16:46:29 +00:00
|
|
|
iconv = attrs: {
|
|
|
|
buildFlags = lib.optional stdenv.isDarwin "--with-iconv-dir=${libiconv}";
|
|
|
|
};
|
|
|
|
|
2019-05-02 01:37:35 +01:00
|
|
|
idn-ruby = attrs: {
|
|
|
|
buildInputs = [ libidn ];
|
|
|
|
};
|
|
|
|
|
2017-03-04 02:09:04 +00:00
|
|
|
# disable bundle install as it can't install anything in addition to what is
|
2017-03-04 04:05:37 +00: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 02:09:04 +00:00
|
|
|
jekyll = attrs: {
|
|
|
|
postInstall = ''
|
|
|
|
installPath=$(cat $out/nix-support/gem-meta/install-path)
|
2017-03-04 04:05:37 +00: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 02:09:04 +00: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 02:17:29 +00: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 ];
|
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 02:17:29 +00:00
|
|
|
buildFlags = [ "--with-system-v8=true" ];
|
2020-02-18 21:29:38 +00:00
|
|
|
dontBuild = false;
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace ext/libv8/extconf.rb \
|
|
|
|
--replace "location = Libv8::Location::Vendor.new" \
|
|
|
|
"location = Libv8::Location::System.new"
|
|
|
|
'';
|
2015-01-22 01:33:19 +00:00
|
|
|
};
|
|
|
|
|
2019-05-18 18:45:38 +01:00
|
|
|
execjs = attrs: {
|
|
|
|
propagatedBuildInputs = [ v8 ];
|
|
|
|
};
|
|
|
|
|
2018-07-26 18:51:17 +01:00
|
|
|
libxml-ruby = attrs: {
|
|
|
|
buildFlags = [
|
|
|
|
"--with-xml2-lib=${libxml2.out}/lib"
|
|
|
|
"--with-xml2-include=${libxml2.dev}/include/libxml2"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2019-07-04 12:39:29 +01:00
|
|
|
mathematical = attrs: {
|
2020-06-19 06:27:21 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
ruby
|
2019-07-04 12:39:29 +01:00
|
|
|
cmake
|
|
|
|
bison
|
|
|
|
flex
|
2020-12-31 07:48:55 +00:00
|
|
|
pkg-config
|
2020-06-19 06:27:21 +01:00
|
|
|
python3
|
2020-05-14 18:52:05 +01:00
|
|
|
patchelf
|
2020-06-19 06:27:21 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2019-07-04 12:39:29 +01:00
|
|
|
cairo
|
2020-06-19 06:27:21 +01:00
|
|
|
fribidi
|
2019-05-22 12:03:39 +01:00
|
|
|
gdk-pixbuf
|
2020-06-19 06:27:21 +01:00
|
|
|
glib
|
2019-07-04 12:39:29 +01:00
|
|
|
libxml2
|
2020-06-19 06:27:21 +01:00
|
|
|
pango
|
2019-07-04 12:39:29 +01:00
|
|
|
];
|
|
|
|
|
2020-06-19 06:27:21 +01:00
|
|
|
strictDeps = true;
|
|
|
|
|
2019-07-04 12:39:29 +01:00
|
|
|
# The ruby build script takes care of this
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
2020-01-06 23:02:58 +00:00
|
|
|
postInstall = ''
|
|
|
|
# Reduce output size by a lot, and remove some unnecessary references.
|
|
|
|
# The ext directory should only be required at build time, so
|
|
|
|
# can be deleted now.
|
|
|
|
rm -r $out/${ruby.gemPath}/gems/mathematical-${attrs.version}/ext \
|
|
|
|
$out/${ruby.gemPath}/extensions/*/*/mathematical-${attrs.version}/gem_make.out
|
|
|
|
'';
|
|
|
|
|
2020-05-14 18:52:05 +01:00
|
|
|
# For some reason 'mathematical.so' is missing cairo, glib, and
|
|
|
|
# lasem in its RPATH, add them explicitly here
|
2019-07-04 12:39:29 +01:00
|
|
|
postFixup = lib.optionalString stdenv.isLinux ''
|
|
|
|
soPath="$out/${ruby.gemPath}/gems/mathematical-${attrs.version}/lib/mathematical/mathematical.so"
|
2020-05-14 18:52:05 +01:00
|
|
|
rpath="$(patchelf --print-rpath "$soPath")"
|
|
|
|
patchelf --set-rpath "${lib.makeLibraryPath [ lasem glib cairo ]}:$rpath" "$soPath"
|
|
|
|
patchelf --replace-needed liblasem.so liblasem-0.4.so "$soPath"
|
2019-07-04 12:39:29 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2018-10-23 15:09:43 +01:00
|
|
|
magic = attrs: {
|
|
|
|
buildInputs = [ file ];
|
|
|
|
postInstall = ''
|
|
|
|
installPath=$(cat $out/nix-support/gem-meta/install-path)
|
|
|
|
sed -e 's@ENV\["MAGIC_LIB"\] ||@ENV\["MAGIC_LIB"\] || "${file}/lib/libmagic.so" ||@' -i $installPath/lib/magic/api.rb
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2018-11-09 09:41:49 +00:00
|
|
|
metasploit-framework = attrs: {
|
|
|
|
preInstall = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2016-01-25 10:22:00 +00:00
|
|
|
msgpack = attrs: {
|
2018-08-18 00:53:33 +01:00
|
|
|
buildInputs = [ msgpack ];
|
2016-01-25 10:22:00 +00:00
|
|
|
};
|
2017-03-06 19:23:02 +00:00
|
|
|
|
2016-11-04 00:19:25 +00:00
|
|
|
mysql = attrs: {
|
2019-09-22 08:38:09 +01:00
|
|
|
buildInputs = [ libmysqlclient zlib openssl ];
|
2016-11-04 00:19:25 +00:00
|
|
|
};
|
2016-01-25 10:22:00 +00:00
|
|
|
|
2015-01-25 21:01:48 +00:00
|
|
|
mysql2 = attrs: {
|
2019-09-22 08:38:09 +01:00
|
|
|
buildInputs = [ libmysqlclient zlib openssl ];
|
2015-01-25 21:01:48 +00:00
|
|
|
};
|
|
|
|
|
2015-01-22 01:33:19 +00:00
|
|
|
ncursesw = attrs: {
|
|
|
|
buildInputs = [ ncurses ];
|
|
|
|
buildFlags = [
|
2015-10-05 19:32:54 +01:00
|
|
|
"--with-cflags=-I${ncurses.dev}/include"
|
2016-02-01 17:16:50 +00:00
|
|
|
"--with-ldflags=-L${ncurses.out}/lib"
|
2015-01-22 01:33:19 +00:00
|
|
|
];
|
2014-10-28 04:16:14 +00:00
|
|
|
};
|
2014-08-31 18:32:34 +01:00
|
|
|
|
2014-10-28 04:16:14 +00:00
|
|
|
nokogiri = attrs: {
|
|
|
|
buildFlags = [
|
|
|
|
"--use-system-libraries"
|
2021-01-09 04:20:00 +00:00
|
|
|
"--with-zlib-lib=${zlib.out}/lib"
|
|
|
|
"--with-zlib-include=${zlib.dev}/include"
|
2015-10-05 12:23:01 +01: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 03:38:29 +00:00
|
|
|
] ++ lib.optional stdenv.isDarwin "--with-iconv-dir=${libiconv}";
|
2014-10-29 01:16:02 +00:00
|
|
|
};
|
|
|
|
|
2021-02-12 15:09:21 +00:00
|
|
|
openssl = attrs: {
|
|
|
|
buildInputs = [ openssl ];
|
|
|
|
};
|
|
|
|
|
2019-04-07 14:09:15 +01:00
|
|
|
opus-ruby = attrs: {
|
|
|
|
dontBuild = false;
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace lib/opus-ruby.rb \
|
|
|
|
--replace "ffi_lib 'opus'" \
|
|
|
|
"ffi_lib '${libopus}/lib/libopus${stdenv.hostPlatform.extensions.sharedLibrary}'"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2019-02-06 22:51:28 +00:00
|
|
|
ovirt-engine-sdk = attrs: {
|
|
|
|
buildInputs = [ curl libxml2 ];
|
|
|
|
};
|
|
|
|
|
2017-05-18 01:47:45 +01:00
|
|
|
pango = attrs: {
|
2019-05-18 18:45:38 +01:00
|
|
|
nativeBuildInputs = [
|
2020-12-31 07:48:55 +00:00
|
|
|
pkg-config
|
2019-05-03 11:48:14 +01:00
|
|
|
fribidi
|
|
|
|
harfbuzz
|
|
|
|
pcre
|
|
|
|
xorg.libpthreadstubs
|
|
|
|
xorg.libXdmcp
|
|
|
|
];
|
2019-05-18 18:45:38 +01:00
|
|
|
propagatedBuildInputs = [ gobject-introspection wrapGAppsHook gtk2 ];
|
2017-05-18 01:47:45 +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 02:17:29 +00: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"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
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 02:17:29 +00:00
|
|
|
puma = attrs: {
|
|
|
|
buildInputs = [ openssl ];
|
|
|
|
};
|
|
|
|
|
2017-05-12 13:52:18 +01:00
|
|
|
rainbow = attrs: {
|
|
|
|
buildInputs = [ rainbow_rake ];
|
|
|
|
};
|
|
|
|
|
2019-01-26 21:13:57 +00:00
|
|
|
rbczmq = { ... }: {
|
|
|
|
buildInputs = [ zeromq czmq ];
|
|
|
|
buildFlags = [ "--with-system-libs" ];
|
|
|
|
};
|
|
|
|
|
2019-01-18 07:37:38 +00:00
|
|
|
rbnacl = spec:
|
|
|
|
if lib.versionOlder spec.version "6.0.0" then {
|
|
|
|
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${stdenv.hostPlatform.extensions.sharedLibrary}'
|
|
|
|
"
|
|
|
|
'';
|
|
|
|
} else {
|
2019-05-18 18:45:38 +01:00
|
|
|
dontBuild = false;
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace lib/rbnacl/sodium.rb \
|
|
|
|
--replace 'ffi_lib ["sodium"' \
|
|
|
|
'ffi_lib ["${libsodium}/lib/libsodium${stdenv.hostPlatform.extensions.sharedLibrary}"'
|
|
|
|
'';
|
2019-01-18 07:37:38 +00:00
|
|
|
};
|
2016-06-16 18:33:12 +01:00
|
|
|
|
2017-08-06 15:27:54 +01:00
|
|
|
re2 = attrs: {
|
|
|
|
buildInputs = [ re2 ];
|
|
|
|
};
|
|
|
|
|
2014-10-29 01:16:02 +00:00
|
|
|
rmagick = attrs: {
|
2020-12-31 07:48:55 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2017-09-05 22:26:13 +01:00
|
|
|
buildInputs = [ imagemagick which ];
|
2014-10-29 01:16:02 +00:00
|
|
|
};
|
|
|
|
|
2019-05-02 01:37:35 +01:00
|
|
|
rpam2 = attrs: {
|
|
|
|
buildInputs = [ linux-pam ];
|
|
|
|
};
|
|
|
|
|
2018-12-16 22:36:30 +00:00
|
|
|
ruby-libvirt = attrs: {
|
2020-12-31 07:48:55 +00:00
|
|
|
buildInputs = [ libvirt pkg-config ];
|
2018-12-16 22:36:30 +00:00
|
|
|
buildFlags = [
|
|
|
|
"--with-libvirt-include=${libvirt}/include"
|
|
|
|
"--with-libvirt-lib=${libvirt}/lib"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2016-12-18 18:27:48 +00:00
|
|
|
ruby-lxc = attrs: {
|
|
|
|
buildInputs = [ lxc ];
|
|
|
|
};
|
|
|
|
|
2015-10-15 23:50:38 +01:00
|
|
|
ruby-terminfo = attrs: {
|
|
|
|
buildInputs = [ ncurses ];
|
|
|
|
buildFlags = [
|
|
|
|
"--with-cflags=-I${ncurses.dev}/include"
|
|
|
|
"--with-ldflags=-L${ncurses.out}/lib"
|
|
|
|
];
|
|
|
|
};
|
2019-01-31 07:12:42 +00:00
|
|
|
|
|
|
|
ruby-vips = attrs: {
|
|
|
|
postInstall = ''
|
|
|
|
cd "$(cat $out/nix-support/gem-meta/install-path)"
|
|
|
|
|
|
|
|
substituteInPlace lib/vips.rb \
|
|
|
|
--replace "glib-2.0" "${glib.out}/lib/libglib-2.0${stdenv.hostPlatform.extensions.sharedLibrary}"
|
|
|
|
|
|
|
|
substituteInPlace lib/vips.rb \
|
|
|
|
--replace "gobject-2.0" "${glib.out}/lib/libgobject-2.0${stdenv.hostPlatform.extensions.sharedLibrary}"
|
|
|
|
|
|
|
|
substituteInPlace lib/vips.rb \
|
2021-01-17 18:11:59 +00:00
|
|
|
--replace "vips_libname = 'vips'" "vips_libname = '${lib.getLib vips}/lib/libvips${stdenv.hostPlatform.extensions.sharedLibrary}'"
|
2019-01-31 07:12:42 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2015-01-25 21:01:48 +00:00
|
|
|
rugged = attrs: {
|
2020-12-31 07:48:55 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config which ];
|
|
|
|
buildInputs = [ openssl libssh2 zlib ];
|
2018-03-10 11:59:06 +00:00
|
|
|
dontUseCmakeConfigure = true;
|
2015-01-25 21:01:48 +00:00
|
|
|
};
|
|
|
|
|
2018-10-11 20:04:29 +01:00
|
|
|
sassc = attrs: {
|
|
|
|
nativeBuildInputs = [ rake ];
|
2019-05-18 18:45:38 +01:00
|
|
|
dontBuild = false;
|
2019-10-27 13:03:25 +00:00
|
|
|
SASS_LIBSASS_PATH = toString libsass;
|
2019-05-18 18:45:38 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace lib/sassc/native.rb \
|
|
|
|
--replace 'gem_root = spec.gem_dir' 'gem_root = File.join(__dir__, "../../")'
|
|
|
|
'';
|
2019-10-27 13:03:25 +00:00
|
|
|
} // (lib.optionalAttrs stdenv.isDarwin {
|
2019-09-14 11:17:05 +01:00
|
|
|
# https://github.com/NixOS/nixpkgs/issues/19098
|
2019-10-27 13:03:25 +00:00
|
|
|
buildFlags = [ "--disable-lto" ];
|
|
|
|
});
|
2018-10-11 20:04:29 +01:00
|
|
|
|
2019-10-27 13:03:25 +00:00
|
|
|
scrypt = attrs: lib.optionalAttrs stdenv.isDarwin {
|
|
|
|
dontBuild = false;
|
|
|
|
postPatch = ''
|
|
|
|
sed -i -e "s/-arch i386//" Rakefile ext/scrypt/Rakefile
|
|
|
|
'';
|
|
|
|
};
|
2016-11-03 00:24:10 +00:00
|
|
|
|
2019-01-26 04:18:33 +00:00
|
|
|
semian = attrs: {
|
|
|
|
buildInputs = [ openssl ];
|
|
|
|
};
|
|
|
|
|
2016-12-16 10:36:05 +00:00
|
|
|
sequel_pg = attrs: {
|
|
|
|
buildInputs = [ postgresql ];
|
|
|
|
};
|
|
|
|
|
2016-09-21 13:29:12 +01:00
|
|
|
snappy = attrs: {
|
|
|
|
buildInputs = [ args.snappy ];
|
|
|
|
};
|
|
|
|
|
2014-10-29 01:16:02 +00:00
|
|
|
sqlite3 = attrs: {
|
|
|
|
buildFlags = [
|
2015-10-13 21:30:30 +01:00
|
|
|
"--with-sqlite3-include=${sqlite.dev}/include"
|
|
|
|
"--with-sqlite3-lib=${sqlite.out}/lib"
|
2014-10-28 04:16:14 +00:00
|
|
|
];
|
|
|
|
};
|
2014-08-31 18:32:34 +01:00
|
|
|
|
2017-05-14 22:13:55 +01:00
|
|
|
rb-readline = attrs: {
|
|
|
|
dontBuild = false;
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace lib/rbreadline.rb \
|
2019-12-10 00:07:19 +00:00
|
|
|
--replace 'infocmp' '${ncurses}/bin/infocmp'
|
2017-05-14 22:13:55 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2019-02-24 17:58:53 +00:00
|
|
|
taglib-ruby = attrs: {
|
|
|
|
buildInputs = [ taglib ];
|
|
|
|
};
|
|
|
|
|
2019-04-09 21:51:13 +01:00
|
|
|
thrift = attrs: {
|
|
|
|
# See: https://stackoverflow.com/questions/36378190/cant-install-thrift-gem-on-os-x-el-capitan/36523125#36523125
|
|
|
|
# Note that thrift-0.8.0 is a dependency of fluent-plugin-scribe which is a dependency of fluentd.
|
|
|
|
buildFlags = lib.optional (stdenv.isDarwin && lib.versionOlder attrs.version "0.9.2.0")
|
|
|
|
"--with-cppflags=\"-D_FORTIFY_SOURCE=0 -Wno-macro-redefined -Wno-shift-negative-value\"";
|
|
|
|
};
|
|
|
|
|
2015-10-21 18:48:56 +01:00
|
|
|
timfel-krb5-auth = attrs: {
|
2021-03-14 16:11:48 +00:00
|
|
|
buildInputs = [ libkrb5 ];
|
2015-10-21 18:48:56 +01:00
|
|
|
};
|
|
|
|
|
2018-06-27 11:56:18 +01:00
|
|
|
tiny_tds = attrs: {
|
2020-12-31 07:48:55 +00:00
|
|
|
nativeBuildInputs = [ pkg-config openssl ];
|
2019-05-18 18:45:38 +01:00
|
|
|
buildInputs = [ freetds ];
|
2018-06-27 11:56:18 +01:00
|
|
|
};
|
|
|
|
|
2016-06-16 10:43:21 +01:00
|
|
|
typhoeus = attrs: {
|
|
|
|
buildInputs = [ curl ];
|
|
|
|
};
|
|
|
|
|
2017-04-06 15:14:45 +01: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 02:17:29 +00:00
|
|
|
dontBuild = false;
|
2019-01-29 20:30:56 +00:00
|
|
|
postPatch =
|
|
|
|
let
|
|
|
|
path = if lib.versionAtLeast attrs.version "2.0"
|
|
|
|
then "lib/tzinfo/data_sources/zoneinfo_data_source.rb"
|
|
|
|
else "lib/tzinfo/zoneinfo_data_source.rb";
|
|
|
|
in
|
|
|
|
''
|
|
|
|
substituteInPlace ${path} \
|
|
|
|
--replace "/usr/share/zoneinfo" "${tzdata}/share/zoneinfo"
|
|
|
|
'';
|
2015-01-24 22:59:01 +00:00
|
|
|
};
|
2017-03-06 19:23:02 +00:00
|
|
|
|
2016-11-21 12:41:05 +00:00
|
|
|
uuid4r = attrs: {
|
|
|
|
buildInputs = [ which libossp_uuid ];
|
|
|
|
};
|
2015-01-24 22:59:01 +00:00
|
|
|
|
2015-01-22 01:33:19 +00: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 02:17:29 +00:00
|
|
|
dontBuild = false;
|
2020-12-31 07:48:55 +00:00
|
|
|
nativeBuildInputs = [ rake pkg-config bundler ];
|
2019-05-18 18:45:38 +01:00
|
|
|
buildInputs = [ xapian zlib ];
|
2015-01-22 01:33:19 +00:00
|
|
|
postPatch = ''
|
|
|
|
cp ${./xapian-Rakefile} Rakefile
|
|
|
|
'';
|
|
|
|
preInstall = ''
|
2019-05-18 18:45:38 +01:00
|
|
|
export XAPIAN_CONFIG=${xapian}/bin/xapian-config
|
2015-01-22 01:33:19 +00:00
|
|
|
'';
|
|
|
|
};
|
2016-04-17 21:36:40 +01:00
|
|
|
|
2019-05-08 16:41:13 +01:00
|
|
|
zlib = attrs: {
|
|
|
|
buildInputs = [ zlib ];
|
|
|
|
};
|
|
|
|
|
2019-05-08 16:40:53 +01:00
|
|
|
zookeeper = attrs: {
|
2021-01-17 18:11:59 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ darwin.cctools ];
|
2019-09-13 15:01:13 +01:00
|
|
|
dontBuild = false;
|
|
|
|
postPatch = ''
|
|
|
|
sed -i ext/extconf.rb -e "4a \
|
|
|
|
FileUtils.cp '${./zookeeper-ftbfs-with-gcc-8.patch}', 'patches/zkc-3.4.5-gcc-8.patch'
|
|
|
|
"
|
|
|
|
'';
|
2019-05-08 16:40:53 +01:00
|
|
|
};
|
2014-10-28 04:16:14 +00:00
|
|
|
}
|