-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgem-config.nix
31 lines (27 loc) · 1.08 KB
/
gem-config.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ defaultGemConfig }:
defaultGemConfig // {
# Prevent the entire postgresql dependency tree from installing along with this gem
# by stripping files that keep `final.postgresql` refs in the closure.
pg = attrs: (defaultGemConfig.pg attrs) // {
postInstall = ''
find $out/lib/ruby/gems/ -name 'pg-*.info' -delete
'';
};
# Ensure newer verisons of the grpc gem can be built.
# TODO: Correctly apply this at the relevant version and submit to upstream nixpkgs
grpc = attrs: (defaultGemConfig.grpc attrs) // {
postPatch = ''
substituteInPlace Makefile \
--replace '-Wno-invalid-source-encoding' ""
substituteInPlace src/ruby/ext/grpc/extconf.rb \
--replace "ENV['AR']" "ENV['NONE']"
substituteInPlace src/ruby/ext/grpc/extconf.rb \
--replace "ENV['ARFLAGS']" "ENV['NONE']"
'';
};
# Prevent v8 from being installed with execjs, since almost everybody
# uses nodejs with this gem, and v8 does not install correctly on Darwin arm64.
execjs = attrs: (defaultGemConfig.execjs attrs) // {
propagatedBuildInputs = [];
};
}