lol

Merge pull request #77149 from alyssais/asciidoctor

Reduce AsciiDoctor closure size

authored by zimbatm.tngl.sh and committed by

GitHub ddc83e68 e639d3e8

+24 -6
+1 -1
pkgs/development/interpreters/ruby/default.nix
··· 49 49 # puts a reference to the C compiler in the binary. 50 50 # This might be required by some gems at runtime, 51 51 # but we allow to strip it out for smaller closure size. 52 - , removeReferencesTo, removeReferenceToCC ? false 52 + , removeReferencesTo, removeReferenceToCC ? true 53 53 , autoreconfHook, bison, autoconf 54 54 , buildEnv, bundler, bundix 55 55 , libiconv, libobjc, libunwind, Foundation
+17
pkgs/development/ruby-modules/gem-config/default.nix
··· 39 39 in 40 40 41 41 { 42 + asciidoctor-diagram = { version, ruby, ... }: { 43 + postInstall = '' 44 + # Delete vendored JAR files unless using JRuby. 45 + if ruby -e 'exit(RUBY_PLATFORM != "java")'; then 46 + rm -v $out/${ruby.gemPath}/gems/$gemName-${version}/lib/*.jar 47 + fi 48 + ''; 49 + }; 50 + 42 51 atk = attrs: { 43 52 dependencies = attrs.dependencies ++ [ "gobject-introspection" ]; 44 53 nativeBuildInputs = [ rake bundler pkgconfig ]; ··· 314 323 315 324 # The ruby build script takes care of this 316 325 dontUseCmakeConfigure = true; 326 + 327 + postInstall = '' 328 + # Reduce output size by a lot, and remove some unnecessary references. 329 + # The ext directory should only be required at build time, so 330 + # can be deleted now. 331 + rm -r $out/${ruby.gemPath}/gems/mathematical-${attrs.version}/ext \ 332 + $out/${ruby.gemPath}/extensions/*/*/mathematical-${attrs.version}/gem_make.out 333 + ''; 317 334 318 335 # For some reason 'mathematical.so' is missing cairo and glib in its RPATH, add them explicitly here 319 336 postFixup = lib.optionalString stdenv.isLinux ''
+6 -3
pkgs/development/ruby-modules/gem/default.nix
··· 39 39 , meta ? {} 40 40 , patches ? [] 41 41 , gemPath ? [] 42 - , dontStrip ? true 42 + , dontStrip ? false 43 43 # Assume we don't have to build unless strictly necessary (e.g. the source is a 44 44 # git checkout). 45 45 # If you need to apply patches, make sure to set `dontBuild = false`; ··· 205 205 $gempkg $gemFlags -- $buildFlags 206 206 207 207 # looks like useless files which break build repeatability and consume space 208 - rm -fv $out/${ruby.gemPath}/doc/*/*/created.rid || true 209 - rm -fv $out/${ruby.gemPath}/gems/*/ext/*/mkmf.log || true 208 + pushd $out/${ruby.gemPath} 209 + rm -fv doc/*/*/created.rid || true 210 + rm -fv {gems/*/ext/*,extensions/*/*/*}/{mkmf.log,gem_make.out} || true 211 + rm -fvr cache 212 + popd 210 213 211 214 # write out metadata and binstubs 212 215 spec=$(echo $out/${ruby.gemPath}/specifications/*.gemspec)
-2
pkgs/top-level/all-packages.nix
··· 9409 9409 docSupport = false; 9410 9410 yamlSupport = false; 9411 9411 fiddleSupport = false; 9412 - # remove gcc from runtime closure 9413 - removeReferenceToCC = true; 9414 9412 }; 9415 9413 9416 9414 ruby = ruby_2_6;