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

Cygwin users cannot load SDL #6

Open
ngolovin opened this issue Dec 17, 2015 · 1 comment
Open

Cygwin users cannot load SDL #6

ngolovin opened this issue Dec 17, 2015 · 1 comment

Comments

@ngolovin
Copy link

Workaround:
edit the file
https://github.com/jacius/nice-ffi/blob/master/lib/nice-ffi/pathset.rb:456

paths = @paths.collect{ |regexp,ps| regexp =~ os ? ps : [] }.flatten

replace by

paths = @paths.collect{ |regexp,ps| regexp =~ "windows" ? ps : [] }.flatten
@jacius
Copy link
Owner

jacius commented Dec 20, 2015

Hi, and thanks for submitting this issue. I have some suggestions about better ways to work around this.

If you tell me the output of the command ruby -r ffi -e 'p FFI::Platform::OS' and the path(s) where libraries are located in Cygwin, I can add support for Cygwin to Nice-FFI. That said, I don't know if there will ever be a new release of Nice-FFI, so maybe that doesn't help you much.

Alternatively, if you are using ruby-sdl-ffi (or rubygame), there are two built-in workarounds to add custom load paths:

  1. If you are writing your own app, you can define the SDL_PATHS constant in your app to be an array of additional paths to search for SDL. You must define the constant before loading ruby-sdl-ffi, like so:
SDL_PATHS = [ "C:\\windows\\system32\\", "C:\\windows\\system\\" ]
require 'ruby-sdl-ffi'
  1. If you are running someone else's app, you can set the RUBYSDLFFI_PATH environment variable (in your shell or system settings) to a path (or semicolon-separated list of paths for Windows, or colon-separated list of paths for Linux/BSD/Mac), like so:
export RUBYSDLFFI_PATH="C:\\windows\\system32\\;C:\\windows\\system\\"
ruby ./some-app.rb

I hope that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants