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

[libmodplug] Patch CMakeLists.txt to fix install paths #21381

Merged
merged 3 commits into from
Nov 17, 2021

Conversation

itsmattkc
Copy link
Contributor

@itsmattkc itsmattkc commented Nov 13, 2021

Describe the pull request

  • What does your PR fix?

    Implements CMake: Fix install paths on Windows Konstanty/libmodplug#61 which fixes a bug in the CMakeLists.txt where DLL files are erroneously installed to the lib folder rather than bin. Currently the portfile.cmake attempts to workaround this by manually renaming the files post-installation, but this is clunky (considering the filename has to be hardcoded), and will also fail if the user is installing only a release OR debug build (since both rename commands are hardcoded and CMake will throw a "file not found" error if they don't both exist).

    By patching the CMakeLists.txt, this is solved at the root of the problem. DLLs are correctly installed to bin in the first place (while other library/linking files are still correctly installed to lib). The CMake documentation recommends this solution towards the end of the "Installing Targets" section here: https://cmake.org/cmake/help/latest/command/install.html#installing-targets

  • Which triplets are supported/not supported? Have you updated the CI baseline?

    All triplets are supported. This patch corrects Win32 issues without breaking other platforms.

  • Does your PR follow the maintainer guide?

    I believe it does. In my opinion, this is a very small and readable patch that I believe will be easy to review. I also believe it makes no extraneous/trivial changes and is the code I am using is fairly well-documented.

  • If you have added/updated a port: Have you run ./vcpkg x-add-version --all and committed the result?

    Yes.

If you are still working on the PR, open it as a Draft: https://github.blog/2019-02-14-introducing-draft-pull-requests/

@ghost
Copy link

ghost commented Nov 13, 2021

CLA assistant check
All CLA requirements met.

@cenit
Copy link
Contributor

cenit commented Nov 13, 2021

whenever you touch a ports/<port name> folder content, you are updating a port in vcpkg terminology.
So you need to bump port-version in vcpkg.json (or control if old port) and run the command above after committing the first steps

@itsmattkc
Copy link
Contributor Author

Understood, I believe I have done this now.

@cenit
Copy link
Contributor

cenit commented Nov 14, 2021

you did everything in one commit and it’s not valid. You should have first committed your patches with the port version bump, then another commit with the modifications after running vcpkg x-add-versions

@itsmattkc itsmattkc force-pushed the libmodplug-fix-paths branch 2 times, most recently from 164ec44 to 4c5bfed Compare November 15, 2021 00:19
@itsmattkc
Copy link
Contributor Author

Alright. How is it now?

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have modified or added at least one portfile where deprecated functions are used.

If you feel able to do so, please consider migrating them to the new functions:
vcpkg_install_cmake -> vcpkg_cmake_install (from port vcpkg-cmake)
vcpkg_build_cmake -> vcpkg_cmake_build (from port vcpkg-cmake)
vcpkg_configure_cmake -> vcpkg_cmake_configure (Please remove the option PREFER_NINJA) (from port vcpkg-cmake)
vcpkg_fixup_cmake_targets -> vcpkg_cmake_config_fixup (from port vcpkg-cmake-config)

In the ports that use the new function, you have to add the corresponding dependencies:

{
  "name": "vcpkg-cmake",
  "host": true
},
{
  "name": "vcpkg-cmake-config",
  "host": true
}

The following files are affected:

  • ports/libmodplug/portfile.cmake

ports/libmodplug/portfile.cmake Outdated Show resolved Hide resolved
ports/libmodplug/portfile.cmake Outdated Show resolved Hide resolved
@JackBoosY JackBoosY added category:port-bug The issue is with a library, which is something the port should already support requires:author-response labels Nov 15, 2021
@itsmattkc
Copy link
Contributor Author

Made requested changes.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have modified or added at least one portfile where deprecated functions are used.

If you feel able to do so, please consider migrating them to the new functions:
vcpkg_install_cmake -> vcpkg_cmake_install (from port vcpkg-cmake)
vcpkg_build_cmake -> vcpkg_cmake_build (from port vcpkg-cmake)
vcpkg_configure_cmake -> vcpkg_cmake_configure (Please remove the option PREFER_NINJA) (from port vcpkg-cmake)
vcpkg_fixup_cmake_targets -> vcpkg_cmake_config_fixup (from port vcpkg-cmake-config)

In the ports that use the new function, you have to add the corresponding dependencies:

{
  "name": "vcpkg-cmake",
  "host": true
},
{
  "name": "vcpkg-cmake-config",
  "host": true
}

The following files are affected:

  • ports/libmodplug/portfile.cmake

@JackBoosY JackBoosY added info:reviewed Pull Request changes follow basic guidelines and removed requires:author-response labels Nov 16, 2021
@JackBoosY
Copy link
Contributor

Normally we make those changes with the port update / port feature / other port bug.
But this LGTM.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have modified or added at least one portfile where deprecated functions are used.

If you feel able to do so, please consider migrating them to the new functions:
vcpkg_install_cmake -> vcpkg_cmake_install (from port vcpkg-cmake)
vcpkg_build_cmake -> vcpkg_cmake_build (from port vcpkg-cmake)
vcpkg_configure_cmake -> vcpkg_cmake_configure (Please remove the option PREFER_NINJA) (from port vcpkg-cmake)
vcpkg_fixup_cmake_targets -> vcpkg_cmake_config_fixup (from port vcpkg-cmake-config)

In the ports that use the new function, you have to add the corresponding dependencies:

{
  "name": "vcpkg-cmake",
  "host": true
},
{
  "name": "vcpkg-cmake-config",
  "host": true
}

The following files are affected:

  • ports/libmodplug/portfile.cmake

@vicroms vicroms merged commit 711db40 into microsoft:master Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants