44 changes: 22 additions & 22 deletions src/common/database.c
Original file line number Diff line number Diff line change
Expand Up @@ -4075,15 +4075,15 @@ void dt_database_backup(const char *filename)
if(g_file_test(filename, G_FILE_TEST_EXISTS))
{
copy_status = g_file_copy(src, dest, G_FILE_COPY_NONE, NULL, NULL, NULL, &gerror);
if(copy_status) copy_status = g_chmod(backup, S_IRUSR) == 0;
}
else
{
// there is nothing to backup, create an empty file to prevent further backup attempts
int fd = g_open(backup, O_CREAT, S_IRUSR);
const int fd = g_open(backup, O_CREAT, S_IWUSR);
if(fd < 0 || !g_close(fd, &gerror)) copy_status = FALSE;
}
if(!copy_status) dt_print(DT_DEBUG_ALWAYS, "[backup failed] %s -> %s", filename, backup);
if(!copy_status)
dt_print(DT_DEBUG_ALWAYS, "[backup failed] %s -> %s", filename, backup);

g_object_unref(src);
g_object_unref(dest);
Expand Down Expand Up @@ -4421,7 +4421,8 @@ dt_database_t *dt_database_init(const char *alternative, const gboolean load_dat

//here were sure that response is either accept (restore from snap) or reject (just delete the damaged db)
dt_print(DT_DEBUG_ALWAYS, "[init] deleting `%s' on user request: %s",
dbfilename_data, g_unlink(dbfilename_data) == 0 ? "ok" : "failed" );
dbfilename_data,
g_unlink(dbfilename_data) == 0 ? "ok" : "failed" );

if(resp == GTK_RESPONSE_ACCEPT && data_snap)
{
Expand All @@ -4434,7 +4435,8 @@ dt_database_t *dt_database_init(const char *alternative, const gboolean load_dat
if(g_file_test(data_snap, G_FILE_TEST_EXISTS))
{
copy_status = g_file_copy(src, dest, G_FILE_COPY_NONE, NULL, NULL, NULL, &gerror);
if(copy_status) copy_status = g_chmod(dbfilename_data, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) == 0;
if(copy_status)
copy_status = g_chmod(dbfilename_data, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) == 0;
}
else
{
Expand All @@ -4443,7 +4445,7 @@ dt_database_t *dt_database_init(const char *alternative, const gboolean load_dat
if(fd < 0 || !g_close(fd, &gerror)) copy_status = FALSE;
}
dt_print(DT_DEBUG_ALWAYS, "[init] restoring `%s' from `%s' :%s",
dbfilename_data, data_snap, copy_status ? "success!" : "failed!");
dbfilename_data, data_snap, copy_status ? "success!" : "failed!");
g_object_unref(src);
g_object_unref(dest);
}
Expand Down Expand Up @@ -4964,20 +4966,20 @@ static void _print_backup_progress(int remaining, int total)
}

static int _backup_db(
sqlite3 *src_db, /* Database handle to back up */
const char *src_db_name, /* Database name to back up */
const char *dest_filename, /* Name of file to back up to */
void(*xProgress)(int, int) /* Progress function to invoke */
sqlite3 *src_db, // Database handle to back up
const char *src_db_name, // Database name to back up
const char *dest_filename, // Name of file to back up to
void(*xProgress)(int, int) // Progress function to invoke
)
{
sqlite3 *dest_db; /* Database connection opened on zFilename */
sqlite3 *dest_db; // Database connection opened on dest_filename

/* Open the database file identified by zFilename. */
// Open the database file identified by dest_filename
int rc = sqlite3_open(dest_filename, &dest_db);

if(rc == SQLITE_OK)
{
/* Open the sqlite3_backup object used to accomplish the transfer */
// Open the sqlite3_backup object used to accomplish the transfer
sqlite3_backup *sb_dest = sqlite3_backup_init(dest_db, "main", src_db, src_db_name);
if(sb_dest)
{
Expand All @@ -4994,20 +4996,20 @@ static int _backup_db(
sqlite3_backup_remaining(sb_dest),
sqlite3_backup_pagecount(sb_dest)
);
if( rc==SQLITE_OK || rc==SQLITE_BUSY || rc==SQLITE_LOCKED )
if(rc==SQLITE_OK || rc==SQLITE_BUSY || rc==SQLITE_LOCKED)
{
sqlite3_sleep(25);
}
}
while( rc==SQLITE_OK || rc==SQLITE_BUSY || rc==SQLITE_LOCKED );
while(rc==SQLITE_OK || rc==SQLITE_BUSY || rc==SQLITE_LOCKED);

/* Release resources allocated by backup_init(). */
// Release resources allocated by backup_init()
(void)sqlite3_backup_finish(sb_dest);
}
rc = sqlite3_errcode(dest_db);
}
/* Close the database connection opened on database file zFilename
** and return the result of this function. */
// Close the database connection opened on database file dest_filename
// and return the result of this function
(void)sqlite3_close(dest_db);
return rc;
}
Expand All @@ -5028,7 +5030,7 @@ gboolean dt_database_snapshot(const struct dt_database_t *db)
gchar *lib_tmpbackup_file = g_strdup_printf(temp_pattern, db->dbfilename_library, date_suffix);

