From 93be327ca2230958b8d9f738dcddd8dd70276cf0 Mon Sep 17 00:00:00 2001 From: kiwixz Date: Tue, 9 Oct 2018 09:20:29 +0100 Subject: [PATCH] [tinyfiledialogs] initial release (#4416) * tinyfiledialogs * [tinyfiledialogs] Download loose files instead of tarball --- ports/tinyfiledialogs/CMakeLists.txt | 11 +++++++++ ports/tinyfiledialogs/CONTROL | 3 +++ ports/tinyfiledialogs/portfile.cmake | 37 ++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 ports/tinyfiledialogs/CMakeLists.txt create mode 100644 ports/tinyfiledialogs/CONTROL create mode 100644 ports/tinyfiledialogs/portfile.cmake diff --git a/ports/tinyfiledialogs/CMakeLists.txt b/ports/tinyfiledialogs/CMakeLists.txt new file mode 100644 index 0000000000..4adabaf9a5 --- /dev/null +++ b/ports/tinyfiledialogs/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.4) +project(tinyfiledialogs C) + +add_library(tinyfiledialogs tinyfiledialogs.c) + +install( + TARGETS tinyfiledialogs + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) diff --git a/ports/tinyfiledialogs/CONTROL b/ports/tinyfiledialogs/CONTROL new file mode 100644 index 0000000000..bb3a2ff33b --- /dev/null +++ b/ports/tinyfiledialogs/CONTROL @@ -0,0 +1,3 @@ +Source: tinyfiledialogs +Version: 3.3.7-1 +Description: Highly portable and cross-platform dialogs for native inputbox, passwordbox, colorpicker and more diff --git a/ports/tinyfiledialogs/portfile.cmake b/ports/tinyfiledialogs/portfile.cmake new file mode 100644 index 0000000000..66f1735a88 --- /dev/null +++ b/ports/tinyfiledialogs/portfile.cmake @@ -0,0 +1,37 @@ +include(vcpkg_common_functions) + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +set(SHA 03d35a86696859128d41f8b967c1ef3e39c980ce) + +vcpkg_download_distfile(HEADERFILE + URLS "https://sourceforge.net/p/tinyfiledialogs/code/ci/${SHA}/tree/tinyfiledialogs.h?format=raw" + FILENAME "tinyfiledialogs-h-${SHA}" + SHA512 e3503165bcbb665c2f09c19591f28eba63e50b8d20fd4e65f31ec6a33742879c007aa7402cfd429ff92a2847534f0f0cc1b979954372be0c6578d49ed5f3e18d +) +vcpkg_download_distfile(SOURCEFILE + URLS "https://sourceforge.net/p/tinyfiledialogs/code/ci/${SHA}/tree/tinyfiledialogs.c?format=raw" + FILENAME "tinyfiledialogs-c-${SHA}" + SHA512 263a9fcd11af3dcfd3cd7b6cfaad216cfdd94925639e613d43e7a2dbae2b4387fe8182cd72401e19b2891a08809bc68caece341df28e91b5894cc4b9ecd157f4 +) + +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SHA}) + +configure_file(${HEADERFILE} ${SOURCE_PATH}/tinyfiledialogs.h COPYONLY) +configure_file(${SOURCEFILE} ${SOURCE_PATH}/tinyfiledialogs.c COPYONLY) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +configure_file(${HEADERFILE} ${CURRENT_PACKAGES_DIR}/include/tinyfiledialogs.h COPYONLY) + +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/tinyfiledialogs) +file(READ ${HEADERFILE} _contents) +string(SUBSTRING "${_contents}" 0 1024 _contents) +file(WRITE ${CURRENT_PACKAGES_DIR}/share/tinyfiledialogs/copyright "${_contents}")