1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-25 23:02:35 +03:00

Bump deps version and slightly refactor the scripts

This commit is contained in:
Tae Won Ha 2021-11-04 21:15:37 +01:00
parent 7f814e1bfb
commit caac9c7c7e
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
18 changed files with 248 additions and 37 deletions

View File

@ -11,8 +11,8 @@ main () {
arm64_deployment_target=$(cat ./resources/arm64_deployment_target.txt)
readonly arm64_deployment_target
local -r pcre_version="8.43"
local -r xz_version="5.2.4"
local -r pcre_version="8.45"
local -r xz_version="5.3.2alpha"
local -r ag_version="2.2.0"
pushd ./third-party >/dev/null

View File

@ -4,10 +4,11 @@ from builder import Builder
from utils.shell import shell
# "https://ftp.pcre.org/pub/pcre/pcre-${version}.tar.bz2" seems to be down as of 2021-11-04.
# language=bash
download_command = Template(
"""
curl -L -s -o pcre.tar.bz2 "https://ftp.pcre.org/pub/pcre/pcre-${version}.tar.bz2"
curl -L -s -o pcre.tar.bz2 "https://www.mirrorservice.org/sites/ftp.exim.org/pub/pcre/pcre-${version}.tar.bz2"
"""
)

View File

@ -8,11 +8,14 @@ class ShellExecutionException(Exception):
def shell(command: str, cwd: Path):
proc = subprocess.Popen(
with subprocess.Popen(
command, cwd=cwd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT
)
for line in iter(lambda: proc.stdout.read(1), b""):
sys.stdout.write(line.decode("utf-8"))
) as proc:
while proc.stdout.readable():
if line := proc.stdout.readline():
sys.stdout.write(line.decode("utf-8"))
else:
break
if proc.poll() != 0:
raise ShellExecutionException(command)
if proc.wait() != 0:
raise ShellExecutionException(command)

View File

@ -26,14 +26,11 @@
/* #undef HAVE_LIBSHLWAPI */
/* Define to 1 if you have the <lzma.h> header file. */
#define HAVE_LZMA_H 1
/* #undef HAVE_LZMA_H */
/* Define to 1 if you have the `madvise' function. */
#define HAVE_MADVISE 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `pledge' function. */
/* #undef HAVE_PLEDGE */
@ -55,6 +52,9 @@
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdio.h> header file. */
#define HAVE_STDIO_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
@ -110,7 +110,9 @@
your system. */
/* #undef PTHREAD_CREATE_JOINABLE */
/* Define to 1 if you have the ANSI C header files. */
/* Define to 1 if all of the C90 standard headers exist (not just the ones
required in a freestanding environment). This macro is provided for
backward compatibility; new code need not use it. */
#define STDC_HEADERS 1
/* Use CPU_SET macros */

View File

@ -219,12 +219,14 @@
*/
#ifndef lzma_nothrow
# if defined(__cplusplus)
# if __cplusplus >= 201103L
# if __cplusplus >= 201103L || (defined(_MSVC_LANG) \
&& _MSVC_LANG >= 201103L)
# define lzma_nothrow noexcept
# else
# define lzma_nothrow throw()
# endif
# elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
# elif defined(__GNUC__) && (__GNUC__ > 3 \
|| (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))
# define lzma_nothrow __attribute__((__nothrow__))
# else
# define lzma_nothrow
@ -241,7 +243,7 @@
* break anything if these are sometimes enabled and sometimes not, only
* affects warnings and optimizations.
*/
#if __GNUC__ >= 3
#if defined(__GNUC__) && __GNUC__ >= 3
# ifndef lzma_attribute
# define lzma_attribute(attr) __attribute__(attr)
# endif

View File

