guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/03: gnu: x265: Build 10-bit and 12-bit libraries.


From: guix-commits
Subject: 01/03: gnu: x265: Build 10-bit and 12-bit libraries.
Date: Tue, 27 Nov 2018 15:21:03 -0500 (EST)

efraim pushed a commit to branch master
in repository guix.

commit bd606fb2ce9ce9ec94fa7e9b078c87790723675c
Author: Efraim Flashner <address@hidden>
Date:   Tue Nov 27 19:10:44 2018 +0200

    gnu: x265: Build 10-bit and 12-bit libraries.
    
    * gnu/packages/video.scm (x265)[arguments]: Add configure-flag to set
    %output for the other builds. Add custom 'build-12-bit and 'build-10-bit
    phases to build their respective versions. Add a custom phase to install
    the 10-bit and 12-bit libraries.
---
 gnu/packages/video.scm | 50 ++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 46 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index bf1f6d3..9d3bd3c 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -412,15 +412,57 @@ and creating Matroska files from other media files 
(@code{mkvmerge}).")
     (build-system cmake-build-system)
     (arguments
      `(#:tests? #f ; tests are skipped if cpu-optimized code isn't built
-       ;; Ensure position independent code for everyone.
-       #:configure-flags '("-DENABLE_PIC=TRUE")
+       #:configure-flags
+         ;; Ensure position independent code for everyone.
+         (list "-DENABLE_PIC=TRUE"
+               (string-append "-DCMAKE_INSTALL_PREFIX="
+                              (assoc-ref %outputs "out")))
        #:phases
        (modify-phases %standard-phases
-         (add-before 'configure 'prepare-build
+         (add-after 'unpack 'prepare-build
            (lambda _
              (delete-file-recursively "build")
              (chdir "source")
-             #t)))))
+             #t))
+         (add-before 'configure 'build-12-bit
+           (lambda* (#:key (configure-flags '()) #:allow-other-keys)
+             (mkdir "../build-12bit")
+             (with-directory-excursion "../build-12bit"
+               (apply invoke
+                 "cmake" "../source"
+                 "-DHIGH_BIT_DEPTH=ON"
+                 "-DEXPORT_C_API=OFF"
+                 "-DENABLE_CLI=OFF"
+                 "-DMAIN12=ON"
+                 configure-flags)
+               (substitute* (cons "cmake_install.cmake"
+                                  (append
+                                    (find-files "CMakeFiles/x265-shared.dir" 
".")
+                                    (find-files "CMakeFiles/x265-static.dir" 
".")))
+                 (("libx265") "libx265_main12"))
+               (invoke "make"))))
+         (add-before 'configure 'build-10-bit
+           (lambda* (#:key (configure-flags '()) #:allow-other-keys)
+             (mkdir "../build-10bit")
+             (with-directory-excursion "../build-10bit"
+               (apply invoke
+                 "cmake" "../source"
+                 "-DHIGH_BIT_DEPTH=ON"
+                 "-DEXPORT_C_API=OFF"
+                 "-DENABLE_CLI=OFF"
+                 configure-flags)
+               (substitute* (cons "cmake_install.cmake"
+                                  (append
+                                    (find-files "CMakeFiles/x265-shared.dir" 
".")
+                                    (find-files "CMakeFiles/x265-static.dir" 
".")))
+                 (("libx265") "libx265_main10"))
+               (invoke "make"))))
+         (add-after 'install 'install-more-libs
+           (lambda _
+             (with-directory-excursion "../build-12bit"
+               (invoke "make" "install"))
+             (with-directory-excursion "../build-10bit"
+               (invoke "make" "install")))))))
     (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,



reply via email to

[Prev in Thread] Current Thread [Next in Thread]