Skip to content
Snippets Groups Projects
Commit f78345df authored by Adar Nimrod's avatar Adar Nimrod Committed by nimrod
Browse files

Endless Flatpak SDK and Dockerfile.

parent 6c8d21a6
No related branches found
No related tags found
No related merge requests found
Showing
with 4049 additions and 0 deletions
FROM debian:sid-slim
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y flatpak-builder
RUN useradd -mUd /var/lib/builder builder
USER builder
WORKDIR /var/lib/builder
# Flatpak in Docker example
> An example of building a Flatpak inside a Docker container
## Scenario
An Ubuntu Xenial instance running the HWE kernel (from the
`linux-virtual-hwe-16.04` package, version 4.15 at the time of writing) and
Docker from the `docker.io` package in the Ubuntu repos (version 18.09 at the
time of writing).
## Example
To build the container and run it:
```
docker build -t flatpak-builder https://raw.githubusercontent.com/adarnimrod/flatpak-docker-example/master/Dockerfile
docker run -it --security-opt seccomp=unconfined --security-opt apparmor=unconfined -v '/proc:/proc' -v '/var/cache/flatpak:/var/lib/builder/.local/share/flatpak' flatpak-builder
```
To pull the dependencies and build the Endless SDK inside the container:
```
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
for dep in org.freedesktop.Sdk/x86_64/1.6 org.freedesktop.Platform/x86_64/1.6 org.gnome.Sdk/x86_64/3.28 org.gnome.Sdk.Debug/x86_64/3.28 org.gnome.Sdk.Docs/x86_64/3.28 org.gnome.Platform/x86_64/3.28 ; do \
flatpak install -y --user flathub $dep ; \
flatpak update -y --user $dep ; \
done
flatpak list --user --runtime --show-details
for dep in org.gnome.Platform.Locale/x86_64/3.28 org.gnome.Sdk.Locale/x86_64/3.28 ; do \
flatpak uninstall -y --user $dep || true ; \
flatpak install -y --user --reinstall flathub $dep ; \
done
flatpak install --user flathub org.gnome.Sdk.Debug
flatpak list --user --runtime --all --show-details
flatpak-builder --verbose --disable-rofiles-fuse --from-git=https://github.com/adarnimrod/flatpak-docker-example builddir com.endlessm.apps.Sdk.json
```
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.disksize.size = "64GB"
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y linux-virtual-hwe-16.04 docker.io
usermod -aG docker vagrant
install -d -m 777 -o root -g root /var/cache/flatpak
systemctl reboot
SHELL
end
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2017 Endless -->
<component type="runtime">
<id>com.endlessm.apps.Platform</id>
<metadata_license>CC0</metadata_license>
<!-- FIXME -->
<project_license>LGPL-2.1+</project_license>
<name>Endless Application Platform version master</name>
<summary>Shared libraries used by Endless applications</summary>
<url type="homepage">https://endlessos.com/</url>
</component>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2017 Endless -->
<component type="runtime">
<id>com.endlessm.apps.Sdk</id>
<metadata_license>CC0</metadata_license>
<!-- FIXME -->
<project_license>LGPL-2.1+</project_license>
<name>Endless Software Development Kit version master</name>
<summary>Tools and headers for developing applications using the Endless application platform</summary>
<url type="homepage">https://endlessos.com/</url>
</component>
This diff is collapsed.
# vim:ff=unix:ts=2:sw=2:ai:expandtab
---
version: '3.5'
services:
flatpak-builder:
build:
context: .
#cap_add:
# - SYS_ADMIN
image: flatpak-builder
privileged: true
#security_opt:
#- seccomp=flatpak-seccomp.json
#- seccomp=unconfined
#- apparmor=unconfined
volumes:
- /proc:/proc
- /var/cache/flatpak:/var/lib/builder/.local/share/flatpak
Description: Don't write cache if there are no valid components
Author: Matthias Klumpp <matthias@tenstral.net>
--- appstream-0.10.4.orig/src/as-cache-file.c
+++ appstream-0.10.4/src/as-cache-file.c
@@ -185,6 +185,7 @@ as_cache_file_save (const gchar *fname,
g_autoptr(GFileOutputStream) file_out = NULL;
g_autoptr(GOutputStream) zout = NULL;
g_autoptr(GZlibCompressor) compressor = NULL;
+ gboolean serializable_components_found = FALSE;
GError *tmp_error = NULL;
guint cindex;
@@ -218,6 +219,8 @@ as_cache_file_save (const gchar *fname,
continue;
}
+ serializable_components_found = TRUE;
+
/* start serializing our component */
g_variant_builder_init (&cb, G_VARIANT_TYPE_VARDICT);
@@ -486,6 +489,11 @@ as_cache_file_save (const gchar *fname,
g_variant_builder_add_value (builder, g_variant_builder_end (&cb));
}
+ /* check if we actually have some valid components serialized to a GVariant */
+ if (!serializable_components_found) {
+ g_debug ("Skipped writing cache file: No valid components found for serialization.");
+ return;
+ }
/* write basic information and add components */
g_variant_builder_add (main_builder, "{sv}",
diff -Nuarp appstream-APPSTREAM_0_10_4.old/docs/CMakeLists.txt appstream-APPSTREAM_0_10_4.new/docs/CMakeLists.txt
--- appstream-APPSTREAM_0_10_4.old/docs/CMakeLists.txt 2016-11-27 17:59:18.000000000 +0000
+++ appstream-APPSTREAM_0_10_4.new/docs/CMakeLists.txt 2017-03-16 14:51:00.997136311 +0000
@@ -1,18 +1,18 @@
# CMakeLists for documentation
-find_program (XMLTO xmlto)
-mark_as_advanced (XMLTO)
-if (XMLTO STREQUAL "XMLTO-NOTFOUND")
- message (FATAL_ERROR "Xmlto was not found! Please install it to continue!")
-endif (XMLTO STREQUAL "XMLTO-NOTFOUND")
+if (DOCUMENTATION)
+ find_program (XMLTO xmlto)
+ mark_as_advanced (XMLTO)
+ if (XMLTO STREQUAL "XMLTO-NOTFOUND")
+ message (FATAL_ERROR "Xmlto was not found! Please install it to continue!")
+ endif (XMLTO STREQUAL "XMLTO-NOTFOUND")
-include (${CMAKE_SOURCE_DIR}/data/cmake/documentation.cmake)
+ include (${CMAKE_SOURCE_DIR}/data/cmake/documentation.cmake)
-add_xml_manpages(doc-man-asi "sources/man/appstreamcli.1" "" "")
+ add_xml_manpages(doc-man-asi "sources/man/appstreamcli.1" "" "")
-set(DOC_HTML_EXPORT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/html")
+ set(DOC_HTML_EXPORT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/html")
-if (DOCUMENTATION)
#########################
# General project documentation
find_program (PUBLICAN publican)
From 22c31d6049b82b1aa52b2ba8843612515aeeba2c Mon Sep 17 00:00:00 2001
From: Juan Pablo Ugarte <ugarte@endlessm.com>
Date: Tue, 12 Jun 2018 10:51:06 -0300
Subject: [PATCH] EvView: fix transformation functions to document coordinates.
Use top border value instead of right in transformation functions.
Fixes issue #914 "Text selection broken with different border widths"
---
libview/ev-view.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libview/ev-view.c b/libview/ev-view.c
index e99ee5dc..e6758944 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -1375,7 +1375,7 @@ _ev_view_transform_view_point_to_doc_point (EvView *view,
double *doc_point_y)
{
*doc_point_x = MAX ((double) (view_point->x - page_area->x - border->left) / view->scale, 0);
- *doc_point_y = MAX ((double) (view_point->y - page_area->y - border->right) / view->scale, 0);
+ *doc_point_y = MAX ((double) (view_point->y - page_area->y - border->top) / view->scale, 0);
}
void
@@ -1386,7 +1386,7 @@ _ev_view_transform_view_rect_to_doc_rect (EvView *view,
EvRectangle *doc_rect)
{
doc_rect->x1 = MAX ((double) (view_rect->x - page_area->x - border->left) / view->scale, 0);
- doc_rect->y1 = MAX ((double) (view_rect->y - page_area->y - border->right) / view->scale, 0);
+ doc_rect->y1 = MAX ((double) (view_rect->y - page_area->y - border->top) / view->scale, 0);
doc_rect->x2 = doc_rect->x1 + (double) view_rect->width / view->scale;
doc_rect->y2 = doc_rect->y1 + (double) view_rect->height / view->scale;
}
--
2.17.1
File added
File added
File added
File added
File added
File added
File added
File added
From 5f6b84d234898d3d9fdac6e42b633c43c1e7b969 Mon Sep 17 00:00:00 2001
From: Juan Pablo Ugarte <ugarte@endlessm.com>
Date: Thu, 11 Jan 2018 17:21:24 -0300
Subject: [PATCH] CSS: add vendor specific -eos-cairo-filter property
This property is used to provide a hint about the algorithm it should be use to scale CSS images.
---
gtk/gtkcssenumvalue.c | 55 +++++++++++++++++++++++++++++++++++++++++
gtk/gtkcssenumvalueprivate.h | 4 +++
gtk/gtkcssimagesurface.c | 9 +++++++
gtk/gtkcssimagesurfaceprivate.h | 4 +++
gtk/gtkcssstylepropertyimpl.c | 20 +++++++++++++++
gtk/gtkcsstypesprivate.h | 1 +
gtk/gtkrenderbackground.c | 9 +++++++
7 files changed, 102 insertions(+)
diff --git a/gtk/gtkcssenumvalue.c b/gtk/gtkcssenumvalue.c
index 784f97e3e6..9af3078f7d 100644
--- a/gtk/gtkcssenumvalue.c
+++ b/gtk/gtkcssenumvalue.c
@@ -1070,3 +1070,58 @@ _gtk_css_icon_style_value_get (const GtkCssValue *value)
return value->value;
}
+
+/* GtkCssEosCairoFilter */
+
+static const GtkCssValueClass GTK_CSS_VALUE_EOS_CAIRO_FILTER = {
+ gtk_css_value_enum_free,
+ gtk_css_value_enum_compute,
+ gtk_css_value_enum_equal,
+ gtk_css_value_enum_transition,
+ gtk_css_value_enum_print
+};
+
+static GtkCssValue cairo_filter_values[] = {
+ { &GTK_CSS_VALUE_EOS_CAIRO_FILTER, 1, CAIRO_FILTER_FAST, "-eos-fast" },
+ { &GTK_CSS_VALUE_EOS_CAIRO_FILTER, 1, CAIRO_FILTER_GOOD, "-eos-good" },
+ { &GTK_CSS_VALUE_EOS_CAIRO_FILTER, 1, CAIRO_FILTER_BEST, "-eos-best" },
+ { &GTK_CSS_VALUE_EOS_CAIRO_FILTER, 1, CAIRO_FILTER_NEAREST, "-eos-nearest" },
+ { &GTK_CSS_VALUE_EOS_CAIRO_FILTER, 1, CAIRO_FILTER_BILINEAR, "-eos-bilinear" }
+};
+
+GtkCssValue *
+_gtk_css_eos_cairo_filter_value_new (cairo_filter_t filter)
+{
+ guint i;
+
+ for (i = 0; i < G_N_ELEMENTS (cairo_filter_values); i++)
+ {
+ if (cairo_filter_values[i].value == filter)
+ return _gtk_css_value_ref (&cairo_filter_values[i]);
+ }
+
+ g_return_val_if_reached (NULL);
+}
+
+GtkCssValue *
+_gtk_css_eos_cairo_filter_value_try_parse (GtkCssParser *parser)
+{
+ guint i;
+
+ g_return_val_if_fail (parser != NULL, NULL);
+
+ for (i = 0; i < G_N_ELEMENTS (cairo_filter_values); i++)
+ {
+ if (_gtk_css_parser_try (parser, cairo_filter_values[i].name, TRUE))
+ return _gtk_css_value_ref (&cairo_filter_values[i]);
+ }
+
+ return NULL;
+}
+
+cairo_filter_t
+_gtk_css_eos_cairo_filter_get (const GtkCssValue *value)
+{
+ g_return_val_if_fail (value->class == &GTK_CSS_VALUE_EOS_CAIRO_FILTER, CAIRO_FILTER_GOOD);
+ return value->value;
+}
diff --git a/gtk/gtkcssenumvalueprivate.h b/gtk/gtkcssenumvalueprivate.h
index deb145cb2e..705a00c373 100644
--- a/gtk/gtkcssenumvalueprivate.h
+++ b/gtk/gtkcssenumvalueprivate.h
@@ -91,6 +91,10 @@ GtkCssValue * _gtk_css_icon_style_value_new (GtkCssIconStyle icon_s
GtkCssValue * _gtk_css_icon_style_value_try_parse (GtkCssParser *parser);
GtkCssIconStyle _gtk_css_icon_style_value_get (const GtkCssValue *value);
+GtkCssValue * _gtk_css_eos_cairo_filter_value_new (cairo_filter_t filter);
+GtkCssValue * _gtk_css_eos_cairo_filter_value_try_parse (GtkCssParser *parser);
+cairo_filter_t _gtk_css_eos_cairo_filter_get (const GtkCssValue *value);
+
G_END_DECLS
#endif /* __GTK_CSS_ENUM_VALUE_PRIVATE_H__ */
diff --git a/gtk/gtkcssimagesurface.c b/gtk/gtkcssimagesurface.c
index 8c439c9a52..c76522ba63 100644
--- a/gtk/gtkcssimagesurface.c
+++ b/gtk/gtkcssimagesurface.c
@@ -57,6 +57,7 @@ gtk_css_image_surface_draw (GtkCssImage *image,
/* Update cache image if size is different */
if (surface->cache == NULL ||
+ surface->cache_filter != surface->filter ||
ABS (width - surface->width) > 0.001 ||
ABS (height - surface->height) > 0.001)
{
@@ -78,6 +79,8 @@ gtk_css_image_surface_draw (GtkCssImage *image,
cairo_rectangle (cache, 0, 0, width, height);
cairo_scale (cache, width / image_width, height / image_height);
cairo_set_source_surface (cache, surface->surface, 0, 0);
+ cairo_pattern_set_filter (cairo_get_source (cache), surface->filter);
+ surface->cache_filter = surface->filter;
cairo_fill (cache);
cairo_destroy (cache);
@@ -153,6 +156,7 @@ _gtk_css_image_surface_class_init (GtkCssImageSurfaceClass *klass)
static void
_gtk_css_image_surface_init (GtkCssImageSurface *image_surface)
{
+ image_surface->filter = CAIRO_FILTER_GOOD;
}
GtkCssImage *
@@ -185,3 +189,8 @@ _gtk_css_image_surface_new_for_pixbuf (GdkPixbuf *pixbuf)
return image;
}
+void
+_gtk_css_image_surface_set_filter (GtkCssImageSurface *image, cairo_filter_t filter)
+{
+ image->filter = filter;
+}
diff --git a/gtk/gtkcssimagesurfaceprivate.h b/gtk/gtkcssimagesurfaceprivate.h
index 9619d8483d..ee758425af 100644
--- a/gtk/gtkcssimagesurfaceprivate.h
+++ b/gtk/gtkcssimagesurfaceprivate.h
@@ -42,6 +42,8 @@ struct _GtkCssImageSurface
cairo_surface_t *cache; /* the scaled surface - to avoid scaling every time we need to draw */
double width; /* original cache width */
double height; /* original cache height */
+ cairo_filter_t filter;
+ cairo_filter_t cache_filter;
};
struct _GtkCssImageSurfaceClass
@@ -53,6 +55,8 @@ GType _gtk_css_image_surface_get_type (void) G_GNUC_CONST;
GtkCssImage * _gtk_css_image_surface_new (cairo_surface_t *surface);
GtkCssImage * _gtk_css_image_surface_new_for_pixbuf (GdkPixbuf *pixbuf);
+void _gtk_css_image_surface_set_filter (GtkCssImageSurface *image,
+ cairo_filter_t filter);
G_END_DECLS
diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c
index 9fd506a0ca..1491dde99b 100644
--- a/gtk/gtkcssstylepropertyimpl.c
+++ b/gtk/gtkcssstylepropertyimpl.c
@@ -719,6 +719,17 @@ css_image_value_parse_with_builtin (GtkCssStyleProperty *property,
return css_image_value_parse (property, parser);
}
+static GtkCssValue *
+cairo_filter_parse (GtkCssStyleProperty *property, GtkCssParser *parser)
+{
+ GtkCssValue *value = _gtk_css_eos_cairo_filter_value_try_parse (parser);
+
+ if (value == NULL)
+ _gtk_css_parser_error (parser, "unknown value for property");
+
+ return value;
+}
+
static void
css_image_value_query (GtkCssStyleProperty *property,
const GtkCssValue *css_value,
@@ -1869,4 +1880,13 @@ G_GNUC_END_IGNORE_DEPRECATIONS
color_query,
color_assign,
_gtk_css_color_value_new_current_color ());
+ gtk_css_style_property_register ("-eos-cairo-filter",
+ GTK_CSS_PROPERTY_EOS_CAIRO_FILTER,
+ G_TYPE_NONE,
+ GTK_STYLE_PROPERTY_INHERIT,
+ GTK_CSS_AFFECTS_BACKGROUND,
+ cairo_filter_parse,
+ NULL,
+ NULL,
+ _gtk_css_eos_cairo_filter_value_new (CAIRO_FILTER_GOOD));
}
diff --git a/gtk/gtkcsstypesprivate.h b/gtk/gtkcsstypesprivate.h
index 59f392a032..e9abbb0f34 100644
--- a/gtk/gtkcsstypesprivate.h
+++ b/gtk/gtkcsstypesprivate.h
@@ -227,6 +227,7 @@ enum { /*< skip >*/
GTK_CSS_PROPERTY_GTK_KEY_BINDINGS,
GTK_CSS_PROPERTY_CARET_COLOR,
GTK_CSS_PROPERTY_SECONDARY_CARET_COLOR,
+ GTK_CSS_PROPERTY_EOS_CAIRO_FILTER,
/* add more */
GTK_CSS_PROPERTY_N_PROPERTIES
};
diff --git a/gtk/gtkrenderbackground.c b/gtk/gtkrenderbackground.c
index 992cf20522..0931bd3d1b 100644
--- a/gtk/gtkrenderbackground.c
+++ b/gtk/gtkrenderbackground.c
@@ -22,6 +22,7 @@
#include "config.h"
#include "gtkrenderbackgroundprivate.h"
+#include "gtkcssimagesurfaceprivate.h"
#include "gtkcssarrayvalueprivate.h"
#include "gtkcssbgsizevalueprivate.h"
@@ -148,6 +149,14 @@ _gtk_theming_background_paint_layer (GtkThemingBackground *bg,
cairo_save (cr);
+ if (GTK_IS_CSS_IMAGE_SURFACE (image))
+ {
+ const GtkCssValue *value;
+ value = gtk_css_style_get_value (bg->style, GTK_CSS_PROPERTY_EOS_CAIRO_FILTER);
+ _gtk_css_image_surface_set_filter (GTK_CSS_IMAGE_SURFACE (image),
+ _gtk_css_eos_cairo_filter_get (value));
+ }
+
_gtk_rounded_box_path (
&bg->boxes[
_gtk_css_area_value_get (
--
2.15.1
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment