aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--testing/anbox/APKBUILD55
-rw-r--r--testing/anbox/anbox-networkmanager.post-deinstall3
-rw-r--r--testing/anbox/anbox-networkmanager.post-install7
-rw-r--r--testing/anbox/disable-tests.patch92
-rw-r--r--testing/anbox/fix-arm-build.patch24
-rw-r--r--testing/anbox/fix-gtest-use.patch146
6 files changed, 178 insertions, 149 deletions
diff --git a/testing/anbox/APKBUILD b/testing/anbox/APKBUILD
index 4488cb0a8c..409c2b6da9 100644
--- a/testing/anbox/APKBUILD
+++ b/testing/anbox/APKBUILD
@@ -3,16 +3,15 @@
# Contributor: Antoine Fontaine <antoine.fontaine@epfl.ch>
# Maintainer:
pkgname=anbox
-pkgver=0_git20200102
-pkgrel=1
-_commit="b18e62218af49ee882abd00da2ef540142e59784"
+pkgver=0_git20200303
+pkgrel=0
+_commit="3ed2e6d5c360d57b6aa61386e279adf3ff155ded"
_cpu_features_commit="b5c271c53759b2b15ff91df19bd0b32f2966e275"
pkgdesc="Android in a box"
url="https://github.com/anbox/anbox"
-arch="x86_64 armhf armv7 aarch64"
+arch="x86_64 armv7 aarch64"
license="GPL-3.0-or-later"
-options="!check" # TODO: make checks work
-subpackages="$pkgname-openrc $pkgname-networkmanager"
+subpackages="$pkgname-openrc"
install="$pkgname.post-install"
depends="
dbus
@@ -38,15 +37,15 @@ makedepends="
elogind-dev
properties-cpp-dev
libexecinfo-dev
+ gtest-dev
"
source="
$pkgname-$_commit.tar.gz::https://github.com/anbox/anbox/archive/$_commit.tar.gz
cpu_features-$_cpu_features_commit.tar.gz::https://github.com/google/cpu_features/archive/$_cpu_features_commit.tar.gz
anbox-container-manager.initd
anbox.confd
- disable-tests.patch
musl-fixes.patch
- fix-arm-build.patch
+ fix-gtest-use.patch
give-more-time-to-start.patch
anbox-launch.sh
anbox.desktop
@@ -54,11 +53,12 @@ source="
builddir="$srcdir/$pkgname-$_commit"
prepare() {
- default_prepare
-
- rm -rf external/cpu_features
+ # the bundled cpu_features is outdated and breaks build on arm.
+ rm -r external/cpu_features
cp -r $srcdir/cpu_features-*/ external/cpu_features
+ default_prepare
+
mkdir -p "$builddir"/build
}
@@ -69,43 +69,52 @@ build() {
-DCMAKE_INSTALL_LIBDIR=lib \
-DBUILD_SHARED_LIBS=True \
-DCMAKE_BUILD_TYPE=None \
- -DBUILD_TESTING=OFF \
-DWerror=OFF
make
}
+check() {
+ cd "$builddir"/build
+ make test
+}
+
package() {
cd "$builddir"/build
DESTDIR="$pkgdir" make install
+ # CPU Feature install itself. That's bad.
+ rm "$pkgdir"/usr/bin/list_cpu_features
+ rm "$pkgdir"/usr/lib/backward/BackwardConfig.cmake
+ rm -r "$pkgdir"/usr/lib/cmake/CpuFeatures
+ rm -r "$pkgdir"/usr/include
+
install -m755 -D "$srcdir"/anbox-container-manager.initd \
"$pkgdir"/etc/init.d/anbox-container-manager
install -m644 -D "$srcdir"/$pkgname.confd \
"$pkgdir"/etc/conf.d/$pkgname
install -m755 -D "$srcdir"/$pkgname-launch.sh \
"$pkgdir"/usr/bin/$pkgname-launch
+
install -m644 -D "$srcdir"/$pkgname.desktop \
"$pkgdir"/usr/share/applications/$pkgname.desktop
+ install -m644 -D "$builddir"/snap/gui/icon.png \
+ "$pkgdir"/usr/share/icons/hicolor/512x512/anbox.png
+
+ # this is a dependency of the init script
install -m755 -D "$builddir"/scripts/anbox-bridge.sh \
"$pkgdir"/usr/share/anbox/anbox-bridge.sh
+ # this is for convinience, to allow someone to get root access
+ install -m755 -D "$builddir"/scripts/anbox-shell.sh \
+ "$pkgdir"/usr/share/anbox/anbox-shell.sh
}
-networkmanager() {
- #install_if="$pkgname networkmanager" # causes issues, let's keep it installed manually for now
- depends="$pkgname networkmanager"
- install="$pkgname-networkmanager.post-install $pkgname-networkmanager.post-deinstall"
- pkgdesc="$pkgdesc, internet access support"
- mkdir "$subpkgdir"
-}
-
-sha512sums="5abf2191968a68f2d9fcde5e85a9d174212506d3c848115e0859b2c41baadaeab08a6828449e3edd5023829432698aa8bbd9c6e16c8ce8560974db1403bbd556 anbox-b18e62218af49ee882abd00da2ef540142e59784.tar.gz
+sha512sums="e75030e2c522c7561677a61d395fbbde4eb4fee316ccf803a12e338820091384a604198f1a05e6a8746fec766f9a9b06995fadd15917d835fc45010775a2d4e6 anbox-3ed2e6d5c360d57b6aa61386e279adf3ff155ded.tar.gz
c0ec9b603cec2cc9049923e15ef50c85806bc0a0ffe57b63348631061aeddb73c1eca910b25696cf5eac2606aec3f86db29e8a01e01cf438bfee86edfe909e4a cpu_features-b5c271c53759b2b15ff91df19bd0b32f2966e275.tar.gz
5a8e76fd636670bdfcbf45c290c06f9399df7831af121e0a6238cc5d7d57d6f7036bca2d457c07f3f694df6f7a574a4e5ace6b1ad3a5e17a68fd638a299faa99 anbox-container-manager.initd
6a3bc88142c5287ec54d481a4788eceb7772d9974af950b5286ce63a49d05d9d49fce5ba1d02b4b1c9893896fd4ba218fd4d39b8e640bdd61ad196b5d5c9a021 anbox.confd
-3351edbd50370f514e405f10584264b110cd3d5eff766185b23d4c7e885933f0378330df5222fbd4b5161ff81f292ea63b4940f4afb1c457a2511fe8b5110195 disable-tests.patch
401669509e05eb586ad40fc9e8f4284b52183f06c60e87bf4e923be165a72f10263daf226db7fd610ef6ff25d09abd140ca2d59187e2d1b85a0bd6ae887dd944 musl-fixes.patch
-897a6f0fddd9d963f6c66e4561f5b468856dd94c8df500f27b08b2bfcef8c0d253f985333b501447afbe3e2abf5d354523b1db0304b87e762abcd4f1d8cac2e7 fix-arm-build.patch
+cb9e11cff5cbc03dbb9f69e3600f1cb8cbff0ef896ea5fc665e41a0556a9c57164cf3cf7b422e229c515af10894817e5b797aba5be7ead6aa05d6a024e7c2e50 fix-gtest-use.patch
4f4439a0f991a77a157464280fd9d43fcff1319effc9bdd235fc61f16c3fbef59d8585ae363326179dd4b1f71e4d206498844361d1418846eb42c5a0d40db33b give-more-time-to-start.patch
d88bc45b681b6ed318279ee4485ae0d47fd648f207722c094906b61c74d7c373762cdaba890fa577467da99204681cd502051071ee61b2c1c555732e403b4e15 anbox-launch.sh
bc3bec88f271484ef66afb862e517b614568270a4047e400995f73b08ce05cb4faa18a746db161711ec91ef125f0063127e4027699921302406405bbb778583d anbox.desktop"
diff --git a/testing/anbox/anbox-networkmanager.post-deinstall b/testing/anbox/anbox-networkmanager.post-deinstall
deleted file mode 100644
index 2bfb4fcf05..0000000000
--- a/testing/anbox/anbox-networkmanager.post-deinstall
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-nmcli connection delete anbox-net
diff --git a/testing/anbox/anbox-networkmanager.post-install b/testing/anbox/anbox-networkmanager.post-install
deleted file mode 100644
index 1614b60226..0000000000
--- a/testing/anbox/anbox-networkmanager.post-install
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-nmcli connection add type bridge ifname anbox0 -- connection.id anbox-net ipv4.method shared ipv4.addresses 192.168.250.1/24
-
-# Alternatively, we could use the anbox-bridge script
-# that relies on iptables.
-# https://github.com/anbox/anbox/blob/master/scripts/anbox-bridge.sh
diff --git a/testing/anbox/disable-tests.patch b/testing/anbox/disable-tests.patch
deleted file mode 100644
index 30d4a3b379..0000000000
--- a/testing/anbox/disable-tests.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 4ee5b98..8aaa3db 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -1,7 +1,6 @@
- project(anbox C CXX)
- cmake_minimum_required(VERSION 2.8.2)
-
--include(CTest)
- include(GNUInstallDirs)
-
- if (NOT CMAKE_BUILD_TYPE)
-@@ -91,8 +90,6 @@ IF(CMAKE_BUILD_TYPE MATCHES [cC][oO][vV][eE][rR][aA][gG][eE])
- SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -ftest-coverage -fprofile-arcs" )
- ENDIF(CMAKE_BUILD_TYPE MATCHES [cC][oO][vV][eE][rR][aA][gG][eE])
-
--find_package(GMock)
--
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -fPIC")
-
- set(ANBOX_TRANSLATOR_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/anbox/translators)
-@@ -113,7 +110,6 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/anbox/build/config.h.in
-
- add_subdirectory(external)
- add_subdirectory(src)
--add_subdirectory(tests)
- add_subdirectory(android)
-
- if (NOT "${HOST_CMAKE_C_COMPILER}" STREQUAL "")
-diff --git a/external/android-emugl/googletest.mk b/external/android-emugl/googletest.mk
-deleted file mode 100644
-index 9d8e5c0..0000000
---- a/external/android-emugl/googletest.mk
-+++ /dev/null
-@@ -1,37 +0,0 @@
--# This contains common definitions used to define a host module
--# to link GoogleTest with the EmuGL test programs.
--#
--# This is used instead of including external/gtest/Android.mk to
--# be able to build both the 32-bit and 64-bit binaries while
--# building a 32-bit only SDK (sdk-eng, sdk_x86-eng, sdk_mips-eng).
--
--
--LOCAL_PATH := $(EMULATOR_GTEST_SOURCES_DIR)
--
--common_SRC_FILES := \
-- src/gtest-all.cc \
-- src/gtest_main.cc
--
--common_CFLAGS := -O0
--
--ifneq (windows,$(BUILD_TARGET_OS))
-- common_LDLIBS += -lpthread
--endif
--
--$(call emugl-begin-host-static-library,libemugl_gtest)
--LOCAL_SRC_FILES := $(common_SRC_FILES)
--LOCAL_CFLAGS += $(common_CFLAGS)
--LOCAL_CPP_EXTENSION := .cc
--$(call emugl-export,C_INCLUDES,$(LOCAL_PATH)/include)
--$(call emugl-export,LDLIBS,$(common_LDLIBS))
--$(call emugl-end-module)
--
--$(call emugl-begin-host-static-library,libemugl_gtest_host)
--LOCAL_SRC_FILES := $(common_SRC_FILES)
--LOCAL_CFLAGS += $(common_CFLAGS)
--LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
--LOCAL_CPP_EXTENSION := .cc
--$(call emugl-export,C_INCLUDES,$(LOCAL_PATH)/include)
--$(call emugl-export,LDLIBS,$(common_LDLIBS) -lpthread)
--LOCAL_HOST_BUILD := true
--$(call emugl-end-module)
-diff --git a/external/android-emugl/shared/emugl/common/CMakeLists.txt b/external/android-emugl/shared/emugl/common/CMakeLists.txt
-index 09388c6..c4f659d 100644
---- a/external/android-emugl/shared/emugl/common/CMakeLists.txt
-+++ b/external/android-emugl/shared/emugl/common/CMakeLists.txt
-@@ -11,7 +11,6 @@ set(COMMON_SOURCES
- message_channel.cpp
- message_channel.h
- mutex.h
-- mutex_unittest.cpp
- pod_vector.cpp
- pod_vector.h
- scoped_pointer_vector.h
-@@ -25,7 +24,6 @@ set(COMMON_SOURCES
- thread_pthread.cpp
- thread_store.cpp
- thread_store.h
-- thread_unittest.cpp
- unique_integer_map.h)
-
- add_library(emugl_common STATIC ${COMMON_SOURCES})
diff --git a/testing/anbox/fix-arm-build.patch b/testing/anbox/fix-arm-build.patch
deleted file mode 100644
index 1e422ef09d..0000000000
--- a/testing/anbox/fix-arm-build.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- a/src/anbox/cmds/system_info.cpp
-+++ b/src/anbox/cmds/system_info.cpp
-@@ -31,7 +31,9 @@
- #include "OpenGLESDispatch/EGLDispatch.h"
-
- #include "cpu_features_macros.h"
-+#if defined(CPU_FEATURES_ARCH_X86)
- #include "cpuinfo_x86.h"
-+#endif
-
- namespace fs = boost::filesystem;
-
---- a/src/anbox/cmds/check_features.cpp
-+++ b/src/anbox/cmds/check_features.cpp
-@@ -19,7 +19,9 @@
- #include "anbox/utils.h"
-
- #include "cpu_features_macros.h"
-+#if defined(CPU_FEATURES_ARCH_X86)
- #include "cpuinfo_x86.h"
-+#endif
-
- namespace {
- std::vector<std::string> cpu_whitelist = {
diff --git a/testing/anbox/fix-gtest-use.patch b/testing/anbox/fix-gtest-use.patch
new file mode 100644
index 0000000000..8db059ccc7
--- /dev/null
+++ b/testing/anbox/fix-gtest-use.patch
@@ -0,0 +1,146 @@
+--- a/cmake/FindGMock.cmake
++++ b/cmake/FindGMock.cmake
+@@ -1,92 +1,6 @@
+-# 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/>.
++pkg_check_modules(GTEST REQUIRED gtest )
++pkg_check_modules(GTEST_MAIN REQUIRED gtest_main)
++pkg_check_modules(GMOCK REQUIRED gmock )
++pkg_check_modules(GMOCK_MAIN REQUIRED gmock_main)
+
+-# 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")
+-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")
+-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 gtest_main)
+-
+-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)
+--- a/external/cpu_features/CMakeLists.txt
++++ b/external/cpu_features/CMakeLists.txt
+@@ -159,44 +159,6 @@ endif()
+
+ include(CTest)
+ if(BUILD_TESTING)
+- # Automatically incorporate googletest into the CMake Project if target not
+- # found.
+- if(NOT TARGET gtest OR NOT TARGET gmock_main)
+- # Download and unpack googletest at configure time.
+- configure_file(
+- cmake/googletest.CMakeLists.txt.in
+- googletest-download/CMakeLists.txt
+- )
+-
+- execute_process(
+- COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+- RESULT_VARIABLE result
+- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download)
+-
+- if(result)
+- message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+- endif()
+-
+- execute_process(
+- COMMAND ${CMAKE_COMMAND} --build .
+- RESULT_VARIABLE result
+- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download)
+-
+- if(result)
+- message(FATAL_ERROR "Build step for googletest failed: ${result}")
+- endif()
+-
+- # Prevent overriding the parent project's compiler/linker settings on
+- # Windows.
+- set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
+-
+- # Add googletest directly to our build. This defines the gtest and
+- # gtest_main targets.
+- add_subdirectory(${CMAKE_BINARY_DIR}/googletest-src
+- ${CMAKE_BINARY_DIR}/googletest-build
+- EXCLUDE_FROM_ALL)
+- endif()
+-
+ add_subdirectory(test)
+ endif()
+