Skip to content

xdelta3: add #2242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions ci_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -1416,6 +1416,17 @@
"x-plane-sdk:cpp=enabled"
]
},
"xdelta3": {
"build_options": [
"xdelta3:lzma=enabled"
],
"alpine_packages": [
"xz-dev"
],
"debian_packages": [
"liblzma-dev"
]
},
"zycore": {
"build_options": [
"zycore:examples=enabled",
Expand Down
8 changes: 8 additions & 0 deletions releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -4368,6 +4368,14 @@
"4.0.1-1"
]
},
"xdelta3": {
"program_names": [
"xdelta3"
],
"versions": [
"3.1.0-1"
]
},
"xtensor": {
"dependency_names": [
"xtensor"
Expand Down
10 changes: 10 additions & 0 deletions subprojects/packagefiles/xdelta3/config.h.meson
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include "config-generated.h"

#ifdef _WIN32
// must set these before including Windows headers; use values from xdelta3.h
#define WINVER 0x0500
#define _WIN32_WINNT 0x0500

// missing include for getpid()
#include <process.h>
#endif
90 changes: 90 additions & 0 deletions subprojects/packagefiles/xdelta3/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
project(
'xdelta3',
'c',
version: '3.1.0',
license: 'GPL-2.0-or-later',
meson_version: '>=0.63.0',

Check notice on line 6 in subprojects/packagefiles/xdelta3/meson.build

View workflow job for this annotation

GitHub Actions / Ubuntu (x86_64)

Minimum Meson version is 0.63.0

0.43.0: compiler.get_supported_arguments 0.46.0: meson.override_find_program 0.47.0: User option "feature", copy arg in configure_file 0.48.0: compiler.has_function_attribute 0.63.0: c_std in subproject default_options
default_options: ['c_std=c99'],
)

cc = meson.get_compiler('c')
add_project_arguments(
'-DHAVE_CONFIG_H',
cc.get_supported_arguments(
'-Wno-format-truncation',
'-Wno-switch-unreachable',
'-Wno-unused-function',
),
language: 'c',
)
if host_machine.system() == 'windows'
add_project_arguments(
'-D_CRT_NONSTDC_NO_DEPRECATE',
'-D_CRT_SECURE_NO_WARNINGS',
language: 'c',
)
endif

cdata = configuration_data()
cdata.set('HAVE_ALIGNED_ACCESS_REQUIRED', 1)
cdata.set('REGRESSION_TEST', 1)
cdata.set('SECONDARY_DJW', 1)
cdata.set('SECONDARY_FGK', 1)
cdata.set('XD3_MAIN', 1)
cdata.set('XD3_DEBUG', 0)
if host_machine.system() == 'windows'
cdata.set('XD3_WIN32', 1)
cdata.set('EXTERNAL_COMPRESSION', 0)
cdata.set('SHELL_TESTS', 0)
endif

foreach type : ['unsigned int', 'unsigned long', 'unsigned long long', 'size_t']
cdata.set('SIZEOF_' + type.underscorify().to_upper(), cc.sizeof(type))
endforeach
if not cc.has_type(
'pid_t',
prefix: '#include <sys/types.h>',
)
cdata.set('pid_t', 'int')
endif
if not cc.has_function_attribute('format')
cdata.set('PRINTF_ATTRIBUTE(x,y)', '')
endif

m_dep = cc.find_library(
'm',
required: false,
)

liblzma_dep = dependency(
'liblzma',
required: get_option('lzma'),
)
if liblzma_dep.found()
cdata.set('HAVE_LZMA_H', 1)
endif

configure_file(
configuration: cdata,
output: 'config-generated.h',
)

configure_file(
input: 'config.h.meson',
output: 'config.h',
copy: true,
)

xdelta3 = executable(
'xdelta3',
'xdelta3.c',
dependencies: [m_dep, liblzma_dep],
)
meson.override_find_program('xdelta3', xdelta3)

test(
'xdelta3',
xdelta3,
args: 'test',
timeout: 500,
)
5 changes: 5 additions & 0 deletions subprojects/packagefiles/xdelta3/meson_options.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
option(
'lzma',
type: 'feature',
description: 'LZMA compression support',
)
9 changes: 9 additions & 0 deletions subprojects/xdelta3.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[wrap-file]
directory = xdelta3-3.1.0
source_url = https://github.com/jmacd/xdelta-gpl/releases/download/v3.1.0/xdelta3-3.1.0.tar.gz
source_filename = xdelta3-3.1.0.tar.gz
source_hash = 114543336ab6cee3764e3c03202701ef79d7e5e8e4863fe64811e4d9e61884dc
patch_directory = xdelta3

[provide]
program_names = xdelta3
Loading