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

meson: Support system-provided bestsource #162

Open
wants to merge 1 commit into
base: feature
Choose a base branch
from

Conversation

al3xtjames
Copy link

Meson unconditionally uses the wrapped bestsource dependency when the bestsource option is enabled. Update meson.build to support using a system-provided version of bestsource when it is present.

@arch1t3cht
Copy link
Owner

Thanks for the PR (and sorry for taking so long) - Three comments:

  1. Do you know of a distribution where this would actually be used? vapoursynth-bestsource is a system package on arch linux, but since it installs into /usr/lib/vapoursynth I don't think it'd get picked up by pkg-config. If not that's not a problem, I'm just curious.
  2. The version requirement needs to be >=6.0 now after the latest bump.
  3. Normally you could simplify the if-else logic by instead just doing dependency('bestsource', fallback: ['bestsource', 'bestsource_dep'], default_options: [...]). (Or is there some specific reason why you did not do this?) However, this then has the problem that the bestsource wrap currently has a patch to remove the project version declaration, since that uses grep, which is not always available on Windows. So this patch would need to be updated to hardcode a 6.0 version instead. Alternatively, you could keep the current logic and add a comment that this is the reason why you don't simplify it into a simple dependency call with fallback.

@0tkl
Copy link

0tkl commented Oct 24, 2024

the bestsource wrap currently has a patch to remove the project version declaration, since that uses grep, which is not always available on Windows.

Speaking of this, as a sidenote, grep is distributed along with Git for Windows and is stored in C:\Program Files\Git\usr\bin or C:\Users\USERNAME\AppData\Roaming\Git\usr\bin. I think we can safely assume that anyone with Git installed on Windows can compile bestsource without the patch.

Meson unconditionally uses the wrapped bestsource dependency when the
bestsource option is enabled. Update meson.build to support using a
system-provided version of bestsource when it is present.
@al3xtjames
Copy link
Author

No worries about the delay.

  1. I use this patch in a Nix derivation for this Aegisub fork. I also wrote one for bestsource, though neither of these are in nixpkgs. I actually haven't tested if this compiles on NixOS but it does work on macOS.
  2. Thanks for pointing this out. I rebased the patch and updated the version.
  3. When I originally made this change I didn't realize that default_options could be passed to dependency for fallbacks, which is why I used an if-else. I updated the patch to use fallback and updated the patch in the bestsource wrap to hardcode the verison to 6.0.

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 this pull request may close these issues.

3 participants