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

Compiling application with lunasvg isn't possible in many distro package build systems #207

Open
WerWolv opened this issue Dec 30, 2024 · 4 comments · May be fixed by #208
Open

Compiling application with lunasvg isn't possible in many distro package build systems #207

WerWolv opened this issue Dec 30, 2024 · 4 comments · May be fixed by #208

Comments

@WerWolv
Copy link
Contributor

WerWolv commented Dec 30, 2024

Hey!

Recently a change was made to the cmake script that downloads the latest version of plutosvg automatically while running cmake.
While this is of course very convenient, it makes the library basically impossible to use when building an application that should be put on various distro's package repositories. For example, the Flatpak and Fedora package builders don't have access to the internet anymore after the initial source code packages have been cloned/downloaded. So at the configure step when your cmake script runs, FetchContent fails because there's no internet available anymore.

To fix this, there's a few options.

  • Have plutosvg as a submodule again
    • This is the easiest way but many distros prefer also using their own plutosvg package
  • Use find_package(plutosvg REQUIRED) instead
    • This requires developers to manually install plutosvg from the package manager or build it themselves
  • Add options to point lunasvg to the include and library files of plutosvg and have it use them then instead.
    • Same as with find_package, just more work for the developer

Personally, I always provide a mix of the first two. Include and use the submodule by default but provide a CMake option to switch over to using find_package when desired. What do you think?

Right now I'm using a fork of lunasvg for my project that has commit b1eb778 reverted. This solves the issue for me but it's of course not a nice solution.

@jonathanspw
Copy link

+1 from the Fedora side. We're having to patch out this new functionality so we can build properly.

@sammycage
Copy link
Owner

Hey, thank you for bringing this to my attention!

I understand that FetchContent can fail without internet access, though I thought it was a more modern approach for handling dependencies. I wasn't aware that it doesn't work properly on some machines, so that's definitely something I'll need to look into.

A pull request with a fix would be highly appreciated!

@WerWolv
Copy link
Contributor Author

WerWolv commented Dec 31, 2024

Great! I can make a PR later with the suggestion I proposed :)

@jonathanspw
Copy link

It's more modern, but that doesn't make it better ;) Most OS-packagers hate it, actually :)

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

Successfully merging a pull request may close this issue.

3 participants