@ -234,6 +234,36 @@ typedef enum {
* can be a sign of a bug in liblzma. See the documentation
* how to report bugs.
*/
LZMA_SEEK_NEEDED = 12,
/**<
* \brief Request to change the input file position
*
* Some coders can do random access in the input file. The
* initialization functions of these coders take the file size
* as an argument. No other coders can return LZMA_SEEK_NEEDED.
*
* When this value is returned, the application must seek to
* the file position given in lzma_stream.seek_pos. This value
* is guaranteed to never exceed the file size that was
* specified at the coder initialization.
*
* After seeking the application should read new input and
* pass it normally via lzma_stream.next_in and .avail_in.
*/
/*
* These eumerations may be used internally by liblzma
* but they will never be returned to applications.
*/
LZMA_RET_INTERNAL1 = 101,
LZMA_RET_INTERNAL2 = 102,
LZMA_RET_INTERNAL3 = 103,
LZMA_RET_INTERNAL4 = 104,
LZMA_RET_INTERNAL5 = 105,
LZMA_RET_INTERNAL6 = 106,
LZMA_RET_INTERNAL7 = 107,
LZMA_RET_INTERNAL8 = 108
} lzma_ret;
@ -447,7 +477,7 @@ typedef struct lzma_internal_s lzma_internal;
*
* The lzma_stream structure is used for
* - passing pointers to input and output buffers to liblzma;
* - defining custom memory hander functions; and
* - defining custom memory handler functions; and
* - holding a pointer to coder-specific internal data structures.
*
* Typical usage:
@ -514,7 +544,19 @@ typedef struct {
void *reserved_ptr2;
void *reserved_ptr3;
void *reserved_ptr4;
uint64_t reserved_int1;
/**
* \brief New seek input position for LZMA_SEEK_NEEDED
*
* When lzma_code() returns LZMA_SEEK_NEEDED, the new input position
* needed by liblzma will be available seek_pos. The value is
* guaranteed to not exceed the file size that was specified when
* this lzma_stream was initialized.
*
* In all other situations the value of this variable is undefined.
*/
uint64_t seek_pos;
uint64_t reserved_int2;
size_t reserved_int3;
size_t reserved_int4;

View File

@ -448,7 +448,7 @@ extern LZMA_API(lzma_vli) lzma_block_total_size(const lzma_block *block)
* - LZMA_MEM_ERROR
* - LZMA_OPTIONS_ERROR
* - LZMA_UNSUPPORTED_CHECK: block->check specifies a Check ID
* that is not supported by this buid of liblzma. Initializing
* that is not supported by this build of liblzma. Initializing
* the encoder failed.
* - LZMA_PROG_ERROR
*/

View File

@ -444,6 +444,60 @@ extern LZMA_API(lzma_ret) lzma_stream_buffer_encode(
lzma_nothrow lzma_attr_warn_unused_result;
/**
* \brief MicroLZMA encoder
*
* The MicroLZMA format is a raw LZMA stream whose first byte (always 0x00)
* has been replaced with bitwise-negation of the LZMA properties (lc/lp/pb).
* This encoding ensures that the first byte of MicroLZMA stream is never
* 0x00. There is no end of payload marker and thus the uncompressed size
* must be stored separately. For the best error detection the dictionary
* size should be stored separately as well but alternatively one may use
* the uncompressed size as the dictionary size when decoding.
*
* With the MicroLZMA encoder, lzma_code() behaves slightly unusually.
* The action argument must be LZMA_FINISH and the return value will never be
* LZMA_OK. Thus the encoding is always done with a single lzma_code() after
* the initialization. The benefit of the combination of initialization
* function and lzma_code() is that memory allocations can be re-used for
* better performance.
*
* lzma_code() will try to encode as much input as is possible to fit into
* the given output buffer. If not all input can be encoded, the stream will
* be finished without encoding all the input. The caller must check both
* input and output buffer usage after lzma_code() (total_in and total_out
* in lzma_stream can be convenient). Often lzma_code() can fill the output
* buffer completely if there is a lot of input, but sometimes a few bytes
* may remain unused because the next LZMA symbol would require more space.
*
* lzma_stream.avail_out must be at least 6. Otherwise LZMA_PROG_ERROR
* will be returned.
*
* The LZMA dictionary should be reasonably low to speed up the encoder
* re-initialization. A good value is bigger than the resulting
* uncompressed size of most of the output chunks. For example, if output
* size is 4 KiB, dictionary size of 32 KiB or 64 KiB is good. If the
* data compresses extremely well, even 128 KiB may be useful.
*
* The MicroLZMA format and this encoder variant were made with the EROFS
* file system in mind. This format may be convenient in other embedded
* uses too where many small streams are needed. XZ Embedded includes a
* decoder for this format.
*
* \return - LZMA_STREAM_END: All good. Check the amounts of input used
* and output produced. Store the amount of input used
* (uncompressed size) as it needs to be known to decompress
* the data.
* - LZMA_OPTIONS_ERROR
* - LZMA_MEM_ERROR
* - LZMA_PROG_ERROR: In addition to the generic reasons for this
* error code, this may also be returned if there isn't enough
* output space (6 bytes) to create a valid MicroLZMA stream.
*/
extern LZMA_API(lzma_ret) lzma_microlzma_encoder(
lzma_stream *strm, const lzma_options_lzma *options);
/************
* Decoding *
************/
@ -630,3 +684,43 @@ extern LZMA_API(lzma_ret) lzma_stream_buffer_decode(
const uint8_t *in, size_t *in_pos, size_t in_size,
uint8_t *out, size_t *out_pos, size_t out_size)
lzma_nothrow lzma_attr_warn_unused_result;
/**
* \brief MicroLZMA decoder
*
* See lzma_microlzma_decoder() for more information.
*
* The lzma_code() usage with this decoder is completely normal. The
* special behavior of lzma_code() applies to lzma_microlzma_encoder() only.
*
* \param strm Pointer to properly prepared lzma_stream
* \param comp_size Compressed size of the MicroLZMA stream.
* The caller must somehow know this exactly.
* \param uncomp_size Uncompressed size of the MicroLZMA stream.
* If the exact uncompressed size isn't known, this
* can be set to a value that is at most as big as
* the exact uncompressed size would be, but then the
* next argument uncomp_size_is_exact must be false.
* \param uncomp_size_is_exact
* If true, uncomp_size must be exactly correct.
* This will improve error detection at the end of
* the stream. If the exact uncompressed size isn't
* known, this must be false. uncomp_size must still
* be at most as big as the exact uncompressed size
* is. Setting this to false when the exact size is
* known will work but error detection at the end of
* the stream will be weaker.
* \param dict_size LZMA dictionary size that was used when
* compressing the data. It is OK to use a bigger
* value too but liblzma will then allocate more
* memory than would actually be required and error
* detection will be slightly worse. (Note that with
* the implementation in XZ Embedded it doesn't
* affect the memory usage if one specifies bigger
* dictionary than actually required.)
*/
extern LZMA_API(lzma_ret) lzma_microlzma_decoder(
lzma_stream *strm, uint64_t comp_size,
uint64_t uncomp_size, lzma_bool uncomp_size_is_exact,
uint32_t dict_size);

View File

@ -341,9 +341,10 @@ extern LZMA_API(lzma_ret) lzma_properties_encode(
* \param filter filter->id must have been set to the correct
* Filter ID. filter->options doesn't need to be
* initialized (it's not freed by this function). The
* decoded options will be stored to filter->options.
* filter->options is set to NULL if there are no
* properties or if an error occurs.
* decoded options will be stored in filter->options;
* it's application's responsibility to free it when
* appropriate. filter->options is set to NULL if
* there are no properties or if an error occurs.
* \param allocator Custom memory allocator used to allocate the
* options. Set to NULL to use the default malloc(),
* and in case of an error, also free().

View File

@ -6,7 +6,7 @@
* ways to limit the resource usage. Applications linking against liblzma
* need to do the actual decisions how much resources to let liblzma to use.
* To ease making these decisions, liblzma provides functions to find out
* the relevant capabilities of the underlaying hardware. Currently there
* the relevant capabilities of the underlying hardware. Currently there
* is only a function to find out the amount of RAM, but in the future there
* will be also a function to detect how many concurrent threads the system
* can run.

View File

@ -684,3 +684,69 @@ extern LZMA_API(lzma_ret) lzma_index_buffer_decode(lzma_index **i,
uint64_t *memlimit, const lzma_allocator *allocator,
const uint8_t *in, size_t *in_pos, size_t in_size)
lzma_nothrow;
/**
* \brief Initialize a .xz file information decoder
*
* \param strm Pointer to a properly prepared lzma_stream
* \param dest_index Pointer to a pointer where the decoder will put
* the decoded lzma_index. The old value
* of *dest_index is ignored (not freed).
* \param memlimit How much memory the resulting lzma_index is
* allowed to require. Use UINT64_MAX to
* effectively disable the limiter.
* \param file_size Size of the input .xz file
*
* This decoder decodes the Stream Header, Stream Footer, Index, and
* Stream Padding field(s) from the input .xz file and stores the resulting
* combined index in *dest_index. This information can be used to get the
* uncompressed file size with lzma_index_uncompressed_size(*dest_index) or,
* for example, to implement random access reading by locating the Blocks
* in the Streams.
*
* To get the required information from the .xz file, lzma_code() may ask
* the application to seek in the input file by returning LZMA_SEEK_NEEDED
* and having the target file position specified in lzma_stream.seek_pos.
* The number of seeks required depends on the input file and how big buffers
* the application provides. When possible, the decoder will seek backward
* and forward in the given buffer to avoid useless seek requests. Thus, if
* the application provides the whole file at once, no external seeking will
* be required (that is, lzma_code() won't return LZMA_SEEK_NEEDED).
*
* The value in lzma_stream.total_in can be used to estimate how much data
* liblzma had to read to get the file information. However, due to seeking
* and the way total_in is updated, the value of total_in will be somewhat
* inaccurate (a little too big). Thus, total_in is a good estimate but don't
* expect to see the same exact value for the same file if you change the
* input buffer size or switch to a different liblzma version.
*
* Valid `action' arguments to lzma_code() are LZMA_RUN and LZMA_FINISH.
* You only need to use LZMA_RUN; LZMA_FINISH is only supported because it
* might be convenient for some applications. If you use LZMA_FINISH and if
* lzma_code() asks the application to seek, remember to reset `action' back
* to LZMA_RUN unless you hit the end of the file again.
*
* Possible return values from lzma_code():
* - LZMA_OK: All OK so far, more input needed
* - LZMA_SEEK_NEEDED: Provide more input starting from the absolute
* file position strm->seek_pos
* - LZMA_STREAM_END: Decoding was successful, *dest_index has been set
* - LZMA_FORMAT_ERROR: The input file is not in the .xz format (the
* expected magic bytes were not found from the beginning of the file)
* - LZMA_OPTIONS_ERROR: File looks valid but contains headers that aren't
* supported by this version of liblzma
* - LZMA_DATA_ERROR: File is corrupt
* - LZMA_BUF_ERROR
* - LZMA_MEM_ERROR
* - LZMA_MEMLIMIT_ERROR
* - LZMA_PROG_ERROR
*
* \return - LZMA_OK
* - LZMA_MEM_ERROR
* - LZMA_PROG_ERROR
*/
extern LZMA_API(lzma_ret) lzma_file_info_decoder(
lzma_stream *strm, lzma_index **dest_index,
uint64_t memlimit, uint64_t file_size)
lzma_nothrow;

View File

@ -301,7 +301,7 @@ typedef struct {
* (2^ pb =2^2=4), which is often a good choice when there's
* no better guess.
*
* When the aligment is known, setting pb accordingly may reduce
* When the alignment is known, setting pb accordingly may reduce
* the file size a little. E.g. with text files having one-byte
* alignment (US-ASCII, ISO-8859-*, UTF-8), setting pb=0 can
* improve compression slightly. For UTF-16 text, pb=1 is a good

View File

@ -21,9 +21,9 @@
* Version number split into components
*/
#define LZMA_VERSION_MAJOR 5
#define LZMA_VERSION_MINOR 2
#define LZMA_VERSION_PATCH 4
#define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_STABLE
#define LZMA_VERSION_MINOR 3
#define LZMA_VERSION_PATCH 2
#define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_ALPHA
#ifndef LZMA_VERSION_COMMIT
# define LZMA_VERSION_COMMIT ""

View File

@ -54,7 +54,7 @@
*
* Valid VLI values are in the range [0, LZMA_VLI_MAX]. Unknown value is
* indicated with LZMA_VLI_UNKNOWN, which is the maximum value of the
* underlaying integer type.
* underlying integer type.
*
* lzma_vli will be uint64_t for the foreseeable future. If a bigger size
* is needed in the future, it is guaranteed that 2 * LZMA_VLI_MAX will

View File

@ -42,9 +42,9 @@ POSSIBILITY OF SUCH DAMAGE.
/* The current PCRE version information. */
#define PCRE_MAJOR 8
#define PCRE_MINOR 43
#define PCRE_MINOR 45
#define PCRE_PRERELEASE
#define PCRE_DATE 2019-02-23
#define PCRE_DATE 2021-06-15
/* When an application links to a PCRE DLL in Windows, the symbols that are
imported have to be identified as such. When building PCRE, the appropriate

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e2e83a83de8e002907cccc04cd157d3bf075af8ff56c6ad1983aac7b032a8cde
size 558184
oid sha256:4db7f15443c3a07f9f937736f08d1d2bb9ceca9031987b7878c4ad54a9c1f83e
size 549208

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ae9487f413f0c93343dc995b9458841a789c992861d9dcddae68be5896a3063d
size 2013424
oid sha256:807087bb6be781d6cc011db9edbb7b0fead120823daa514aadf26551846a9057
size 2090656

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5b9c348f7271ea2a09c926d8fad098261c0cf7b81fd3015edb9b1ae197689431
size 7611384
oid sha256:b74633bd3c2bcc45fec7ca75995c39b1e2d4efd8064d69c32a6332d0faa7a3f2
size 1426560