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

Install headers and pkg-config files, MkII #3834

Merged
merged 5 commits into from
May 21, 2024

Conversation

flibitijibibo
Copy link
Contributor

@flibitijibibo flibitijibibo commented Feb 4, 2024

This reworks #3325 to apply to the latest dxvk revision, and is based on #3738 and #3743. As a result, only the last 3 commits are actually for this specific PR.

CC @smcv, I had to adjust a few of the patches, so we'll need to re-confirm the signoffs for those.

Fixes #3323

Part of #3451

Supercedes #3325

@smcv
Copy link
Contributor

smcv commented Feb 5, 2024

I have no problem with the versions of my commits that appear here. Feel free to add a Co-authored-by, or not, as you prefer.

@smcv
Copy link
Contributor

smcv commented Feb 5, 2024

On #3325 I wrote:

It's a bit unfortunate that [the name prefix for *.so] is dxvk_ and [the name prefix for *.pc] is dxvk-. I've kept the naming from the Fedora packaging for now, but I'd be very tempted to change it to dxvk_d3d9.pc, dxvk_glfw_dxgi.pc and so on, to be consistent with the library names and avoid having two subtly different name-prefixes.

What do maintainers think about that? This PR is changing the pkg-config API anyway, so if there was a time to make that change, now would probably be that time.

@flibitijibibo
Copy link
Contributor Author

I'd be okay with doing _ over -, I'll check with Neal to see if this is an okay change for Fedora.

meson.build Outdated Show resolved Hide resolved
src/wsi/sdl2/wsi_platform_sdl2.cpp Outdated Show resolved Hide resolved
src/wsi/sdl2/wsi_platform_sdl2.h Outdated Show resolved Hide resolved
@Conan-Kudo
Copy link

I'd be okay with doing _ over -, I'll check with Neal to see if this is an okay change for Fedora.

Does Meson's pkgconfig generator not support setting Provides names? It's documented in pc(5).

@smcv
Copy link
Contributor

smcv commented Feb 5, 2024

Does Meson's pkgconfig generator not support setting Provides names? It's documented in pc(5).

Not as far as I can see in https://mesonbuild.com/Pkgconfig-module.html.

Does original freedesktop.org pkg-config support Provides, or are they a pkgconf-ism?

@smcv
Copy link
Contributor

smcv commented Feb 5, 2024

I believe the way the equivalent of Provides was traditionally implemented is as a symlink oldname.pc -> newname.pc, as is done in the Debian packaging of sdl12-compat and sdl2-compat.

[edited to add]

sdl12_compat.pc does have Provides: sdl, and Debian uses pkgconf now, so maybe we don't actually need that symlink any more; but there are other modules (e.g. libpng, libplist, libxcrypt) for which the symlinks are still used, and there's no Provides in those cases.

@Conan-Kudo
Copy link

Conan-Kudo commented Feb 5, 2024

It was always part of the spec, but not implemented fully in pkg-config. pkgconf actually implemented it to work. You see this with pkg-config --provides sdl12-compat across the two implementations.

@flibitijibibo
Copy link
Contributor Author

Rebased and updated with the latest changes from the other two PRs.

Did we ever make a call with the - v. _ change? Left that part alone for now.

@Conan-Kudo
Copy link

Well, I'm shipping dxvk-native-2.3 now with -, so... 🤷🏾‍♂️

@flibitijibibo
Copy link
Contributor Author

Latest push is just a rebase, this PR now only depends on #3743

meson.build Outdated Show resolved Hide resolved
meson.build Outdated Show resolved Hide resolved
@Joshua-Ashton
Copy link
Collaborator

If you fix that comment and the commit commit names, I will merge it.

@flibitijibibo
Copy link
Contributor Author

Looks like Meson made the choice for us:

src/dxgi/meson.build:24:0: ERROR: Invalid Shared library version "0.2.3.1". Must be of the form X.Y.Z where all three are numbers. Y and Z are optional.

So I guess I need to revert that...? Also, what were the commit/comment changes I needed to make, I couldn't see them in this thread.

@Joshua-Ashton
Copy link
Collaborator

Just make the commit names match up with the style of the rest of the repo.

@Joshua-Ashton
Copy link
Collaborator

Joshua-Ashton commented May 21, 2024

Looks like Meson made the choice for us:

src/dxgi/meson.build:24:0: ERROR: Invalid Shared library version "0.2.3.1". Must be of the form X.Y.Z where all three are numbers. Y and Z are optional.

So I guess I need to revert that...? Also, what were the commit/comment changes I needed to make, I couldn't see them in this thread.

lol let's make it 0.231 or whatever then

@flibitijibibo
Copy link
Contributor Author

flibitijibibo commented May 21, 2024

Latest push changes to be the '231' style, and adjusts the commit tag to use [].

flibitijibibo and others added 2 commits May 21, 2024 13:39
Zips can't preserve the symlink, so make the .tar.gz package with package_native.sh and zip that up instead.
This is necessary for compatibility with Meson's pkg module, which
generates pkg-config metadata containing "-lNAME" where NAME is the
first argument to shared_library(). Changing the name_prefix parameter
would break that.

Conversely, including .dll or .so in the first parameter would also
break that, so remove the `+dll_ext` part (in practice this is not a
functional change, because `dll_ext` is always set to an empty string).

Signed-off-by: Simon McVittie <[email protected]>
@Joshua-Ashton
Copy link
Collaborator

One final nit, the tarball for Steam Runtime binaries contains a .git file inside of the include folder :P

smcv added 2 commits May 21, 2024 14:00
When building a game that has been ported to Linux using DXVK Native,
these headers are necessary to provide the Direct3D and DXVK APIs.

Signed-off-by: Simon McVittie <[email protected]>
This allows dependent projects to query the version and location of DXVK
via the pkg-config interface.

The include directories aren't yet set, because the headers aren't
installed; that will follow in a subsequent commit.

The naming of these pkg-config files is based on proposed Fedora packages
for DXVK 2.0, and is not compatible with older Fedora packages for DXVK
1.x (which used the naming convention dxvk-native-d3d9 and so on).
Packagers can create symlinks such as dxvk-native-d3d9.pc -> dxvk-d3d9.pc
if they want to retain compatibility with older names.

Signed-off-by: Simon McVittie <[email protected]>
@flibitijibibo
Copy link
Contributor Author

flibitijibibo commented May 21, 2024

Added an exclude_files to the directx install block to ignore a possible .git file when packaging a repo clone (shouldn't happen with source tarballs).

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.

Install headers and pkg-config metadata for DXVK Native
4 participants