diff --git a/gnu/packages/julia-xyz.scm b/gnu/packages/julia-xyz.scm index bb22615a87..37f359f56f 100644 --- a/gnu/packages/julia-xyz.scm +++ b/gnu/packages/julia-xyz.scm @@ -23,6 +23,7 @@ #:use-module (guix packages) #:use-module (gnu packages compression) #:use-module (gnu packages graphics) + #:use-module (gnu packages video) #:use-module (gnu packages xml) #:use-module (gnu packages tls)) @@ -1438,4 +1439,73 @@ visualization framework.") (description "Custom plotting themes for @code{Plots.jl}, including both light and dark themes.") (license license:expat))) + +(define-public julia-ffmpeg + (package + (name "julia-ffmpeg") + (version "0.2.3") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/JuliaIO/FFMPEG.jl") + (commit (string-append "v" version)))) + (file-name "FFMPEG") + (sha256 + (base32 "1rnb7n5gzn7bsiz09fqapw4fcqc1p5bjcjw4ha3kxcs70w4by52x")))) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-before 'precompile 'build-deps + (lambda* (#:key outputs source inputs #:allow-other-keys) + (let ((f (open-file + (string-append + (assoc-ref outputs "out") + "/share/julia/packages/" + (string-append + (strip-store-file-name source) "/deps/deps.jl")) + "w"))) + (display (string-append "const libavcodec = \"" + (assoc-ref inputs "ffmpeg") + "/lib/libavcodec.so\"\n") f) + (display (string-append "const libavformat = \"" + (assoc-ref inputs "ffmpeg") + "/lib/libavformat.so\"\n") f) + (display (string-append "const libavcodec = \"" + (assoc-ref inputs "ffmpeg") + "/lib/libavcodec.so\"\n") f) + (display (string-append "const libavutil = \"" + (assoc-ref inputs "ffmpeg") + "/lib/libavutil.so\"\n") f) + (display (string-append "const libswscale = \"" + (assoc-ref inputs "ffmpeg") + "/lib/libswscale.so\"\n") f) + (display (string-append "const libavdevice = \"" + (assoc-ref inputs "ffmpeg") + "/lib/libavdevice.so\"\n") f) + (display (string-append "const libavfilter = \"" + (assoc-ref inputs "ffmpeg") + "/lib/libavfilter.so\"\n") f) + (display (string-append "const ffmpeg = \"" + (assoc-ref inputs "ffmpeg") + "/bin/ffmpeg\"\n") f) + (close-port f)) + (substitute* + (string-append (assoc-ref + outputs "out") "/share/julia/packages/" + (string-append (strip-store-file-name + source) "/src/FFMPEG.jl")) + (("const libpath = joinpath(@__DIR__, \"..\", \"deps\", \"usr\", \"lib\")") + (string-append "const libpath = \"" + (assoc-ref inputs "ffmpeg") + "/lib"))) + #t))))) + (propagated-inputs `(("julia-binaryprovider" ,julia-binaryprovider) + ("ffmpeg" ,ffmpeg))) + (build-system julia-build-system) + (home-page "https://github.com/JuliaIO/FFMPEG.jl") + (synopsis "Wrapper for the ffmpeg executable in Julia") + (description "Low level ffmpeg API used to get ffmpeg binaries and +executables.") + (license license:expat))) (license license:expat)))