Skip to content
Commits on Source (7)
  • Øyvind Kolås's avatar
    post release version bump · f01acc74
    Øyvind Kolås authored
    f01acc74
  • John's avatar
    build: subproject improvements: · 4383ee86
    John authored
     - don't expose source in dependency to avoid name clashes
     - add babl path variables to dependency object
     - add babl path variables to uninstalled pc
    4383ee86
  • Øyvind Kolås's avatar
    build: remove push_web target · 0a87f731
    Øyvind Kolås authored
    ci/meson has started failing due to missing scp binary.
    0a87f731
  • Jehan's avatar
    babl: do not append space to the format name when explicitly set. · 4c7c2b75
    Jehan authored
    When a format is named explicitly by the caller, we should just keep the
    same name, not tweak it. Generating a name is only valid when no
    explicit name is given. Moreover this is the behavior as described in
    the docs of babl_format_new():
    
    > If no name is provided a (long) descriptive name is used.
    
    (which usually implies that with a name provided, this one will be used
    instead of a generated name)
    
    This is especially important for palette formats for which name is
    mostly not descriptive anyway (either caller-set or generated by babl
    with incremental number) and this fixes a bug when calling
    babl_new_palette_with_space() with the same name and space would fail to
    find the already created formats (yet would find the models and return
    NULL for both formats) because it would search without the space
    description appended. Yet the docs of babl_new_palette*() clearly says
    as well:
    
    > If you pass in the same name the previous formats will be provided
    > again.
    
    Moreover we actually already tweak a bit the palette format name by
    appending the space pointer. No need to tweak it twice appending the
    same information (space) in a different way.
    
    See also: https://gitlab.gnome.org/GNOME/gimp/-/issues/6501
    4c7c2b75
  • Jehan's avatar
    babl: re-creation of palette conversions must always set data. · 69e6b090
    Jehan authored
    If we allow conversions to be recreated for palettes, it will create a
    new identical conversion with collision number incremented in the name
    and no user data. Yet the user data is extremely important for palette
    conversions, because it contains the palette itself which is required by
    the palette conversion functions. Hence we end up crashing.
    
    Moreover, although I think that right now, only palette conversions use
    the data field, it might be used for other type of data in the future.
    In any case, we should always save this data along as it has been stored
    there for a reason.
    
    Finally in babl-palette code, make sure the user data is added to the
    models before creating the formats and conversions as we also ended up
    in crash-happy code when we didn't.
    
    See: https://gitlab.gnome.org/GNOME/gimp/-/issues/6501
    69e6b090
  • Øyvind Kolås's avatar
    release 0.1.88 · d4984bc2
    Øyvind Kolås authored
    d4984bc2
  • Jeremy Bicha's avatar
    New upstream version 0.1.88 · 60a279e1
    Jeremy Bicha authored
    60a279e1
