aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatoly Shirokov <anatoly.shirokov@gmail.com>2017-12-21 10:37:02 +0300
committerRobert Schumacher <roschuma@microsoft.com>2017-12-20 23:37:02 -0800
commita0b2767175c20dc446c22a9ce30ed1874d72acdf (patch)
tree949e386ab7cb0c35808e09addb40cdd0e501f8d6
parentd4b1d19912e919be3516e444331428916e1ff9f0 (diff)
downloadvcpkg-a0b2767175c20dc446c22a9ce30ed1874d72acdf.tar.gz
vcpkg-a0b2767175c20dc446c22a9ce30ed1874d72acdf.zip
Added port libqrencode - a fast and compact QR Code encoding library (#2372)
* https://github.com/Microsoft/vcpkg/issues/2363 * libqrencode: Added necessary new line at end of CONTROL, portfile.cmake, usage files. Added copying the usage file in portfile.cmake, and removed unnecessary DBUILD_SHARED_LIBS as remarked @ras0219-msft * [libqrencode] Adjust usage to match other packages
-rw-r--r--ports/libqrencode/CONTROL4
-rw-r--r--ports/libqrencode/portfile.cmake47
-rw-r--r--ports/libqrencode/remove-deprecated-attribute.patch16
-rw-r--r--ports/libqrencode/usage10
4 files changed, 77 insertions, 0 deletions
diff --git a/ports/libqrencode/CONTROL b/ports/libqrencode/CONTROL
new file mode 100644
index 000000000..0e96c99a9
--- /dev/null
+++ b/ports/libqrencode/CONTROL
@@ -0,0 +1,4 @@
+Source: libqrencode
+Version: 4.0.0-1
+Build-Depends: libpng, libiconv
+Description: libqrencode - a fast and compact QR Code encoding library
diff --git a/ports/libqrencode/portfile.cmake b/ports/libqrencode/portfile.cmake
new file mode 100644
index 000000000..ff0c2302b
--- /dev/null
+++ b/ports/libqrencode/portfile.cmake
@@ -0,0 +1,47 @@
+include(vcpkg_common_functions)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO fukuchi/libqrencode
+ REF v4.0.0
+ SHA512 0e4855c7983d4c73eb4a7f9cb081679547957c9f4a30cb943f2ae25e3a6496a202d3489f46e248386499d05a68c6a36e24f64af57ef4d6f447ef3a39e08374ee
+ HEAD_REF master
+)
+
+vcpkg_apply_patches(
+ SOURCE_PATH ${SOURCE_PATH}
+ PATCHES
+ ${CMAKE_CURRENT_LIST_DIR}/remove-deprecated-attribute.patch
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS
+ -DWITH_TOOLS=NO
+ -DWITH_TEST=NO
+ -DSKIP_INSTALL_PROGRAMS=ON
+ -DSKIP_INSTALL_EXECUTABLES=ON
+ -DSKIP_INSTALL_FILES=ON
+ OPTIONS_DEBUG
+ -DSKIP_INSTALL_HEADERS=ON
+)
+
+vcpkg_install_cmake()
+
+if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/qrencode.dll)
+ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin)
+ file(RENAME ${CURRENT_PACKAGES_DIR}/lib/qrencode.dll ${CURRENT_PACKAGES_DIR}/bin/qrencode.dll)
+endif()
+if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/qrencoded.dll)
+ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin)
+ file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/qrencoded.dll ${CURRENT_PACKAGES_DIR}/debug/bin/qrencoded.dll)
+endif()
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
+file(COPY ${CURRENT_BUILDTREES_DIR}/src/libqrencode-4.0.0/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libqrencode)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/libqrencode/COPYING ${CURRENT_PACKAGES_DIR}/share/libqrencode/copyright)
+
+vcpkg_copy_pdbs()
+
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
diff --git a/ports/libqrencode/remove-deprecated-attribute.patch b/ports/libqrencode/remove-deprecated-attribute.patch
new file mode 100644
index 000000000..1a00c3a3b
--- /dev/null
+++ b/ports/libqrencode/remove-deprecated-attribute.patch
@@ -0,0 +1,16 @@
+ qrencode.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/qrencode.h b/qrencode.h
+index b855f0a..a6d4a29 100644
+--- a/qrencode.h
++++ b/qrencode.h
+@@ -555,7 +555,7 @@ extern char *QRcode_APIVersionString(void);
+ /**
+ * @deprecated
+ */
+-extern void QRcode_clearCache(void) __attribute__ ((deprecated));
++extern void QRcode_clearCache(void);
+
+ #if defined(__cplusplus)
+ }
diff --git a/ports/libqrencode/usage b/ports/libqrencode/usage
new file mode 100644
index 000000000..f6003f4e3
--- /dev/null
+++ b/ports/libqrencode/usage
@@ -0,0 +1,10 @@
+To use libqrencode library in CMakeLists.txt:
+
+ find_path(QRENCODE_INCLUDE_DIR NAMES qrencode.h)
+ find_library(QRENCODE_LIBRARY_RELEASE qrencode)
+ find_library(QRENCODE_LIBRARY_DEBUG qrencoded)
+ set(QRENCODE_LIBRARIES optimized ${QRENCODE_LIBRARY_RELEASE} debug ${QRENCODE_LIBRARY_DEBUG})
+
+ add_executable(main main.cpp)
+ target_include_directories(main PRIVATE ${QRENCODE_INCLUDE_DIR})
+ target_link_libraries(main PRIVATE ${QRENCODE_LIBRARIES})