diff options
| author | Joshua Helm <jhelm@simpfony.com> | 2017-04-27 11:12:00 -0400 |
|---|---|---|
| committer | Joshua Helm <jhelm@simpfony.com> | 2017-04-27 11:12:00 -0400 |
| commit | e7aadfa21683555afea72e0b057ea47fea0cc444 (patch) | |
| tree | b68d1ce1680084fc35f5ed740acfc23329d6ef90 | |
| parent | 0bc49876445ac4198c3e1f7207baa7924da9aaac (diff) | |
| download | vcpkg-e7aadfa21683555afea72e0b057ea47fea0cc444.tar.gz vcpkg-e7aadfa21683555afea72e0b057ea47fea0cc444.zip | |
add ports/taglib
| -rw-r--r-- | ports/taglib/CONTROL | 4 | ||||
| -rw-r--r-- | ports/taglib/copyright | 24 | ||||
| -rw-r--r-- | ports/taglib/ignore_c4996_error.patch | 16 | ||||
| -rw-r--r-- | ports/taglib/portfile.cmake | 41 | ||||
| -rw-r--r-- | ports/taglib/replace_non-uwp_functions.patch | 29 |
5 files changed, 114 insertions, 0 deletions
diff --git a/ports/taglib/CONTROL b/ports/taglib/CONTROL new file mode 100644 index 000000000..05686de09 --- /dev/null +++ b/ports/taglib/CONTROL @@ -0,0 +1,4 @@ +Source: taglib +Version: 1.11.1 +Description: TagLib Audio Meta-Data Library +Build-Depends: zlib
\ No newline at end of file diff --git a/ports/taglib/copyright b/ports/taglib/copyright new file mode 100644 index 000000000..adbf9ecff --- /dev/null +++ b/ports/taglib/copyright @@ -0,0 +1,24 @@ +/*************************************************************************** + copyright : (C) 2002 - 2008 by Scott Wheeler + email : wheeler@kde.org + ***************************************************************************/ + +/*************************************************************************** + * This library is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License version * + * 2.1 as published by the Free Software Foundation. * + * * + * This library is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * + * 02110-1301 USA * + * * + * Alternatively, this file is available under the Mozilla Public * + * License Version 1.1. You may obtain a copy of the License at * + * http://www.mozilla.org/MPL/ * + ***************************************************************************/
\ No newline at end of file diff --git a/ports/taglib/ignore_c4996_error.patch b/ports/taglib/ignore_c4996_error.patch new file mode 100644 index 000000000..1990b4730 --- /dev/null +++ b/ports/taglib/ignore_c4996_error.patch @@ -0,0 +1,16 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a59efc9..8ac3266 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -64,6 +64,11 @@ if(MSVC AND ENABLE_STATIC_RUNTIME) + endforeach(flag_var) + endif() + ++# disable error on usage of vsprintf() for UWP builds ++if(MSVC) ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996") ++endif() ++ + # Read version information from file taglib/toolkit/taglib.h into variables + # TAGLIB_LIB_MAJOR_VERSION, TAGLIB_LIB_MINOR_VERSION, TAGLIB_LIB_PATCH_VERSION. + foreach(version_part MAJOR MINOR PATCH) diff --git a/ports/taglib/portfile.cmake b/ports/taglib/portfile.cmake new file mode 100644 index 000000000..98bc8c3d9 --- /dev/null +++ b/ports/taglib/portfile.cmake @@ -0,0 +1,41 @@ +# taglib + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/taglib-1.11.1) +vcpkg_download_distfile(ARCHIVE + URLS "http://taglib.org/releases/taglib-1.11.1.tar.gz" + FILENAME "taglib-1.11.1.tar.gz" + SHA512 7846775c4954ea948fe4383e514ba7c11f55d038ee06b6ea5a0a1c1069044b348026e76b27aa4ba1c71539aa8143e1401fab39184cc6e915ba0ae2c06133cb98 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +#patches for UWP +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) + vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/ignore_c4996_error.patch + ${CMAKE_CURRENT_LIST_DIR}/replace_non-uwp_functions.patch + ) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 + # OPTIONS_RELEASE -DOPTIMIZE=1 + # OPTIONS_DEBUG -DDEBUGGABLE=1 +) + +vcpkg_install_cmake() + +# remove the debug/include files +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# copyright file +file(COPY ${CURRENT_PORT_DIR}/copyright DESTINATION ${CURRENT_PACKAGES_DIR}/share/taglib) + +# remove bin directory for static builds (taglib creates a cmake batch file there) +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() diff --git a/ports/taglib/replace_non-uwp_functions.patch b/ports/taglib/replace_non-uwp_functions.patch new file mode 100644 index 000000000..5f01672d5 --- /dev/null +++ b/ports/taglib/replace_non-uwp_functions.patch @@ -0,0 +1,29 @@ +diff --git a/taglib/toolkit/tfilestream.cpp b/taglib/toolkit/tfilestream.cpp +index 5205bae..b267aaa 100644 +--- a/taglib/toolkit/tfilestream.cpp ++++ b/taglib/toolkit/tfilestream.cpp +@@ -52,9 +52,9 @@ namespace + const DWORD access = readOnly ? GENERIC_READ : (GENERIC_READ | GENERIC_WRITE); + + if(!path.wstr().empty()) +- return CreateFileW(path.wstr().c_str(), access, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); ++ return CreateFile2(path.wstr().c_str(), access, FILE_SHARE_READ, OPEN_EXISTING, NULL); + else if(!path.str().empty()) +- return CreateFileA(path.str().c_str(), access, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); ++ return CreateFile2(std::wstring(path.str().cbegin(), path.str().end()).c_str(), access, FILE_SHARE_READ, OPEN_EXISTING, NULL); + else + return InvalidFileHandle; + } +@@ -437,9 +437,10 @@ long FileStream::length() + #ifdef _WIN32 + + SetLastError(NO_ERROR); +- const DWORD fileSize = GetFileSize(d->file, NULL); ++ LARGE_INTEGER fileSize; ++ GetFileSizeEx(d->file, &fileSize); + if(GetLastError() == NO_ERROR) { +- return static_cast<long>(fileSize); ++ return fileSize.QuadPart; + } + else { + debug("FileStream::length() -- Failed to get the file size."); |
