dev-cpp/cppgir: Add

New dependency for telegram-desktop

Signed-off-by: Esteve Varela Colominas <esteve.varela@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Esteve Varela Colominas 2023-06-10 14:01:36 +02:00 committed by Sam James
parent 80a69793b4
commit 52eb1e640e
No known key found for this signature in database
GPG Key ID: 738409F520DF9190
6 changed files with 152 additions and 0 deletions

1
dev-cpp/cppgir/Manifest Normal file
View File

@ -0,0 +1 @@
DIST cppgir-0_p20230606.tar.bz2 92576 BLAKE2B 47d43405eee8cebb782a3021e8398ce61ced23094424ced9f1bfaf390bfd83b7fa6e6fe5e0689886857cef3c992f9318de99d9e38362c2777a409cf597b55f7a SHA512 832c99379b0203db9b2cfefa530fc8f68411da5b0f121a37ab1b60dfa39e929a0d95971c4161a744dc5b3ddbb92848f1bbce9b265f9d4d5724084c08ab8fd4f4

View File

@ -0,0 +1,43 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake
DESCRIPTION="GObject-Introspection C++ binding wrapper generator"
HOMEPAGE="https://gitlab.com/mnauw/cppgir"
MY_PV="960fe054ffaab7cf55722fea6094c56a8ee8f18e"
SRC_URI="https://gitlab.com/mnauw/cppgir/-/archive/${MY_PV}/cppgir-${MY_PV}.tar.bz2 -> ${P}.tar.bz2"
S="${WORKDIR}/${PN}-${MY_PV}"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"
IUSE="doc test"
RESTRICT="!test? ( test )"
DEPEND="
dev-cpp/expected-lite
dev-libs/boost:=
dev-libs/libfmt:=
"
BDEPEND="
doc? ( app-text/ronn-ng )
"
PATCHES=(
"${FILESDIR}/cppgir-0_p20230606-system-expected-lite.patch"
"${FILESDIR}/cppgir-0_p20230606-fix-install-paths.patch"
"${FILESDIR}/cppgir-0_p20230606-prevent-automagic.patch"
)
src_configure() {
local mycmakeargs=(
-DBUILD_DOC=$(usex doc)
-DBUILD_TESTING=$(usex test)
)
cmake_src_configure
}

View File

@ -0,0 +1,13 @@
Install cmake targets in correct directory
--- cppgir-960fe054ffaab7cf55722fea6094c56a8ee8f18e.orig/CMakeLists.txt
+++ cppgir-960fe054ffaab7cf55722fea6094c56a8ee8f18e/CMakeLists.txt
@@ -259,7 +259,7 @@
DESTINATION ${GI_IGNORE_FILE_INSTALL_DIR})
# cmake EXPORTS
-set(CONFIG_PACKAGE_LOCATION lib/cmake/${PROJECT_NAME})
+set(CONFIG_PACKAGE_LOCATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
set(CONFIG_VERSION_NAME ${PROJECT_NAME}-config-version.cmake)
set(CONFIG_TARGETS_NAME ${PROJECT_NAME}-targets.cmake)
set(CONFIG_NAME ${PROJECT_NAME}-config.cmake)

View File

@ -0,0 +1,42 @@
Remove checks for libraries that are completely unnecessary
--- cppgir-960fe054ffaab7cf55722fea6094c56a8ee8f18e.orig/CMakeLists.txt
+++ cppgir-960fe054ffaab7cf55722fea6094c56a8ee8f18e/CMakeLists.txt
@@ -79,15 +79,14 @@
find_package(expected-lite REQUIRED)
target_link_libraries(gi PUBLIC expected-lite)
-include(FindPkgConfig)
-pkg_check_modules(GOBJECT gobject-2.0)
-pkg_check_modules(GIO gio-2.0 gio-unix-2.0)
-pkg_check_modules(GST gstreamer-1.0)
-pkg_check_modules(GTK gtk+-3.0)
+if (BUILD_TESTING)
+ include(FindPkgConfig REQUIRED)
+ pkg_check_modules(GOBJECT gobject-2.0 REQUIRED)
+endif()
## TEST ##
-if (BUILD_TESTING AND GOBJECT_FOUND)
+if (BUILD_TESTING)
add_executable(gi-test test/main.cpp
test/test_object.c test/test_object.h test/test_boxed.c test/test_boxed.h)
target_include_directories(gi-test PRIVATE "gi" "override")
@@ -113,7 +112,7 @@
set(EXAMPLE_TARGETS "")
set(EXAMPLE_NS "")
-if (GOBJECT_FOUND)
+if (FALSE)
add_executable(example-gobject EXCLUDE_FROM_ALL examples/gobject.cpp)
target_compile_options(example-gobject PRIVATE ${GOBJECT_CFLAGS})
target_link_libraries(example-gobject PRIVATE ${GOBJECT_LDFLAGS})
@@ -179,7 +178,6 @@
endif ()
# optional Qt example
-find_package(Qt5Core 5.9)
if (Qt5Core_FOUND AND GIO_FOUND)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_executable(example-gio-qt-async EXCLUDE_FROM_ALL examples/gio-qt-async.cpp)

View File

@ -0,0 +1,37 @@
Use system-wide copy of expected-lite
--- cppgir-960fe054ffaab7cf55722fea6094c56a8ee8f18e.orig/CMakeLists.txt
+++ cppgir-960fe054ffaab7cf55722fea6094c56a8ee8f18e/CMakeLists.txt
@@ -76,14 +76,8 @@
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/override>"
)
-set(EXPECTED_LITE_INCLUDE "expected-lite/include")
-if (EXISTS ${CMAKE_CURRENT_LIST_DIR}/${EXPECTED_LITE_INCLUDE}/nonstd/expected.hpp)
- target_include_directories(gi INTERFACE
- "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/${EXPECTED_LITE_INCLUDE}>"
- )
-else ()
- message (FATAL_ERROR "missing submodule expected-lite")
-endif ()
+find_package(expected-lite REQUIRED)
+target_link_libraries(gi INTERFACE nonstd::expected-lite)
include(FindPkgConfig)
pkg_check_modules(GOBJECT gobject-2.0)
@@ -241,8 +235,6 @@
# headers
install(DIRECTORY gi override
DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/${PROJECT_NAME})
-install(DIRECTORY ${EXPECTED_LITE_INCLUDE}/nonstd
- DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/${PROJECT_NAME}/gi)
# doc
install(FILES README.md docs/cppgir.md
--- cppgir-960fe054ffaab7cf55722fea6094c56a8ee8f18e.orig/cmake/cppgir-config.cmake
+++ cppgir-960fe054ffaab7cf55722fea6094c56a8ee8f18e/cmake/cppgir-config.cmake
@@ -1 +1,4 @@
+include(CMakeFindDependencyMacro)
+find_dependency(expected-lite)
+
include("${CMAKE_CURRENT_LIST_DIR}/cppgir-targets.cmake")

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person" proxied="yes">
<email>esteve.varela@gmail.com</email>
<name>Esteve Varela Colominas</name>
</maintainer>
<maintainer type="project" proxied="proxy">
<email>proxy-maint@gentoo.org</email>
<name>Proxy Maintainers</name>
</maintainer>
<upstream>
<remote-id type="gitlab">mnauw/cppgir</remote-id>
<bugs-to>https://gitlab.com/mnauw/cppgir/-/issues</bugs-to>
</upstream>
</pkgmetadata>