commit:     67d96b3e23905552c023be65c24254539472ff22
Author:     Gonçalo Negrier Duarte <gonegrier.duarte <AT> gmail <DOT> com>
AuthorDate: Thu May  9 14:55:15 2024 +0000
Commit:     Gonçalo Negrier Duarte <gonegrier.duarte <AT> gmail <DOT> com>
CommitDate: Thu May  9 15:57:39 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=67d96b3e

media-libs/implot: new package, add 0.16

Signed-off-by: Gonçalo Negrier Duarte <gonegrier.duarte <AT> gmail.com>

 media-libs/implot/Manifest                         |  2 +
 .../implot/files/implot-0.16-wrapdb-meson-fix.diff | 64 ++++++++++++++++++++++
 media-libs/implot/implot-0.16.ebuild               | 41 ++++++++++++++
 media-libs/implot/metadata.xml                     | 13 +++++
 4 files changed, 120 insertions(+)

diff --git a/media-libs/implot/Manifest b/media-libs/implot/Manifest
new file mode 100644
index 0000000000..cac8dc9c2c
--- /dev/null
+++ b/media-libs/implot/Manifest
@@ -0,0 +1,2 @@
+DIST implot-0.16-1-meson-wrap.zip 1226 BLAKE2B 
4725661fe2c7f7f05e1702c3a871f9feb9fdefdc2a840cdf8a3d56e7e180e950533f830192f9ad19cba97e8094ab53cf73adda2ed6712a83384d4160f6c06b18
 SHA512 
6e54beebef8ac4ec0b3e85d30d7570c9a987d69c03b6a564bc67d105d19d2cec45cb3ab8921ebcbda51e7139d93c3c6dae359fa30b3fcce748cdec8953aabbf7
+DIST implot-0.16.tar.gz 137983 BLAKE2B 
aca328e2fe6049b72601f25a409f313e99971f606e68ca780a1594f8ca42b1606831090add8039fefd013cfb6c057900f0add347d1b80c466a05bd18e455b8d7
 SHA512 
117cb08122d900e7db857897bfec4c9ac3300a1d429c8f0303415bc693840baa9bbbb91ca3f13853d8efd3a6ebf538b7114401d4fbfe0d067256e58cbdbd4919

diff --git a/media-libs/implot/files/implot-0.16-wrapdb-meson-fix.diff 
b/media-libs/implot/files/implot-0.16-wrapdb-meson-fix.diff
new file mode 100644
index 0000000000..3e497727b4
--- /dev/null
+++ b/media-libs/implot/files/implot-0.16-wrapdb-meson-fix.diff
@@ -0,0 +1,64 @@
+# Meson wrapdb's meson.build file doesn't handle installing the library
+# and find imgui system library, we patch that here
+
+diff --git a/meson.build b/implot-0.16-meson.build
+index 3343dd4ad..804f84227 100644
+--- a/meson.build
++++ b/implot-0.16-meson.build
+@@ -5,8 +5,7 @@
+   version : '0.16',
+ )
+
+-imgui_sp = subproject('imgui')
+-imgui_dep = imgui_sp.get_variable('imgui_dep')
++imgui_dep=dependency('imgui', required : true)
+
+ implot_inc = include_directories('.')
+ implot_src = files(
+@@ -17,7 +16,19 @@
+ implot_lib = library(
+   'implot',
+   implot_src,
+-  dependencies: imgui_dep
++  dependencies: imgui_dep,
++  version: meson.project_version(),
++  install: true
++)
++
++pkg_mod = import('pkgconfig')
++pkg_mod.generate(implot_lib,
++  description : 'Immediate Mode Plotting'
++)
++
++install_headers(
++    'implot.h',
++    'implot_internal.h'
+ )
+
+ implot_dep = declare_dependency(
+diff --git a/implot.h b/implot.h
+index 3054331..856eb0c 100644
+--- a/implot.h
++++ b/implot.h
+@@ -45,7 +45,7 @@
+ // [SECTION] Obsolete API
+ 
+ #pragma once
+-#include "imgui.h"
++#include <imgui/imgui.h>
+ 
+ 
//-----------------------------------------------------------------------------
+ // [SECTION] Macros and Defines
+diff --git a/implot_internal.h b/implot_internal.h
+index cd05478..a189fcf 100644
+--- a/implot_internal.h
++++ b/implot_internal.h
+@@ -32,7 +32,7 @@
+ #pragma once
+
+ #include <time.h>
+-#include "imgui_internal.h"
++#include <imgui/imgui_internal.h>
+
+ #ifndef IMPLOT_VERSION
+ #error Must include implot.h before implot_internal.h

diff --git a/media-libs/implot/implot-0.16.ebuild 
b/media-libs/implot/implot-0.16.ebuild
new file mode 100644
index 0000000000..9bc245b814
--- /dev/null
+++ b/media-libs/implot/implot-0.16.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit meson-multilib
+
+MESON_WRAP_VER="1"
+
+DESCRIPTION="Immediate Mode Plotting"
+HOMEPAGE="
+       https://github.com/epezent/implot/
+"
+
+SRC_URI="
+       https://github.com/epezent/implot/archive/v${PV}.tar.gz -> 
implot-${PV}.tar.gz
+       
https://wrapdb.mesonbuild.com/v2/implot_${PV}-${MESON_WRAP_VER}/get_patch -> 
implot-${PV}-${MESON_WRAP_VER}-meson-wrap.zip
+"
+
+LICENSE="MIT"
+SLOT="0/${PV}"
+KEYWORDS="~amd64"
+
+DEPEND="
+       media-libs/imgui
+"
+
+BDEPEND="
+       virtual/pkgconfig
+       app-arch/unzip
+"
+
+PATCHES=(
+       "${FILESDIR}/${P}-wrapdb-meson-fix.diff"
+)
+
+src_unpack() {
+       default
+
+       unpack implot-${PV}-${MESON_WRAP_VER}-meson-wrap.zip
+}

diff --git a/media-libs/implot/metadata.xml b/media-libs/implot/metadata.xml
new file mode 100644
index 0000000000..33a455ffb9
--- /dev/null
+++ b/media-libs/implot/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>[email protected]</email>
+               <name>Gonçalo Negrier Duarte</name>
+       </maintainer>
+    <upstream>
+        <bugs-to>https://github.com/epezent/implot/issues</bugs-to>
+        <remote-id type="github">epezent/implot</remote-id>
+    </upstream>
+    </use>
+</pkgmetadata>

Reply via email to