unity8: initial packaging (!27)

* Mir starts up and is able to display system settings
* x86_64 only for now, because at least ubuntu-app-test did not build
  on aarch64

Based on PureTryOut's work. Getting it to this stage was a huge effort
(as it shows in the package count: 111(!)). See the merge request for
details.

[skip ci]: this won't finish in CI; ollieparanoid made sure that
           everything builds for x86_64.
This commit is contained in:
Luca Weiss 2018-09-03 01:29:38 +02:00 committed by Oliver Smith
parent 7df8828dfb
commit 8c2a95dbe2
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
111 changed files with 8125 additions and 0 deletions

44
main/dbus-cpp/APKBUILD Normal file
View file

@ -0,0 +1,44 @@
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=dbus-cpp
pkgver=5.0.1
pkgrel=0
_commit="967dc1caf0efe0a1286c308e8e8dd1bf7da5f3ee"
pkgdesc="A header-only dbus-binding leveraging C++-11"
url="https://code.launchpad.net/dbus-cpp"
arch="x86_64"
license="LGPL3"
depends="dbus libxml2 boost properties-cpp"
depends_dev="boost-dev"
makedepends="$depends_dev cmake cmake-extras libxml2-dev properties-cpp-dev dbus-dev linux-headers process-cpp-dev gtest-dev gmock"
install=""
subpackages="$pkgname-dev"
source="https://github.com/lib-cpp/dbus-cpp/archive/$_commit.tar.gz
boost_io_context.patch" # https://github.com/lib-cpp/dbus-cpp/pull/2
builddir="$srcdir/$pkgname-$_commit"
options="!check" # 53% tests passed, 7 tests failed out of 15
build() {
mkdir "$builddir"/build
cd "$builddir"/build
cmake .. \
-DCMAKE_INSTALL_LIBDIR=/usr/lib \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DDBUS_CPP_VERSION_MAJOR=5 \
-DDBUS_CPP_VERSION_MINOR=0 \
-DDBUS_CPP_VERSION_PATCH=0
make
}
check() {
cd "$builddir"/build
make test
}
package() {
cd "$builddir"/build
make DESTDIR="$pkgdir" install
}
sha512sums="6db299307eb966600d488aa31db2814095c562c9c62a46b614ec1fa361f3c17900bbbe3da021629e6b7279ad99bf193393772302bfc8f6b5ea80ef3497fb7f46 967dc1caf0efe0a1286c308e8e8dd1bf7da5f3ee.tar.gz
55862c347f2aeabd00b3d547b34c7b3c5bbbb3f40a76cb2e20711c6168b4780db36436f631cf33f1b6ff48f3e6a83480db1df69cafa7e8a25e5f06df9ea53829 boost_io_context.patch"

View file

