media-libs/implot: new package, add 0.16

Signed-off-by: Gonçalo Negrier Duarte <gonegrier.duarte@gmail.com>
This commit is contained in:
Gonçalo Negrier Duarte
2024-05-09 15:55:15 +01:00
parent 5973746612
commit 67d96b3e23
4 changed files with 120 additions and 0 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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
}

View File

@@ -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>gonegrier.duarte@gmail.com</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>