diff --git a/ports/argtable2/CONTROL b/ports/argtable2/CONTROL new file mode 100644 index 0000000000..1d9b5bc0e1 --- /dev/null +++ b/ports/argtable2/CONTROL @@ -0,0 +1,3 @@ +Source: argtable2 +Version: 2.13-1 +Description: Argtable is an ANSI C library for parsing GNU style command line options with a minimum of fuss. diff --git a/ports/argtable2/fix-install-dirs.patch b/ports/argtable2/fix-install-dirs.patch new file mode 100644 index 0000000000..cc1b925433 --- /dev/null +++ b/ports/argtable2/fix-install-dirs.patch @@ -0,0 +1,24 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 3427487..a9b8be0 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -1,5 +1,4 @@ +-# for now, install in subdirectory of source directory by default +-SET( CMAKE_INSTALL_PREFIX .. ) ++include(GNUInstallDirs) + + IF( WIN32 ) + ADD_LIBRARY( argtable2 arg_dbl.c arg_end.c arg_file.c arg_int.c arg_lit.c arg_rem.c arg_str.c argtable2.c argtable2.h getopt.c getopt.h getopt1.c ) +@@ -7,5 +6,9 @@ ELSE( WIN32 ) + ADD_LIBRARY( argtable2 arg_date.c arg_dbl.c arg_end.c arg_file.c arg_int.c arg_lit.c arg_rem.c arg_rex.c arg_str.c argtable2.c argtable2.h getopt.c getopt.h getopt1.c ) + ENDIF( WIN32 ) + +-INSTALL( TARGETS argtable2 ARCHIVE DESTINATION lib) +-SET_TARGET_PROPERTIES( argtable2 PROPERTIES DEBUG_POSTFIX d ) +\ No newline at end of file ++INSTALL(TARGETS argtable2 ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++) ++INSTALL(FILES argtable2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/ports/argtable2/portfile.cmake b/ports/argtable2/portfile.cmake new file mode 100644 index 0000000000..6123335ab5 --- /dev/null +++ b/ports/argtable2/portfile.cmake @@ -0,0 +1,32 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/argtable2-13) +vcpkg_download_distfile(ARCHIVE + URLS "http://prdownloads.sourceforge.net/argtable/argtable2-13.tar.gz" + FILENAME "argtable-2.13.zip" + SHA512 3d8303f3ba529e3241d918c0127a16402ece951efb964d14a06a3a7d29a252812ad3c44e96da28798871e9923e73a2cfe7ebc84139c1397817d632cae25c4585 +) + +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-install-dirs.patch" +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + # Due to missing dllexport flags we export all symbols + -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE + -DCMAKE_DEBUG_POSTFIX=d +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +# Remove duplicate include installs +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/argtable2 RENAME copyright)