int rc = _backup_db(db->handle, "main", lib_tmpbackup_file, _print_backup_progress);
if(!(rc==SQLITE_OK))
if(rc != SQLITE_OK)
{
g_unlink(lib_tmpbackup_file);
g_free(lib_tmpbackup_file);
Expand All @@ -5037,7 +5039,6 @@ gboolean dt_database_snapshot(const struct dt_database_t *db)
return FALSE;
}
g_rename(lib_tmpbackup_file, lib_backup_file);
g_chmod(lib_backup_file, S_IRUSR);
g_free(lib_tmpbackup_file);
g_free(lib_backup_file);

Expand All @@ -5047,15 +5048,14 @@ gboolean dt_database_snapshot(const struct dt_database_t *db)
g_free(date_suffix);

rc = _backup_db(db->handle, "data", dat_tmpbackup_file, _print_backup_progress);
if(!(rc==SQLITE_OK))
if(rc != SQLITE_OK)
{
g_unlink(dat_tmpbackup_file);
g_free(dat_tmpbackup_file);
g_free(dat_backup_file);
return FALSE;
}
g_rename(dat_tmpbackup_file, dat_backup_file);
g_chmod(dat_backup_file, S_IRUSR);
g_free(dat_tmpbackup_file);
g_free(dat_backup_file);

