[PATCH] gnu: racket: Add add ffmpeg and portaudio to inputs.

  • Open
  • quality assurance status badge
Details
2 participants
  • Philip McGrath
  • Rostislav Svoboda
Owner
unassigned
Submitted by
Rostislav Svoboda
Severity
normal
R
R
Rostislav Svoboda wrote on 13 Jul 2022 13:39
(address . guix-patches@gnu.org)(name . Rostislav Svoboda)(address . Rostislav.Svoboda@gmail.com)
20220713113951.6375-1-Rostislav.Svoboda@gmail.com
* ffmpeg and portaudio are required by '#lang video'. See
---
gnu/packages/racket.scm | 6 ++++++
1 file changed, 6 insertions(+)

Toggle diff (54 lines)
diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm
index 3399bcc3fe..8a54e2ece4 100644
--- a/gnu/packages/racket.scm
+++ b/gnu/packages/racket.scm
@@ -35,6 +35,7 @@ (define-module (gnu packages racket)
#:use-module (srfi srfi-34)
#:use-module (ice-9 match)
#:use-module (gnu packages)
+ #:use-module (gnu packages audio)
#:use-module (gnu packages autotools)
#:use-module (gnu packages bash)
#:use-module (gnu packages chez)
@@ -51,6 +52,7 @@ (define-module (gnu packages racket)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages sqlite)
#:use-module (gnu packages tls)
+ #:use-module (gnu packages video)
#:use-module (gnu packages xorg)
#:use-module ((guix licenses) #:prefix license:))
@@ -591,6 +593,7 @@ (define-public racket
(list
cairo
fontconfig
+ ffmpeg
glib
glu
gmp
@@ -601,6 +604,7 @@ (define-public racket
mesa
mpfr
pango
+ portaudio
unixodbc
libedit ;; TODO reconsider in light of expeditor and readline-gpl
racket-minimal ;; <-- TODO non-tethered layer
@@ -933,6 +937,7 @@ (define-public racket
name)))))
'("cairo"
"fontconfig-minimal" ;; aka fontconfig
+ "ffmpeg"
"glib"
"glu"
"gmp"
@@ -943,6 +948,7 @@ (define-public racket
"mesa"
"mpfr"
"pango"
+ "portaudio"
"unixodbc"
"libedit"))))))))
(synopsis "Programmable programming language in the Scheme family")
--
2.36.1
P
P
Philip McGrath wrote on 13 Jul 2022 23:33
Re: [videolang/video] #lang video on Guix OS (Issue #67)
(name . Rostislav Svoboda)(address . rostislav.svoboda@gmail.com)
e943b0df-28e1-4600-ab4c-f223598db3fd@www.fastmail.com
Hi,

On Wed, Jul 13, 2022, at 7:55 AM, Bost wrote:
Toggle quote (15 lines)
>
>
> Hi Leif,
>
> FYI I just created a patch [1] enabling #lang video on the Guix OS. I guess you might want to extend the list [2] of supported operating systems when the patch gets merged ;-)
>
> Cheers
>
> Bost
>
>
> [1] https://issues.guix.gnu.org/56534
> [2] https://docs.racket-lang.org/video@video/Installing.html
>

It's great to see more Racketeers interested in Guix!

I'm cross-posting this to both https://issues.guix.gnu.org/56534 and https://github.com/videolang/video/issues/67 .

I've been working for some time toward making a Guix build system and importer for Racket packages: I'm optimistic that I may get something working between the Racket 8.6 and 8.7 releases.

For now, I would suggest not adding `portaudio` and `ffmpeg` as inputs to the main `racket` package. Instead, if you want to get something working for now, I would suggest adding a new package `racket-with-video` that extends the `racket` package in the same way that `racket` extends `racket-minimal`. I'd expect it would go somewhat like this

```scheme
(define-public racket-with-video
(let* ((commit "3c69669063c56ff8d269768589cb9506a33315e5")
(revision "1")
(video-version (git-version "0.2.3" revision commit)))
(package
(inherit racket)
(version (string-append %racket-version "+video" video-version))
(source #f)
(native-inputs '())
(inputs
(list
racket
(racket-vm-for-system)
ffmpeg
portaudio
(racket-packages-origin
"video" (origin
(method git-fetch)
(uri (git-reference
(commit commit)))
(sha256
(base32 "17lysqgd4h0kdx73vzmsdqc6ip5rlk56hss3880yapvic14lf5dy"))
(file-name (git-file-name "racket-video" video-version)))
'("video"))
#|
... likewise for other packages not in main-distribution,
particularly libvid ...
|#))
(arguments
(substitute-keyword-arguments (package-arguments racket)
((#:make-flags _ '())
#~`("video"))
((#:configure-flags _ '())
#~`("--tethered"
"--extra-foreign-lib-search-dirs"
,(format #f "~s"
'(#$@(map (lambda (name)
(cond
((this-package-input name)
=> (cut file-append <> "/lib"))
(else
(raise
(formatted-message
(G_ "missing input '~a' to the 'racket-with-video' package")
name)))))
'("portaudio"
"ffmpeg"))))))))
(home-page "https://lang.video")
(synopsis "Racket with @code{#lang video}")
(description
"Video is a language for making movies. It combines the power
of a traditional video editor with the capabilities of a full
programming language. Video integrates with the Racket ecosystem and
extensions for DrRacket to transform it into a non-linear video
editor.")
(license license:asl2.0))))
```

Those helper functions are not exported from (gnu packages racket) because they're hack-ish and should be replaced with proper build system support, but hopefully you can see from the docstrings how they work for now.

I ran into https://github.com/racket/racket/issues/4357 while working on this example: we'd need to backport a fix for that, or it might make it into 8.6. Incidentally, you might be interested in my branch at https://gitlab.com/philip1/guix-patches/-/tree/zuo getting ready for the Racket release: I'll be updating it to the new 8.5.900 release candidate soon.

@LeifAndersen, I used 3c69669063c56ff8d269768589cb9506a33315e5 because I expect Guix would run into that issue during our build process, but we could use the stable branch or cherry-pick it if you think that would be better.

Hopefully by the next time a situation like https://guix.gnu.org/en/blog/2021/reproducible-data-processing-pipelines/ comes up, Guix folks will be able to get `#lang video`'s "sweet high-level functional interface" together with reproducibility of their makefile!

-Philip
R
R
Rostislav Svoboda wrote on 24 Oct 2022 14:13
(address . 56534@debbugs.gnu.org)
CAEtmmexS6Wtz0Xic9Vo6iueTHSOC73GPOtDrnynQCt2vRcKxbQ@mail.gmail.com
#lang video got out of my focus, but I just discovered this "A Short
Example of Packaging for GNU Guix with Racket."
https://youtu.be/0tznTxEmuRswhere Tassos did the same.
Cheers
?