gnu: avidemux: Use gexps.

* gnu/packages/video.scm (avidemux) [phases]: Use gexps.

Change-Id: I8a02285a7c85c4cd78558e88c073d62e10fe8d4d
This commit is contained in:
Maxim Cournoyer 2025-03-22 23:48:59 +09:00
parent ba53c29c43
commit a3ed1a2e0d
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -3634,71 +3634,72 @@ for use with HTML5 video.")
sqlite sqlite
zlib)) zlib))
(arguments (arguments
`(#:tests? #f ; no check target (list
#:phases #:tests? #f ; no check target
;; Make sure files inside the included ffmpeg tarball are #:phases
;; patch-shebanged. ;; Make sure files inside the included ffmpeg tarball are
(let ((ffmpeg "ffmpeg-4.2.4")) ;; patch-shebanged.
(modify-phases %standard-phases #~(let ((ffmpeg "ffmpeg-4.2.4"))
(add-before 'patch-source-shebangs 'unpack-ffmpeg (modify-phases %standard-phases
(lambda _ (add-before 'patch-source-shebangs 'unpack-ffmpeg
(with-directory-excursion "avidemux_core/ffmpeg_package" (lambda _
(invoke "tar" "xf" (string-append ffmpeg ".tar.bz2")) (with-directory-excursion "avidemux_core/ffmpeg_package"
(delete-file (string-append ffmpeg ".tar.bz2"))))) (invoke "tar" "xf" (string-append ffmpeg ".tar.bz2"))
(add-after 'patch-source-shebangs 'repack-ffmpeg (delete-file (string-append ffmpeg ".tar.bz2")))))
(lambda _ (add-after 'patch-source-shebangs 'repack-ffmpeg
(with-directory-excursion "avidemux_core/ffmpeg_package" (lambda _
(substitute* (string-append ffmpeg "/configure") (with-directory-excursion "avidemux_core/ffmpeg_package"
(("#! /bin/sh") (string-append "#!" (which "sh")))) (substitute* (string-append ffmpeg "/configure")
(invoke "tar" "cjf" (string-append ffmpeg ".tar.bz2") ffmpeg (("#! /bin/sh") (string-append "#!" (which "sh"))))
;; avoid non-determinism in the archive (invoke "tar" "cjf" (string-append ffmpeg ".tar.bz2") ffmpeg
"--sort=name" "--mtime=@0" ;; avoid non-determinism in the archive
"--owner=root:0" "--group=root:0") "--sort=name" "--mtime=@0"
(delete-file-recursively ffmpeg)))) "--owner=root:0" "--group=root:0")
(replace 'configure (delete-file-recursively ffmpeg))))
(lambda _ (replace 'configure
;; Copy-paste settings from the cmake build system. (lambda _
(setenv "CMAKE_LIBRARY_PATH" (getenv "LIBRARY_PATH")) ;; Copy-paste settings from the cmake build system.
(setenv "CMAKE_INCLUDE_PATH" (getenv "C_INCLUDE_PATH")))) (setenv "CMAKE_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
(replace 'build (setenv "CMAKE_INCLUDE_PATH" (getenv "C_INCLUDE_PATH"))))
(lambda* (#:key inputs outputs #:allow-other-keys) (replace 'build
(let* ((out (assoc-ref outputs "out")) (lambda _
(lib (string-append out "/lib")) (let* ((out #$output)
(top (getcwd)) (lib (string-append out "/lib"))
(build_component (top (getcwd))
(lambda* (component srcdir #:optional (args '())) (build_component
(let ((builddir (string-append "build_" component))) (lambda* (component srcdir #:optional (args '()))
(mkdir builddir) (let ((builddir (string-append "build_" component)))
(with-directory-excursion builddir (mkdir builddir)
(apply invoke "cmake" (with-directory-excursion builddir
"-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE" (apply invoke "cmake"
(string-append "-DCMAKE_INSTALL_PREFIX=" out) "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE"
(string-append "-DCMAKE_INSTALL_RPATH=" lib) (string-append "-DCMAKE_INSTALL_PREFIX=" out)
(string-append "-DCMAKE_SHARED_LINKER_FLAGS=" (string-append "-DCMAKE_INSTALL_RPATH=" lib)
"\"-Wl,-rpath=" lib "\"") (string-append "-DCMAKE_SHARED_LINKER_FLAGS="
(string-append "-DAVIDEMUX_SOURCE_DIR=" top) "\"-Wl,-rpath=" lib "\"")
(string-append "../" srcdir) (string-append "-DAVIDEMUX_SOURCE_DIR=" top)
"-DENABLE_QT5=True" (string-append "../" srcdir)
args) "-DENABLE_QT5=True"
(invoke "make" "-j" args)
(number->string (parallel-job-count))) (invoke "make" "-j"
(invoke "make" "install")))))) (number->string (parallel-job-count)))
(mkdir out) (invoke "make" "install"))))))
(build_component "core" "avidemux_core") (mkdir out)
(build_component "cli" "avidemux/cli") (build_component "core" "avidemux_core")
(build_component "qt4" "avidemux/qt4") (build_component "cli" "avidemux/cli")
(build_component "plugins_common" "avidemux_plugins" (build_component "qt4" "avidemux/qt4")
'("-DPLUGIN_UI=COMMON")) (build_component "plugins_common" "avidemux_plugins"
(build_component "plugins_cli" "avidemux_plugins" '("-DPLUGIN_UI=COMMON"))
'("-DPLUGIN_UI=CLI")) (build_component "plugins_cli" "avidemux_plugins"
(build_component "plugins_qt4" "avidemux_plugins" '("-DPLUGIN_UI=CLI"))
'("-DPLUGIN_UI=QT4")) (build_component "plugins_qt4" "avidemux_plugins"
(build_component "plugins_settings" "avidemux_plugins" '("-DPLUGIN_UI=QT4"))
'("-DPLUGIN_UI=SETTINGS")) (build_component "plugins_settings" "avidemux_plugins"
;; Remove .exe and .dll file. '("-DPLUGIN_UI=SETTINGS"))
(delete-file-recursively ;; Remove .exe and .dll file.
(string-append out "/share/ADM6_addons"))))) (delete-file-recursively
(delete 'install))))) (string-append out "/share/ADM6_addons")))))
(delete 'install)))))
(home-page "http://fixounet.free.fr/avidemux/") (home-page "http://fixounet.free.fr/avidemux/")
(synopsis "Video editor") (synopsis "Video editor")
(description "Avidemux is a video editor designed for simple cutting, (description "Avidemux is a video editor designed for simple cutting,