summary refs log tree commit diff
path: root/pkgs/development/ruby-modules/gem-config/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-01-26 22:39:25 +0000
committerAlyssa Ross <hi@alyssa.is>2020-01-26 22:39:25 +0000
commitbd2ad77e38991af0d7a3a5d82bd3f41a077ce401 (patch)
treed1e26d039eb5004eb7c836aafff259cc198626d4 /pkgs/development/ruby-modules/gem-config/default.nix
parente5d8381542a8d084371d26013fab199f52474be7 (diff)
parentad3f0d9829119b611350a9be1c226fb625f1f310 (diff)
downloadnixpkgs-bd2ad77e38991af0d7a3a5d82bd3f41a077ce401.tar
nixpkgs-bd2ad77e38991af0d7a3a5d82bd3f41a077ce401.tar.gz
nixpkgs-bd2ad77e38991af0d7a3a5d82bd3f41a077ce401.tar.bz2
nixpkgs-bd2ad77e38991af0d7a3a5d82bd3f41a077ce401.tar.lz
nixpkgs-bd2ad77e38991af0d7a3a5d82bd3f41a077ce401.tar.xz
nixpkgs-bd2ad77e38991af0d7a3a5d82bd3f41a077ce401.tar.zst
nixpkgs-bd2ad77e38991af0d7a3a5d82bd3f41a077ce401.zip
Merge remote-tracking branch 'nixpkgs/master' into master
Diffstat (limited to 'pkgs/development/ruby-modules/gem-config/default.nix')
-rw-r--r--pkgs/development/ruby-modules/gem-config/default.nix17
1 files changed, 17 insertions, 0 deletions
diff --git a/pkgs/development/ruby-modules/gem-config/default.nix b/pkgs/development/ruby-modules/gem-config/default.nix
index c1eb82c5fa8..088bcedf6de 100644
--- a/pkgs/development/ruby-modules/gem-config/default.nix
+++ b/pkgs/development/ruby-modules/gem-config/default.nix
@@ -39,6 +39,15 @@ let
 in
 
 {
+  asciidoctor-diagram = { version, ruby, ... }: {
+    postInstall = ''
+      # Delete vendored JAR files unless using JRuby.
+      if ruby -e 'exit(RUBY_PLATFORM != "java")'; then
+          rm -v $out/${ruby.gemPath}/gems/$gemName-${version}/lib/*.jar
+      fi
+    '';
+  };
+
   atk = attrs: {
     dependencies = attrs.dependencies ++ [ "gobject-introspection" ];
     nativeBuildInputs = [ rake bundler pkgconfig ];
@@ -315,6 +324,14 @@ in
     # The ruby build script takes care of this
     dontUseCmakeConfigure = true;
 
+    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
+    '';
+
     # For some reason 'mathematical.so' is missing cairo and glib in its RPATH, add them explicitly here
     postFixup = lib.optionalString stdenv.isLinux ''
       soPath="$out/${ruby.gemPath}/gems/mathematical-${attrs.version}/lib/mathematical/mathematical.so"