@ -0,0 +1,25 @@
diff --git a/include/core/dbus/asio/executor.h b/include/core/dbus/asio/executor.h
index d1f043e..505a55b 100644
--- a/include/core/dbus/asio/executor.h
+++ b/include/core/dbus/asio/executor.h
@@ -18,18 +18,12 @@
#ifndef CORE_DBUS_ASIO_EXECUTOR_H_
#define CORE_DBUS_ASIO_EXECUTOR_H_
+#include <boost/asio/io_service.hpp>
+
#include <core/dbus/bus.h>
#include <core/dbus/executor.h>
#include <core/dbus/visibility.h>
-namespace boost
-{
-namespace asio
-{
-class io_service;
-}
-}
-
namespace core
{
namespace dbus

View file

@ -0,0 +1,30 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=dbus-test-runner
pkgver=15.04.0
pkgrel=0
pkgdesc="A small little utility to run a couple of executables under a new DBus session for testing"
url="https://launchpad.net/dbus-test-runner"
arch="x86_64"
license=GPL-3.0
depends="dbus"
makedepends="gnome-common automake autoconf intltool libtool dbus-glib-dev"
source="$pkgname-$pkgver.tar.gz::https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/dbus-test-runner/$pkgver+16.10.20160906-0ubuntu1/dbus-test-runner_$pkgver+16.10.20160906.orig.tar.gz"
options="!check"
builddir="$srcdir"
build() {
export CFLAGS="${CFLAGS:-} -Wno-error=deprecated -Wno-error=deprecated-declarations"
./autogen.sh \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--libexecdir=/usr/lib
make
}
package() {
cd "$builddir"
make DESTDIR="$pkgdir/" install
}
sha512sums="ce358cfa0b993546306f723c2cbd2e2226badee44d0bdbbe94d279912cdbfd07e291ffe3e5b84800933533c87a32dbe17cdf2aa875f2503096ffdf88cab2c15c dbus-test-runner-15.04.0.tar.gz"

View file

@ -0,0 +1,34 @@
pkgname=dmz-cursor-theme
pkgver=0.4.5
pkgrel=0
pkgdesc="Vanilla DMZ cursor theme"
arch="noarch"
url="http://jimmac.musichall.cz/"
license="CCPL:by-nc-sa"
makedepends="xcursorgen"
source="http://ftp.de.debian.org/debian/pool/main/d/$pkgname/${pkgname}_$pkgver.tar.xz"
subpackages="$pkgname-black"
options="!check"
build() {
cd "$builddir"
(cd DMZ-White/pngs ; ./make.sh)
(cd DMZ-Black/pngs ; ./make.sh)
}
package() {
cd "$builddir"
install -d "$pkgdir"/usr/share/icons/DMZ-White/cursors
cp -a DMZ-White/xcursors/* "$pkgdir"/usr/share/icons/DMZ-White/cursors
install -Dm644 DMZ-White/index.theme "$pkgdir"/usr/share/icons/DMZ-White/index.theme
}
black() {
pkgdesc="Vanilla DMZ Black cursor theme"
cd "$builddir"
install -d "$subpkgdir"/usr/share/icons/DMZ-Black/cursors
cp -a DMZ-Black/xcursors/* "$subpkgdir"/usr/share/icons/DMZ-Black/cursors
install -Dm644 DMZ-Black/index.theme "$subpkgdir"/usr/share/icons/DMZ-Black/index.theme
}
sha512sums="627fff9e4f690e30c6acbedb06035abc3ca7f6c6656a7e1290d752e115dbd8a41c37a2fe0d7cd7ece697c54dd7a343dd78d3c4604d124158961d95125f899f73 dmz-cursor-theme_0.4.5.tar.xz"

View file

@ -0,0 +1,39 @@
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=libaccounts-glib
pkgver=1.24
pkgrel=0
pkgdesc="GLib-based client library for the accounts database"
url="https://gitlab.com/accounts-sso/libaccounts-glib"
arch="x86_64"
license="LGPL-2.1"
depends=""
makedepends="meson glib-dev libxml2-dev sqlite-dev gobject-introspection-dev vala py3-gobject3 check-dev gtk-doc"
subpackages="$pkgname-dev"
source="https://gitlab.com/accounts-sso/$pkgname/-/archive/VERSION_$pkgver/$pkgname-VERSION_$pkgver.tar.gz"
builddir="$srcdir/$pkgname-VERSION_$pkgver"
options="!check" # Needs D-Bus server
prepare() {
default_prepare
mkdir "$builddir"/build
}
build() {
cd "$builddir"/build
meson \
--prefix=/usr \
--buildtype=release \
--sysconfdir=/etc ..
ninja
}
check() {
cd "$builddir"/build
ninja test
}
package() {
cd "$builddir"/build
DESTDIR="$pkgdir" ninja install
}
sha512sums="d4e6906f642c7a196cb42172f31345f58037d528950bee3af2b8cb388aea386056cbaa22f0e7c604a4e00038b231e9ee455f6a1d48f82344cfc0037ad7251b7c libaccounts-glib-VERSION_1.24.tar.gz"

View file

@ -0,0 +1,38 @@
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=libsignon-glib
pkgver=2.1
_spec_commit="67487954653006ebd0743188342df65342dc8f9b"
pkgrel=0
pkgdesc="GLib library to interface with the Signon Daemon"
url="https://gitlab.com/accounts-sso/libsignon-glib"
arch="x86_64"
license="LGPL-2.1"
depends=""
makedepends="meson glib-dev check-dev gobject-introspection-dev vala py3-gobject3 gtk-doc"
subpackages="$pkgname-dev"
source="https://gitlab.com/accounts-sso/$pkgname/-/archive/VERSION_$pkgver/$pkgname-VERSION_$pkgver.tar.gz
https://gitlab.com/accounts-sso/signon-dbus-specification/-/archive/$_spec_commit/signon-dbus-specification-$_spec_commit.tar.gz"
builddir="$srcdir/$pkgname-VERSION_$pkgver"
options="!check"
prepare() {
default_prepare
mkdir "$builddir"/build
cp "$srcdir"/signon-dbus-specification-$_spec_commit/* "$builddir"/libsignon-glib/interfaces/
}
build() {
cd "$builddir"/build
meson \
--prefix=/usr \
--buildtype=release \
--sysconfdir=/etc ..
ninja
}
package() {
cd "$builddir"/build
DESTDIR="$pkgdir" ninja install
}
sha512sums="45d8e26263a16b98517cda0fff8e46fb1ffcc4bb833a6364454f120eb9819b48ee04bdb338bf5e9f0b0fe344af5940f35ed56f0765ca3605dead5b3755657dcf libsignon-glib-VERSION_2.1.tar.gz
8b65019e2793dd58b2b60f8893ab999513a6aa2374f5d1053341fcdec6e2debb4d729abbbef17c8a2cb0b905893f06118649f17698bb91dc4e2681b2fe99e4b3 signon-dbus-specification-67487954653006ebd0743188342df65342dc8f9b.tar.gz"

View file

@ -0,0 +1,591 @@
From 137154eacd98118beef0664d47a2eae82eefd1f0 Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Sat, 9 Feb 2019 01:31:42 +0100
Subject: [PATCH 1/3] Port to new jsoncpp API
---
tests/http_client_load_test.cpp | 14 +++--
tests/http_client_test.cpp | 80 +++++++++++++++++-----------
tests/http_streaming_client_test.cpp | 75 +++++++++++++++-----------
3 files changed, 99 insertions(+), 70 deletions(-)
diff --git a/tests/http_client_load_test.cpp b/tests/http_client_load_test.cpp
index 79d125b..105c316 100644
--- a/tests/http_client_load_test.cpp
+++ b/tests/http_client_load_test.cpp
@@ -132,10 +132,6 @@ TEST_F(HttpClientLoadTest, async_head_request_for_existing_resource_succeeds)
auto response_verifier = [](const http::Response& response) -> bool
{
- // All endpoint data on httpbin.org is JSON encoded.
- json::Value root;
- json::Reader reader;
-
// We expect the query to complete successfully
EXPECT_EQ(core::net::http::Status::ok, response.status);
@@ -159,12 +155,13 @@ TEST_F(HttpClientLoadTest, async_get_request_for_existing_resource_succeeds)
{
// All endpoint data on httpbin.org is JSON encoded.
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
// We expect the query to complete successfully
EXPECT_EQ(core::net::http::Status::ok, response.status);
// Parsing the body of the response as JSON should succeed.
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
// The url field of the payload should equal the original url we requested.
EXPECT_EQ(url, root["url"].asString());
@@ -191,12 +188,13 @@ TEST_F(HttpClientLoadTest, async_post_request_for_existing_resource_succeeds)
{
// All endpoint data on httpbin.org is JSON encoded.
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
// We expect the query to complete successfully
EXPECT_EQ(core::net::http::Status::ok, response.status);
// Parsing the body of the response as JSON should succeed.
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
// The url field of the payload should equal the original url we requested.
EXPECT_EQ(payload, root["data"].asString());
diff --git a/tests/http_client_test.cpp b/tests/http_client_test.cpp
index dd37d4f..e7cdd73 100644
--- a/tests/http_client_test.cpp
+++ b/tests/http_client_test.cpp
@@ -144,7 +144,8 @@ TEST(HttpClient, get_request_for_existing_resource_succeeds)
// All endpoint data on httpbin.org is JSON encoded.
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
// We finally execute the query synchronously and story the response.
auto response = request->execute(default_progress_reporter);
@@ -152,7 +153,7 @@ TEST(HttpClient, get_request_for_existing_resource_succeeds)
// We expect the query to complete successfully
EXPECT_EQ(core::net::http::Status::ok, response.status);
// Parsing the body of the response as JSON should succeed.
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
// The url field of the payload should equal the original url we requested.
EXPECT_EQ(url, root["url"].asString());
}
@@ -174,7 +175,8 @@ TEST(HttpClient, get_request_with_custom_headers_for_existing_resource_succeeds)
// All endpoint data on httpbin.org is JSON encoded.
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
// We finally execute the query synchronously and story the response.
auto response = request->execute(default_progress_reporter);
@@ -183,7 +185,7 @@ TEST(HttpClient, get_request_with_custom_headers_for_existing_resource_succeeds)
EXPECT_EQ(core::net::http::Status::ok, response.status);
// Parsing the body of the response as JSON should succeed.
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
auto headers = root["headers"];
@@ -207,7 +209,8 @@ TEST(HttpClient, empty_header_values_are_handled_correctly)
// All endpoint data on httpbin.org is JSON encoded.
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
// We finally execute the query synchronously and story the response.
auto response = request->execute(default_progress_reporter);
@@ -216,7 +219,7 @@ TEST(HttpClient, empty_header_values_are_handled_correctly)
EXPECT_EQ(core::net::http::Status::ok, response.status);
// Parsing the body of the response as JSON should succeed.
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
auto headers = root["headers"];
EXPECT_EQ(std::string{}, headers["Empty"].asString());
@@ -240,7 +243,8 @@ TEST(HttpClient, get_request_for_existing_resource_guarded_by_basic_auth_succeed
// All endpoint data on httpbin.org is JSON encoded.
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
// We finally execute the query synchronously and story the response.
auto response = request->execute(default_progress_reporter);
@@ -248,7 +252,7 @@ TEST(HttpClient, get_request_for_existing_resource_guarded_by_basic_auth_succeed
// We expect the query to complete successfully
EXPECT_EQ(core::net::http::Status::ok, response.status);
// Parsing the body of the response as JSON should succeed.
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
// We expect authentication to work.
EXPECT_TRUE(root["authenticated"].asBool());
// With the correct user id
@@ -274,7 +278,8 @@ TEST(HttpClient, DISABLED_get_request_for_existing_resource_guarded_by_digest_au
// All endpoint data on httpbin.org is JSON encoded.
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
// We finally execute the query synchronously and story the response.
auto response = request->execute(default_progress_reporter);
@@ -282,7 +287,7 @@ TEST(HttpClient, DISABLED_get_request_for_existing_resource_guarded_by_digest_au
// We expect the query to complete successfully
EXPECT_EQ(core::net::http::Status::ok, response.status);
// Parsing the body of the response as JSON should succeed.
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
// We expect authentication to work.
EXPECT_TRUE(root["authenticated"].asBool());
// With the correct user id
@@ -323,12 +328,13 @@ TEST(HttpClient, async_get_request_for_existing_resource_succeeds)
// All endpoint data on httpbin.org is JSON encoded.
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
// We expect the query to complete successfully
EXPECT_EQ(core::net::http::Status::ok, response.status);
// Parsing the body of the response as JSON should succeed.
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
// The url field of the payload should equal the original url we requested.
EXPECT_EQ(url, root["url"].asString());
@@ -362,7 +368,8 @@ TEST(HttpClient, async_get_request_for_existing_resource_guarded_by_basic_authen
// All endpoint data on httpbin.org is JSON encoded.
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
std::promise<core::net::http::Response> promise;
auto future = promise.get_future();
@@ -392,7 +399,7 @@ TEST(HttpClient, async_get_request_for_existing_resource_guarded_by_basic_authen
// We expect the query to complete successfully
EXPECT_EQ(core::net::http::Status::ok, response.status);
// Parsing the body of the response as JSON should succeed.
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
// We expect authentication to work.
EXPECT_TRUE(root["authenticated"].asBool());
// With the correct user id
@@ -416,7 +423,8 @@ TEST(HttpClient, post_request_for_existing_resource_succeeds)
// All endpoint data on httpbin.org is JSON encoded.
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
// We finally execute the query synchronously and story the response.
auto response = request->execute(default_progress_reporter);
@@ -424,7 +432,7 @@ TEST(HttpClient, post_request_for_existing_resource_succeeds)
// We expect the query to complete successfully
EXPECT_EQ(core::net::http::Status::ok, response.status);
// Parsing the body of the response as JSON should succeed.
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
// The url field of the payload should equal the original url we requested.
EXPECT_EQ(payload, root["data"].asString());
}
@@ -451,10 +459,11 @@ TEST(HttpClient, post_form_request_for_existing_resource_succeeds)
// All endpoint data on httpbin.org is JSON encoded.
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
EXPECT_EQ(core::net::http::Status::ok, response.status);
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
EXPECT_EQ("test", root["form"]["test"].asString());
}
@@ -476,12 +485,13 @@ TEST(HttpClient, post_request_for_file_with_large_chunk_succeeds)
size);
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
auto response = request->execute(default_progress_reporter);
EXPECT_EQ(core::net::http::Status::ok, response.status);
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
EXPECT_EQ(url, root["url"].asString());
}
@@ -498,12 +508,13 @@ TEST(HttpClient, put_request_for_existing_resource_succeeds)
value.size());
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
auto response = request->execute(default_progress_reporter);
EXPECT_EQ(core::net::http::Status::ok, response.status);
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
EXPECT_EQ(payload.str(), root["data"].asString());
}
@@ -525,12 +536,13 @@ TEST(HttpClient, put_request_for_file_with_large_chunk_succeeds)
size);
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
auto response = request->execute(default_progress_reporter);
EXPECT_EQ(core::net::http::Status::ok, response.status);
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
EXPECT_EQ(url, root["url"].asString());
}
@@ -542,12 +554,13 @@ TEST(HttpClient, del_request_for_existing_resource_succeeds)
auto request = client->del(http::Request::Configuration::from_uri_as_string(url));
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
auto response = request->execute(default_progress_reporter);
EXPECT_EQ(core::net::http::Status::ok, response.status);
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
EXPECT_EQ(url, root["url"].asString());
}
@@ -615,7 +628,8 @@ const char* submit() { return "/v1/submit?key=net-cpp-testing"; }
// for API and endpoint documentation.
TEST(HttpClient, DISABLED_search_for_location_on_mozillas_location_service_succeeds)
{
- json::FastWriter writer;
+ json::StreamWriterBuilder wbuilder;
+ std::unique_ptr<json::StreamWriter> writer(wbuilder.newStreamWriter());
json::Value search;
json::Value cell;
cell["radio"] = "umts";
@@ -642,16 +656,17 @@ TEST(HttpClient, DISABLED_search_for_location_on_mozillas_location_service_succe
std::string(com::mozilla::services::location::host) +
com::mozilla::services::location::resources::v1::search();
auto request = client->post(http::Request::Configuration::from_uri_as_string(url),
- writer.write(search),
+ Json::writeString(wbuilder, search),
http::ContentType::json);
auto response = request->execute(default_progress_reporter);
- json::Reader reader;
+ json::CharReaderBuilder rbuilder;
+ std::unique_ptr<Json::CharReader> reader(rbuilder.newCharReader());
json::Value result;
EXPECT_EQ(core::net::http::Status::ok, response.status);
- EXPECT_TRUE(reader.parse(response.body, result));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &result, NULL));
// We cannot be sure that the server has got information for the given
// cell and wifi ids. For that, we disable the test.
@@ -693,13 +708,14 @@ TEST(HttpClient, DISABLED_submit_of_location_on_mozillas_location_service_succee
submit["items"].append(item);
- json::FastWriter writer;
+ json::StreamWriterBuilder wbuilder;
+ std::unique_ptr<json::StreamWriter> writer(wbuilder.newStreamWriter());
auto client = http::make_client();
auto url =
std::string(com::mozilla::services::location::host) +
com::mozilla::services::location::resources::v1::submit();
auto request = client->post(http::Request::Configuration::from_uri_as_string(url),
- writer.write(submit),
+ Json::writeString(wbuilder, submit),
http::ContentType::json);
auto response = request->execute(default_progress_reporter);
diff --git a/tests/http_streaming_client_test.cpp b/tests/http_streaming_client_test.cpp
index 68ad100..7e9faa1 100644
--- a/tests/http_streaming_client_test.cpp
+++ b/tests/http_streaming_client_test.cpp
@@ -156,7 +156,8 @@ TEST(StreamingHttpClient, get_request_for_existing_resource_succeeds)
// All endpoint data on httpbin.org is JSON encoded.
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
// We finally execute the query synchronously and story the response.
auto response = request->execute(default_progress_reporter, dh->to_data_handler());
@@ -164,7 +165,7 @@ TEST(StreamingHttpClient, get_request_for_existing_resource_succeeds)
// We expect the query to complete successfully
EXPECT_EQ(core::net::http::Status::ok, response.status);
// Parsing the body of the response as JSON should succeed.
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
// The url field of the payload should equal the original url we requested.
EXPECT_EQ(url, root["url"].asString());
}
@@ -191,7 +192,8 @@ TEST(StreamingHttpClient, get_request_with_custom_headers_for_existing_resource_
// All endpoint data on httpbin.org is JSON encoded.
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
// We finally execute the query synchronously and story the response.
auto response = request->execute(default_progress_reporter, dh->to_data_handler());
@@ -200,7 +202,7 @@ TEST(StreamingHttpClient, get_request_with_custom_headers_for_existing_resource_
EXPECT_EQ(core::net::http::Status::ok, response.status);
// Parsing the body of the response as JSON should succeed.
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
auto headers = root["headers"];
@@ -229,7 +231,8 @@ TEST(StreamingHttpClient, empty_header_values_are_handled_correctly)
// All endpoint data on httpbin.org is JSON encoded.
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
// We finally execute the query synchronously and story the response.
auto response = request->execute(default_progress_reporter, dh->to_data_handler());
@@ -238,7 +241,7 @@ TEST(StreamingHttpClient, empty_header_values_are_handled_correctly)
EXPECT_EQ(core::net::http::Status::ok, response.status);
// Parsing the body of the response as JSON should succeed.
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
auto headers = root["headers"];
EXPECT_EQ(std::string{}, headers["Empty"].asString());
@@ -267,7 +270,8 @@ TEST(StreamingHttpClient, get_request_for_existing_resource_guarded_by_basic_aut
// All endpoint data on httpbin.org is JSON encoded.
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
// We finally execute the query synchronously and story the response.
auto response = request->execute(default_progress_reporter, dh->to_data_handler());
@@ -275,7 +279,7 @@ TEST(StreamingHttpClient, get_request_for_existing_resource_guarded_by_basic_aut
// We expect the query to complete successfully
EXPECT_EQ(core::net::http::Status::ok, response.status);
// Parsing the body of the response as JSON should succeed.
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
// We expect authentication to work.
EXPECT_TRUE(root["authenticated"].asBool());
// With the correct user id
@@ -306,7 +310,8 @@ TEST(StreamingHttpClient, DISABLED_get_request_for_existing_resource_guarded_by_
// All endpoint data on httpbin.org is JSON encoded.
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
// We finally execute the query synchronously and story the response.
auto response = request->execute(default_progress_reporter, dh->to_data_handler());
@@ -314,7 +319,7 @@ TEST(StreamingHttpClient, DISABLED_get_request_for_existing_resource_guarded_by_
// We expect the query to complete successfully
EXPECT_EQ(core::net::http::Status::ok, response.status);
// Parsing the body of the response as JSON should succeed.
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
// We expect authentication to work.
EXPECT_TRUE(root["authenticated"].asBool());
// With the correct user id
@@ -361,12 +366,13 @@ TEST(StreamingHttpClient, async_get_request_for_existing_resource_succeeds)
// All endpoint data on httpbin.org is JSON encoded.
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
// We expect the query to complete successfully
EXPECT_EQ(core::net::http::Status::ok, response.status);
// Parsing the body of the response as JSON should succeed.
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
// The url field of the payload should equal the original url we requested.
EXPECT_EQ(url, root["url"].asString());
@@ -405,7 +411,8 @@ TEST(StreamingHttpClient, async_get_request_for_existing_resource_guarded_by_bas
// All endpoint data on httpbin.org is JSON encoded.
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
std::promise<core::net::http::Response> promise;
auto future = promise.get_future();
@@ -436,7 +443,7 @@ TEST(StreamingHttpClient, async_get_request_for_existing_resource_guarded_by_bas
// We expect the query to complete successfully
EXPECT_EQ(core::net::http::Status::ok, response.status);
// Parsing the body of the response as JSON should succeed.
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
// We expect authentication to work.
EXPECT_TRUE(root["authenticated"].asBool());
// With the correct user id
@@ -465,7 +472,8 @@ TEST(StreamingHttpClient, post_request_for_existing_resource_succeeds)
// All endpoint data on httpbin.org is JSON encoded.
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
// We finally execute the query synchronously and story the response.
auto response = request->execute(default_progress_reporter, dh->to_data_handler());
@@ -473,7 +481,7 @@ TEST(StreamingHttpClient, post_request_for_existing_resource_succeeds)
// We expect the query to complete successfully
EXPECT_EQ(core::net::http::Status::ok, response.status);
// Parsing the body of the response as JSON should succeed.
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
// The url field of the payload should equal the original url we requested.
EXPECT_EQ(payload, root["data"].asString());
}
@@ -505,10 +513,11 @@ TEST(StreamingHttpClient, post_form_request_for_existing_resource_succeeds)
// All endpoint data on httpbin.org is JSON encoded.
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
EXPECT_EQ(core::net::http::Status::ok, response.status);
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
EXPECT_EQ("test", root["form"]["test"].asString());
}
@@ -536,10 +545,11 @@ TEST(StreamingHttpClient, post_request_for_file_with_large_chunk_succeeds)
auto response = request->execute(default_progress_reporter, dh->to_data_handler());
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
EXPECT_EQ(core::net::http::Status::ok, response.status);
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
EXPECT_EQ(url, root["url"].asString());
}
@@ -569,10 +579,11 @@ TEST(StreamingHttpClient, post_request_for_file_with_large_chunk_with_read_callb
auto response = request->execute(default_progress_reporter, dh->to_data_handler());
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
EXPECT_EQ(core::net::http::Status::ok, response.status);
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
EXPECT_EQ(url, root["url"].asString());
}
@@ -596,10 +607,11 @@ TEST(StreamingHttpClient, put_request_for_existing_resource_succeeds)
auto response = request->execute(default_progress_reporter, dh->to_data_handler());
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
EXPECT_EQ(core::net::http::Status::ok, response.status);
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
EXPECT_EQ(payload.str(), root["data"].asString());
}
@@ -627,10 +639,11 @@ TEST(StreamingHttpClient, put_request_for_file_with_large_chunk_succeeds)
auto response = request->execute(default_progress_reporter, dh->to_data_handler());
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
EXPECT_EQ(core::net::http::Status::ok, response.status);
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
EXPECT_EQ(url, root["url"].asString());
}
@@ -660,10 +673,11 @@ TEST(StreamingHttpClient, put_request_for_file_with_large_chunk_with_read_callba
auto response = request->execute(default_progress_reporter, dh->to_data_handler());
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
EXPECT_EQ(core::net::http::Status::ok, response.status);
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
EXPECT_EQ(url, root["url"].asString());
}
@@ -682,10 +696,11 @@ TEST(StreamingHttpClient, del_request_for_existing_resource_succeeds)
auto response = request->execute(default_progress_reporter, dh->to_data_handler());
json::Value root;
- json::Reader reader;
+ json::CharReaderBuilder builder;
+ std::unique_ptr<json::CharReader> reader(builder.newCharReader());
EXPECT_EQ(core::net::http::Status::ok, response.status);
- EXPECT_TRUE(reader.parse(response.body, root));
+ EXPECT_TRUE(reader->parse(response.body.c_str(), response.body.c_str() + response.body.size(), &root, NULL));
EXPECT_EQ(url, root["url"].asString());
}
--
2.20.1

View file

@ -0,0 +1,44 @@
From e028baabc3627d5d13b9a9db2d096990ce7b7459 Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Sat, 9 Feb 2019 01:32:13 +0100
Subject: [PATCH 2/3] Don't bundle httpbin, don't fail silently
---
tests/CMakeLists.txt | 4 ----
tests/httpbin.h.in | 2 +-
tests/httpbin.tar.bz2 | Bin 15383 -> 0 bytes
3 files changed, 1 insertion(+), 5 deletions(-)
delete mode 100644 tests/httpbin.tar.bz2
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index a21e322..0fcea99 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -14,10 +14,6 @@
#
# Authored by: Thomas Voss <thomas.voss@canonical.com>
-execute_process(
- COMMAND ${CMAKE_COMMAND} -E tar xf ${CMAKE_CURRENT_SOURCE_DIR}/httpbin.tar.bz2
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
-
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/httpbin.h.in
${CMAKE_CURRENT_BINARY_DIR}/httpbin.h
diff --git a/tests/httpbin.h.in b/tests/httpbin.h.in
index 30703a2..0010068 100644
--- a/tests/httpbin.h.in
+++ b/tests/httpbin.h.in
@@ -42,7 +42,7 @@ struct Instance
Instance()
: server
{
- core::posix::exec("/usr/bin/python", {"@CMAKE_CURRENT_BINARY_DIR@/httpbin/run.py"}, {}, core::posix::StandardStream::stdout | core::posix::StandardStream::stderr)
+ core::posix::exec("/usr/bin/python3", {"-c", "from httpbin import app; app.run()"}, {}, core::posix::StandardStream::stdout /*| core::posix::StandardStream::stderr*/)
}
{
std::this_thread::sleep_for(std::chrono::milliseconds{1000});
--
2.20.1

View file

@ -0,0 +1,30 @@
From 8567cc6014399259bf6efa5574f0ac7e98e70094 Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Sat, 9 Feb 2019 01:32:44 +0100
Subject: [PATCH 3/3] Set the Content-Type header on POST, otherwise stuff
breaks
---
src/core/net/http/impl/curl/client.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/core/net/http/impl/curl/client.cpp b/src/core/net/http/impl/curl/client.cpp
index ba68cda..f49ce67 100644
--- a/src/core/net/http/impl/curl/client.cpp
+++ b/src/core/net/http/impl/curl/client.cpp
@@ -158,9 +158,12 @@ std::shared_ptr<http::impl::curl::Request> http::impl::curl::Client::post_impl(
const std::string& ct)
{
::curl::easy::Handle handle;
+ http::Header ctheader;
+ ctheader.set("Content-Type", ct);
handle.method(http::Method::post)
.url(configuration.uri.c_str())
.header(configuration.header)
+ .header(ctheader)
.post_data(payload.c_str(), ct);
handle.set_option(::curl::Option::ssl_verify_host,
--
2.20.1

42
main/net-cpp/APKBUILD Normal file
View file

@ -0,0 +1,42 @@
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=net-cpp
pkgver=2.2.1
_commit="01fc17e8ce09bcee37e83422520e4c3f26e8c8dd"
pkgrel=0
pkgdesc="A simple yet beautiful networking API for C++11"
url="https://launchpad.net/process-cpp"
arch="x86_64"
license="LGPL3 GPL3"
makedepends="cmake cmake-extras boost-dev curl-dev"
checkdepends="gtest-dev gmock process-cpp-dev properties-cpp-dev jsoncpp-dev py3-httpbin"
subpackages="$pkgname-dev"
source="https://github.com/lib-cpp/net-cpp/archive/$_commit.tar.gz
0001-Port-to-new-jsoncpp-API.patch
0002-Don-t-bundle-httpbin-don-t-fail-silently.patch
0003-Set-the-Content-Type-header-on-POST-otherwise-stuff-.patch"
builddir="$srcdir/$pkgname-$_commit"
build() {
mkdir "$builddir"/build
cd "$builddir"/build
cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_BUILD_TYPE=Release
make
}
check() {
cd "$builddir"/build
env CTEST_OUTPUT_ON_FAILURE=1 make test
}
package() {
cd "$builddir"/build
make DESTDIR="$pkgdir/" install
}
sha512sums="b8aa59f6fdb6f2358a7f78845acf1af866186995613daa10a04497c3072dfbc034a552561d76c2d91c6e55b98c41bbf069052ca459531538ada4032a38d09afb 01fc17e8ce09bcee37e83422520e4c3f26e8c8dd.tar.gz
2893f20ef1028d016fccf77af6c24dbe1a7967a9e03cadbccc3cde18a0a0eb3b1f8ffb1f1b3afc7d9e4c046fb3b5d6cf907023638dcdb37273dd514c9139c99e 0001-Port-to-new-jsoncpp-API.patch
ba4c2737504ddf9475a8a4c01fe31756dbc32d3bfb00c1a10e342cd2f7989cc87466c921d8430ff7003ebf48369d5daeb0ebeefc3d2b1955142d6a35681840e7 0002-Don-t-bundle-httpbin-don-t-fail-silently.patch
357669776625f4476feaf76336a976c596572028e165d54eb5078baca42c2f8304e60a3898f4ce0b4494f9a40d303720e539a0da281f5f33159b8576b89d7d71 0003-Set-the-Content-Type-header-on-POST-otherwise-stuff-.patch"

View file

@ -0,0 +1,55 @@
From 9e25c80e0e45c21dedc785019be95c0bbff4174d Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Sun, 30 Dec 2018 18:01:32 +0100
Subject: [PATCH] Musl libc fixes
---
include/core/posix/standard_stream.h | 5 +++++
src/CMakeLists.txt | 1 +
src/core/posix/signal.cpp | 2 +-
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/include/core/posix/standard_stream.h b/include/core/posix/standard_stream.h
index f50a9b7..1927fa8 100644
--- a/include/core/posix/standard_stream.h
+++ b/include/core/posix/standard_stream.h
@@ -23,6 +23,11 @@
#include <cstdint>
+// Musl uses "#define stdin (stdin)", so the enum declaration fails with a syntax error
+#undef stdin
+#undef stdout
+#undef stderr
+
namespace core
{
namespace posix
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 063ece1..2a9dc15 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -45,6 +45,7 @@ target_link_libraries(
${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
+ execinfo
)
# We compile with all symbols visible by default. For the shipping library, we strip
diff --git a/src/core/posix/signal.cpp b/src/core/posix/signal.cpp
index 9c80f21..ce8bbc1 100644
--- a/src/core/posix/signal.cpp
+++ b/src/core/posix/signal.cpp
@@ -151,7 +151,7 @@ public:
{
auto result = ::read(scope.signal_fd, signal_info, sizeof(signal_info));
- for (uint i = 0; i < result / sizeof(signalfd_siginfo); i++)
+ for (unsigned int i = 0; i < result / sizeof(signalfd_siginfo); i++)
{
if (has(static_cast<core::posix::Signal>(signal_info[i].ssi_signo)))
{
--
2.20.1

41
main/process-cpp/APKBUILD Normal file
View file

@ -0,0 +1,41 @@
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=process-cpp
pkgver=2.0.1
pkgrel=0
_commit="2923b597f6fc5b49133be8c4f2ba3cbaacdb9540"
pkgdesc="C++11 library for handling processes"
url="https://launchpad.net/process-cpp"
arch="x86_64"
license="LGPL3"
depends="boost properties-cpp"
makedepends="boost-dev cmake cmake-extras doxygen properties-cpp-dev libexecinfo-dev musl-dev"
checkdepends="gtest-dev gmock"
install=""
subpackages="$pkgname-dev"
source="https://github.com/lib-cpp/process-cpp/archive/$_commit.tar.gz
0001-Musl-libc-fixes.patch" # https://github.com/lib-cpp/process-cpp/pull/1
builddir="$srcdir/$pkgname-$_commit"
build() {
mkdir "$builddir"/build
cd "$builddir"/build
cmake .. \
-DCMAKE_INSTALL_LIBDIR=/usr/lib \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DPROCESS_CPP_ENABLE_DOC_GENERATION=no
make
}
check() {
cd "$builddir"/build
make test
}
package() {
cd "$builddir"/build
make DESTDIR="$pkgdir/" install
}
sha512sums="8787f9bbfb157c30c2a6ff072735344104f609ebae3385b41539fa7b24aa45eff5465ae8edf0479030ef7061256e7f1f7354621b172fa6ba196d59d275f2fad6 2923b597f6fc5b49133be8c4f2ba3cbaacdb9540.tar.gz
97b2a54e52b8f6a1839cfcdc6fb401768d731bacbe6bc920b511777e72806d844cded9ad9222b570e46cdbf692def363128c4cb4e2e291fcd4f66c081ad0c5cd 0001-Musl-libc-fixes.patch"

View file

@ -0,0 +1,41 @@
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=properties-cpp
pkgver=0.0.1
_pkgver=0.0.1+14.10.20140730
pkgrel=0
pkgdesc="A very simple convenience library for handling properties and signals in C++11"
url="https://launchpad.net/properties-cpp"
arch="noarch"
license="LGPL3"
depends=""
makedepends="cmake cmake-extras"
checkdepends="gtest-dev gtest"
install=""
subpackages="$pkgname-dev"
source="https://launchpad.net/ubuntu/+archive/primary/+files/properties-cpp_$_pkgver.orig.tar.gz
fixes.patch" # https://github.com/lib-cpp/properties-cpp/pull/1
builddir="$srcdir/$pkgname-$_pkgver"
build() {
mkdir -p "$builddir/build"
cd "$builddir/build"
cmake .. \
-DCMAKE_INSTALL_LIBDIR=/usr/lib \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release
make
}
check() {
cd "$builddir"/build
make test
}
package() {
cd "$builddir/build"
make DESTDIR="$pkgdir/" install
}
sha512sums="44627c548ac31abb191254246006e73bc3e8a0c489062a253c1815e3588b62eb7578d56b1ef7f5016b23ba1e09ab964354e55930b076d9c439ad5484eb7ea6d3 properties-cpp_0.0.1+14.10.20140730.orig.tar.gz
298ccdf5222f7aad4bf25aa3d18cd4bf552c67db8a98bf473c367857b355457d38a42fae8571061f94596750856a841f2cf03d2ba11bf014a92f82ba19fd74a9 fixes.patch"

View file

@ -0,0 +1,379 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0c7394e..728b40a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,7 +4,6 @@ project(properties-cpp)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
-include(cmake/EnableCoverageReport.cmake)
include(cmake/PrePush.cmake)
include(GNUInstallDirs)
@@ -42,4 +41,5 @@ add_subdirectory(data)
add_subdirectory(include)
add_subdirectory(tests)
+# find_package(CoverageReport)
# enable_coverage_report(posix_process_test linux_process_test)
diff --git a/cmake/EnableCoverageReport.cmake b/cmake/EnableCoverageReport.cmake
deleted file mode 100644
index b109ad4..0000000
--- a/cmake/EnableCoverageReport.cmake
+++ /dev/null
@@ -1,153 +0,0 @@
-# - Creates a special coverage build type and target on GCC.
-#
-# Defines a function ENABLE_COVERAGE_REPORT which generates the coverage target
-# for selected targets. Optional arguments to this function are used to filter
-# unwanted results using globbing expressions. Moreover targets with tests for
-# the source code can be specified to trigger regenerating the report if the
-# test has changed
-#
-# ENABLE_COVERAGE_REPORT(TARGETS target... [FILTER filter...] [TESTS test targets...])
-#
-# To generate a coverage report first build the project with
-# CMAKE_BUILD_TYPE=coverage, then call make test and afterwards make coverage.
-#
-# The coverage report is based on gcov. Depending on the availability of lcov
-# a HTML report will be generated and/or an XML report of gcovr is found.
-# The generated coverage target executes all found solutions. Special targets
-# exist to create e.g. only the xml report: coverage-xml.
-#
-# Copyright (C) 2010 by Johannes Wienke <jwienke at techfak dot uni-bielefeld dot de>
-#
-# This program is free software; you can redistribute it
-# and/or modify it under the terms of the GNU General
-# Public License as published by the Free Software Foundation;
-# either version 2, or (at your option)
-# any later version.
-#
-# This program 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 General Public License for more details.
-#
-
-INCLUDE(ParseArguments)
-
-FIND_PACKAGE(Lcov)
-FIND_PACKAGE(gcovr)
-
-FUNCTION(ENABLE_COVERAGE_REPORT)
-
- # argument parsing
- PARSE_ARGUMENTS(ARG "FILTER;TARGETS;TESTS" "" ${ARGN})
-
- SET(COVERAGE_RAW_FILE "${CMAKE_BINARY_DIR}/coverage.raw.info")
- SET(COVERAGE_FILTERED_FILE "${CMAKE_BINARY_DIR}/coverage.info")
- SET(COVERAGE_REPORT_DIR "${CMAKE_BINARY_DIR}/coveragereport")
- SET(COVERAGE_XML_FILE "${CMAKE_BINARY_DIR}/coverage.xml")
- SET(COVERAGE_XML_COMMAND_FILE "${CMAKE_BINARY_DIR}/coverage-xml.cmake")
-
- # decide if there is any tool to create coverage data
- SET(TOOL_FOUND FALSE)
- IF(LCOV_FOUND OR GCOVR_FOUND)
- SET(TOOL_FOUND TRUE)
- ENDIF()
- IF(NOT TOOL_FOUND)
- MESSAGE(STATUS "Cannot enable coverage targets because neither lcov nor gcovr are found.")
- ENDIF()
-
- STRING(TOLOWER "${CMAKE_BUILD_TYPE}" COVERAGE_BUILD_TYPE)
- IF(CMAKE_COMPILER_IS_GNUCXX AND TOOL_FOUND AND "${COVERAGE_BUILD_TYPE}" MATCHES "coverage")
-
- MESSAGE(STATUS "Coverage support enabled for targets: ${ARG_TARGETS}")
-
- # create coverage build type
- SET(CMAKE_CXX_FLAGS_COVERAGE ${CMAKE_CXX_FLAGS_DEBUG} PARENT_SCOPE)
- SET(CMAKE_C_FLAGS_COVERAGE ${CMAKE_C_FLAGS_DEBUG} PARENT_SCOPE)
- SET(CMAKE_CONFIGURATION_TYPES ${CMAKE_CONFIGURATION_TYPES} coverage PARENT_SCOPE)
-
- # instrument targets
- SET_TARGET_PROPERTIES(${ARG_TARGETS} PROPERTIES COMPILE_FLAGS --coverage
- LINK_FLAGS --coverage)
-
- # html report
- IF (LCOV_FOUND)
-
- MESSAGE(STATUS "Enabling HTML coverage report")
-
- # set up coverage target
-
- ADD_CUSTOM_COMMAND(OUTPUT ${COVERAGE_RAW_FILE}
- COMMAND ${LCOV_EXECUTABLE} -c -d ${CMAKE_BINARY_DIR} -o ${COVERAGE_RAW_FILE}
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
- COMMENT "Collecting coverage data"
- DEPENDS ${ARG_TARGETS} ${ARG_TESTS}
- VERBATIM)
-
- # filter unwanted stuff
- LIST(LENGTH ARG_FILTER FILTER_LENGTH)
- IF(${FILTER_LENGTH} GREATER 0)
- SET(FILTER COMMAND ${LCOV_EXECUTABLE})
- FOREACH(F ${ARG_FILTER})
- SET(FILTER ${FILTER} -r ${COVERAGE_FILTERED_FILE} ${F})
- ENDFOREACH()
- SET(FILTER ${FILTER} -o ${COVERAGE_FILTERED_FILE})
- ELSE()
- SET(FILTER "")
- ENDIF()
-
- ADD_CUSTOM_COMMAND(OUTPUT ${COVERAGE_FILTERED_FILE}
- COMMAND ${LCOV_EXECUTABLE} -e ${COVERAGE_RAW_FILE} "${CMAKE_SOURCE_DIR}*" -o ${COVERAGE_FILTERED_FILE}
- ${FILTER}
- DEPENDS ${COVERAGE_RAW_FILE}
- COMMENT "Filtering recorded coverage data for project-relevant entries"
- VERBATIM)
- ADD_CUSTOM_COMMAND(OUTPUT ${COVERAGE_REPORT_DIR}
- COMMAND ${CMAKE_COMMAND} -E make_directory ${COVERAGE_REPORT_DIR}
- COMMAND ${GENHTML_EXECUTABLE} --legend --show-details -t "${PROJECT_NAME} test coverage" -o ${COVERAGE_REPORT_DIR} ${COVERAGE_FILTERED_FILE}
- DEPENDS ${COVERAGE_FILTERED_FILE}
- COMMENT "Generating HTML coverage report in ${COVERAGE_REPORT_DIR}"
- VERBATIM)
-
- ADD_CUSTOM_TARGET(coverage-html
- DEPENDS ${COVERAGE_REPORT_DIR})
-
- ENDIF()
-
- # xml coverage report
- IF(GCOVR_FOUND)
-
- MESSAGE(STATUS "Enabling XML coverage report")
-
- # gcovr cannot write directly to a file so the execution needs to
- # be wrapped in a cmake file that generates the file output
- FILE(WRITE ${COVERAGE_XML_COMMAND_FILE}
- "SET(ENV{LANG} en)\n")
- FILE(APPEND ${COVERAGE_XML_COMMAND_FILE}
- "EXECUTE_PROCESS(COMMAND \"${GCOVR_EXECUTABLE}\" --exclude=tests.* --exclude=obj-.* --exclude=cmake.* -x -r \"${CMAKE_SOURCE_DIR}\" OUTPUT_FILE \"${COVERAGE_XML_FILE}\" WORKING_DIRECTORY \"${CMAKE_BINARY_DIR}\")\n")
-
- ADD_CUSTOM_COMMAND(OUTPUT ${COVERAGE_XML_FILE}
- COMMAND ${CMAKE_COMMAND} ARGS -P ${COVERAGE_XML_COMMAND_FILE}
- COMMENT "Generating coverage XML report"
- VERBATIM)
-
- ADD_CUSTOM_TARGET(coverage-xml
- DEPENDS ${COVERAGE_XML_FILE})
-
- ENDIF()
-
- # provide a global coverage target executing both steps if available
- SET(GLOBAL_DEPENDS "")
- IF(LCOV_FOUND)
- LIST(APPEND GLOBAL_DEPENDS ${COVERAGE_REPORT_DIR})
- ENDIF()
- IF(GCOVR_FOUND)
- LIST(APPEND GLOBAL_DEPENDS ${COVERAGE_XML_FILE})
- ENDIF()
- IF(LCOV_FOUND OR GCOVR_FOUND)
- ADD_CUSTOM_TARGET(coverage
- DEPENDS ${GLOBAL_DEPENDS})
- ENDIF()
-
- ENDIF()
-
-ENDFUNCTION()
diff --git a/cmake/FindGtest.cmake b/cmake/FindGtest.cmake
deleted file mode 100644
index 1283174..0000000
--- a/cmake/FindGtest.cmake
+++ /dev/null
@@ -1,53 +0,0 @@
-include(ExternalProject)
-include(FindPackageHandleStandardArgs)
-
-#gtest
-set(GTEST_INSTALL_DIR /usr/src/gmock/gtest/include)
-find_path(GTEST_INCLUDE_DIR gtest/gtest.h
- HINTS ${GTEST_INSTALL_DIR})
-
-#gmock
-find_path(GMOCK_INSTALL_DIR gmock/CMakeLists.txt
- HINTS /usr/src)
-if(${GMOCK_INSTALL_DIR} STREQUAL "GMOCK_INSTALL_DIR-NOTFOUND")
- message(FATAL_ERROR "google-mock package not found")
-endif()
-
-set(GMOCK_INSTALL_DIR ${GMOCK_INSTALL_DIR}/gmock)
-find_path(GMOCK_INCLUDE_DIR gmock/gmock.h)
-
-set(GMOCK_PREFIX gmock)
-set(GMOCK_BINARY_DIR ${CMAKE_BINARY_DIR}/${GMOCK_PREFIX}/libs)
-set(GTEST_BINARY_DIR ${GMOCK_BINARY_DIR}/gtest)
-
-set(GTEST_CMAKE_ARGS "")
-if (${MIR_IS_CROSS_COMPILING})
- set(GTEST_CMAKE_ARGS
- -DCMAKE_TOOLCHAIN_FILE=${CMAKE_MODULE_PATH}/LinuxCrossCompile.cmake)
-endif()
-
-ExternalProject_Add(
- GMock
- #where to build in source tree
- PREFIX ${GMOCK_PREFIX}
- #where the source is external to the project
- SOURCE_DIR ${GMOCK_INSTALL_DIR}
- #forward the compilers to the subproject so cross-arch builds work
- CMAKE_ARGS ${GTEST_CMAKE_ARGS}
- BINARY_DIR ${GMOCK_BINARY_DIR}
-
- #we don't need to install, so skip
- INSTALL_COMMAND ""
-)
-
-set(GMOCK_LIBRARY ${GMOCK_BINARY_DIR}/libgmock.a)
-set(GMOCK_MAIN_LIBRARY ${GMOCK_BINARY_DIR}/libgmock_main.a)
-set(GMOCK_BOTH_LIBRARIES ${GMOCK_LIBRARY} ${GMOCK_MAIN_LIBRARY})
-set(GTEST_LIBRARY ${GTEST_BINARY_DIR}/libgtest.a)
-set(GTEST_MAIN_LIBRARY ${GTEST_BINARY_DIR}/libgtest_main.a)
-set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY})
-set(GTEST_ALL_LIBRARIES ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES})
-
-find_package_handle_standard_args(GTest DEFAULT_MSG
- GMOCK_INCLUDE_DIR
- GTEST_INCLUDE_DIR)
diff --git a/cmake/FindLcov.cmake b/cmake/FindLcov.cmake
deleted file mode 100644
index 70628f4..0000000
--- a/cmake/FindLcov.cmake
+++ /dev/null
@@ -1,29 +0,0 @@
-# - Find lcov
-# Will define:
-#
-# LCOV_EXECUTABLE - the lcov binary
-# GENHTML_EXECUTABLE - the genhtml executable
-#
-# Copyright (C) 2010 by Johannes Wienke <jwienke at techfak dot uni-bielefeld dot de>
-#
-# This program is free software; you can redistribute it
-# and/or modify it under the terms of the GNU General
-# Public License as published by the Free Software Foundation;
-# either version 2, or (at your option)
-# any later version.
-#
-# This program 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 General Public License for more details.
-#
-
-INCLUDE(FindPackageHandleStandardArgs)
-
-FIND_PROGRAM(LCOV_EXECUTABLE lcov)
-FIND_PROGRAM(GENHTML_EXECUTABLE genhtml)
-
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lcov DEFAULT_MSG LCOV_EXECUTABLE GENHTML_EXECUTABLE)
-
-# only visible in advanced view
-MARK_AS_ADVANCED(LCOV_EXECUTABLE GENHTML_EXECUTABLE)
diff --git a/cmake/Findgcovr.cmake b/cmake/Findgcovr.cmake
deleted file mode 100644
index e4c43fe..0000000
--- a/cmake/Findgcovr.cmake
+++ /dev/null
@@ -1,31 +0,0 @@
-# - Find gcovr scrip
-# Will define:
-#
-# GCOVR_EXECUTABLE - the gcovr script
-#
-# Uses:
-#
-# GCOVR_ROOT - root to search for the script
-#
-# Copyright (C) 2011 by Johannes Wienke <jwienke at techfak dot uni-bielefeld dot de>
-#
-# This program is free software; you can redistribute it
-# and/or modify it under the terms of the GNU General
-# Public License as published by the Free Software Foundation;
-# either version 2, or (at your option)
-# any later version.
-#
-# This program 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 General Public License for more details.
-#
-
-INCLUDE(FindPackageHandleStandardArgs)
-
-FIND_PROGRAM(GCOVR_EXECUTABLE gcovr HINTS ${GCOVR_ROOT} "${GCOVR_ROOT}/bin")
-
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(gcovr DEFAULT_MSG GCOVR_EXECUTABLE)
-
-# only visible in advanced view
-MARK_AS_ADVANCED(GCOVR_EXECUTABLE)
diff --git a/cmake/ParseArguments.cmake b/cmake/ParseArguments.cmake
deleted file mode 100644
index e13f671..0000000
--- a/cmake/ParseArguments.cmake
+++ /dev/null
@@ -1,52 +0,0 @@
-# Parse arguments passed to a function into several lists separated by
-# upper-case identifiers and options that do not have an associated list e.g.:
-#
-# SET(arguments
-# hello OPTION3 world
-# LIST3 foo bar
-# OPTION2
-# LIST1 fuz baz
-# )
-# PARSE_ARGUMENTS(ARG "LIST1;LIST2;LIST3" "OPTION1;OPTION2;OPTION3" ${arguments})
-#
-# results in 7 distinct variables:
-# * ARG_DEFAULT_ARGS: hello;world
-# * ARG_LIST1: fuz;baz
-# * ARG_LIST2:
-# * ARG_LIST3: foo;bar
-# * ARG_OPTION1: FALSE
-# * ARG_OPTION2: TRUE
-# * ARG_OPTION3: TRUE
-#
-# taken from http://www.cmake.org/Wiki/CMakeMacroParseArguments
-
-MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
- SET(DEFAULT_ARGS)
- FOREACH(arg_name ${arg_names})
- SET(${prefix}_${arg_name})
- ENDFOREACH(arg_name)
- FOREACH(option ${option_names})
- SET(${prefix}_${option} FALSE)
- ENDFOREACH(option)
-
- SET(current_arg_name DEFAULT_ARGS)
- SET(current_arg_list)
- FOREACH(arg ${ARGN})
- SET(larg_names ${arg_names})
- LIST(FIND larg_names "${arg}" is_arg_name)
- IF (is_arg_name GREATER -1)
- SET(${prefix}_${current_arg_name} ${current_arg_list})
- SET(current_arg_name ${arg})
- SET(current_arg_list)
- ELSE (is_arg_name GREATER -1)
- SET(loption_names ${option_names})
- LIST(FIND loption_names "${arg}" is_option)
- IF (is_option GREATER -1)
- SET(${prefix}_${arg} TRUE)
- ELSE (is_option GREATER -1)
- SET(current_arg_list ${current_arg_list} ${arg})
- ENDIF (is_option GREATER -1)
- ENDIF (is_arg_name GREATER -1)
- ENDFOREACH(arg)
- SET(${prefix}_${current_arg_name} ${current_arg_list})
-ENDMACRO(PARSE_ARGUMENTS)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 180498f..cb05b48 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,7 +1,7 @@
set (OLD_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
# Don't treat warnings as errors in 3rd_party/{gmock,cucumber-cpp}
string (REPLACE " -Werror " " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
-find_package(Gtest REQUIRED)
+find_package(GTest REQUIRED)
include_directories(${GMOCK_INCLUDE_DIR} ${GTEST_INCLUDE_DIR})
set (CMAKE_CXX_FLAGS ${OLD_CMAKE_CXX_FLAGS})

60
main/py-isodate/APKBUILD Normal file
View file

@ -0,0 +1,60 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgbase=isodate
pkgname=py-isodate
pkgver=0.6.0
pkgrel=0
pkgdesc="An ISO 8601 date/time/duration parser and formatter"
arch=noarch
url="http://pypi.python.org/pypi/isodate"
license='BSD'
depends=""
makedepends="py-setuptools py3-setuptools"
provides="py2-isodate=$pkgver-r$pkgrel"
source="$pkgbase-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/i/$pkgbase/$pkgbase-$pkgver.tar.gz"
subpackages="py3-$pkgbase:_py3"
options="!check"
builddir="$srcdir/$pkgbase-$pkgver"
build() {
cd "$builddir"
python setup.py build
python2 setup.py build
}
check() {
cd "$builddir"
python2 setup.py test
python setup.py test
}
package() {
cd "$builddir"
python2 setup.py install --root="$pkgdir" --optimize=1
find "$pkgdir/" -name '*.pyc' -delete
install -d "$pkgdir"/usr/share/licenses/$pkgname
head -26 src/isodate/isodates.py > "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
_py() {
pkgdesc="$pkgdesc (for python)"
depends="python2"
install_if="$pkgname=$pkgver-r$pkgrel python2"
cd "$builddir"
python2 setup.py install --root="$subpkgdir" --optimize=1
find "$subpkgdir/" -name '*.pyc' -delete
install -d "$subpkgdir"/usr/share/licenses/$pkgname
head -26 src/isodate/isodates.py > "$subpkgdir/usr/share/licenses/$pkgname/LICENSE"
}
_py3() {
depends="python3"
cd "$builddir"
python setup.py install --root="$subpkgdir" --optimize=1
find "$subpkgdir/" -name '*.pyc' -delete
install -d "$subpkgdir"/usr/share/licenses/$pkgname
head -26 src/isodate/isodates.py > "$subpkgdir/usr/share/licenses/$pkgname/LICENSE"
}
sha512sums="e977748e13ee2c94ab47bfc47113d152280e9acff6f70e773de73717392148dd2c111a7db2d9fa3679d37936c6ed9a23dc526cb00bd601df45459b6a244f9f7d isodate-0.6.0.tar.gz"

70
main/py-rdflib/APKBUILD Normal file
View file

@ -0,0 +1,70 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=py-rdflib
pkgbase=${pkgname#py-}
pkgver=4.2.2
pkgrel=0
pkgdesc="A Python library for working with RDF, a simple yet powerful language for representing information"
arch=noarch
url="https://rdflib.readthedocs.org/"
license='BSD'
depends="py-isodate py2-six"
makedepends="py-setuptools py3-setuptools"
provides="py2-rdflib=$pkgver-r$pkgrel"
source="$pkgbase-$pkgver.tar.gz::https://github.com/RDFLib/$pkgbase/archive/$pkgver.tar.gz"
subpackages="py3-$pkgbase:_py3"
options="!check"
builddir="$srcdir/$pkgbase-$pkgver"
build() {
cd "$builddir"
python setup.py build
python2 setup.py build
}
check() {
cd "$builddir"
# Not running "python setup.py test", because it will download and install rdflib again
nosetests3 --where=./build/src \
--with-doctest \
--doctest-extension=.doctest \
--doctest-tests
cd ../python2-rdflib
python2 run_tests.py --with-xunit
}
package() {
cd "$builddir"
python2 setup.py install --root="$pkgdir" --optimize=1
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
cd "$pkgdir/usr/bin"
for i in * ; do
mv $i $i-py2
done
}
_py() {
pkgdesc="$pkgdesc (for python)"
depends="python2 py-isodate py2-six"
install_if="$pkgname=$pkgver-r$pkgrel python2"
cd "$builddir"
pytho2n setup.py install --root="$subpkgdir" --optimize=1
install -Dm644 LICENSE "$subpkgdir/usr/share/licenses/$pkgname/LICENSE"
cd "$subpkgdir/usr/bin"
for i in * ; do
mv $i $i-py2
done
}
_py3() {
depends="python3 py3-isodate py3-six"
cd "$builddir"
python setup.py install --root="$subpkgdir" --optimize=1
install -Dm644 LICENSE "$subpkgdir/usr/share/licenses/$pkgname/LICENSE"
}
sha512sums="12ae2f48ab343c8f8ecce74f419b7171ddd9d38b325d8da3c29a0b5964030596cf18c947faaf526e7656b9b421e5cf9f0e1c0c6b81a8b2b2d0232a7f70454992 rdflib-4.2.2.tar.gz"

View file

@ -0,0 +1,26 @@
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=py3-brotlipy
_pkgname=brotlipy
pkgver=0.7.0
pkgrel=0
pkgdesc="Python binding to the Brotli library"
url="https://github.com/python-hyper/brotlipy"
arch="x86_64"
license="MIT"
depends="python3 py3-cffi"
makedepends="python3-dev"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"
options="!check"
build() {
cd "$builddir"
python3 setup.py build
}
package() {
cd "$builddir"
python3 setup.py install --prefix=/usr --root="$pkgdir"
}
sha512sums="2a01e5b2d217043f13316afc4f54569c5dff76d31c296d4be563a5851195380ab80a33a3035ca95effdebffb45806fb9a431a181bba6f9af205b7f5576937268 brotlipy-0.7.0.tar.gz"

View file

@ -0,0 +1,32 @@
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=py3-dbusmock
_pkgname=python-dbusmock
pkgver=0.18
pkgrel=0
pkgdesc="Mock D-Bus objects for tests"
url="https://github.com/martinpitt/python-dbusmock/"
arch="x86_64"
license="LGPL-3.0"
depends="python3 py3-dbus py3-gobject3"
makedepends="python3-dev"
checkdepends="dbus py3-nose"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"
options="!check" # See https://github.com/martinpitt/python-dbusmock/issues/46
build() {
cd "$builddir"
python3 setup.py build
}
check() {
cd "$builddir"
python3 setup.py test
}
package() {
cd "$builddir"
python3 setup.py install --prefix=/usr --root="$pkgdir"
}
sha512sums="1747cbece9bc091cef13d8377bf59ec3653bd9d65b5f35af66f3f5ef0595cf5145bd518142a9110c033217c0636b43521e38a1035ba9af9dbadf76e943687b52 python-dbusmock-0.18.tar.gz"

26
main/py3-httpbin/APKBUILD Normal file
View file

@ -0,0 +1,26 @@
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=py3-httpbin
_pkgname=httpbin
pkgver=0.7.0
pkgrel=0
pkgdesc="HTTP Request and Response Service"
url="https://github.com/requests/httpbin"
arch="x86_64"
license="MIT"
depends="python3 py3-flask py3-six py3-raven py3-blinker py3-brotlipy py3-decorator"
makedepends="python3-dev"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"
options="!check"
build() {
cd "$builddir"
python3 setup.py build
}
package() {
cd "$builddir"
python3 setup.py install --prefix=/usr --root="$pkgdir"
}
sha512sums="82e80058b58943637e9f8191764cea79bf7a6e40f36069f9b5d3f908585dbef20a03ef070d1f865d350920b6e874a93a48a544b05c14ff4911038ec2c20f6f63 httpbin-0.7.0.tar.gz"

View file

@ -0,0 +1,42 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=qt5-qtfeedback
pkgver=0_git20180122
_commit="a14bd0bb1373cde86e09e3619fb9dc70f34c71f2"
pkgrel=0
arch="x86_64"
url='http://qt-project.org/'
license="LGPL-3.0"
pkgdesc='Qt Tactile Feedback'
depends=""
depends_dev="qt5-qtdeclarative-dev"
makedepends="$depends_dev git"
source="$pkgname-$_commit.tar.gz::https://github.com/qt/${pkgname/qt5-/}/archive/$_commit.tar.gz"
subpackages="$pkgname-dev $pkgname-doc"
builddir="$srcdir/${pkgname/qt5-/}-$_commit"
options="!check"
prepare() {
default_prepare
# Something in the build system only runs the syncqt.pl script when it's in a git repo
git init
}
build() {
cd "$builddir"
qmake-qt5
make
}
package() {
cd "$builddir"
make INSTALL_ROOT="$pkgdir" install
# Drop QMAKE_PRL_BUILD_DIR because reference the build dir
find "$pkgdir/usr/lib" -type f -name '*.prl' \
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;
install -d "$pkgdir"/usr/share/licenses
ln -s /usr/share/licenses/qt5-base "$pkgdir"/usr/share/licenses/$pkgname
}
sha512sums="40f58a55bdbeaec91d31a7e7c4ec54e84c002d4b22f607b4b99985b6629bbe90dc98570f36bb736f7b90f078db42481c44b2fd2730f8e6102ebcf8e3e70a847f qt5-qtfeedback-a14bd0bb1373cde86e09e3619fb9dc70f34c71f2.tar.gz"

42
main/qt5-qtpim/APKBUILD Normal file
View file

@ -0,0 +1,42 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=qt5-qtpim
pkgver=0_git20181121
_commit="380605ef048372a40587f0231ba00df146bc070e"
pkgrel=0
arch="x86_64"
url='http://qt-project.org/'
license="LGPL-3.0"
pkgdesc='Qt Personal Information Management'
depends=""
depends_dev="qt5-qtdeclarative-dev"
makedepends="$depends_dev git"
source="$pkgname-$_commit.tar.gz::https://github.com/qt/${pkgname/qt5-/}/archive/$_commit.tar.gz"
subpackages="$pkgname-dev $pkgname-doc"
builddir="$srcdir/${pkgname/qt5-/}-$_commit"
options="!check"
prepare() {
default_prepare
# Something in the build system only runs the syncqt.pl script when it's in a git repo
git init
}
build() {
cd "$builddir"
qmake-qt5
make
}
package() {
cd "$builddir"
make INSTALL_ROOT="$pkgdir" install
# Drop QMAKE_PRL_BUILD_DIR because reference the build dir
find "$pkgdir/usr/lib" -type f -name '*.prl' \
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;
install -d "$pkgdir"/usr/share/licenses
ln -s /usr/share/licenses/qt5-base "$pkgdir"/usr/share/licenses/$pkgname
}
sha512sums="dadd6484b34540b5f47f39b1a09e404384b1a22d8c757a56f9ce1efbf047a1ece556fb3b1fe32dfe54c82985023776d182420f55576c9d87f1267c94b144ad77 qt5-qtpim-380605ef048372a40587f0231ba00df146bc070e.tar.gz"

View file

@ -0,0 +1,42 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=qt5-qtsystems
pkgver=0_git20180122
_commit="66e45676f5f5c6251ccab36906c6324fd0065e08"
pkgrel=0
arch="x86_64"
url='http://qt-project.org/'
license="LGPL-3.0"
pkgdesc='Qt Systems'
depends=""
depends_dev="qt5-qtdeclarative-dev"
makedepends="$depends_dev git"
source="$pkgname-$_commit.tar.gz::https://github.com/qt/${pkgname/qt5-/}/archive/$_commit.tar.gz"
subpackages="$pkgname-dev $pkgname-doc"
builddir="$srcdir/${pkgname/qt5-/}-$_commit"
options="!check"
prepare() {
default_prepare
# Something in the build system only runs the syncqt.pl script when it's in a git repo
git init
}
build() {
cd "$builddir"
qmake-qt5
make
}
package() {
cd "$builddir"
make INSTALL_ROOT="$pkgdir" install
# Drop QMAKE_PRL_BUILD_DIR because reference the build dir
find "$pkgdir/usr/lib" -type f -name '*.prl' \
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;
install -d "$pkgdir"/usr/share/licenses
ln -s /usr/share/licenses/qt5-base "$pkgdir"/usr/share/licenses/$pkgname
}
sha512sums="b0190cd2b02d41222738887ef24d1f34aa74e3d739fe5eb61b02a23369f43b718bf92c08b4a083e703598443d2445a36cf60980d9ef31ac71303d07bb7d95de7 qt5-qtsystems-66e45676f5f5c6251ccab36906c6324fd0065e08.tar.gz"

38
main/umockdev/APKBUILD Normal file
View file

@ -0,0 +1,38 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=umockdev
pkgver=0.12.1
pkgrel=0
pkgdesc="Record/mock hardware devices for bug reports and regression tests"
arch="x86_64"
url="https://github.com/martinpitt/umockdev/"
license="LGPL-2.1"
depends=""
depends_dev="eudev-dev libgudev-dev"
makedepends="$depends_dev autoconf automake libtool gtk-doc vala linux-headers bash"
source="$pkgname-$pkgver.tar.gz::https://github.com/martinpitt/$pkgname/archive/$pkgver.tar.gz"
subpackages="$pkgname-dev $pkgname-doc"
options="!check" # See https://gitlab.com/postmarketOS/pmbootstrap/issues/1650
build() {
cd "$builddir"
./autogen.sh \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--enable-gtk-doc
make
}
check() {
cd "$builddir"
make check
}
package() {
cd "$builddir"
make DESTDIR="$pkgdir" install
}
sha512sums="0680efd60cdb10f48ed1aff3650b9a8345cb1b5f352751335830cef4d366c7cfd1c7c5b35864c078f2aa899965ef73bffcc4ae00029df80ecec5eb09c9505267 umockdev-0.12.1.tar.gz"

25
main/xcursorgen/APKBUILD Normal file
View file

@ -0,0 +1,25 @@
pkgname=xcursorgen
pkgver=1.0.6
pkgrel=0
pkgdesc="Create an X cursor file from PNG images"
arch="x86_64"
url="https://xorg.freedesktop.org/"
license="custom"
depends=""
makedepends="libx11-dev libxcursor-dev libpng-dev"
source="https://xorg.freedesktop.org/archive/individual/app/$pkgname-$pkgver.tar.bz2"
subpackages="$pkgname-doc"
build() {
cd "$builddir"
./configure --prefix=/usr
make
}
package() {
cd "$builddir"
make DESTDIR="$pkgdir" install
install -m755 -d "$pkgdir/usr/share/licenses/$pkgname"
install -m644 COPYING "$pkgdir/usr/share/licenses/$pkgname/"
}
sha512sums="3b464b7be3cec8c6d2bf4538266108bdc09e1dae4053d573f7f38e004929b41be0d996aa54918490fa040655644e2b0d4fab1ec24cca014d77bdb91c41ab1db4 xcursorgen-1.0.6.tar.bz2"

50
main/zeitgeist/APKBUILD Normal file
View file

@ -0,0 +1,50 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=zeitgeist
pkgver=1.0.1
pkgrel=0
pkgdesc="Activity logging framework"
arch="x86_64"
url="https://zeitgeist.freedesktop.org/"
license="LGPL-2.1"
depends=""
depends_dev="sqlite-dev gobject-introspection-dev xapian-core-dev telepathy-glib-dev gtk+3.0-dev json-glib-dev"
makedepends="$depends_dev autoconf automake gettext gettext-dev libtool python3 vala git raptor2 py-rdflib"
source="$pkgname-$pkgver.tar.gz::https://gitlab.freedesktop.org/$pkgname/$pkgname/-/archive/v$pkgver/$pkgname-v$pkgver.tar.gz"
subpackages="$pkgname-dev $pkgname-doc"
builddir="$srcdir/$pkgname-v$pkgver"
options="!check" # Needs D-Bus server, see https://gitlab.freedesktop.org/zeitgeist/zeitgeist/issues/4
prepare() {
default_prepare
cd "$builddir"
NOCONFIGURE=1 ./autogen.sh
}
build() {
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--libexecdir=/usr/lib \
--enable-fts
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
make
}
check() {
cd "$builddir"
make check
}
package() {
cd "$builddir"
make DESTDIR="$pkgdir" install
}
sha512sums="58c190daf705141ac06df53d8b928ed615ea98eeaec23f6418a8cff447e9ab32955166266f62175b1ce01fefcef80f46a6095c1df240b00f06a3f1fc73b07ae6 zeitgeist-1.0.1.tar.gz"

35
main/zmqpp/APKBUILD Normal file
View file

@ -0,0 +1,35 @@
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=zmqpp
pkgver=4.2.0
pkgrel=0
pkgdesc="0mq 'highlevel' C++ bindings"
url="http://zeromq.github.io/zmqpp"
arch="x86_64"
license="MPL2"
depends=""
makedepends="cmake zeromq-dev"
install=""
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/zeromq/zmqpp/archive/$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver"
options="!check"
prepare() {
default_prepare
mkdir "$builddir"/build
}
build() {
cd "$builddir"/build
cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release
make
}
package() {
cd "$builddir"/build
make DESTDIR="$pkgdir/" install
}
sha512sums="a6b767278d85f38e5d78a958980782f15e3214db169ec2da118216c002657e525783d4ad3b9043d742801acf77b9b070ea12c18ec0e311e01f13d90d409277a7 zmqpp-4.2.0.tar.gz"

70
temp/lightdm/APKBUILD Normal file
View file

@ -0,0 +1,70 @@
pkgname=lightdm
_pkgver=1.28.0
pkgver=9999
pkgrel=0
pkgdesc="A cross-desktop display manager"
url="https://www.freedesktop.org/wiki/Software/LightDM"
arch="x86_64"
license="GPL-3.0-or-later"
depends="dbus xinit accountsservice"
makedepends="linux-pam-dev gtk+3.0-dev libxext-dev libxklavier-dev
autoconf automake libtool gobject-introspection-dev itstool
libgcrypt-dev libxml2-utils intltool qt5-qtbase-dev"
install="$pkgname.pre-install"
pkgusers="lightdm"
pkggroups="lightdm"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang $pkgname-openrc $pkgname-qt5 $pkgname-qt5-dev:qt5_dev"
source="https://github.com/CanonicalLtd/${pkgname}/releases/download/${_pkgver}/${pkgname}-${_pkgver}.tar.xz
musl-language.patch
musl-is-linux.patch
musl-updwtmpx.patch
disallow-guest.patch
allow-null-passwd.patch
lightdm.initd"
builddir="$srcdir/$pkgname-$_pkgver"
build() {
cd "$builddir"
export CFLAGS="$CFLAGS -D_GNU_SOURCE"
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--sbindir=/usr/bin \
--sysconfdir=/etc \
--localstatedir=/var \
--enable-liblightdm-gobject \
--disable-tests \
--with-greeter-session=lightdm-gtk-greeter
make
}
package() {
cd "$builddir"
make DESTDIR="$pkgdir" install
ln -s /etc/X11/xinit/Xsession "$pkgdir"/usr/bin/lightdm-session
install -Dm755 "$srcdir"/lightdm.initd "$pkgdir"/etc/init.d/lightdm
install -o lightdm -g lightdm -d "$pkgdir"/var/lib/lightdm-data
rm -rf "$pkgdir"/etc/apparmor.d
}
qt5() {
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/liblightdm-qt5* "$subpkgdir"/usr/lib
}
qt5_dev() {
mkdir -p "$subpkgdir"/usr/lib/pkgconfig "$subpkgdir"/usr/include
mv "$pkgdir"/../$pkgname-dev/usr/include/lightdm-qt5-3 "$subpkgdir"/usr/include/
mv "$pkgdir"/../$pkgname-dev/usr/lib/liblightdm-qt5-3.* "$subpkgdir"/usr/lib/
mv "$pkgdir"/../$pkgname-dev/usr/lib/pkgconfig/liblightdm-qt5-3.pc "$subpkgdir"/usr/lib/pkgconfig/
}
sha512sums="e1e8a952e723bbcc106043d33a64278b228a5a47a7e54235375817b08483594cc5e46ec52f5cbb9d258266e44b045785bca1d4c62daf83071c0f668b3c480071 lightdm-1.28.0.tar.xz
592d630bdabeed304f8b677ceb0ebd2a6ab0930baae473814aafb0d58b7e28a79c8c667f18a656a460132c48a9fee90be7eebd50f835ea641d6d99387b28310a musl-language.patch
aa33888f61b61f6c8082c77dc0b539fa14fb395c17e70b825ba88af7bb6adaad8f99583342a77442c60c105c1b83dd6eb0547fbddb43dcd767d9ad2c65ca2baf musl-is-linux.patch
876088f21e502630c7d13343b03785d3327727c25657690c8e1cff5428a36944eb75d538f24ab4f5b11f931d8fad51241f25046da370eb5868aa8d2860be4eb2 musl-updwtmpx.patch
c5bf8cfc0b4c4f95d9c9a3fa517b6c8ec90e02d84fb4498176b4745ed6089576fab536e9a3595200443811f05f2d47ac5e7c0205c878d9c23eff4dda7093ad6c disallow-guest.patch
7d31a5d7034e665a86a7067654c8865fa5db98b58c32afab6077d589c0cd1351bfbfb4625e5e1b2ccf8c98bc08e7c97412c528311c3c32da0b8e45916f8de767 allow-null-passwd.patch
212fb5830e6c76a3e396d38d55ad03b5a4a49f4ddc48fe60976612cee1ab5f0cc9867129e676929b421557be84c4db6699850a0408de9b16bd5ef34b6c7fbd51 lightdm.initd"

View file

@ -0,0 +1,11 @@
--- a/data/pam/lightdm 2018-04-29 21:13:23.633200880 +0300
+++ b/data/pam/lightdm 2018-04-29 21:14:24.817767352 +0300
@@ -7,7 +7,7 @@
auth required pam_env.so
# Use /etc/passwd and /etc/shadow for passwords
-auth required pam_unix.so
+auth required pam_unix.so nullok
# Check account is active, change password if required
account required pam_unix.so

View file

@ -0,0 +1,22 @@
--- a/src/lightdm.c
+++ b/src/lightdm.c
@@ -779,7 +779,7 @@
if (!config_has_key (config_get_instance (), "Seat:*", "allow-user-switching"))
config_set_boolean (config_get_instance (), "Seat:*", "allow-user-switching", TRUE);
if (!config_has_key (config_get_instance (), "Seat:*", "allow-guest"))
- config_set_boolean (config_get_instance (), "Seat:*", "allow-guest", TRUE);
+ config_set_boolean (config_get_instance (), "Seat:*", "allow-guest", FALSE);
if (!config_has_key (config_get_instance (), "Seat:*", "greeter-allow-guest"))
config_set_boolean (config_get_instance (), "Seat:*", "greeter-allow-guest", TRUE);
if (!config_has_key (config_get_instance (), "Seat:*", "greeter-show-remote-login"))
--- a/data/lightdm.conf
+++ b/data/lightdm.conf
@@ -112,7 +112,7 @@
#greeter-show-remote-login=true
#user-session=default
#allow-user-switching=true
-#allow-guest=true
+#allow-guest=false
#guest-session=
#session-wrapper=lightdm-session
#greeter-wrapper=

15
temp/lightdm/lightdm.initd Executable file
View file

@ -0,0 +1,15 @@
#!/sbin/openrc-run
depend() {
need localmount dbus
}
description="Lightweight Display Manager"
command="/usr/bin/lightdm"
command_background="yes"
pidfile="/run/lightdm.pid"
start_pre() {
checkpath --owner lightdm:lightdm --directory /run/lightdm
}

View file

@ -0,0 +1,8 @@
#!/bin/sh
name=lightdm
addgroup -S $name 2>/dev/null
adduser -S -D -H -h /var/run/lightdm -s /bin/false -G $name -g $name $name 2>/dev/null
exit 0

View file

@ -0,0 +1,11 @@
--- a/tests/src/libsystem.c
+++ b/tests/src/libsystem.c
@@ -213,7 +213,7 @@
return g_strdup (path);
}
-#ifdef __linux__
+#ifdef __GLIBC__
static int
open_wrapper (const char *func, const char *pathname, int flags, mode_t mode)
{

View file

@ -0,0 +1,36 @@
--- a/liblightdm-gobject/language.c
+++ b/liblightdm-gobject/language.c
@@ -210,6 +210,7 @@
if (!priv->name)
{
+ #if HAVE_LC_IDENTIFICATION
g_autofree gchar *locale = get_locale_name (priv->code);
if (locale)
{
@@ -223,6 +224,8 @@
setlocale (LC_ALL, current);
}
+ #endif
+
if (!priv->name)
{
g_auto(GStrv) tokens = g_strsplit_set (priv->code, "_.@", 2);
@@ -250,6 +253,7 @@
if (!priv->territory && strchr (priv->code, '_'))
{
+ #if HAVE_LC_IDENTITIFICATION
g_autofree gchar *locale = get_locale_name (priv->code);
if (locale)
{
@@ -263,6 +267,8 @@
setlocale (LC_ALL, current);
}
+ #endif
+
if (!priv->territory)
{
g_auto(GStrv) tokens = g_strsplit_set (priv->code, "_.@", 3);

View file

@ -0,0 +1,13 @@
--- a/src/session-child.c
+++ b/src/session-child.c
@@ -193,8 +193,8 @@
}
/* GNU provides this but we can't rely on that so let's make our own version */
-static void
-updwtmpx (const gchar *wtmp_file, struct utmpx *ut)
+void
+updwtmpx (const char *wtmp_file, const struct utmpx *ut)
{
struct utmp u;
memset (&u, 0, sizeof (u));

42
temp/lttng-tools/APKBUILD Normal file
View file

@ -0,0 +1,42 @@
pkgname=lttng-tools
pkgver=2.10.5
pkgrel=0
pkgdesc="LTTng 2.0 control and utility programs"
url="https://lttng.org"
arch="x86_64 !aarch64"
license="GPL-2.0"
depends="babeltrace"
depends_dev="popt-dev libxml2-dev userspace-rcu-dev lttng-ust-dev kmod-dev
util-linux-dev"
makedepends="$depends_dev bash grep coreutils automake autoconf"
install=""
subpackages="$pkgname-dev $pkgname-doc"
source="https://lttng.org/files/$pkgname/$pkgname-$pkgver.tar.bz2"
options="!check" # Tests fail
build() {
cd "$builddir"
unset LDFLAGS
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var
make V=1
}
check() {
cd "$builddir"
make -j1 check
}
package() {
cd "$builddir"
make DESTDIR="$pkgdir" install
mkdir -p "$pkgdir"/usr/share/licenses/$pkgname
mv "$pkgdir"/usr/share/doc/$pkgname/LICENSE \
"$pkgdir"/usr/share/licenses/$pkgname/
}
sha512sums="30689be92331fb3421ecb67150dab29c182c2febd5db77113dc0439c2289cdadb645043bbbbb4a95c6da40dbf8bbc258dd775e22b908e9514fbeffc450312a5b lttng-tools-2.10.5.tar.bz2"

View file

@ -0,0 +1,378 @@
From 0e3381dc788670849751dcb01b4257b56095b334 Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Thu, 27 Sep 2018 23:31:06 +0200
Subject: [PATCH 1/4] 0001-formats-locale-property.patch
---
data/org.freedesktop.Accounts.User.xml | 45 +++++++++++++++
src/libaccountsservice/act-user.c | 69 +++++++++++++++++++++++
src/libaccountsservice/act-user.h | 3 +
src/user.c | 76 ++++++++++++++++++++++++++
4 files changed, 193 insertions(+)
diff --git a/data/org.freedesktop.Accounts.User.xml b/data/org.freedesktop.Accounts.User.xml
index 4ab989a..0856974 100644
--- a/data/org.freedesktop.Accounts.User.xml
+++ b/data/org.freedesktop.Accounts.User.xml
@@ -150,6 +150,41 @@
</doc:doc>
</method>
+ <method name="SetFormatsLocale">
+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+ <arg name="formats_locale" direction="in" type="s">
+ <doc:doc>
+ <doc:summary>
+ The new regional formats, as a locale specification like "de_DE.UTF-8".
+ </doc:summary>
+ </doc:doc>
+ </arg>
+ <doc:doc>
+ <doc:description>
+ <doc:para>
+ Sets the users regional formats.
+ </doc:para>
+ </doc:description>
+ <doc:permission>
+ The caller needs one of the following PolicyKit authorizations:
+ <doc:list>
+ <doc:item>
+ <doc:term>org.freedesktop.accounts.change-own-user-data</doc:term>
+ <doc:definition>To change his own language</doc:definition>
+ </doc:item>
+ <doc:item>
+ <doc:term>org.freedesktop.accounts.user-administration</doc:term>
+ <doc:definition>To change the language of another user</doc:definition>
+ </doc:item>
+ </doc:list>
+ </doc:permission>
+ <doc:errors>
+ <doc:error name="org.freedesktop.Accounts.Error.PermissionDenied">if the caller lacks the appropriate PolicyKit authorization</doc:error>
+ <doc:error name="org.freedesktop.Accounts.Error.Failed">if the operation failed</doc:error>
+ </doc:errors>
+ </doc:doc>
+ </method>
+
<method name="SetXSession">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="user_set_x_session"/>
@@ -668,6 +703,16 @@
</doc:doc>
</property>
+ <property name="FormatsLocale" type="s" access="read">
+ <doc:doc>
+ <doc:description>
+ <doc:para>
+ The users regional formats, as a locale specification like "de_DE.UTF-8".
+ </doc:para>
+ </doc:description>
+ </doc:doc>
+ </property>
+
<property name="XSession" type="s" access="read">
<doc:doc>
<doc:description>
diff --git a/src/libaccountsservice/act-user.c b/src/libaccountsservice/act-user.c
index dbb9b53..c0b52db 100644
--- a/src/libaccountsservice/act-user.c
+++ b/src/libaccountsservice/act-user.c
@@ -93,6 +93,7 @@ enum {
PROP_LOGIN_HISTORY,
PROP_ICON_FILE,
PROP_LANGUAGE,
+ PROP_FORMATS_LOCALE,
PROP_X_SESSION,
PROP_IS_LOADED
};
@@ -122,6 +123,7 @@ struct _ActUser {
char *location;
char *icon_file;
char *language;
+ char *formats_locale;
char *x_session;
GList *our_sessions;
GList *other_sessions;
@@ -308,6 +310,9 @@ act_user_get_property (GObject *object,
case PROP_LANGUAGE:
g_value_set_string (value, user->language);
break;
+ case PROP_FORMATS_LOCALE:
+ g_value_set_string (value, user->formats_locale);
+ break;
case PROP_X_SESSION:
g_value_set_string (value, user->x_session);
break;
@@ -463,6 +468,13 @@ act_user_class_init (ActUserClass *class)
"User's locale.",
NULL,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+ g_object_class_install_property (gobject_class,
+ PROP_FORMATS_LOCALE,
+ g_param_spec_string ("formats_locale",
+ "Regional Formats",
+ "User's regional formats.",
+ NULL,
+ G_PARAM_READABLE));
g_object_class_install_property (gobject_class,
PROP_X_SESSION,
g_param_spec_string ("x-session",
@@ -583,6 +595,7 @@ act_user_finalize (GObject *object)
g_free (user->location);
if (user->login_history)
g_variant_unref (user->login_history);
+ g_free (user->formats_locale);
if (user->accounts_proxy != NULL) {
g_object_unref (user->accounts_proxy);
@@ -1051,6 +1064,22 @@ act_user_get_language (ActUser *user)
return user->language;
}
+/**
+ * act_user_get_formats_locale:
+ * @user: a #ActUser
+ *
+ * Returns the path to the configured formats locale of @user.
+ *
+ * Returns: (transfer none): a path to an icon
+ */
+const char *
+act_user_get_formats_locale (ActUser *user)
+{
+ g_return_val_if_fail (ACT_IS_USER (user), NULL);
+
+ return user->formats_locale;
+}
+
/**
* act_user_get_x_session:
* @user: a #ActUser
@@ -1279,6 +1308,17 @@ collect_props (const gchar *key,
user->language = g_strdup (new_language);
g_object_notify (G_OBJECT (user), "language");
}
+
+ } else if (strcmp (key, "FormatsLocale") == 0) {
+ const char *new_formats_locale;
+
+ new_formats_locale = g_variant_get_string (value, NULL);
+ if (g_strcmp0 (user->formats_locale, new_formats_locale) != 0) {
+ g_free (user->formats_locale);
+ user->formats_locale = g_strdup (new_formats_locale);
+ g_object_notify (G_OBJECT (user), "formats_locale");
+ }
+
} else if (strcmp (key, "XSession") == 0) {
const char *new_x_session;
@@ -1618,6 +1658,35 @@ act_user_get_password_expiration_policy (ActUser *user,
}
}
+/**
+ * act_user_set_formats_locale:
+ * @user: the user object to alter.
+ * @formats_locale: a locale (e.g. en_US.utf8)
+ *
+ * Assigns a new formats locale for @user.
+ *
+ * Note this function is synchronous and ignores errors.
+ **/
+void
+act_user_set_formats_locale (ActUser *user,
+ const char *formats_locale)
+{
+ GError *error = NULL;
+
+ g_return_if_fail (ACT_IS_USER (user));
+ g_return_if_fail (formats_locale != NULL);
+ g_return_if_fail (ACCOUNTS_IS_USER (user->accounts_proxy));
+
+ if (!accounts_user_call_set_formats_locale_sync (user->accounts_proxy,
+ formats_locale,
+ NULL,
+ &error)) {
+ g_warning ("SetFormatsLocale call failed: %s", error->message);
+ g_error_free (error);
+ return;
+ }
+}
+
/**
* act_user_set_email:
* @user: the user object to alter.
diff --git a/src/libaccountsservice/act-user.h b/src/libaccountsservice/act-user.h
index 76dceb6..e026ce2 100644
--- a/src/libaccountsservice/act-user.h
+++ b/src/libaccountsservice/act-user.h
@@ -77,6 +77,7 @@ gboolean act_user_is_local_account (ActUser *user);
gboolean act_user_is_nonexistent (ActUser *user);
const char *act_user_get_icon_file (ActUser *user);
const char *act_user_get_language (ActUser *user);
+const char *act_user_get_formats_locale (ActUser *user);
const char *act_user_get_x_session (ActUser *user);
const char *act_user_get_primary_session_id (ActUser *user);
@@ -96,6 +97,8 @@ void act_user_set_email (ActUser *user,
const char *email);
void act_user_set_language (ActUser *user,
const char *language);
+void act_user_set_formats_locale (ActUser *user,
+ const char *formats_locale);
void act_user_set_x_session (ActUser *user,
const char *x_session);
void act_user_set_location (ActUser *user,
diff --git a/src/user.c b/src/user.c
index 802d07a..e0dc56a 100644
--- a/src/user.c
+++ b/src/user.c
@@ -58,6 +58,7 @@ enum {
PROP_SHELL,
PROP_EMAIL,
PROP_LANGUAGE,
+ PROP_FORMATS_LOCALE,
PROP_X_SESSION,
PROP_LOCATION,
PROP_LOGIN_FREQUENCY,
@@ -93,6 +94,7 @@ struct User {
gchar *shell;
gchar *email;
gchar *language;
+ gchar *formats_locale;
gchar *x_session;
gchar *location;
guint64 login_frequency;
@@ -319,6 +321,13 @@ user_update_from_keyfile (User *user,
g_object_notify (G_OBJECT (user), "language");
}
+ s = g_key_file_get_string (keyfile, "User", "FormatsLocale", NULL);
+ if (s != NULL) {
+ g_free (user->formats_locale);
+ user->formats_locale = s;
+ g_object_notify (G_OBJECT (user), "formats-locale");
+ }
+
s = g_key_file_get_string (keyfile, "User", "XSession", NULL);
if (s != NULL) {
g_free (user->x_session);
@@ -402,6 +411,9 @@ user_save_to_keyfile (User *user,
if (user->language)
g_key_file_set_string (keyfile, "User", "Language", user->language);
+ if (user->formats_locale)
+ g_key_file_set_string (keyfile, "User", "FormatsLocale", user->formats_locale);
+
if (user->x_session)
g_key_file_set_string (keyfile, "User", "XSession", user->x_session);
@@ -1103,6 +1115,61 @@ user_set_language (AccountsUser *auser,
return TRUE;
}
+static void
+user_change_formats_locale_authorized_cb (Daemon *daemon,
+ User *user,
+ GDBusMethodInvocation *context,
+ gpointer data)
+
+{
+ gchar *formats_locale = data;
+
+ if (g_strcmp0 (user->formats_locale, formats_locale) != 0) {
+ g_free (user->formats_locale);
+ user->formats_locale = g_strdup (formats_locale);
+
+ save_extra_data (user);
+
+ accounts_user_emit_changed (ACCOUNTS_USER (user));
+
+ g_object_notify (G_OBJECT (user), "formats_locale");
+ }
+
+ accounts_user_complete_set_formats_locale (ACCOUNTS_USER (user), context);
+}
+
+gboolean
+user_set_formats_locale (AccountsUser *auser,
+ GDBusMethodInvocation *context,
+ const gchar *formats_locale)
+{
+ User *user = (User*)auser;
+
+ int uid;
+ const gchar *action_id;
+
+ if (!get_caller_uid (context, &uid)) {
+ throw_error (context, ERROR_FAILED, "identifying caller failed");
+ return FALSE;
+ }
+
+ if (user->uid == (uid_t) uid)
+ action_id = "org.freedesktop.accounts.change-own-user-data";
+ else
+ action_id = "org.freedesktop.accounts.user-administration";
+
+ daemon_local_check_auth (user->daemon,
+ user,
+ action_id,
+ TRUE,
+ user_change_formats_locale_authorized_cb,
+ context,
+ g_strdup (formats_locale),
+ (GDestroyNotify) g_free);
+
+ return TRUE;
+}
+
static void
user_change_x_session_authorized_cb (Daemon *daemon,
User *user,
@@ -2209,6 +2276,7 @@ user_finalize (GObject *object)
g_free (user->default_icon_file);
g_free (user->email);
g_free (user->language);
+ g_free (user->formats_locale);
g_free (user->x_session);
g_free (user->location);
g_free (user->password_hint);
@@ -2235,6 +2303,9 @@ user_set_property (GObject *object,
case PROP_LANGUAGE:
user->language = g_value_dup_string (value);
break;
+ case PROP_FORMATS_LOCALE:
+ user->formats_locale = g_value_dup_string (value);
+ break;
case PROP_X_SESSION:
user->x_session = g_value_dup_string (value);
break;
@@ -2303,6 +2374,9 @@ user_get_property (GObject *object,
case PROP_LANGUAGE:
g_value_set_string (value, user->language);
break;
+ case PROP_FORMATS_LOCALE:
+ g_value_set_string (value, user->formats_locale);
+ break;
case PROP_X_SESSION:
g_value_set_string (value, user->x_session);
break;
@@ -2366,6 +2440,7 @@ user_accounts_user_iface_init (AccountsUserIface *iface)
iface->handle_set_account_type = user_set_account_type;
iface->handle_set_automatic_login = user_set_automatic_login;
iface->handle_set_email = user_set_email;
+ iface->handle_set_formats_locale = user_set_formats_locale;
iface->handle_set_home_directory = user_set_home_directory;
iface->handle_set_icon_file = user_set_icon_file;
iface->handle_set_language = user_set_language;
@@ -2414,6 +2489,7 @@ user_init (User *user)
user->default_icon_file = NULL;
user->email = NULL;
user->language = NULL;
+ user->formats_locale = NULL;
user->x_session = NULL;
user->location = NULL;
user->password_mode = PASSWORD_MODE_REGULAR;
--
2.20.1

View file

@ -0,0 +1,190 @@
From 5f8f807b2a9a22d203d948127b24e5790b6b64b9 Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Thu, 27 Sep 2018 23:31:06 +0200
Subject: [PATCH 2/4] 0007-add-lightdm-support.patch
---
src/daemon.c | 143 +++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 132 insertions(+), 11 deletions(-)
diff --git a/src/daemon.c b/src/daemon.c
index 312394a..ae59e50 100644
--- a/src/daemon.c
+++ b/src/daemon.c
@@ -1413,10 +1413,10 @@ daemon_local_check_auth (Daemon *daemon,
}
gboolean
-load_autologin (Daemon *daemon,
- gchar **name,
- gboolean *enabled,
- GError **error)
+load_autologin_gdm (Daemon *daemon,
+ gchar **name,
+ gboolean *enabled,
+ GError **error)
{
GKeyFile *keyfile;
GError *local_error;
@@ -1459,23 +1459,89 @@ load_autologin (Daemon *daemon,
return TRUE;
}
-static gboolean
-save_autologin (Daemon *daemon,
- const gchar *name,
- gboolean enabled,
+gboolean
+load_autologin_lightdm (Daemon *daemon,
+ gchar **name,
+ gboolean *enabled,
+ GError **error)
+{
+ GKeyFile *keyfile;
+ const gchar *filename;
+
+ filename = "/etc/lightdm/lightdm.conf";
+
+ keyfile = g_key_file_new ();
+ if (!g_key_file_load_from_file (keyfile,
+ filename,
+ G_KEY_FILE_KEEP_COMMENTS,
+ error)) {
+ g_key_file_free (keyfile);
+ return FALSE;
+ }
+
+ *name = g_key_file_get_string (keyfile, "SeatDefaults", "autologin-user", error);
+ *enabled = (*error == NULL && (*name) && (*name)[0] != 0);
+
+ g_key_file_free (keyfile);
+
+ return (*error == NULL);
+}
+
+gboolean
+load_autologin (Daemon *daemon,
+ gchar **name,
+ gboolean *enabled,
GError **error)
+{
+ GDBusProxy *proxy;
+
+ /* First, determine whether we should load GDM or LightDM values by
+ checking if GDM is running. */
+ proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
+ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES|
+ G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS|
+ G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
+ NULL,
+ "org.gnome.DisplayManager",
+ "/org/gnome/DisplayManager/Manager",
+ "org.gnome.DisplayManager.Manager",
+ NULL, /* GCancellable */
+ NULL); /* GError */
+
+ if (proxy != NULL) {
+ g_object_unref (proxy);
+ return load_autologin_gdm (daemon, name, enabled, error);
+ } else {
+ return load_autologin_lightdm (daemon, name, enabled, error);
+ }
+}
+
+static gboolean
+save_autologin_gdm (Daemon *daemon,
+ const gchar *name,
+ gboolean enabled,
+ GError **error)
{
GKeyFile *keyfile;
gchar *data;
gboolean result;
+ GError *local_error = NULL;
+
+ if (!g_file_test ("/etc/gdm3", G_FILE_TEST_EXISTS))
+ return TRUE; /* not an error, just not installed */
keyfile = g_key_file_new ();
if (!g_key_file_load_from_file (keyfile,
PATH_GDM_CUSTOM,
G_KEY_FILE_KEEP_COMMENTS,
- error)) {
- g_key_file_free (keyfile);
- return FALSE;
+ &local_error)) {
+ /* It's OK for custom.conf to not exist, we will make it */
+ if (!g_error_matches (local_error, G_FILE_ERROR, G_FILE_ERROR_NOENT)) {
+ g_propagate_error (error, local_error);
+ g_key_file_free (keyfile);
+ return FALSE;
+ }
+ g_error_free (local_error);
}
g_key_file_set_string (keyfile, "daemon", "AutomaticLoginEnable", enabled ? "True" : "False");
@@ -1490,6 +1556,61 @@ save_autologin (Daemon *daemon,
return result;
}
+static gboolean
+save_autologin_lightdm (Daemon *daemon,
+ const gchar *name,
+ gboolean enabled,
+ GError **error)
+{
+ GKeyFile *keyfile;
+ const gchar *filename;
+ gchar *data;
+ gboolean result;
+ GError *local_error = NULL;
+
+ if (!g_file_test ("/etc/lightdm", G_FILE_TEST_EXISTS))
+ return TRUE; /* not an error, just not installed */
+
+ filename = "/etc/lightdm/lightdm.conf";
+
+ keyfile = g_key_file_new ();
+ if (!g_key_file_load_from_file (keyfile,
+ filename,
+ G_KEY_FILE_KEEP_COMMENTS,
+ &local_error)) {
+ /* It's OK for custom.conf to not exist, we will make it */
+ if (!g_error_matches (local_error, G_FILE_ERROR, G_FILE_ERROR_NOENT)) {
+ g_propagate_error (error, local_error);
+ g_key_file_free (keyfile);
+ return FALSE;
+ }
+ g_error_free (local_error);
+ }
+
+ g_key_file_set_string (keyfile, "SeatDefaults", "autologin-user", enabled ? name : "");
+
+ data = g_key_file_to_data (keyfile, NULL, NULL);
+ result = g_file_set_contents (filename, data, -1, error);
+
+ g_key_file_free (keyfile);
+ g_free (data);
+
+ return result;
+}
+
+static gboolean
+save_autologin (Daemon *daemon,
+ const gchar *name,
+ gboolean enabled,
+ GError **error)
+{
+ if (!save_autologin_gdm (daemon, name, enabled, error))
+ return FALSE;
+ if (!save_autologin_lightdm (daemon, name, enabled, error))
+ return FALSE;
+ return TRUE;
+}
+
gboolean
daemon_local_set_automatic_login (Daemon *daemon,
User *user,
--
2.20.1

View file

@ -0,0 +1,369 @@
From bf5c35a6ffec43378f7a7483642e866b5efbcfdb Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Thu, 27 Sep 2018 23:31:07 +0200
Subject: [PATCH 3/4] 0011-add-background-file-support.patch
---
data/org.freedesktop.Accounts.User.xml | 45 ++++++++++++
src/libaccountsservice/act-user.c | 67 ++++++++++++++++++
src/user.c | 98 ++++++++++++++++++++++++++
3 files changed, 210 insertions(+)
diff --git a/data/org.freedesktop.Accounts.User.xml b/data/org.freedesktop.Accounts.User.xml
index 0856974..103661c 100644
--- a/data/org.freedesktop.Accounts.User.xml
+++ b/data/org.freedesktop.Accounts.User.xml
@@ -331,6 +331,41 @@
</doc:doc>
</method>
+ <method name="SetBackgroundFile">
+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+ <arg name="filename" direction="in" type="s">
+ <doc:doc>
+ <doc:summary>
+ The absolute filename of a png file to use as the users background.
+ </doc:summary>
+ </doc:doc>
+ </arg>
+ <doc:doc>
+ <doc:description>
+ <doc:para>
+ Sets the users background.
+ </doc:para>
+ </doc:description>
+ <doc:permission>
+ The caller needs one of the following PolicyKit authorizations:
+ <doc:list>
+ <doc:item>
+ <doc:term>org.freedesktop.accounts.change-own-user-data</doc:term>
+ <doc:definition>To change his own background</doc:definition>
+ </doc:item>
+ <doc:item>
+ <doc:term>org.freedesktop.accounts.user-administration</doc:term>
+ <doc:definition>To change the background of another user</doc:definition>
+ </doc:item>
+ </doc:list>
+ </doc:permission>
+ <doc:errors>
+ <doc:error name="org.freedesktop.Accounts.Error.PermissionDenied">if the caller lacks the appropriate PolicyKit authorization</doc:error>
+ <doc:error name="org.freedesktop.Accounts.Error.Failed">if the operation failed</doc:error>
+ </doc:errors>
+ </doc:doc>
+ </method>
+
<method name="SetIconFile">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg name="filename" direction="in" type="s">
@@ -770,6 +805,16 @@
</doc:doc>
</property>
+ <property name="BackgroundFile" type="s" access="read">
+ <doc:doc>
+ <doc:description>
+ <doc:para>
+ The filename of a png file containing the users background.
+ </doc:para>
+ </doc:description>
+ </doc:doc>
+ </property>
+
<property name="IconFile" type="s" access="read">
<doc:doc>
<doc:description>
diff --git a/src/libaccountsservice/act-user.c b/src/libaccountsservice/act-user.c
index c0b52db..36d1ade 100644
--- a/src/libaccountsservice/act-user.c
+++ b/src/libaccountsservice/act-user.c
@@ -91,6 +91,7 @@ enum {
PROP_LOGIN_FREQUENCY,
PROP_LOGIN_TIME,
PROP_LOGIN_HISTORY,
+ PROP_BACKGROUND_FILE,
PROP_ICON_FILE,
PROP_LANGUAGE,
PROP_FORMATS_LOCALE,
@@ -121,6 +122,7 @@ struct _ActUser {
char *shell;
char *email;
char *location;
+ char *background_file;
char *icon_file;
char *language;
char *formats_locale;
@@ -304,6 +306,9 @@ act_user_get_property (GObject *object,
case PROP_LOCATION:
g_value_set_string (value, user->location);
break;
+ case PROP_BACKGROUND_FILE:
+ g_value_set_string (value, user->background_file);
+ break;
case PROP_ICON_FILE:
g_value_set_string (value, user->icon_file);
break;
@@ -454,6 +459,13 @@ act_user_class_init (ActUserClass *class)
G_VARIANT_TYPE ("a(xxa{sv})"),
NULL,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+ g_object_class_install_property (gobject_class,
+ PROP_BACKGROUND_FILE,
+ g_param_spec_string ("background-file",
+ "Background File",
+ "The path to a background for this user.",
+ NULL,
+ G_PARAM_READABLE));
g_object_class_install_property (gobject_class,
PROP_ICON_FILE,
g_param_spec_string ("icon-file",
@@ -585,6 +597,7 @@ act_user_finalize (GObject *object)
g_free (user->user_name);
g_free (user->real_name);
+ g_free (user->background_file);
g_free (user->icon_file);
g_free (user->language);
g_free (user->object_path);
@@ -1032,6 +1045,22 @@ act_user_is_nonexistent (ActUser *user)
return user->nonexistent;
}
+/**
+ * act_user_get_background_file:
+ * @user: a #ActUser
+ *
+ * Returns the path to the account background belonging to @user.
+ *
+ * Returns: (transfer none): a path to a background
+ */
+const char *
+act_user_get_background_file (ActUser *user)
+{
+ g_return_val_if_fail (ACT_IS_USER (user), NULL);
+
+ return user->background_file;
+}
+
/**
* act_user_get_icon_file:
* @user: a #ActUser
@@ -1290,6 +1319,15 @@ collect_props (const gchar *key,
user->login_history = g_variant_ref (new_login_history);
g_object_notify (G_OBJECT (user), "login-history");
}
+ } else if (strcmp (key, "BackgroundFile") == 0) {
+ const char *new_background_file;
+
+ new_background_file = g_variant_get_string (value, NULL);
+ if (g_strcmp0 (user->background_file, new_background_file) != 0) {
+ g_free (user->background_file);
+ user->background_file = g_strdup (new_background_file);
+ g_object_notify (G_OBJECT (user), "background-file");
+ }
} else if (strcmp (key, "IconFile") == 0) {
const char *new_icon_file;
@@ -1745,6 +1783,35 @@ act_user_set_language (ActUser *user,
}
}
+/**
+ * act_user_set_background_file:
+ * @user: the user object to alter.
+ * @background_file: path to an background
+ *
+ * Assigns a new background for @user.
+ *
+ * Note this function is synchronous and ignores errors.
+ **/
+void
+act_user_set_background_file (ActUser *user,
+ const char *background_file)
+{
+ GError *error = NULL;
+
+ g_return_if_fail (ACT_IS_USER (user));
+ g_return_if_fail (background_file != NULL);
+ g_return_if_fail (ACCOUNTS_IS_USER (user->accounts_proxy));
+
+ if (!accounts_user_call_set_background_file_sync (user->accounts_proxy,
+ background_file,
+ NULL,
+ &error)) {
+ g_warning ("SetBackgroundFile call failed: %s", error->message);
+ g_error_free (error);
+ return;
+ }
+}
+
/**
* act_user_set_x_session:
* @user: the user object to alter.
diff --git a/src/user.c b/src/user.c
index e0dc56a..c32971e 100644
--- a/src/user.c
+++ b/src/user.c
@@ -64,6 +64,7 @@ enum {
PROP_LOGIN_FREQUENCY,
PROP_LOGIN_TIME,
PROP_LOGIN_HISTORY,
+ PROP_BACKGROUND_FILE,
PROP_ICON_FILE,
PROP_LOCKED,
PROP_PASSWORD_MODE,
@@ -98,6 +99,7 @@ struct User {
gchar *x_session;
gchar *location;
guint64 login_frequency;
+ gchar *background_file;
gint64 login_time;
gint64 expiration_time;
gint64 last_change_time;
@@ -356,6 +358,13 @@ user_update_from_keyfile (User *user,
g_object_notify (G_OBJECT (user), "password-hint");
}
+ s = g_key_file_get_string (keyfile, "User", "Background", NULL);
+ if (s != NULL) {
+ g_free (user->background_file);
+ user->background_file = s;
+ g_object_notify (G_OBJECT (user), "background-file");
+ }
+
s = g_key_file_get_string (keyfile, "User", "Icon", NULL);
if (s != NULL) {
g_free (user->icon_file);
@@ -423,6 +432,9 @@ user_save_to_keyfile (User *user,
if (user->password_hint)
g_key_file_set_string (keyfile, "User", "PasswordHint", user->password_hint);
+ if (user->background_file)
+ g_key_file_set_string (keyfile, "User", "Background", user->background_file);
+
if (user->icon_file)
g_key_file_set_string (keyfile, "User", "Icon", user->icon_file);
@@ -1460,6 +1472,86 @@ become_user (gpointer data)
}
}
+static void
+user_change_background_file_authorized_cb (Daemon *daemon,
+ User *user,
+ GDBusMethodInvocation *context,
+ gpointer data)
+{
+ gchar *filename;
+ GFile *file;
+ GFileInfo *info;
+ GFileType type;
+
+ filename = g_strdup (data);
+
+ if (filename == NULL ||
+ *filename == '\0') {
+ g_free (filename);
+ filename = NULL;
+
+ goto background_saved;
+ }
+
+ file = g_file_new_for_path (filename);
+ info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_TYPE,
+ 0, NULL, NULL);
+ type = g_file_info_get_file_type (info);
+
+ g_object_unref (info);
+ g_object_unref (file);
+
+ if (type != G_FILE_TYPE_REGULAR) {
+ g_debug ("not a regular file\n");
+ throw_error (context, ERROR_FAILED, "file '%s' is not a regular file", filename);
+ g_free (filename);
+ return;
+ }
+
+background_saved:
+ g_free (user->background_file);
+ user->background_file = filename;
+
+ save_extra_data (user);
+
+ accounts_user_emit_changed (ACCOUNTS_USER (user));
+
+ g_object_notify (G_OBJECT (user), "background-file");
+
+ accounts_user_complete_set_background_file (ACCOUNTS_USER (user), context);
+}
+
+gboolean
+user_set_background_file (AccountsUser *auser,
+ GDBusMethodInvocation *context,
+ const gchar *filename)
+{
+ User *user = (User*)auser;
+ int uid;
+ const gchar *action_id;
+
+ if (!get_caller_uid (context, &uid)) {
+ throw_error (context, ERROR_FAILED, "identifying caller failed");
+ return FALSE;
+ }
+
+ if (user->uid == (uid_t) uid)
+ action_id = "org.freedesktop.accounts.change-own-user-data";
+ else
+ action_id = "org.freedesktop.accounts.user-administration";
+
+ daemon_local_check_auth (user->daemon,
+ user,
+ action_id,
+ TRUE,
+ user_change_background_file_authorized_cb,
+ context,
+ g_strdup (filename),
+ (GDestroyNotify)g_free);
+
+ return TRUE;
+}
+
static void
user_change_icon_file_authorized_cb (Daemon *daemon,
User *user,
@@ -2274,6 +2366,7 @@ user_finalize (GObject *object)
g_free (user->shell);
g_free (user->icon_file);
g_free (user->default_icon_file);
+ g_free (user->background_file);
g_free (user->email);
g_free (user->language);
g_free (user->formats_locale);
@@ -2383,6 +2476,9 @@ user_get_property (GObject *object,
case PROP_LOCATION:
g_value_set_string (value, user->location);
break;
+ case PROP_BACKGROUND_FILE:
+ g_value_set_string (value, user->background_file);
+ break;
case PROP_ICON_FILE:
if (user->icon_file)
g_value_set_string (value, user->icon_file);
@@ -2439,6 +2535,7 @@ user_accounts_user_iface_init (AccountsUserIface *iface)
{
iface->handle_set_account_type = user_set_account_type;
iface->handle_set_automatic_login = user_set_automatic_login;
+ iface->handle_set_background_file = user_set_background_file;
iface->handle_set_email = user_set_email;
iface->handle_set_formats_locale = user_set_formats_locale;
iface->handle_set_home_directory = user_set_home_directory;
@@ -2485,6 +2582,7 @@ user_init (User *user)
user->account_type = ACCOUNT_TYPE_STANDARD;
user->home_dir = NULL;
user->shell = NULL;
+ user->background_file = NULL;
user->icon_file = NULL;
user->default_icon_file = NULL;
user->email = NULL;
--
2.20.1

View file

@ -0,0 +1,570 @@
From a1b09a0d0243ac3a7fbd26c176a274dd3716f391 Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Thu, 27 Sep 2018 23:32:49 +0200
Subject: [PATCH 4/4] 0016-add-input-sources-support.patch
---
data/org.freedesktop.Accounts.User.xml | 45 ++++++
src/libaccountsservice/act-user.c | 82 ++++++++++
src/libaccountsservice/act-user.h | 3 +
src/user.c | 213 +++++++++++++++++++++++++
4 files changed, 343 insertions(+)
diff --git a/data/org.freedesktop.Accounts.User.xml b/data/org.freedesktop.Accounts.User.xml
index 103661c..ede2a19 100644
--- a/data/org.freedesktop.Accounts.User.xml
+++ b/data/org.freedesktop.Accounts.User.xml
@@ -185,6 +185,41 @@
</doc:doc>
</method>
+ <method name="SetInputSources">
+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+ <arg name="sources" direction="in" type="aa{ss}">
+ <doc:doc>
+ <doc:summary>
+ A list of input sources.
+ </doc:summary>
+ </doc:doc>
+ </arg>
+ <doc:doc>
+ <doc:description>
+ <doc:para>
+ Sets the user's input sources.
+ </doc:para>
+ </doc:description>
+ <doc:permission>
+ The caller needs one of the following PolicyKit authorizations:
+ <doc:list>
+ <doc:item>
+ <doc:term>org.freedesktop.accounts.change-own-user-data</doc:term>
+ <doc:definition>To change his own input sources</doc:definition>
+ </doc:item>
+ <doc:item>
+ <doc:term>org.freedesktop.accounts.user-administration</doc:term>
+ <doc:definition>To change the input sources of another user</doc:definition>
+ </doc:item>
+ </doc:list>
+ </doc:permission>
+ <doc:errors>
+ <doc:error name="org.freedesktop.Accounts.Error.PermissionDenied">if the caller lacks the appropriate PolicyKit authorization</doc:error>
+ <doc:error name="org.freedesktop.Accounts.Error.Failed">if the operation failed</doc:error>
+ </doc:errors>
+ </doc:doc>
+ </method>
+
<method name="SetXSession">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="user_set_x_session"/>
@@ -748,6 +783,16 @@
</doc:doc>
</property>
+ <property name="InputSources" type="aa{ss}" access="read">
+ <doc:doc>
+ <doc:description>
+ <doc:para>
+ The user's input sources.
+ </doc:para>
+ </doc:description>
+ </doc:doc>
+ </property>
+
<property name="XSession" type="s" access="read">
<doc:doc>
<doc:description>
diff --git a/src/libaccountsservice/act-user.c b/src/libaccountsservice/act-user.c
index 36d1ade..43fc0ff 100644
--- a/src/libaccountsservice/act-user.c
+++ b/src/libaccountsservice/act-user.c
@@ -95,6 +95,7 @@ enum {
PROP_ICON_FILE,
PROP_LANGUAGE,
PROP_FORMATS_LOCALE,
+ PROP_INPUT_SOURCES,
PROP_X_SESSION,
PROP_IS_LOADED
};
@@ -126,6 +127,7 @@ struct _ActUser {
char *icon_file;
char *language;
char *formats_locale;
+ GVariant *input_sources;
char *x_session;
GList *our_sessions;
GList *other_sessions;
@@ -318,6 +320,9 @@ act_user_get_property (GObject *object,
case PROP_FORMATS_LOCALE:
g_value_set_string (value, user->formats_locale);
break;
+ case PROP_INPUT_SOURCES:
+ g_value_set_variant (value, user->input_sources);
+ break;
case PROP_X_SESSION:
g_value_set_string (value, user->x_session);
break;
@@ -487,6 +492,14 @@ act_user_class_init (ActUserClass *class)
"User's regional formats.",
NULL,
G_PARAM_READABLE));
+ g_object_class_install_property (gobject_class,
+ PROP_INPUT_SOURCES,
+ g_param_spec_variant ("input-sources",
+ "Input sources",
+ "User's input sources.",
+ G_VARIANT_TYPE ("aa{ss}"),
+ NULL,
+ G_PARAM_READABLE));
g_object_class_install_property (gobject_class,
PROP_X_SESSION,
g_param_spec_string ("x-session",
@@ -606,6 +619,8 @@ act_user_finalize (GObject *object)
g_free (user->shell);
g_free (user->email);
g_free (user->location);
+ if (user->input_sources)
+ g_variant_unref (user->input_sources);
if (user->login_history)
g_variant_unref (user->login_history);
g_free (user->formats_locale);
@@ -1109,6 +1124,22 @@ act_user_get_formats_locale (ActUser *user)
return user->formats_locale;
}
+/**
+ * act_user_get_input_sources:
+ * @user: a #ActUser
+ *
+ * Returns the input sources of @user.
+ *
+ * Returns: (transfer none): a list of input sources
+ */
+GVariant *
+act_user_get_input_sources (ActUser *user)
+{
+ g_return_val_if_fail (ACT_IS_USER (user), NULL);
+
+ return user->input_sources;
+}
+
/**
* act_user_get_x_session:
* @user: a #ActUser
@@ -1357,6 +1388,19 @@ collect_props (const gchar *key,
g_object_notify (G_OBJECT (user), "formats_locale");
}
+ } else if (strcmp (key, "InputSources") == 0) {
+ GVariant *sources;
+
+ g_variant_get (value, "@aa{ss}", &sources);
+
+ if (!user->input_sources || !g_variant_equal (sources, user->input_sources)) {
+ if (user->input_sources)
+ g_variant_unref (user->input_sources);
+ user->input_sources = g_variant_ref (sources);
+ g_object_notify (G_OBJECT (user), "input-sources");
+ }
+
+ g_variant_unref (sources);
} else if (strcmp (key, "XSession") == 0) {
const char *new_x_session;
@@ -1612,6 +1656,15 @@ _act_user_load_from_user (ActUser *user,
user->language = g_strdup (user_to_copy->language);
g_object_notify (G_OBJECT (user), "language");
+ if (user_to_copy->input_sources != user->input_sources) {
+ if (user->input_sources)
+ g_variant_unref (user->input_sources);
+ user->input_sources = user_to_copy->input_sources;
+ if (user->input_sources)
+ g_variant_ref (user->input_sources);
+ g_object_notify (G_OBJECT (user), "input-sources");
+ }
+
g_free (user->x_session);
user->x_session = g_strdup (user_to_copy->x_session);
g_object_notify (G_OBJECT (user), "x-session");
@@ -1812,6 +1865,35 @@ act_user_set_background_file (ActUser *user,
}
}
+/**
+ * act_user_set_input_sources:
+ * @user: the user object to alter.
+ * @sources: a list of input sources
+ *
+ * Assigns new input sources for @user.
+ *
+ * Note this function is synchronous and ignores errors.
+ **/
+void
+act_user_set_input_sources (ActUser *user,
+ GVariant *sources)
+{
+ GError *error = NULL;
+
+ g_return_if_fail (ACT_IS_USER (user));
+ g_return_if_fail (ACCOUNTS_IS_USER (user->accounts_proxy));
+ g_return_if_fail (g_variant_is_of_type (sources, G_VARIANT_TYPE ("aa{ss}")));
+
+ if (!accounts_user_call_set_input_sources_sync (user->accounts_proxy,
+ sources,
+ NULL,
+ &error)) {
+ g_warning ("SetInputSources call failed: %s", error->message);
+ g_error_free (error);
+ return;
+ }
+}
+
/**
* act_user_set_x_session:
* @user: the user object to alter.
diff --git a/src/libaccountsservice/act-user.h b/src/libaccountsservice/act-user.h
index e026ce2..de9a5a9 100644
--- a/src/libaccountsservice/act-user.h
+++ b/src/libaccountsservice/act-user.h
@@ -78,6 +78,7 @@ gboolean act_user_is_nonexistent (ActUser *user);
const char *act_user_get_icon_file (ActUser *user);
const char *act_user_get_language (ActUser *user);
const char *act_user_get_formats_locale (ActUser *user);
+GVariant *act_user_get_input_sources (ActUser *user);
const char *act_user_get_x_session (ActUser *user);
const char *act_user_get_primary_session_id (ActUser *user);
@@ -99,6 +100,8 @@ void act_user_set_language (ActUser *user,
const char *language);
void act_user_set_formats_locale (ActUser *user,
const char *formats_locale);
+void act_user_set_input_sources (ActUser *user,
+ GVariant *sources);
void act_user_set_x_session (ActUser *user,
const char *x_session);
void act_user_set_location (ActUser *user,
diff --git a/src/user.c b/src/user.c
index c32971e..17772f8 100644
--- a/src/user.c
+++ b/src/user.c
@@ -59,6 +59,7 @@ enum {
PROP_EMAIL,
PROP_LANGUAGE,
PROP_FORMATS_LOCALE,
+ PROP_INPUT_SOURCES,
PROP_X_SESSION,
PROP_LOCATION,
PROP_LOGIN_FREQUENCY,
@@ -96,6 +97,7 @@ struct User {
gchar *email;
gchar *language;
gchar *formats_locale;
+ GVariant *input_sources;
gchar *x_session;
gchar *location;
guint64 login_frequency;
@@ -307,6 +309,75 @@ user_update_from_pwent (User *user,
accounts_user_emit_changed (ACCOUNTS_USER (user));
}
+static gint
+intcmp (gconstpointer a,
+ gconstpointer b,
+ gpointer user_data)
+{
+ return GPOINTER_TO_INT (a) - GPOINTER_TO_INT (b);
+}
+
+static GVariant *
+key_file_get_input_sources (GKeyFile *key_file)
+{
+ GVariantBuilder builder;
+ GSequence *indices;
+ GSequenceIter *indices_iter;
+ gchar **groups;
+ gchar **groups_iter;
+
+ indices = g_sequence_new (NULL);
+ groups = g_key_file_get_groups (key_file, NULL);
+
+ for (groups_iter = groups; *groups_iter; groups_iter++) {
+ if (g_str_has_prefix (*groups_iter, "InputSource") && (*groups_iter)[11]) {
+ gchar *end;
+ guint64 index;
+
+ index = g_ascii_strtoull (*groups_iter + 11, &end, 0);
+
+ if (!*end)
+ g_sequence_insert_sorted (indices, GINT_TO_POINTER (index), intcmp, NULL);
+ }
+ }
+
+ g_strfreev (groups);
+
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("aa{ss}"));
+
+ indices_iter = g_sequence_get_begin_iter (indices);
+
+ while (!g_sequence_iter_is_end (indices_iter)) {
+ guint index;
+ gchar *group;
+ gchar **keys;
+ gchar **keys_iter;
+
+ g_variant_builder_open (&builder, G_VARIANT_TYPE ("a{ss}"));
+
+ index = GPOINTER_TO_UINT (g_sequence_get (indices_iter));
+ group = g_strdup_printf ("InputSource%u", index);
+ keys = g_key_file_get_keys (key_file, group, NULL, NULL);
+
+ for (keys_iter = keys; *keys_iter; keys_iter++) {
+ gchar *value = g_key_file_get_string (key_file, group, *keys_iter, NULL);
+ g_variant_builder_add (&builder, "{ss}", *keys_iter, value);
+ g_free (value);
+ }
+
+ g_strfreev (keys);
+ g_free (group);
+
+ g_variant_builder_close (&builder);
+
+ indices_iter = g_sequence_iter_next (indices_iter);
+ }
+
+ g_sequence_free (indices);
+
+ return g_variant_ref_sink (g_variant_builder_end (&builder));
+}
+
void
user_update_from_keyfile (User *user,
GKeyFile *keyfile)
@@ -330,6 +401,11 @@ user_update_from_keyfile (User *user,
g_object_notify (G_OBJECT (user), "formats-locale");
}
+ if (user->input_sources != NULL)
+ g_variant_unref (user->input_sources);
+ user->input_sources = key_file_get_input_sources (keyfile);
+ g_object_notify (G_OBJECT (user), "input-sources");
+
s = g_key_file_get_string (keyfile, "User", "XSession", NULL);
if (s != NULL) {
g_free (user->x_session);
@@ -408,6 +484,51 @@ user_update_system_account_property (User *user,
g_object_notify (G_OBJECT (user), "system-account");
}
+static void
+key_file_set_input_sources (GKeyFile *key_file,
+ GVariant *input_sources)
+{
+ gchar **groups;
+ gchar **groups_iter;
+ GVariantIter sources;
+ GVariantIter *source;
+ guint i;
+
+ /* Remove all groups matching regex "InputSource\d+". */
+
+ groups = g_key_file_get_groups (key_file, NULL);
+
+ for (groups_iter = groups; *groups_iter; groups_iter++) {
+ if (g_str_has_prefix (*groups_iter, "InputSource")) {
+ for (i = 11; g_ascii_isdigit ((*groups_iter)[i]); i++);
+
+ if (i > 11 && !(*groups_iter)[i])
+ g_key_file_remove_group (key_file, *groups_iter, NULL);
+ }
+ }
+
+ g_strfreev (groups);
+
+ /* Write all input sources to key file. */
+
+ g_variant_iter_init (&sources, input_sources);
+
+ for (i = 0; g_variant_iter_next (&sources, "a{ss}", &source); i++) {
+ gchar *group;
+ const gchar *key;
+ const gchar *value;
+
+ group = g_strdup_printf ("InputSource%u", i);
+
+ while (g_variant_iter_next (source, "{&s&s}", &key, &value))
+ g_key_file_set_string (key_file, group, key, value);
+
+ g_free (group);
+
+ g_variant_iter_free (source);
+ }
+}
+
static void
user_save_to_keyfile (User *user,
GKeyFile *keyfile)
@@ -423,6 +544,9 @@ user_save_to_keyfile (User *user,
if (user->formats_locale)
g_key_file_set_string (keyfile, "User", "FormatsLocale", user->formats_locale);
+ if (user->input_sources)
+ key_file_set_input_sources (keyfile, user->input_sources);
+
if (user->x_session)
g_key_file_set_string (keyfile, "User", "XSession", user->x_session);
@@ -1182,6 +1306,67 @@ user_set_formats_locale (AccountsUser *auser,
return TRUE;
}
+static void
+user_change_input_sources_authorized_cb (Daemon *daemon,
+ User *user,
+ GDBusMethodInvocation *context,
+ gpointer data)
+
+{
+ GVariant *sources = data;
+
+ if (sources != user->input_sources &&
+ (!sources || !user->input_sources ||
+ !g_variant_equal (sources, user->input_sources))) {
+ if (user->input_sources)
+ g_variant_unref (user->input_sources);
+
+ user->input_sources = sources;
+
+ if (user->input_sources)
+ g_variant_ref (user->input_sources);
+
+ save_extra_data (user);
+
+ accounts_user_emit_changed (ACCOUNTS_USER (user));
+
+ g_object_notify (G_OBJECT (user), "input-sources");
+ }
+
+ accounts_user_complete_set_input_sources (ACCOUNTS_USER (user), context);
+}
+
+static gboolean
+user_set_input_sources (AccountsUser *auser,
+ GDBusMethodInvocation *context,
+ GVariant *sources)
+{
+ User *user = (User*)auser;
+ int uid;
+ const gchar *action_id;
+
+ if (!get_caller_uid (context, &uid)) {
+ throw_error (context, ERROR_FAILED, "identifying caller failed");
+ return FALSE;
+ }
+
+ if (user->uid == (uid_t) uid)
+ action_id = "org.freedesktop.accounts.change-own-user-data";
+ else
+ action_id = "org.freedesktop.accounts.user-administration";
+
+ daemon_local_check_auth (user->daemon,
+ user,
+ action_id,
+ TRUE,
+ user_change_input_sources_authorized_cb,
+ context,
+ sources ? g_variant_ref (sources) : NULL,
+ sources ? (GDestroyNotify) g_variant_unref : NULL);
+
+ return TRUE;
+}
+
static void
user_change_x_session_authorized_cb (Daemon *daemon,
User *user,
@@ -2281,6 +2466,12 @@ user_real_get_language (AccountsUser *user)
return USER (user)->language;
}
+static GVariant *
+user_real_get_input_sources (AccountsUser *user)
+{
+ return USER (user)->input_sources;
+}
+
static const gchar *
user_real_get_xsession (AccountsUser *user)
{
@@ -2377,6 +2568,9 @@ user_finalize (GObject *object)
if (user->login_history)
g_variant_unref (user->login_history);
+ if (user->input_sources)
+ g_variant_unref (user->input_sources);
+
if (G_OBJECT_CLASS (user_parent_class)->finalize)
(*G_OBJECT_CLASS (user_parent_class)->finalize) (object);
}
@@ -2388,6 +2582,7 @@ user_set_property (GObject *object,
GParamSpec *pspec)
{
User *user = USER (object);
+ GVariant *variant;
switch (param_id) {
case PROP_ACCOUNT_TYPE:
@@ -2398,6 +2593,18 @@ user_set_property (GObject *object,
break;
case PROP_FORMATS_LOCALE:
user->formats_locale = g_value_dup_string (value);
+ break;
+ case PROP_INPUT_SOURCES:
+ variant = g_value_get_variant (value);
+
+ if (variant != user->input_sources) {
+ if (user->input_sources)
+ g_variant_unref (user->input_sources);
+ user->input_sources = variant;
+ if (user->input_sources)
+ g_variant_ref (user->input_sources);
+ }
+
break;
case PROP_X_SESSION:
user->x_session = g_value_dup_string (value);
@@ -2470,6 +2677,9 @@ user_get_property (GObject *object,
case PROP_FORMATS_LOCALE:
g_value_set_string (value, user->formats_locale);
break;
+ case PROP_INPUT_SOURCES:
+ g_value_set_variant (value, user->input_sources);
+ break;
case PROP_X_SESSION:
g_value_set_string (value, user->x_session);
break;
@@ -2541,6 +2751,7 @@ user_accounts_user_iface_init (AccountsUserIface *iface)
iface->handle_set_home_directory = user_set_home_directory;
iface->handle_set_icon_file = user_set_icon_file;
iface->handle_set_language = user_set_language;
+ iface->handle_set_input_sources = user_set_input_sources;
iface->handle_set_location = user_set_location;
iface->handle_set_locked = user_set_locked;
iface->handle_set_password = user_set_password;
@@ -2559,6 +2770,7 @@ user_accounts_user_iface_init (AccountsUserIface *iface)
iface->get_shell = user_real_get_shell;
iface->get_email = user_real_get_email;
iface->get_language = user_real_get_language;
+ iface->get_input_sources = user_real_get_input_sources;
iface->get_xsession = user_real_get_xsession;
iface->get_location = user_real_get_location;
iface->get_login_frequency = user_real_get_login_frequency;
@@ -2588,6 +2800,7 @@ user_init (User *user)
user->email = NULL;
user->language = NULL;
user->formats_locale = NULL;
+ user->input_sources = NULL;
user->x_session = NULL;
user->location = NULL;
user->password_mode = PASSWORD_MODE_REGULAR;
--
2.20.1

View file

@ -0,0 +1,59 @@
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
# Needed because of https://github.com/ubports/system-settings/issues/65
pkgname=accountsservice-ubuntu
_pkgname=accountsservice
pkgver=0.6.45
pkgrel=0
pkgdesc="D-Bus interface for user account query and manipulation"
url="http://www.freedesktop.org/software/accountsservice/"
arch="x86_64"
license="GPL-3.0-or-later"
depends=""
depends_dev="glib-dev gobject-introspection-dev polkit-dev"
makedepends="$depends_dev intltool gnome-doc-utils"
provides="$_pkgname=$pkgver"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
# Issues about "Ubuntu-specific" patches:
# https://gitlab.freedesktop.org/accountsservice/accountsservice/issues/22
# https://gitlab.freedesktop.org/accountsservice/accountsservice/issues/52
source="http://www.freedesktop.org/software/accountsservice/accountsservice-$pkgver.tar.xz
musl-fgetspent_r.patch
0001-0001-formats-locale-property.patch.patch
0002-0007-add-lightdm-support.patch.patch
0003-0011-add-background-file-support.patch.patch
0004-0016-add-input-sources-support.patch.patch"
builddir="$srcdir"/$_pkgname-$pkgver
build() {
cd "$builddir"
# Hack to check for /var/log/wtmp instead of /var/log/utx.log
sed -i configure -e "s;utx\.log;wtmp;g"
ac_cv_file__var_log_utx_log=yes ./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--localstatedir=/var \
--disable-systemd \
--enable-introspection=yes
make
}
check() {
cd "$builddir"
make check
}
package() {
cd "$builddir"
make DESTDIR="$pkgdir" install
}
sha512sums="09975f9fa03a3177d923de6d6f6e6acfffeb2ff4924c45eaac78c994c16974427c8e936a87034747ba494d2bb3df6e8a92ff44db387761b06e06e311d7cf105a accountsservice-0.6.45.tar.xz
469392beca8f5941eafaa193c4fcb0472770ee4183ce520416a1b5d6abafe0e201990eb74d06bfbd9e20af08e55aff5f0031f267083f6c6879f0fe4e5028103c musl-fgetspent_r.patch
ad924e29432c92fbf8cdfab7e1d023f67502003f54ab1f0db3d264a7e71a9aececa65ef4c4de110df3f9892f8f90bb50018115b61513e883ac6797ad8c6dd4f4 0001-0001-formats-locale-property.patch.patch
3d91eebc4e877a73dd9fad802d8473a8f4275b82d2ac79fc1d0191262794b95cdf50edd6ea76e9bfc946c523b9d88e8cabc90a3b00211b404565c8884cd62653 0002-0007-add-lightdm-support.patch.patch
8baf966e83e74efb3b5fe75722320953c481bb2e7803bbece539e3ffb82ce2879fcebfa4512f59978f852dbf7e62a21fca5a8cd668fd94549d39796730b61518 0003-0011-add-background-file-support.patch.patch
9cfe41e017e0025d3f474b07b6f7599728b7ff8a0eecbbf629d035b6542f9af1b61469eb38f1ca295999a5baeb69424ed39b56703ac5919c9946eab6135a9eb4 0004-0016-add-input-sources-support.patch.patch"

View file

@ -0,0 +1,34 @@
diff --git a/src/daemon.c b/src/daemon.c
index 312394a..e7b3c58 100644
--- a/src/daemon.c
+++ b/src/daemon.c
@@ -140,6 +140,28 @@ error_get_type (void)
#define MAX_LOCAL_USERS 50
#endif
+#ifndef __GLIBC__
+ /* Musl libc does not support fgetspent_r(), write own
+ * wrapper
+ */
+static int fgetspent_r(FILE *fp, struct spwd *spbuf, char *buf, size_t buflen, struct spwd **spbufp) {
+ struct spwd *shadow_entry = fgetspent(fp);
+ if(!shadow_entry)
+ return -1;
+ size_t namplen = strlen(shadow_entry->sp_namp);
+ size_t pwdplen = strlen(shadow_entry->sp_pwdp);
+
+ if(namplen + pwdplen + 2 > buflen)
+ return -1;
+
+ *spbufp = memcpy(spbuf, shadow_entry, sizeof(struct spwd));
+ spbuf->sp_namp = strncpy(buf, shadow_entry->sp_namp, namplen + 1);
+ spbuf->sp_pwdp = strncpy(buf + namplen + 1, shadow_entry->sp_pwdp, pwdplen + 1);
+
+ return 0;
+}
+#endif
+
static struct passwd *
entry_generator_fgetpwent (Daemon *daemon,
GHashTable *users,

40
unity8/click/APKBUILD Normal file
View file

@ -0,0 +1,40 @@
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=click
pkgver=0_git20190129
_commit="cc108942faa348a155e665a5c07828dd36954d6a"
pkgrel=0
pkgdesc="Click is a simplified packaging format"
url="https://github.com/ubports/click"
arch="x86_64"
license="GPL-3.0"
depends=""
depends_dev="libgee-dev gobject-introspection-dev"
makedepends="$depends_dev cmake intltool vala gobject-introspection autoconf libtool automake json-glib-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$_commit.tar.gz::https://github.com/ubports/$pkgname/archive/$_commit.tar.gz"
builddir="$srcdir/$pkgname-$_commit"
options="!check" # Needs dpkg
build() {
cd "$builddir"
./autogen.sh
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--disable-packagekit \
--disable-systemd
make
}
check() {
cd "$builddir"
make check
}
package() {
cd "$builddir"
make DESTDIR="$pkgdir/" PYTHON_INSTALL_FLAGS="--root=$pkgdir/" install
}
sha512sums="c7b2aed6bd14a791cde5ea97d6558c29a6e86e5da48ea15cd008e0811fab254ce6c0e289eb7e00554a5522e1f5562ed0d4e24e057ea4d1bd37b9a11580ef69d7 click-cc108942faa348a155e665a5c07828dd36954d6a.tar.gz"

View file

@ -0,0 +1,31 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=cmake-extras
pkgver=0_git20181002
_commit="f50570d01861ddd38e3eba32fedd870ca1fa6afc"
pkgrel=0
pkgdesc="A collection of add-ons for the CMake build tool"
url="https://github.com/ubports/cmake-extras"
arch="noarch"
license="GPL-3.0"
depends="cmake"
makedepends="cmake"
options="!check" # No testsuite
source="$pkgname-$_commit.tar.gz::https://github.com/ubports/$pkgname/archive/$_commit.tar.gz
Use_gtest_cmake_from_mir.patch
qmlplugindump_path.patch"
builddir="$srcdir/$pkgname-$_commit"
build() {
cd "$builddir"
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr .
make
}
package() {
cd "$builddir"
make DESTDIR="$pkgdir" install
}
sha512sums="a440fb3aaa9a3ada069439e74eebc72811ff994509f71b765fffe4e1a9d925a213bfebd90408d103e0ec476a858d889fed1578ee3c8347f5e1945e4f58c5e2f3 cmake-extras-f50570d01861ddd38e3eba32fedd870ca1fa6afc.tar.gz
996334490e062868b2dd24a0d2d688d95877343ae2db6a06efc580d14ffe1d00f0c9277be0929b9c7c859aef2dea0be68ddc49a7495ad16eaa0a156838f8bca9 Use_gtest_cmake_from_mir.patch
e55bd3ae7372b33534d239f7e959af0eba5687aba0386613381e4f9fc840f89213f5ae92544b7e969943d46e815d49c66fd24c29c44fd4166bb3a6bf81e1ac7e qmlplugindump_path.patch"

View file

@ -0,0 +1,171 @@
diff --git a/src/GMock/GMockConfig.cmake b/src/GMock/GMockConfig.cmake
index 2078030..77ba4a3 100644
--- a/src/GMock/GMockConfig.cmake
+++ b/src/GMock/GMockConfig.cmake
@@ -1,92 +1,77 @@
-# Copyright (C) 2014 Canonical Ltd
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3 as
-# published by the Free Software Foundation.
-#
-# This program 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 program. If not, see <http://www.gnu.org/licenses/>.
-
-# Build with system gmock and embedded gtest
-#
-# Usage:
-#
-# find_package(GMock)
-#
-# ...
-#
-# target_link_libraries(
-# my-target
-# ${GTEST_BOTH_LIBRARIES}
-# )
-#
-# NOTE: Due to the way this package finder is implemented, do not attempt
-# to find the GMock package more than once.
-
-find_package(Threads)
-
-if (EXISTS "/usr/src/googletest")
- # As of version 1.8.0
- set(GMOCK_SOURCE_DIR "/usr/src/googletest/googlemock" CACHE PATH "gmock source directory")
- set(GMOCK_INCLUDE_DIRS "${GMOCK_SOURCE_DIR}/include" CACHE PATH "gmock source include directory")
- set(GTEST_INCLUDE_DIRS "/usr/src/googletest/googletest/include" CACHE PATH "gtest source include directory")
+include(FindPackageHandleStandardArgs)
+
+find_package(GTest)
+
+pkg_check_modules (GTEST REQUIRED "gtest >= 1.8.0")
+pkg_check_modules (GTEST_MAIN REQUIRED "gtest_main >= 1.8.0")
+if (GTEST_FOUND AND GTEST_MAIN_FOUND)
+ set(GTEST_LIBRARY ${GTEST_LIBRARIES})
+ set(GTEST_MAIN_LIBRARY ${GTEST_MAIN_LIBRARIES})
+ set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY})
+endif()
+
+if (NOT GTEST_FOUND)
+ include(ExternalProject)
+
+ find_path(GTEST_ROOT
+ NAMES CMakeLists.txt
+ PATHS /usr/src/gtest /usr/src/googletest/googletest/
+ DOC "Path to GTest CMake project")
+
+ ExternalProject_Add(GTest PREFIX ./gtest
+ SOURCE_DIR ${GTEST_ROOT}
+ CMAKE_ARGS
+ -DCMAKE_CXX_COMPILER_WORKS=1
+ -DCMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS}'
+ -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
+ INSTALL_COMMAND true
+ BUILD_BYPRODUCTS
+ ${CMAKE_CURRENT_BINARY_DIR}/gtest/src/GTest-build/libgtest.a
+ ${CMAKE_CURRENT_BINARY_DIR}/gtest/src/GTest-build/libgtest_main.a
+ ${CMAKE_CURRENT_BINARY_DIR}/gtest/src/GMock-build/libgmock.a)
+
+ ExternalProject_Get_Property(GTest binary_dir)
+
+ add_library(gtest UNKNOWN IMPORTED)
+ set_target_properties(gtest PROPERTIES IMPORTED_LOCATION ${binary_dir}/libgtest.a)
+ add_dependencies(gtest GTest)
+ set(GTEST_LIBRARY "gtest")
+
+ add_library(gtest_main UNKNOWN IMPORTED)
+ set_target_properties(gtest_main PROPERTIES IMPORTED_LOCATION ${binary_dir}/libgtest_main.a)
+ add_dependencies(gtest_main GTest)
+ set(GTEST_MAIN_LIBRARY "gtest_main")
+
+ set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY})
+ find_path(GTEST_INCLUDE_DIRS NAMES gtest/gtest.h)
+ find_package_handle_standard_args(GTest GTEST_LIBRARY GTEST_BOTH_LIBRARIES GTEST_INCLUDE_DIRS)
+endif()
+
+find_file(GMOCK_SOURCE
+ NAMES gmock-all.cc
+ DOC "GMock source"
+ PATHS /usr/src/googletest/googlemock/src/ /usr/src/gmock/ /usr/src/gmock/src)
+
+if (EXISTS ${GMOCK_SOURCE})
+ find_path(GMOCK_INCLUDE_DIR gmock/gmock.h PATHS /usr/src/googletest/googlemock/include)
+
+ add_library(GMock STATIC ${GMOCK_SOURCE})
+
+ if (EXISTS /usr/src/googletest/googlemock/src)
+ set_source_files_properties(${GMOCK_SOURCE} PROPERTIES COMPILE_FLAGS "-I/usr/src/googletest/googlemock")
+ endif()
+
+ if (EXISTS /usr/src/gmock/src)
+ set_source_files_properties(${GMOCK_SOURCE} PROPERTIES COMPILE_FLAGS "-I/usr/src/gmock")
+ endif()
+
+ find_package_handle_standard_args(GMock DEFAULT_MSG GMOCK_INCLUDE_DIR)
+
+ set(GMOCK_LIBRARY GMock)
else()
- set(GMOCK_SOURCE_DIR "/usr/src/gmock" CACHE PATH "gmock source directory")
- set(GMOCK_INCLUDE_DIRS "/usr/include" CACHE PATH "gmock source include directory")
- set(GTEST_INCLUDE_DIRS "/usr/include" CACHE PATH "gtest source include directory")
+ # Assume gmock is no longer source, we'll find out soon enough if that's wrong
+ add_custom_target(GMock)
+ string(REPLACE gtest gmock GMOCK_LIBRARY ${GTEST_LIBRARY})
endif()
-# We add -g so we get debug info for the gtest stack frames with gdb.
-# The warnings are suppressed so we get a noise-free build for gtest and gmock if the caller
-# has these warnings enabled.
-set(findgmock_cxx_flags "${CMAKE_CXX_FLAGS} -g -Wno-old-style-cast -Wno-missing-field-initializers -Wno-ctor-dtor-privacy -Wno-switch-default")
-
-set(findgmock_bin_dir "${CMAKE_CURRENT_BINARY_DIR}/gmock")
-set(findgmock_gtest_lib "${findgmock_bin_dir}/gtest/libgtest.a")
-set(findgmock_gtest_main_lib "${findgmock_bin_dir}/gtest/libgtest_main.a")
-set(findgmock_gmock_lib "${findgmock_bin_dir}/libgmock.a")
-set(findgmock_gmock_main_lib "${findgmock_bin_dir}/libgmock_main.a")
-
-include(ExternalProject)
-ExternalProject_Add(GMock SOURCE_DIR "${GMOCK_SOURCE_DIR}"
- BINARY_DIR "${findgmock_bin_dir}"
- BUILD_BYPRODUCTS "${findgmock_gtest_lib}"
- "${findgmock_gtest_main_lib}"
- "${findgmock_gmock_lib}"
- "${findgmock_gmock_main_lib}"
- INSTALL_COMMAND ""
- CMAKE_ARGS "-DCMAKE_CXX_FLAGS=${findgmock_cxx_flags}")
-
-add_library(gtest INTERFACE)
-target_include_directories(gtest INTERFACE ${GTEST_INCLUDE_DIRS})
-target_link_libraries(gtest INTERFACE ${findgmock_gtest_lib} ${CMAKE_THREAD_LIBS_INIT})
-add_dependencies(gtest GMock)
-
-add_library(gtest_main INTERFACE)
-target_include_directories(gtest_main INTERFACE ${GTEST_INCLUDE_DIRS})
-target_link_libraries(gtest_main INTERFACE ${findgmock_gtest_main_lib} gtest)
-
-add_library(gmock INTERFACE)
-target_include_directories(gmock INTERFACE ${GMOCK_INCLUDE_DIRS})
-target_link_libraries(gmock INTERFACE ${findgmock_gmock_lib} gtest)
-
-add_library(gmock_main INTERFACE)
-target_include_directories(gmock_main INTERFACE ${GMOCK_INCLUDE_DIRS})
-target_link_libraries(gmock_main INTERFACE ${findgmock_gmock_main_lib} gmock)
-
-set(GTEST_LIBRARIES gtest)
-set(GTEST_MAIN_LIBRARIES gtest_main)
-set(GMOCK_LIBRARIES gmock gmock_main)
-set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES})
-
-unset(findgmock_cxx_flags)
-unset(findgmock_bin_dir)
-unset(findgmock_gtest_lib)
-unset(findgmock_gtest_main_lib)
-unset(findgmock_gmock_lib)
-unset(findgmock_gmock_main_lib)
+set(GMOCK_LIBRARIES ${GTEST_BOTH_LIBRARIES} ${GMOCK_LIBRARY})

View file

@ -0,0 +1,13 @@
diff --git a/src/QmlPlugins/QmlPluginsConfig.cmake b/src/QmlPlugins/QmlPluginsConfig.cmake
index f563330..7e326bf 100644
--- a/src/QmlPlugins/QmlPluginsConfig.cmake
+++ b/src/QmlPlugins/QmlPluginsConfig.cmake
@@ -2,7 +2,7 @@
# target before loading this plugin.
if(NOT TARGET qmlplugindump)
- find_program(qmlplugindump_exe qmlplugindump)
+ find_program(qmlplugindump_exe qmlplugindump HINTS /usr/lib/qt5/bin/)
if(NOT qmlplugindump_exe)
msg(FATAL_ERROR "Could not locate qmlplugindump.")

View file

@ -0,0 +1,26 @@
From 96d2928d15ee0506573866f367762c9deea75542 Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Sun, 30 Dec 2018 23:59:16 +0100
Subject: [PATCH] Use qmlplugindump-qt5
Fixes #4
---
import/Ubuntu/Content/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/import/Ubuntu/Content/CMakeLists.txt b/import/Ubuntu/Content/CMakeLists.txt
index 1322309..5cd18bf 100644
--- a/import/Ubuntu/Content/CMakeLists.txt
+++ b/import/Ubuntu/Content/CMakeLists.txt
@@ -95,7 +95,7 @@ endif()
if(NOT CMAKE_CROSSCOMPILING)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes
- COMMAND qmlplugindump -qt=qt5 -noinstantiate -notrelocatable Ubuntu.Content 1.1 ../../ > ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes
+ COMMAND qmlplugindump-qt5 -noinstantiate -notrelocatable Ubuntu.Content 1.1 ../../ > ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes
DEPENDS ${PLUGIN}
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
)
--
2.20.1

View file

@ -0,0 +1,46 @@
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=content-hub
pkgver=0_git20190129
_commit="3f046207beec0441a5e2cd567e63becaafd181eb"
pkgrel=0
pkgdesc="Content sharing/picking infrastructure and service, designed to allow apps to securely and efficiently exchange content"
url="https://github.com/ubports/content-hub"
arch="x86_64"
license="GPL-3.0 LGPL-3.0"
depends=""
depends_dev="qt5-qtdeclarative-dev ubuntu-app-launch-dev gsettings-qt-dev libnih-dev ubuntu-download-manager-dev libnotify-dev libapparmor-dev ubuntu-ui-toolkit-dev"
makedepends="$depends_dev cmake cmake-extras libapparmor"
checkdepends="gtest-dev gmock dbus-test-runner"
options="!check" # 92% tests passed, 1 tests failed out of 12 (xfvb-run script is missing, see https://bugs.alpinelinux.org/issues/9617)
source="$pkgname-$_commit.tar.gz::https://github.com/ubports/$pkgname/archive/$_commit.tar.gz
0001-Use-qmlplugindump-qt5.patch"
subpackages="$pkgname-dev $pkgname-lang"
builddir="$srcdir/$pkgname-$_commit"
prepare() {
default_prepare
# Don't build tests
truncate -s 0 "$builddir"/tests/CMakeLists.txt
}
build() {
mkdir "$builddir"/build
cd "$builddir"/build
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib ..
make
}
check() {
cd "$builddir"/build/tests
CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}
package() {
cd "$builddir"/build
make DESTDIR="$pkgdir" install
}
sha512sums="b0d7b0c7d47941f88e4aa6ce5e57f900419c16d1cbd8efa07dcdd8f50194f4961e6263e59ca37ddb671e4ce6c5aa55d292887765a3f98ea20d40a5c71602d19b content-hub-3f046207beec0441a5e2cd567e63becaafd181eb.tar.gz
f5a13fbbf2a26342a043474b5911ad4949e6b61f36116197e9c614d2e399f4dcb6adbab08376764756d68d45cfd55215dd49aa5cdfe5926b61d928a8424ba767 0001-Use-qmlplugindump-qt5.patch"

43
unity8/geonames/APKBUILD Normal file
View file

@ -0,0 +1,43 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=geonames
pkgver=0_git20180310
pkgrel=0
_commit="5d77e827cd8800e9738f0e8ac2f865a59a9f68b2"
pkgdesc='Geonames'
arch="x86_64"
url='https://unity8.io'
license="GPL-3.0"
depends=""
depends_dev=""
makedepends="$depends_dev gtk-doc autoconf automake libtool"
# See https://github.com/ubports/geonames/issues/1
source="$pkgname-$_commit.tar.gz::http://repo.ubports.com/pool/xenial/main/g/geonames/geonames_0.3+ubports1+0~20180310073020.3~1.gbp5d77e8.tar.gz"
subpackages="$pkgname-dev $pkgname-lang"
options="!check" # Tests fail
builddir="$srcdir/source"
prepare() {
cd "$builddir"
./autogen.sh \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr
}
build() {
make
}
check() {
cd "$builddir"
make check
}
package() {
cd "$builddir"
make DESTDIR="${pkgdir}" install
}
sha512sums="347976e251fa4a48760bae96f3f6326bee06fc799cd989237898a23fb72e49929b202dcd0fd33eaf06dc9a8966f47deedcf105ec402a3125bffdbfd14a4dc5b6 geonames-5d77e827cd8800e9738f0e8ac2f865a59a9f68b2.tar.gz"

View file

@ -0,0 +1,38 @@
From 32d7af4f22bbd99b3bd7775290300dc920f275ac Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Mon, 31 Dec 2018 18:15:02 +0100
Subject: [PATCH] Add missing header include
---
src/MatchUtils.cpp | 2 ++
tests/functional/menus/MenuMain.cpp | 1 +
2 files changed, 3 insertions(+)
diff --git a/src/MatchUtils.cpp b/src/MatchUtils.cpp
index 19f458a..7f2c98e 100644
--- a/src/MatchUtils.cpp
+++ b/src/MatchUtils.cpp
@@ -20,6 +20,8 @@
#include <unity/util/ResourcePtr.h>
+#include <functional>
+
using namespace std;
namespace util = unity::util;
diff --git a/tests/functional/menus/MenuMain.cpp b/tests/functional/menus/MenuMain.cpp
index 5123177..cbc7cbe 100644
--- a/tests/functional/menus/MenuMain.cpp
+++ b/tests/functional/menus/MenuMain.cpp
@@ -25,6 +25,7 @@
#include <iostream>
#include <memory>
+#include <functional>
using namespace std;
using namespace unity::util;
--
2.20.1

View file

@ -0,0 +1,40 @@
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=gmenuharness
pkgver=0_git20161202
_commit="a5380607d3b494fd221add2837f5824327f77dff"
pkgrel=0
pkgdesc="Library to test GMenuModel structures."
url="https://github.com/unity8-team/gmenuharness"
arch="x86_64"
license="LGPL-3.0"
depends=""
depends_dev=""
makedepends="$depends_dev cmake cmake-extras qt5-qtbase-dev unity-api-dev glib-dev gtest-dev gmock libqtdbustest"
checkdepends=""
source="$pkgname-$_commit.tar.gz::https://github.com/unity8-team/$pkgname/archive/$_commit.tar.gz
0001-Add-missing-header-include.patch"
subpackages="$pkgname-dev"
builddir="$srcdir/$pkgname-$_commit"
options="!check" # something with dbus - 0% tests passed, 1 tests failed out of 1
build() {
mkdir "$builddir"/build
cd "$builddir"/build
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib ..
make
}
check() {
cd "$builddir"/build/tests
CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}
package() {
cd "$builddir"/build
make DESTDIR="$pkgdir" install
}
sha512sums="c86f45f94deb106280508b74b2f33ff5aa50c47f98bb6f26587f0c21709abd13dc9bf905857be7510809622b8d10b03facc184d56bd0557630865f93d3d52605 gmenuharness-a5380607d3b494fd221add2837f5824327f77dff.tar.gz
3b4d93b57a6b4c440e98d5dc08e3b1e67857662b12dbee27912f442dc7daffc0b2fb1703da42dba09b2c3d81eaa7a2130aea7c69964abf8f03bf49e5e9cf1712 0001-Add-missing-header-include.patch"

View file

@ -0,0 +1,36 @@
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=gsettings-qt
pkgver=0_git20171026
_commit="3b03880cc40675541d330681e55e0e9787dce99d"
pkgrel=0
pkgdesc="Library to access GSettings from Qt"
url="https://github.com/ubports/gsettings-qt"
arch="x86_64"
license="LGPL-3.0"
depends=""
depends_dev="qt5-qtdeclarative-dev"
makedepends="$depends_dev qt5-qtbase-dev"
subpackages="$pkgname-dev"
source="$pkgname-$_commit.tar.gz::https://github.com/ubports/$pkgname/archive/$_commit.tar.gz
fix_install.patch"
builddir="$srcdir/$pkgname-$_commit"
options="!check" # Requires running X11 server
build() {
cd "$builddir"
qmake-qt5
make -j1 # See https://github.com/ubports/gsettings-qt/issues/2
}
check() {
cd "$builddir"
make check
}
package() {
cd "$builddir"
make INSTALL_ROOT="$pkgdir" install
}
sha512sums="6f0e7522da13ec3f07f2a23458eaab179ff778d367b224b3e648b2a60d4986b2b8b5016ff5fa1fda11c92dc64e8ae5aef40c7b9a72bdbce32fea2786bd007ac8 gsettings-qt-3b03880cc40675541d330681e55e0e9787dce99d.tar.gz
de1dd50997868c67742a23909b3682068e7262991df6f0e27dfd0f2774de26dc07f524f1a0fe335b93ee8044b78ee42e9af8d9a38c03f9cf073e361f6f6c2b08 fix_install.patch"

View file

@ -0,0 +1,16 @@
diff --git a/GSettings/gsettings-qt.pro b/GSettings/gsettings-qt.pro
index 218eeea..6f1cd3e 100644
--- a/GSettings/gsettings-qt.pro
+++ b/GSettings/gsettings-qt.pro
@@ -25,6 +25,10 @@ INSTALLS += extra
qmltypes.path = $$installPath
qmltypes.files = plugins.qmltypes
-qmltypes.extra = export LD_PRELOAD=../src/libgsettings-qt.so.1; $$[QT_INSTALL_BINS]/qmlplugindump -notrelocatable GSettings 1.0 .. > $(INSTALL_ROOT)/$$installPath/plugins.qmltypes
+# TODO: Complain at whoever is responsible for this - I lost an hour debugging this
+# Relative and absolute LD_PRELOAD path doesn't work
+# Relative LD_LIBRARY_PATH doesn't work
+# Absolute LD_LIBRARY_PATH DOES work
+qmltypes.extra = export LD_LIBRARY_PATH=$$PWD/../src; $$[QT_INSTALL_BINS]/qmlplugindump -notrelocatable GSettings 1.0 .. > $(INSTALL_ROOT)/$$installPath/plugins.qmltypes
INSTALLS += qmltypes

View file

@ -0,0 +1,31 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=gsettings-ubuntu-touch-schemas
pkgver=0_git20181006
pkgrel=0
_commit="b3bdf178e4226c91c567b84f1adf9202b2492ca2"
pkgdesc='Collection of GSettings schemas for settings shared by various components of an Ubuntu environment'
arch="noarch"
url='https://unity8.io'
license="LGPL-2.1"
depends=""
makedepends="gnome-common automake autoconf glib-dev intltool"
source="$pkgname-$_commit.tar.gz::https://github.com/ubports/$pkgname/archive/$_commit.tar.gz"
builddir="$srcdir/$pkgname-$_commit"
build() {
cd "$builddir"
./autogen.sh \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--localstatedir=/var
make
}
package() {
cd "$builddir"
make DESTDIR="$pkgdir" install
}
sha512sums="9cb68efeda62d4802345292b75593658eed28e8068aa0361bafdc3c9fd1d4212cf1f0ad8cf9350aa438ecc3c937e1952ea9f89c85be418594e01febe6c8a70c8 gsettings-ubuntu-touch-schemas-b3bdf178e4226c91c567b84f1adf9202b2492ca2.tar.gz"

View file

@ -0,0 +1,39 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=indicator-network
pkgver=0_git20181231
_commit="3cb4ada3d87303e6b981cf1307244f3a88017fec"
pkgrel=0
pkgdesc="The 'Network' indicator for Ubuntu Touch"
arch="x86_64"
url="https://unity8.io"
license="GPL-3.0"
depends=""
depends_dev="glib-dev unity-api-dev ofono-dev networkmanager-dev libsecret-dev url-dispatcher-dev qt5-qtdeclarative-dev libqofono-dev"
makedepends="$depends_dev cmake-extras gtest-dev gmock libqtdbustest libqtdbusmock gmenuharness-dev"
source="$pkgname-$_commit.tar.gz::https://github.com/ubports/$pkgname/archive/$_commit.tar.gz"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
builddir="$srcdir/$pkgname-$_commit"
options="!check" # Tests hang
build() {
mkdir -p "$builddir"/build
cd "$builddir"/build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib ..
make
}
check() {
cd "$builddir"/build
CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}
package() {
cd "$builddir"/build
make DESTDIR="$pkgdir" install
}
sha512sums="a5ce04d9a896b2887592caf6f3bab8962569cdc5ba09a77c7799ce42b1b3cc78f8f2bb66d704a9b1487784755854188dcf012ca0515cdd79e418c51afad78b72 indicator-network-3cb4ada3d87303e6b981cf1307244f3a88017fec.tar.gz"

View file

@ -0,0 +1,36 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=libqtdbusmock
pkgver=0_git20181013
_commit="f3ac84e2f3c005ae59a10a392c1b2ad4b8e6c528"
pkgrel=0
pkgdesc="Library for mocking DBus interactions using Qt"
url="https://github.com/ubports/libqtdbusmock"
arch="x86_64"
license="LGPL-3.0"
depends=""
makedepends="cmake cmake-extras libqtdbustest networkmanager-dev qt5-qtbase-dev gtest-dev gmock"
checkdepends="py3-dbusmock"
source="$pkgname-$_commit.tar.gz::https://github.com/ubports/$pkgname/archive/$_commit.tar.gz
no_coverage.patch"
builddir="$srcdir/$pkgname-$_commit"
options="!check" # 0% tests passed, 1 tests failed out of 1
build() {
cd "$builddir"
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib .
make
}
check() {
cd "$builddir"
CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}
package() {
cd "$builddir"
make DESTDIR="$pkgdir" install
}
sha512sums="d59ce4258ce1e26896c533ed0aa99bb3f30d731ca55d7742bd635edef6c8c0ee82343b3e960effa8a58ed9268de8e870dbeaafaf420a08a49aea1f9cbc294ac7 libqtdbusmock-f3ac84e2f3c005ae59a10a392c1b2ad4b8e6c528.tar.gz
b5a5616c00b7da8cb7ed5c1129a63372a8760412143b3cc3d57efe2e23ba1aa7d9a75c3f82b6b72eb5e2b12973a1b5a252aa77e557e74f8b9d7bcf94f0421942 no_coverage.patch"

View file

@ -0,0 +1,19 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,16 +68,3 @@
check
${CMAKE_CTEST_COMMAND} --force-new-ctest-process --output-on-failure
)
-
-find_package(CoverageReport)
-enable_coverage_report(
- TARGETS
- qtdbusmock
- unit-tests
- FILTER
- ${CMAKE_SOURCE_DIR}/tests/*
- ${CMAKE_BINARY_DIR}/*
- TESTS
- unit-tests
-)
-

View file

@ -0,0 +1,36 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=libqtdbustest
pkgver=0_git20180611
_commit="24e410ea77c9fa08894365c60bf08811a3b60bc0"
pkgrel=0
pkgdesc='Library for testing DBus interactions using Qt'
url='https://github.com/ubports/libqtdbustest'
arch="x86_64"
license=LGPL-3.0
depends=""
makedepends="cmake cmake-extras gmock gtest-dev qt5-qtbase-dev"
checkdepends="procps py3-dbusmock dbus-x11"
source="$pkgname-$_commit.tar.gz::https://github.com/ubports/$pkgname/archive/$_commit.tar.gz
SuicidalSleep.patch"
builddir="$srcdir/$pkgname-$_commit"
build() {
cd "$builddir"
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_INSTALL_LIBEXECDIR=lib .
make
}
check() {
cd "$builddir"
CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}
package() {
cd "$builddir"
make DESTDIR="$pkgdir" install
}
sha512sums="e587a3342879cf11543529cf2e6ad9f6266963afdad29f91bcf2742086cb9f889eca36f335280a658ecbf9a5e5319154e0b7ea842a008b3d2fb7740488ed442e libqtdbustest-24e410ea77c9fa08894365c60bf08811a3b60bc0.tar.gz
4ce1c9a23784412b7e171129db2dc13e39a515249edc73bdbd835996d76670eeafead55dbaa197ec8614d560038f6bf9fa999be3e5989d4d7134172e9dcf25bb SuicidalSleep.patch"

View file

@ -0,0 +1,13 @@
diff --git a/tests/libqtdbustest/TestSuicidalProcess.cpp b/tests/libqtdbustest/TestSuicidalProcess.cpp
index 3bdaeea..fa1e4eb 100644
--- a/tests/libqtdbustest/TestSuicidalProcess.cpp
+++ b/tests/libqtdbustest/TestSuicidalProcess.cpp
@@ -51,7 +51,7 @@ TEST_F(TestSuicidalProcess, BehavesLikeNormalQProcess) {
pgrep.waitForFinished();
pgrep.waitForReadyRead();
- EXPECT_EQ("sleep 5",
+ EXPECT_EQ("/bin/sleep 5",
QString::fromUtf8(pgrep.readAll().trimmed()).toStdString());
}

View file

@ -0,0 +1,49 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=libusermetrics
pkgver=0_git20180919
_commit="a50ce9f3d4c428646c0a7063e11c7dff82d5983b"
pkgrel=0
pkgdesc='Library for exporting anonymous metrics about users'
arch="x86_64"
url="https://unity8.io"
license="GPL-3.0 LGPL-3.0 LGPL-2.1"
depends=""
depends_dev="qt5-qtxmlpatterns-dev libapparmor-dev gsettings-qt-dev qt5-qtdeclarative-dev click-dev qdjango-dev"
makedepends="$depends_dev cmake-extras qt5-qtbase-dev libapparmor libqtdbustest intltool"
source="$pkgname-$_commit.tar.gz::https://github.com/ubports/$pkgname/archive/$_commit.tar.gz
fix_linking.patch"
subpackages="$pkgname-dev $pkgname-lang"
builddir="$srcdir/$pkgname-$_commit"
prepare() {
default_prepare
mkdir "$builddir"/build
# Don't build tests
truncate -s 0 "$builddir"/tests/CMakeLists.txt
}
build() {
cd "$builddir"/build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DWerror=OFF ..
make
}
check() {
cd "$builddir"/build
CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}
package() {
cd "$builddir"/build
make DESTDIR="$pkgdir" install
}
sha512sums="d3863df6b68c8fac0f2afc70dff943f8db293aaffea61031b8d3242f5652a8d55994172b32defaccfe825922d7980bb59f610f06ec16bffbf5bf54aa725c2ad5 libusermetrics-a50ce9f3d4c428646c0a7063e11c7dff82d5983b.tar.gz
f1ff2e49c67507cc8930e14f63c49e67bbc259d9fccf074999f18c5f2017dc34c4830aa350cf5f27e10e3ba43794b2d3d184c74a1ce0807ba59d775fa2383a33 fix_linking.patch"

View file

@ -0,0 +1,19 @@
diff --git a/src/libusermetricsinput/CMakeLists.txt b/src/libusermetricsinput/CMakeLists.txt
index bf3262e..47b7346 100644
--- a/src/libusermetricsinput/CMakeLists.txt
+++ b/src/libusermetricsinput/CMakeLists.txt
@@ -79,6 +79,7 @@ qt5_use_modules(
target_link_libraries(
usermetricsinput
usermetricscommon
+ intl
)
set_target_properties(
@@ -157,5 +158,6 @@ qt5_use_modules(
target_link_libraries(
usermetricsinput-increment
usermetricsinput
+ intl
)

View file

@ -0,0 +1,46 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=location-service
pkgver=0_git20180614
pkgrel=0
_commit="142f6ca0e4243448a43110453d22dae31f57b617"
pkgdesc="Location service aggregating position/velocity/heading updates and exporting them over dbus"
arch="x86_64"
url="https://unity8.io"
license="GPL-3.0 LGPL-3.0"
depends=""
depends_dev="boost-dev dbus-dev net-cpp-dev process-cpp-dev properties-cpp-dev json-c-dev libapparmor-dev gflags-dev glog-dev trust-store-dev"
makedepends="$depends_dev cmake-extras gettext gtest-dev gmock dbus-cpp-dev"
source="$pkgname-$_commit.tar.gz::https://github.com/ubports/$pkgname/archive/$_commit.tar.gz
missing_includes.patch"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
options="!check" # Several failures
builddir="$srcdir/$pkgname-$_commit"
prepare() {
default_prepare
mkdir -p "$builddir"/build
}
build() {
cd "$builddir"/build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DLOCATION_SERVICE_ENABLE_GPS_PROVIDER=OFF ..
make
}
check() {
cd "$builddir"/build
CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}
package() {
cd "$builddir"/build
make DESTDIR="$pkgdir" install
}
sha512sums="07fc5288370290cdfa1d8af5b14ef8f682ea899027be8d91bdd084fd58ccffbf946aa4dd9a2d654ec8f93ba6c47350f7e4a313646d8baba48f1e5305100de433 location-service-142f6ca0e4243448a43110453d22dae31f57b617.tar.gz
e22591651b49f222487203cc292b592d6dbcc485ac1731977ad1354bd14cbcef7a054ae188f5d09da5da2def1a491aa902da58d2057f9dad69d7fedd39e5cf04 missing_includes.patch"

View file

@ -0,0 +1,12 @@
diff --git a/include/location_service/com/ubuntu/location/service/permission_manager.h b/include/location_service/com/ubuntu/location/service/permission_manager.h
index 73b79bd..045a83d 100644
--- a/include/location_service/com/ubuntu/location/service/permission_manager.h
+++ b/include/location_service/com/ubuntu/location/service/permission_manager.h
@@ -19,6 +19,7 @@
#define LOCATION_SERVICE_COM_UBUNTU_LOCATION_SERVICE_PERMISSION_MANAGER_H_
#include <memory>
+#include <sys/types.h>
namespace com
{

View file

@ -0,0 +1,24 @@
From 5cb89550f709c911f28bb4f50f32598ceb8f11cd Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Mon, 7 Jan 2019 17:26:54 +0100
Subject: [PATCH 1/7] Add missing include (#681)
---
tests/include/mir_test_framework/open_wrapper.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/include/mir_test_framework/open_wrapper.h b/tests/include/mir_test_framework/open_wrapper.h
index 560f911298..cc4a4a4ce7 100644
--- a/tests/include/mir_test_framework/open_wrapper.h
+++ b/tests/include/mir_test_framework/open_wrapper.h
@@ -21,6 +21,7 @@
#include <functional>
#include <memory>
#include <experimental/optional>
+#include <sys/stat.h>
namespace mir_test_framework
{
--
2.20.1

View file

@ -0,0 +1,46 @@
From 2abb20e48c245e41934f77c2917e8cb90ad890db Mon Sep 17 00:00:00 2001
From: Alan Griffiths <alan@octopull.co.uk>
Date: Sat, 12 Jan 2019 14:54:30 +0100
Subject: [PATCH 2/7] Don't hardcode request type for ioctl()
---
.../privileged-tests/ui_get_sysname_ioctl_override.cpp | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/tests/privileged-tests/ui_get_sysname_ioctl_override.cpp b/tests/privileged-tests/ui_get_sysname_ioctl_override.cpp
index 89d9f2cc9e..98b2c7d3db 100644
--- a/tests/privileged-tests/ui_get_sysname_ioctl_override.cpp
+++ b/tests/privileged-tests/ui_get_sysname_ioctl_override.cpp
@@ -43,6 +43,8 @@
#include <string>
#include <iostream>
+#include <sys/ioctl.h>
+#include <linux/ioctl.h>
#include <linux/uinput.h>
#include <dlfcn.h>
#include <dirent.h>
@@ -91,14 +93,18 @@ bool request_is_ui_get_sysname(unsigned long int request)
static_cast<unsigned long>(UI_GET_SYSNAME(0));
}
+template<typename Param1>
+auto request_param_type(int (*ioctl)(int, Param1, ...)) -> Param1;
}
-extern "C" int ioctl(int fd, unsigned long int request, ...) __THROW
+using ioctl_request_t = decltype(request_param_type(&ioctl));
+
+extern "C" int ioctl(int fd, ioctl_request_t request, ...) noexcept
{
va_list vargs;
va_start(vargs, request);
- using ioctl_func = int(*)(int, unsigned long int, void*);
+ using ioctl_func = decltype(&ioctl);
static ioctl_func const real_ioctl =
reinterpret_cast<ioctl_func>(dlsym(RTLD_NEXT, "ioctl"));
--
2.20.1

View file

@ -0,0 +1,44 @@
From cc862ef9a703782f7fc8a9a20dbfde882776b9b7 Mon Sep 17 00:00:00 2001
From: Alan Griffiths <alan@octopull.co.uk>
Date: Wed, 9 Jan 2019 10:35:34 +0100
Subject: [PATCH 3/7] Suppress the compiler diagnostic on Alpine Linux caused
by a mismatch between the signed type of the ioctl() request parameter and
the unsigned type returned by EVIOCGPROP. (See #692)
---
src/platforms/evdev/evdev_device_detection.cpp | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/platforms/evdev/evdev_device_detection.cpp b/src/platforms/evdev/evdev_device_detection.cpp
index f771f1f234..cf844a7f83 100644
--- a/src/platforms/evdev/evdev_device_detection.cpp
+++ b/src/platforms/evdev/evdev_device_detection.cpp
@@ -48,6 +48,16 @@ struct DeviceInfo
uint8_t property_bit_mask[(INPUT_PROP_MAX+1)/8];
};
+namespace
+{
+// On Alpine Linux there's a mismatch between the signed type of the ioctl() request parameter and the
+// unsigned type returned by EVIOCGPROP. (See #692)
+// We use a bit of magic to suppress the compiler diagnostic.
+template<typename Param1>
+auto request_param_type(int (*ioctl)(int, Param1, ...)) -> Param1;
+using ioctl_request_t = decltype(request_param_type(&ioctl));
+}
+
DeviceInfo::DeviceInfo(mir::Fd const& fd)
{
auto const get_bitmask = [&](int bit, size_t size, uint8_t* buf) -> void
@@ -62,7 +72,7 @@ DeviceInfo::DeviceInfo(mir::Fd const& fd)
get_bitmask(EV_ABS, sizeof abs_bit_mask, abs_bit_mask);
get_bitmask(EV_SW, sizeof sw_bit_mask, sw_bit_mask);
- if (ioctl(fd, EVIOCGPROP(sizeof property_bit_mask), property_bit_mask) < 1)
+ if (ioctl(fd, static_cast<ioctl_request_t>(EVIOCGPROP(sizeof property_bit_mask)), property_bit_mask) < 1)
BOOST_THROW_EXCEPTION(
std::system_error(std::error_code(errno, std::system_category()), "Failed to query devices properties"));
}
--
2.20.1

View file

@ -0,0 +1,25 @@
From 65849eebc52c5712a966242bbd5eebcbba4238dd Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Wed, 9 Jan 2019 17:05:47 +0100
Subject: [PATCH 4/7] <sys/poll.h> include is incorrect, use <poll.h>
---
examples/example-server-lib/decoration_provider.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/examples/example-server-lib/decoration_provider.cpp b/examples/example-server-lib/decoration_provider.cpp
index 7fbcbb6772..4458f57316 100644
--- a/examples/example-server-lib/decoration_provider.cpp
+++ b/examples/example-server-lib/decoration_provider.cpp
@@ -25,7 +25,7 @@
#include <ft2build.h>
#include FT_FREETYPE_H
-#include <sys/poll.h>
+#include <poll.h>
#include <sys/eventfd.h>
#include <locale>
#include <codecvt>
--
2.20.1

View file

@ -0,0 +1,25 @@
From 100cbb05ba1f30b800c67bacbb7dc104f6a44194 Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Thu, 10 Jan 2019 09:09:17 +0000
Subject: [PATCH 5/7] Fix "unused parameter 'type'" warning/error on musl
---
src/common/posix_rw_mutex.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/common/posix_rw_mutex.cpp b/src/common/posix_rw_mutex.cpp
index f52c423480..4e26ee6a56 100644
--- a/src/common/posix_rw_mutex.cpp
+++ b/src/common/posix_rw_mutex.cpp
@@ -100,6 +100,8 @@ mir::PosixRWMutex::PosixRWMutex(Type type)
std::system_category(),
"Failed to set preferred rw-lock mode"}));
}
+#else
+ (void)type;
#endif
err = pthread_rwlock_init(&mutex, &attr);
--
2.20.1

View file

@ -0,0 +1,83 @@
From 90ed6b991b0cf11599ac6ede2e03d952368d588d Mon Sep 17 00:00:00 2001
From: William Wold <wm@wmww.sh>
Date: Sat, 12 Jan 2019 14:58:44 +0100
Subject: [PATCH 6/7] William enters the dlvsym fray
---
src/common/sharedlibrary/CMakeLists.txt | 27 +++++++++++++++++++++
src/common/sharedlibrary/shared_library.cpp | 9 +++++++
2 files changed, 36 insertions(+)
diff --git a/src/common/sharedlibrary/CMakeLists.txt b/src/common/sharedlibrary/CMakeLists.txt
index 0889ccc2f3..27436c5701 100644
--- a/src/common/sharedlibrary/CMakeLists.txt
+++ b/src/common/sharedlibrary/CMakeLists.txt
@@ -14,6 +14,33 @@
#
# Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
+include(CheckCXXSymbolExists)
+
+list(APPEND CMAKE_REQUIRED_LIBRARIES dl)
+list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
+
+check_cxx_symbol_exists("dlvsym" "dlfcn.h" HAS_DLVSYM)
+check_cxx_symbol_exists("dlsym" "dlfcn.h" HAS_DLSYM)
+
+if (NOT HAS_DLVSYM)
+ if (NOT HAS_DLSYM)
+ message(
+ FATAL_ERROR
+ "Could not detect dlvsym or dlsym"
+ )
+ endif()
+
+ set_source_files_properties (
+ "shared_library.cpp"
+ PROPERTIES COMPILE_DEFINITIONS MIR_DONT_USE_DLVSYM="1"
+ )
+
+ message(
+ WARNING
+ "dlvsym() not supported by libc. Mir may attempt to load ABI-incompatible platform modules"
+ )
+endif()
+
add_library(mirsharedsharedlibrary OBJECT
module_deleter.cpp
shared_library.cpp
diff --git a/src/common/sharedlibrary/shared_library.cpp b/src/common/sharedlibrary/shared_library.cpp
index c97e26b040..80cbdb4186 100644
--- a/src/common/sharedlibrary/shared_library.cpp
+++ b/src/common/sharedlibrary/shared_library.cpp
@@ -17,6 +17,7 @@
*/
#include "mir/shared_library.h"
+#include <mir/log.h>
#include <boost/throw_exception.hpp>
#include <boost/exception/info.hpp>
@@ -56,6 +57,13 @@ void* mir::SharedLibrary::load_symbol(char const* function_name) const
void* mir::SharedLibrary::load_symbol(char const* function_name, char const* version) const
{
+ // Some libc implementations (such as musl) do not support dlvsym
+
+#ifdef MIR_DONT_USE_DLVSYM
+ // Load the function without checking the version
+ log_debug("Cannot check \"%s\" symbol version is \"%s\": dlvsym() is unavailable", function_name, version);
+ return load_symbol(function_name);
+#else
if (void* result = dlvsym(so, function_name, version))
{
return result;
@@ -64,4 +72,5 @@ void* mir::SharedLibrary::load_symbol(char const* function_name, char const* ver
{
BOOST_THROW_EXCEPTION(std::runtime_error(dlerror()));
}
+#endif
}
--
2.20.1

View file

@ -0,0 +1,166 @@
From ab4b2a5863f475a39485cf1a6931418c2510981a Mon Sep 17 00:00:00 2001
From: Alan Griffiths <alan@octopull.co.uk>
Date: Sat, 12 Jan 2019 14:59:59 +0100
Subject: [PATCH 7/7] ifdef pthread_getname_np as musl doesn't have it
---
tests/CMakeLists.txt | 7 +++++++
tests/mir_test/CMakeLists.txt | 6 ++++++
tests/mir_test/current_thread_name.cpp | 5 +++++
tests/unit-tests/CMakeLists.txt | 18 +++++++++++++++++-
.../dispatch/test_threaded_dispatcher.cpp | 9 ++++++---
.../frontend/test_basic_connector.cpp | 4 ++++
6 files changed, 45 insertions(+), 4 deletions(-)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 2f4b848a59..05f9e596ea 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -105,6 +105,13 @@ endif()
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-lto")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-lto")
+include(CheckSymbolExists)
+list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
+list(APPEND CMAKE_REQUIRED_LIBRARIES "-lpthread")
+string(REPLACE " -Werror " " " CMAKE_C_FLAGS ${CMAKE_C_FLAGS}) # This flag breaks check_symbol_exists()
+check_symbol_exists(pthread_getname_np pthread.h HAVE_PTHREAD_GETNAME_NP)
+list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "-lpthread")
+
if (MIR_BUILD_PLATFORM_MESA_KMS)
add_definitions(-DMIR_BUILD_PLATFORM_MESA_KMS)
endif()
diff --git a/tests/mir_test/CMakeLists.txt b/tests/mir_test/CMakeLists.txt
index 4eb15aefed..1f9a464abd 100644
--- a/tests/mir_test/CMakeLists.txt
+++ b/tests/mir_test/CMakeLists.txt
@@ -23,3 +23,9 @@ add_library(mir-test-static STATIC
wait_object.cpp
$<TARGET_OBJECTS:mir-public-test>
)
+
+if (NOT HAVE_PTHREAD_GETNAME_NP)
+ set_source_files_properties (current_thread_name.cpp PROPERTIES COMPILE_DEFINITIONS MIR_DONT_USE_PTHREAD_GETNAME_NP
+ )
+ message(WARNING "pthread_getname_np() not supported by libc. Stubbing out mir::test::current_thread_name() that relies on it")
+endif()
diff --git a/tests/mir_test/current_thread_name.cpp b/tests/mir_test/current_thread_name.cpp
index 26edf0a708..a3c05e36cc 100644
--- a/tests/mir_test/current_thread_name.cpp
+++ b/tests/mir_test/current_thread_name.cpp
@@ -19,13 +19,18 @@
#include "mir/test/current_thread_name.h"
#include <pthread.h>
+#include <stdexcept>
std::string mir::test::current_thread_name()
{
+#ifndef MIR_DONT_USE_PTHREAD_GETNAME_NP
static size_t const max_thread_name_size = 16;
char thread_name[max_thread_name_size];
pthread_getname_np(pthread_self(), thread_name, sizeof thread_name);
return {thread_name};
+#else
+ throw std::logic_error("mir::test::current_thread_name() is not supported on this system");
+#endif
}
diff --git a/tests/unit-tests/CMakeLists.txt b/tests/unit-tests/CMakeLists.txt
index 5bfd401cdc..23e801b03f 100644
--- a/tests/unit-tests/CMakeLists.txt
+++ b/tests/unit-tests/CMakeLists.txt
@@ -61,7 +61,6 @@ set(
shared_library_test.cpp
test_raii.cpp
test_variable_length_array.cpp
- test_thread_name.cpp
test_default_emergency_cleanup.cpp
test_thread_safe_list.cpp
test_fatal.cpp
@@ -77,6 +76,12 @@ set(
test_edid.cpp
)
+if (HAVE_PTHREAD_GETNAME_NP)
+ list(APPEND UNIT_TEST_SOURCES test_thread_name.cpp)
+else()
+ message(WARNING "pthread_getname_np() not supported: Omitting test_thread_name.cpp which relies on it")
+endif()
+
CMAKE_DEPENDENT_OPTION(
MIR_RUN_UNIT_TESTS
"Run unit tests as part of default testing"
@@ -101,6 +106,17 @@ add_subdirectory(dispatch/)
add_subdirectory(renderers/gl)
add_subdirectory(wayland/)
+if (NOT HAVE_PTHREAD_GETNAME_NP)
+ set_source_files_properties (
+ ${CMAKE_CURRENT_SOURCE_DIR}/dispatch/test_threaded_dispatcher.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/frontend/test_basic_connector.cpp
+
+ PROPERTIES COMPILE_DEFINITIONS MIR_DONT_USE_PTHREAD_GETNAME_NP
+ )
+ message(WARNING "pthread_getname_np() not supported: Disabling test_threaded_dispatcher.cpp tests that rely on it")
+ message(WARNING "pthread_getname_np() not supported: Disabling test_basic_connector.cpp tests that rely on it")
+endif()
+
link_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
mir_add_wrapped_executable(mir_unit_tests NOINSTALL
diff --git a/tests/unit-tests/dispatch/test_threaded_dispatcher.cpp b/tests/unit-tests/dispatch/test_threaded_dispatcher.cpp
index 2ac50b1002..382699ab35 100644
--- a/tests/unit-tests/dispatch/test_threaded_dispatcher.cpp
+++ b/tests/unit-tests/dispatch/test_threaded_dispatcher.cpp
@@ -19,6 +19,7 @@
#include "mir/dispatch/threaded_dispatcher.h"
#include "mir/dispatch/dispatchable.h"
#include "mir/fd.h"
+#include "mir/test/current_thread_name.h"
#include "mir/test/death.h"
#include "mir/test/pipe.h"
#include "mir/test/signal.h"
@@ -278,7 +279,11 @@ TEST_F(ThreadedDispatcherDeathTest, exceptions_in_threadpool_trigger_termination
}, KilledBySignal(SIGABRT), (std::string{".*"} + exception_msg + ".*").c_str());
}
+#ifndef MIR_DONT_USE_PTHREAD_GETNAME_NP
TEST_F(ThreadedDispatcherTest, sets_thread_names_appropriately)
+#else
+TEST_F(ThreadedDispatcherTest, DISABLED_sets_thread_names_appropriately)
+#endif
{
using namespace testing;
using namespace std::chrono_literals;
@@ -290,9 +295,7 @@ TEST_F(ThreadedDispatcherTest, sets_thread_names_appropriately)
auto dispatchable = std::make_shared<mt::TestDispatchable>([dispatched, &dispatch_count]()
{
- char buffer[80] = {0};
- pthread_getname_np(pthread_self(), buffer, sizeof(buffer));
- EXPECT_THAT(buffer, StartsWith(threadname_base));
+ EXPECT_THAT(mt::current_thread_name(), StartsWith(threadname_base));
if (++dispatch_count == threadcount)
{
diff --git a/tests/unit-tests/frontend/test_basic_connector.cpp b/tests/unit-tests/frontend/test_basic_connector.cpp
index 5c553c91d8..623cf98184 100644
--- a/tests/unit-tests/frontend/test_basic_connector.cpp
+++ b/tests/unit-tests/frontend/test_basic_connector.cpp
@@ -41,7 +41,11 @@ struct StubConnectorReport : mir::report::null::ConnectorReport
}
+#ifndef MIR_DONT_USE_PTHREAD_GETNAME_NP
TEST(BasicConnector, names_ipc_threads)
+#else
+TEST(BasicConnector, DISABLED_names_ipc_threads)
+#endif
{
using namespace testing;
--
2.20.1

58
unity8/mir/APKBUILD Normal file
View file

@ -0,0 +1,58 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=mir
pkgver=1.1.0
pkgrel=0
pkgdesc="Canonical's display server"
url="https://mir-server.io"
arch="x86_64"
license="GPL-2.0 GPL-3.0 LGPL-2.1 LGPL-3.0"
depends="xkeyboard-config dmz-cursor-theme ttf-freefont"
depends_dev="boost-dev mesa-dev glm-dev protobuf-dev glog-dev gflags-dev eudev-dev glib-dev wayland-dev libepoxy-dev nettle-dev libinput-dev
capnproto-dev libxml++-2.6-dev py3-pillow freetype-dev libevdev-dev umockdev-dev lttng-ust-dev yaml-cpp-dev libxcursor-dev"
makedepends="$depends_dev cmake libxkbcommon-dev gtest-dev gmock clang-dev"
source="https://github.com/MirServer/mir/releases/download/v$pkgver/mir-$pkgver.tar.xz
0001-Add-missing-include-681.patch
0002-Don-t-hardcode-request-type-for-ioctl.patch
0003-Suppress-the-compiler-diagnostic-on-Alpine-Linux-cau.patch
0004-sys-poll.h-include-is-incorrect-use-poll.h.patch
0005-Fix-unused-parameter-type-warning-error-on-musl.patch
0006-William-enters-the-dlvsym-fray.patch
0007-ifdef-pthread_getname_np-as-musl-doesn-t-have-it.patch
no-werror.patch
ioctl_clang.patch"
subpackages="$pkgname-dev"
options="!check" # Some tests fail
build() {
cd "$builddir"
export CC=clang
export CXX=clang++
cmake \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DMIR_USE_LD=ld
make
}
check() {
cd "$builddir"
bin/mir_acceptance_tests
bin/mir_integration_tests
bin/mir_unit_tests
}
package() {
cd "$builddir"
make DESTDIR="$pkgdir/" install
}
sha512sums="6120ee84a0261a672e800d12e8836fc32f2bd24eb85bea703dc32adf1af94ef07b81a2e9d67d9687c68406392e249987d70987a80014bf8010c855002660cee4 mir-1.1.0.tar.xz
9141613b5078cdce5b57a2f9e2c1bfec53996cf93e58a5522340420b9eba9c85e5cf72428e6bac0da886f27e32bb850ef468077b9f3814f6b87d427b7b9333a3 0001-Add-missing-include-681.patch
737f6dcc91ce6fd94059c08e481b5e54e81207019ffb86c8c8de237c4632edb7842a05297d25e38aa71e9ef0993c9be8a650030d9a7f328ee6f6618be7cf03ed 0002-Don-t-hardcode-request-type-for-ioctl.patch
4881969d4c373461d08df39d94d38a14e8a9b5ad4bf37bde4f3d7a3ef87d7df5342a35d98e564961158b5811ce293bff7c780fd98c333787c1914ab9d6cc4bec 0003-Suppress-the-compiler-diagnostic-on-Alpine-Linux-cau.patch
561d80f7f40acd8cd92aa22bcd2d5537f3d686d1d4b77209e8633980b593a2103c4a0d1e4ccfeab34c31d7578013f52d705a933e79ef23c9944d133e93342c85 0004-sys-poll.h-include-is-incorrect-use-poll.h.patch
26b14f5fd1a340a2163dc97d1be84d457022c4aaf2b6c25163a88cf21fb755ee87a95dd3dde02647fcece3ddc00f4542e89358ad2cdb782c6579255a10744210 0005-Fix-unused-parameter-type-warning-error-on-musl.patch
b8aedaf28ba7bb06823628cb3428ec4acd8da0955ace5d022423db0537ce5db568e016c1c6e6df808d2c7b10bf0fb2fc850788bcf90c8ca6411fe28b4843e4e9 0006-William-enters-the-dlvsym-fray.patch
6b974cc9beb50c2700cce70a615040d6e2639c921019ce801d0cb1e850454951df0e49509d5b4252180d7dc016389177e2703cc034824e3b1971d7dbe1a9e0b0 0007-ifdef-pthread_getname_np-as-musl-doesn-t-have-it.patch
6369c55842c5c2a4eb4970dcafa7f09c36bb1bcaf85d20f3e021f741e7097def3685a96841e9d0a9bd5fdfdfc3016192fdacc751d3e861b51689940fc079e054 no-werror.patch
31e87b7dafcb7e59c420b5ebc1cc6f8002f3491a89f38ee7c1aa31fe7f9c667080e15ef69bed10ba5408ef98bae0454e077b0ba67ededa3199801aa32f1e5166 ioctl_clang.patch"

View file

@ -0,0 +1,13 @@
diff --git a/tests/privileged-tests/ui_get_sysname_ioctl_override.cpp b/tests/privileged-tests/ui_get_sysname_ioctl_override.cpp
index 98b2c7d3db..a4760875d6 100644
--- a/tests/privileged-tests/ui_get_sysname_ioctl_override.cpp
+++ b/tests/privileged-tests/ui_get_sysname_ioctl_override.cpp
@@ -99,7 +99,7 @@ auto request_param_type(int (*ioctl)(int, Param1, ...)) -> Param1;
using ioctl_request_t = decltype(request_param_type(&ioctl));
-extern "C" int ioctl(int fd, ioctl_request_t request, ...) noexcept
+extern "C" int ioctl(int fd, ioctl_request_t request, ...)
{
va_list vargs;
va_start(vargs, request);

View file

@ -0,0 +1,24 @@
From 5568035c1b6fd208716787e242ef5cfd32caae7e Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Thu, 27 Sep 2018 11:49:06 +0200
Subject: [PATCH] Remove -Werror from CMakeLists.txt
---
CMakeLists.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4879c94b8c..da9a14b50d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -66,8 +66,8 @@ set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread -g -Werror -Wall -pedantic -Wextra -fPIC")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -g -std=c++14 -Werror -Wall -fno-strict-aliasing -pedantic -Wnon-virtual-dtor -Wextra -fPIC")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread -g -Wall -pedantic -Wextra -fPIC")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -g -std=c++14 -Wall -fno-strict-aliasing -pedantic -Wnon-virtual-dtor -Wextra -fPIC")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--as-needed")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--as-needed")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed")

View file

@ -0,0 +1,37 @@
From 1289c8754848b1b95d89037aea6ddf3bde3534db Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Sat, 12 Jan 2019 14:12:54 +0100
Subject: [PATCH 1/3] Use proper GTest
---
CMakeLists.txt | 2 --
tests/CMakeLists.txt | 2 +-
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d5076b4..e6e5485 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -84,6 +84,4 @@ add_subdirectory(examples/)
#### Enable tests
include(CTest)
-set(GTEST_ROOT /usr/src/gtest)
add_subdirectory(tests/)
-add_subdirectory(${GTEST_ROOT} ${CMAKE_CURRENT_BINARY_DIR}/gtest)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 2b7204f..659510c 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,7 +1,7 @@
find_package(PkgConfig REQUIRED)
pkg_check_modules(PROCESS_CPP process-cpp REQUIRED)
-include_directories(${GTEST_ROOT}/src)
+find_package(GTest)
include_directories(${PROCESS_CPP_INCLUDE_DIRS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11")
--
2.20.1

View file

@ -0,0 +1,48 @@
From 3e44a0e6b759f1cc5483e73efd9a3e50a276fdb3 Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Sat, 12 Jan 2019 14:13:21 +0100
Subject: [PATCH 2/3] Use getenv instead of secure_getenv
---
src/bridge/bridge.h | 4 ++--
src/ubuntu/application/base_module.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/bridge/bridge.h b/src/bridge/bridge.h
index c972e6a..eafacbd 100644
--- a/src/bridge/bridge.h
+++ b/src/bridge/bridge.h
@@ -44,7 +44,7 @@ class HIDDEN_SYMBOL Bridge
void* resolve_symbol(const char* symbol, const char* module = "") const
{
- static const char* test_modules = secure_getenv("UBUNTU_PLATFORM_API_TEST_OVERRIDE");
+ static const char* test_modules = getenv("UBUNTU_PLATFORM_API_TEST_OVERRIDE");
if (test_modules && strstr(test_modules, module)) {
printf("Platform API: INFO: Overriding symbol '%s' with test version\n", symbol);
return Scope::dlsym_fn(lib_override_handle, symbol);
@@ -57,7 +57,7 @@ class HIDDEN_SYMBOL Bridge
Bridge()
: lib_handle(Scope::dlopen_fn(Scope::path(), RTLD_LAZY))
{
- if (Scope::override_path() && secure_getenv("UBUNTU_PLATFORM_API_TEST_OVERRIDE"))
+ if (Scope::override_path() && getenv("UBUNTU_PLATFORM_API_TEST_OVERRIDE"))
lib_override_handle = (Scope::dlopen_fn(Scope::override_path(), RTLD_LAZY));
}
diff --git a/src/ubuntu/application/base_module.h b/src/ubuntu/application/base_module.h
index 31522e3..379276b 100644
--- a/src/ubuntu/application/base_module.h
+++ b/src/ubuntu/application/base_module.h
@@ -47,7 +47,7 @@ struct HIDDEN_SYMBOL ToBackend
char module_name[32];
if (cache == NULL) {
- cache = secure_getenv("UBUNTU_PLATFORM_API_BACKEND");
+ cache = getenv("UBUNTU_PLATFORM_API_BACKEND");
if (cache == NULL) {
FILE *conf;
conf = fopen("/etc/ubuntu-platform-api/application.conf", "r");
--
2.20.1

View file

@ -0,0 +1,208 @@
From 35d1771d83879a0e6970682b1e75f83d9cb1d143 Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Sat, 12 Jan 2019 14:14:45 +0100
Subject: [PATCH 3/3] Only use hybris if available
---
src/ubuntu/application/touch/CMakeLists.txt | 58 +++++++--------
.../application/touch/hybris/CMakeLists.txt | 30 ++++----
src/ubuntu/hardware/CMakeLists.txt | 70 ++++++++++---------
3 files changed, 82 insertions(+), 76 deletions(-)
diff --git a/src/ubuntu/application/touch/CMakeLists.txt b/src/ubuntu/application/touch/CMakeLists.txt
index b0272cd..fb4408d 100644
--- a/src/ubuntu/application/touch/CMakeLists.txt
+++ b/src/ubuntu/application/touch/CMakeLists.txt
@@ -1,35 +1,37 @@
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11")
+if(Hybris)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11")
-add_subdirectory(hybris)
+ add_subdirectory(hybris)
-add_library(
- ubuntu_application_api_touch_mirclient SHARED
+ add_library(
+ ubuntu_application_api_touch_mirclient SHARED
- module.cpp
- module_version.h
-)
+ module.cpp
+ module_version.h
+ )
-target_link_libraries(
- ubuntu_application_api_touch_mirclient
+ target_link_libraries(
+ ubuntu_application_api_touch_mirclient
- "-Wl,--whole-archive"
- ubuntu_application_api_mirclient
- ubuntu_application_api_hybris
- ${UBUNTU_APPLICATION_API_LINK_LIBRARIES}
- "-Wl,--no-whole-archive"
- #TODO: Alarms
-)
+ "-Wl,--whole-archive"
+ ubuntu_application_api_mirclient
+ ubuntu_application_api_hybris
+ ${UBUNTU_APPLICATION_API_LINK_LIBRARIES}
+ "-Wl,--no-whole-archive"
+ #TODO: Alarms
+ )
-set_target_properties(
- ubuntu_application_api_touch_mirclient
- PROPERTIES
- VERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}.${UBUNTU_PLATFORM_API_VERSION_MINOR}.${UBUNTU_PLATFORM_API_VERSION_PATCH}
- SOVERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}
-)
+ set_target_properties(
+ ubuntu_application_api_touch_mirclient
+ PROPERTIES
+ VERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}.${UBUNTU_PLATFORM_API_VERSION_MINOR}.${UBUNTU_PLATFORM_API_VERSION_PATCH}
+ SOVERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}
+ )
-install(
- TARGETS ubuntu_application_api_touch_mirclient
- # this is not a development library to compile against, users should always
- # specify the SONAME; so don't build a *.so
- LIBRARY DESTINATION "${LIB_INSTALL_DIR}" NAMELINK_SKIP
-)
+ install(
+ TARGETS ubuntu_application_api_touch_mirclient
+ # this is not a development library to compile against, users should always
+ # specify the SONAME; so don't build a *.so
+ LIBRARY DESTINATION "${LIB_INSTALL_DIR}" NAMELINK_SKIP
+ )
+endif()
diff --git a/src/ubuntu/application/touch/hybris/CMakeLists.txt b/src/ubuntu/application/touch/hybris/CMakeLists.txt
index 26a1c59..2ce2912 100644
--- a/src/ubuntu/application/touch/hybris/CMakeLists.txt
+++ b/src/ubuntu/application/touch/hybris/CMakeLists.txt
@@ -1,17 +1,19 @@
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -fPIC")
+if(Hybris)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -fPIC")
-add_library(
- ubuntu_application_api_hybris STATIC
-
- ubuntu_application_sensors_hybris.cpp
-)
+ add_library(
+ ubuntu_application_api_hybris STATIC
-include_directories(
- ${CMAKE_BINARY_DIR}/include
-)
+ ubuntu_application_sensors_hybris.cpp
+ )
-target_link_libraries(
- ubuntu_application_api_hybris
-
- ${Hybris}
-)
+ include_directories(
+ ${CMAKE_BINARY_DIR}/include
+ )
+
+ target_link_libraries(
+ ubuntu_application_api_hybris
+
+ ${Hybris}
+ )
+endif()
diff --git a/src/ubuntu/hardware/CMakeLists.txt b/src/ubuntu/hardware/CMakeLists.txt
index df1f0d2..b780f16 100644
--- a/src/ubuntu/hardware/CMakeLists.txt
+++ b/src/ubuntu/hardware/CMakeLists.txt
@@ -1,45 +1,47 @@
-set(
- UBUNTU_HARDWARE_API_LINK_LIBRARIES
-
- ubuntu_hardware_alarm
-)
+if(Hybris)
+ set(
+ UBUNTU_HARDWARE_API_LINK_LIBRARIES
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -fPIC")
+ ubuntu_hardware_alarm
+ )
-include_directories(
- ${CMAKE_BINARY_DIR}/include
-)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -fPIC")
-include_directories(../../bridge)
+ include_directories(
+ ${CMAKE_BINARY_DIR}/include
+ )
-add_subdirectory(alarms/)
+ include_directories(../../bridge)
-add_library(
- ubuntu_platform_hardware_api SHARED
- ubuntu_platform_hardware_api.cpp
-)
+ add_subdirectory(alarms/)
-target_link_libraries(
- ubuntu_platform_hardware_api
+ add_library(
+ ubuntu_platform_hardware_api SHARED
+ ubuntu_platform_hardware_api.cpp
+ )
- "-Wl,--whole-archive"
- ${UBUNTU_HARDWARE_API_LINK_LIBRARIES}
- "-Wl,--no-whole-archive"
+ target_link_libraries(
+ ubuntu_platform_hardware_api
- dl
- ${Hybris}
-)
+ "-Wl,--whole-archive"
+ ${UBUNTU_HARDWARE_API_LINK_LIBRARIES}
+ "-Wl,--no-whole-archive"
-set_target_properties(
- ubuntu_platform_hardware_api
- PROPERTIES
- VERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}.${UBUNTU_PLATFORM_API_VERSION_MINOR}.${UBUNTU_PLATFORM_API_VERSION_PATCH}
- SOVERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}
-)
+ dl
+ ${Hybris}
+ )
-install(
- TARGETS ubuntu_platform_hardware_api
- ${INSTALL_TARGETS_DEFAULT_ARGS}
-)
+ set_target_properties(
+ ubuntu_platform_hardware_api
+ PROPERTIES
+ VERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}.${UBUNTU_PLATFORM_API_VERSION_MINOR}.${UBUNTU_PLATFORM_API_VERSION_PATCH}
+ SOVERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}
+ )
-add_subdirectory(tests/)
+ install(
+ TARGETS ubuntu_platform_hardware_api
+ ${INSTALL_TARGETS_DEFAULT_ARGS}
+ )
+
+ add_subdirectory(tests/)
+endif()
--
2.20.1

View file

@ -0,0 +1,45 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=platform-api
pkgver=0_git20180218
pkgrel=0
_commit="464a38b496ec499ed19fb93aefd6770abd5c19b8"
pkgdesc="Platform API for system level capabilities"
arch="x86_64"
url='https://unity8.io'
license="GPL-3.0 LGPL-3.0"
depends=""
depends_dev="process-cpp-dev url-dispatcher-dev location-service-dev"
makedepends="$depends_dev cmake cmake-extras dbus-cpp-dev"
checkdepends="gtest-dev gmock"
source="$pkgname-$_commit.tar.gz::https://github.com/ubports/$pkgname/archive/$_commit.tar.gz
0001-Use-proper-GTest.patch
0002-Use-getenv-instead-of-secure_getenv.patch
0003-Only-use-hybris-if-available.patch"
subpackages="$pkgname-dev"
builddir="$srcdir/$pkgname-$_commit"
build() {
mkdir -p build
cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib ..
make
}
check() {
cd "$builddir"/build
make test
}
package() {
cd "$builddir"/build
make DESTDIR="$pkgdir" install
}
sha512sums="e2218778bdef261b0b1e16e70eb720c1ab2f369d410dbb24edd4acc9ab882ffdcc9a96e16b5e703960dae63c49d82912bb5671e678c1caf6c4f4bc6b9784b7ee platform-api-464a38b496ec499ed19fb93aefd6770abd5c19b8.tar.gz
45825a297eadafc4ad51cc989785704e974f4b6d714753a120165b40868fb7b0addd0d473bd97b01d248082817605128ddc4909ab0c0f81162129fa322d20d64 0001-Use-proper-GTest.patch
c7eb662fd843ac73d91366d11fd331281c040dd8a58665419fad155f0af2054c66496ee58c3db40040736a2673efe44d2343f5bb11cb5188965ee04a1bc36907 0002-Use-getenv-instead-of-secure_getenv.patch
2cf7c3d05c9f8f100afcb0d921729cb9479250e7b8ad3f9d00be3689ed0026a990d1a6ce5d3fcc24c930880aaefe33f0236509fae6e22a2563cab27127cefc3e 0003-Only-use-hybris-if-available.patch"

39
unity8/qdjango/APKBUILD Normal file
View file

@ -0,0 +1,39 @@
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=qdjango
pkgver=0.6.2
pkgrel=0
pkgdesc="A Qt-based C++ web framework"
url="https://github.com/jlaine/qdjango"
arch="x86_64"
license="LGPL-2.1"
depends=""
depends_dev="qt5-qtdeclarative-dev"
makedepends="$depends_dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/jlaine/qdjango/archive/v$pkgver.tar.gz"
subpackages="$pkgname-dev $pkgname-doc"
prepare() {
default_prepare
mkdir "$builddir"/build
# Remove tests as they fail to compile
sed -i 's|SUBDIRS += tests examples|SUBDIRS += examples|' qdjango.pro
}
build() {
cd build
qmake-qt5 PREFIX=/usr ..
make
}
check() {
cd build
make check
}
package() {
cd build
make INSTALL_ROOT="$pkgdir" install
}
sha512sums="0280b09f0740ca7e70f62e36ea9e5bb648fe6d3ba1492e59f8c956df163c6db2338ea735e0b7937ee6e417f503a510eedf983ec6dc9744021a0c83a9432aa33f qdjango-0.6.2.tar.gz"

View file

@ -0,0 +1,38 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=qmenumodel
pkgver=0_git20180727
pkgrel=0
_commit="30e3dc541966abfd2ac1436caec7cd4bebdf996e"
pkgdesc='qmenumodel'
arch="x86_64"
url="https://unity8.io"
license="LGPL-3.1"
depends=""
depends_dev="qt5-qtdeclarative-dev"
makedepends="$depends_dev cmake qt5-qtbase-dev"
checkdepends="dbus-test-runner"
source="$pkgname-$_commit.tar.gz::https://github.com/ubports/$pkgname/archive/$_commit.tar.gz"
subpackages="$pkgname-dev"
builddir="$srcdir/$pkgname-$_commit"
options="!check" # 44% tests passed, 5 tests failed out of 9
build() {
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib
make
}
check() {
cd "$builddir"
make test
}
package() {
cd "$builddir"
make DESTDIR="$pkgdir" install
}
sha512sums="36fb9314703aed90862f405792ff9eaac3761972dfd51591ba2270809681d0a0035151241a9efb20595ea5a66860398041be8cf8d0b5865253cbb16475373172 qmenumodel-30e3dc541966abfd2ac1436caec7cd4bebdf996e.tar.gz"

43
unity8/qtmir/APKBUILD Normal file
View file

@ -0,0 +1,43 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=qtmir
pkgver=0_git20190129
_commit="7ba43e5310f39219ee01e73976d44e4b581fc4df"
pkgrel=0
pkgdesc="QPA plugin to make Qt a Mir server"
arch="x86_64"
url="https://unity8.io"
license="LGPL-3.0"
depends=""
makedepends="$depends_dev cmake cmake-extras gtest-dev mir-dev process-cpp-dev qt5-qtdeclarative-dev qt5-qtsensors-dev ubuntu-app-launch-dev gsettings-qt-dev libqtdbustest libqtdbusmock content-hub-dev valgrind-dev url-dispatcher-dev"
source="$pkgname-$_commit.tar.gz::https://github.com/ubports/$pkgname/archive/$_commit.tar.gz"
builddir="$srcdir/$pkgname-$_commit"
prepare() {
default_prepare
mkdir -p "$builddir"/build
# Don't build tests, they require Mir to be built with tests which is disabled
truncate -s 0 "$builddir"/tests/CMakeLists.txt
}
build() {
cd "$builddir"/build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib ..
make
}
check() {
cd "$builddir"/build
CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}
package() {
cd "$builddir"/build
make DESTDIR="$pkgdir" install
}
sha512sums="69df637dbe88041468609ccdf9d428f5ca9fb0a67bb2b566f9827d49e47857242525b576ca8e528a374435c6dfadc3e2aa190d5dbb305f04d013c9cb981cac3b qtmir-7ba43e5310f39219ee01e73976d44e4b581fc4df.tar.gz"

View file

@ -0,0 +1,40 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=settings-components
pkgver=0_git20180610
pkgrel=0
_commit="d66cac294e48d2a65ff8b5140187916c0eb1f2e8"
pkgdesc="Ubuntu settings components for Unity8"
arch="x86_64"
url="https://unity8.io"
license="GPL-3.0 LGPL-3.0"
depends=""
makedepends="cmake cmake-extras qt5-qtdeclarative-dev"
source="$pkgname-$_commit.tar.gz::https://github.com/ubports/$pkgname/archive/$_commit.tar.gz
qmltestrunner.patch"
subpackages="$pkgname-lang"
builddir="$srcdir/$pkgname-$_commit"
options="!check" # 0% tests passed, 1 tests failed out of 1
build() {
mkdir -p "$builddir"/build
cd "$builddir"/build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib ..
make
}
check() {
cd "$builddir"/build
make test
}
package() {
cd "$builddir"/build
make DESTDIR="$pkgdir" install
}
sha512sums="199b2baf552f35bac4f16027e7823fae21149b0cfade6c99d3e0e802d32ba75fec3ac4e1a8651940e7216bfef737d3f7227e3b09840483b64d24a404a204e92a settings-components-d66cac294e48d2a65ff8b5140187916c0eb1f2e8.tar.gz
0cbe24ba24468ccfae80b6d6b49c68b55e44561ac7914645746af15ee252c12341f2b401390cffbed520963d1cb7da6980f99520ee820528de964b8a714b87b4 qmltestrunner.patch"

View file

@ -0,0 +1,29 @@
diff --git a/cmake/modules/QmlTest.cmake b/cmake/modules/QmlTest.cmake
index 42d5c49..3ccd6ac 100644
--- a/cmake/modules/QmlTest.cmake
+++ b/cmake/modules/QmlTest.cmake
@@ -65,9 +65,9 @@ endfunction()
# This function wraps add_executable_test, see below for available arguments.
function(add_qml_unittest PATH COMPONENT_NAME)
- import_executables(qmltestrunner)
+ import_executables(qmltestrunner-qt5)
- add_executable_test(${COMPONENT_NAME} qmltestrunner
+ add_executable_test(${COMPONENT_NAME} qmltestrunner-qt5
${ARGN}
ARGS -input ${CMAKE_CURRENT_SOURCE_DIR}/${PATH}/tst_${COMPONENT_NAME}.qml ${QMLTEST_ARGS}
)
@@ -84,10 +84,10 @@ endfunction()
# This function wraps add_manual_test, see below for available arguments.
function(add_manual_qml_test PATH COMPONENT_NAME)
- import_executables(qmlscene)
+ import_executables(qmlscene-qt5)
cmake_parse_arguments(QMLTEST "${QMLTEST_OPTIONS}" "${QMLTEST_SINGLE}" "${QMLTEST_MULTI}" ${ARGN})
- add_manual_test(${COMPONENT_NAME} qmlscene
+ add_manual_test(${COMPONENT_NAME} qmlscene-qt5
${ARGN}
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${PATH}/tst_${COMPONENT_NAME}.qml ${QMLTEST_ARGS}
)

View file

@ -0,0 +1,48 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=system-settings
_pkgname=system-settings
pkgver=0_git20180920
_commit="10e0e8c96890cd4924e63b84ba883b9ad330e071"
pkgrel=0
pkgdesc="System Settings application for Unity8"
url="https://github.com/ubports/system-settings"
arch="x86_64"
license="GPL-3.0"
depends=""
makedepends="cmake qt5-qtbase-dev upower-dev networkmanager-dev accountsservice-ubuntu-dev geonames-dev icu-dev libqtdbusmock gsettings-qt-dev click-dev gnome-desktop-dev trust-store-dev qt5-qtdeclarative-dev qt5-qtdeclarative intltool"
source="$pkgname-$_commit.tar.gz::https://github.com/ubports/$pkgname/archive/$_commit.tar.gz
qmltestrunner.patch"
builddir="$srcdir/$pkgname-$_commit"
options="!check" # Needs xvfb-run
prepare() {
default_prepare
mkdir "$builddir"/build
# Don't build the update page, needs apt libraries
sed -i 's/update.cpp//g' plugins/system-update/CMakeLists.txt
sed -i 's/apt-pkg//g' plugins/system-update/CMakeLists.txt
sed -i 's/apt-pkg//g' tests/mocks/Ubuntu/SystemSettings/Update/CMakeLists.txt
truncate -s 0 "$builddir"/tests/plugins/system-update/CMakeLists.txt
}
build() {
cd "$builddir"/build
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib ..
make
}
check() {
cd "$builddir"/build
CTEST_OUTPUT_ON_FAILURE=true ctest
}
package() {
cd "$builddir"/build
make DESTDIR="$pkgdir" install
}
sha512sums="6243ac823871c93636d0b0ea8da3283bea885f532f190e7252f395cc2836af73442d679f5baf2b1abadbcf7c8f11522b6eb52ea891ac2b19cdaefd61328321da system-settings-10e0e8c96890cd4924e63b84ba883b9ad330e071.tar.gz
d839e01038301ecccaba86407f0b82c56cac175992d7900893a5aa6a71468a7a78a6458ba56a39c949947be7c9b705409db9f8e70e08ddf3155259ceb5327d31 qmltestrunner.patch"

View file

@ -0,0 +1,13 @@
diff --git a/cmake/QmlTest.cmake b/cmake/QmlTest.cmake
index 253b1206..dbdf6668 100644
--- a/cmake/QmlTest.cmake
+++ b/cmake/QmlTest.cmake
@@ -19,7 +19,7 @@
# qmltest_DEFAULT_IMPORT_PATHS
# qmltest_DEFAULT_PROPERTIES
-find_program(qmltestrunner_exe qmltestrunner)
+find_program(qmltestrunner_exe qmltestrunner-qt5)
find_program(qmlscene_exe qmlscene)
find_program(gcc_exe gcc)

View file

@ -0,0 +1,40 @@
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=trust-store
pkgver=0_git20180614
_commit="029270066854c281213cbf7dab10e21682c61b86"
pkgrel=0
pkgdesc="An API for creating, reading, updating and deleting trust requests answered by users."
url="https://github.com/ubports/trust-store"
arch="x86_64"
license="LGPL-3.0"
depends=""
makedepends="cmake cmake-extras mir-dev boost-dev process-cpp-dev dbus-cpp-dev properties-cpp-dev libapparmor-dev libapparmor qt5-qtdeclarative-dev gtest-dev gmock"
source="$pkgname-$_commit.tar.gz::https://github.com/ubports/$pkgname/archive/$_commit.tar.gz
link_with_libintl.patch
no_werror.patch"
subpackages="$pkgname-dev $pkgname-lang"
builddir="$srcdir/$pkgname-$_commit"
options="!check" # 62% tests passed, 5 tests failed out of 13
build() {
mkdir "$builddir/build"
cd "$builddir/build"
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib ..
make
}
check() {
cd "$builddir/build"
make test
}
package() {
cd "$builddir/build"
make DESTDIR="$pkgdir" install
}
sha512sums="ae011c74f5a581f2cc6d5e69fe3ce69b085ca39d4f62c2fe0969283f8b8c0883ca461f706be11e9151af5e6fc38c4533b9e17fcf71f91ff3d97f76a711591fd4 trust-store-029270066854c281213cbf7dab10e21682c61b86.tar.gz
8a632fb81a063f0e35aa0040f775656dbf5f4fef7a6383ef2320b31d30c5561444fada85602c7837062413e99c4171f5ac44c7e52678fc3fb1a7a5487cc7a297 link_with_libintl.patch
b839985eaedbab84240a619f5775b4b1d4a22cb38aec3314d125665550889cde845ba86f065346dc83aac8a03900feae62c69db69e4cb2983b9f20128c373ffb no_werror.patch"

View file

@ -0,0 +1,20 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 32b3632..4661cbc 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -17,6 +17,7 @@
find_package(Qt5Core REQUIRED)
find_package(Qt5Qml REQUIRED)
find_package(Qt5Quick REQUIRED)
+find_package(Intl REQUIRED)
pkg_check_modules(DBUS_CPP dbus-cpp REQUIRED)
pkg_check_modules(DBUS dbus-1 REQUIRED)
@@ -108,6 +109,7 @@ if (TRUST_STORE_MIR_AGENT_ENABLED)
target_link_libraries(
trust-prompt
+ ${Intl_LIBRARIES}
Qt5::Core Qt5::Gui Qt5::Qml Qt5::Quick
${Boost_LIBRARIES}
${PROCESS_CPP_LDFLAGS}

View file

@ -0,0 +1,15 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0e86292..a68687e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,8 +39,8 @@ include(cmake/EnableCoverageReport.cmake)
include(cmake/PrePush.cmake)
include(GNUInstallDirs)
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wall -pedantic -Wextra -fPIC -fvisibility=hidden -pthread")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Werror -Wall -fno-strict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden -pedantic -Wextra -fPIC -pthread")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic -Wextra -fPIC -fvisibility=hidden -pthread")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -fno-strict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden -pedantic -Wextra -fPIC -pthread")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
#####################################################################

View file

@ -0,0 +1,46 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=ubuntu-app-launch
pkgver=0_git20181230
pkgrel=0
_commit="55c0338a110a10994de4efc220d36293080770e2"
pkgdesc="Session init system job for Launching Applications"
arch="x86_64"
url="https://unity8.io"
license="GPL-3.0"
depends_dev="gobject-introspection-dev lttng-ust-dev json-glib-dev zeitgeist-dev unity-api-dev curl-dev properties-cpp-dev"
makedepends="$depends_dev cmake cmake-extras dbus-test-runner qt5-qtdeclarative gtest-dev glib-dev mir-dev"
checkdepends="gtest-dev gmock py3-dbusmock"
source="$pkgname-$_commit.tar.gz::https://github.com/ubports/$pkgname/archive/$_commit.tar.gz
libual-test_libertine.patch"
subpackages="$pkgname-dev"
builddir="$srcdir/$pkgname-$_commit"
options="!check" # Tests have to be adjusted for POSIX backend
prepare() {
default_prepare
# Don't build tests, see above
truncate -s 0 "$builddir"/tests/CMakeLists.txt
}
build() {
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib
make
}
check() {
cd "$builddir"
make test
}
package() {
cd "$builddir"
make DESTDIR="$pkgdir" install
}
sha512sums="0834277bd0cf14255bbf67a558933044a3daa04b62de4df1bf540dad63f2a03411ec3b1833c1ef7b97a26051064a37e9b1c9a2078caad8bd4d389425f0fd091e ubuntu-app-launch-55c0338a110a10994de4efc220d36293080770e2.tar.gz
aaec2d03930b85ea4298c056670ecc1e7855ecb951ecaa13cc94a762524928aacdd86a8d89cf86fa16f44bd8a6064e2f8cc3450a9f06cc57e1fa8bbd1a21c2d9 libual-test_libertine.patch"

View file

@ -0,0 +1,51 @@
diff --git a/tests/libual-test.cc b/tests/libual-test.cc
index 623911a..7e11034 100644
--- a/tests/libual-test.cc
+++ b/tests/libual-test.cc
@@ -32,7 +32,7 @@
#include "ubuntu-app-launch.h"
#include "eventually-fixture.h"
-#include "libertine-service.h"
+//#include "libertine-service.h"
#include "mir-mock.h"
#include "snapd-mock.h"
#include "systemd-mock.h"
@@ -46,7 +46,7 @@ protected:
DbusTestService *service = NULL;
DbusTestDbusMock *mock = NULL;
DbusTestDbusMock *cgmock = NULL;
- std::shared_ptr<LibertineService> libertine;
+ //std::shared_ptr<LibertineService> libertine;
std::shared_ptr<SystemdMock> systemd;
GDBusConnection *bus = NULL;
std::string last_focus_appid;
@@ -122,8 +122,8 @@ protected:
dbus_test_service_add_task(service, *systemd);
/* Add in Libertine */
- libertine = std::make_shared<LibertineService>();
- dbus_test_service_add_task(service, *libertine);
+ //libertine = std::make_shared<LibertineService>();
+ //dbus_test_service_add_task(service, *libertine);
dbus_test_service_start_tasks(service);
@@ -131,7 +131,7 @@ protected:
g_dbus_connection_set_exit_on_close(bus, FALSE);
g_object_add_weak_pointer(G_OBJECT(bus), (gpointer *)&bus);
- ASSERT_EVENTUALLY_FUNC_EQ(false, std::function<bool()>{[&] { return libertine->getUniqueName().empty(); }});
+ //ASSERT_EVENTUALLY_FUNC_EQ(false, std::function<bool()>{[&] { return libertine->getUniqueName().empty(); }});
ASSERT_TRUE(ubuntu_app_launch_observer_add_app_focus(focus_cb, this));
ASSERT_TRUE(ubuntu_app_launch_observer_add_app_resume(resume_cb, this));
@@ -145,7 +145,7 @@ protected:
ubuntu::app_launch::Registry::clearDefault();
systemd.reset();
- libertine.reset();
+ //libertine.reset();
g_clear_object(&service);
g_object_unref(bus);

View file

@ -0,0 +1,43 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=ubuntu-download-manager
pkgver=0_git20180603
_commit="5ff8a51e5a8f68dce791a5c66f162137d7b96543"
pkgrel=0
pkgdesc="Provides a service for downloading files while an application is suspended"
arch="x86_64"
url="https://unity8.io"
license="LGPL-3.0"
depends=""
depends_dev="qt5-qtdeclarative-dev boost-dev glog-dev libnih-dev"
makedepends="$depends_dev cmake cmake-extras gtest-dev gmock"
checkdepends="dbus-test-runner xvfb" # and xvfb-run :)
source="$pkgname-$_commit.tar.gz::https://github.com/ubports/$pkgname/archive/$_commit.tar.gz
cmake-extras.patch"
subpackages="$pkgname-dev"
builddir="$srcdir/$pkgname-$_commit"
options="!check" # Tests fail
build() {
mkdir -p "$builddir"/build
cd "$builddir"/build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBEXECDIR=/usr/lib \
-DCMAKE_INSTALL_LIBDIR=lib ..
make
}
check() {
cd "$builddir"/build
make test
}
package() {
cd "$builddir"/build
make DESTDIR="$pkgdir" install
}
sha512sums="1f343548951c14e29e9e461335ca3803f7a9f75c469760ed7bc93f5ff7d166e124c77da5cf1267c9f633b13e2bad6489fbbadb76e930044ac80ad1c2d9a3408a ubuntu-download-manager-5ff8a51e5a8f68dce791a5c66f162137d7b96543.tar.gz
36fa1cfccfa29b9c298711bf8c7e264ec15d4e78a3e47cdd12f8ab0752f83504dc4b3e8576e84ca529ff631c8a9a7452a88bfa9612b7261fe8d80c4c8c4f1d35 cmake-extras.patch"

View file

@ -0,0 +1,395 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fd724b55..8e0e7525 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,5 @@
project(ubuntu-download-manager)
cmake_minimum_required(VERSION 2.8)
-set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC -pthread")
# for dh_translations to extract the domain
@@ -11,7 +10,7 @@ add_definitions(-DI18N_DOMAIN="${GETTEXT_PACKAGE}")
# Standard install paths
include(GNUInstallDirs)
-include(EnableCoverageReport)
+find_package(CoverageReport)
#####################################################################
# Enable code coverage calculation with gcov/gcovr/lcov
# Usage:
diff --git a/cmake/modules/EnableCoverageReport.cmake b/cmake/modules/EnableCoverageReport.cmake
deleted file mode 100644
index dc8c8d29..00000000
--- a/cmake/modules/EnableCoverageReport.cmake
+++ /dev/null
@@ -1,153 +0,0 @@
-# - Creates a special coverage build type and target on GCC.
-#
-# Defines a function ENABLE_COVERAGE_REPORT which generates the coverage target
-# for selected targets. Optional arguments to this function are used to filter
-# unwanted results using globbing expressions. Moreover targets with tests for
-# the source code can be specified to trigger regenerating the report if the
-# test has changed
-#
-# ENABLE_COVERAGE_REPORT(TARGETS target... [FILTER filter...] [TESTS test targets...])
-#
-# To generate a coverage report first build the project with
-# CMAKE_BUILD_TYPE=coverage, then call make test and afterwards make coverage.
-#
-# The coverage report is based on gcov. Depending on the availability of lcov
-# a HTML report will be generated and/or an XML report of gcovr is found.
-# The generated coverage target executes all found solutions. Special targets
-# exist to create e.g. only the xml report: coverage-xml.
-#
-# Copyright (C) 2010 by Johannes Wienke <jwienke at techfak dot uni-bielefeld dot de>
-#
-# This program is free software; you can redistribute it
-# and/or modify it under the terms of the GNU General
-# Public License as published by the Free Software Foundation;
-# either version 2, or (at your option)
-# any later version.
-#
-# This program 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 General Public License for more details.
-#
-
-INCLUDE(ParseArguments)
-
-FIND_PACKAGE(Lcov)
-FIND_PACKAGE(gcovr)
-
-FUNCTION(ENABLE_COVERAGE_REPORT)
-
- # argument parsing
- PARSE_ARGUMENTS(ARG "FILTER;TARGETS;TESTS" "" ${ARGN})
-
- SET(COVERAGE_RAW_FILE "${CMAKE_BINARY_DIR}/coverage.raw.info")
- SET(COVERAGE_FILTERED_FILE "${CMAKE_BINARY_DIR}/coverage.info")
- SET(COVERAGE_REPORT_DIR "${CMAKE_BINARY_DIR}/coveragereport")
- SET(COVERAGE_XML_FILE "${CMAKE_BINARY_DIR}/coverage.xml")
- SET(COVERAGE_XML_COMMAND_FILE "${CMAKE_BINARY_DIR}/coverage-xml.cmake")
-
- # decide if there is any tool to create coverage data
- SET(TOOL_FOUND FALSE)
- IF(LCOV_FOUND OR GCOVR_FOUND)
- SET(TOOL_FOUND TRUE)
- ENDIF()
- IF(NOT TOOL_FOUND)
- MESSAGE(STATUS "Cannot enable coverage targets because neither lcov nor gcovr are found.")
- ENDIF()
-
- STRING(TOLOWER "${CMAKE_BUILD_TYPE}" COVERAGE_BUILD_TYPE)
- IF(CMAKE_COMPILER_IS_GNUCXX AND TOOL_FOUND AND "${COVERAGE_BUILD_TYPE}" MATCHES "coverage")
-
- MESSAGE(STATUS "Coverage support enabled for targets: ${ARG_TARGETS}")
-
- # create coverage build type
- SET(CMAKE_CXX_FLAGS_COVERAGE ${CMAKE_CXX_FLAGS_DEBUG} PARENT_SCOPE)
- SET(CMAKE_C_FLAGS_COVERAGE ${CMAKE_C_FLAGS_DEBUG} PARENT_SCOPE)
- SET(CMAKE_CONFIGURATION_TYPES ${CMAKE_CONFIGURATION_TYPES} coverage PARENT_SCOPE)
-
- # instrument targets
- SET_TARGET_PROPERTIES(${ARG_TARGETS} PROPERTIES COMPILE_FLAGS --coverage
- LINK_FLAGS --coverage)
-
- # html report
- IF (LCOV_FOUND)
-
- MESSAGE(STATUS "Enabling HTML coverage report")
-
- # set up coverage target
-
- ADD_CUSTOM_COMMAND(OUTPUT ${COVERAGE_RAW_FILE}
- COMMAND ${LCOV_EXECUTABLE} -c -d ${CMAKE_BINARY_DIR} -o ${COVERAGE_RAW_FILE}
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
- COMMENT "Collecting coverage data"
- DEPENDS ${ARG_TARGETS} ${ARG_TESTS}
- VERBATIM)
-
- # filter unwanted stuff
- LIST(LENGTH ARG_FILTER FILTER_LENGTH)
- IF(${FILTER_LENGTH} GREATER 0)
- SET(FILTER COMMAND ${LCOV_EXECUTABLE})
- FOREACH(F ${ARG_FILTER})
- SET(FILTER ${FILTER} -r ${COVERAGE_FILTERED_FILE} ${F})
- ENDFOREACH()
- SET(FILTER ${FILTER} -o ${COVERAGE_FILTERED_FILE})
- ELSE()
- SET(FILTER "")
- ENDIF()
-
- ADD_CUSTOM_COMMAND(OUTPUT ${COVERAGE_FILTERED_FILE}
- COMMAND ${LCOV_EXECUTABLE} -e ${COVERAGE_RAW_FILE} "${CMAKE_SOURCE_DIR}*" -o ${COVERAGE_FILTERED_FILE}
- ${FILTER}
- DEPENDS ${COVERAGE_RAW_FILE}
- COMMENT "Filtering recorded coverage data for project-relevant entries"
- VERBATIM)
- ADD_CUSTOM_COMMAND(OUTPUT ${COVERAGE_REPORT_DIR}
- COMMAND ${CMAKE_COMMAND} -E make_directory ${COVERAGE_REPORT_DIR}
- COMMAND ${GENHTML_EXECUTABLE} --legend --show-details -t "${PROJECT_NAME} test coverage" -o ${COVERAGE_REPORT_DIR} ${COVERAGE_FILTERED_FILE}
- DEPENDS ${COVERAGE_FILTERED_FILE}
- COMMENT "Generating HTML coverage report in ${COVERAGE_REPORT_DIR}"
- VERBATIM)
-
- ADD_CUSTOM_TARGET(coverage-html
- DEPENDS ${COVERAGE_REPORT_DIR})
-
- ENDIF()
-
- # xml coverage report
- IF(GCOVR_FOUND)
-
- MESSAGE(STATUS "Enabling XML coverage report")
-
- # gcovr cannot write directly to a file so the execution needs to
- # be wrapped in a cmake file that generates the file output
- FILE(WRITE ${COVERAGE_XML_COMMAND_FILE}
- "SET(ENV{LANG} en)\n")
- FILE(APPEND ${COVERAGE_XML_COMMAND_FILE}
- "EXECUTE_PROCESS(COMMAND \"${GCOVR_EXECUTABLE}\" -x -r \"${CMAKE_SOURCE_DIR}\" OUTPUT_FILE \"${COVERAGE_XML_FILE}\" WORKING_DIRECTORY \"${CMAKE_BINARY_DIR}\")\n")
-
- ADD_CUSTOM_COMMAND(OUTPUT ${COVERAGE_XML_FILE}
- COMMAND ${CMAKE_COMMAND} ARGS -P ${COVERAGE_XML_COMMAND_FILE}
- COMMENT "Generating coverage XML report"
- VERBATIM)
-
- ADD_CUSTOM_TARGET(coverage-xml
- DEPENDS ${COVERAGE_XML_FILE})
-
- ENDIF()
-
- # provide a global coverage target executing both steps if available
- SET(GLOBAL_DEPENDS "")
- IF(LCOV_FOUND)
- LIST(APPEND GLOBAL_DEPENDS ${COVERAGE_REPORT_DIR})
- ENDIF()
- IF(GCOVR_FOUND)
- LIST(APPEND GLOBAL_DEPENDS ${COVERAGE_XML_FILE})
- ENDIF()
- IF(LCOV_FOUND OR GCOVR_FOUND)
- ADD_CUSTOM_TARGET(coverage
- DEPENDS ${GLOBAL_DEPENDS})
- ENDIF()
-
- ENDIF()
-
-ENDFUNCTION()
diff --git a/cmake/modules/FindGtest.cmake b/cmake/modules/FindGtest.cmake
deleted file mode 100644
index 25350d59..00000000
--- a/cmake/modules/FindGtest.cmake
+++ /dev/null
@@ -1,67 +0,0 @@
-include(ExternalProject)
-include(FindPackageHandleStandardArgs)
-
-#gtest
-if (EXISTS /usr/src/googletest)
- set (USING_GOOGLETEST_1_8 TRUE)
- set (GTEST_INSTALL_DIR /usr/src/googletest/googletest/include)
-else()
- set(GTEST_INSTALL_DIR /usr/src/gmock/gtest/include)
-endif()
-find_path(GTEST_INCLUDE_DIR gtest/gtest.h
- HINTS ${GTEST_INSTALL_DIR})
-
-#gmock
-find_path(GMOCK_INSTALL_DIR CMakeLists.txt
- HINTS /usr/src/googletest /usr/src/gmock)
-if(${GMOCK_INSTALL_DIR} STREQUAL "GMOCK_INSTALL_DIR-NOTFOUND")
- message(FATAL_ERROR "google-mock package not found")
-endif()
-
-find_path(GMOCK_INCLUDE_DIR gmock/gmock.h)
-
-if (USING_GOOGLETEST_1_8)
- set(GMOCK_BASE_BINARY_DIR ${CMAKE_BINARY_DIR}/gmock/libs)
- set(GMOCK_BINARY_DIR ${GMOCK_BASE_BINARY_DIR}/googlemock)
- set(GTEST_BINARY_DIR ${GMOCK_BINARY_DIR}/gtest)
-else()
- set(GMOCK_BASE_BINARY_DIR ${CMAKE_BINARY_DIR}/gmock/libs)
- set(GMOCK_BINARY_DIR ${GMOCK_BASE_BINARY_DIR})
- set(GTEST_BINARY_DIR ${GMOCK_BINARY_DIR}/gtest)
-endif()
-
-set(GTEST_CMAKE_ARGS "")
-if (${MIR_IS_CROSS_COMPILING})
- set(GTEST_CMAKE_ARGS
- -DCMAKE_TOOLCHAIN_FILE=${CMAKE_MODULE_PATH}/LinuxCrossCompile.cmake)
-endif()
-
-if (USING_GOOGLETEST_1_8)
- list(APPEND GTEST_CMAKE_ARGS -DBUILD_GTEST=ON)
-endif()
-
-ExternalProject_Add(
- GMock
- #where to build in source tree
- PREFIX ${GMOCK_PREFIX}
- #where the source is external to the project
- SOURCE_DIR ${GMOCK_INSTALL_DIR}
- #forward the compilers to the subproject so cross-arch builds work
- CMAKE_ARGS ${GTEST_CMAKE_ARGS}
- BINARY_DIR ${GMOCK_BASE_BINARY_DIR}
-
- #we don't need to install, so skip
- INSTALL_COMMAND ""
-)
-
-set(GMOCK_LIBRARY ${GMOCK_BINARY_DIR}/libgmock.a)
-set(GMOCK_MAIN_LIBRARY ${GMOCK_BINARY_DIR}/libgmock_main.a)
-set(GMOCK_BOTH_LIBRARIES ${GMOCK_LIBRARY} ${GMOCK_MAIN_LIBRARY})
-set(GTEST_LIBRARY ${GTEST_BINARY_DIR}/libgtest.a)
-set(GTEST_MAIN_LIBRARY ${GTEST_BINARY_DIR}/libgtest_main.a)
-set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY})
-set(GTEST_ALL_LIBRARIES ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES})
-
-find_package_handle_standard_args(GTest DEFAULT_MSG
- GMOCK_INCLUDE_DIR
- GTEST_INCLUDE_DIR)
diff --git a/cmake/modules/FindLcov.cmake b/cmake/modules/FindLcov.cmake
deleted file mode 100644
index 70628f4e..00000000
--- a/cmake/modules/FindLcov.cmake
+++ /dev/null
@@ -1,29 +0,0 @@
-# - Find lcov
-# Will define:
-#
-# LCOV_EXECUTABLE - the lcov binary
-# GENHTML_EXECUTABLE - the genhtml executable
-#
-# Copyright (C) 2010 by Johannes Wienke <jwienke at techfak dot uni-bielefeld dot de>
-#
-# This program is free software; you can redistribute it
-# and/or modify it under the terms of the GNU General
-# Public License as published by the Free Software Foundation;
-# either version 2, or (at your option)
-# any later version.
-#
-# This program 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 General Public License for more details.
-#
-
-INCLUDE(FindPackageHandleStandardArgs)
-
-FIND_PROGRAM(LCOV_EXECUTABLE lcov)
-FIND_PROGRAM(GENHTML_EXECUTABLE genhtml)
-
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lcov DEFAULT_MSG LCOV_EXECUTABLE GENHTML_EXECUTABLE)
-
-# only visible in advanced view
-MARK_AS_ADVANCED(LCOV_EXECUTABLE GENHTML_EXECUTABLE)
diff --git a/cmake/modules/Findgcovr.cmake b/cmake/modules/Findgcovr.cmake
deleted file mode 100644
index e4c43fe1..00000000
--- a/cmake/modules/Findgcovr.cmake
+++ /dev/null
@@ -1,31 +0,0 @@
-# - Find gcovr scrip
-# Will define:
-#
-# GCOVR_EXECUTABLE - the gcovr script
-#
-# Uses:
-#
-# GCOVR_ROOT - root to search for the script
-#
-# Copyright (C) 2011 by Johannes Wienke <jwienke at techfak dot uni-bielefeld dot de>
-#
-# This program is free software; you can redistribute it
-# and/or modify it under the terms of the GNU General
-# Public License as published by the Free Software Foundation;
-# either version 2, or (at your option)
-# any later version.
-#
-# This program 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 General Public License for more details.
-#
-
-INCLUDE(FindPackageHandleStandardArgs)
-
-FIND_PROGRAM(GCOVR_EXECUTABLE gcovr HINTS ${GCOVR_ROOT} "${GCOVR_ROOT}/bin")
-
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(gcovr DEFAULT_MSG GCOVR_EXECUTABLE)
-
-# only visible in advanced view
-MARK_AS_ADVANCED(GCOVR_EXECUTABLE)
diff --git a/cmake/modules/ParseArguments.cmake b/cmake/modules/ParseArguments.cmake
deleted file mode 100644
index e13f671a..00000000
--- a/cmake/modules/ParseArguments.cmake
+++ /dev/null
@@ -1,52 +0,0 @@
-# Parse arguments passed to a function into several lists separated by
-# upper-case identifiers and options that do not have an associated list e.g.:
-#
-# SET(arguments
-# hello OPTION3 world
-# LIST3 foo bar
-# OPTION2
-# LIST1 fuz baz
-# )
-# PARSE_ARGUMENTS(ARG "LIST1;LIST2;LIST3" "OPTION1;OPTION2;OPTION3" ${arguments})
-#
-# results in 7 distinct variables:
-# * ARG_DEFAULT_ARGS: hello;world
-# * ARG_LIST1: fuz;baz
-# * ARG_LIST2:
-# * ARG_LIST3: foo;bar
-# * ARG_OPTION1: FALSE
-# * ARG_OPTION2: TRUE
-# * ARG_OPTION3: TRUE
-#
-# taken from http://www.cmake.org/Wiki/CMakeMacroParseArguments
-
-MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
- SET(DEFAULT_ARGS)
- FOREACH(arg_name ${arg_names})
- SET(${prefix}_${arg_name})
- ENDFOREACH(arg_name)
- FOREACH(option ${option_names})
- SET(${prefix}_${option} FALSE)
- ENDFOREACH(option)
-
- SET(current_arg_name DEFAULT_ARGS)
- SET(current_arg_list)
- FOREACH(arg ${ARGN})
- SET(larg_names ${arg_names})
- LIST(FIND larg_names "${arg}" is_arg_name)
- IF (is_arg_name GREATER -1)
- SET(${prefix}_${current_arg_name} ${current_arg_list})
- SET(current_arg_name ${arg})
- SET(current_arg_list)
- ELSE (is_arg_name GREATER -1)
- SET(loption_names ${option_names})
- LIST(FIND loption_names "${arg}" is_option)
- IF (is_option GREATER -1)
- SET(${prefix}_${arg} TRUE)
- ELSE (is_option GREATER -1)
- SET(current_arg_list ${current_arg_list} ${arg})
- ENDIF (is_option GREATER -1)
- ENDIF (is_arg_name GREATER -1)
- ENDFOREACH(arg)
- SET(${prefix}_${current_arg_name} ${current_arg_list})
-ENDMACRO(PARSE_ARGUMENTS)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 9ec602cf..ab56cc39 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -14,7 +14,7 @@
#
# Authored by: Manuel de la Peña <manuel.delapena@canonical.com>
-find_package(Gtest REQUIRED)
+find_package(GMock REQUIRED)
include_directories(${GMOCK_INCLUDE_DIR} ${GTEST_INCLUDE_DIR})
if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")

View file

@ -0,0 +1,39 @@
From bd27207eba5211e106129b79be138e5298c9b3cb Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Wed, 3 Oct 2018 17:07:21 +0200
Subject: [PATCH 1/5] Adapt to QtPim API changes
---
debian/control | 2 +-
src/UbuntuToolkit/adapters/alarmsadapter_organizer.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/debian/control b/debian/control
index 97964424e..800892f62 100644
--- a/debian/control
+++ b/debian/control
@@ -52,7 +52,7 @@ Build-Depends: accountsservice,
qtdeclarative5-private-dev,
qtdeclarative5-unity-action-plugin (>= 1.1.0),
qtmultimedia5-doc-html,
- qtpim5-dev,
+ qtpim5-dev (>= 5.0~git20171109~0bd985b),
qtscript5-doc-html,
qtsvg5-doc-html,
qtsystems5-dev,
diff --git a/src/UbuntuToolkit/adapters/alarmsadapter_organizer.cpp b/src/UbuntuToolkit/adapters/alarmsadapter_organizer.cpp
index 72e30ba12..7552142f2 100644
--- a/src/UbuntuToolkit/adapters/alarmsadapter_organizer.cpp
+++ b/src/UbuntuToolkit/adapters/alarmsadapter_organizer.cpp
@@ -420,7 +420,7 @@ AlarmsAdapter::AlarmsAdapter(AlarmManager *qq)
QStringLiteral("collection-type"), QStringLiteral("Task List"));
if (!manager->saveCollection(&collection)) {
qWarning() << "WARNING: Creating dedicated collection for alarms was not possible, alarms will be saved into the default collection!";
- collection = manager->defaultCollection();
+ collection = manager->collection(manager->defaultCollectionId());
}
}
}
--
2.20.1

View file

@ -0,0 +1,25 @@
From 49fe9d5aaef907d309710577699d788b53bde15c Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Wed, 3 Oct 2018 17:07:51 +0200
Subject: [PATCH 2/5] Fix "Missing sentinel in function call" warning
---
src/UbuntuToolkit/ucurihandler.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/UbuntuToolkit/ucurihandler.cpp b/src/UbuntuToolkit/ucurihandler.cpp
index ad752f80c..c9f0566c9 100644
--- a/src/UbuntuToolkit/ucurihandler.cpp
+++ b/src/UbuntuToolkit/ucurihandler.cpp
@@ -75,7 +75,7 @@ UCUriHandler::UCUriHandler()
qWarning() << "UCUriHandler: Empty \"APP_ID\" environment variable, ignoring.";
return;
}
- char* path = nih_dbus_path(NULL, "", applicationId.constData(), NULL);
+ char* path = nih_dbus_path(NULL, "", applicationId.constData(), (char *)NULL);
objectPath = QString::fromLocal8Bit(path);
nih_free(path);
--
2.20.1

View file

@ -0,0 +1,28 @@
From 1091e7af92eba4bba90632e9ea3386ae68dbeba2 Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Wed, 3 Oct 2018 17:08:08 +0200
Subject: [PATCH 3/5] Add option to disable building of docs
---
ubuntu-sdk.pro | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/ubuntu-sdk.pro b/ubuntu-sdk.pro
index 4cd2e9cfe..b5ff7e0db 100644
--- a/ubuntu-sdk.pro
+++ b/ubuntu-sdk.pro
@@ -11,7 +11,10 @@ load(qt_parts)
src_uitk_launcher.subdir = ubuntu-ui-toolkit-launcher
src_uitk_launcher.depends = sub-src
-SUBDIRS += po documentation app-launch-profiler src_uitk_launcher apicheck
+SUBDIRS += po app-launch-profiler src_uitk_launcher apicheck
+!CONFIG(no_docs) {
+ SUBDIRS += documentation
+}
sub_tests.CONFIG -= no_default_target
sub_tests.CONFIG -= no_default_install
--
2.20.1

View file

@ -0,0 +1,155 @@
From f306efd7fcceac905093a0ef58aae93412813d16 Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Sun, 30 Dec 2018 22:31:37 +0100
Subject: [PATCH 4/5] Make it compile with Qt 5.12
---
src/UbuntuToolkit/ucstylehints.cpp | 35 +++++++++++++++---------------
src/UbuntuToolkit/ucstylehints_p.h | 8 +++----
2 files changed, 21 insertions(+), 22 deletions(-)
diff --git a/src/UbuntuToolkit/ucstylehints.cpp b/src/UbuntuToolkit/ucstylehints.cpp
index cf1bba798..852f55777 100644
--- a/src/UbuntuToolkit/ucstylehints.cpp
+++ b/src/UbuntuToolkit/ucstylehints.cpp
@@ -27,17 +27,17 @@
UT_NAMESPACE_BEGIN
// verifies property declaration correctness
-void UCStyleHintsParser::verifyBindings(const QV4::CompiledData::Unit *qmlUnit, const QList<const QV4::CompiledData::Binding *> &bindings)
+void UCStyleHintsParser::verifyBindings(const QQmlRefPointer<QV4::CompiledData::CompilationUnit> &compilationUnit, const QList<const QV4::CompiledData::Binding *> &bindings)
{
Q_FOREACH(const QV4::CompiledData::Binding *binding, bindings) {
- verifyProperty(qmlUnit, binding);
+ verifyProperty(compilationUnit, binding);
}
}
-void UCStyleHintsParser::verifyProperty(const QV4::CompiledData::Unit *qmlUnit, const QV4::CompiledData::Binding *binding)
+void UCStyleHintsParser::verifyProperty(const QQmlRefPointer<QV4::CompiledData::CompilationUnit> &compilationUnit, const QV4::CompiledData::Binding *binding)
{
if (binding->type == QV4::CompiledData::Binding::Type_Object) {
- error(qmlUnit->objectAt(binding->value.objectIndex),
+ error(compilationUnit->objectAt(binding->value.objectIndex),
QStringLiteral("StyleHints does not support creating state-specific objects."));
return;
}
@@ -45,15 +45,15 @@ void UCStyleHintsParser::verifyProperty(const QV4::CompiledData::Unit *qmlUnit,
// group properties or attached properties, we do handle those as well
if (binding->type == QV4::CompiledData::Binding::Type_GroupProperty
|| binding->type == QV4::CompiledData::Binding::Type_AttachedProperty) {
- const QV4::CompiledData::Object *subObj = qmlUnit->objectAt(binding->value.objectIndex);
+ const QV4::CompiledData::Object *subObj = compilationUnit->objectAt(binding->value.objectIndex);
const QV4::CompiledData::Binding *subBinding = subObj->bindingTable();
for (quint32 i = 0; i < subObj->nBindings; ++i, ++subBinding) {
- verifyProperty(qmlUnit, subBinding);
+ verifyProperty(compilationUnit, subBinding);
}
}
// filter out signals!
- QString propertyName = qmlUnit->stringAt(binding->propertyNameIndex);
+ QString propertyName = compilationUnit->stringAt(binding->propertyNameIndex);
if (propertyName.startsWith(QStringLiteral("on")) && propertyName.at(2).isUpper()) {
error(binding, QStringLiteral("Signal properties are not supported."));
return;
@@ -61,10 +61,9 @@ void UCStyleHintsParser::verifyProperty(const QV4::CompiledData::Unit *qmlUnit,
}
// decodes property declarations, stores the bindings and values
-void UCStyleHintsParser::applyBindings(QObject *obj, QV4::CompiledData::CompilationUnit *cdata, const QList<const QV4::CompiledData::Binding *> &bindings)
+void UCStyleHintsParser::applyBindings(QObject *obj, const QQmlRefPointer<QV4::CompiledData::CompilationUnit> &compilationUnit, const QList<const QV4::CompiledData::Binding *> &bindings)
{
UCStyleHints *hints = static_cast<UCStyleHints*>(obj);
- const QV4::CompiledData::Unit *qmlUnit = cdata->data;
UCStyledItemBase *styledItem = qobject_cast<UCStyledItemBase*>(hints->parent());
if (!styledItem) {
@@ -73,26 +72,26 @@ void UCStyleHintsParser::applyBindings(QObject *obj, QV4::CompiledData::Compilat
}
Q_FOREACH(const QV4::CompiledData::Binding *binding, bindings) {
- hints->decodeBinding(QString(), qmlUnit, binding);
+ hints->decodeBinding(QString(), compilationUnit, binding);
}
- hints->m_cdata = cdata;
+ hints->m_cdata = compilationUnit;
hints->m_decoded = true;
}
-void UCStyleHints::decodeBinding(const QString &propertyPrefix, const QV4::CompiledData::Unit *qmlUnit, const QV4::CompiledData::Binding *binding)
+void UCStyleHints::decodeBinding(const QString &propertyPrefix, const QQmlRefPointer<QV4::CompiledData::CompilationUnit> &compilationUnit, const QV4::CompiledData::Binding *binding)
{
- QString propertyName = propertyPrefix + qmlUnit->stringAt(binding->propertyNameIndex);
+ QString propertyName = propertyPrefix + compilationUnit->stringAt(binding->propertyNameIndex);
// handle grouped properties first
if (binding->type == QV4::CompiledData::Binding::Type_GroupProperty
|| binding->type == QV4::CompiledData::Binding::Type_AttachedProperty) {
- const QV4::CompiledData::Object *subObj = qmlUnit->objectAt(binding->value.objectIndex);
+ const QV4::CompiledData::Object *subObj = compilationUnit->objectAt(binding->value.objectIndex);
const QV4::CompiledData::Binding *subBinding = subObj->bindingTable();
QString pre = propertyName + ".";
for (quint32 i = 0; i < subObj->nBindings; ++i, ++subBinding) {
- decodeBinding(pre, qmlUnit, subBinding);
+ decodeBinding(pre, compilationUnit, subBinding);
}
return;
}
@@ -100,7 +99,7 @@ void UCStyleHints::decodeBinding(const QString &propertyPrefix, const QV4::Compi
switch (binding->type) {
case QV4::CompiledData::Binding::Type_Script:
{
- QString expression = binding->valueAsScriptString(qmlUnit);
+ QString expression = binding->valueAsScriptString(compilationUnit.data());
QUrl url = QUrl();
int line = -1;
int column = -1;
@@ -125,12 +124,12 @@ void UCStyleHints::decodeBinding(const QString &propertyPrefix, const QV4::Compi
case QV4::CompiledData::Binding::Type_TranslationById:
case QV4::CompiledData::Binding::Type_String:
{
- m_values << qMakePair(propertyName, binding->valueAsString(qmlUnit));
+ m_values << qMakePair(propertyName, binding->valueAsString(compilationUnit.data()));
break;
}
case QV4::CompiledData::Binding::Type_Number:
{
- m_values << qMakePair(propertyName, binding->valueAsNumber());
+ m_values << qMakePair(propertyName, binding->valueAsNumber(compilationUnit->constants));
break;
}
case QV4::CompiledData::Binding::Type_Boolean:
diff --git a/src/UbuntuToolkit/ucstylehints_p.h b/src/UbuntuToolkit/ucstylehints_p.h
index ef5fafd6e..ddc96a7f1 100644
--- a/src/UbuntuToolkit/ucstylehints_p.h
+++ b/src/UbuntuToolkit/ucstylehints_p.h
@@ -78,7 +78,7 @@ private:
friend class UCStyleHintsParser;
void propertyNotFound(const QString &styleName, const QString &property);
- void decodeBinding(const QString &propertyPrefix, const QV4::CompiledData::Unit *qmlUnit, const QV4::CompiledData::Binding *binding);
+ void decodeBinding(const QString &propertyPrefix, const QQmlRefPointer<QV4::CompiledData::CompilationUnit> &compilationUnit, const QV4::CompiledData::Binding *binding);
};
class UBUNTUTOOLKIT_EXPORT UCStyleHintsParser : public QQmlCustomParser
@@ -86,11 +86,11 @@ class UBUNTUTOOLKIT_EXPORT UCStyleHintsParser : public QQmlCustomParser
public:
UCStyleHintsParser() : QQmlCustomParser(QQmlCustomParser::AcceptsSignalHandlers) {}
- void verifyBindings(const QV4::CompiledData::Unit *qmlUnit, const QList<const QV4::CompiledData::Binding *> &bindings) override;
- void applyBindings(QObject *obj, QV4::CompiledData::CompilationUnit *cdata, const QList<const QV4::CompiledData::Binding *> &bindings) override;
+ void verifyBindings(const QQmlRefPointer<QV4::CompiledData::CompilationUnit> &compilationUnit, const QList<const QV4::CompiledData::Binding *> &bindings) override;
+ void applyBindings(QObject *obj, const QQmlRefPointer<QV4::CompiledData::CompilationUnit> &compilationUnit, const QList<const QV4::CompiledData::Binding *> &bindings) override;
private:
- void verifyProperty(const QV4::CompiledData::Unit *qmlUnit, const QV4::CompiledData::Binding *binding);
+ void verifyProperty(const QQmlRefPointer<QV4::CompiledData::CompilationUnit> &compilationUnit, const QV4::CompiledData::Binding *binding);
};
UT_NAMESPACE_END
--
2.20.1

View file

@ -0,0 +1,686 @@
From 83d90533ebcef429fd7499c5e6ad856e42062820 Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Sun, 30 Dec 2018 22:53:00 +0100
Subject: [PATCH 5/5] Adjust for removed QTest::waitForEvents() method
See https://github.com/qt/qtbase/commit/75e583b3fcbdbbb999633eb5f2267720dd695cfa
---
.../tst_deprecated_theme_engine.cpp | 4 +-
.../src/tst_i18n_LocalizedApp.cpp | 2 +-
.../src/tst_i18n_RelativeTime.cpp | 2 +-
.../tst_inversemouseareatest.cpp | 32 +++----
tests/unit/mainview11/tst_mainview.cpp | 2 +-
tests/unit/mainview13/tst_mainview.cpp | 2 +-
.../mousefilters/tst_mousefilterstest.cpp | 96 +++++++++----------
tests/unit/performance/tst_performance.cpp | 2 +-
tests/unit/statesaver/tst_statesaver.cpp | 2 +-
tests/unit/subtheming/tst_subtheming.cpp | 2 +-
10 files changed, 73 insertions(+), 73 deletions(-)
diff --git a/tests/unit/deprecated_theme_engine/tst_deprecated_theme_engine.cpp b/tests/unit/deprecated_theme_engine/tst_deprecated_theme_engine.cpp
index 19bea4c5f..94b0edf1c 100644
--- a/tests/unit/deprecated_theme_engine/tst_deprecated_theme_engine.cpp
+++ b/tests/unit/deprecated_theme_engine/tst_deprecated_theme_engine.cpp
@@ -56,13 +56,13 @@ public:
void setTheme(const QString &theme)
{
rootObject()->setProperty("themeName", theme);
- QTest::waitForEvents();
+ qApp->processEvents();
}
void setStyle(const QString &style)
{
rootObject()->setProperty("styleDocument", style);
- QTest::waitForEvents();
+ qApp->processEvents();
}
};
diff --git a/tests/unit/i18n/LocalizedApp/src/tst_i18n_LocalizedApp.cpp b/tests/unit/i18n/LocalizedApp/src/tst_i18n_LocalizedApp.cpp
index 8333460fd..84da303ad 100644
--- a/tests/unit/i18n/LocalizedApp/src/tst_i18n_LocalizedApp.cpp
+++ b/tests/unit/i18n/LocalizedApp/src/tst_i18n_LocalizedApp.cpp
@@ -57,7 +57,7 @@ public:
{
// load the document
view->setSource(QUrl::fromLocalFile(document));
- QTest::waitForEvents();
+ qApp->processEvents();
return view->rootObject();
}
diff --git a/tests/unit/i18n/RelativeTime/src/tst_i18n_RelativeTime.cpp b/tests/unit/i18n/RelativeTime/src/tst_i18n_RelativeTime.cpp
index 957a9570b..abd497e07 100644
--- a/tests/unit/i18n/RelativeTime/src/tst_i18n_RelativeTime.cpp
+++ b/tests/unit/i18n/RelativeTime/src/tst_i18n_RelativeTime.cpp
@@ -57,7 +57,7 @@ public:
{
// load the document
view->setSource(QUrl::fromLocalFile(document));
- QTest::waitForEvents();
+ qApp->processEvents();
return view->rootObject();
}
diff --git a/tests/unit/inversemousearea/tst_inversemouseareatest.cpp b/tests/unit/inversemousearea/tst_inversemouseareatest.cpp
index 19736ca5c..9fd448a66 100644
--- a/tests/unit/inversemousearea/tst_inversemouseareatest.cpp
+++ b/tests/unit/inversemousearea/tst_inversemouseareatest.cpp
@@ -97,7 +97,7 @@ private Q_SLOTS:
// connect pressed signal to capture mouse object
QObject::connect(area, SIGNAL(pressed(QQuickMouseEvent*)), this, SLOT(capturePressed(QQuickMouseEvent*)));
QTest::mouseClick(quickView.data(), Qt::LeftButton, Qt::NoModifier, QPoint(10, 10));
- QTest::waitForEvents();
+ qApp->processEvents();
QVERIFY(eventCleanup.isEmpty());
}
@@ -110,7 +110,7 @@ private Q_SLOTS:
// connect pressed signal to capture mouse object
QObject::connect(area, SIGNAL(pressed(QQuickMouseEvent*)), this, SLOT(capturePressed(QQuickMouseEvent*)));
QTest::mouseClick(quickView.data(), Qt::LeftButton, Qt::NoModifier, QPoint(10, 10));
- QTest::waitForEvents();
+ qApp->processEvents();
QVERIFY(eventCleanup.isEmpty());
}
@@ -119,7 +119,7 @@ private Q_SLOTS:
QScopedPointer<InverseMouseAreaTest> quickView(new InverseMouseAreaTest("SensingAreaError.qml"));
QTest::mouseClick(quickView.data(), Qt::LeftButton, 0, QPoint(20, 20));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(quickView->rootObject()->property("log").toString(), QString("IMA"));
}
@@ -134,7 +134,7 @@ private Q_SLOTS:
quickView->findItem<QQuickItem*>("clickArea");
QTest::mouseClick(l[0], Qt::LeftButton, 0, QPoint(20, 10));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(quickView->rootObject()->property("log").toString(), QString("IMA"));
}
@@ -143,7 +143,7 @@ private Q_SLOTS:
QScopedPointer<InverseMouseAreaTest> quickView(new InverseMouseAreaTest("OverlappedMouseArea.qml"));
QTest::mouseClick(quickView.data(), Qt::LeftButton, 0, QPoint(20, 10));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(quickView->rootObject()->property("log").toString(), QString("MA"));
}
@@ -161,7 +161,7 @@ private Q_SLOTS:
// click in the top rectangle, use 800msec delay to prevent dblclick detection
QTest::mouseClick(quickView.data(), Qt::LeftButton, 0, QPoint(10, 10), DOUBLECLICK_TIMEOUT);
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(ma1Spy.count(), 0);
QCOMPARE(ma2Spy.count(), 0);
QCOMPARE(imaSpy.count(), 1);
@@ -169,7 +169,7 @@ private Q_SLOTS:
// click in the second rectangle, use 800msec delay to prevent dblclick detection
QTest::mouseClick(quickView.data(), Qt::LeftButton, 0, QPoint(10, 65), DOUBLECLICK_TIMEOUT);
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(ma1Spy.count(), 0);
QCOMPARE(ma2Spy.count(), 0);
QCOMPARE(imaSpy.count(), 1);
@@ -177,7 +177,7 @@ private Q_SLOTS:
// click in the button, use 800msec delay to prevent dblclick detection
QTest::mouseClick(quickView.data(), Qt::LeftButton, 0, QPoint(25, 85), DOUBLECLICK_TIMEOUT);
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(ma1Spy.count(), 0);
QCOMPARE(ma2Spy.count(), 1);
QCOMPARE(imaSpy.count(), 0);
@@ -185,14 +185,14 @@ private Q_SLOTS:
// double click in the second rectangle
QSignalSpy imaDSpy(area, SIGNAL(doubleClicked(QQuickMouseEvent*)));
QTest::mouseDClick(quickView.data(), Qt::LeftButton, 0, QPoint(10, 65));
- QTest::waitForEvents();
+ qApp->processEvents();
// FIXME: this is flaky
QCOMPARE(imaDSpy.count(), 1);
imaDSpy.clear();
// double click in the first rectangle
QTest::mouseDClick(quickView.data(), Qt::LeftButton, 0, QPoint(10, 10));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(imaDSpy.count(), 1);
imaDSpy.clear();
}
@@ -210,21 +210,21 @@ private Q_SLOTS:
QSignalSpy ma2Spy(ma2, SIGNAL(pressed(QQuickMouseEvent*)));
QTest::mouseClick(quickView.data(), Qt::LeftButton, 0, QPoint(10, 10), DOUBLECLICK_TIMEOUT);
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(ma1Spy.count(), 1);
QCOMPARE(ma2Spy.count(), 0);
QCOMPARE(imaSpy.count(), 1);
ma1Spy.clear(); imaSpy.clear();
QTest::mouseClick(quickView.data(), Qt::LeftButton, 0, QPoint(10, 65), DOUBLECLICK_TIMEOUT);
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(ma1Spy.count(), 0);
QCOMPARE(ma2Spy.count(), 1);
QCOMPARE(imaSpy.count(), 1);
ma2Spy.clear(); imaSpy.clear();
QTest::mouseClick(quickView.data(), Qt::LeftButton, 0, QPoint(25, 80), DOUBLECLICK_TIMEOUT);
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(ma1Spy.count(), 0);
QCOMPARE(ma2Spy.count(), 1);
QCOMPARE(imaSpy.count(), 0);
@@ -253,21 +253,21 @@ private Q_SLOTS:
// click on the topmost rectangle
QTest::mouseClick(quickView.data(), Qt::LeftButton, 0, QPoint(10, 10), DOUBLECLICK_TIMEOUT);
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(ma2Spy.count(), 0);
QCOMPARE(imaSpy.count(), 1);
imaSpy.clear();
// click on the second rectangle
QTest::mouseClick(quickView.data(), Qt::LeftButton, 0, QPoint(10, 65), DOUBLECLICK_TIMEOUT);
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(ma2Spy.count(), 0);
QCOMPARE(imaSpy.count(), 1);
imaSpy.clear();
// click on the button
QTest::mouseClick(quickView.data(), Qt::LeftButton, 0, QPoint(25, 85), DOUBLECLICK_TIMEOUT);
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(ma2Spy.count(), 1);
QCOMPARE(imaSpy.count(), 0);
diff --git a/tests/unit/mainview11/tst_mainview.cpp b/tests/unit/mainview11/tst_mainview.cpp
index f1e68f4c6..e9ae2257a 100644
--- a/tests/unit/mainview11/tst_mainview.cpp
+++ b/tests/unit/mainview11/tst_mainview.cpp
@@ -57,7 +57,7 @@ public:
{
// load the document
view->setSource(QUrl::fromLocalFile(document));
- QTest::waitForEvents();
+ qApp->processEvents();
return view->rootObject();
}
diff --git a/tests/unit/mainview13/tst_mainview.cpp b/tests/unit/mainview13/tst_mainview.cpp
index 36c5c78cc..287dd75ee 100644
--- a/tests/unit/mainview13/tst_mainview.cpp
+++ b/tests/unit/mainview13/tst_mainview.cpp
@@ -57,7 +57,7 @@ public:
{
// load the document
view->setSource(QUrl::fromLocalFile(document));
- QTest::waitForEvents();
+ qApp->processEvents();
return view->rootObject();
}
diff --git a/tests/unit/mousefilters/tst_mousefilterstest.cpp b/tests/unit/mousefilters/tst_mousefilterstest.cpp
index 955289a07..dc0b28bac 100644
--- a/tests/unit/mousefilters/tst_mousefilterstest.cpp
+++ b/tests/unit/mousefilters/tst_mousefilterstest.cpp
@@ -146,7 +146,7 @@ private Q_SLOTS:
preventDblClick();
QTest::mouseClick(view.data(), Qt::LeftButton, 0, guPoint(2, 2));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(view->rootObject()->hasFocus(), true);
QCOMPARE(pressed.count(), 1);
QCOMPARE(released.count(), 1);
@@ -175,7 +175,7 @@ private Q_SLOTS:
preventDblClick();
QTest::mouseClick(view.data(), Qt::LeftButton, 0, guPoint(2, 2));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(view->rootObject()->hasFocus(), true);
QCOMPARE(pressed.count(), 1);
QCOMPARE(released.count(), 1);
@@ -204,7 +204,7 @@ private Q_SLOTS:
preventDblClick();
QTest::mouseClick(view.data(), Qt::LeftButton, 0, guPoint(10, 10));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(view->rootObject()->hasFocus(), false);
QCOMPARE(pressed.count(), 1);
QCOMPARE(released.count(), 1);
@@ -234,7 +234,7 @@ private Q_SLOTS:
preventDblClick();
QTest::mouseClick(view.data(), Qt::LeftButton, 0, guPoint(10, 10));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(view->rootObject()->hasFocus(), false);
QCOMPARE(pressed.count(), 1);
QCOMPARE(released.count(), 1);
@@ -265,7 +265,7 @@ private Q_SLOTS:
QTest::mousePress(view.data(), Qt::LeftButton, 0, guPoint(2, 2));
QTest::mouseMove(view.data(), guPoint(2.2, 2.2));
QTest::mouseRelease(view.data(), Qt::LeftButton, 0, guPoint(2.2, 2.2));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(view->rootObject()->hasFocus(), true);
QCOMPARE(pressed.count(), 1);
QCOMPARE(released.count(), 1);
@@ -296,7 +296,7 @@ private Q_SLOTS:
QTest::mousePress(view.data(), Qt::LeftButton, 0, guPoint(10, 10));
QTest::mouseMove(view.data(), guPoint(10.2, 10.2));
QTest::mouseRelease(view.data(), Qt::LeftButton, 0, guPoint(10.2, 10.2));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(view->rootObject()->hasFocus(), false);
QCOMPARE(pressed.count(), 1);
QCOMPARE(released.count(), 1);
@@ -327,7 +327,7 @@ private Q_SLOTS:
QTest::mousePress(view.data(), Qt::LeftButton, 0, guPoint(2, 2));
QTest::mouseMove(view.data(), guPoint(2.7, 2.7));
QTest::mouseRelease(view.data(), Qt::LeftButton, 0, guPoint(2.7, 2.7));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(view->rootObject()->hasFocus(), true);
QCOMPARE(pressed.count(), 1);
QCOMPARE(released.count(), 1);
@@ -358,7 +358,7 @@ private Q_SLOTS:
QTest::mousePress(view.data(), Qt::LeftButton, 0, guPoint(10, 10));
QTest::mouseMove(view.data(), guPoint(10.6, 10.6));
QTest::mouseRelease(view.data(), Qt::LeftButton, 0, guPoint(10.6, 10.6));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(view->rootObject()->hasFocus(), false);
QCOMPARE(pressed.count(), 1);
QCOMPARE(released.count(), 1);
@@ -395,10 +395,10 @@ private Q_SLOTS:
// introduce small delay to suppress double clicks
preventDblClick();
QTest::mouseClick(view.data(), Qt::LeftButton, 0, guPoint(10, 10));
- QTest::waitForEvents();
+ qApp->processEvents();
preventDblClick();
QTest::mouseClick(view.data(), Qt::LeftButton, 0, guPoint(10, 69));
- QTest::waitForEvents();
+ qApp->processEvents();
if (!inputPanelPresent()) {
QEXPECT_FAIL(0, "No OSK installed", Abort);
}
@@ -432,7 +432,7 @@ private Q_SLOTS:
QTest::mousePress(view.data(), Qt::LeftButton, 0, guPoint(2, 2));
QTest::mouseMove(view.data(), guPoint(2.7, 2.7));
QTest::mouseRelease(view.data(), Qt::LeftButton, 0, guPoint(2.7, 2.7));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(view->rootObject()->hasFocus(), true);
QCOMPARE(pressed.count(), 1);
QCOMPARE(released.count(), 1);
@@ -464,7 +464,7 @@ private Q_SLOTS:
QTest::mousePress(view.data(), Qt::LeftButton, 0, guPoint(10, 10));
QTest::mouseMove(view.data(), guPoint(10.5, 10.5));
QTest::mouseRelease(view.data(), Qt::LeftButton, 0, guPoint(10.5, 10.5));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(view->rootObject()->hasFocus(), false);
QCOMPARE(pressed.count(), 1);
QCOMPARE(released.count(), 1);
@@ -496,7 +496,7 @@ private Q_SLOTS:
QTest::mousePress(view.data(), Qt::LeftButton, 0, guPoint(10, 10));
QTest::mouseMove(view.data(), guPoint(15, 15));
QTest::mouseRelease(view.data(), Qt::LeftButton, 0, guPoint(15, 15));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(view->rootObject()->hasFocus(), false);
QCOMPARE(pressed.count(), 1);
QCOMPARE(released.count(), 1);
@@ -519,7 +519,7 @@ private Q_SLOTS:
preventDblClick();
mousePressAndHold(view.data(), Qt::LeftButton, 0, guPoint(2, 2));
QTest::mouseRelease(view.data(), Qt::LeftButton, 0, guPoint(2, 2));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(view->rootObject()->hasFocus(), true);
QCOMPARE(pressAndHold.count(), 1);
QCOMPARE(clicked.count(), 0);
@@ -536,7 +536,7 @@ private Q_SLOTS:
preventDblClick();
mousePressAndHold(view.data(), Qt::LeftButton, 0, guPoint(2, 2));
QTest::mouseRelease(view.data(), Qt::LeftButton, 0, guPoint(2, 2));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(view->rootObject()->hasFocus(), true);
QCOMPARE(pressAndHold.count(), 1);
QCOMPARE(clicked.count(), 1);
@@ -556,7 +556,7 @@ private Q_SLOTS:
preventDblClick();
QTest::mouseDClick(view.data(), Qt::LeftButton, 0, guPoint(2, 2));
- QTest::waitForEvents();
+ qApp->processEvents();
QVariant selectedText = input->property("selectedText");
QCOMPARE(input->hasFocus(), true);
QVERIFY(selectedText.isValid());
@@ -600,7 +600,7 @@ private Q_SLOTS:
preventDblClick();
QTest::mouseClick(view.data(), Qt::LeftButton, 0, guPoint(2, 2));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(input->hasFocus(), true);
QCOMPARE(pressed.count(), 1);
QCOMPARE(released.count(), 1);
@@ -631,7 +631,7 @@ private Q_SLOTS:
preventDblClick();
QTest::mouseClick(view.data(), Qt::LeftButton, 0, guPoint(2, 2));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(input->hasFocus(), false);
// only the pressed was blocked, the rest of the events land in the proxy
QCOMPARE(pressed.count(), 0);
@@ -663,7 +663,7 @@ private Q_SLOTS:
preventDblClick();
QTest::mouseClick(view.data(), Qt::LeftButton, 0, guPoint(2, 2));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(input->hasFocus(), false);
QCOMPARE(pressed.count(), 1);
QCOMPARE(released.count(), 1);
@@ -694,7 +694,7 @@ private Q_SLOTS:
preventDblClick();
QTest::mouseClick(view.data(), Qt::LeftButton, 0, guPoint(2, 2));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(input->hasFocus(), true);
QCOMPARE(pressed.count(), 0);
QCOMPARE(released.count(), 1);
@@ -725,7 +725,7 @@ private Q_SLOTS:
preventDblClick();
QTest::mouseClick(view.data(), Qt::LeftButton, 0, guPoint(2, 2));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(input->hasFocus(), false);
QCOMPARE(pressed.count(), 1);
QCOMPARE(released.count(), 1);
@@ -756,7 +756,7 @@ private Q_SLOTS:
preventDblClick();
QTest::mouseClick(input->window(), Qt::LeftButton, 0, guPoint(10, 7));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(input->hasFocus(), true);
QCOMPARE(pressed.count(), 1);
QCOMPARE(released.count(), 1);
@@ -780,7 +780,7 @@ private Q_SLOTS:
preventDblClick();
QTest::mouseDClick(input->window(), Qt::LeftButton, 0, guPoint(10, 7));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(input->hasFocus(), true);
QVariant selectedText = input->property("selectedText");
QVERIFY(selectedText.isValid());
@@ -807,7 +807,7 @@ private Q_SLOTS:
preventDblClick();
QTest::mouseClick(view.data(), Qt::LeftButton, 0, guPoint(2, 2));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(input->hasFocus(), true);
QCOMPARE(pressed.count(), 1);
QCOMPARE(released.count(), 0);
@@ -843,9 +843,9 @@ private Q_SLOTS:
for (int i = 0; i < 30; i++) {
QTest::mouseMove(flickable->window(), guPoint(5 + i, 5 + i));
}
- QTest::waitForEvents();
+ qApp->processEvents();
QTest::mouseRelease(flickable->window(), Qt::LeftButton, 0, guPoint(35, 35));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(pressed.count(), 1);
QCOMPARE(released.count(), 1);
@@ -883,7 +883,7 @@ private Q_SLOTS:
QTest::mouseMove(flickable->window(), guPoint(5 + i, 5 + i));
}
QTest::mouseRelease(flickable->window(), Qt::LeftButton, 0, guPoint(35, 35));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(pressed.count(), 1);
QCOMPARE(released.count(), 1);
@@ -913,7 +913,7 @@ private Q_SLOTS:
// Note: press inside the filtered area, so entered() exited() positionChanged() will
// all receive the pressed button
QTest::mousePress(view.data(), Qt::LeftButton, 0, guPoint(5, 5));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(entered.count(), 1);
// when entered(), buttons are the same as when pressed
QCOMPARE(mouseEventParams.handler, QString("EVENT1"));
@@ -921,12 +921,12 @@ private Q_SLOTS:
QTest::mouseMove(view.data(), guPoint(15, 5));
QTest::mouseMove(view.data(), guPoint(25, 5));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(mouseEvent2Params.handler, QString("EVENT2"));
QCOMPARE(mouseEvent2Params.pressedButton, Qt::LeftButton);
QTest::mouseRelease(view.data(), Qt::LeftButton, 0, guPoint(35, 5));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(exited.count(), 1);
// when entered(), button is the same when pressed, however buttons
// does no longer contains the button pressed
@@ -1005,14 +1005,14 @@ private Q_SLOTS:
//center of the view
QTest::mouseMove(view.data(), guPoint(1, 1));
QTest::mouseMove(view.data(), guPoint(15, 15));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(entered.count(), 1);
QCOMPARE(mouseEvent3Params.handler, QString("EVENT4"));
QCOMPARE(mouseEvent3Params.pressedButton, Qt::NoButton);
QTest::mousePress(view.data(), Qt::LeftButton, 0, guPoint(15, 15));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(mouseEventParams.handler, QString("EVENT1"));
QCOMPARE(mouseEventParams.pressedButton, Qt::LeftButton);
@@ -1020,7 +1020,7 @@ private Q_SLOTS:
//go out of the mousearea on the right
QTest::mouseMove(view.data(), guPoint(45, 15));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(mouseEvent2Params.handler, QString("EVENT2"));
QCOMPARE(mouseEvent2Params.pressedButton, Qt::LeftButton);
QCOMPARE(exited.count(), 1);
@@ -1029,7 +1029,7 @@ private Q_SLOTS:
//move back in
QTest::mouseMove(view.data(), guPoint(25, 15));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(mouseEvent2Params.handler, QString("EVENT2"));
QCOMPARE(mouseEvent2Params.pressedButton, Qt::LeftButton);
QCOMPARE(entered.count(), 2);
@@ -1038,7 +1038,7 @@ private Q_SLOTS:
//and out again
QTest::mouseMove(view.data(), guPoint(45, 15));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(mouseEvent2Params.handler, QString("EVENT2"));
QCOMPARE(mouseEvent2Params.pressedButton, Qt::LeftButton);
QCOMPARE(exited.count(), 2);
@@ -1046,7 +1046,7 @@ private Q_SLOTS:
QCOMPARE(mouseEvent3Params.pressedButton, Qt::LeftButton);
QTest::mouseRelease(view.data(), Qt::LeftButton, 0, guPoint(45, 15));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(positionChanged.count(), 4);
}
@@ -1104,13 +1104,13 @@ private Q_SLOTS:
// produce long press
// FIXME move this under UbuntuTestCase
mousePressAndHold(test.data(), Qt::LeftButton, 0, guPoint(20, 30));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(hostHoldSpy.count(), 1);
QCOMPARE(proxyHoldSpy.count(), 1);
// click
QTest::mouseRelease(test.data(), Qt::LeftButton, 0, guPoint(20, 30));
- QTest::waitForEvents();
+ qApp->processEvents();
}
void testCase_forwardComposedEventsToProxy_whenMoved()
@@ -1133,13 +1133,13 @@ private Q_SLOTS:
QTest::mouseMove(test.data(), guPoint(20 + i, 30 + i));
}
QTest::qWait(UCMouse::DefaultPressAndHoldDelay / 2 + 200);
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(hostHoldSpy.count(), 0);
QCOMPARE(proxyHoldSpy.count(), 0);
// click
QTest::mouseRelease(test.data(), Qt::LeftButton, 0, guPoint(20, 30));
- QTest::waitForEvents();
+ qApp->processEvents();
}
void testCase_forwardToChainedItems()
@@ -1162,7 +1162,7 @@ private Q_SLOTS:
QObject::connect(proxy2, SIGNAL(pressed(QQuickMouseEvent*,QQuickItem*)), this, SLOT(onMouseEvent3(QQuickMouseEvent*,QQuickItem*)));
QTest::mousePress(test.data(), Qt::LeftButton, 0, guPoint(20, 30));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(hostPressed.count(), 1);
QCOMPARE(proxy1Pressed.count(), 1);
QCOMPARE(proxy2Pressed.count(), 1);
@@ -1173,7 +1173,7 @@ private Q_SLOTS:
// click
QTest::mouseRelease(test.data(), Qt::LeftButton, 0, guPoint(20, 30));
- QTest::waitForEvents();
+ qApp->processEvents();
}
void testCase_ignoreSynthesizedEvents() {
@@ -1199,32 +1199,32 @@ private Q_SLOTS:
//send a touch event, which will be converted to a synthesized mouse event, since
//no item in this QML is handling touch events
UCTestExtras::touchPress(0, overlayArea, guPoint(15, 15));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(areaPressed.count(), 0);
QCOMPARE(overlayAreaPressed.count(), 1);
QCOMPARE(overlayFilterPressed.count(), 0);
UCTestExtras::touchRelease(0, overlayArea, guPoint(15, 15));
- QTest::waitForEvents();
+ qApp->processEvents();
overlayFilter->setProperty("ignoreSynthesizedEvents", false);
QCOMPARE(overlayFilter->property("ignoreSynthesizedEvents").toBool(), false);
UCTestExtras::touchPress(1, overlayArea, guPoint(15, 15));
- QTest::waitForEvents();
+ qApp->processEvents();
QCOMPARE(areaPressed.count(), 0);
//the filter doesn't accept the pressed event by default
QCOMPARE(overlayAreaPressed.count(), 2);
QCOMPARE(overlayFilterPressed.count(), 1);
UCTestExtras::touchRelease(1, overlayArea, guPoint(15, 15));
- QTest::waitForEvents();
+ qApp->processEvents();
overlayArea->setEnabled(false);
QCOMPARE(overlayArea->isEnabled(), false);
UCTestExtras::touchPress(2, overlayArea, guPoint(15, 15));
- QTest::waitForEvents();
+ qApp->processEvents();
//the filter gets the event but its owner is not enabled, so we expect it
//to propagate to the area underneath
@@ -1232,7 +1232,7 @@ private Q_SLOTS:
QCOMPARE(overlayAreaPressed.count(), 2);
QCOMPARE(overlayFilterPressed.count(), 2);
UCTestExtras::touchRelease(2, overlayArea, guPoint(15, 15));
- QTest::waitForEvents();
+ qApp->processEvents();
}
};
diff --git a/tests/unit/performance/tst_performance.cpp b/tests/unit/performance/tst_performance.cpp
index 605ef79c4..ce31de076 100644
--- a/tests/unit/performance/tst_performance.cpp
+++ b/tests/unit/performance/tst_performance.cpp
@@ -35,7 +35,7 @@ private:
QQuickItem *loadDocument(const QString &document)
{
quickView->setSource(QUrl::fromLocalFile(document));
- QTest::waitForEvents();
+ qApp->processEvents();
return quickView->rootObject();
}
diff --git a/tests/unit/statesaver/tst_statesaver.cpp b/tests/unit/statesaver/tst_statesaver.cpp
index 19c2a0c21..4c55d903d 100644
--- a/tests/unit/statesaver/tst_statesaver.cpp
+++ b/tests/unit/statesaver/tst_statesaver.cpp
@@ -458,7 +458,7 @@ private Q_SLOTS:
QVERIFY(topLoader);
topLoader->setProperty("source", "Dynamic.qml");
- QTest::waitForEvents();
+ qApp->processEvents();
QObject *testItem = view->rootObject()->findChild<QObject*>("testItem");
QVERIFY(testItem);
diff --git a/tests/unit/subtheming/tst_subtheming.cpp b/tests/unit/subtheming/tst_subtheming.cpp
index 77e099cee..1db1de29e 100644
--- a/tests/unit/subtheming/tst_subtheming.cpp
+++ b/tests/unit/subtheming/tst_subtheming.cpp
@@ -739,7 +739,7 @@ private Q_SLOTS:
void test_mixed_versions() {
ThemeTestCase::ignoreWarning("OtherVersion.qml", 19, 1, "QML StyledItem: Mixing of Ubuntu.Components module versions 1.3 and 1.2 detected!");
QScopedPointer<ThemeTestCase> view(new ThemeTestCase("OtherVersion.qml"));
- QTest::waitForEvents();
+ qApp->processEvents();
UCStyledItemBase *newStyled = static_cast<UCStyledItemBase*>(view->rootObject());
UCStyledItemBase *otherStyled = view->findItem<UCStyledItemBase*>("otherStyled");
QCOMPARE(UCStyledItemBasePrivate::get(newStyled)->styleInstance()->objectName(), QString("OptionSelector13"));
--
2.20.1

View file

@ -0,0 +1,54 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=ubuntu-ui-toolkit
pkgver=0_git20180422
_commit="2f541e8b5e509ad40cd8dc70d634434e7ab8fc42"
pkgrel=0
pkgdesc='The Ubuntu UI toolkit used in Ubuntu Touch'
arch="x86_64"
url="https://unity8.io"
license="LGPL-3.0"
depends="qt5-qtfeedback"
depends_dev="libnih-dev qt5-qtsvg-dev qt5-qtpim-dev qt5-qtsystems-dev lttng-ust-dev libxi-dev eudev-dev mir-dev libevdev-dev qt5-qtgraphicaleffects qt5-qtfeedback-dev"
makedepends="$depends_dev qt5-qttools-dev qt5-qtdeclarative-dev"
source="$pkgname-$_commit.tar.gz::https://github.com/ubports/$pkgname/archive/$_commit.tar.gz
0001-Adapt-to-QtPim-API-changes.patch
0002-Fix-Missing-sentinel-in-function-call-warning.patch
0003-Add-option-to-disable-building-of-docs.patch
0004-Make-it-compile-with-Qt-5.12.patch
0005-Adjust-for-removed-QTest-waitForEvents-method.patch
replace-bash-for-sh.patch"
subpackages="$pkgname-dev $pkgname-lang"
options="!check" # Complaining about a non-existing file
builddir="$srcdir/$pkgname-$_commit"
prepare() {
default_prepare
# Lets warnings be warnings and not errors
sed -i 's|warning_clean|warn_off|' "$builddir"/.qmake.conf
}
build() {
cd "$builddir"
qmake-qt5 "CONFIG+=no_docs"
make
}
check() {
cd "$builddir"
make check
}
package() {
cd "$builddir"
make INSTALL_ROOT="$pkgdir" install
}
sha512sums="9f2d4707db936eb262893b226ffda71c886dcb2a99cb3c2e169f12f80ba04836717322a43f28919a75f43c57c8a6b1ebf52cd74cca50af0d8a657708faf81502 ubuntu-ui-toolkit-2f541e8b5e509ad40cd8dc70d634434e7ab8fc42.tar.gz
d293464a334fdbdf6a61700002a692d2e101803b8aa46effd004c84341fca993f4a17fda55ba22eb1bd628a400e54b8f1e6c4cb1f690f49405e6f3f3122f1475 0001-Adapt-to-QtPim-API-changes.patch
7dbdc3d2d3de42820cd628f59f959c18f26189e3c690cacbefdc51c4913186d954137b0997da206a2004ba837fb7f6bdce64c9ab4fe013044ce857507bb8e7d6 0002-Fix-Missing-sentinel-in-function-call-warning.patch
13109d75e1922a9b750e0d528d120d85a164be045f2db728a5cdf637eebc8aca0633ca7d4e766c71f57a1ee10892f36841ad3351a2db72289059ae7d00e43da1 0003-Add-option-to-disable-building-of-docs.patch
5b5c00bd365ee4068e2e0622a0ce31c7b67b0c6cf136b0d717dd68ac9559bc2d9c54e1e0c9106fa1d6e3438de974fa8b44c023888fe87bc1d1ed584023184eba 0004-Make-it-compile-with-Qt-5.12.patch
402f529c6eba4e384ba0c7789fd6c23757b278befa24f9b8b23a0d11b6a1ffe4abab28d188e77f606708a2e23a89bf4ec0c04e65e51efb82b448d4257b276381 0005-Adjust-for-removed-QTest-waitForEvents-method.patch
e01567f2426f78b0862e7b09cd99cabf3d885b600592e6a4f0e07dc077fae2ba8dd1d2deba3bb89d31171a90db6de909281664bcbc7736b9432f2bc0b26544e1 replace-bash-for-sh.patch"

View file

@ -0,0 +1,10 @@
diff --git a/documentation/docs.sh b/documentation/docs.sh
index 10fcfc49d..aa93dea62 100755
--- a/documentation/docs.sh
+++ b/documentation/docs.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
#
# Copyright 2012 Canonical Ltd.
#

42
unity8/unity-api/APKBUILD Normal file
View file

@ -0,0 +1,42 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=unity-api
pkgver=0_git20190129
_commit="417d59b748bf2fc914561e671603399bf3818f6e"
pkgrel=0
pkgdesc="API for Unity shell integration"
url="https://github.com/ubports/unity-api"
arch="x86_64"
license="LGPL-3.0"
depends=""
depends_dev=""
makedepends="$depends_dev cmake cmake-extras qt5-qtdeclarative-dev libqtdbustest gtest-dev gmock"
source="$pkgname-$_commit.tar.gz::https://github.com/ubports/$pkgname/archive/$_commit.tar.gz
qmltestrunner.patch
gtest.patch"
subpackages="$pkgname-dev"
builddir="$srcdir/$pkgname-$_commit"
options="!check" # 88% tests passed, 3 tests failed out of 26
build() {
mkdir "$builddir"/build
cd "$builddir"/build
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib ..
make
}
check() {
cd "$builddir"/build
CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}
package() {
cd "$builddir"/build
make DESTDIR="$pkgdir" install
}
sha512sums="8bced72af9a3cecac9786ca079c7e28a6867de44e68f80e846e4ddba913ab39b60c3bcab0d38a1a7fb62f3195b33057493e26d72cda075f65e73ee035f9a8fea unity-api-417d59b748bf2fc914561e671603399bf3818f6e.tar.gz
8695998cb0451943ff08f00be52766d27c439184b1e8531a563cffe4bf4251dea52d5bc3493d797f4f6007f13130930c6b0cfb2c04b9dc54e6891e17c2978fb9 qmltestrunner.patch
d1fdccdf8d2b31d3be68478ba671514bc83afd26c756062f3f4a3cb1ee05331efb1ca5092b612449cc00552f8dd7071ba22903b5d336cc34b5bc94077a00d51e gtest.patch"

View file

@ -0,0 +1,49 @@
diff --git a/test/gtest/CMakeLists.txt b/test/gtest/CMakeLists.txt
index b2e105c..b1fa79e 100644
--- a/test/gtest/CMakeLists.txt
+++ b/test/gtest/CMakeLists.txt
@@ -1,7 +1,6 @@
find_package(Threads REQUIRED)
-set(TESTLIBDIR ${CMAKE_BINARY_DIR}/test/gtest/libgtest/build)
-set(LIBGTEST gtest)
-set(TESTLIBS ${TESTLIBS} ${LIBGTEST} ${CMAKE_THREAD_LIBS_INIT})
+find_package(GMock REQUIRED)
+set(TESTLIBS ${TESTLIBS} ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
# gtest does weird things with its own implementation of tr1::tuple. For clang, we need to
# set this macro, otherwise anything that includes gtest.h won't compile.
@@ -9,7 +8,6 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGTEST_USE_OWN_TR1_TUPLE=1")
endif()
-add_subdirectory(libgtest)
add_subdirectory(unity)
set(TEST_SRC
diff --git a/test/gtest/libgtest/CMakeLists.txt b/test/gtest/libgtest/CMakeLists.txt
deleted file mode 100644
index e4b4074..0000000
--- a/test/gtest/libgtest/CMakeLists.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-if (NOT DEFINED GTEST_ROOT)
- set(GTEST_ROOT /usr/src/gtest)
-endif()
-
-# Do not use -Wsuggest-override here, we can't fix gtest
-string (REPLACE "-Wsuggest-override" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
-
-set(GTEST_SRC_DIR "${GTEST_ROOT}/src")
-set(GTEST_INCLUDE_DIR ${GTEST_ROOT})
-
-add_library(gtest STATIC
-${GTEST_SRC_DIR}/gtest-all.cc
-${GTEST_SRC_DIR}/gtest_main.cc
-)
-
-set_target_properties(gtest PROPERTIES INCLUDE_DIRECTORIES ${GTEST_INCLUDE_DIR})
-
-# Clang complains about unused private field 'pretty_' in gtest-internal-inl.h.
-if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
- set_target_properties(gtest PROPERTIES COMPILE_FLAGS "-Wno-unused-private-field")
-endif()

View file

@ -0,0 +1,13 @@
diff --git a/cmake/modules/QmlTest.cmake b/cmake/modules/QmlTest.cmake
index 8241703..d209b55 100644
--- a/cmake/modules/QmlTest.cmake
+++ b/cmake/modules/QmlTest.cmake
@@ -15,7 +15,7 @@
# qmltest_DEFAULT_IMPORT_PATHS
# qmltest_DEFAULT_PROPERTIES
-find_program(qmltestrunner_exe qmltestrunner)
+find_program(qmltestrunner_exe qmltestrunner-qt5)
if(NOT qmltestrunner_exe)
message(FATAL_ERROR "Could not locate qmltestrunner.")

Some files were not shown because too many files have changed in this diff Show more