Expand Down
5 changes: 4 additions & 1 deletion src/common/exif.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1138,9 +1138,12 @@ static void _find_datetime_taken(Exiv2::ExifData &exifData,
// Note: We allow a longer "datetime original" field with an unnecessary
// trailing byte(s) due to buggy software that creates it.
// See https://github.com/darktable-org/darktable/issues/17389
// We also accept the out of spec Exif.Photo.DateTimeOriginal
// without a null terminator, which AnalogExif creates.
// See https://github.com/darktable-org/darktable/issues/18146
if((FIND_EXIF_TAG("Exif.Image.DateTimeOriginal")
|| FIND_EXIF_TAG("Exif.Photo.DateTimeOriginal"))
&& pos->size() >= DT_DATETIME_EXIF_LENGTH)
&& pos->size() >= DT_DATETIME_EXIF_LENGTH - 1)
{
_strlcpy_to_utf8(exif_datetime_taken, DT_DATETIME_EXIF_LENGTH, pos, exifData);
if(FIND_EXIF_TAG("Exif.Photo.SubSecTimeOriginal")
Expand Down
18 changes: 13 additions & 5 deletions src/common/opencl.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ static gboolean _opencl_device_init(dt_opencl_t *cl,
cl->dev[dev].fullname = NULL;
cl->dev[dev].cname = NULL;
cl->dev[dev].options = NULL;
cl->dev[dev].cflags = NULL;
cl->dev[dev].memory_in_use = 0;
cl->dev[dev].peak_memory = 0;
cl->dev[dev].used_available = 0;
Expand Down Expand Up @@ -951,10 +952,12 @@ static gboolean _opencl_device_init(dt_opencl_t *cl,
gchar *my_option = g_strdup(compile_opt);
dt_conf_set_string(compile_option_name_cname, my_option);

cl->dev[dev].options = g_strdup_printf("-w %s %s -D%s=1 -I%s",
my_option,
cl->dev[dev].nvidia_sm_20 ? " -DNVIDIA_SM_20=1" : "",
_opencl_get_vendor_by_id(vendor_id), escapedkerneldir);
cl->dev[dev].cflags = g_strdup_printf("-w %s%s -D%s=1",
my_option,
cl->dev[dev].nvidia_sm_20 ? " -DNVIDIA_SM_20=1" : "",
_opencl_get_vendor_by_id(vendor_id));
cl->dev[dev].options = g_strdup_printf("%s -I%s",
cl->dev[dev].cflags, escapedkerneldir);

dt_print_nts(DT_DEBUG_OPENCL, " CL COMPILER OPTION: %s\n", my_option);
dt_print_nts(DT_DEBUG_OPENCL, " CL COMPILER COMMAND: %s\n", cl->dev[dev].options);
Expand Down Expand Up @@ -1519,6 +1522,7 @@ void dt_opencl_init(
free((void *)(cl->dev[i].fullname));
free((void *)(cl->dev[i].cname));
free((void *)(cl->dev[i].options));
free((void *)(cl->dev[i].cflags));
}
}

Expand Down Expand Up @@ -1611,6 +1615,7 @@ void dt_opencl_cleanup(dt_opencl_t *cl)
free((void *)(cl->dev[i].fullname));
free((void *)(cl->dev[i].cname));
free((void *)(cl->dev[i].options));
free((void *)(cl->dev[i].cflags));
}
free(cl->dev_priority_image);
free(cl->dev_priority_preview);
Expand Down Expand Up @@ -2195,6 +2200,8 @@ static gboolean _opencl_load_program(const int dev,
size_t len;

cl_device_id devid = cl->dev[dev].devid;

// We include driver & platform version in checksum
(cl->dlocl->symbols->dt_clGetDeviceInfo)
(devid, CL_DRIVER_VERSION, end - start, start, &len);
start += len;
Expand All @@ -2207,7 +2214,8 @@ static gboolean _opencl_load_program(const int dev,
(platform, CL_PLATFORM_VERSION, end - start, start, &len);
start += len;

len = g_strlcpy(start, cl->dev[dev].options, end - start);
// Include compiler flags for checksum
len = g_strlcpy(start, cl->dev[dev].cflags, end - start);
start += len;

/* make sure that the md5sums of all the includes are applied as well */
Expand Down
1 change: 1 addition & 0 deletions src/common/opencl.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ typedef struct dt_opencl_device_t
const char *fullname;
const char *cname;
const char *options;
const char *cflags;
cl_int summary;
size_t memory_in_use;
size_t peak_memory;
Expand Down
1 change: 0 additions & 1 deletion src/develop/imageop.c
Original file line number Diff line number Diff line change
Expand Up @@ -2250,7 +2250,6 @@ void dt_iop_gui_update(dt_iop_module_t *module)
dt_iop_gui_update_expanded(module);
}
dt_iop_gui_update_header(module);
dt_iop_show_hide_header_buttons(module, NULL, FALSE, FALSE);
dt_guides_update_module_widget(module);

// this signal must be raised only safely when the darkroom and history
Expand Down
28 changes: 23 additions & 5 deletions src/dtgtk/thumbtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -1439,8 +1439,7 @@ static gboolean _event_button_press(GtkWidget *widget,
}
}

if(event->button == 1
&& event->type == GDK_BUTTON_PRESS
if(event->type == GDK_BUTTON_PRESS
&& table->mode == DT_THUMBTABLE_MODE_FILMSTRIP)
return FALSE;
}
Expand Down Expand Up @@ -1480,6 +1479,19 @@ static gboolean _event_button_press(GtkWidget *widget,
return TRUE;
}

if(table->mode != DT_THUMBTABLE_MODE_ZOOM)
return TRUE;

if(event->button == 1
&& event->type == GDK_BUTTON_PRESS)
{
table->dragging = TRUE;
table->drag_dx = table->drag_dy = 0;
table->drag_initial_imgid = id;
table->drag_thumb = _thumbtable_get_thumb(table, id);
if(table->drag_thumb)
table->drag_thumb->moved = FALSE;
}
return TRUE;
}

Expand Down Expand Up @@ -1523,7 +1535,8 @@ static gboolean _event_button_release(GtkWidget *widget,

if(cv != DT_VIEW_DARKROOM
&& cv != DT_VIEW_LIGHTTABLE
&& cv != DT_VIEW_MAP)
&& cv != DT_VIEW_MAP
&& cv != DT_VIEW_PRINT)
return FALSE;

dt_set_backthumb_time(0.0);
Expand Down Expand Up @@ -1575,15 +1588,20 @@ static gboolean _event_button_release(GtkWidget *widget,
}
else
{
dt_selection_select_single(darktable.selection, id);
if(table->mode != DT_THUMBTABLE_MODE_ZOOM
|| !table->drag_thumb->moved)
{
dt_selection_select_single(darktable.selection, id);
DT_CONTROL_SIGNAL_RAISE(DT_SIGNAL_VIEWMANAGER_THUMBTABLE_ACTIVATE, id);
}
}
}
}

