Drop z_const patches and unbreak geo/pdal on ports-gcc
Note: needs zlib headers with the ZLIB_CONST addition
This commit is contained in:
parent
3db1cbebb4
commit
11da792a95
@ -1,10 +1,10 @@
|
||||
# $OpenBSD: Makefile,v 1.9 2019/04/28 20:51:40 sthen Exp $
|
||||
# $OpenBSD: Makefile,v 1.10 2019/05/12 16:07:03 jca Exp $
|
||||
|
||||
COMMENT = translator library for point cloud formats
|
||||
|
||||
DISTNAME = PDAL-1.9.0-src
|
||||
PKGNAME = ${DISTNAME:L:C/-src//}
|
||||
REVISION = 0
|
||||
REVISION = 1
|
||||
|
||||
SHARED_LIBS = pdal_base 2.0 # 6.1
|
||||
SHARED_LIBS += pdal_util 0.2 # 6.1
|
||||
|
@ -1,73 +0,0 @@
|
||||
$OpenBSD: patch-vendor_arbiter_arbiter_hpp,v 1.1 2019/04/24 08:14:17 landry Exp $
|
||||
|
||||
our ancient zlib doesnt have z_const
|
||||
|
||||
Index: vendor/arbiter/arbiter.hpp
|
||||
--- vendor/arbiter/arbiter.hpp.orig
|
||||
+++ vendor/arbiter/arbiter.hpp
|
||||
@@ -2921,7 +2921,8 @@ class Compressor
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
- deflate_s.next_in = reinterpret_cast<z_const Bytef*>(data);
|
||||
+ char* data2 = strdup(data);
|
||||
+ deflate_s.next_in = reinterpret_cast<Bytef*>(data2);
|
||||
deflate_s.avail_in = static_cast<unsigned int>(size);
|
||||
|
||||
std::size_t size_compressed = 0;
|
||||
@@ -2946,6 +2947,7 @@ class Compressor
|
||||
|
||||
deflateEnd(&deflate_s);
|
||||
output.resize(size_compressed);
|
||||
+ free(data2);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -3050,19 +3052,22 @@ class Decompressor
|
||||
throw std::runtime_error("inflate init failed");
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
- inflate_s.next_in = reinterpret_cast<z_const Bytef*>(data);
|
||||
+ char* data2 = strdup(data);
|
||||
+ inflate_s.next_in = reinterpret_cast<Bytef*>(data2);
|
||||
|
||||
#ifdef DEBUG
|
||||
// Verify if size (long type) input will fit into unsigned int, type used for zlib's avail_in
|
||||
std::uint64_t size_64 = size * 2;
|
||||
if (size_64 > std::numeric_limits<unsigned int>::max())
|
||||
{
|
||||
+ free(data2);
|
||||
inflateEnd(&inflate_s);
|
||||
throw std::runtime_error("size arg is too large to fit into unsigned int type x2");
|
||||
}
|
||||
#endif
|
||||
if (size > max_ || (size * 2) > max_)
|
||||
{
|
||||
+ free(data2);
|
||||
inflateEnd(&inflate_s);
|
||||
throw std::runtime_error("size may use more memory than intended when decompressing");
|
||||
}
|
||||
@@ -3073,6 +3078,7 @@ class Decompressor
|
||||
std::size_t resize_to = size_uncompressed + 2 * size;
|
||||
if (resize_to > max_)
|
||||
{
|
||||
+ free(data2);
|
||||
inflateEnd(&inflate_s);
|
||||
throw std::runtime_error("size of output string will use more memory then intended when decompressing");
|
||||
}
|
||||
@@ -3083,6 +3089,7 @@ class Decompressor
|
||||
if (ret != Z_STREAM_END && ret != Z_OK && ret != Z_BUF_ERROR)
|
||||
{
|
||||
std::string error_msg = inflate_s.msg;
|
||||
+ free(data2);
|
||||
inflateEnd(&inflate_s);
|
||||
throw std::runtime_error(error_msg);
|
||||
}
|
||||
@@ -3091,6 +3098,7 @@ class Decompressor
|
||||
} while (inflate_s.avail_out == 0);
|
||||
inflateEnd(&inflate_s);
|
||||
output.resize(size_uncompressed);
|
||||
+ free(data2);
|
||||
}
|
||||
};
|
||||
|
@ -1,11 +1,11 @@
|
||||
# $OpenBSD: Makefile,v 1.24 2018/12/13 19:53:24 sthen Exp $
|
||||
# $OpenBSD: Makefile,v 1.25 2019/05/12 16:07:03 jca Exp $
|
||||
|
||||
COMMENT = 2D animation software
|
||||
|
||||
V= 1.2.1
|
||||
DISTNAME = synfig-$V
|
||||
API_V = 1.0
|
||||
REVISION = 0
|
||||
REVISION = 1
|
||||
|
||||
SHARED_LIBS += synfig 2.0 # 0.0
|
||||
|
||||
|
@ -1,41 +0,0 @@
|
||||
$OpenBSD: patch-src_synfig_zstreambuf_cpp,v 1.1 2017/12/07 22:42:50 rsadowski Exp $
|
||||
Base zlib don't provide z_const.
|
||||
Index: src/synfig/zstreambuf.cpp
|
||||
--- src/synfig/zstreambuf.cpp.orig
|
||||
+++ src/synfig/zstreambuf.cpp
|
||||
@@ -74,7 +74,7 @@ bool zstreambuf::pack(std::vector<char> &dest, const v
|
||||
)) return false;
|
||||
|
||||
stream.avail_in = size;
|
||||
- stream.next_in = (z_const Bytef*)src;
|
||||
+ stream.next_in = ( Bytef*)src;
|
||||
bool result = true;
|
||||
do
|
||||
{
|
||||
@@ -104,7 +104,7 @@ size_t zstreambuf::pack(void *dest, size_t dest_size,
|
||||
)) return 0;
|
||||
|
||||
stream.avail_in = src_size;
|
||||
- stream.next_in = (z_const Bytef*)src;
|
||||
+ stream.next_in = ( Bytef*)src;
|
||||
stream.avail_out = dest_size;
|
||||
stream.next_out = (Bytef*)dest;
|
||||
size_t size = 0;
|
||||
@@ -120,7 +120,7 @@ bool zstreambuf::unpack(std::vector<char> &dest, const
|
||||
if (Z_OK != inflateInit2(&stream, option_window_bits )) return false;
|
||||
|
||||
stream.avail_in = size;
|
||||
- stream.next_in = (z_const Bytef*)src;
|
||||
+ stream.next_in = ( Bytef*)src;
|
||||
bool result = true;
|
||||
do
|
||||
{
|
||||
@@ -144,7 +144,7 @@ size_t zstreambuf::unpack(void *dest, size_t dest_size
|
||||
if (Z_OK != inflateInit2(&stream, option_window_bits )) return 0;
|
||||
|
||||
stream.avail_in = src_size;
|
||||
- stream.next_in = (z_const Bytef*)src;
|
||||
+ stream.next_in = ( Bytef*)src;
|
||||
stream.avail_out = dest_size;
|
||||
stream.next_out = (Bytef*)dest;
|
||||
size_t size = 0;
|
@ -1,9 +1,9 @@
|
||||
# $OpenBSD: Makefile,v 1.84 2019/04/19 16:52:31 semarie Exp $
|
||||
# $OpenBSD: Makefile,v 1.85 2019/05/12 16:07:03 jca Exp $
|
||||
|
||||
COMMENT = graphic library, pdf parser, viewer and utilities
|
||||
|
||||
V = 1.14.0
|
||||
REVISION = 1
|
||||
REVISION = 2
|
||||
DISTNAME = mupdf-$V-source
|
||||
PKGNAME = mupdf-$V
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
$OpenBSD: patch-source_fitz_compress_c,v 1.1 2018/04/23 11:55:54 sthen Exp $
|
||||
$OpenBSD: patch-source_fitz_compress_c,v 1.2 2019/05/12 16:07:03 jca Exp $
|
||||
|
||||
cope with old zlib
|
||||
|
||||
@ -12,11 +12,3 @@ Index: source/fitz/compress.c
|
||||
#include <zlib.h>
|
||||
|
||||
#include <limits.h>
|
||||
@@ -38,6 +39,7 @@ void fz_deflate(fz_context *ctx, unsigned char *dest,
|
||||
|
||||
stream.next_out = dest;
|
||||
stream.avail_out = 0;
|
||||
+#define z_const
|
||||
stream.next_in = (z_const Bytef *)source;
|
||||
stream.avail_in = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user