- 
                Notifications
    You must be signed in to change notification settings 
- Fork 88
Add devshell for nix under macOs #135
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
base: oxce-plus
Are you sure you want to change the base?
Conversation
| As aditional for the #123 | 
| set ( SDLMIXER_LIBRARY SDL_mixer ) | ||
| set ( SDLIMAGE_LIBRARY SDL_image ) | ||
| set ( PKG_DEPS_LDFLAGS ${SDLIMAGE_LIBRARY} ${SDLMIXER_LIBRARY} ${SDLGFX_LIBRARY} ${SDL_LIBRARY} ${OPENGL_LIBRARIES} ) | ||
| set ( PKG_DEPS_LDFLAGS ${SDLIMAGE_LIBRARY} ${SDLMIXER_LIBRARY} ${SDLGFX_LIBRARY} ${SDL_LIBRARY} ${SDL2_LIBRARY} ${OPENGL_LIBRARIES} ) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using this SDL2 added to the dependecies list which trigger copy of it to macos Frameworks library
| include_directories(${PKG_SDL_INCLUDE_DIRS} ${PKG_ZLIB_INCLUDE_DIRS} ${PKG_SDLIMAGE_INCLUDE_DIRS}) | ||
| include_directories(${PKG_SDLGFX_INCLUDE_DIRS} ${PKG_SDLMIXER_INCLUDE_DIRS}) | ||
| set(PKG_DEPS_LDFLAGS ${PKG_SDL_LDFLAGS} ${PKG_ZLIB_LDFLAGS} ${PKG_SDLIMAGE_LDFLAGS} ${PKG_SDLGFX_LDFLAGS} ${PKG_SDLMIXER_LDFLAGS} ${OPENGL_LIBRARIES}) | ||
| set(PKG_DEPS_LDFLAGS ${PKG_SDL_LDFLAGS} ${PKG_SDL2_LDFLAGS} ${PKG_ZLIB_LDFLAGS} ${PKG_SDLIMAGE_LDFLAGS} ${PKG_SDLGFX_LDFLAGS} ${PKG_SDLMIXER_LDFLAGS} ${OPENGL_LIBRARIES}) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using all dependecies of SDL2, which trigger copy of webp and etc libraries which is needed for runtime work
| #SDL_mixer | ||
| # SDL_image | ||
| # SDL_gfx | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This old libraries avalaible for SDL1, using it teh sound and the software rendering is not working, only OpenGL works and there is no video support also
| # Try to build using SDL12_compat | ||
| (SDL_compat.overrideAttrs (old: { | ||
| postInstall = '' | ||
| ln -s $out/lib/pkgconfig/sdl12_compat.pc $out/lib/pkgconfig/sdl.pc | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
workaround to have working dependecies checking in cmake flow.
Note: The same behavior done in the brew formula
6e12068    to
    6ff84ea      
    Compare
  
            
          
                flake.nix
              
                Outdated
          
        
      |  | ||
| # Need to use brew cmake since nix use old one 3.30.5 | ||
| # which has issues with copy libraries to macOs app | ||
| #cmake | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is issue with cmake for the new macOs due to libSystem shared library which is not exists under filesystem anymore due to cmake while generate macOs appication(directory) cannot copy this library to it.
Brew cmake already updated and doesn't have this issue.
Nix has already update the cmake, but it's not avalaible for now.
We can wait and merge when it will be updated in at least under unstable nixpkgs, since I'm using it in flake.nix
NixOS/nixpkgs#363395
Merged yesterday
6ff84ea    to
    77ed943      
    Compare
  
    77ed943    to
    e408df1      
    Compare
  
    e408df1    to
    06e356d      
    Compare
  
    | @vkravets I'd like to build on Mac OS via brew however sdl packages are not available anymore. README still state that it needs sdl but sdl2 and sdl3 are only available. | 
This PR added devshel under nix macOs and can be adopded in future for the linux with nix.
After this command enter to shell where all dependecies and configuration to build already defined.
README-OSX.md has beeen updated also.
This PR also added USE_SDL2 options which turn on by default on apple.
Under brew (which is default build on macOs and easiest ) leagcy SDL is not avalaible and only sdl12-compat is available. Also there is deprecation for sdl-mixer and sdl-gfx but it's only disabled and can be enabled via brew edit, so I don't touch enything about it in this PR.