nixpkgs/pkgs/development/ruby-modules/bundix/default.nix
Robert 107d53f40c bundix: 2.2.0 -> 2.2.1 (#26894)
This fixes `fetchurl-force.nix` not being installed, which breaks
bundix for some gems.

E.g.

```
$ nix-build --argstr url https://rubygems.org/gems/nio4r-2.1.0.gem /nix/store/y6959dxal86l3alc0ryf7752prbbkzxg-bundix-2.2.0/lib/ruby/gems/2.3.0/gems/bundix-2.2.0/lib/bundix/fetchurl-force.nix
error: getting status of ‘/nix/store/y6959dxal86l3alc0ryf7752prbbkzxg-bundix-2.2.0/lib/ruby/gems/2.3.0/gems/bundix-2.2.0/lib/bundix/fetchurl-force.nix’: No such file or directory
```
2017-06-27 10:24:16 +01:00

50 lines
1.3 KiB
Nix

{ buildRubyGem, fetchFromGitHub, lib, bundler, ruby, nix, nix-prefetch-git }:
buildRubyGem rec {
inherit ruby;
name = "${gemName}-${version}";
gemName = "bundix";
version = "2.2.1";
src = fetchFromGitHub {
owner = "manveru";
repo = "bundix";
rev = version;
sha256 = "1gh90yxm4k27jdjdl3r31fcg4sk7k54jlbw1zfm1p9q3i7k8x4i7";
};
buildInputs = [bundler];
postInstall = ''
substituteInPlace $GEM_HOME/gems/${gemName}-${version}/lib/bundix.rb \
--replace \
"'nix-instantiate'" \
"'${nix.out}/bin/nix-instantiate'" \
--replace \
"'nix-hash'" \
"'${nix.out}/bin/nix-hash'" \
--replace \
"'nix-prefetch-url'" \
"'${nix.out}/bin/nix-prefetch-url'" \
--replace \
"'nix-prefetch-git'" \
"'${nix-prefetch-git}/bin/nix-prefetch-git'"
'';
meta = {
inherit version;
description = "Creates Nix packages from Gemfiles";
longDescription = ''
This is a tool that converts Gemfile.lock files to nix expressions.
The output is then usable by the bundlerEnv derivation to list all the
dependencies of a ruby package.
'';
homepage = "https://github.com/manveru/bundix";
license = "MIT";
maintainers = with lib.maintainers; [ manveru zimbatm ];
platforms = lib.platforms.all;
};
}