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

Nix stuff #38

Open
TheSunCat opened this issue Nov 18, 2024 · 4 comments
Open

Nix stuff #38

TheSunCat opened this issue Nov 18, 2024 · 4 comments

Comments

@TheSunCat
Copy link

Hi! I'm working on a NixOS project with SDL3, and I wanted to see how you have it set up. Cloning tomato locally and running nix build however fails, with this log tail:

       > -- Configuring SDL3_image 3.0.0
       > -- Performing Test CHECK_CPU_ARCHITECTURE_X64
       > -- Performing Test CHECK_CPU_ARCHITECTURE_X64 - Success
       > -- SDL3_image: Using system libavif
       > -- Dynamic libavif: libavif.so.16
       > -- Found JPEG: /nix/store/x7p3dkj051g47q81kg7f79rxgm4p9xs7-libjpeg-turbo-3.0.3/lib/libjpeg.so (found version "62")
       > -- SDL3_image: Using system libjpeg
       > -- Dynamic libjpeg: libjpeg.so.62
       > -- Found libjxl: /nix/store/sr5n74ak13m4a70ywb5v7xkaziyqhbq1-libjxl-0.10.2/lib/libjxl.so
       > -- SDL3_image: Using system libjxl
       > -- Dynamic libjxl: libjxl.so.0.10
       > -- Found ZLIB: /nix/store/v2ny69wp81ch6k4bxmp4lnhh77r0n4h1-zlib-1.3.1/lib/libz.so (found version "1.3.1")
       > -- Found PNG: /nix/store/q0wnlhb6ms8v624faknfdc3z0h6nrp35-libpng-apng-1.6.43/lib/libpng.so (found version "1.6.43")
       > -- SDL3_image: Using system libpng
       > -- Dynamic libpng: libpng16.so.16
       > -- Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR)
       > -- libtiff NOT found
       > -- SDL3_image backends:
       > -- - enabled:  avif bmp gif jpg jxl lbm pcx png pnm svg tga xcf xpm xv
       > -- - disabled: stb imageio wic qoi tif webp
       > -- Configuring incomplete, errors occurred!

It's strange because you disable tif from SDL3_image backends, but it is still looking for the library.

@Green-Sky
Copy link
Owner

I'm working on a NixOS project with SDL3, and I wanted to see how you have it set up.

Yea ... SDL with nix is a pain, since it needs to load libs dynamically by itself.
I know vulkan does not work with the current nix code. Also it is kind of hacky and needs a rewrite, but it works I guess.

It's strange because you disable tif from SDL3_image backends, but it is still looking for the library.

I don't know this one, might be an SDL_Image issue.
I do not explicitly disable it, it should disable itself...

@Green-Sky
Copy link
Owner

Green-Sky commented Nov 19, 2024

Actually, can you run with -L to see the full cmake run? Speaking from experience, the error is likely further up.

Also, if you tried to build tomato with just nix build, then I know whats up. I have submodules, so you need to run nix build '.?submodules=1'

@TheSunCat
Copy link
Author

nix build '.?submodules=1' does work, nice! I never knew about that flag.

The first error confirms this when building with -L:

tomato> -- Check for working CXX compiler: /nix/store/r73z9i18vbjcph7k2f3isrysxzx6sqjx-gcc-wrapper-13.2.0/bin/g++ - skipped
tomato> -- Detecting CXX compile features
tomato> -- Detecting CXX compile features - done
tomato> II TOMATO_BREAKPAD: OFF
tomato> II TOMATO_TOX_AV: ON
tomato> -- Using the multi-header code from /nix/store/i8xbp4fwlggg8mggifkq5kb68gz6lxxh-source/include/
tomato> CMake Error at external/CMakeLists.txt:7 (add_subdirectory):
tomato>   The source directory
tomato>     /build/nax43w29bja1wcljp56wjknanjgm9dyw-source/external/solanaceae_util
tomato>   does not contain a CMakeLists.txt file.

On the topic of Vulkan, I did find a way to build a package that uses it (and SDL_gpu) on Nix. Feel free to look at my code here: https://git.allpurposem.at/mat/gooey/src/branch/main/nix/packages/gooey/default.nix
However, I haven't solved not being able to capture it with RenderDoc (it fails to find libvulkan in that case).

@Green-Sky
Copy link
Owner

nix build '.?submodules=1' still fails for the new nix...
Just found out that nix build '.?submodules=1#' works NixOS/nix#6633

@Green-Sky Green-Sky changed the title Build failure with libtiff Nix stuff Dec 25, 2024
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