Skip to content

Commit 9e90b9d

Browse files
committed
xdelta3: add
1 parent 7672a73 commit 9e90b9d

File tree

6 files changed

+129
-0
lines changed

6 files changed

+129
-0
lines changed

ci_config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,6 +1416,17 @@
14161416
"x-plane-sdk:cpp=enabled"
14171417
]
14181418
},
1419+
"xdelta3": {
1420+
"build_options": [
1421+
"xdelta3:lzma=enabled"
1422+
],
1423+
"alpine_packages": [
1424+
"xz-dev"
1425+
],
1426+
"debian_packages": [
1427+
"liblzma-dev"
1428+
]
1429+
},
14191430
"zycore": {
14201431
"build_options": [
14211432
"zycore:examples=enabled",

releases.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4368,6 +4368,14 @@
43684368
"4.0.1-1"
43694369
]
43704370
},
4371+
"xdelta3": {
4372+
"program_names": [
4373+
"xdelta3"
4374+
],
4375+
"versions": [
4376+
"3.1.0-1"
4377+
]
4378+
},
43714379
"xtensor": {
43724380
"dependency_names": [
43734381
"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: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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+
if host_machine.system() == 'windows'
21+
add_project_arguments(
22+
'-D_CRT_NONSTDC_NO_DEPRECATE',
23+
'-D_CRT_SECURE_NO_WARNINGS',
24+
language: 'c',
25+
)
26+
endif
27+
28+
cdata = configuration_data()
29+
cdata.set('HAVE_ALIGNED_ACCESS_REQUIRED', 1)
30+
cdata.set('REGRESSION_TEST', 1)
31+
cdata.set('SECONDARY_DJW', 1)
32+
cdata.set('SECONDARY_FGK', 1)
33+
cdata.set('XD3_MAIN', 1)
34+
cdata.set('XD3_DEBUG', 0)
35+
if host_machine.system() == 'windows'
36+
cdata.set('XD3_WIN32', 1)
37+
cdata.set('EXTERNAL_COMPRESSION', 0)
38+
cdata.set('SHELL_TESTS', 0)
39+
endif
40+
41+
foreach type : ['unsigned int', 'unsigned long', 'unsigned long long', 'size_t']
42+
cdata.set('SIZEOF_' + type.underscorify().to_upper(), cc.sizeof(type))
43+
endforeach
44+
if not cc.has_type(
45+
'pid_t',
46+
prefix: '#include <sys/types.h>',
47+
)
48+
cdata.set('pid_t', 'int')
49+
endif
50+
if not cc.has_function_attribute('format')
51+
cdata.set('PRINTF_ATTRIBUTE(x,y)', '')
52+
endif
53+
54+
m_dep = cc.find_library(
55+
'm',
56+
required: false,
57+
)
58+
59+
liblzma_dep = dependency(
60+
'liblzma',
61+
required: get_option('lzma'),
62+
)
63+
if liblzma_dep.found()
64+
cdata.set('HAVE_LZMA_H', 1)
65+
endif
66+
67+
configure_file(
68+
configuration: cdata,
69+
output: 'config-generated.h',
70+
)
71+
72+
configure_file(
73+
input: 'config.h.meson',
74+
output: 'config.h',
75+
copy: true,
76+
)
77+
78+
xdelta3 = executable(
79+
'xdelta3',
80+
'xdelta3.c',
81+
dependencies: [m_dep, liblzma_dep],
82+
)
83+
meson.override_find_program('xdelta3', xdelta3)
84+
85+
test(
86+
'xdelta3',
87+
xdelta3,
88+
args: 'test',
89+
timeout: 500,
90+
)
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)