bohonghuang / cl-gtk4

GTK4/Libadwaita/WebKit2 bindings for Common Lisp.
GNU Lesser General Public License v3.0
215 stars 9 forks source link

Can't make a GStream binding. #46

Closed Filipp-Druan closed 1 year ago

Filipp-Druan commented 1 year ago

I tried to make binding for GStreamer and get fiasco. cl-gtk4.gstreamer.asd:

(defsystem cl-gtk4.gstreamer
  :version "1.0.0"
  :author "Filipp Druan <druanf@bk.ru>"
  :maintainer "Bohong Huang <1281299809@qq.com>"
  :license "lgpl3"
  :description "GStreamer bindings for Common Lisp."
  :homepage "https://github.com/bohonghuang/cl-gtk4"
  :bug-tracker "https://github.com/bohonghuang/cl-gtk4/issues"
  :source-control (:git "https://github.com/bohonghuang/cl-gtk4.git")
  :serial t
  :components ((:file "gstreamer"))
  :depends-on (#:cl-gobject-introspection-wrapper #:cl-gtk4))

(uiop:register-image-restore-hook
 (lambda ()
   (let ((package (find-package :sourceview)))
     (when package
       (setf (symbol-value (find-symbol "*NS*" package))
             (uiop:symbol-call :gir :require-namespace "gstreamer"))))))

gstreamer.lisp:

(cl:defpackage gtkgstreamer
  (:use)
  (:nicknames #:gstreamer)
  (:export #:*ns*))

(in-package #:gstreamer)

(gir-wrapper:define-gir-namespace "gstreamer")

I tried different versions, different spellings of the library name, but Lisp still gave me an error:

CL-USER> (ql:quickload :cl-gtk4.gstreamer)
To load "cl-gtk4.gstreamer":
  Load 1 ASDF system:
    cl-gtk4.gstreamer
; Loading "cl-gtk4.gstreamer"
[package gtkgstreamer]

; file: /home/iam/quicklisp/local-projects/cl-gtk4/gstreamer.lisp
; in: GOBJECT-INTROSPECTION-WRAPPER:DEFINE-GIR-NAMESPACE "gstreamer"
;     (GOBJECT-INTROSPECTION-WRAPPER:DEFINE-GIR-NAMESPACE "gstreamer")
; 
; caught COMMON-LISP:ERROR:
;   (during macroexpansion of (GOBJECT-INTROSPECTION-WRAPPER:DEFINE-GIR-NAMESPACE "gstreamer"))
;   Typelib file for namespace 'gstreamer' (any version) not found
; Debugger entered on #<UIOP/LISP-BUILD:COMPILE-FILE-ERROR {10046B53C3}>
; 
; compilation unit aborted
;   caught 1 fatal ERROR condition
;   caught 1 ERROR condition
[1] CL-USER> 
; Evaluation aborted on #<UIOP/LISP-BUILD:COMPILE-FILE-ERROR {10046B53C3}>

How I can make a binding?

bohonghuang commented 1 year ago

The acronym in the GIR library name should be capitalized. I happened to create a WIP binding to GStreamer a few days ago, but I'm currently considering how to modularize it based on different GStreamer plugins. Perhaps we can discuss that there.