Skip to content

Commit 8065d3f

Browse files
committed
Bump libzip to 1.6.1 and Patch Mingw compile errors
1 parent 5d1985e commit 8065d3f

File tree

7 files changed

+90
-13
lines changed

7 files changed

+90
-13
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "external/libzip"]
22
path = external/libzip
33
url = https://github.com/nih-at/libzip.git
4+
[submodule "external/vcpkg"]
5+
path = external/vcpkg
6+
url = https://github.com/Microsoft/vcpkg

azure-pipelines.yml

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,42 @@ variables:
1414
stages:
1515
- stage: Build
1616
jobs:
17+
- job: buildWindows
18+
pool:
19+
vmImage: vs2017-win2016
20+
steps:
21+
- script: |
22+
echo "Hello"
23+
git submodule update --init --recursive
24+
cd external/vcpkg
25+
bootstrap-vcpkg.bat
26+
displayName: "Build vcpkg"
27+
- script: |
28+
vcpkg integrate install
29+
- script: |
30+
vcpkg install zlib:x64-windows bzip2:x64-windows zlib:x86-windows bzip2:x86-windows
31+
- script: |
32+
vcpkg list
33+
- script: |
34+
cd ..\..
35+
displayName: "Install Dependencies"
36+
- script: |
37+
mkdir build\Windows\64
38+
cd build\Windows\64
39+
cmake -DCMAKE_TOOLCHAIN_FILE=%cd%/../../../external/vcpkg/scripts/buildsystems/vcpkg.cmake ..\..\..\external\libzip -G "Visual Studio 15 2017 Win64" -DBUILD_SHARED_LIBS=on
40+
- script: |
41+
cmake --build . --config Release
42+
displayName: "Build LibZip x64"
43+
- script: |
44+
cd ..\..\..
45+
- script: |
46+
mkdir build\Windows\32
47+
cd build\Windows\32
48+
cmake -DCMAKE_TOOLCHAIN_FILE=%cd%/../../../external/vcpkg/scripts/buildsystems/vcpkg.cmake ..\..\..\external\libzip -G "Visual Studio 15 2017" -DBUILD_SHARED_LIBS=on
49+
displayName: "Generate Build"
50+
- script: |
51+
cmake --build . --config Release
52+
displayName: "Build LibZip x86"
1753
- job: buildlinux
1854
pool:
1955
vmImage: ubuntu-16.04
@@ -36,14 +72,14 @@ stages:
3672
displayName: 'Build Linux x86'
3773
- task: ArchiveFiles@2
3874
inputs:
39-
rootFolderOrFile: build/Linux/32/lib/libzip.so.5.0
75+
rootFolderOrFile: build/Linux/32/lib/libzip.so.5.1
4076
includeRootFolder: false
4177
archiveType: 7z
4278
replaceExistingArchive: true
4379
archiveFile: $(Build.ArtifactStagingDirectory)/libzip-linux-x86.7z
4480
- task: ArchiveFiles@2
4581
inputs:
46-
rootFolderOrFile: build/Linux/64/lib/libzip.so.5.0
82+
rootFolderOrFile: build/Linux/64/lib/libzip.so.5.1
4783
includeRootFolder: false
4884
archiveType: 7z
4985
replaceExistingArchive: true
@@ -54,7 +90,9 @@ stages:
5490
artifactName: 'native'
5591
pathtoPublish: $(Build.ArtifactStagingDirectory)
5692
- job: build
57-
dependsOn: buildlinux
93+
dependsOn:
94+
- buildlinux
95+
# - buildWindows
5896
pool:
5997
vmImage: xcode9-macos10.13
6098
steps:
@@ -66,7 +104,14 @@ stages:
66104
git submodule update --init --recursive
67105
- bash: |
68106
HOSTOS=Darwin ./build_native
107+
displayName: 'Build Darwin'
108+
- bash: |
109+
patch --verbose -d external/libzip -p1 -l < libzip-windows.patch
110+
displayName: 'Apply Windows Patch'
111+
- bash: |
69112
./build_windows
113+
displayName: 'Build Windows'
114+
- bash: |
70115
mkdir -p build/Linux/64
71116
mkdir -p build/Linux/32
72117
find build/* | grep libzip
@@ -86,8 +131,8 @@ stages:
86131
archiveFilePatterns: $(Build.ArtifactStagingDirectory)/native/libzip-linux-x86.7z
87132
destinationFolder: build/Linux/32
88133
- bash: |
89-
mv build/Linux/32/libzip.so.5.0 build/Linux/32/libzip.so
90-
mv build/Linux/64/libzip.so.5.0 build/Linux/64/libzip.so
134+
mv build/Linux/32/libzip.so.5.1 build/Linux/32/libzip.so
135+
mv build/Linux/64/libzip.so.5.1 build/Linux/64/libzip.so
91136
rm $(Build.ArtifactStagingDirectory)/native/libzip-linux-*.7z
92137
displayName: 'Find libzip'
93138
- task: MSBuild@1

external/libzip

Submodule libzip updated 424 files

external/vcpkg

Submodule vcpkg added at 7365cd7

libZipSharp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<Link>libZipSharp.dll.config</Link>
4444
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
4545
</None>
46-
<None Include="build\Darwin\64\lib\libzip.5.0.dylib" PackagePath="runtimes\osx\native\libzip.dylib" Pack="true" />
46+
<None Include="build\Darwin\64\lib\libzip.5.1.dylib" PackagePath="runtimes\osx\native\libzip.dylib" Pack="true" />
4747
<None Include="build\Windows\64\lib\libzip.dll" PackagePath="runtimes\win-x64\native\libzip.dll" Pack="true" />
4848
<None Include="build\Windows\32\lib\libzip.dll" PackagePath="runtimes\win-x86\native\libzip.dll" Pack="true" />
4949
<None Include="build\Linux\64\libzip.so" PackagePath="runtimes\linux-x64\native\libzip.so" Pack="true" />

libzip-static.patch

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
22
index 92c4becc..e58b7db3 100644
33
--- a/lib/CMakeLists.txt
44
+++ b/lib/CMakeLists.txt
5-
@@ -211,7 +211,7 @@ ENDIF()
6-
7-
ADD_LIBRARY(zip ${LIBZIP_SOURCES} ${LIBZIP_EXTRA_FILES} ${LIBZIP_OPTIONAL_FILES} ${LIBZIP_OPSYS_FILES})
8-
SET_TARGET_PROPERTIES(zip PROPERTIES VERSION 5.0 SOVERSION 5)
9-
-TARGET_LINK_LIBRARIES(zip ${ZLIB_LIBRARY} ${OPTIONAL_LIBRARY})
10-
+TARGET_LINK_LIBRARIES(zip ${ZLIB_LIBRARY} ${OPTIONAL_LIBRARY} OpenSSL::Crypto -ldl -pthread)
5+
@@ -228,7 +228,7 @@ ENDIF()
6+
7+
8+
-TARGET_LINK_LIBRARIES(zip PRIVATE ${ZLIB_LIBRARIES} ${OPTIONAL_LIBRARY})
9+
+TARGET_LINK_LIBRARIES(zip PRIVATE ${ZLIB_LIBRARY} ${OPTIONAL_LIBRARY} OpenSSL::Crypto -ldl -pthread)
1110
INSTALL(TARGETS zip
1211
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
1312
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}

libzip-windows.patch

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
2+
index d5bf5804..d80c5b53 100644
3+
--- a/lib/CMakeLists.txt
4+
+++ b/lib/CMakeLists.txt
5+
@@ -164,6 +164,8 @@ SET(LIBZIP_SOURCES
6+
7+
IF(WIN32)
8+
SET(LIBZIP_OPSYS_FILES
9+
+ zip_mkstempm.c
10+
+ zip_random_win32.c
11+
zip_source_win32handle.c
12+
zip_source_win32utf8.c
13+
zip_source_win32w.c
14+
diff --git a/lib/zip_random_win32.c b/lib/zip_random_win32.c
15+
index 16d0f647..ae273b31 100644
16+
--- a/lib/zip_random_win32.c
17+
+++ b/lib/zip_random_win32.c
18+
@@ -72,9 +72,9 @@ zip_random_uint32(void) {
19+
}
20+
21+
if (!seeded) {
22+
- srandom((unsigned int)time(NULL));
23+
+ srand((unsigned int)time(NULL));
24+
}
25+
26+
- return (zip_uint32_t)random();
27+
+ return (zip_uint32_t)rand();
28+
}
29+
#endif

0 commit comments

Comments
 (0)