......@@ -3,6 +3,9 @@ The NEWS file in the babl source tree is the source location for
the news section both in the README and the webpage.
-->
2021-07-01 babl-0.1.88 </dt><dd>
Consistency fixes to format names, in particular for palettized formats.
2021-02-26 babl-0.1.86 </dt><dd>
input-class (scanner/RGB) ICC profiles are valid for creating RGB spaces.
improved thread safety for babl_space_from_icc
......
......@@ -406,6 +406,7 @@ alias_conversion (Babl *babl,
babl_remodel_with_space (
(void*)conv->destination, (void*)space),
"linear", conv->function.linear,
"data", conv->data,
NULL);
break;
case BABL_CONVERSION_PLANAR:
......@@ -415,6 +416,7 @@ alias_conversion (Babl *babl,
babl_remodel_with_space (
(void*)conv->destination, (void*)space),
"planar", conv->function.planar,
"data", conv->data,
NULL);
break;
case BABL_CONVERSION_PLANE:
......@@ -424,6 +426,7 @@ alias_conversion (Babl *babl,
babl_remodel_with_space (
(void*)conv->destination, (void*)space),
"plane", conv->function.plane,
"data", conv->data,
NULL);
break;
default:
......
......@@ -468,16 +468,18 @@ babl_format_new (const void *first_arg,
va_end (varg);
if (!name)
name = create_name (model, components, component, type);
{
name = create_name (model, components, component, type);
if (space != babl_space ("sRGB"))
{
char *new_name = babl_malloc (strlen (name) +
strlen (babl_get_name ((Babl*)space)) + 1);
sprintf (new_name, "%s-%s", name, babl_get_name ((Babl*)space));
babl_free (name);
name = new_name;
}
if (space != babl_space ("sRGB"))
{
char *new_name = babl_malloc (strlen (name) +
strlen (babl_get_name ((Babl*)space)) + 1);
sprintf (new_name, "%s-%s", name, babl_get_name ((Babl*)space));
babl_free (name);
name = new_name;
}
}
if (!model)
{
......
......@@ -831,6 +831,10 @@ babl_new_palette_with_space (const char *name,
*palptr = default_palette ();;
cname[0] = 'v';
model_no_alpha = babl_model_new ("name", name, component, NULL);
babl_set_user_data (model, palptr);
babl_set_user_data (model_no_alpha, palptr);
cname[0] = '\\';
f_pal_a_u8 = (void*) babl_format_new ("name", name, model, space,
babl_type ("u8"),
......@@ -924,9 +928,6 @@ babl_new_palette_with_space (const char *name,
"data", palptr,
NULL);
babl_set_user_data (model, palptr);
babl_set_user_data (model_no_alpha, palptr);
if (format_u8)
*format_u8 = f_pal_u8;
if (format_u8_with_alpha)
......
# Copy the public headers here for subproject builds.
foreach _hdr : babl_headers
configure_file(
input: _hdr,
output: '@PLAINNAME@',
copy: true,
)
endforeach
#ifndef __GIT_VERSION_H__
#define __GIT_VERSION_H__
#define BABL_GIT_VERSION "BABL_0_1_86"
#endif /* __GIT_VERSION_H__ */
......@@ -54,43 +54,14 @@ if platform_win32
babl_link_args += no_undefined
endif
# sources
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.
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',
replace_string: '@BABL_GIT_VERSION@',
command: [ git_bin.path(), 'describe', '--always' ],
)
if env_bin.found() and not meson.is_subproject()
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 = [
babl_sources = files(
'babl-cache.c',
'babl-component.c',
'babl-conversion.c',
......@@ -123,25 +94,34 @@ babl_sources = [
'babl-util.c',
'babl-version.c',
'babl.c',
) + [
babl_version_h,
git_version_h,
]
babl_headers = [
babl_headers = files(
'babl-introspect.h',
'babl-macros.h',
'babl-types.h',
'babl.h',
) + [
babl_version_h,
]
install_headers(babl_headers,
subdir: join_paths(lib_name, 'babl')
subdir: lib_name / 'babl'
)
# copy external headers to babl subdirectory for subproject builds as
# we don't want to expose the project root folder due to potential
# name clashes.
if meson.is_subproject()
subdir('babl')
endif
babl_deps = [math, thread, dl, lcms]
babl_includes = [rootInclude, bablBaseInclude]
# build library
babl = library(
lib_name,
babl_sources,
......@@ -155,12 +135,6 @@ babl = library(
install: true,
)
libbabl_dep = declare_dependency(
include_directories: babl_includes,
link_with: babl,
dependencies: babl_deps
)
if build_gir
# identity filter, so GIR doesn't choke on the Babl type
# (since it has the same name as the Babl namespace)
......
subdir('graphics')
host = 'pippin.gimp.org'
location= 'public_html/babl'
scptarget = host + ':' + location + '/'
xml_insert = find_program(
xml_insert_file,
native: true
......@@ -100,12 +95,3 @@ foreach _file, _parms : html_files
index_html = _tgt
endif
endforeach
run_target('push_web',
command: [
'scp', index_html, index_static_html, babl_css, scptarget,
'&&',
'scp', graphic_files_install, scptarget + 'graphics/'
],
)
#ifndef __BABL_GIT_VERSION_H__
#define __BABL_GIT_VERSION_H__
#define BABL_GIT_VERSION "BABL_0_1_88"
#endif /* __BABL_GIT_VERSION_H__ */
#ifndef __GIT_VERSION_H__
#define __GIT_VERSION_H__
#ifndef __BABL_GIT_VERSION_H__
#define __BABL_GIT_VERSION_H__
#define BABL_GIT_VERSION "@BABL_GIT_VERSION@"
#endif /* __GIT_VERSION_H__ */
#endif /* __BABL_GIT_VERSION_H__ */
project('babl', 'c',
license: 'LGPL3+',
version: '0.1.86',
version: '0.1.88',
meson_version: '>=0.54.0',
default_options: [
'buildtype=debugoptimized'
......@@ -30,6 +30,9 @@ buildtype = get_option('buildtype')
babl_prefix = get_option('prefix')
babl_libdir = join_paths(babl_prefix, get_option('libdir'))
project_build_root = meson.current_build_dir()
project_source_root = meson.current_source_dir()
################################################################################
# Projects infos
......@@ -409,12 +412,46 @@ endif
################################################################################
# Configuration files
# This should not be made visible in babl_dep due to possible name clash
# when built as a sub-project.
rootInclude = include_directories('.')
# config.h
configure_file(
output: 'config.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.
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',
replace_string: '@BABL_GIT_VERSION@',
command: [ git_bin.path(), 'describe', '--always' ],
)
if not meson.is_subproject()
meson.add_dist_script(
[ 'ninja', 'git-version.h', ],
)
meson.add_dist_script(
[ 'sh', '-c', ' '.join(
[ 'cp', git_version_h.full_path(), '${MESON_DIST_ROOT}' ]
)]
)
endif
else
git_version_h = files('git-version.h')
endif
################################################################################
# Global variables
......@@ -428,8 +465,6 @@ gen_babl_map_file = files('gen_babl_map.py')
################################################################################
# Subdirs
rootInclude = include_directories('.')
subdir('babl')
subdir('extensions')
subdir('tests')
......@@ -456,17 +491,31 @@ endif
# pkg-config file
pkgconfig.generate(babl,
pkgconfig.generate(
babl,
filebase: 'babl',
name: 'babl',
description: 'Pixel encoding and color space conversion engine.',
version: meson.project_version(),
libraries_private: [
'-lm',
subdirs: lib_name,
uninstalled_variables: [
'babl_path=@0@'.format(babl_extensions_build_dir),
'babl_libdir=@0@'.format(babl_library_build_dir),
],
subdirs: [
lib_name,
)
# dependency for wrap builds
babl_dep = declare_dependency(
include_directories: bablInclude,
link_with : babl,
sources: [
babl_version_h,
is_variable('babl_gir') ? babl_gir : []
],
variables: {
'babl_path' : babl_extensions_build_dir,
'babl_libdir' : babl_library_build_dir,
},
)
################################################################################
......