[go: up one dir, main page]

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

[vcpkg-make] Add new port #39050

Open
wants to merge 213 commits into
base: master
Choose a base branch
from

Conversation

JavierMatosD
Copy link
Contributor
@JavierMatosD JavierMatosD commented May 30, 2024

Testing to see what happens when various options are on/off. Added a test port and cleaned up some of the code.

@dg0yt
Copy link
Contributor
dg0yt commented Sep 13, 2024

Please drop a note when this is "ready for review".

@JavierMatosD
Copy link
Contributor Author

This is ready for review.

@vicroms vicroms added the info:reviewed Pull Request changes follow basic guidelines label Sep 26, 2024
BillyONeal
BillyONeal previously approved these changes Sep 26, 2024
ports/vcpkg-make/vcpkg_make.cmake Outdated Show resolved Hide resolved
ports/vcpkg-make/vcpkg_make.cmake Outdated Show resolved Hide resolved
Copy link
Contributor
@dg0yt dg0yt left a comment

Choose a reason for hiding this comment

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

Submitting at 12 comments, slightly tired. Need to review my review later.
My old test-related comments still seem to apply.

@@ -195,6 +195,7 @@ foreach(flag ${VCPKG_LANGUAGES} SHARED_LINKER EXE_LINKER STATIC_LINKER MODULE_LI
endif()
endif()
endif()
string(STRIP "${${flag}_FLAGS}" "${flag}_FLAGS")
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the only change to this port. Is it necessary?
(The original flags may always having leading or trailing space.)

Comment on lines +3 to +25
vcpkg_download_distfile(ARCHIVE
URLS https://ftp.gnu.org/gnu/automake/automake-1.17.tar.gz
FILENAME automake.tar.gz
SHA512 11357dfab8cbf4b5d94d9d06e475732ca01df82bef1284888a34bd558afc37b1a239bed1b5eb18a9dbcc326344fb7b1b301f77bb8385131eb8e1e118b677883a
)

vcpkg_extract_source_archive(
automake_source
ARCHIVE ${ARCHIVE}
)

file(COPY
"${CMAKE_CURRENT_LIST_DIR}/"
DESTINATION
"${CURRENT_PACKAGES_DIR}/share/${PORT}"
)

file(COPY
"${automake_source}/lib/ar-lib"
"${automake_source}/lib/compile"
DESTINATION
"${CURRENT_PACKAGES_DIR}/share/${PORT}/wrappers"
)
Copy link
Contributor
@dg0yt dg0yt Sep 29, 2024

Choose a reason for hiding this comment

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

IIUC these wrappers are only used for MSVC.
In that case, linux binaries should not need to rebuild for wrapper updates.
In that case, this should be decoupled into a separate port, to scope the dependency at least to windows & !mingw.

Comment on lines +27 to +30
file(REMOVE
"${CURRENT_PACKAGES_DIR}/share/${PORT}/portfile.cmake"
"${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg.json"
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Prefering explicit copying over selective removal.
(General pattern in script ports.)

Comment on lines +3 to +7
file(GLOB cmake_files "${CMAKE_CURRENT_LIST_DIR}/*.cmake")
list(REMOVE_ITEM cmake_files "${CMAKE_CURRENT_LIST_FILE}")
foreach(cmake_file IN LISTS cmake_files)
include("${cmake_file}")
endforeach()
Copy link
Contributor

Choose a reason for hiding this comment

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

Prefering explicit including over globbing with selective removal.
(General pattern in script ports.)

message(STATUS "Generating configure for ${TARGET_TRIPLET}")
vcpkg_run_shell(
SHELL ${shell_cmd}
COMMAND ${AUTORECONF} -vfi
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
COMMAND ${AUTORECONF} -vfi
COMMAND "${AUTORECONF}" -vfi

Comment on lines +124 to +129
# Restore environment
vcpkg_restore_env_variables(VARS
${cm_FLAGS}
C_INCLUDE_PATH CPLUS_INCLUDE_PATH LIBRARY_PATH LD_LIBRARY_PATH
INCLUDE LIB LIBPATH _CL_ _LINK_
)
Copy link
Contributor

Choose a reason for hiding this comment

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

The environment is not restored between release and debug. I hope debug settings are prepended correctly.


z_vcpkg_make_restore_env()

vcpkg_restore_env_variables(VARS LIB LIBPATH LIBRARY_PATH)
Copy link
Contributor

Choose a reason for hiding this comment

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

OTOH, this restore takes place after each build type.

endfunction()

function(z_vcpkg_make_prepare_link_flags)
cmake_parse_arguments(PARSE_ARGV 0 ARG
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
cmake_parse_arguments(PARSE_ARGV 0 ARG
cmake_parse_arguments(PARSE_ARGV 0 arg

etc.

function(z_vcpkg_make_prepare_link_flags)
cmake_parse_arguments(PARSE_ARGV 0 ARG
""
"IN_OUT_VAR;X_VCPKG_TRANSFORM_LIBS;VCPKG_TARGET_IS_WINDOWS;VCPKG_TARGET_IS_MINGW;VCPKG_LIBRARY_LINKAGE"
Copy link
Contributor

Choose a reason for hiding this comment

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

Confusing...

Suggested change
"IN_OUT_VAR;X_VCPKG_TRANSFORM_LIBS;VCPKG_TARGET_IS_WINDOWS;VCPKG_TARGET_IS_MINGW;VCPKG_LIBRARY_LINKAGE"
"IN_OUT_VAR;TRANSFORM_LIBS;TARGET_IS_WINDOWS;TARGET_IS_MINGW;LIBRARY_LINKAGE"

... or maybe not use args at all. Calling sites, in particual tests, might override vars within block() scopes.


set(link_flags ${${ARG_IN_OUT_VAR}})

if(ARG_X_VCPKG_TRANSFORM_LIBS STREQUAL "ON")
Copy link
Contributor

Choose a reason for hiding this comment

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

Literally ON?
And why call it with OFF at all?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR! category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly info:internal This PR or Issue was filed by the vcpkg team. info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants