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

[jinja2cpp] New port #39537

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft

[jinja2cpp] New port #39537

wants to merge 8 commits into from

Conversation

Cheaterdev
Copy link

  • Changes comply with the maintainer guide.
  • The name of the port matches an existing name for this component on https://repology.org/ if possible, and/or is strongly associated with that component on search engines.
  • Optional dependencies are resolved in exactly one way. For example, if the component is built with CMake, all find_package calls are REQUIRED, are satisfied by vcpkg.json's declared dependencies, or disabled with CMAKE_DISABLE_FIND_PACKAGE_Xxx.
  • The versioning scheme in vcpkg.json matches what upstream says.
  • The license declaration in vcpkg.json matches what upstream says.
  • The installed as the "copyright" file matches what upstream says.
  • The source code of the component installed comes from an authoritative source.
  • The generated "usage text" is accurate. See adding-usage for context.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is in the new port's versions file.
  • Only one version is added to each modified port's versions file.

@Cheaterdev
Copy link
Author

@microsoft-github-policy-service agree

@WangWeiLin-MV WangWeiLin-MV added the category:new-port The issue is requesting a new library to be added; consider making a PR! label Jun 27, 2024
probably will fix non-windows builds
@Cheaterdev Cheaterdev marked this pull request as ready for review June 28, 2024 20:27
@WangWeiLin-MV WangWeiLin-MV changed the title [Jinja2cpp] New port [jinja2cpp] New port Jul 1, 2024
Comment on lines 53 to 55
file(INSTALL
${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright
)
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
file(INSTALL
${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright
)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

Copy link
Contributor

Choose a reason for hiding this comment

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

As a new port, could you please unify the file EOL from CRLF to LF?

@WangWeiLin-MV
Copy link
Contributor

Compilation fails when using this library, could you help take a look or provide a simple example?

cmake_minimum_required(VERSION 3.25.1)
project(Example VERSION 0.1.2.3 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED True)

add_executable(main c.cpp)
find_package(jinja2cpp CONFIG REQUIRED)
target_link_libraries(main PRIVATE jinja2cpp)
#include "jinja2cpp/config.h"
#include <iostream>
int main() {

std::cout << "jinja2cpp" << std::endl;
std::cout << JINJA2CPP_VERSION << std::endl;

return 0;
}

@Cheaterdev Cheaterdev marked this pull request as draft July 1, 2024 19:42
@Cheaterdev
Copy link
Author

Cheaterdev commented Jul 2, 2024

Compilation fails when using this library, could you help take a look or provide a simple example?

It tries to link binary with jinja2cpp.dll instead of jinja2cpp.lib for some reason.

vcpkg\installed\x64-windows\share\jinja2cpp\jinja2cpp-cfg-debug.cmake:

set_target_properties(jinja2cpp PROPERTIES
  IMPORTED_IMPLIB_DEBUG "${_IMPORT_PREFIX}/debug/lib/static/jinja2cpp.lib"
  IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBUG "Boost::filesystem;Boost::json;Boost::regex"
  IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/debug/bin/jinja2cpp.dll"
  )

It completely ignores the IMPORTED_IMPLIB_DEBUG and uses IMPORTED_LOCATION_DEBUG as a library interface file.

PS While using exactly the same vcpkg branch but with msbuild+vcpkg manifest - works as intended.

Comment on lines 29 to 40
find_library(JINJA2CPP_REL NAMES jinja2cpp ${REL_NAMES} PATHS "${CURRENT_PACKAGES_DIR}/lib/static" NO_DEFAULT_PATH)
find_library(JINJA2CPP_DBG NAMES jinja2cpp ${DBG_NAMES} PATHS "${CURRENT_PACKAGES_DIR}/debug/lib/static" NO_DEFAULT_PATH)

if(JINJA2CPP_REL)
get_filename_component(JINJA2CPP_REL_EXT "${JINJA2CPP_REL}" EXT)
file(RENAME "${JINJA2CPP_REL}" "${CURRENT_PACKAGES_DIR}/lib/jinja2cpp.${JINJA2CPP_REL_EXT}")
endif()

if(JINJA2CPP_DBG)
get_filename_component(JINJA2CPP_DBG_EXT "${JINJA2CPP_DBG}" EXT)
file(RENAME "${JINJA2CPP_DBG}" "${CURRENT_PACKAGES_DIR}/debug/lib/jinja2cpp.${JINJA2CPP_DBG_EXT}")
endif()
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like asking for trouble with CMake config.
I would recommend to use options and patching to directly install to vcpkg's desired locations.

Copy link
Author

Choose a reason for hiding this comment

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

@dg0yt Changed location using patch, still the same issue.

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!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants