Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spec aarch64-apple-darwin9 (Apple Silicon) #11

Merged
merged 3 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,37 @@ This is a (currently) brief but usable wrap for SDL2_image. Currently, this exp

These functions act more or less like their wrapped equivalents; see the SDL_image 2.0 documentation for details.

## Regenerating CFFI Bindings

This library uses [cl-autowrap](https://github.com/rpav/cl-autowrap) to generate CFFI bindings. If you need to regenerate the bindings, follow these steps:

1. Delete the existing bindings:

```
$ rm -f src/spec/SDL_image.*.spec
```

2. Reload the system in a REPL. This action will automatically regenerate the bindings:

```
${LISP-sbcl} \
--load "sdl2-image.asd" \
--eval "(ql:quickload '(:sdl2-image))" \
--eval "(uiop:quit)"
```

In most cases, this process should work without issues. However, if you encounter problems (usually due to environment-specific factors like missing include headers), you can use the `C_INCLUDE_PATH` environment variable to specify additional include paths:

```
C_INCLUDE_PATH=/data1/include:/data1/lib/include \
${LISP-sbcl} \
--load "sdl2-image.asd" \
--eval "(ql:quickload '(:sdl2-image))" \
--eval "(uiop:quit)"
```

This approach allows you to provide the necessary include paths without modifying the source code.

## Issues

If you require further functions, please file an issue, **pull request**, or inquire in `#lispgames` on freenode.
Expand Down
5 changes: 5 additions & 0 deletions src/autowrap.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@
:spec-path '(sdl2-image autowrap-spec)
:exclude-sources ("/usr/local/lib/clang/([^/]*)/include/(?!stddef.h)"
"/usr/include/"
#+darwin "/opt/homebrew/include/SDL2"
"/usr/include/arm-linux-gnueabihf"
"/usr/local/include/SDL2")
:include-sources ("SDL_image.h")
:sysincludes (cl:append
#+darwin '("/opt/homebrew/include")
(cl:if (uiop:getenv "C_INCLUDE_PATH")
(uiop:split-string (uiop:getenv "C_INCLUDE_PATH") :separator ":")))
:exclude-constants ("^__")
:symbol-exceptions (("SDL_RWops" . "SDL-RWOPS"))
:no-accessors cl:t
Expand Down
Loading