Hello community, here is the log from the commit of package babl for openSUSE:Factory checked in at 2020-08-23 09:20:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/babl (Old) and /work/SRC/openSUSE:Factory/.babl.new.3399 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "babl" Sun Aug 23 09:20:28 2020 rev:52 rq:828142 version:0.1.80 Changes: -------- --- /work/SRC/openSUSE:Factory/babl/babl.changes 2020-06-14 18:16:04.646977446 +0200 +++ /work/SRC/openSUSE:Factory/.babl.new.3399/babl.changes 2020-08-23 09:20:29.970662518 +0200 @@ -1,0 +2,6 @@ +Mon Aug 10 08:00:19 UTC 2020 - Bjørn Lie <bjorn....@gmail.com> + +- Update to version 0.1.80: + + No upstream changes provided. + +------------------------------------------------------------------- @@ -7,3 +13,4 @@ - conversion. Added AV2 gamme u8->linear float conversions. VAPI file generation - for vala integration. Adjusted strategy for conversion selection, trades back - warm-up time for missing some fast multi-step conversions. + conversion. Added AV2 gamme u8->linear float conversions. + VAPI file generation for vala integration. Adjusted strategy + for conversion selection, trades back warm-up time for missing + some fast multi-step conversions. Old: ---- babl-0.1.78.tar.xz New: ---- babl-0.1.80.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ babl.spec ++++++ --- /var/tmp/diff_new_pack.xFuODs/_old 2020-08-23 09:20:30.530662827 +0200 +++ /var/tmp/diff_new_pack.xFuODs/_new 2020-08-23 09:20:30.534662830 +0200 @@ -19,7 +19,7 @@ %define debug_package_requires libbabl-0_1-0 = %{version}-%{release} Name: babl -Version: 0.1.78 +Version: 0.1.80 Release: 0 Summary: Dynamic Pixel Format Translation Library License: LGPL-3.0-or-later AND GPL-3.0-or-later ++++++ babl-0.1.78.tar.xz -> babl-0.1.80.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/babl/.gitignore new/babl-0.1.80/babl/.gitignore --- old/babl-0.1.78/babl/.gitignore 2020-06-07 19:38:51.880586000 +0200 +++ new/babl-0.1.80/babl/.gitignore 1970-01-01 01:00:00.000000000 +0100 @@ -1,8 +0,0 @@ -/*.la -/*.lo -/.deps -/.libs -/Makefile -/Makefile.in -/babl-version.h -/git-version.h diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/babl/babl-icc.c new/babl-0.1.80/babl/babl-icc.c --- old/babl-0.1.78/babl/babl-icc.c 2020-06-07 19:38:51.884585900 +0200 +++ new/babl-0.1.80/babl/babl-icc.c 2020-08-02 22:15:38.947836000 +0200 @@ -960,6 +960,8 @@ return ret; ret->space.icc_length = icc_length; ret->space.icc_profile = malloc (icc_length); + if (!ret->space.icc_profile) + return NULL; memcpy (ret->space.icc_profile, icc_data, icc_length); #ifdef HAVE_LCMS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/babl/babl-space.c new/babl-0.1.80/babl/babl-space.c --- old/babl-0.1.78/babl/babl-space.c 2020-06-07 19:38:51.888586000 +0200 +++ new/babl-0.1.80/babl/babl-space.c 2020-08-02 22:15:38.955821000 +0200 @@ -21,6 +21,7 @@ #include "config.h" #include "babl-internal.h" #include "base/util.h" +#include "babl-trc.h" static BablSpace space_db[MAX_SPACES]; @@ -1443,3 +1444,13 @@ if (blue_luminance) *blue_luminance = space->space.RGBtoXYZ[5]; } + +double +babl_space_get_gamma (const Babl *space) +{ + if (space->space.trc[0] != space->space.trc[1] || + space->space.trc[1] != space->space.trc[2] || + space->space.trc[0]->trc.type != BABL_TRC_FORMULA_GAMMA) + return 0.0; + return space->space.trc[0]->trc.gamma; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/babl/babl-trc.c new/babl-0.1.80/babl/babl-trc.c --- old/babl-0.1.78/babl/babl-trc.c 2020-06-07 19:38:51.888586000 +0200 +++ new/babl-0.1.80/babl/babl-trc.c 2020-08-02 22:15:38.959813800 +0200 @@ -611,3 +611,4 @@ return NULL; } + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/babl/babl.h new/babl-0.1.80/babl/babl.h --- old/babl-0.1.78/babl/babl.h 2020-06-07 19:38:51.892586000 +0200 +++ new/babl-0.1.80/babl/babl.h 2020-08-02 22:15:38.959813800 +0200 @@ -134,7 +134,14 @@ int icc_length, BablIccIntent intent, const char **error); - +/* babl_space_get_gamma: + * @space: a babl space + * + * Returns the gamma of the TRCs of the space, iff they are all equal + * and a simple gamma number, otherwise 0.0 is returned. + */ +double +babl_space_get_gamma (const Babl *space); // XXX : deprecated const Babl *babl_icc_make_space (const char *icc_data, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/babl/base/.gitignore new/babl-0.1.80/babl/base/.gitignore --- old/babl-0.1.78/babl/base/.gitignore 2020-06-07 19:38:51.892586000 +0200 +++ new/babl-0.1.80/babl/base/.gitignore 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +0,0 @@ -/Makefile -/Makefile.in -/.deps -/*.lo -/*.la -/.libs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/babl/base/meson.build new/babl-0.1.80/babl/base/meson.build --- old/babl-0.1.78/babl/base/meson.build 2020-06-07 19:38:51.892586000 +0200 +++ new/babl-0.1.80/babl/base/meson.build 2020-08-02 22:15:38.959813800 +0200 @@ -18,6 +18,6 @@ babl_base = static_library('babl_base', babl_base_sources, - include_directories: [ rootInclude, bablInclude, ], - dependencies: [ math, lcms], + include_directories: [rootInclude, bablInclude], + dependencies: [math, lcms], ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/babl/git-version.h new/babl-0.1.80/babl/git-version.h --- old/babl-0.1.78/babl/git-version.h 2020-06-07 19:38:52.256591800 +0200 +++ new/babl-0.1.80/babl/git-version.h 2020-08-02 22:15:39.470893400 +0200 @@ -1,6 +1,6 @@ #ifndef __GIT_VERSION_H__ #define __GIT_VERSION_H__ -#define BABL_GIT_VERSION "BABL_0_1_76-5-g24c3666" +#define BABL_GIT_VERSION "BABL_0_1_80" #endif /* __GIT_VERSION_H__ */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/babl/meson.build new/babl-0.1.80/babl/meson.build --- old/babl-0.1.78/babl/meson.build 2020-06-07 19:38:51.892586000 +0200 +++ new/babl-0.1.80/babl/meson.build 2020-08-02 22:15:38.963806400 +0200 @@ -1,67 +1,74 @@ -bablInclude = include_directories('.') -subdir('base') -python = import('python').find_installation() - -version_script = 'babl.map' -version_script_clang = 'babl.map.clang' +babl_library_build_dir = meson.current_build_dir() +bablInclude = include_directories('.') -babl_gnu_sym_path = join_paths(meson.current_source_dir(), 'test-gnu.map') -babl_clang_sym_path = join_paths(meson.current_source_dir(), 'test-clang.map') +subdir('base') -export_symbols = join_paths(meson.source_root(), 'export-symbols') -version_script_target = custom_target(version_script, - input : [ export_symbols, ] , - output: [ version_script ] , - command: [ - python, - join_paths(meson.source_root(), 'gen_babl_map.py'), - export_symbols, - version_script, - ], - capture: true, -) - # c compiler arguments babl_c_args = [ sse2_cflags, '-DLIBDIR="@0@"'.format(babl_libdir), ] +# symbol maps +version_script = custom_target('babl.map', + input : meson.source_root() / 'export-symbols', + output: ['babl.map', 'babl.map.clang'], + command: [ + find_program(meson.source_root() / 'gen_babl_map.py'), + '@INPUT@', + '@OUTPUT0@', + ], +) + # Linker arguments -if cc.links('', name: '-Wl,--version-script', args: ['-shared', '-Wl,--version-script=' + babl_gnu_sym_path]) - babl_link_args = ['-Wl,--version-script,' + version_script] -elif host_machine.system() == 'darwin' and cc.has_multi_link_arguments('-Wl,-exported_symbols_list', babl_clang_sym_path) - # Clang on Darwin - babl_link_args = ['-Wl,-exported_symbols_list',version_script_clang] +if cc.links('', + name: '-Wl,--version-script', + args: ['-shared', '-Wl,--version-script=' + + meson.current_source_dir() / 'test-gnu.map'] + ) + babl_link_args = [ + '-Wl,--version-script=' + version_script[0].full_path() + ] +elif cc.get_id() == 'clang' + if cc.links('', + name: '-Wl,-exported_symbols_list', + args: ['-Wl,-exported_symbols_list', + meson.current_source_dir() / 'test-clang.map'] + ) + # Clang on Darwin + babl_link_args = [ + '-Wl,-exported_symbols_list', version_script[1].full_path() + ] + else + # Clang on msys/mingw + babl_link_args = [] + endif else - error('Linker doesn\'t support --version-script or -exported_symbols_list') + error( + 'Linker doesn\'t support --version-script or -exported_symbols_list' + ) endif if platform_win32 - babl_link_args += '-Wl,--no-undefined' + babl_link_args += no_undefined endif - babl_version_h = configure_file( input: 'babl-version.h.in', output: 'babl-version.h', configuration: conf, ) - # If git is available, always check if git-version.h should be # updated. If git is not available, don't do anything if git-version.h # already exists because then we are probably working with a tarball # in which case the git-version.h we ship is correct. - -is_git_repo = ( - test_bin.found() and - git_bin.found() and - run_command(test_bin, '-d', meson.source_root() / '.git').returncode() == 0 -) - -if is_git_repo +if git_bin.found() and run_command( + git_bin, + 'rev-parse', + '--is-inside-work-tree', +).returncode() == 0 git_version_h = vcs_tag( input : 'git-version.h.in', output: 'git-version.h', @@ -69,18 +76,18 @@ command: [ git_bin.path(), 'describe', '--always' ], ) - meson.add_dist_script( - [ 'ninja', 'babl/git-version.h', ], - ) - meson.add_dist_script( - [ 'sh', '-c', ' '.join( - [ 'cp', git_version_h.full_path(), '${MESON_DIST_ROOT}/babl' ] - )] - ) - + if env_bin.found() + meson.add_dist_script( + [ 'ninja', 'babl/git-version.h', ], + ) + meson.add_dist_script( + [ 'sh', '-c', ' '.join( + [ 'cp', git_version_h.full_path(), '${MESON_DIST_ROOT}/babl' ] + )] + ) + endif else git_version_h = files('git-version.h') - endif babl_sources = [ @@ -135,34 +142,33 @@ babl = library( lib_name, babl_sources, - include_directories: [ rootInclude, bablBaseInclude], + include_directories: [rootInclude, bablBaseInclude], c_args: babl_c_args, - link_whole: [ babl_base, ], - link_args: [ babl_link_args, ], - dependencies: [ math, thread, dl, lcms, ], - link_depends: [ version_script_target, ], + link_whole: babl_base, + link_args: babl_link_args, + dependencies: [math, thread, dl, lcms], + link_depends: version_script, version: so_version, install: true, ) -if get_option('enable-gir') +if build_gir # identity filter, so GIR doesn't choke on the Babl type # (since it has the same name as the Babl namespace) - identfilter_py = join_paths(meson.current_source_dir(), 'identfilter.py') - babl_gir = gnome.generate_gir(babl, sources: babl_headers, extra_args: [ - '--identifier-filter-cmd=@0@ @1@'.format(python.path(), identfilter_py), + '--identifier-filter-cmd=@0@ @1@'.format(python.path(), + meson.current_source_dir() / 'identfilter.py'), '-DBABL_IS_BEING_COMPILED', ], namespace: 'Babl', - nsversion: '0.1', + nsversion: api_version, header: 'babl.h', install: true, ) - if get_option('enable-vapi') + if build_vapi gnome.generate_vapi(lib_name, sources: babl_gir[0], install: true, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/docs/.gitignore new/babl-0.1.80/docs/.gitignore --- old/babl-0.1.78/docs/.gitignore 2020-06-07 19:38:51.896586200 +0200 +++ new/babl-0.1.80/docs/.gitignore 1970-01-01 01:00:00.000000000 +0100 @@ -1,7 +0,0 @@ -/BablFishPath.html -/BablFishPath.txt -/Makefile -/Makefile.in -/changelog.rss -/index-static.html -/index.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/docs/graphics/.gitignore new/babl-0.1.80/docs/graphics/.gitignore --- old/babl-0.1.78/docs/graphics/.gitignore 2020-06-07 19:38:51.896586200 +0200 +++ new/babl-0.1.80/docs/graphics/.gitignore 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +0,0 @@ -/*.png -/Makefile.in -/Makefile diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/docs/graphics/meson.build new/babl-0.1.80/docs/graphics/meson.build --- old/babl-0.1.78/docs/graphics/meson.build 2020-06-07 19:38:51.896586200 +0200 +++ new/babl-0.1.80/docs/graphics/meson.build 2020-08-02 22:15:38.971791500 +0200 @@ -14,26 +14,20 @@ copy: true ) -foreach file : graphic_files +foreach _file : graphic_files # Copy svg files to build graphic_files_install += configure_file( - input: file, + input: _file, output: '@PLAINNAME@', copy: true ) endforeach if rsvg_convert_bin.found() - foreach file : graphic_files - sizeinfo = ( - file.contains('a4poster') - ? [ '-w', '256', ] - : [] - ) - - graphic_files_install += custom_target( - file, - input: file, + foreach _file : graphic_files + sizeinfo = _file.contains('a4poster') ? ['-w', '256'] : [] + graphic_files_install += custom_target(_file, + input: _file, output: '@BASENAME@.png', command: [ rsvg_convert_bin, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/docs/index-static.html.in new/babl-0.1.80/docs/index-static.html.in --- old/babl-0.1.78/docs/index-static.html.in 2020-06-07 19:38:51.896586200 +0200 +++ new/babl-0.1.80/docs/index-static.html.in 2020-08-02 22:15:38.971791500 +0200 @@ -79,8 +79,8 @@ </p> <pre>git clone https://gitlab.gnome.org/GNOME/babl.git/</pre> - <a name='NEWS'></a> - <h2>NEWS</h2> + <a name='News'></a> + <h2>News</h2> <p>The following is a list of the major changes that have gone into each babl release. If there are significant improvements to babl when @@ -88,7 +88,8 @@ to the GEGL release.</p> <!--NEWS--> - For more detailed changes see git log. + + <p>For more detailed changes see git log.</p> <a name='Usage'></a> @@ -275,7 +276,7 @@ version 3 of the License, or (at your option) any later version. </p> <a name='Authors'></a> - <h3>Authors</h3> + <h2>Authors</h2> <!--AUTHORS--> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/docs/meson.build new/babl-0.1.80/docs/meson.build --- old/babl-0.1.78/docs/meson.build 2020-06-07 19:38:51.896586200 +0200 +++ new/babl-0.1.80/docs/meson.build 2020-08-02 22:15:38.971791500 +0200 @@ -5,7 +5,10 @@ scptarget = host + ':' + location + '/' -xml_insert = find_program(join_paths('tools', 'xml_insert.sh')) +xml_insert = find_program( + meson.source_root() / 'tools' / 'xml-insert.py', + native: true +) index_static_html = configure_file( input : 'index-static.html.in', @@ -20,130 +23,85 @@ ) index_html_tmp_env = [ - 'BABL_PATH='+ join_paths(meson.build_root(), 'extensions'), + 'BABL_PATH=' + babl_extensions_build_dir, ] -index_html_tmp = custom_target('index.html.tmp', - input : [ babl_html_dump, ], - output: [ 'index.html.tmp', ], - command: [ - env_bin, - index_html_tmp_env, - babl_html_dump - ], - capture: true, -) - -index_html = custom_target('index.html', - input : [ - index_static_html, - join_paths(meson.source_root(), 'AUTHORS'), - join_paths(meson.source_root(), 'TODO'), - join_paths(meson.source_root(), 'NEWS'), - 'toc', - ], - output: [ 'index.html', ], - command: [ - env_bin, - 'cp', '@INPUT0@', '@OUTPUT@', - '&&', xml_insert, '@OUTPUT@', 'AUTHORS', '@INPUT1@', - '&&', xml_insert, '@OUTPUT@', 'TODO', '@INPUT2@', - '&&', xml_insert, '@OUTPUT@', 'NEWS', '@INPUT3@', - '&&', xml_insert, '@OUTPUT@', 'TOC', '@INPUT4@', - ], - build_by_default: true, -) - -Reference_html = custom_target('Reference.html', - input : [ - 'Reference-static.html', - 'toc', - index_html_tmp, - ], - output: [ 'Reference.html', ], - command: [ - env_bin, - 'cp', '@INPUT0@', '@OUTPUT@', - '&&', xml_insert, '@OUTPUT@', 'TOC', '@INPUT1@', - '&&', xml_insert, '@OUTPUT@', 'BablBase', '@INPUT2@', - ], - build_by_default: true, -) +# Don't build babl ref if cannot run compiled objects in this env +if env_bin.found() and can_run_host_binaries + index_html_tmp = custom_target('index.html.tmp', + input : babl_html_dump, + output:'index.html.tmp', + command: [ + env_bin, + index_html_tmp_env, + babl_html_dump + ], + capture: true, + ) +else + warning('Cannot create babl reference in this environment') + index_html_tmp = 'index.html.tmp' +endif + +TOC = files('toc') +html_files = { + 'index': [index_static_html, [ + ['AUTHORS', files(meson.source_root() / 'AUTHORS')], + ['TODO', files(meson.source_root() / 'TODO')], + ['NEWS', files(meson.source_root() / 'NEWS')], + ['TOC', TOC], + ]], + 'Reference': ['auto', [ + ['BablBase', index_html_tmp], + ['TOC', TOC], + ]], + 'CMYK': ['auto', [ + ['TOC', TOC] + ]], + 'OldNews': ['auto', [ + ['TOC', TOC], + ]], + 'Glossary': ['auto', [ + ['TOC', TOC], + ]], + 'ColorManagement': ['auto', [ + ['TOC', TOC], + ]], + 'UnifiedAlpha': ['auto', [ + ['TOC', TOC], + ]], +} + +foreach _file, _parms : html_files + if '@0@'.format(_parms[0]) == 'auto' + _in = '@0...@-static.html'.format(_file) + else + _in = _parms[0] + endif + _out = '@0@.html'.format(_file) + + inserts = [] + foreach _parm : _parms[1] + inserts += ['--insert', _parm[0], _parm[1]] + endforeach + + _tgt = custom_target(_out, + input: _in, + output: _out, + command: [ + xml_insert, + '--output' , '@OUTPUT@', + inserts, + '@INPUT@', + ], + build_by_default: true + ) + if _file == 'index' + index_html = _tgt + endif +endforeach -CMYK_html = custom_target('CMYK.html', - input : [ - 'CMYK-static.html', - 'toc', - ], - output: [ 'CMYK.html', ], - command: [ - env_bin, - 'cp', '@INPUT0@', '@OUTPUT@', - '&&', xml_insert, '@OUTPUT@', 'TOC', '@INPUT1@', - ], - build_by_default: true, -) - -OldNews_html = custom_target('OldNews.html', - input : [ - 'OldNews-static.html', - 'toc', - ], - output: [ 'OldNews.html', ], - command: [ - env_bin, - 'cp', '@INPUT0@', '@OUTPUT@', - '&&', xml_insert, '@OUTPUT@', 'TOC', '@INPUT1@', - ], - build_by_default: true, -) - - - -Glossary_html = custom_target('Glossary.html', - input : [ - 'Glossary-static.html', - 'toc', - ], - output: [ 'Glossary.html', ], - command: [ - env_bin, - 'cp', '@INPUT0@', '@OUTPUT@', - '&&', xml_insert, '@OUTPUT@', 'TOC', '@INPUT1@', - ], - build_by_default: true, -) - - -ColorManagement_html = custom_target('ColorManagement.html', - input : [ - 'ColorManagement-static.html', - 'toc', - ], - output: [ 'ColorManagement.html', ], - command: [ - env_bin, - 'cp', '@INPUT0@', '@OUTPUT@', - '&&', xml_insert, '@OUTPUT@', 'TOC', '@INPUT1@', - ], - build_by_default: true, -) - -UnifiedAlpha_html = custom_target('UnifiedAlpha.html', - input : [ - 'UnifiedAlpha-static.html', - 'toc', - ], - output: [ 'UnifiedAlpha.html', ], - command: [ - env_bin, - 'cp', '@INPUT0@', '@OUTPUT@', - '&&', xml_insert, '@OUTPUT@', 'TOC', '@INPUT1@', - ], - build_by_default: true, -) - run_target('push_web', command: [ 'scp', index_html, index_static_html, babl_css, scptarget, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/docs/toc new/babl-0.1.80/docs/toc --- old/babl-0.1.78/docs/toc 2020-06-07 19:38:51.896586200 +0200 +++ new/babl-0.1.80/docs/toc 2020-08-02 22:15:38.971791500 +0200 @@ -19,6 +19,7 @@ <li><a href='index.html#Environment'> Environment</a></li> <li><a href='index.html#Extending'> Extending</a></li> <li><a href='index.html#DirectoryOverview'> Directory Overview</a></li> + <li><a href='index.html#News'> News</a></li> <li><a href='index.html#TODO'> Todo</a></li> <li><a href='index.html#Copyright'> Copyright</a></li> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/docs/tools/xml_insert.sh new/babl-0.1.80/docs/tools/xml_insert.sh --- old/babl-0.1.78/docs/tools/xml_insert.sh 2020-06-07 19:38:51.896586200 +0200 +++ new/babl-0.1.80/docs/tools/xml_insert.sh 1970-01-01 01:00:00.000000000 +0100 @@ -1,103 +0,0 @@ -#!/bin/sh -# -# Utility script to merge an xml snippet from one file into a document. -# -# To insert the file foo.inc into bar.xml, -# after the first line containing the marker <!--foo--> enter -# -# xml_insert.sh bar.xml foo foo.inc -# -# 2005 © Øyvind Kolås -# -# FIXME: add argument checking / error handling - -: ${AWK="awk"} -: ${ECHO="echo"} -: ${MKDIR="mkdir"} -: ${SED="sed"} -: ${Xsed="$SED -e 1s/^X//"} - -# Global variables: -EXIT_SUCCESS=0 -EXIT_FAILURE=1 - -dirname="s,/[[^/]]*$,," -basename="s,^.*/,," - -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" - -# The name of this program: -# In the unlikely event $progname began with a '-', it would play havoc with -# func_echo (imagine progname=-n), so we prepend ./ in that case: -progname=`$ECHO "X$progpath" | $Xsed -e "$basename" -e 's,^-,./-,'` - -# func_error arg... -# Echo program name prefixed message to standard error. -func_error () -{ - $ECHO "$progname: "${1+"$@"} 1>&2 -} - -# func_fatal_error arg... -# Echo program name prefixed message to standard error, and exit. -func_fatal_error () -{ - func_error ${1+"$@"} - exit $EXIT_FAILURE -} - -# func_mktempdir [string] -# Make a temporary directory that won't clash with other running -# processes, and avoids race conditions if possible. If -# given, STRING is the basename for that directory. -func_mktempdir () -{ - my_template="${TMPDIR-/tmp}/${1-$progname}" - - if test "$opt_dry_run" = ":"; then - # Return a directory name, but don't create it in dry-run mode - my_tmpdir="${my_template}-$$" - else - - # If mktemp works, use that first and foremost - my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` - - if test ! -d "$my_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" - - save_mktempdir_umask=`umask` - umask 0077 - $MKDIR "$my_tmpdir" - umask $save_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$my_tmpdir" || \ - func_fatal_error "cannot create temporary directory \`$my_tmpdir'" - fi - - $ECHO "X$my_tmpdir" | $Xsed -} - -tmp_dir="`func_mktempdir`" -tmp_file="$tmp_dir/one" - -cp $1 $tmp_file - -numlines=`wc -l $tmp_file | $AWK '{print $1;}'` -splitno=`$AWK "/<!--$2-->/ { print NR; exit 0; }" $tmp_file` -tailno=`expr $numlines - $splitno` - -head -$splitno $tmp_file > $1 -cat $3 >> $1 -tail -$tailno $tmp_file >> $1 - -rm -rf $tmp_dir - -exit $? diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/export-symbols new/babl-0.1.80/export-symbols --- old/babl-0.1.78/export-symbols 2020-06-07 19:38:51.896586200 +0200 +++ new/babl-0.1.80/export-symbols 2020-08-02 22:15:38.971791500 +0200 @@ -56,6 +56,7 @@ babl_space_with_trc babl_space_is_cmyk babl_space_is_gray +babl_space_get_gamma babl_icc_make_space babl_icc_get_key babl_ticks diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/extensions/.gitignore new/babl-0.1.80/extensions/.gitignore --- old/babl-0.1.78/extensions/.gitignore 2020-06-07 19:38:51.896586200 +0200 +++ new/babl-0.1.80/extensions/.gitignore 1970-01-01 01:00:00.000000000 +0100 @@ -1,7 +0,0 @@ -/*.lo -/*.la -/*.so -/.deps -/.libs -/Makefile -/Makefile.in diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/extensions/meson.build new/babl-0.1.80/extensions/meson.build --- old/babl-0.1.78/extensions/meson.build 2020-06-07 19:38:51.904586300 +0200 +++ new/babl-0.1.80/extensions/meson.build 2020-08-02 22:15:38.979776900 +0200 @@ -1,3 +1,5 @@ +babl_extensions_build_dir = meson.current_build_dir() + no_cflags = [] # Dependencies @@ -16,7 +18,7 @@ babl_ext_link_args = [ ] if platform_win32 - babl_ext_link_args += '-Wl,--no-undefined' + babl_ext_link_args += no_undefined endif @@ -41,7 +43,7 @@ ['HSV', no_cflags], ['naive-CMYK', no_cflags], ['simple', no_cflags], - ['sse-half', [sse4_1_cflags, f16c_cflags]], + ['sse-half', [sse4_1_cflags, f16c_cflags]], ['sse2-float', sse2_cflags], ['sse2-int16', sse2_cflags], ['sse2-int8', sse2_cflags], @@ -62,6 +64,6 @@ dependencies: babl_ext_dep, name_prefix: '', install: true, - install_dir: join_paths(get_option('libdir'), lib_name), + install_dir: babl_libdir / lib_name, ) endforeach diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/gen_babl_map.py new/babl-0.1.80/gen_babl_map.py --- old/babl-0.1.78/gen_babl_map.py 2020-06-07 19:38:51.908586300 +0200 +++ new/babl-0.1.80/gen_babl_map.py 2020-08-02 22:15:38.987762000 +0200 @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + import sys export_symbols=sys.argv[1] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/meson.build new/babl-0.1.80/meson.build --- old/babl-0.1.78/meson.build 2020-06-07 19:38:51.908586300 +0200 +++ new/babl-0.1.80/meson.build 2020-08-02 22:15:38.987762000 +0200 @@ -1,11 +1,8 @@ project('babl', 'c', license: 'LGPL3+', - version: '0.1.78', - meson_version: '>=0.50.0', + version: '0.1.80', + meson_version: '>=0.54.0', default_options: [ - 'sysconfdir=/etc', - 'localstatedir=/var', - 'sharedstatedir=/var/lib', 'buildtype=debugoptimized' ], # https://gitlab.gnome.org/GNOME/babl/issues/ @@ -20,13 +17,11 @@ # if backwards compatibility has been broken, # set BABL_BINARY_AGE _and_ BABL_INTERFACE_AGE to 0. - conf = configuration_data() pkgconfig = import('pkgconfig') -i18n = import('i18n') gnome = import('gnome') -python = import('python') +python = import('python').find_installation() cc = meson.get_compiler('c') prefix = get_option('prefix') @@ -81,9 +76,6 @@ platform_win32 = false host_cpu_family = host_machine.cpu_family() -message('Host machine cpu family: ' + host_cpu_family) - -host_cpu_family = host_machine.cpu_family() if host_cpu_family == 'x86' have_x86 = true conf.set10('ARCH_X86', true) @@ -148,8 +140,12 @@ build_os.startswith('cygwin') or build_os.startswith('windows')) -# Only run cross compile objects if we have exe wrapper -cc_can_run = not meson.is_cross_build() or meson.has_exe_wrapper() +# Only try to run compiled programs if native compile or cross-compile +# and have exe wrapper. If we don't need a wrapper (e.g. 32 bit build in +# 64-bit environment) then set proprty has_exe_wrapper=true in cross +# file +can_run_host_binaries = meson.has_exe_wrapper() + ################################################################################ # Compiler arguments @@ -159,7 +155,9 @@ if buildtype == 'debugoptimized' or buildtype == 'release' common_c_flags += cc.get_supported_arguments(['-Ofast']) endif -common_c_flags += cc.get_supported_arguments(['-fno-unsafe-math-optimizations']) +common_c_flags += cc.get_supported_arguments( + ['-fno-unsafe-math-optimizations'] +) extra_warnings_list = [ '-Wdeclaration-after-statement', @@ -173,31 +171,48 @@ add_project_arguments(common_c_flags, language: 'c') +# Linker arguments +if platform_win32 and cc.has_link_argument('-Wl,--no-undefined') + no_undefined = '-Wl,--no-undefined' +else + no_undefined = [] +endif + + ################################################################################ # Check for compiler CPU extensions # intialize these to nothing, so meson doesn't complain on non-x86 +have_mmx = false +have_sse = false +have_sse2 = false +have_sse4_1 = false +have_avx2 = false +have_f16c = false + sse2_cflags = [] f16c_cflags = [] sse4_1_cflags = [] avx2_cflags = [] # mmx assembly -if cc.has_argument('-mmmx') and get_option('enable-mmx') +if get_option('enable-mmx') and cc.has_argument('-mmmx') if cc.compiles('asm ("movq 0, %mm0");') message('mmx assembly available') add_project_arguments('-mmmx', language: 'c') conf.set('USE_MMX', 1, description: 'Define to 1 if MMX assembly is available.') + have_mmx = true # sse assembly - if cc.has_argument('-msse') and get_option('enable-sse') + if get_option('enable-sse') and cc.has_argument('-msse') if cc.compiles('asm ("movntps %xmm0, 0");') add_project_arguments('-msse', language: 'c') message('sse assembly available') conf.set('USE_SSE', 1, description: 'Define to 1 if SSE assembly is available.') + have_sse = true sse_args = ['-mfpmath=sse'] if platform_win32 sse_args += '-mstackrealign' @@ -210,36 +225,39 @@ endforeach # sse2 assembly - if cc.has_argument('-msse2') and get_option('enable-sse2') + if get_option('enable-sse2') and cc.has_argument('-msse2') if cc.compiles('asm ("punpckhwd %xmm0,%xmm1");') message('sse2 assembly available') sse2_cflags = '-msse2' conf.set('USE_SSE2', 1, description: 'Define to 1 if sse2 assembly is available.') + have_sse2 = true # sse4.1 assembly - if cc.has_argument('-msse4.1') and get_option('enable-sse4_1') + if get_option('enable-sse4_1') and cc.has_argument('-msse4.1') if cc.compiles('asm ("pmovzxbd %xmm0,%xmm1");') message('sse4.1 assembly available') sse4_1_cflags = '-msse4.1' conf.set('USE_SSE4_1', 1, description: 'Define to 1 if sse4.1 assembly is available.') + have_sse4_1 = true endif # avx2 assembly - if cc.has_argument('-mavx2') and get_option('enable-avx2') + if get_option('enable-avx2') and cc.has_argument('-mavx2') if cc.compiles('asm ("vpgatherdd %ymm0,(%eax,%ymm1,4),%ymm2");') message('avx2 assembly available') avx2_cflags = '-mavx2' conf.set('USE_AVX2', 1, description: 'Define to 1 if avx2 assembly is available.') + have_avx2 = true endif endif endif endif endif endif - if cc.has_argument('-mf16c') and get_option('enable-f16c') + if get_option('enable-f16c') and cc.has_argument('-mf16c') if cc.compiles( 'asm ("#include <immintrin.h>],' + '[__m128 val = _mm_cvtph_ps ((__m128i)_mm_setzero_ps());' + @@ -249,6 +267,7 @@ f16c_cflags = '-mf16c' conf.set('USE_F16C', 1, description: 'Define to 1 if f16c intrinsics are available.') + have_f16c = true endif endif endif @@ -304,17 +323,6 @@ ################################################################################ # Dependencies -# LCMS -if get_option('with-lcms') - lcms = dependency('lcms2', required: true, native: false) - if lcms.found() - conf.set('HAVE_LCMS', 1, description: - 'Define to 1 if liblcms2 is available') - endif -else - lcms = declare_dependency() -endif - math = cc.find_library('m', required: false) thread = dependency('threads', required: false) if platform_android @@ -329,29 +337,74 @@ endif +# gobject introspection +g_ir = dependency('gobject-introspection-1.0', version: '>=1.32.0', + required: false) + +# lcms +if get_option('with-lcms') + lcms = dependency('lcms2', version: '>=2.8', required: true) + if lcms.found() + conf.set('HAVE_LCMS', 1, description: + 'Define to 1 if liblcms2 is available') + endif +else + lcms = declare_dependency() +endif + +# vapigen +vapigen = dependency('vapigen', version:'>=0.20.0', required: false) + + ################################################################################ # Build utilities -env_bin = find_program('env', required: false, native: true) +# build from git repo git_bin = find_program('git', required: false, native: true) + +# docs +env_bin = find_program('env', required: false, native: true) rsvg_convert_bin = find_program('rsvg-convert', required: false, native: true) -test_bin = find_program('test', required: false, native: true) w3m_bin = find_program('w3m', required: false, native: true) + ################################################################################ # Build flags -build_docs = false - -if get_option('with-docs') - if cc_can_run and env_bin.found() and not platform_win32 - build_docs = true - else - warning('Unable to generate docs in this environment') +# Docs - don't build by default in cross-build environments +# can't build if no env binary +build_docs = true +if get_option('with-docs') != 'false' and not env_bin.found() + build_docs = false + warning('env is required to build documentation') +elif get_option('with-docs') == 'auto' + if meson.is_cross_build() + build_docs = false + message( + 'configure with -Ddocs=true to cross-build documentation' + ) endif +elif get_option('with-docs') == 'false' + build_docs = false endif +# Introspection - don't build by default on cross-build environments +if get_option('enable-gir') == 'auto' + build_gir = meson.is_cross_build() ? false : true +else + build_gir = get_option('enable-gir') == 'true' ? true : false +endif +if not g_ir.found() + build_gir = false +endif + +# Vapi - only build if building introspection +if build_gir and get_option('enable-vapi') and vapigen.found() + build_vapi = true +else + build_vapi = false +endif ################################################################################ # Configuration files @@ -376,6 +429,7 @@ subdir('docs') endif +# Create README file from web page if w3m_bin.found() and build_docs custom_target('README', input: index_html, @@ -387,6 +441,7 @@ '@INPUT@', ], capture: true, + build_by_default: true ) endif @@ -404,3 +459,34 @@ lib_name, ], ) + +################################################################################ +# Build summary +summary( + { + 'prefix': babl_prefix, + 'libdir': get_option('libdir'), + }, section: 'Directories' +) +summary( + { + 'BABL docs' : build_docs, + 'Introspection' : build_gir, + 'VALA support' : build_vapi, + }, section: 'Optional features' +) +summary( + { + 'mmx' : have_mmx, + 'sse' : have_sse, + 'sse2' : have_sse2, + 'sse4_1' : have_sse4_1, + 'avx2' : have_avx2, + 'f16c (half fp)' : have_f16c, + }, section: 'Processor extensions' +) +summary( + { + 'lcms' : get_option('with-lcms'), + }, section: 'Optional dependencies' +) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/meson_options.txt new/babl-0.1.80/meson_options.txt --- old/babl-0.1.78/meson_options.txt 2020-06-07 19:38:51.908586300 +0200 +++ new/babl-0.1.80/meson_options.txt 2020-08-02 22:15:38.987762000 +0200 @@ -1,11 +1,55 @@ -option('enable-mmx', type: 'boolean', value: true, description: 'enable MMX support') -option('enable-sse', type: 'boolean', value: true, description: 'enable SSE support') -option('enable-sse2', type: 'boolean', value: true, description: 'enable SSE2 support') -option('enable-sse3', type: 'boolean', value: true, description: 'enable SSE3 support') -option('enable-sse4_1', type: 'boolean', value: true, description: 'enable SSE4.1 support') -option('enable-avx2', type: 'boolean', value: true, description: 'enable AVX2 support') -option('enable-f16c', type: 'boolean', value: true, description: 'enable hardware half-float support') -option('enable-gir', type: 'boolean', value: true, description: 'enable GObject-Introspection (GIR)') -option('enable-vapi', type: 'boolean', value: true, description: 'enable Vala .vapi generation (requires GIR)') -option('with-docs', type: 'boolean', value: true, description: 'build website') -option('with-lcms', type: 'boolean', value: true, description: 'build with lcms') +# Optional features +option('with-docs', + type: 'combo', + choices: ['auto', 'true', 'false'], + description: 'build documentation' +) +option('enable-gir', + type: 'combo', + choices: ['auto', 'true', 'false'], + description: 'gobject introspection .gir generation' +) +option('enable-vapi', + type: 'boolean', + value: 'true', + description: 'Vala .vapi generation - depends on introspection' +) + +# Compiler extensions +option('enable-mmx', + type: 'boolean', + value: 'true', + description: 'MMX support - disables all compiler extensons' +) +option('enable-sse', + type: 'boolean', + value: 'true', + description: 'SSE support - depends on MMX' +) +option('enable-sse2', + type: 'boolean', + value: 'true', + description: 'SSE2 support - depends on SSE' +) +option('enable-sse4_1', + type: 'boolean', + value: 'true', + description: 'SSE4.1 support - depends on SSE2' +) +option('enable-avx2', + type: 'boolean', + value: 'true', + description: 'AVX2 support - depends on SSE4.1' +) +option('enable-f16c', + type: 'boolean', + value: 'true', + description: 'Hardware half-float support - depends on SSE' +) + +# Optional dependencies +option('with-lcms', + type: 'boolean', + value: 'true', + description: 'build with lcms' +) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/tests/.gitignore new/babl-0.1.80/tests/.gitignore --- old/babl-0.1.78/tests/.gitignore 2020-06-07 19:38:51.908586300 +0200 +++ new/babl-0.1.80/tests/.gitignore 1970-01-01 01:00:00.000000000 +0100 @@ -1,40 +0,0 @@ -/.deps -/.libs -/*.o -/*.exe -/*.trs -/*.log -/Makefile -/Makefile.in -/babl-html-dump -/babl_class_name -/babl_fish_path_dhtml -/babl_fish_path_fitness -/cairo-RGB24 -/concurrency-stress-test -/conversions -/extract -/float-to-8bit -/floatclamp -/formats -/grayscale_to_rgb -/introspect -/models -/n_components -/nop -/palette -/rgb_to_bgr -/rgb_to_lab_to_rgb -/rgb_to_ycbcr -/rgb_to_ycbcr_to_rgb -/sanity -/srgb_to_lab_u8 -/types -/hsva -/hsl -/cairo_cmyk_hack -/chromaticities -/format_with_space -/n_components_cast -/palette-concurrency-stress-test -/transparent diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/tests/meson.build new/babl-0.1.80/tests/meson.build --- old/babl-0.1.78/tests/meson.build 2020-06-07 19:38:51.908586300 +0200 +++ new/babl-0.1.80/tests/meson.build 2020-08-02 22:15:38.987762000 +0200 @@ -34,16 +34,14 @@ endif test_env = environment() -test_env.prepend('LD_LIBRARY_PATH', join_paths(meson.build_root(), 'babl')) -test_env.set('GI_TYPELIB_PATH', join_paths(meson.build_root(), 'babl')) -test_env.set('BABL_PATH', join_paths(meson.build_root(), 'extensions')) +test_env.set('BABL_PATH', babl_extensions_build_dir) + foreach test_name : test_names - test = executable( - test_name, + test = executable(test_name, test_name + '.c', - include_directories: [ rootInclude, bablInclude, ], - link_with: [ babl, ], - dependencies: [ thread, ], + include_directories: [rootInclude, bablInclude], + link_with: babl, + dependencies: thread, export_dynamic: true, install: false, ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/tools/.gitignore new/babl-0.1.80/tools/.gitignore --- old/babl-0.1.78/tools/.gitignore 2020-06-07 19:38:51.912586500 +0200 +++ new/babl-0.1.80/tools/.gitignore 1970-01-01 01:00:00.000000000 +0100 @@ -1,16 +0,0 @@ -/*.o -/.deps -/.libs -/Makefile -/Makefile.in -/babl-gen-test-pixels -/babl_fish_path_fitness -/babl-benchmark -/babl-html-dump -/babl-icc-dump -/babl-icc-rewrite -/babl-verify -/conversions -/formats -/introspect -/trc-validator diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/tools/meson.build new/babl-0.1.80/tools/meson.build --- old/babl-0.1.78/tools/meson.build 2020-06-07 19:38:51.912586500 +0200 +++ new/babl-0.1.80/tools/meson.build 2020-08-02 22:15:38.991754500 +0200 @@ -15,9 +15,9 @@ foreach tool_name : tool_names tool = executable(tool_name, tool_name + '.c', - include_directories: [ rootInclude, bablInclude, ], - link_with: [ babl, ], - dependencies: [ math, thread, ], + include_directories: [rootInclude, bablInclude], + link_with: babl, + dependencies: [math, thread], install: false, ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/babl-0.1.78/tools/xml-insert.py new/babl-0.1.80/tools/xml-insert.py --- old/babl-0.1.78/tools/xml-insert.py 1970-01-01 01:00:00.000000000 +0100 +++ new/babl-0.1.80/tools/xml-insert.py 2020-08-02 22:15:38.991754500 +0200 @@ -0,0 +1,110 @@ +#!/usr/bin/env python3 +# +# Utility script to insert an xml snippet into an existing document +# +# Re-implements xml_insert.sh in python with extra options to send the +# output to a new file. +# +# Copyright John Marshall 2020 +# + +from __future__ import print_function + +import os +import sys +import argparse + +class Args(): + def __init__(self): + parser = argparse.ArgumentParser() + parser.add_argument( + '--output', + metavar='OUTPUT_FILE', + help='output file - otherwise output to STDOUT' + ) + parser.add_argument( + '--insert', + action='append', + nargs=2, + required=True, + metavar=('TAG', 'INSERT_FILE'), + help='insert file tag and file name' + ) + parser.add_argument( + 'FILE', + metavar='INPUT_FILE', + help='input file' + ) + + self.input = os.path.realpath(parser.parse_args().FILE) + if parser.parse_args().output: + self.output = os.path.realpath(parser.parse_args().output) + else: + self.output = None + self.inserts = parser.parse_args().insert + + +def main(): + args = Args() + + try: + in_file = open(args.input, 'r') + except IOError: + print('cannot access input file ' + args.input, + file=sys.stderr) + sys.exit(1) + + doc = in_file.read().splitlines() + in_file.close() + + # get insert files + inserts = args.inserts + for insert in inserts: + ins_tag = '<!--' + insert[0] + '-->' + + # find tag instances in input file + indices = [] + for i, line in enumerate(doc): + if ins_tag in line: + indices.append(i) + + if not indices: + print(ins_tag + ' not in input file - skipping', + file=sys.stderr) + continue + + # read in insert file + try: + ins_file = open(os.path.realpath(insert[1]), 'r') + except IOError: + print ('cannot open insert file %s - skipping' % insert[1], + file=sys.stderr) + continue + + if ins_file: + ins_doc = ins_file.read().splitlines() + ins_file.close() + + # insert in reverse order so that remaining inert positions + # remain valid + for index in reversed(indices): + doc[index+1:index+1] = ins_doc + + # output to file or stdout + if args.output: + try: + out_file = open(os.path.realpath(args.output), 'w') + except IOError: + print('cannot open output file %s' % args.output) + sys.exit(1) + else: + out_file = sys.stdout + + for line in doc: + print(line, file=out_file) + + sys.exit(0) + + +if __name__ == "__main__": + main() \ No newline at end of file