-
Notifications
You must be signed in to change notification settings - Fork 6.9k
[vcpkg-tool-swig] Add new tool port #36612
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
base: master
Are you sure you want to change the base?
Conversation
@microsoft-github-policy-service agree |
@cbentejac, Thanks for your PR, looks the PR build failed in many triplets, this is error log, please take a look:
|
It's a tool, should this be a release only build? F.t.r. there's an alternative (similar): ports/swig/portfile.cmake |
b6826c1
to
ced62dc
Compare
2ba3329
to
5289061
Compare
5289061
to
d27a74c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if the vcpkg maintainers will accept a tool port ATM.
If yes, it might need a different name (vcpkg-tool-swig
).
I would also encourage to add a tiny test project in scripts/test_ports
. Given that swig seems to need resources which are moved around only for Windows, I wouldn't be surprised if this area needs more work.
Ping @cbentejac for response. |
d27a74c
to
4b5c9d1
Compare
Thanks @dg0yt for your feedback. I renamed the port and applied your suggested changes. I haven't added a test project yet, though. |
file(COPY "${CURRENT_PACKAGES_DIR}/bin/" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/swig") | ||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cbentejac, Could you explain the purpose of these two lines? why put the lib folder under the tools folder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering it is supposed to be a tool, I thought it was better to have it being self-contained. Since vcpkg_copy_tools
only moves the executable and DLLs, the first line ensures that the "Lib" folder is also copied in the final tools folder, and the second cleans everything up so we end up in a similar state as if we had added the AUTO_CLEAN
in vcpkg_copy_tools
options.
Should "Lib" be placed somewhere else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you test by running swig -swiglib for the binary in installed
. Lib
should be placed where it is expected on Windows.
On non-windows, it might be useful to move the binary to manual-tools/vcpkg-tool-swig/swig
, and install an sh
script in tools/[name]/swig
instead. This script would set SWIG_LIB
relative to the script location, and then forward the args to the actual swig binary.
(Since this weekend, I do have a test case: itk[python]
needs swig >= 4.2. And the portfile needs to process swiglib. Cf. #41525.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Since this weekend, I do have a test case:
itk[python]
needs swig >= 4.2. And the portfile needs to process swiglib. Cf. #41525.)
What about gdal[python]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dg0yt Lib
is correctly placed according to "swig -swiglib" on Windows. I'll work next week on implementing your suggestion for non-Windows platforms and use your test case. Thanks!
vcpkg_copy_tools( | ||
TOOL_NAMES swig | ||
DESTINATION "${CURRENT_PACKAGES_DIR}/tools/swig" | ||
) | ||
|
||
file(COPY "${CURRENT_PACKAGES_DIR}/bin/" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/swig") |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
vcpkg_copy_tools( | ||
TOOL_NAMES swig | ||
DESTINATION "${CURRENT_PACKAGES_DIR}/tools/swig" | ||
) | ||
|
||
file(COPY "${CURRENT_PACKAGES_DIR}/bin/" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/swig") | ||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vcpkg_copy_tools( | |
TOOL_NAMES swig | |
DESTINATION "${CURRENT_PACKAGES_DIR}/tools/swig" | |
) | |
file(COPY "${CURRENT_PACKAGES_DIR}/bin/" DESTINATION "${CURRENT_PACKAGES_D 6D40 IR}/tools/swig") | |
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin") | |
vcpkg_copy_tools(TOOL_NAMES swig AUTO_CLEAN) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the Lib dir in the screenshot now. Maybe that's the explanation for manual copying/removal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing on linux: swig -swiglib
points to the packages dir. Is there a chance to make a relocatable build?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, not yet. swig/swig#2509
Pinging @cbentejac Can you address the review suggestions? Thanks! |
Note: I will be converting your PR to draft status. When you respond, please revert to "ready for review". That way, I can be aware that you've responded since you can't modify the tags. |
@cbentejac do you have plans to continue working on this in the near future? |
Hi @m-kuhn, Yes, I'm planning on finishing this port but haven't been able to find the time to wrap it up lately. |
find_package
calls are REQUIRED, are satisfied byvcpkg.json
's declared dependencies, or disabled with CMAKE_DISABLE_FIND_PACKAGE_Xxx.vcpkg.json
matches what upstream says.vcpkg.json
matches what upstream says../vcpkg x-add-version --all
and committing the result.