2017-08-21 13:40:21 +00:00
|
|
|
/*
|
|
|
|
* Copyright © 2017 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
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* 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_EXTENSION_H__
|
|
|
|
#define __BUILDER_EXTENSION_H__
|
|
|
|
|
|
|
|
#include <json-glib/json-glib.h>
|
|
|
|
|
|
|
|
#include "builder-context.h"
|
|
|
|
#include "builder-cache.h"
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
typedef struct BuilderExtension BuilderExtension;
|
|
|
|
|
|
|
|
#define BUILDER_TYPE_EXTENSION (builder_extension_get_type ())
|
|
|
|
#define BUILDER_EXTENSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUILDER_TYPE_EXTENSION, BuilderExtension))
|
|
|
|
#define BUILDER_IS_EXTENSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUILDER_TYPE_EXTENSION))
|
|
|
|
|
|
|
|
/* Bump this if format changes in incompatible ways to force rebuild */
|
|
|
|
#define BUILDER_EXTENSION_CHECKSUM_VERSION "1"
|
|
|
|
|
|
|
|
GType builder_extension_get_type (void);
|
|
|
|
|
|
|
|
void builder_extension_set_name (BuilderExtension *self,
|
|
|
|
const char *name);
|
|
|
|
const char * builder_extension_get_name (BuilderExtension *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
|
|
|
const char * builder_extension_get_version (BuilderExtension *self);
|
2017-08-21 13:40:21 +00:00
|
|
|
|
|
|
|
gboolean builder_extension_is_bundled (BuilderExtension *self);
|
|
|
|
const char * builder_extension_get_directory (BuilderExtension *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
|
|
|
void builder_extension_add_remove_args (BuilderExtension *self,
|
|
|
|
GPtrArray *args);
|
|
|
|
void builder_extension_add_finish_args (BuilderExtension *self,
|
2017-08-21 13:40:21 +00:00
|
|
|
GPtrArray *args);
|
|
|
|
void builder_extension_checksum (BuilderExtension *self,
|
|
|
|
BuilderCache *cache,
|
|
|
|
BuilderContext *context);
|
|
|
|
|
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BuilderExtension, g_object_unref)
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __BUILDER_EXTENSION_H__ */
|