gnu: avidemux: Factorise ffmpeg version.

* gnu/packages/video.scm (avidemux)[arguments]: Move oft-repeated
hard-coded ffmpeg version number to a single let-bound variable.
This commit is contained in:
Tobias Geerinckx-Rice 2019-03-11 01:28:21 +01:00
parent 7d3ac6c08e
commit 642de36b9e
No known key found for this signature in database
GPG key ID: 0DB0FF884F556D79

View file

@ -1857,73 +1857,74 @@ (define-public avidemux
#:phases #:phases
;; Make sure files inside the included ffmpeg tarball are ;; Make sure files inside the included ffmpeg tarball are
;; patch-shebanged. ;; patch-shebanged.
(modify-phases %standard-phases (let ((ffmpeg "ffmpeg-3.3.7"))
(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" "ffmpeg-3.3.7.tar.bz2") (with-directory-excursion "avidemux_core/ffmpeg_package"
(delete-file "ffmpeg-3.3.7.tar.bz2")) (invoke "tar" "xf" (string-append ffmpeg ".tar.bz2"))
#t)) (delete-file (string-append ffmpeg ".tar.bz2")))
(add-after 'patch-source-shebangs 'repack-ffmpeg #t))
(lambda _ (add-after 'patch-source-shebangs 'repack-ffmpeg
(with-directory-excursion "avidemux_core/ffmpeg_package" (lambda _
(substitute* "ffmpeg-3.3.7/configure" (with-directory-excursion "avidemux_core/ffmpeg_package"
(("#! /bin/sh") (string-append "#!" (which "sh")))) (substitute* (string-append ffmpeg "/configure")
(invoke "tar" "cjf" "ffmpeg-3.3.7.tar.bz2" "ffmpeg-3.3.7" (("#! /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-3.3.7")) "--owner=root:0" "--group=root:0")
#t)) (delete-file-recursively ffmpeg))
(replace 'configure #t))
(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"))
#t)) (setenv "CMAKE_INCLUDE_PATH" (getenv "C_INCLUDE_PATH"))
(replace 'build #t))
(lambda* (#:key inputs outputs #:allow-other-keys) (replace 'build
(let* ((out (assoc-ref outputs "out")) (lambda* (#:key inputs outputs #:allow-other-keys)
(lib (string-append out "/lib")) (let* ((out (assoc-ref outputs "out"))
(top (getcwd)) (lib (string-append out "/lib"))
(sdl (assoc-ref inputs "sdl")) (top (getcwd))
(build_component (sdl (assoc-ref inputs "sdl"))
(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 "-DSDL_INCLUDE_DIR=" (string-append "-DAVIDEMUX_SOURCE_DIR=" top)
sdl "/include/SDL") (string-append "-DSDL_INCLUDE_DIR="
(string-append "../" srcdir) sdl "/include/SDL")
"-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
#t))) (string-append out "/share/ADM6_addons"))
(delete 'install)))) #t)))
(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,