1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
--- a/CMakeLists.orig.txt 2017-03-15 13:01:27.623725000 +0100
+++ b/CMakeLists.txt 2017-03-15 14:12:22.247705049 +0100
@@ -764,6 +764,8 @@
valid. It should contain the file zlib.h, but it does not.")
endif()
+ find_package(PkgConfig)
+ pkg_check_modules(MINIZIP REQUIRED minizip)
endif(WITH_ZLIB)
--- a/src/CMakeLists.orig.txt 2017-03-15 13:01:26.507732000 +0100
+++ b/src/CMakeLists.txt 2017-03-15 14:15:49.173159496 +0100
@@ -353,14 +353,6 @@
if(WITH_ZLIB)
set(COMPRESS_SOURCES ${COMPRESS_SOURCES}
- sbml/compress/zip.c
- sbml/compress/zip.h
- sbml/compress/unzip.h
- sbml/compress/unzip.c
- sbml/compress/ioapi.h
- sbml/compress/ioapi.c
- sbml/compress/ioapi_mem.h
- sbml/compress/ioapi_mem.c
sbml/compress/zfstream.h
sbml/compress/zfstream.cpp
sbml/compress/zipfstream.cpp
@@ -380,7 +372,7 @@
endif()
include_directories(${LIBZ_INCLUDE_DIR})
- set(LIBSBML_LIBS ${LIBSBML_LIBS} ${LIBZ_LIBRARY})
+ set(LIBSBML_LIBS ${LIBSBML_LIBS} ${LIBZ_LIBRARY} ${MINIZIP_LIBRARIES})
endif()
--- a/src/sbml/compress/zipfstream.orig.h 2017-03-15 13:01:25.633738000 +0100
+++ b/src/sbml/compress/zipfstream.h 2017-03-15 14:18:08.254792811 +0100
@@ -66,8 +66,8 @@
#include <istream> // not iostream, since we don't need cin/cout
#include <ostream>
-#include "zip.h"
-#include "unzip.h"
+#include "minizip/zip.h"
+#include "minizip/unzip.h"
/*****************************************************************************/
--- a/src/sbml/compress/zipfstream.h.orig 2021-01-07 14:08:02.122268503 +0100
+++ b/src/sbml/compress/zipfstream.h 2021-01-07 14:08:02.142268743 +0100
@@ -44,10 +44,10 @@
*
* zipFile zipopen (const char* path, const char* filenameinzip, int append);
* int zipclose(zipFile file);
- * int zipwrite(zipFile file, voidp buf, unsigned len);
+ * int zipwrite(zipFile file, void* buf, unsigned len);
* unzFile unzipopen (const char* path);
* int unzipclose(unzFile file);
- * int unzipread (unzFile file, voidp buf, unsigned len);
+ * int unzipread (unzFile file, void* buf, unsigned len);
*
* Minizip is distributed under the following terms:
* ---------------------------------------------------------------------------
@@ -504,11 +504,11 @@
zipFile zipopen (const char* path, const char* filenameinzip, int append);
int zipclose(zipFile file);
-int zipwrite(zipFile file, voidp buf, unsigned len);
+int zipwrite(zipFile file, void* buf, unsigned len);
unzFile unzipopen (const char* path);
int unzipclose(unzFile file);
-int unzipread (unzFile file, voidp buf, unsigned len);
+int unzipread (unzFile file, void* buf, unsigned len);
--- a/src/sbml/compress/zipfstream.cpp.orig 2020-11-25 11:58:43.000000000 +0100
+++ b/src/sbml/compress/zipfstream.cpp 2021-01-07 14:08:02.143268755 +0100
@@ -44,10 +44,10 @@
*
* zipFile zipopen (const char* path, const char* filenameinzip, int append);
* int zipclose(zipFile file);
- * int zipwrite(zipFile file, voidp buf, unsigned len);
+ * int zipwrite(zipFile file, void* buf, unsigned len);
* unzFile unzipopen (const char* path);
* int unzipclose(unzFile file);
- * int unzipread (unzFile file, voidp buf, unsigned len);
+ * int unzipread (unzFile file, void* buf, unsigned len);
*
* Minizip is distributed under the following terms:
* ---------------------------------------------------------------------------
@@ -94,7 +94,7 @@
#define BIGBUFSIZE BUFSIZ
#define SMALLBUFSIZE 1
-uLong filetime(const char* f, tm_zip* tmzip, uLong* dt);
+unsigned long filetime(const char* f, tm_zip* tmzip, uint32_t* dt);
/*****************************************************************************/
@@ -547,7 +547,7 @@
err = zipOpenNewFileInZip(zf,filenameinzip,&zi,
NULL,0,NULL,0,NULL,
Z_DEFLATED,
- Z_DEFAULT_COMPRESSION);
+ Z_DEFLATED);
if (err != ZIP_OK)
{
@@ -563,7 +563,7 @@
return zipClose(file,NULL);
}
-int zipwrite(zipFile file, voidp buf, unsigned len)
+int zipwrite(zipFile file, void* buf, unsigned len)
{
return zipWriteInFileInZip (file,buf,len);
}
@@ -615,14 +615,14 @@
return unzClose(file);
}
-int unzipread (unzFile file, voidp buf, unsigned len)
+int unzipread (unzFile file, void* buf, unsigned len)
{
return unzReadCurrentFile(file,buf,len);
}
#if defined(WIN32) && !defined(CYGWIN)
-uLong filetime(const char* f, tm_zip* tmzip, uLong *dt)
+unsigned long filetime(const char* f, tm_zip* tmzip, uint32_t* dt)
{
int ret = 0;
{
@@ -643,7 +643,7 @@
}
#else
#if defined(unix) || defined(MACOSX)
-uLong filetime(const char* f, tm_zip* tmzip, uLong *dt)
+unsigned long filetime(const char* f, tm_zip* tmzip, uint32_t* dt)
{
int ret=0;
struct stat s; /* results of stat() */
@@ -682,7 +682,7 @@
return ret;
}
#else
-uLong filetime(const char* f, tm_zip* tmzip, uLong *dt)
+unsigned long filetime(const char* f, tm_zip* tmzip, uint32_t* dt)
{
return 0;
}
|