File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,19 @@ in rec {
137137
138138 chmod -R +w $out
139139
140+ # XXX: they increase the closure (i.e. installer) size greatly:
141+ echo 'Deleting all redundant /nix/store references from to-be-distributed ‘node_modules/’:'
142+ (
143+ cd $out/share/daedalus/
144+ find node_modules -type f '(' -name '*.o' -o -name '*.o.d' -o -name '*.target.mk' -o -name '*.Makefile' -o -name 'Makefile' -o -name 'config.gypi' ')' -exec rm -vf '{}' ';'
145+
146+ # Get rid of ${ nodejs } , too – another 60 MiB:
147+ cd node_modules/
148+ for file in $(grep -RF ${ nodejs } . 2>/dev/null | cut -d: -f1) ; do
149+ sed -r 's,^#!${ nodejs } /bin/,#!/usr/bin/env ,g' -i "$file"
150+ done
151+ )
152+
140153 mkdir -p $out/share/daedalus/node_modules/usb/build
141154 cp node_modules/usb/build/Debug/usb_bindings.node $out/share/daedalus/node_modules/usb/build
142155
You can’t perform that action at this time.
0 commit comments