# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

CMAKE_CHECK_ADDITIONAL_FILES=(
    cmake/UseGlibGeneration.cmake
    cmake/UseConstantBuilder.cmake
)
inherit lomiri

DESCRIPTION="Lomiri Operating Environment service for requesting URLs to be opened."
HOMEPAGE="https://gitlab.com/ubports/development/core/${PN}"

LICENSE="LGPL-3 GPL-3"

DEPEND="
    dev-db/sqlite
    dev-libs/json-glib
    dev-util/click
    lomiri-base/lomiri-app-launch
    sys-apps/systemd
    sys-libs/libapparmor
"
RDEPEND="${DEPEND}"

BDEPEND="
    dev-build/cmake
    dev-build/cmake-extras
    dev-util/intltool
"

# trying to fix issues in 'src_prepare' causes no files are copmpiled.
# not clean, why
PATCHES=(
    "${FILESDIR}"/0001-disable-tests-and-coverage.patch
    "${FILESDIR}"/0002-disable-cmake-policy-CMP0153-warning.patch
)

src_configure() {
    # disable mir client
    local mycmakeargs=(
        -Denable_mirclient=OFF
    )

    lomiri_src_configure
}