Subject: [bug#41548] [PATCH] gnu: mozjs: Remove static library

From: Julien Lepiller <[email-masked]>
Date: Tue, 26 May 2020 23:15:57 +0200

Hi,

the attached patch removes lib/libjs_static.ajs from the output of
mozjs, a 30 MB static library.  This mozjs is part of the closure of
gdm and gnome, so it reduces the size of most desktop systems.

The reason why I found that file, is because it is mentionned in
BLFS: http://linuxfromscratch.org/blfs/view/svn/general/js68.html
>From 9529f1442323bad4f96fe070a510e1dd64a2c8ce Mon Sep 17 00:00:00 2001
From: Julien Lepiller <[email-masked]>
Date: Tue, 26 May 2020 23:08:15 +0200
Subject: [PATCH] gnu: mozjs: Remove static library.

* gnu/packages/gnuzilla.scm (mozjs-60): Remove static library.
---
 gnu/packages/gnuzilla.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index 7bf9850e97..808c04f1db 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -404,6 +404,12 @@ in C/C++.")
              ;; This test assumes that /bin exists and contains certain
              ;; executables.
              (delete-file "js/src/tests/shell/os.js")
+             #t))
+         (add-after 'install 'remove-static
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; this saves ~30 MB
+             (delete-file (string-append (assoc-ref outputs "out")
+                                         "/lib/libjs_static.ajs"))
              #t)))))
     (native-inputs
      `(("autoconf" ,autoconf)
-- 
2.26.2