2015-11-16 15:23:23 +00:00
|
|
|
/*
|
|
|
|
* Copyright © 2015 Red Hat, Inc
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
2016-07-29 18:27:49 +00:00
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
2015-11-16 15:23:23 +00:00
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Alexander Larsson <alexl@redhat.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __BUILDER_MANIFEST_H__
|
|
|
|
#define __BUILDER_MANIFEST_H__
|
|
|
|
|
|
|
|
#include <json-glib/json-glib.h>
|
|
|
|
|
2017-08-25 07:35:34 +00:00
|
|
|
#include "builder-flatpak-utils.h"
|
2015-11-16 15:23:23 +00:00
|
|
|
#include "builder-options.h"
|
|
|
|
#include "builder-module.h"
|
|
|
|
#include "builder-cache.h"
|
2017-08-21 13:40:21 +00:00
|
|
|
#include "builder-extension.h"
|
2015-11-16 15:23:23 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
typedef struct BuilderManifest BuilderManifest;
|
|
|
|
|
2016-05-06 14:03:27 +00:00
|
|
|
#define BUILDER_TYPE_MANIFEST (builder_manifest_get_type ())
|
2015-11-16 15:23:23 +00:00
|
|
|
#define BUILDER_MANIFEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUILDER_TYPE_MANIFEST, BuilderManifest))
|
|
|
|
#define BUILDER_IS_MANIFEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUILDER_TYPE_MANIFEST))
|
|
|
|
|
|
|
|
/* Bump this if format changes in incompatible ways to force rebuild */
|
2017-12-11 10:47:32 +00:00
|
|
|
#define BUILDER_MANIFEST_CHECKSUM_VERSION "5"
|
2016-01-19 15:53:11 +00:00
|
|
|
#define BUILDER_MANIFEST_CHECKSUM_CLEANUP_VERSION "1"
|
2018-04-19 11:22:18 +00:00
|
|
|
#define BUILDER_MANIFEST_CHECKSUM_FINISH_VERSION "3"
|
2017-04-24 10:31:56 +00:00
|
|
|
#define BUILDER_MANIFEST_CHECKSUM_BUNDLE_SOURCES_VERSION "1"
|
2016-01-19 15:53:11 +00:00
|
|
|
#define BUILDER_MANIFEST_CHECKSUM_PLATFORM_VERSION "1"
|
2015-11-16 15:23:23 +00:00
|
|
|
|
|
|
|
GType builder_manifest_get_type (void);
|
|
|
|
|
2017-04-19 15:46:28 +00:00
|
|
|
void builder_manifest_set_demarshal_base_dir (GFile *dir);
|
|
|
|
GFile *builder_manifest_get_demarshal_base_dir (void);
|
2017-03-06 08:18:17 +00:00
|
|
|
|
2016-05-06 14:03:27 +00:00
|
|
|
const char * builder_manifest_get_id (BuilderManifest *self);
|
2016-10-26 18:57:57 +00:00
|
|
|
char * builder_manifest_get_locale_id (BuilderManifest *self);
|
|
|
|
char * builder_manifest_get_debug_id (BuilderManifest *self);
|
2017-03-31 05:56:10 +00:00
|
|
|
char * builder_manifest_get_sources_id (BuilderManifest *self);
|
2016-05-06 14:03:27 +00:00
|
|
|
const char * builder_manifest_get_id_platform (BuilderManifest *self);
|
2016-10-26 18:57:57 +00:00
|
|
|
char * builder_manifest_get_locale_id_platform (BuilderManifest *self);
|
2016-05-06 14:03:27 +00:00
|
|
|
BuilderOptions *builder_manifest_get_build_options (BuilderManifest *self);
|
|
|
|
GList * builder_manifest_get_modules (BuilderManifest *self);
|
2017-08-21 13:40:21 +00:00
|
|
|
GList * builder_manifest_get_add_extensions (BuilderManifest *self);
|
Support using app-extensions during the build
This adds add-build-extensions which is similar to add-extensions
except the extension is added at build-init time, so can be
used during the build. It can also optionally be removed after
the build is done.
This depends on the flatpak work in:
https://github.com/flatpak/flatpak/pull/1598
With this I was able to build the following app which runs 32bit binaries
in a 64bit build:
```
{
"app-id": "org.example.Multilib",
"runtime": "org.freedesktop.Platform",
"sdk": "org.freedesktop.Sdk",
"runtime-version": "1.6",
"command": "/usr/bin/true",
"add-build-extensions": {
"org.freedesktop.Platform.Compat32": {
"directory": "lib/32bit",
"add-ld-path": "lib",
"version": "1.6"
}
},
"modules": [
{
"name": "test 32bit",
"buildsystem": "simple",
"build-commands": [
"ln -s /app/lib/32bit/lib/ld-linux.so.2 /app/lib/ld-linux.so.2",
"/app/lib/32bit/bin/echo echoing from 32bit world"
]
}
]
}
```
Closes: #129
Approved by: alexlarsson
2018-04-20 09:34:49 +00:00
|
|
|
GList * builder_manifest_get_add_build_extensions (BuilderManifest *self);
|
2019-01-25 16:20:08 +00:00
|
|
|
const char * builder_manifest_get_branch (BuilderManifest *self,
|
|
|
|
BuilderContext *context);
|
2017-06-27 12:09:57 +00:00
|
|
|
const char * builder_manifest_get_collection_id (BuilderManifest *self);
|
2020-02-26 21:07:48 +00:00
|
|
|
gint32 builder_manifest_get_token_type (BuilderManifest *self);
|
2018-04-09 07:32:07 +00:00
|
|
|
const char * builder_manifest_get_extension_tag (BuilderManifest *self);
|
2017-06-27 12:09:57 +00:00
|
|
|
void builder_manifest_set_default_collection_id (BuilderManifest *self,
|
|
|
|
const char *default_collection_id);
|
2020-02-26 21:07:48 +00:00
|
|
|
void builder_manifest_set_default_token_type (BuilderManifest *self,
|
|
|
|
gint32 default_token_type);
|
2015-11-16 15:23:23 +00:00
|
|
|
|
2019-02-04 09:46:14 +00:00
|
|
|
void builder_manifest_add_tags (BuilderManifest *self,
|
|
|
|
const char **add_tags);
|
|
|
|
void builder_manifest_remove_tags (BuilderManifest *self,
|
|
|
|
const char **remove_tags);
|
|
|
|
|
2017-08-21 13:40:21 +00:00
|
|
|
|
|
|
|
char ** builder_manifest_get_exclude_dirs (BuilderManifest *self);
|
|
|
|
|
2016-05-06 14:03:27 +00:00
|
|
|
gboolean builder_manifest_start (BuilderManifest *self,
|
2018-05-03 15:34:18 +00:00
|
|
|
gboolean download_only,
|
2016-10-07 22:42:25 +00:00
|
|
|
gboolean allow_missing_runtimes,
|
2016-05-06 14:03:27 +00:00
|
|
|
BuilderContext *context,
|
|
|
|
GError **error);
|
|
|
|
gboolean builder_manifest_init_app_dir (BuilderManifest *self,
|
2017-02-16 09:51:00 +00:00
|
|
|
BuilderCache *cache,
|
2016-05-06 14:03:27 +00:00
|
|
|
BuilderContext *context,
|
|
|
|
GError **error);
|
|
|
|
gboolean builder_manifest_download (BuilderManifest *self,
|
|
|
|
gboolean update_vcs,
|
2017-02-20 14:02:09 +00:00
|
|
|
const char *only_module,
|
2016-05-06 14:03:27 +00:00
|
|
|
BuilderContext *context,
|
|
|
|
GError **error);
|
2017-02-20 14:02:09 +00:00
|
|
|
gboolean builder_manifest_build_shell (BuilderManifest *self,
|
|
|
|
BuilderContext *context,
|
|
|
|
const char *modulename,
|
|
|
|
GError **error);
|
2016-05-06 14:03:27 +00:00
|
|
|
gboolean builder_manifest_build (BuilderManifest *self,
|
|
|
|
BuilderCache *cache,
|
|
|
|
BuilderContext *context,
|
|
|
|
GError **error);
|
2017-08-18 09:04:13 +00:00
|
|
|
gboolean builder_manifest_install_deps (BuilderManifest *self,
|
|
|
|
BuilderContext *context,
|
2019-05-12 19:04:42 +00:00
|
|
|
char * const *remotes,
|
2017-08-18 09:04:13 +00:00
|
|
|
gboolean opt_user,
|
|
|
|
const char *opt_installation,
|
2018-02-16 07:22:49 +00:00
|
|
|
gboolean opt_yes,
|
2017-08-18 09:04:13 +00:00
|
|
|
GError **error);
|
2016-05-06 14:03:27 +00:00
|
|
|
gboolean builder_manifest_run (BuilderManifest *self,
|
|
|
|
BuilderContext *context,
|
2016-05-26 10:23:48 +00:00
|
|
|
FlatpakContext *arg_context,
|
2016-05-06 14:03:27 +00:00
|
|
|
char **argv,
|
|
|
|
int argc,
|
2017-11-09 13:12:14 +00:00
|
|
|
gboolean log_session_bus,
|
|
|
|
gboolean log_system_bus,
|
2016-05-06 14:03:27 +00:00
|
|
|
GError **error);
|
2016-09-20 13:56:06 +00:00
|
|
|
gboolean builder_manifest_show_deps (BuilderManifest *self,
|
2017-02-28 11:07:53 +00:00
|
|
|
BuilderContext *context,
|
2016-09-20 13:56:06 +00:00
|
|
|
GError **error);
|
2016-05-06 14:03:27 +00:00
|
|
|
void builder_manifest_checksum (BuilderManifest *self,
|
|
|
|
BuilderCache *cache,
|
|
|
|
BuilderContext *context);
|
|
|
|
gboolean builder_manifest_cleanup (BuilderManifest *self,
|
|
|
|
BuilderCache *cache,
|
|
|
|
BuilderContext *context,
|
|
|
|
GError **error);
|
|
|
|
gboolean builder_manifest_finish (BuilderManifest *self,
|
|
|
|
BuilderCache *cache,
|
|
|
|
BuilderContext *context,
|
|
|
|
GError **error);
|
2017-04-24 10:31:56 +00:00
|
|
|
gboolean builder_manifest_bundle_sources (BuilderManifest *self,
|
|
|
|
const char *json,
|
|
|
|
BuilderCache *cache,
|
|
|
|
BuilderContext *context,
|
|
|
|
GError **error);
|
2016-05-06 14:03:27 +00:00
|
|
|
gboolean builder_manifest_create_platform (BuilderManifest *self,
|
|
|
|
BuilderCache *cache,
|
|
|
|
BuilderContext *context,
|
|
|
|
GError **error);
|
2019-09-13 12:25:17 +00:00
|
|
|
char * builder_manifest_serialize (BuilderManifest *self);
|
2015-11-16 15:23:23 +00:00
|
|
|
|
2016-05-06 14:03:27 +00:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BuilderManifest, g_object_unref)
|
2015-11-16 15:23:23 +00:00
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __BUILDER_MANIFEST_H__ */
|