Skip to content

Commit

Permalink
[ignition-modularscripts] Fix pkgconfig files installed by ignition l…
Browse files Browse the repository at this point in the history
…ibraries

Use the new function vcpkg_fixup_pkgconfig to fix the installed .pc pkgconfig files
of the ignition libraries.

As ignition-fuel-tools1 depends on curl that has a broken pkg-config file, disable
installation of its pkg-config files.
  • Loading branch information
traversaro committed May 9, 2020
1 parent 3479a26 commit 67c6b55
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 20 deletions.
2 changes: 1 addition & 1 deletion ports/ignition-fuel-tools1/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: ignition-fuel-tools1
Version: 1.2.0-1
Version: 1.2.0-2
Build-Depends: curl, ignition-cmake0, ignition-common1, libyaml, libzip, jsoncpp
Description: Tools for using fuel API to download robot models
7 changes: 4 additions & 3 deletions ports/ignition-fuel-tools1/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
include(vcpkg_common_functions)

include(${CURRENT_INSTALLED_DIR}/share/ignitionmodularscripts/ignition_modular_library.cmake)

ignition_modular_library(NAME fuel-tools
VERSION "1.2.0"
CMAKE_PACKAGE_NAME ignition-fuel_tools1
SHA512 a656fed74fb2138b3bcf7d35b25ad06da95cfb9a3ad7ded2c9c54db385f55ea310fd1a72dcf6400b0a6199e376c1ba2d11ee2a08c66e3c2cc8b2ee1b25406986
# Ensure yaml is correctly linked (backport of https://bitbucket.org/ignitionrobotics/ign-fuel-tools/pull-requests/103/use-yaml_target-instead-of-yaml-yaml/diff)
PATCHES link-correct-yaml-target.patch)
PATCHES link-correct-yaml-target.patch
# This can be removed when the pc file of curl is fixed
DISABLE_PKGCONFIG_INSTALL
)
2 changes: 1 addition & 1 deletion ports/ignition-modularscripts/CONTROL
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Source: ignition-modularscripts
Version: 2020-04-16
Version: 2020-05-09
Description: Vcpkg helpers to package ignition libraries
35 changes: 25 additions & 10 deletions ports/ignition-modularscripts/ignition_modular_library.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

function(ignition_modular_build_library NAME MAJOR_VERSION SOURCE_PATH CMAKE_PACKAGE_NAME DEFAULT_CMAKE_PACKAGE_NAME)
function(ignition_modular_build_library NAME MAJOR_VERSION SOURCE_PATH CMAKE_PACKAGE_NAME DEFAULT_CMAKE_PACKAGE_NAME IML_DISABLE_PKGCONFIG_INSTALL)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
Expand All @@ -17,11 +17,19 @@ function(ignition_modular_build_library NAME MAJOR_VERSION SOURCE_PATH CMAKE_PAC

file(COPY ${CMAKE_RELEASE_FILES} DESTINATION
"${CURRENT_PACKAGES_DIR}/share/${CMAKE_PACKAGE_NAME}/")

# Remove debug files
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include
${CURRENT_PACKAGES_DIR}/debug/lib/cmake
${CURRENT_PACKAGES_DIR}/debug/share)
endif()

# Remove debug files
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include
${CURRENT_PACKAGES_DIR}/debug/lib/cmake
${CURRENT_PACKAGES_DIR}/debug/share)

# Make pkg-config files relocatable
if(NOT IML_DISABLE_PKGCONFIG_INSTALL)
vcpkg_fixup_pkgconfig()
else()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig
${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig)
endif()

