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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
Reference in New Issue
Block a user