aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Karatarakis <alex@karatarakis.com>2017-05-01 02:04:14 -0700
committerGitHub <noreply@github.com>2017-05-01 02:04:14 -0700
commit50433c2a7c6a9fed8f81574cb500729f3cc7ee48 (patch)
tree8a7453b7b7e2f511aaa23f3a7b0e4b31f11506cd
parent58fda0a5faa3d1e82239cb5eeb8ab65f495f85f3 (diff)
parent99efc9c21656883332910f0204a5cea3052010bb (diff)
downloadvcpkg-50433c2a7c6a9fed8f81574cb500729f3cc7ee48.tar.gz
vcpkg-50433c2a7c6a9fed8f81574cb500729f3cc7ee48.zip
Merge pull request #993 from trazme/add-giflib
giflib port
-rw-r--r--ports/giflib/CMakeLists.txt33
-rw-r--r--ports/giflib/CONTROL3
-rw-r--r--ports/giflib/msvc-guard-unistd-h.patch52
-rw-r--r--ports/giflib/portfile.cmake26
4 files changed, 114 insertions, 0 deletions
diff --git a/ports/giflib/CMakeLists.txt b/ports/giflib/CMakeLists.txt
new file mode 100644
index 000000000..e9b6a17c6
--- /dev/null
+++ b/ports/giflib/CMakeLists.txt
@@ -0,0 +1,33 @@
+cmake_minimum_required(VERSION 3.4)
+
+project(giflib)
+
+set(GIFLIB_HEADERS
+ lib/gif_lib.h
+)
+
+set(GIFLIB_SOURCES
+ lib/dgif_lib.c
+ lib/egif_lib.c
+ lib/gif_err.c
+ lib/gif_font.c
+ lib/gif_hash.c
+ lib/gifalloc.c
+ lib/openbsd-reallocarray.c
+ lib/quantize.c
+)
+
+add_library(gif ${GIFLIB_SOURCES})
+if (BUILD_SHARED_LIBS)
+ set_property(TARGET gif PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS ON)
+endif ()
+
+if (NOT GIFLIB_SKIP_HEADERS)
+ install(FILES ${GIFLIB_HEADERS} DESTINATION include)
+endif ()
+
+install(TARGETS gif
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+)
diff --git a/ports/giflib/CONTROL b/ports/giflib/CONTROL
new file mode 100644
index 000000000..abac8f1cf
--- /dev/null
+++ b/ports/giflib/CONTROL
@@ -0,0 +1,3 @@
+Source: giflib
+Version: 5.1.4
+Description: A library for reading and writing gif images.
diff --git a/ports/giflib/msvc-guard-unistd-h.patch b/ports/giflib/msvc-guard-unistd-h.patch
new file mode 100644
index 000000000..5140e6ee3
--- /dev/null
+++ b/ports/giflib/msvc-guard-unistd-h.patch
@@ -0,0 +1,52 @@
+diff -Naur a/lib/dgif_lib.c b/lib/dgif_lib.c
+--- a/lib/dgif_lib.c 2016-04-02 21:34:00.000000000 +0600
++++ b/lib/dgif_lib.c 2017-04-21 07:06:48.781271400 +0700
+@@ -12,7 +12,9 @@
+ #include <limits.h>
+ #include <stdint.h>
+ #include <fcntl.h>
++#ifndef _MSC_VER
+ #include <unistd.h>
++#endif
+ #include <stdio.h>
+ #include <string.h>
+
+diff -Naur a/lib/egif_lib.c b/lib/egif_lib.c
+--- a/lib/egif_lib.c 2016-01-22 16:36:36.000000000 +0600
++++ b/lib/egif_lib.c 2017-04-21 07:07:08.728159900 +0700
+@@ -8,7 +8,9 @@
+
+ *****************************************************************************/
+
++#ifndef _MSC_VER
+ #include <unistd.h>
++#endif
+ #include <stdint.h>
+ #include <stdlib.h>
+ #include <stdio.h>
+diff -Naur a/lib/gif_hash.c b/lib/gif_hash.c
+--- a/lib/gif_hash.c 2014-05-16 17:46:53.000000000 +0700
++++ b/lib/gif_hash.c 2017-04-21 07:07:17.718719500 +0700
+@@ -11,7 +11,9 @@
+
+ *****************************************************************************/
+
++#ifndef _MSC_VER
+ #include <unistd.h>
++#endif
+ #include <stdint.h>
+ #include <stdlib.h>
+ #include <fcntl.h>
+diff -Naur a/lib/gif_hash.h b/lib/gif_hash.h
+--- a/lib/gif_hash.h 2014-05-16 17:46:53.000000000 +0700
++++ b/lib/gif_hash.h 2017-04-21 07:07:32.316346800 +0700
+@@ -7,7 +7,9 @@
+ #ifndef _GIF_HASH_H_
+ #define _GIF_HASH_H_
+
++#ifndef _MSC_VER
+ #include <unistd.h>
++#endif
+ #include <stdint.h>
+
+ #define HT_SIZE 8192 /* 12bits = 4096 or twice as big! */
diff --git a/ports/giflib/portfile.cmake b/ports/giflib/portfile.cmake
new file mode 100644
index 000000000..ee7f96449
--- /dev/null
+++ b/ports/giflib/portfile.cmake
@@ -0,0 +1,26 @@
+include(vcpkg_common_functions)
+set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/giflib-5.1.4)
+vcpkg_download_distfile(ARCHIVE
+ URLS "http://downloads.sourceforge.net/sourceforge/giflib/giflib-5.1.4.tar.bz2"
+ FILENAME "giflib-5.1.4.tar.bz2"
+ SHA512 32b5e342056c210e6478e9cb3b6ceec9594dcfaf34feea1eb4dad633a081ed4465bceee578c19165907cb47cb83912ac359ceea666a8e07dbbb5420f9928f96d
+)
+vcpkg_extract_source_archive(${ARCHIVE})
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+
+vcpkg_apply_patches(
+ SOURCE_PATH ${SOURCE_PATH}
+ PATCHES
+ ${CMAKE_CURRENT_LIST_DIR}/msvc-guard-unistd-h.patch
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ OPTIONS_DEBUG
+ -DGIFLIB_SKIP_HEADERS=ON
+)
+
+vcpkg_install_cmake()
+vcpkg_copy_pdbs()
+
+file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/giflib RENAME copyright)