Skip to content

Commit

Permalink
[sdl1] fix regression due to variable expansion of pkg-config. Use si…
Browse files Browse the repository at this point in the history
…milar regex to the library removal for ignored flags.
  • Loading branch information
Neumann-A committed Jul 15, 2020
1 parent 4994797 commit 5ccacd4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion ports/sdl1/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Source: sdl1
Version: 1.2.15-11
Version: 1.2.15
Port-Version: 12
Homepage: https://www.libsdl.org
Description: Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.
6 changes: 4 additions & 2 deletions ports/sdl1/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@ else()
message("libgles2-mesa-dev must be installed before sdl1 can build. Install it with \"apt install libgles2-mesa-dev\".")

vcpkg_configure_make(
SOURCE_PATH ${SOURCE_PATH}
SOURCE_PATH ${SOURCE_PATH}
)

vcpkg_install_make()
vcpkg_fixup_pkgconfig(IGNORE_FLAGS -Wl,-rpath,\${libdir} SYSTEM_LIBRARIES -lm -ldl -lpthread)
vcpkg_fixup_pkgconfig(IGNORE_FLAGS -Wl,-rpath,${CURRENT_PACKAGES_DIR}/lib/pkgconfig/../../lib
-Wl,-rpath,${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/../../lib
SYSTEM_LIBRARIES pthread)

file(GLOB SDL1_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*")
foreach (SDL1_TOOL ${SDL1_TOOLS})
Expand Down
7 changes: 6 additions & 1 deletion scripts/cmake/vcpkg_fixup_pkgconfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,15 @@ function(vcpkg_fixup_pkgconfig_check_files pkg_cfg_cmd _file _config _system_lib
endif()

debug_message("IGNORED FLAGS:'${_ignore_flags}'")
debug_message("BEFORE IGNORE FLAGS REMOVAL: ${_pkg_libs_output}")
foreach(_ignore IN LISTS _ignore_flags) # Remove ignore with whitespace
string(REGEX REPLACE "[\t ]+${_ignore}([\t ]+|$)" "\\1" _pkg_libs_output "${_pkg_libs_output}")
debug_message("REMOVING FLAG:'${_ignore}'")
string(REGEX REPLACE "(^[\t ]*|;[\t ]*|[\t ]+)${_ignore}([\t ]+|[\t ]*;|[\t ]*$)" "\\2" _pkg_libs_output "${_pkg_libs_output}")
debug_message("AFTER REMOVAL: ${_pkg_libs_output}")
endforeach()

string(REGEX REPLACE ";?[\t ]*;[\t ]*" ";" _pkg_libs_output "${_pkg_libs_output}") # Double ;; and Whitespace before/after ; removal

debug_message("SYSTEM LIBRARIES:'${_system_libs}'")
debug_message("LIBRARIES in PC:'${_pkg_libs_output}'")
foreach(_system_lib IN LISTS _system_libs) # Remove system libs with whitespace
Expand Down

0 comments on commit 5ccacd4

Please sign in to comment.