Commit 670f5923 authored by Mohammed Sadiq's avatar Mohammed Sadiq
Browse files

Merge branch 'master' into wip/sadiq/byzantium

parents 6a2c7a49 f9f601cd
......@@ -19,13 +19,13 @@ before_script:
- wget -O- https://ci.puri.sm/ci-repo.key | apt-key add -
- apt-get -y update
- apt-get -y build-dep .
- apt-get -y install libgtk-3-bin xvfb
build-debian-gcc-buster:
<<: *tags
image: debian:buster
stage: build
script:
- apt-get -y install libgtk-3-bin xvfb
- export LC_ALL=C.UTF-8
- meson . _build -Db_coverage=true --werror
- ninja -C _build
......@@ -59,6 +59,7 @@ test:debian-gcc:
dependencies:
- build-debian-gcc-buster
script:
- apt-get -y install libgtk-3-bin xvfb
- export G_DEBUG=fatal-warnings
- export LC_ALL=C.UTF-8
- xvfb-run -a -s "-screen 0 1024x768x24" ninja -C _build test
......@@ -95,6 +96,7 @@ autopkgtest-debian-buster-package:
extends: .l5-autopkgtest-debian-package
lintian-debian-buster-package:
before_script: []
dependencies:
- package:deb-debian-buster
extends: .l5-lintian-debian-package
......
From 5b34d5883d1c7fc9d306491a0823badcaf03bdda Mon Sep 17 00:00:00 2001
From: Julian Sparber <julian@sparber.net>
Date: Fri, 8 Nov 2019 16:44:18 +0100
Subject: [PATCH] Remove java dep, and fix build issue
---
cpp/CMakeLists.txt | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 38ce1f50..b5e2770b 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -130,9 +130,6 @@ endif ()
find_required_program (PROTOC protoc
"Google Protocol Buffers compiler (protoc)")
-find_required_program (JAVA java
- "Java Runtime Environment")
-
if (APPLE)
FIND_LIBRARY (COREFOUNDATION_LIB CoreFoundation)
FIND_LIBRARY (FOUNDATION_LIB Foundation)
@@ -268,13 +265,10 @@ function (add_metadata_gen_target TARGET_NAME
set (METADATA_SOURCE_DIR "${CMAKE_SOURCE_DIR}/src/phonenumbers")
set (GEN_OUTPUT "${METADATA_SOURCE_DIR}/${METADATA_TYPE}.cc"
"${METADATA_SOURCE_DIR}/${METADATA_HEADER}.h")
- set (JAR_PATH "${CMAKE_SOURCE_DIR}/../tools/java/cpp-build/target")
- set (JAR_PATH "${JAR_PATH}/cpp-build-1.0-SNAPSHOT-jar-with-dependencies.jar")
-
add_custom_command (
- COMMAND ${JAVA_BIN} -jar
- ${JAR_PATH} BuildMetadataCppFromXml ${XML_FILE}
- ${CMAKE_SOURCE_DIR}/src/phonenumbers ${METADATA_TYPE}
+ COMMAND echo "skip metadata generation from"
+ ${XML_FILE} "to"
+ ${CMAKE_SOURCE_DIR}/src/phonenumbers ${METADATA_TYPE}
OUTPUT ${GEN_OUTPUT}
DEPENDS ${XML_FILE}
@@ -314,7 +308,7 @@ add_metadata_gen_target (
${TEST_METADATA_TARGET}
"${RESOURCES_DIR}/PhoneNumberMetadataForTesting.xml"
"test_metadata"
- "metadata"
+ "test_metadata"
)
list (APPEND TESTING_LIBRARY_SOURCES "src/phonenumbers/test_metadata.cc")
--
2.20.1
......@@ -68,6 +68,12 @@
<description>Whether pressing Enter key sends the message</description>
</key>
<key name="experimental-features" type="b">
<default>false</default>
<summary>Enable experimental features</summary>
<description>Whether to enable experimental features</description>
</key>
<key name="window-maximized" type="b">
<default>false</default>
<summary>Window maximized</summary>
......
......@@ -11,9 +11,14 @@ Build-Depends:
libfeedback-dev,
libhandy-1-dev (>= 1.0.0),
libebook-contacts1.2-dev,
libgcrypt20-dev,
libjson-glib-dev,
libphonenumber-dev,
libpurple-dev,
libsqlite3-dev,
libolm-dev,
libsecret-1-dev,
libsoup2.4-dev,
libsqlite3-dev (>= 3.26.0),
libebook1.2-dev,
gsettings-desktop-schemas-dev,
meson,
......
......@@ -6,15 +6,27 @@ project(
i18n = import('i18n')
gnome = import('gnome')
cc = meson.get_compiler('c')
top_inc = include_directories('.')
src_inc = include_directories('src')
config_h = configuration_data()
config_h.set10('HAVE_EXPLICIT_BZERO', cc.has_function('explicit_bzero'))
config_h.set_quoted('GETTEXT_PACKAGE', 'purism-chatty')
config_h.set_quoted('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir')))
config_h.set_quoted('PACKAGE_NAME', meson.project_name())
config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
# TODO: Use has_headers: 'olm/olm.h' when we bump meson requirement
libolm_dep = cc.find_library('olm', required: true)
if (cc.has_function('olm_pk_key_from_private', dependencies: libolm_dep))
config_h.set('HAVE_OLM3', true)
else
config_h.set('HAVE_OLM2', true)
endif
configure_file(
output: 'chatty-config.h',
configuration: config_h,
......@@ -22,10 +34,9 @@ configure_file(
add_project_arguments([
'-I' + meson.build_root(),
'-DGLIB_DISABLE_DEPRECATION_WARNINGS',
'-DG_LOG_USE_STRUCTURED',
], language: 'c')
cc = meson.get_compiler('c')
global_c_args = []
test_c_args = [
'-Wcast-align',
......
......@@ -7,7 +7,9 @@ es
fi
fr
fur
ht
hu
id
it
ja
ko
......
......@@ -10,12 +10,12 @@ src/chatty-chat.c
src/chatty-chat.h
src/chatty-contact-provider.c
src/chatty-contact-provider.h
src/chatty-dbus.c
src/chatty-dbus.h
src/chatty-history.c
src/chatty-history.h
src/chatty-icons.c
src/chatty-icons.h
src/chatty-fp-row.c
src/chatty-fp-row.h
src/chatty-list-row.c
src/chatty-list-row.h
src/chatty-manager.c
......@@ -23,34 +23,40 @@ src/chatty-manager.h
src/chatty-message-row.c
src/chatty-message.c
src/chatty-message.h
src/chatty-notify.c
src/chatty-notify.h
src/chatty-notification.c
src/chatty-notification.h
src/chatty-purple-notify.c
src/chatty-purple-notify.h
src/chatty-purple-request.c
src/chatty-purple-request.h
src/chatty-secret-store.c
src/chatty-secret-store.h
src/chatty-settings.c
src/chatty-settings.h
src/chatty-utils.c
src/chatty-utils.h
src/chatty-window.c
src/chatty-window.h
src/dialogs/chatty-muc-info-dialog.c
src/dialogs/chatty-muc-info-dialog.h
src/dialogs/chatty-info-dialog.c
src/dialogs/chatty-info-dialog.h
src/dialogs/chatty-new-chat-dialog.c
src/dialogs/chatty-new-chat-dialog.h
src/dialogs/chatty-new-muc-dialog.c
src/dialogs/chatty-new-muc-dialog.h
src/dialogs/chatty-settings-dialog.c
src/dialogs/chatty-settings-dialog.h
src/dialogs/chatty-user-info-dialog.c
src/dialogs/chatty-user-info-dialog.h
src/main.c
src/matrix/chatty-ma-account.c
src/matrix/chatty-ma-account.h
src/matrix/chatty-ma-chat.c
src/matrix/chatty-ma-chat.h
src/matrix/matrix-utils.c
src/matrix/matrix-utils.h
src/ui/chatty-contact-row.ui
src/ui/chatty-dialog-join-muc.ui
src/ui/chatty-dialog-muc-info.ui
src/ui/chatty-dialog-new-chat.ui
src/ui/chatty-dialog-user-info.ui
src/ui/chatty-info-dialog.ui
src/ui/chatty-fp-row.ui
src/ui/chatty-list-row.ui
src/ui/chatty-settings-dialog.ui
src/ui/chatty-window.ui
......
......@@ -4,3 +4,7 @@ src/contrib/gtkflattenlistmodel.c
src/contrib/gtkslicelistmodel.c
src/contrib/gtksorter.c
src/contrib/gtksortlistmodel.c
src/matrix/matrix-db.c
src/matrix/matrix-db.h
src/matrix/matrix-api.c
src/matrix/matrix-api.h
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -3,28 +3,15 @@
"runtime": "org.gnome.Platform",
"runtime-version": "master",
"sdk": "org.gnome.Sdk",
"sdk-extensions": [
"org.freedesktop.Sdk.Extension.openjdk11"
],
"command": "chatty",
"finish-args": [
"--share=network",
"--share=ipc",
"--socket=x11",
"--socket=fallback-x11",
"--socket=wayland",
"--filesystem=xdg-run/dconf",
"--filesystem=~/.config/dconf:ro",
"--talk-name=ca.desrt.dconf",
"--env=DCONF_USER_CONFIG_DIR=.config/dconf",
"--env=PATH=/app/jre/bin:/usr/bin"
"--talk-name=org.sigxcpu.Feedback"
],
"build-options": {
"cflags": "-O2 -g",
"cxxflags": "-O2 -g",
"env": {
"V": "1"
}
},
"cleanup-commands": [ "rm -rf /app/lib/debug/ /app/include/boost" ],
"cleanup": [
"/include",
"/lib/pkgconfig",
......@@ -33,6 +20,8 @@
"/share/gtk-doc",
"/share/man",
"/share/pkgconfig",
"/share/aclocal",
"/share/vala",
"*.la",
"*.a"
],
......@@ -72,27 +61,6 @@
}
]
},
{
"name": "libhandy",
"buildsystem": "meson",
"builddir": true,
"config-opts": [
"-Dglade_catalog=disabled"
],
"sources": [
{
"type": "git",
"url": "https://source.puri.sm/Librem5/libhandy.git"
}
]
},
{
"name": "openjdk",
"buildsystem": "simple",
"build-commands": [
"/usr/lib/sdk/openjdk11/install.sh"
]
},
{
"name": "libical",
"cleanup": [
......@@ -100,16 +68,18 @@
],
"buildsystem": "cmake-ninja",
"config-opts": [
"-DCMAKE_INSTALL_LIBDIR:PATH=/app/lib",
"-DBUILD_SHARED_LIBS=On",
"-DICAL_BUILD_DOCS=False",
"-DWITH_CXX_BINDINGS=False"
"-DCMAKE_BUILD_TYPE=Release",
"-DCMAKE_INSTALL_LIBDIR=lib",
"-DBUILD_SHARED_LIBS:BOOL=ON",
"-DICAL_GLIB=true",
"-DGOBJECT_INTROSPECTION=true",
"-DICAL_GLIB_VAPI=true",
"-DICAL_BUILD_DOCS=false"
],
"sources": [
{
"type": "archive",
"url": "https://github.com/libical/libical/releases/download/v3.0.5/libical-3.0.5.tar.gz",
"sha256": "7ad550c8c49c9b9983658e3ab3e68b1eee2439ec17b169a6b1e6ecb5274e78e6"
"type": "git",
"url": "https://github.com/libical/libical.git"
}
]
},
......@@ -167,42 +137,48 @@
"sources": [
{
"type": "archive",
"url": "https://github.com/google/libphonenumber/archive/v8.10.16.tar.gz",
"sha256": "0cd9baf788dc7a7cca94ecbd43d0a562c4acf21f234d66d756574be89edf14c5"
"url": "https://github.com/google/libphonenumber/archive/v8.10.22.tar.gz",
"sha256": "1d43a94502c875cb44f9bd464c5898bca6db9a54e18288892921e985268a3fb4"
},
{
"type": "shell",
"commands": [
"sed -i -e 's/\${\${NAME}_BIN}-NOTFOUND/\${NAME}_BIN-NOTFOUND/' cpp/CMakeLists.txt"
]
},
{
"type" : "patch",
"path" : "0001-Remove-java-dep-and-fix-build-issue.patch"
}
],
"subdir": "cpp",
"build-options": {
"append-path": "/app/jre/bin"
}
"subdir": "cpp"
},
{
"name": "evolution-data-server",
"cleanup": [
"/share/GConf"
"/share/GConf",
"/lib/cmake",
"/lib/evolution-data-server/*-backends",
"/libexec",
"/share/dbus-1/services"
],
"buildsystem": "cmake-ninja",
"config-opts": [
"-DENABLE_PHONENUMBER=ON",
"-DENABLE_DOT_LOCKING=OFF",
"-DENABLE_FILE_LOCKING=fcntl",
"-DENABLE_GOA=OFF",
"-DENABLE_GTK=ON",
"-DENABLE_GOA=OFF",
"-DENABLE_UOA=OFF",
"-DENABLE_GOOGLE_AUTH=OFF",
"-DENABLE_GOOGLE=OFF",
"-DENABLE_VALA_BINDINGS=OFF",
"-DENABLE_WITH_PHONENUMBER=ON",
"-DENABLE_VALA_BINDINGS=ON",
"-DENABLE_WEATHER=OFF",
"-DWITH_OPENLDAP=OFF",
"-DWITH_LIBDB=OFF",
"-DENABLE_INTROSPECTION=OFF",
"-DENABLE_INTROSPECTION=ON",
"-DENABLE_INSTALLED_TESTS=OFF",
"-DENABLE_GTK_DOC=OFF",
"-DENABLE_EXAMPLES=OFF"
"-DENABLE_EXAMPLES=OFF",
"-DENABLE_CANBERRA=OFF"
],
"sources": [
{
......@@ -212,11 +188,32 @@
]
},
{
"name": "purism-chatty",
"name": "libfeedback",
"buildsystem": "meson",
"config-opts": [
"--libdir=lib"
"-Dtests=false",
"-Ddaemon=false"
],
"sources": [
{
"type": "git",
"url": "https://source.puri.sm/Librem5/feedbackd.git"
}
]
},
{
"name": "olm",
"buildsystem": "cmake-ninja",
"sources": [
{
"type": "git",
"url": "https://gitlab.matrix.org/matrix-org/olm.git"
}
]
},
{
"name": "purism-chatty",
"buildsystem": "meson",
"builddir": true,
"sources": [
{
......@@ -226,4 +223,4 @@
]
}
]
}
\ No newline at end of file
}
......@@ -34,6 +34,7 @@
#include "chatty-application.h"
#include "chatty-settings.h"
#include "chatty-history.h"
#include "chatty-log.h"
#define LIBFEEDBACK_USE_UNSTABLE_API
#include <libfeedback.h>
......@@ -51,7 +52,6 @@ struct _ChattyApplication
GtkWidget *main_window;
ChattySettings *settings;
GtkCssProvider *css_provider;
ChattyManager *manager;
char *uri;
......@@ -60,20 +60,39 @@ struct _ChattyApplication
gboolean daemon;
gboolean show_window;
gboolean enable_debug;
gboolean enable_verbose;
};
G_DEFINE_TYPE (ChattyApplication, chatty_application, GTK_TYPE_APPLICATION)
static gboolean cmd_verbose_cb (const char *option_name,
const char *value,
gpointer data,
GError **error);
static GOptionEntry cmd_options[] = {
{ "version", 'v', G_OPTION_FLAG_NONE, G_OPTION_ARG_NONE, NULL, N_("Show release version"), NULL },
{ "version", 0, G_OPTION_FLAG_NONE, G_OPTION_ARG_NONE, NULL, N_("Show release version"), NULL },
{ "daemon", 'D', G_OPTION_FLAG_NONE, G_OPTION_ARG_NONE, NULL, N_("Start in daemon mode"), NULL },
{ "nologin", 'n', G_OPTION_FLAG_NONE, G_OPTION_ARG_NONE, NULL, N_("Disable all accounts"), NULL },
{ "debug", 'd', G_OPTION_FLAG_NONE, G_OPTION_ARG_NONE, NULL, N_("Enable libpurple debug messages"), NULL },
{ "verbose", 'V', G_OPTION_FLAG_NONE, G_OPTION_ARG_NONE, NULL, N_("Enable verbose libpurple debug messages"), NULL },
{ "verbose", 'v', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, cmd_verbose_cb,
N_("Enable verbose libpurple debug messages"), NULL },
{ NULL }
};
static gboolean
cmd_verbose_cb (const char *option_name,
const char *value,
gpointer data,
GError **error)
{
chatty_log_increase_verbosity ();
purple_debug_set_enabled (TRUE);
purple_debug_set_verbose (TRUE);
return TRUE;
}
static int
run_dialog_and_destroy (GtkDialog *dialog)
{
......@@ -221,7 +240,6 @@ chatty_application_finalize (GObject *object)
ChattyApplication *self = (ChattyApplication *)object;
g_clear_handle_id (&self->open_uri_id, g_source_remove);
g_clear_object (&self->css_provider);
g_clear_object (&self->manager);
G_OBJECT_CLASS (chatty_application_parent_class)->finalize (object);
......@@ -262,17 +280,14 @@ chatty_application_command_line (GApplication *application,
g_debug ("Enable daemon mode");
}
if (g_variant_dict_contains (options, "nologin")) {
if (g_variant_dict_contains (options, "nologin"))
chatty_manager_disable_auto_login (chatty_manager_get_default (), TRUE);
} else if (g_variant_dict_contains (options, "debug")) {
self->enable_debug = TRUE;
} else if (g_variant_dict_contains (options, "verbose")) {
if (g_variant_dict_contains (options, "debug"))
self->enable_debug = TRUE;
self->enable_verbose = TRUE;
}
purple_debug_set_enabled (self->enable_debug);
purple_debug_set_verbose (self->enable_verbose);
purple_debug_set_verbose (chatty_log_get_verbosity () > 0);
arguments = g_application_command_line_get_arguments (command_line, &argc);
......@@ -292,36 +307,46 @@ static void
chatty_application_startup (GApplication *application)
{
ChattyApplication *self = (ChattyApplication *)application;
g_autoptr(GtkCssProvider) provider = NULL;
g_autofree char *db_path = NULL;
g_autofree char *dir = NULL;
static const GActionEntry app_entries[] = {
{ "show-window", chatty_application_show_window },
};
self->daemon = FALSE;
self->manager = g_object_ref (chatty_manager_get_default ());
self->manager = chatty_manager_get_default ();
G_APPLICATION_CLASS (chatty_application_parent_class)->startup (application);
g_info ("%s %s, git version: %s", PACKAGE_NAME, PACKAGE_VERSION, GIT_VERSION);
hdy_init ();
g_set_application_name (_("Chats"));
dir = g_build_filename (g_get_user_cache_dir (), "chatty", "matrix", "files", "thumbnail", NULL);
g_mkdir_with_parents (dir, S_IRWXU);
lfb_init (CHATTY_APP_ID, NULL);
db_path = g_build_filename (purple_user_dir(), "chatty", "db", NULL);
chatty_history_open (db_path, "chatty-history.db");
chatty_history_open (chatty_manager_get_history (self->manager),
db_path, "chatty-history.db");
self->settings = chatty_settings_get_default ();
if (chatty_settings_get_experimental_features (self->settings))
g_warning ("Experimental features enabled");
self->css_provider = gtk_css_provider_new ();
gtk_css_provider_load_from_resource (self->css_provider,
provider = gtk_css_provider_new ();
gtk_css_provider_load_from_resource (provider,
"/sm/puri/Chatty/css/style.css");
gtk_style_context_add_provider_for_screen (gdk_screen_get_default(),
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_USER);
g_action_map_add_action_entries (G_ACTION_MAP (self), app_entries,
G_N_ELEMENTS (app_entries), self);
gtk_style_context_add_provider_for_screen (gdk_screen_get_default(),
GTK_STYLE_PROVIDER (self->css_provider),
GTK_STYLE_PROVIDER_PRIORITY_USER);
g_signal_connect_object (self->manager, "authorize-buddy",
G_CALLBACK (application_authorize_buddy_cb), self,
G_CONNECT_SWAPPED);
......@@ -372,8 +397,10 @@ chatty_application_activate (GApplication *application)
static void
chatty_application_shutdown (GApplication *application)
{
ChattyApplication *self = (ChattyApplication *)application;
g_object_unref (chatty_settings_get_default ());
chatty_history_close ();
chatty_history_close (chatty_manager_get_history (self->manager));
lfb_uninit ();
G_APPLICATION_CLASS (chatty_application_parent_class)->shutdown (application);
......@@ -437,9 +464,14 @@ chatty_application_get_main_window (ChattyApplication *self)
ChattyChat *
chatty_application_get_active_chat (ChattyApplication *self)
{
GtkWidget *widget = NULL;
g_return_val_if_fail (CHATTY_IS_APPLICATION (self), NULL);
if (self->main_window)
widget = gtk_window_get_focus (GTK_WINDOW (self->main_window));
if (self->main_window && widget && gtk_widget_has_focus (widget))
return chatty_window_get_active_chat (CHATTY_WINDOW (self->main_window));
return NULL;
......