Skip to content

Commit

Permalink
[libxslt] Fix install tools and pkgconfig (#14476)
Browse files Browse the repository at this point in the history
* [libxslt] Fix install tools and pkgconfig

* [libxml2] install pkgconfig
  • Loading branch information
JackBoosY authored Nov 11, 2020
1 parent 3b910ec commit 2c94072
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
9 changes: 9 additions & 0 deletions ports/libxml2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,12 @@ install(TARGETS libxml2
ARCHIVE DESTINATION lib
${TARGET_INSTALL_OPTIONS}
)

# pkgconfig
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix "\${prefix}")
set(libdir ${prefix}/${CMAKE_INSTALL_LIBDIR})
set(includedir ${prefix}/${CMAKE_INSTALL_INCLUDEDIR})

configure_file(libxml-2.0.pc.in libxml-2.0.pc @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/libxml-2.0.pc DESTINATION lib/pkgconfig)
1 change: 1 addition & 0 deletions ports/libxml2/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Source: libxml2
Version: 2.9.10
Port-Version: 1
Homepage: https://xmlsoft.org/
Description: Libxml2 is the XML C parser and toolkit developed for the Gnome project (but usable outside of the Gnome platform)
Build-Depends: zlib, libiconv, liblzma
10 changes: 4 additions & 6 deletions ports/libxml2/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ vcpkg_configure_cmake(

vcpkg_install_cmake()

# Handle copyright
configure_file(${SOURCE_PATH}/Copyright ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)

# Install usage
file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage
DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
vcpkg_fixup_pkgconfig()

vcpkg_copy_pdbs()

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
endif()

file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
file(INSTALL ${SOURCE_PATH}/Copyright DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
2 changes: 1 addition & 1 deletion ports/libxslt/CONTROL
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Source: libxslt
Version: 1.1.33-7
Port-Version: 1
Port-Version: 2
Homepage: https://github.com/GNOME/libxslt
Description: Libxslt is a XSLT library implemented in C for XSLT 1.0 and most of EXSLT
Build-Depends: libxml2, liblzma
16 changes: 4 additions & 12 deletions ports/libxslt/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if (VCPKG_TARGET_IS_WINDOWS)
prefix=@INSTALL_DIR@
include=@INCLUDE_DIR@
lib=@LIB_DIR@
bindir=$(PREFIX)\\tools
bindir=$(PREFIX)\\bin
sodir=$(PREFIX)\\bin
)
# Debug params
Expand Down Expand Up @@ -60,6 +60,8 @@ if (VCPKG_TARGET_IS_WINDOWS)
OPTIONS rebuild
)

vcpkg_copy_tools(TOOL_NAMES xsltproc AUTO_CLEAN)

# The makefile builds both static and dynamic libraries, so remove the ones we don't want
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libxslt_a${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX} ${CURRENT_PACKAGES_DIR}/lib/libexslt_a${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX})
Expand Down Expand Up @@ -103,16 +105,8 @@ else()
)

vcpkg_install_make()
#vcpkg_fixup_pkgconfig()?
vcpkg_fixup_pkgconfig()

if (EXISTS ${CURRENT_PACKAGES_DIR}/bin/xslt-config)
file(COPY ${CURRENT_PACKAGES_DIR}/bin/xslt-config DESTINATION ${CURRENT_PACKAGES_DIR}/tools)
file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/xslt-config)
endif()
if (EXISTS ${CURRENT_PACKAGES_DIR}/bin/xsltproc)
file(COPY ${CURRENT_PACKAGES_DIR}/bin/xsltproc DESTINATION ${CURRENT_PACKAGES_DIR}/tools)
file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/xslt-config)
endif()
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
file(COPY ${CURRENT_PACKAGES_DIR}/lib/libxslt.so ${CURRENT_PACKAGES_DIR}/bin/)
else()
Expand Down Expand Up @@ -143,8 +137,6 @@ endif()
file(WRITE ${CURRENT_PACKAGES_DIR}/include/libexslt/exsltexports.h "${EXSLTEXPORTS_H}")

# Remove tools and debug include directories
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)

Expand Down

0 comments on commit 2c94072

Please sign in to comment.