Skip to content

Commit 927396f

Browse files
committed
xdelta3: add
1 parent 257ad56 commit 927396f

File tree

6 files changed

+116
-0
lines changed

6 files changed

+116
-0
lines changed

ci_config.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,6 +1423,11 @@
14231423
"x-plane-sdk:cpp=enabled"
14241424
]
14251425
},
1426+
"xdelta3": {
1427+
"build_options": [
1428+
"xdelta3:lzma=enabled"
1429+
]
1430+
},
14261431
"zycore": {
14271432
"build_options": [
14281433
"zycore:examples=enabled",

releases.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4347,6 +4347,14 @@
43474347
"4.0.1-1"
43484348
]
43494349
},
4350+
"xdelta3": {
4351+
"program_names": [
4352+
"xdelta3"
4353+
],
4354+
"versions": [
4355+
"3.1.0-1"
4356+
]
4357+
},
43504358
"xtensor": {
43514359
"dependency_names": [
43524360
"xtensor"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include "config-generated.h"
2+
3+
#ifdef _WIN32
4+
// missing include for getpid()
5+
#include <process.h>
6+
#endif
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
project(
2+
'xdelta3',
3+
'c',
4+
version: '3.1.0',
5+
license: 'GPL-2.0-or-later',
6+
meson_version: '>=0.63.0',
7+
default_options: ['c_std=c99'],
8+
)
9+
10+
cc = meson.get_compiler('c')
11+
add_project_arguments(
12+
'-DHAVE_CONFIG_H',
13+
cc.get_supported_arguments(
14+
'-Wno-format-truncation',
15+
'-Wno-switch-unreachable',
16+
'-Wno-unused-function',
17+
),
18+
language: 'c',
19+
)
20+
21+
cdata = configuration_data()
22+
cdata.set('HAVE_ALIGNED_ACCESS_REQUIRED', 1)
23+
cdata.set('REGRESSION_TEST', 1)
24+
cdata.set('SECONDARY_DJW', 1)
25+
cdata.set('SECONDARY_FGK', 1)
26+
cdata.set('XD3_MAIN', 1)
27+
cdata.set('XD3_DEBUG', 0)
28+
if host_machine.system() == 'windows'
29+
cdata.set('XD3_WIN32', 1)
30+
cdata.set('EXTERNAL_COMPRESSION', 0)
31+
cdata.set('SHELL_TESTS', 0)
32+
endif
33+
34+
foreach type : ['unsigned int', 'unsigned long', 'unsigned long long', 'size_t']
35+
cdata.set('SIZEOF_' + type.underscorify().to_upper(), cc.sizeof(type))
36+
endforeach
37+
if not cc.has_type(
38+
'pid_t',
39+
prefix: '#include <sys/types.h>',
40+
)
41+
cdata.set('pid_t', 'int')
42+
endif
43+
if not cc.has_function_attribute('format')
44+
cdata.set('PRINTF_ATTRIBUTE(x,y)', '')
45+
endif
46+
47+
m_dep = cc.find_library(
48+
'm',
49+
required: false,
50+
)
51+
52+
liblzma_dep = dependency(
53+
'liblzma',
54+
required: get_option('lzma'),
55+
)
56+
if liblzma_dep.found()
57+
cdata.set('HAVE_LZMA_H', 1)
58+
endif
59+
60+
configure_file(
61+
configuration: cdata,
62+
output: 'config-generated.h',
63+
)
64+
65+
configure_file(
66+
input: 'config.h.meson',
67+
output: 'config.h',
68+
copy: true,
69+
)
70+
71+
xdelta3 = executable(
72+
'xdelta3',
73+
'xdelta3.c',
74+
dependencies: [m_dep, liblzma_dep],
75+
)
76+
meson.override_find_program('xdelta3', xdelta3)
77+
78+
test(
79+
'xdelta3',
80+
xdelta3,
81+
args: 'test',
82+
timeout: 500,
83+
)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
option(
2+
'lzma',
3+
type: 'feature',
4+
description: 'LZMA compression support',
5+
)

subprojects/xdelta3.wrap

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[wrap-file]
2+
directory = xdelta3-3.1.0
3+
source_url = https://github.com/jmacd/xdelta-gpl/releases/download/v3.1.0/xdelta3-3.1.0.tar.gz
4+
source_filename = xdelta3-3.1.0.tar.gz
5+
source_hash = 114543336ab6cee3764e3c03202701ef79d7e5e8e4863fe64811e4d9e61884dc
6+
patch_directory = xdelta3
7+
8+
[provide]
9+
program_names = xdelta3

0 commit comments

Comments
 (0)