# Find the relevant license file and install it
Expand All @@ -44,7 +52,9 @@ endfunction()
## SHA512 <sha512>
## [REF <ref>]
## [HEAD_REF <head_ref>]
## [PATCHES <patches>])
## [PATCHES <patches>]
## [CMAKE_PACKAGE_NAME <cmake_package_name>]
## [DISABLE_PKGCONFIG_INSTALL])
## ```
##
## ## Parameters:
Expand Down Expand Up @@ -72,16 +82,21 @@ endfunction()
## ### CMAKE_PACKAGE_NAME
## The name of the CMake package for the port.
## If not specified, defaults to `ignition-${NAME}${MAJOR_VERSION}`.
##
## ### DISABLE_PKGCONFIG_INSTALL
## If present, disable installation of .pc pkg-config configuration files.
##
##
## ## Examples:
##
## * [ignition-cmake0](https://github.com/Microsoft/vcpkg/blob/master/ports/ignition-cmake0/portfile.cmake)
## * [ignition-math4](https://github.com/Microsoft/vcpkg/blob/master/ports/ignition-math4/portfile.cmake)
## * [ignition-fuel-tools1](https://github.com/Microsoft/vcpkg/blob/master/ports/ignition-fuel-tools1/portfile.cmake)
function(ignition_modular_library)
set(options DISABLE_PKGCONFIG_INSTALL)
set(oneValueArgs NAME VERSION SHA512 REF HEAD_REF CMAKE_PACKAGE_NAME)
set(multiValueArgs PATCHES)
cmake_parse_arguments(IML "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
cmake_parse_arguments(IML "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

string(REPLACE "." ";" IML_VERSION_LIST ${IML_VERSION})
list(GET IML_VERSION_LIST 0 IML_MAJOR_VERSION)
Expand All @@ -101,7 +116,7 @@ function(ignition_modular_library)
if(NOT DEFINED IML_CMAKE_PACKAGE_NAME)
set(IML_CMAKE_PACKAGE_NAME ${DEFAULT_CMAKE_PACKAGE_NAME})
endif()

# Download library from github, to support also the --head option
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
Expand All @@ -113,5 +128,5 @@ function(ignition_modular_library)
)

# Build library
ignition_modular_build_library(${IML_NAME} ${IML_MAJOR_VERSION} ${SOURCE_PATH} ${IML_CMAKE_PACKAGE_NAME} ${DEFAULT_CMAKE_PACKAGE_NAME})
ignition_modular_build_library(${IML_NAME} ${IML_MAJOR_VERSION} ${SOURCE_PATH} ${IML_CMAKE_PACKAGE_NAME} ${DEFAULT_CMAKE_PACKAGE_NAME} ${IML_DISABLE_PKGCONFIG_INSTALL})
endfunction()
4 changes: 2 additions & 2 deletions ports/ignition-transport4/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: ignition-transport4
Version: 4.0.0-1
Build-Depends: cppzmq, ignition-cmake0, ignition-msgs1, libuuid (!windows&!uwp), protobuf, zeromq
Version: 4.0.0-2
Build-Depends: cppzmq, ignition-cmake0, ignition-modularscripts, ignition-msgs1, libuuid (!windows&!uwp), protobuf, zeromq
Description: Transport middleware for robotics
6 changes: 3 additions & 3 deletions ports/ignition-transport4/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include(vcpkg_common_functions)

include(${CURRENT_INSTALLED_DIR}/share/ignitionmodularscripts/ignition_modular_library.cmake)

ignition_modular_library(NAME transport
VERSION "4.0.0"
SHA512 d4125044c21fdd6754f3b8b06f372df3f858080d5d33e97ed7a8ef8f6fb9857d562082aad41c89ea9146a33b1c3814305d33c5c8f8bcde66a16477b4a01655b4)
SHA512 d4125044c21fdd6754f3b8b06f372df3f858080d5d33e97ed7a8ef8f6fb9857d562082aad41c89ea9146a33b1c3814305d33c5c8f8bcde66a16477b4a01655b4
# This can be removed when the pc file of libuuid on Windows is fixed
DISABLE_PKGCONFIG_INSTALL)

0 comments on commit 67c6b55

Please sign in to comment.