diff --git a/doc/flatpak-manifest.xml b/doc/flatpak-manifest.xml
index 7631d22e..11cd3498 100644
--- a/doc/flatpak-manifest.xml
+++ b/doc/flatpak-manifest.xml
@@ -289,6 +289,11 @@
The build prefix for the modules (defaults to /app for
applications and /usr for runtimes).
+
+ (string)
+ The build libdir for the modules (defaults to /app/lib for
+ applications and /usr/lib for runtimes).
+
(string)
This will get appended to PATH in the build environment (with an leading colon if
diff --git a/src/builder-options.c b/src/builder-options.c
index 740c0169..7c26d79c 100644
--- a/src/builder-options.c
+++ b/src/builder-options.c
@@ -50,6 +50,7 @@ struct BuilderOptions
char *append_pkg_config_path;
char *prepend_pkg_config_path;
char *prefix;
+ char *libdir;
char **env;
char **build_args;
char **test_args;
@@ -76,6 +77,7 @@ enum {
PROP_CXXFLAGS,
PROP_LDFLAGS,
PROP_PREFIX,
+ PROP_LIBDIR,
PROP_ENV,
PROP_STRIP,
PROP_NO_DEBUGINFO,
@@ -112,6 +114,7 @@ builder_options_finalize (GObject *object)
g_free (self->append_pkg_config_path);
g_free (self->prepend_pkg_config_path);
g_free (self->prefix);
+ g_free (self->libdir);
g_strfreev (self->env);
g_strfreev (self->build_args);
g_strfreev (self->test_args);
@@ -177,6 +180,10 @@ builder_options_get_property (GObject *object,
g_value_set_string (value, self->prefix);
break;
+ case PROP_LIBDIR:
+ g_value_set_string (value, self->libdir);
+ break;
+
case PROP_ENV:
g_value_set_boxed (value, self->env);
break;
@@ -288,6 +295,11 @@ builder_options_set_property (GObject *object,
self->prefix = g_value_dup_string (value);
break;
+ case PROP_LIBDIR:
+ g_clear_pointer (&self->libdir, g_free);
+ self->libdir = g_value_dup_string (value);
+ break;
+
case PROP_ENV:
tmp = self->env;
self->env = g_strdupv (g_value_get_boxed (value));
@@ -433,6 +445,13 @@ builder_options_class_init (BuilderOptionsClass *klass)
"",
NULL,
G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_LIBDIR,
+ g_param_spec_string ("libdir",
+ "",
+ "",
+ NULL,
+ G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_ENV,
g_param_spec_boxed ("env",
@@ -889,6 +908,22 @@ builder_options_get_prefix (BuilderOptions *self, BuilderContext *context)
return "/app";
}
+const char *
+builder_options_get_libdir (BuilderOptions *self, BuilderContext *context)
+{
+ g_autoptr(GList) options = get_all_options (self, context);
+ GList *l;
+
+ for (l = options; l != NULL; l = l->next)
+ {
+ BuilderOptions *o = l->data;
+ if (o->libdir)
+ return o->libdir;
+ }
+
+ return NULL;
+}
+
gboolean
builder_options_get_strip (BuilderOptions *self, BuilderContext *context)
{
@@ -1154,6 +1189,7 @@ builder_options_checksum (BuilderOptions *self,
builder_cache_checksum_str (cache, self->cppflags);
builder_cache_checksum_str (cache, self->ldflags);
builder_cache_checksum_str (cache, self->prefix);
+ builder_cache_checksum_compat_str (cache, self->libdir);
builder_cache_checksum_strv (cache, self->env);
builder_cache_checksum_strv (cache, self->build_args);
builder_cache_checksum_compat_strv (cache, self->test_args);
diff --git a/src/builder-options.h b/src/builder-options.h
index e210e2b4..3b2ecc5f 100644
--- a/src/builder-options.h
+++ b/src/builder-options.h
@@ -47,6 +47,8 @@ const char *builder_options_get_ldflags (BuilderOptions *self,
BuilderContext *context);
const char *builder_options_get_prefix (BuilderOptions *self,
BuilderContext *context);
+const char *builder_options_get_libdir (BuilderOptions *self,
+ BuilderContext *context);
char ** builder_options_get_env (BuilderOptions *self,
BuilderContext *context);
char ** builder_options_get_build_args (BuilderOptions *self,