lem-project / lem

Common Lisp editor/IDE with high expansibility
http://lem-project.github.io/
MIT License
2.15k stars 161 forks source link

SDL2 support OpenBSD #1401

Open rpx99 opened 3 weeks ago

rpx99 commented 3 weeks ago

OpenBSD needs a patch for SDL2:

diff --git a/frontends/sdl2/platform.lisp b/frontends/sdl2/platform.lisp
index ad251e97..72784152 100644
--- a/frontends/sdl2/platform.lisp
+++ b/frontends/sdl2/platform.lisp
@@ -27,6 +27,8 @@
                  (make-instance 'mac))
                 ("FreeBSD"
                  (make-instance 'freebsd))
+               ("OpenBSD"
+                 (make-instance 'linux))
                 ("Windows"
                  (make-instance 'windows))
                 (otherwise
rpx99 commented 3 weeks ago

Solves this problem:

debugger invoked on a SIMPLE-ERROR in thread
#<THREAD tid=381395 "main thread" RUNNING {1000DB8003}>:
  unsupported platform: OpenBSD

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [CONTINUE] Return to the SDL2 main loop.
  1: [ABORT   ] Abort, quitting SDL2 entirely.
  2: [STOP    ] Stop the task.
  3:            Exit debugger, returning to top level.

(LEM-SDL2/PLATFORM:GET-PLATFORM)
   source: (ERROR "unsupported platform: ~A" (SDL2:PLATFORM))
0] 1

I pointed to linux as otherwise more work needs to be done.

When I introduce it as a new class, LEM indeed starts, but as soon as you start typing you get this error:

debugger invoked on a SB-PCL::NO-APPLICABLE-METHOD-ERROR in thread
#<THREAD tid=453626 "main thread" RUNNING {1000DC8003}>:
  There is no applicable method for the generic function
    #<STANDARD-GENERIC-FUNCTION LEM-SDL2/KEYBOARD:HANDLE-KEY-DOWN (4)>
  when called with arguments
    (#<LEM-SDL2/PLATFORM:OPENBSD {100298EED3}>
     #S(LEM-SDL2/KEYBOARD::KEY-EVENT
        :CODE 1073742048
        :MODIFIER #S(LEM-SDL2/KEYBOARD::MODIFIER
                     :SHIFT NIL
                     :CTRL T
                     :META NIL
                     :SUPER NIL))).
See also:
  The ANSI Standard, Section 7.6.6

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [RETRY   ] Retry calling the generic function.
  1: [CONTINUE] Return to the SDL2 main loop.
  2: [ABORT   ] Abort, quitting SDL2 entirely.
  3: [STOP    ] Stop the task.
  4:            Exit debugger, returning to top level.

((:METHOD NO-APPLICABLE-METHOD (T)) #<STANDARD-GENERIC-FUNCTION LEM-SDL2/KEYBOARD:HANDLE-KEY-DOWN (4)> #<LEM-SDL2/PLATFORM:OPENBSD {100298EED3}> #S(LEM-SDL2/KEYBOARD::KEY-EVENT :CODE 1073742048 :MODIFIER #S(LEM-SDL2/KEYBOARD::MODIFIER :SHIFT NIL :CTRL T :META NIL :SUPER NIL))) [fast-method]

I think freebsd should point to linux, too, but not sure any longer as I moved away from it.