commit:     48d2fe7cc6773b8a7efd0f42e1f2f044af3e54f7
Author:     Yuri Konotopov <ykonotopov <AT> gnome <DOT> org>
AuthorDate: Sun Apr 21 17:23:25 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Sun Apr 21 18:05:42 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=48d2fe7c

dev-cpp/simpleini: install cmake config files

Signed-off-by: Yuri Konotopov <ykonotopov <AT> gnome.org>
Closes: https://github.com/gentoo/gentoo/pull/36344
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 .../files/simpleini-4.22-disable-tests.patch       | 25 ++++++++++++
 .../files/simpleini-4.22-include-dir.patch         | 44 ++++++++++++++++++++++
 dev-cpp/simpleini/simpleini-4.22-r1.ebuild         | 33 ++++++++++++++++
 3 files changed, 102 insertions(+)

diff --git a/dev-cpp/simpleini/files/simpleini-4.22-disable-tests.patch 
b/dev-cpp/simpleini/files/simpleini-4.22-disable-tests.patch
new file mode 100644
index 000000000000..380c50d587e7
--- /dev/null
+++ b/dev-cpp/simpleini/files/simpleini-4.22-disable-tests.patch
@@ -0,0 +1,25 @@
+From f7862c3dd7ad35becc2741f268e3402e89a37666 Mon Sep 17 00:00:00 2001
+From: Alexandre Bouvier <[email protected]>
+Date: Tue, 2 Jan 2024 10:54:44 +0100
+Subject: [PATCH 2/2] cmake: really disable tests (#75)
+
+---
+ CMakeLists.txt | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 7804947..4b360ad 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -72,5 +72,7 @@ target_include_directories(${PROJECT_NAME} INTERFACE
+ 
+ if(IS_TOPLEVEL_PROJECT)
+       include(CTest)
+-      add_subdirectory(tests)
++      if(BUILD_TESTING)
++              add_subdirectory(tests)
++      endif()
+ endif()
+-- 
+2.43.2
+

diff --git a/dev-cpp/simpleini/files/simpleini-4.22-include-dir.patch 
b/dev-cpp/simpleini/files/simpleini-4.22-include-dir.patch
new file mode 100644
index 000000000000..78fba987bc0a
--- /dev/null
+++ b/dev-cpp/simpleini/files/simpleini-4.22-include-dir.patch
@@ -0,0 +1,44 @@
+From aeacf861a8ad8add5f4974792a88ffea393e41db Mon Sep 17 00:00:00 2001
+From: Alexandre Bouvier <[email protected]>
+Date: Tue, 2 Jan 2024 08:42:03 +0100
+Subject: [PATCH 1/2] cmake: fix namespace and include dir (#74)
+
+---
+ CMakeLists.txt | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 8f09295..7804947 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -48,7 +48,7 @@ configure_package_config_file(${PROJECT_NAME}Config.cmake.in
+ )
+ 
+ install(FILES SimpleIni.h
+-      DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}
++      DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+ )
+ 
+ install(TARGETS ${PROJECT_NAME}
+@@ -62,12 +62,15 @@ install(FILES
+ )
+ install(EXPORT ${PROJECT_NAME}Targets
+       DESTINATION ${CMAKE_INSTALL_DATADIR}/cmake/${PROJECT_NAME}
+-      NAMESPACE EXPORT_NAMESPACE
++      NAMESPACE ${EXPORT_NAMESPACE}
+ )
+ 
+-target_include_directories(${PROJECT_NAME} INTERFACE 
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
++target_include_directories(${PROJECT_NAME} INTERFACE
++      $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
++      $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
++)
+ 
+ if(IS_TOPLEVEL_PROJECT)
+-      enable_testing()
++      include(CTest)
+       add_subdirectory(tests)
+ endif()
+-- 
+2.43.2
+

diff --git a/dev-cpp/simpleini/simpleini-4.22-r1.ebuild 
b/dev-cpp/simpleini/simpleini-4.22-r1.ebuild
new file mode 100644
index 000000000000..e5b4c147bbb9
--- /dev/null
+++ b/dev-cpp/simpleini/simpleini-4.22-r1.ebuild
@@ -0,0 +1,33 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+DESCRIPTION="C++ library providing a simple API to read and write INI-style 
files"
+HOMEPAGE="https://github.com/brofield/simpleini/";
+SRC_URI="https://github.com/brofield/simpleini/archive/refs/tags/v${PV}.tar.gz 
-> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+DEPEND="test? ( dev-cpp/gtest )"
+BDEPEND="test? ( virtual/pkgconfig )"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-4.20-pkgconfig-var.patch
+       "${FILESDIR}"/${P}-include-dir.patch
+       "${FILESDIR}"/${P}-disable-tests.patch
+)
+
+src_configure() {
+       local mycmakeargs=(
+               -DBUILD_TESTING=$(usex test)
+               -DSIMPLEINI_USE_SYSTEM_GTEST=ON
+       )
+       cmake_src_configure
+}

Reply via email to