Merge pull request #77149 from alyssais/asciidoctor
Reduce AsciiDoctor closure size
This commit is contained in:
commit
ddc83e68cc
@ -49,7 +49,7 @@ let
|
|||||||
# puts a reference to the C compiler in the binary.
|
# puts a reference to the C compiler in the binary.
|
||||||
# This might be required by some gems at runtime,
|
# This might be required by some gems at runtime,
|
||||||
# but we allow to strip it out for smaller closure size.
|
# but we allow to strip it out for smaller closure size.
|
||||||
, removeReferencesTo, removeReferenceToCC ? false
|
, removeReferencesTo, removeReferenceToCC ? true
|
||||||
, autoreconfHook, bison, autoconf
|
, autoreconfHook, bison, autoconf
|
||||||
, buildEnv, bundler, bundix
|
, buildEnv, bundler, bundix
|
||||||
, libiconv, libobjc, libunwind, Foundation
|
, libiconv, libobjc, libunwind, Foundation
|
||||||
|
@ -39,6 +39,15 @@ let
|
|||||||
in
|
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: {
|
atk = attrs: {
|
||||||
dependencies = attrs.dependencies ++ [ "gobject-introspection" ];
|
dependencies = attrs.dependencies ++ [ "gobject-introspection" ];
|
||||||
nativeBuildInputs = [ rake bundler pkgconfig ];
|
nativeBuildInputs = [ rake bundler pkgconfig ];
|
||||||
@ -315,6 +324,14 @@ in
|
|||||||
# The ruby build script takes care of this
|
# The ruby build script takes care of this
|
||||||
dontUseCmakeConfigure = true;
|
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
|
# For some reason 'mathematical.so' is missing cairo and glib in its RPATH, add them explicitly here
|
||||||
postFixup = lib.optionalString stdenv.isLinux ''
|
postFixup = lib.optionalString stdenv.isLinux ''
|
||||||
soPath="$out/${ruby.gemPath}/gems/mathematical-${attrs.version}/lib/mathematical/mathematical.so"
|
soPath="$out/${ruby.gemPath}/gems/mathematical-${attrs.version}/lib/mathematical/mathematical.so"
|
||||||
|
@ -39,7 +39,7 @@ lib.makeOverridable (
|
|||||||
, meta ? {}
|
, meta ? {}
|
||||||
, patches ? []
|
, patches ? []
|
||||||
, gemPath ? []
|
, gemPath ? []
|
||||||
, dontStrip ? true
|
, dontStrip ? false
|
||||||
# Assume we don't have to build unless strictly necessary (e.g. the source is a
|
# Assume we don't have to build unless strictly necessary (e.g. the source is a
|
||||||
# git checkout).
|
# git checkout).
|
||||||
# If you need to apply patches, make sure to set `dontBuild = false`;
|
# If you need to apply patches, make sure to set `dontBuild = false`;
|
||||||
@ -205,8 +205,11 @@ stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // {
|
|||||||
$gempkg $gemFlags -- $buildFlags
|
$gempkg $gemFlags -- $buildFlags
|
||||||
|
|
||||||
# looks like useless files which break build repeatability and consume space
|
# looks like useless files which break build repeatability and consume space
|
||||||
rm -fv $out/${ruby.gemPath}/doc/*/*/created.rid || true
|
pushd $out/${ruby.gemPath}
|
||||||
rm -fv $out/${ruby.gemPath}/gems/*/ext/*/mkmf.log || true
|
rm -fv doc/*/*/created.rid || true
|
||||||
|
rm -fv {gems/*/ext/*,extensions/*/*/*}/{mkmf.log,gem_make.out} || true
|
||||||
|
rm -fvr cache
|
||||||
|
popd
|
||||||
|
|
||||||
# write out metadata and binstubs
|
# write out metadata and binstubs
|
||||||
spec=$(echo $out/${ruby.gemPath}/specifications/*.gemspec)
|
spec=$(echo $out/${ruby.gemPath}/specifications/*.gemspec)
|
||||||
|
@ -9409,8 +9409,6 @@ in
|
|||||||
docSupport = false;
|
docSupport = false;
|
||||||
yamlSupport = false;
|
yamlSupport = false;
|
||||||
fiddleSupport = false;
|
fiddleSupport = false;
|
||||||
# remove gcc from runtime closure
|
|
||||||
removeReferenceToCC = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ruby = ruby_2_6;
|
ruby = ruby_2_6;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user