// Left now if not in zoom mode

if(table->mode != DT_THUMBTABLE_MODE_ZOOM)
return FALSE;
return TRUE;

// in some case, image_over_id can get out of sync at the end of dragging
// this happen esp. if the pointer as been out of the center area during drag
Expand Down
402 changes: 282 additions & 120 deletions src/gui/guides.c

Large diffs are not rendered by default.

19 changes: 6 additions & 13 deletions src/imageio/imageio_tiff.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static inline int _read_chunky_8(tiff_t *t)
/* set rgb to first sample from scanline */
out[0] = ((float)in[0]) * (1.0f / 255.0f);

if(t->spp == 1)
if(t->spp < 3) // mono, maybe plus alpha channel
{
out[1] = out[2] = out[0];
}
Expand Down Expand Up @@ -130,7 +130,7 @@ static inline int _read_chunky_16(tiff_t *t)
{
out[0] = ((float)in[0]) * (1.0f / 65535.0f);

if(t->spp == 1)
if(t->spp < 3) // mono, maybe plus alpha channel
{
out[1] = out[2] = out[0];
}
Expand Down Expand Up @@ -165,7 +165,7 @@ static inline int _read_chunky_h(tiff_t *t)
out[0] = _half_to_float(in[0]);
#endif

if(t->spp == 1)
if(t->spp < 3) // mono, maybe plus alpha channel
{
out[1] = out[2] = out[0];
}
Expand Down Expand Up @@ -201,7 +201,7 @@ static inline int _read_chunky_f(tiff_t *t)
{
out[0] = in[0];

if(t->spp == 1)
if(t->spp < 3) // mono, maybe plus alpha channel
{
out[1] = out[2] = out[0];
}
Expand Down Expand Up @@ -237,7 +237,7 @@ static inline int _read_chunky_8_Lab(tiff_t *t, uint16_t photometric)
{
out[0] = ((float)in[0]) * (100.0f/255.0f);

if(t->spp == 1)
if(t->spp < 3) // mono, maybe plus alpha channel
{
out[1] = out[2] = 0;
}
Expand Down Expand Up @@ -293,7 +293,7 @@ static inline int _read_chunky_16_Lab(tiff_t *t, uint16_t photometric)
{
out[0] = ((float)in[0]) * (100.0f/range);

if(t->spp == 1)
if(t->spp < 3) // mono, maybe plus alpha channel
{
out[1] = out[2] = 0;
}
Expand Down Expand Up @@ -411,13 +411,6 @@ dt_imageio_retval_t dt_imageio_open_tiff(dt_image_t *img, const char *filename,
return DT_IMAGEIO_UNSUPPORTED_FEATURE;
}

/* we only support 1, 3 or 4 samples per pixel */
if(t.spp != 1 && t.spp != 3 && t.spp != 4)
{
TIFFClose(t.tiff);
return DT_IMAGEIO_UNSUPPORTED_FEATURE;
}

/* don't depend on planar config if spp == 1 */
if(t.spp > 1 && config != PLANARCONFIG_CONTIG)
{
Expand Down
230 changes: 133 additions & 97 deletions src/libs/print_settings.c

Large diffs are not rendered by default.

14 changes: 10 additions & 4 deletions src/libs/tools/module_toolbox.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of darktable,
Copyright (C) 2011-2021 darktable developers.
Copyright (C) 2011-2025 darktable developers.
darktable is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -25,7 +25,9 @@
DT_MODULE(1)

/* proxy function, to add a widget to toolbox */
static void _lib_module_toolbox_add(dt_lib_module_t *self, GtkWidget *widget, dt_view_type_flags_t views);
static void _lib_module_toolbox_add(dt_lib_module_t *self,
GtkWidget *widget,
dt_view_type_flags_t views);


typedef struct child_data_t
Expand Down Expand Up @@ -89,7 +91,9 @@ void gui_cleanup(dt_lib_module_t *self)
self->data = NULL;
}

void view_enter(dt_lib_module_t *self, dt_view_t *old_view, dt_view_t *new_view)
void view_enter(dt_lib_module_t *self,
dt_view_t *old_view,
dt_view_t *new_view)
{
dt_lib_module_toolbox_t *d = self->data;
dt_view_type_flags_t nv= new_view->view(new_view);
Expand All @@ -107,7 +111,9 @@ void view_enter(dt_lib_module_t *self, dt_view_t *old_view, dt_view_t *new_view)
}
}

static void _lib_module_toolbox_add(dt_lib_module_t *self, GtkWidget *widget, dt_view_type_flags_t views)
static void _lib_module_toolbox_add(dt_lib_module_t *self,
GtkWidget *widget,
dt_view_type_flags_t views)
{
dt_lib_module_toolbox_t *d = self->data;
gtk_box_pack_start(GTK_BOX(d->container), widget, TRUE, FALSE, 0);
Expand Down
19 changes: 14 additions & 5 deletions src/libs/tools/view_toolbox.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file is part of darktable,
Copyright (C) 2011-2021 darktable developers.
Copyright (C) 2011-2025 darktable developers.
darktable is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -25,7 +25,9 @@
DT_MODULE(1)

/* proxy function, to add a widget to toolbox */
static void _lib_view_toolbox_add(dt_lib_module_t *self, GtkWidget *widget, dt_view_type_flags_t views);
static void _lib_view_toolbox_add(dt_lib_module_t *self,
GtkWidget *widget,
dt_view_type_flags_t views);


typedef struct child_data_t
Expand Down Expand Up @@ -88,11 +90,16 @@ void gui_cleanup(dt_lib_module_t *self)
self->data = NULL;
}

void view_enter(dt_lib_module_t *self, dt_view_t *old_view, dt_view_t *new_view)
void view_enter(dt_lib_module_t *self,
dt_view_t *old_view,
dt_view_t *new_view)
{
dt_lib_view_toolbox_t *d = self->data;
dt_view_type_flags_t nv= new_view->view(new_view);
for(const GList *child_elt = d->child_views; child_elt; child_elt = g_list_next(child_elt))

for(const GList *child_elt = d->child_views;
child_elt;
child_elt = g_list_next(child_elt))
{
child_data_t* child_data = child_elt->data;
if(child_data->views & nv)
Expand All @@ -107,7 +114,9 @@ void view_enter(dt_lib_module_t *self, dt_view_t *old_view, dt_view_t *new_view)
}


static void _lib_view_toolbox_add(dt_lib_module_t *self, GtkWidget *widget, dt_view_type_flags_t views)
static void _lib_view_toolbox_add(dt_lib_module_t *self,
GtkWidget *widget,
dt_view_type_flags_t views)
{
dt_lib_view_toolbox_t *d = self->data;
gtk_box_pack_start(GTK_BOX(d->container), widget, TRUE, FALSE, 0);
Expand Down
4 changes: 3 additions & 1 deletion src/views/darkroom.c
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ static gboolean _dev_load_requested_image(gpointer user_data)
{
dt_iop_gui_init(module);

/* add module to right panel */
/* add module to right panel with safe header buttons */
dt_iop_gui_set_expander(module);
dt_iop_gui_update_blending(module);
}
Expand All @@ -1134,6 +1134,8 @@ static gboolean _dev_load_requested_image(gpointer user_data)
// update the module header to ensure proper multi-name display
if(!dt_iop_is_hidden(module))
{
// Make sure module header buttons are reset to a safe state
dt_iop_show_hide_header_buttons(module, NULL, FALSE, FALSE);
snprintf(option, sizeof(option), "plugins/darkroom/%s/expanded", module->op);
module->expanded = dt_conf_get_bool(option);
dt_iop_gui_update_expanded(module);
Expand Down
44 changes: 30 additions & 14 deletions tools/appimage-build-script.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/usr/bin/env bash

# This script builds darktable and then packages it as an AppImage.
# You are expected to call it from the darktable root folder.
# You are expected to call it from the darktable sources root folder.

# This script contains the launch of the AppImage program, linuxdeploy.
# This script contains the launch of linuxdeply, which itself is an AppImage.
# By default, FUSE, which is required for the standard technology of
# launching programs in AppImage format, does not work in Docker containers.
# So if this script is running in a Docker container, the environment
# variable APPIMAGE_EXTRACT_AND_RUN=1 must be set before calling it.

# desktop-file-validate is an optional dependency for darktable build, but is required by linuxdeploy.
# desktop-file-validate is an optional dependency for darktable build,
# but is required by linuxdeploy.
if ! [ -x "$(command -v desktop-file-validate)" ]; then
echo 'Error: desktop-file-validate is not installed.' >&2
exit 1
Expand All @@ -23,20 +24,35 @@ mkdir {build,AppDir}
export DESTDIR=../AppDir

# The CLI parameters of this script will be passed verbatim to build.sh.
# This allows you to conveniently manage the enabling/disabling of various features.
# For example, you can easily build darktable with support for ImageMagick instead of GraphicsMagick
# by running this script with the parameters `--disable-graphicsmagick --enable-imagemagick`
# This allows you to conveniently manage the enabling/disabling of various
# features. For example, you can easily build darktable with support for
# ImageMagick instead of GraphicsMagick by running this script with the
# parameters `--disable-graphicsmagick --enable-imagemagick`
./build.sh --build-dir ./build/ --prefix /usr --build-type Release $@ --install -- "-DBINARY_PACKAGE_BUILD=1 -DBUILD_CURVE_TOOLS=ON -DBUILD_NOISE_TOOLS=ON -DDONT_USE_INTERNAL_LUA=Off -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"

# Sanitize path to executable in org.darktable.darktable.desktop (it will be handled by AppImage).
# In fact, most desktop files do not include the full path to the program in the Exec field
# (relying on the OS's path lookup functionality). When we'll do the same, this hack can be removed.
# Sanitize path to executable in the .desktop (it will be handled by AppImage).
# In reality, most .desktop files do not include the full path to the program
# in the Exec field (relying on the OS's path lookup functionality).
# When we'll do the same, this hack can be removed.
cd build
sed -i 's/\/usr\/bin\///' ../AppDir/usr/share/applications/org.darktable.darktable.desktop

# Since linuxdeploy is itself an AppImage, we don't rely on it being installed on the build system, but download it every time
# we run this script. If that doesn't suit you (for example, you want to build an AppImage without an Internet connection),
# you can edit this script accordingly, and call linuxdeploy and its plugin from where you put them.
# The caller of the script should run `sudo lensfun-update-data` before making
# AppImage, for the nightly builds we did this in the GitHub Action.
# Ideally, we should include the latest lens data at the time of the build.
# So we assume that before calling this script, there was a call to
# lensfun-update-data, which downloaded the updates to /var/lib/lensfun-updates.
# It might be worth adding more complex logic here to find where the latest
# data is located on the build host, but for now we'll rely on the user of this
# script to read this comment and act accordingly.
mkdir -p ../AppDir/usr/share/lensfun
cp -a /var/lib/lensfun-updates/* ../AppDir/usr/share/lensfun

# Since linuxdeploy is itself an AppImage, we don't rely on it being installed
# on the build system, but download it every time we run this script. If that
# doesn't suit you (for example, you want to build an AppImage without an
# Internet connection), you can edit this script accordingly, and call
# linuxdeploy and its plugin from where you put them.
wget -c --no-verbose "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
wget -c --no-verbose "https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh"

Expand All @@ -53,8 +69,8 @@ elif [ "$DARKTABLE_APPIMAGE_UPDATE" != "no" ]; then
export LDAI_UPDATE_INFORMATION="gh-releases-zsync|darktable-org|darktable|nightly|Darktable-*-x86_64.AppImage.zsync"
fi

# '--deploy-deps-only' are needed to tell linuxdeploy where to collect dependencies
# of modules that are loaded via dlopen (and therefore cannot be found automatically)
# '--deploy-deps-only' are needed to tell linuxdeploy where to collect deps of
# modules that are loaded via dlopen (therefore cannot be found automatically)
./linuxdeploy-x86_64.AppImage \
--appdir ../AppDir \
--plugin gtk \
Expand Down