Skip to content

Commit

Permalink
[graphviz] Fix tools (#23148)
Browse files Browse the repository at this point in the history
* Fix graphviz tools

* Update versions

* Add license

* Fix non-Windows build

* Update versions

* Fix dot command call for non-Windows

* Update versions

* Force dynamic library

* Update versions

* Try fixing unix

* Try using rpath

* Try fixing unix

* Update versions

* Make pkgconf a host dep

* Update versions
  • Loading branch information
Ace314159 committed Feb 22, 2022
1 parent 6585d12 commit 0749a32
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 9 deletions.
43 changes: 37 additions & 6 deletions ports/graphviz/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)

vcpkg_from_gitlab(
GITLAB_URL https://gitlab.com
OUT_SOURCE_PATH SOURCE_PATH
Expand All @@ -9,6 +11,25 @@ vcpkg_from_gitlab(
0001-Fix-build.patch
)

if(VCPKG_TARGET_IS_OSX)
message("${PORT} currently requires the following libraries from the system package manager:\n libtool\n\nThey can be installed with brew install libtool")
elseif(VCPKG_TARGET_IS_LINUX)
message("${PORT} currently requires the following libraries from the system package manager:\n libtool\n\nThey can be installed with apt-get install libtool")
else()
vcpkg_download_distfile(
LTDL_H_PATH
URLS "https://gitlab.com/graphviz/graphviz-windows-dependencies/-/raw/141d3a21be904fa8dc2ae3ed01d36684db07a35d/${VCPKG_TARGET_ARCHITECTURE}/include/ltdl.h"
FILENAME ltdl.h
SHA512 f2d20e849e35060536265f47014c40eb70e57dacd600a9db112fc465fbfa6a66217b44a8c3dc33039c260a27f09d9034b329b03cc28c32a22ec503fcd17b78cd
)
file(COPY ${LTDL_H_PATH} DESTINATION ${SOURCE_PATH}/lib/common)
set(EXTRA_CMAKE_OPTION "-DLTDL_INCLUDE_DIR=${SOURCE_PATH}/lib/common")
endif()

if(NOT VCPKG_TARGET_IS_WINDOWS)
set(EXTRA_CMAKE_OPTION "-DCMAKE_INSTALL_RPATH=${CURRENT_INSTALLED_DIR}/lib")
endif()

vcpkg_acquire_msys(MSYS_ROOT PACKAGES gawk)
vcpkg_add_to_path("${MSYS_ROOT}/usr/bin")

Expand All @@ -19,15 +40,14 @@ vcpkg_find_acquire_program(PYTHON3)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"

DISABLE_PARALLEL_CONFIGURE
OPTIONS
-DBISON_EXECUTABLE=${BISON}
-DFLEX_EXECUTABLE=${FLEX}
-DGIT_EXECUTABLE=${GIT}
-DPython3_EXECUTABLE=${PYTHON3}
-DPKG_CONFIG_EXECUTABLE=${CURRENT_INSTALLED_DIR}/tools/pkgconf/pkgconf
-Denable_ltdl=OFF
-DPKG_CONFIG_EXECUTABLE=${CURRENT_HOST_INSTALLED_DIR}/tools/pkgconf/pkgconf
${EXTRA_CMAKE_OPTION}
)

vcpkg_cmake_install()
Expand All @@ -40,7 +60,18 @@ vcpkg_copy_tools(
AUTO_CLEAN
)

# # Handle copyright
if(VCPKG_TARGET_IS_WINDOWS)
file(GLOB PLUGINS "${CURRENT_PACKAGES_DIR}/bin/gvplugin_*")
file(COPY ${PLUGINS} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
vcpkg_execute_required_process(
COMMAND dot -c
WORKING_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/${PORT}
LOGNAME configure-plugins
)
file(COPY "${CURRENT_PACKAGES_DIR}/tools/${PORT}/config6" DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
endif()

# Handle copyright
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

vcpkg_fixup_pkgconfig()

vcpkg_fixup_pkgconfig()
8 changes: 6 additions & 2 deletions ports/graphviz/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
{
"name": "graphviz",
"version-semver": "2.49.1",
"port-version": 1,
"port-version": 2,
"description": "Graph Visualization Tools",
"homepage": "https://graphviz.org/",
"license": "EPL-1.0",
"dependencies": [
"cairo",
"getopt",
"libffi",
"libgd",
"pango",
"pkgconf",
{
"name": "pkgconf",
"host": true
},
{
"name": "vcpkg-cmake",
"host": true
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2586,7 +2586,7 @@
},
"graphviz": {
"baseline": "2.49.1",
"port-version": 1
"port-version": 2
},
"greatest": {
"baseline": "1.5.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/g-/graphviz.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "912ac6a1578bd9cf23c20ed7f3bc85c25058c872",
"version-semver": "2.49.1",
"port-version": 2
},
{
"git-tree": "61316edc3deb64749cf84f70f5b0dbd669c06a9e",
"version-semver": "2.49.1",
Expand Down

0 comments on commit 0749a32

Please sign in to comment.