aboutsummaryrefslogtreecommitdiff
path: root/ports/libmysql/portfile.cmake
diff options
context:
space:
mode:
authorsdcb <sdflysha@qq.com>2016-10-14 17:50:23 +0800
committersdcb <sdflysha@qq.com>2016-10-14 17:50:23 +0800
commit97c6bfc021ddfe977c1c4d2a8a604b89c81ad4fc (patch)
tree71721dfa12af45b003d2e0d6627486c62c006506 /ports/libmysql/portfile.cmake
parent1c5798197673092ccd95556c2b72f51c7572954e (diff)
downloadvcpkg-97c6bfc021ddfe977c1c4d2a8a604b89c81ad4fc.tar.gz
vcpkg-97c6bfc021ddfe977c1c4d2a8a604b89c81ad4fc.zip
Add libmysql
Diffstat (limited to 'ports/libmysql/portfile.cmake')
-rw-r--r--ports/libmysql/portfile.cmake56
1 files changed, 56 insertions, 0 deletions
diff --git a/ports/libmysql/portfile.cmake b/ports/libmysql/portfile.cmake
new file mode 100644
index 000000000..0f2c16b90
--- /dev/null
+++ b/ports/libmysql/portfile.cmake
@@ -0,0 +1,56 @@
+include(${CMAKE_TRIPLET_FILE})
+include(vcpkg_common_functions)
+set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mysql-server-mysql-5.7.16)
+
+vcpkg_download_distfile(ARCHIVE
+ URLS "https://github.com/mysql/mysql-server/archive/mysql-5.7.16.tar.gz"
+ FILENAME "mysql-server-mysql-5.7.16.tar.gz"
+ SHA512 30a3c55ebb15f18ededf814b66c108f18b2ced9c39e08319cdc9559ccf38d494ad9322098f2b04418ddf557e46d9d727be0e514be0ae982ac4f5186aa295b9c6
+)
+vcpkg_extract_source_archive(${ARCHIVE})
+
+vcpkg_apply_patches(
+ SOURCE_PATH ${SOURCE_PATH}
+ PATCHES
+ ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+)
+
+vcpkg_install_cmake()
+
+# delete debug headers
+file(REMOVE_RECURSE
+ ${CURRENT_PACKAGES_DIR}/debug/include)
+
+# delete useless vcruntime/scripts/bin/msg file
+file(REMOVE_RECURSE
+ ${CURRENT_PACKAGES_DIR}/share
+ ${CURRENT_PACKAGES_DIR}/debug/share
+ ${CURRENT_PACKAGES_DIR}/bin
+ ${CURRENT_PACKAGES_DIR}/debug/bin)
+
+file(MAKE_DIRECTORY
+ ${CURRENT_PACKAGES_DIR}/share
+ ${CURRENT_PACKAGES_DIR}/debug/share
+ ${CURRENT_PACKAGES_DIR}/bin
+ ${CURRENT_PACKAGES_DIR}/debug/bin)
+
+# remove misc files
+file(REMOVE
+ ${CURRENT_PACKAGES_DIR}/COPYING
+ ${CURRENT_PACKAGES_DIR}/my-default.ini
+ ${CURRENT_PACKAGES_DIR}/README
+ ${CURRENT_PACKAGES_DIR}/debug/COPYING
+ ${CURRENT_PACKAGES_DIR}/debug/my-default.ini
+ ${CURRENT_PACKAGES_DIR}/debug/README)
+
+# correct the dll directory
+file (RENAME ${CURRENT_PACKAGES_DIR}/lib/libmysql.dll ${CURRENT_PACKAGES_DIR}/bin/libmysql.dll)
+file (RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.dll ${CURRENT_PACKAGES_DIR}/debug/libmysql.dll)
+
+# copy license
+file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmysql)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/libmysql/COPYING ${CURRENT_PACKAGES_DIR}/share/libmysql/copyright) \ No newline at end of file