aboutsummaryrefslogtreecommitdiff
path: root/ports/libpng
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2016-09-18 20:50:08 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2016-09-18 20:54:03 -0700
commitccca198c1b1730b0241911cb56dc8e3504958b2a (patch)
treea2dd9b8b087a09afdcecc5cbb3377bed15127eb2 /ports/libpng
downloadvcpkg-ccca198c1b1730b0241911cb56dc8e3504958b2a.tar.gz
vcpkg-ccca198c1b1730b0241911cb56dc8e3504958b2a.zip
Initial commit
Diffstat (limited to 'ports/libpng')
-rw-r--r--ports/libpng/CONTROL4
-rw-r--r--ports/libpng/portfile.cmake47
-rw-r--r--ports/libpng/use-abort-on-all-platforms.patch17
3 files changed, 68 insertions, 0 deletions
diff --git a/ports/libpng/CONTROL b/ports/libpng/CONTROL
new file mode 100644
index 000000000..239fa0cb2
--- /dev/null
+++ b/ports/libpng/CONTROL
@@ -0,0 +1,4 @@
+Source: libpng
+Version: 1.6.24-1
+Build-Depends: zlib
+Description: libpng is a library implementing an interface for reading and writing PNG (Portable Network Graphics) format files. \ No newline at end of file
diff --git a/ports/libpng/portfile.cmake b/ports/libpng/portfile.cmake
new file mode 100644
index 000000000..a5e506585
--- /dev/null
+++ b/ports/libpng/portfile.cmake
@@ -0,0 +1,47 @@
+include(vcpkg_common_functions)
+vcpkg_download_distfile(ARCHIVE
+ URL "http://download.sourceforge.net/libpng/libpng-1.6.24.tar.xz"
+ FILENAME "libpng-1.6.24.tar.xz"
+ MD5 ffcdbd549814787fa8010c372e35ff25
+)
+vcpkg_extract_source_archive(${ARCHIVE})
+
+find_program(GIT git)
+vcpkg_execute_required_process(
+ COMMAND ${GIT} init
+ WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src/libpng-1.6.24
+ LOGNAME git-init
+)
+execute_process(
+ COMMAND ${GIT} apply "${CMAKE_CURRENT_LIST_DIR}/use-abort-on-all-platforms.patch" --ignore-whitespace --whitespace=nowarn
+ WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src/libpng-1.6.24
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libpng-1.6.24
+ OPTIONS
+ -DPNG_STATIC=OFF
+ -DPNG_TESTS=OFF
+ -DSKIP_INSTALL_PROGRAMS=ON
+ -DSKIP_INSTALL_EXECUTABLES=ON
+ -DSKIP_INSTALL_FILES=ON
+ OPTIONS_DEBUG
+ -DSKIP_INSTALL_HEADERS=ON
+)
+
+vcpkg_build_cmake()
+vcpkg_install_cmake()
+
+file(REMOVE_RECURSE
+ ${CURRENT_PACKAGES_DIR}/debug/share
+)
+file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share)
+file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libpng ${CURRENT_PACKAGES_DIR}/share/libpng)
+file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libpng/libpng16-debug.cmake ${CURRENT_PACKAGES_DIR}/share/libpng/libpng16-debug.cmake)
+file(REMOVE_RECURSE
+ ${CURRENT_PACKAGES_DIR}/debug/lib/libpng
+)
+file(COPY ${CURRENT_BUILDTREES_DIR}/src/libpng-1.6.24/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libpng)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/libpng/LICENSE ${CURRENT_PACKAGES_DIR}/share/libpng/copyright)
+vcpkg_copy_pdbs()
+
diff --git a/ports/libpng/use-abort-on-all-platforms.patch b/ports/libpng/use-abort-on-all-platforms.patch
new file mode 100644
index 000000000..0a629e059
--- /dev/null
+++ b/ports/libpng/use-abort-on-all-platforms.patch
@@ -0,0 +1,17 @@
+diff --git a/pngpriv.h b/pngpriv.h
+index fe3355d..5a049b5 100644
+--- a/pngpriv.h
++++ b/pngpriv.h
+@@ -457,11 +457,7 @@
+
+ /* Memory model/platform independent fns */
+ #ifndef PNG_ABORT
+-# ifdef _WINDOWS_
+-# define PNG_ABORT() ExitProcess(0)
+-# else
+-# define PNG_ABORT() abort()
+-# endif
++# define PNG_ABORT() abort()
+ #endif
+
+ /* These macros may need to be architecture dependent. */