Skip to content

Commit

Permalink
[glib/gts] Add pkgconfig files (microsoft#11884)
Browse files Browse the repository at this point in the history
* [glib/gts] Add pkgconfig files

* Update the patch

* Update ports/glib/CMakeLists.txt
  • Loading branch information
PhoebeHui authored Jun 12, 2020
1 parent d690c9b commit df99d8d
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 6 deletions.
32 changes: 32 additions & 0 deletions ports/glib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -360,3 +360,35 @@ message(STATUS " " ${ICONV_LIBRARY})
message(STATUS " " ${CHARSET_LIBRARY})
message(STATUS " " ${FFI_LIBRARY})
message(STATUS " " ${LIBINTL_LIBRARY})

set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
set(libdir ${CMAKE_INSTALL_PREFIX}/lib)
set(includedir ${CMAKE_INSTALL_PREFIX}/include)

configure_file("${CMAKE_CURRENT_SOURCE_DIR}/glib-2.0.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/glib-2.0.pc" @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/gobject-2.0.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/gobject-2.0.pc" @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/gmodule-2.0.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/gmodule-2.0.pc" @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/gmodule-export-2.0.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/gmodule-export-2.0.pc" @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/gmodule-no-export-2.0.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/gmodule-no-export-2.0.pc" @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/gthread-2.0.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/gthread-2.0.pc" @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/gio-2.0.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/gio-2.0.pc" @ONLY)

install(FILES "${CMAKE_CURRENT_BINARY_DIR}/glib-2.0.pc"
"${CMAKE_CURRENT_BINARY_DIR}/gobject-2.0.pc"
"${CMAKE_CURRENT_BINARY_DIR}/gmodule-2.0.pc"
"${CMAKE_CURRENT_BINARY_DIR}/gmodule-export-2.0.pc"
"${CMAKE_CURRENT_BINARY_DIR}/gmodule-no-export-2.0.pc"
"${CMAKE_CURRENT_BINARY_DIR}/gthread-2.0.pc"
"${CMAKE_CURRENT_BINARY_DIR}/gio-2.0.pc"
DESTINATION lib/pkgconfig)

if(WIN32)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/gio-windows-2.0.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/gio-windows-2.0.pc" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/gio-windows-2.0.pc" DESTINATION lib/pkgconfig)
endif()

if(UNIX)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/gio-unix-2.0.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/gio-unix-2.0.pc" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/gio-unix-2.0.pc" DESTINATION lib/pkgconfig)
endif()
2 changes: 1 addition & 1 deletion ports/glib/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: glib
Version: 2.52.3-14-6
Version: 2.52.3-14-7
Homepage: https://developer.gnome.org/glib/
Description: Portable, general-purpose utility library.
Build-Depends: zlib, pcre, libffi, gettext, libiconv
Expand Down
4 changes: 3 additions & 1 deletion ports/glib/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ vcpkg_extract_source_archive_ex(
fix-arm-builds.patch
)

file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
configure_file(${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt ${SOURCE_PATH}/CMakeLists.txt COPYONLY)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/cmake DESTINATION ${SOURCE_PATH})
file(REMOVE_RECURSE ${SOURCE_PATH}/glib/pcre)
file(WRITE ${SOURCE_PATH}/glib/pcre/Makefile.in)
Expand Down Expand Up @@ -54,4 +54,6 @@ vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

vcpkg_fixup_pkgconfig()

file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
2 changes: 1 addition & 1 deletion ports/gts/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: gts
Version: 0.7.6-2
Version: 0.7.6-3
Homepage: https://github.com/finetjul/gts
Description: A Library intended to provide a set of useful functions to deal with 3D surfaces meshed with interconnected triangles
Build-Depends: glib
28 changes: 28 additions & 0 deletions ports/gts/fix-pkgconfig.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f458c35..8035507 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -124,3 +124,11 @@ INSTALL(FILES
src/gtsconfig.h
DESTINATION include COMPONENT Development
)
+
+set(prefix ${CMAKE_INSTALL_PREFIX})
+set(exec_prefix ${CMAKE_INSTALL_PREFIX})
+set(libdir ${CMAKE_INSTALL_PREFIX}/lib)
+set(includedir ${CMAKE_INSTALL_PREFIX}/include)
+
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/gts.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/gts.pc" @ONLY)
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/gts.pc" DESTINATION lib/pkgconfig)
\ No newline at end of file
diff --git a/gts.pc.in b/gts.pc.in
index 39626d7..bcd4014 100644
--- a/gts.pc.in
+++ b/gts.pc.in
@@ -7,5 +7,5 @@ Name: GTS
Description: GNU Triangulated Surface Library
Version: @VERSION@
Requires: glib-2.0,gthread-2.0,gmodule-2.0
-Libs: -L${libdir} @LIBS@ -lgts -lm
+Libs: -L${libdir} @LIBS@ -lgts
Cflags: -I${includedir}
7 changes: 4 additions & 3 deletions ports/gts/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ vcpkg_from_github(
PATCHES
fix-M_PI-in-windows.patch
support-unix.patch
fix-pkgconfig.patch
)

vcpkg_configure_cmake(
Expand All @@ -19,7 +20,7 @@ vcpkg_install_cmake()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

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

vcpkg_fixup_pkgconfig()
vcpkg_copy_pdbs()

file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

0 comments on commit df99d8d

Please sign in to comment.