From 020d4d2cdc388242da91819cc1b146f1a6cce93b Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Tue, 27 Nov 2018 19:12:01 +0200 Subject: [PATCH] gnu: x265: Install static libraries in a separate output. This saves more than 50% of the closure size. * gnu/packages/video.scm (x265)[outputs]: New field. [arguments]: Add custom phase to move the static libraries to a new output. --- gnu/packages/video.scm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index 9d3bd3c159..1e1c988c25 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -396,6 +396,7 @@ and creating Matroska files from other media files (@code{mkvmerge}).") (package (name "x265") (version "2.9") + (outputs '("out" "static")) (source (origin (method url-fetch) @@ -462,7 +463,20 @@ and creating Matroska files from other media files (@code{mkvmerge}).") (with-directory-excursion "../build-12bit" (invoke "make" "install")) (with-directory-excursion "../build-10bit" - (invoke "make" "install"))))))) + (invoke "make" "install")))) + (add-before 'strip 'move-static-libs + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (static (assoc-ref outputs "static"))) + (mkdir-p (string-append static "/lib")) + (with-directory-excursion + (string-append out "/lib") + (for-each + (lambda (file) + (rename-file file + (string-append static "/lib/" file))) + (find-files "." "\\.a$")))) + #t))))) (home-page "http://x265.org/") (synopsis "Library for encoding h.265/HEVC video streams") (description "x265 is a H.265 / HEVC video encoder application library,