Skip to content

Commit ab89885

Browse files
authored
x-add-version: Check that port-version is the next integer (#1495)
1 parent 48946f6 commit ab89885

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+760
-142
lines changed

azure-pipelines/e2e-ports/version-files/default-baseline-2/vcpkg.json

Lines changed: 0 additions & 8 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
diff --git a/zconf.h.cmakein b/zconf.h.cmakein
2+
index a7f24cc..a1b359b 100644
3+
--- a/zconf.h.cmakein
4+
+++ b/zconf.h.cmakein
5+
@@ -434,11 +434,19 @@ typedef uLong FAR uLongf;
6+
#endif
7+
8+
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
9+
-# define Z_HAVE_UNISTD_H
10+
+# if ~(~HAVE_UNISTD_H + 0) == 0 && ~(~HAVE_UNISTD_H + 1) == 1
11+
+# define Z_HAVE_UNISTD_H
12+
+# elif HAVE_UNISTD_H != 0
13+
+# define Z_HAVE_UNISTD_H
14+
+# endif
15+
#endif
16+
17+
#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
18+
-# define Z_HAVE_STDARG_H
19+
+# if ~(~HAVE_STDARG_H + 0) == 0 && ~(~HAVE_STDARG_H + 1) == 1
20+
+# define Z_HAVE_STDARG_H
21+
+# elif HAVE_STDARG_H != 0
22+
+# define Z_HAVE_STDARG_H
23+
+# endif
24+
#endif
25+
26+
#ifdef STDC
27+
diff --git a/zconf.h.in b/zconf.h.in
28+
index 5e1d68a..32f53c8 100644
29+
--- a/zconf.h.in
30+
+++ b/zconf.h.in
31+
@@ -432,11 +432,19 @@ typedef uLong FAR uLongf;
32+
#endif
33+
34+
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
35+
-# define Z_HAVE_UNISTD_H
36+
+# if ~(~HAVE_UNISTD_H + 0) == 0 && ~(~HAVE_UNISTD_H + 1) == 1
37+
+# define Z_HAVE_UNISTD_H
38+
+# elif HAVE_UNISTD_H != 0
39+
+# define Z_HAVE_UNISTD_H
40+
+# endif
41+
#endif
42+
43+
#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
44+
-# define Z_HAVE_STDARG_H
45+
+# if ~(~HAVE_STDARG_H + 0) == 0 && ~(~HAVE_STDARG_H + 1) == 1
46+
+# define Z_HAVE_STDARG_H
47+
+# elif HAVE_STDARG_H != 0
48+
+# define Z_HAVE_STDARG_H
49+
+# endif
50+
#endif
51+
52+
#ifdef STDC
53+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Source: zlib
2+
Version: 1.2.11
3+
Port-Version: 8
4+
Homepage: https://www.zlib.net/
5+
Description: A compression library
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
2+
3+
This software is provided 'as-is', without any express or implied
4+
warranty. In no event will the authors be held liable for any damages
5+
arising from the use of this software.
6+
7+
Permission is granted to anyone to use this software for any purpose,
8+
including commercial applications, and to alter it and redistribute it
9+
freely, subject to the following restrictions:
10+
11+
1. The origin of this software must not be misrepresented; you must not
12+
claim that you wrote the original software. If you use this software
13+
in a product, an acknowledgment in the product documentation would be
14+
appreciated but is not required.
15+
2. Altered source versions must be plainly marked as such, and must not be
16+
misrepresented as being the original software.
17+
3. This notice may not be removed or altered from any source distribution.
18+
19+
Jean-loup Gailly Mark Adler
20+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 0fe939d..e4fc213 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -59,7 +59,7 @@ endif()
6+
#
7+
check_include_file(unistd.h Z_HAVE_UNISTD_H)
8+
9+
-if(MSVC)
10+
+if(WIN32)
11+
set(CMAKE_DEBUG_POSTFIX "d")
12+
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
13+
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 0fe939d..a1291d5 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -7,6 +7,7 @@ set(VERSION "1.2.11")
6+
7+
option(ASM686 "Enable building i686 assembly implementation")
8+
option(AMD64 "Enable building amd64 assembly implementation")
9+
+option(SKIP_BUILD_EXAMPLES "Skip build of the examples" OFF)
10+
11+
set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
12+
set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")
13+
@@ -124,9 +125,11 @@ set(ZLIB_SRCS
14+
)
15+
16+
if(NOT MINGW)
17+
- set(ZLIB_DLL_SRCS
18+
- win32/zlib1.rc # If present will override custom build rule below.
19+
- )
20+
+ if(BUILD_SHARED_LIBS)
21+
+ set(ZLIB_DLL_SRCS
22+
+ win32/zlib1.rc # If present will override custom build rule below.
23+
+ )
24+
+ endif()
25+
endif()
26+
27+
if(CMAKE_COMPILER_IS_GNUCC)
28+
@@ -180,11 +183,12 @@ if(MINGW)
29+
-I ${CMAKE_CURRENT_BINARY_DIR}
30+
-o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
31+
-i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc)
32+
- set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
33+
+ if(BUILD_SHARED_LIBS)
34+
+ set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
35+
+ endif()
36+
endif(MINGW)
37+
38+
-add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
39+
-add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
40+
+add_library(zlib ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
41+
set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
42+
set_target_properties(zlib PROPERTIES SOVERSION 1)
43+
44+
@@ -201,7 +205,7 @@ endif()
45+
46+
if(UNIX)
47+
# On unix-like platforms the library is almost always called libz
48+
- set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z)
49+
+ set_target_properties(zlib PROPERTIES OUTPUT_NAME z)
50+
if(NOT APPLE)
51+
set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
52+
endif()
53+
@@ -211,7 +215,7 @@ elseif(BUILD_SHARED_LIBS AND WIN32)
54+
endif()
55+
56+
if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
57+
- install(TARGETS zlib zlibstatic
58+
+ install(TARGETS zlib
59+
RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
60+
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
61+
LIBRARY DESTINATION "${INSTALL_LIB_DIR}" )
62+
@@ -230,6 +234,7 @@ endif()
63+
# Example binaries
64+
#============================================================================
65+
66+
+if (NOT SKIP_BUILD_EXAMPLES)
67+
add_executable(example test/example.c)
68+
target_link_libraries(example zlib)
69+
add_test(example example)
70+
@@ -247,3 +252,4 @@ if(HAVE_OFF64_T)
71+
target_link_libraries(minigzip64 zlib)
72+
set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
73+
endif()
74+
+endif()
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
set(VERSION 1.2.11)
2+
3+
vcpkg_download_distfile(ARCHIVE_FILE
4+
URLS "http://www.zlib.net/zlib-${VERSION}.tar.gz" "https://downloads.sourceforge.net/project/libpng/zlib/${VERSION}/zlib-${VERSION}.tar.gz"
5+
FILENAME "zlib1211.tar.gz"
6+
SHA512 73fd3fff4adeccd4894084c15ddac89890cd10ef105dd5e1835e1e9bbb6a49ff229713bd197d203edfa17c2727700fce65a2a235f07568212d820dca88b528ae
7+
)
8+
9+
vcpkg_extract_source_archive_ex(
10+
OUT_SOURCE_PATH SOURCE_PATH
11+
ARCHIVE ${ARCHIVE_FILE}
12+
REF ${VERSION}
13+
PATCHES
14+
"cmake_dont_build_more_than_needed.patch"
15+
"0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch"
16+
"add_debug_postfix_on_mingw.patch"
17+
)
18+
19+
# This is generated during the cmake build
20+
file(REMOVE ${SOURCE_PATH}/zconf.h)
21+
22+
vcpkg_configure_cmake(
23+
SOURCE_PATH ${SOURCE_PATH}
24+
PREFER_NINJA
25+
OPTIONS
26+
-DSKIP_INSTALL_FILES=ON
27+
-DSKIP_BUILD_EXAMPLES=ON
28+
OPTIONS_DEBUG
29+
-DSKIP_INSTALL_HEADERS=ON
30+
)
31+
32+
vcpkg_install_cmake()
33+
34+
# Install the pkgconfig file
35+
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
36+
if(VCPKG_TARGET_IS_WINDOWS)
37+
vcpkg_replace_string(${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/zlib.pc "-lz" "-lzlib")
38+
endif()
39+
file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/zlib.pc DESTINATION ${CURRENT_PACKAGES_DIR}/lib/pkgconfig)
40+
endif()
41+
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
42+
if(VCPKG_TARGET_IS_WINDOWS)
43+
vcpkg_replace_string(${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/zlib.pc "-lz" "-lzlibd")
44+
endif()
45+
file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/zlib.pc DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig)
46+
endif()
47+
48+
vcpkg_fixup_pkgconfig()
49+
50+
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
51+
52+
vcpkg_copy_pdbs()
53+
54+
file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
The package zlib is compatible with built-in CMake targets:
2+
3+
find_package(ZLIB REQUIRED)
4+
target_link_libraries(main PRIVATE ZLIB::ZLIB)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
diff --git a/zconf.h.cmakein b/zconf.h.cmakein
2+
index a7f24cc..a1b359b 100644
3+
--- a/zconf.h.cmakein
4+
+++ b/zconf.h.cmakein
5+
@@ -434,11 +434,19 @@ typedef uLong FAR uLongf;
6+
#endif
7+
8+
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
9+
-# define Z_HAVE_UNISTD_H
10+
+# if ~(~HAVE_UNISTD_H + 0) == 0 && ~(~HAVE_UNISTD_H + 1) == 1
11+
+# define Z_HAVE_UNISTD_H
12+
+# elif HAVE_UNISTD_H != 0
13+
+# define Z_HAVE_UNISTD_H
14+
+# endif
15+
#endif
16+
17+
#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
18+
-# define Z_HAVE_STDARG_H
19+
+# if ~(~HAVE_STDARG_H + 0) == 0 && ~(~HAVE_STDARG_H + 1) == 1
20+
+# define Z_HAVE_STDARG_H
21+
+# elif HAVE_STDARG_H != 0
22+
+# define Z_HAVE_STDARG_H
23+
+# endif
24+
#endif
25+
26+
#ifdef STDC
27+
diff --git a/zconf.h.in b/zconf.h.in
28+
index 5e1d68a..32f53c8 100644
29+
--- a/zconf.h.in
30+
+++ b/zconf.h.in
31+
@@ -432,11 +432,19 @@ typedef uLong FAR uLongf;
32+
#endif
33+
34+
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
35+
-# define Z_HAVE_UNISTD_H
36+
+# if ~(~HAVE_UNISTD_H + 0) == 0 && ~(~HAVE_UNISTD_H + 1) == 1
37+
+# define Z_HAVE_UNISTD_H
38+
+# elif HAVE_UNISTD_H != 0
39+
+# define Z_HAVE_UNISTD_H
40+
+# endif
41+
#endif
42+
43+
#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
44+
-# define Z_HAVE_STDARG_H
45+
+# if ~(~HAVE_STDARG_H + 0) == 0 && ~(~HAVE_STDARG_H + 1) == 1
46+
+# define Z_HAVE_STDARG_H
47+
+# elif HAVE_STDARG_H != 0
48+
+# define Z_HAVE_STDARG_H
49+
+# endif
50+
#endif
51+
52+
#ifdef STDC
53+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Source: zlib
2+
Version: 1.2.11
3+
Port-Version: 8
4+
Homepage: https://www.zlib.net/
5+
Description: A compression library

0 commit comments

Comments
 (0)