kiwix-build/kiwixbuild/patches/zlib_meson.patch

104 lines
3.5 KiB
Diff

diff -uNr zlib-1.2.11/LICENSE.build zlib-1.2.11.meson/LICENSE.build
--- zlib-1.2.11/LICENSE.build 1970-01-01 01:00:00.000000000 +0100
+++ zlib-1.2.11.meson/LICENSE.build 2018-05-29 15:10:02.000000000 +0200
@@ -0,0 +1,19 @@
+Copyright (c) 2018 The Meson development team
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff -uNr zlib-1.2.11/meson.build zlib-1.2.11.meson/meson.build
--- zlib-1.2.11/meson.build 1970-01-01 01:00:00.000000000 +0100
+++ zlib-1.2.11.meson/meson.build 2018-06-20 18:09:04.498957829 +0200
@@ -0,0 +1,71 @@
+project('zlib', 'c', version : '1.2.11', license : 'zlib')
+
+cc = meson.get_compiler('c')
+
+link_args = []
+compile_args = []
+if cc.get_id() == 'msvc'
+ add_project_arguments('-D_CRT_SECURE_NO_DEPRECATE',
+ '-D_CRT_NONSTDC_NO_DEPRECATE', language : 'c')
+else
+ # Don't spam consumers of this wrap with these warnings
+ compile_args += cc.get_supported_arguments(['-Wno-implicit-fallthrough',
+ '-Wno-implicit-function-declaration'])
+ if cc.get_id() == 'gcc' and host_machine.system() != 'windows'
+ vflag = '-Wl,--version-script,@0@/zlib.map'.format(meson.current_source_dir())
+ link_args += [vflag]
+ endif
+endif
+
+src = files([
+ 'adler32.c',
+ 'crc32.c',
+ 'deflate.c',
+ 'infback.c',
+ 'inffast.c',
+ 'inflate.c',
+ 'inftrees.c',
+ 'trees.c',
+ 'zutil.c',
+ 'compress.c',
+ 'uncompr.c',
+ 'gzclose.c',
+ 'gzlib.c',
+ 'gzread.c',
+ 'gzwrite.c'])
+
+headers = files(['zconf.h', 'zlib.h'])
+
+if host_machine.system() == 'windows'
+ win = import('windows')
+ win_args = []
+ if cc.get_id() != 'msvc'
+ win_args += '-DGCC_WINDRES'
+ endif
+ src += win.compile_resources('win32/zlib1.rc', args : win_args)
+endif
+
+if get_option('solo')
+ compile_args += ['-DZ_SOLO']
+endif
+
+zlib = library('z', src,
+ c_args : compile_args,
+ link_args : link_args,
+ vs_module_defs : 'win32/zlib.def',
+ install : true)
+
+incdir = include_directories('.')
+
+zlib_dep = declare_dependency(
+ link_with : zlib,
+ include_directories : incdir)
+
+install_headers(headers)
+
+pkg = import('pkgconfig')
+
+pkg.generate(name: 'zlib',
+ description: 'zlib compression library',
+ version: '1.2.11',
+ libraries: zlib)
diff -uNr zlib-1.2.11/meson_options.txt zlib-1.2.11.meson/meson_options.txt
--- zlib-1.2.11/meson_options.txt 1970-01-01 01:00:00.000000000 +0100
+++ zlib-1.2.11.meson/meson_options.txt 2018-05-29 15:10:02.000000000 +0200
@@ -0,0 +1 @@
+option('solo', type: 'boolean', value: false, description: 'Build a minimal zlib without file I/O API')