diff options
author | 2022-08-27 21:02:21 +0200 | |
---|---|---|
committer | 2022-08-27 21:22:48 +0200 | |
commit | 37a299260b8a3396af925f2c46f586dda0e7a28f (patch) | |
tree | ce04da0514efa28bc0e8cfe16e2cd22561dd1f61 /media-libs | |
parent | sci-electronics/circt: new package, add 1.14.0 (diff) | |
download | guru-37a299260b8a3396af925f2c46f586dda0e7a28f.tar.gz guru-37a299260b8a3396af925f2c46f586dda0e7a28f.tar.bz2 guru-37a299260b8a3396af925f2c46f586dda0e7a28f.zip |
media-libs/imgui: add version 1.81 and use meson
meson was simpler to use to add tweaks that makes
this version work with mangohud
Signed-off-by: Adel KARA SLIMANE <adel.ks@zegrapher.com>
Diffstat (limited to 'media-libs')
-rw-r--r-- | media-libs/imgui/Manifest | 1 | ||||
-rw-r--r-- | media-libs/imgui/files/imgui-1.81-meson.build | 137 | ||||
-rw-r--r-- | media-libs/imgui/files/imgui-1.81-meson_options.txt | 18 | ||||
-rw-r--r-- | media-libs/imgui/imgui-1.81.ebuild | 66 |
4 files changed, 222 insertions, 0 deletions
diff --git a/media-libs/imgui/Manifest b/media-libs/imgui/Manifest index 6c720b19b..c33c14ca9 100644 --- a/media-libs/imgui/Manifest +++ b/media-libs/imgui/Manifest @@ -1,3 +1,4 @@ DIST cimgui-1.87.gh.tar.gz 385460 BLAKE2B 0916d53a00234343536ee412035a2c405b01e31a26c3d059cff4d446188ee8a1835a1233a68f671ccebb67be480801b85203a90b0e79fa729f7ac1efdc8bf4a2 SHA512 bf2ed9461e8c12514d29914e6da7f8fae7cd31fcc587c7d89122c950541aed3b4b908d8cd298b3975e9a955a47789335a88db7223ca558cbdf459693a0081bda +DIST imgui-1.81.tar.gz 1413443 BLAKE2B 6f2e63777821b2767da92d9f40f4de7b4313c38817413e959e612c0ce67701645cf29f0748a3b86cfbd41e0b4b2c8099e9a0ca786c637ca1661fffd7b0de0629 SHA512 d7a2b66dea77359f78068a595607d7668e09ddd0b91910f67fc6463cb920b91b0cc1855984bd4d41e6a880b69ca7cd5e3adc064dcf461c0629b9f8c845a4fc3e DIST imgui-1.83.tar.gz 1448389 BLAKE2B 648306bd69181ad8315f12fc5b2c319b23005d6b3fc790ad64caaf1f80304e81b33af5d6f435fa97151fcf1e77eb15455838a09570b7a9c7dd9c56a61510b5a1 SHA512 2150e7101f384b1c749b2e89876b2085a7ff43435f04e88602d0e5e00db7a41c1ace5176bdb0963326845d1c8303b5092a7ca1c9c8e70c522ba96f899ed5bb9c DIST imgui-1.87.gh.tar.gz 1460834 BLAKE2B f73b71400311e7c5f82248e242a932add5090670c78077ca2239f349730bab88a00bfe4deca4e854772ef7f6a2cff1fc0f38f7174a026995f93c9e7b55eb2a1d SHA512 3255b06698ab9c8951953e1e0b6d160d64adfa4c011b21a4288547292a7f8fff586875faf9dae0677818bde65bd7e98da92f16f6beb1e6a66aa835edf32e8ce2 diff --git a/media-libs/imgui/files/imgui-1.81-meson.build b/media-libs/imgui/files/imgui-1.81-meson.build new file mode 100644 index 000000000..1d5e67e38 --- /dev/null +++ b/media-libs/imgui/files/imgui-1.81-meson.build @@ -0,0 +1,137 @@ +# Copyright (c) 2020 The Meson development team + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +project('imgui', 'cpp', + version: '1.81', + license: 'MIT', +) + +include_dirs = include_directories('.', 'backends') +sources = ['imgui_demo.cpp', 'imgui_draw.cpp', 'imgui_tables.cpp', 'imgui_widgets.cpp', 'imgui.cpp'] + +cpp = meson.get_compiler('cpp') +dependencies = [] + +# renderer backends +dx9_dep = cpp.find_library('d3d9', required: get_option('dx9')) +if dx9_dep.found() + sources += 'backends/imgui_impl_dx9.cpp' + dependencies += dx9_dep +endif +dx10_dep = cpp.find_library('d3d10', required: get_option('dx10')) +if dx10_dep.found() + sources += 'backends/imgui_impl_dx10.cpp' + dependencies += dx10_dep +endif +dx11_dep = cpp.find_library('d3d11', required: get_option('dx11')) +if dx11_dep.found() + sources += 'backends/imgui_impl_dx11.cpp' + dependencies += dx11_dep +endif +dx12_dep = cpp.find_library('d3d12', required: get_option('dx12')) +if dx12_dep.found() + sources += 'backends/imgui_impl_dx12.cpp' + dependencies += dx12_dep +endif +metal_dep = cpp.find_library('metal', required: get_option('metal')) +if get_option('metal').enabled() + sources += 'backends/imgui_impl_metal.mm' + dependencies += metal_dep +endif +glew_dep = dependency('glew', required: get_option('opengl')) +if glew_dep.found() + sources += 'backends/imgui_impl_opengl3.cpp' + dependencies += glew_dep +endif +vulkan_dep = dependency('vulkan', required: get_option('vulkan')) +if vulkan_dep.found() + sources += 'backends/imgui_impl_vulkan.cpp' + dependencies += vulkan_dep +endif + +# platform backends +glfw_dep = dependency('glfw3', required: get_option('glfw')) +if glfw_dep.found() + sources += 'backends/imgui_impl_glfw.cpp' + dependencies += glfw_dep +endif +sdl2_dep = dependency('sdl2', required: get_option('sdl2')) +if sdl2_dep.found() + sources += 'backends/imgui_impl_sdl.cpp' + dependencies += sdl2_dep +endif +if get_option('osx').enabled() or (get_option('osx').auto() and target_machine.system() == 'darwin') + sources += 'backends/imgui_impl_osx.mm' +endif +if get_option('win').enabled() or (get_option('win').auto() and target_machine.system() == 'windows') + sources += 'backends/imgui_impl_win32.cpp' +endif + +# frameworks +allegro5_dep = dependency('allegro5', required: get_option('allegro5')) +if allegro5_dep.found() + sources += 'backends/imgui_impl_allegro5.cpp' + dependencies += allegro5_dep +endif +marmalade_dep = cpp.find_library('marmalade', required: get_option('marmalade')) +if marmalade_dep.found() + sources += 'backends/imgui_impl_marmalade.cpp' + dependencies += marmalade_dep +endif + +imgui = library('imgui', + sources, + dependencies: dependencies, + include_directories: include_dirs, + version: meson.project_version(), + install: true +) + +pkg_mod = import('pkgconfig') +pkg_mod.generate(imgui, + description : 'Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies' +) + +install_headers( + 'imconfig.h', + 'imgui.h', + 'imgui_internal.h', + 'imstb_rectpack.h', + 'imstb_textedit.h', + 'imstb_truetype.h', + 'backends/imgui_impl_dx9.h', + 'backends/imgui_impl_osx.h', + 'backends/imgui_impl_sdl.h', + 'backends/imgui_impl_dx10.h', + 'backends/imgui_impl_dx11.h', + 'backends/imgui_impl_dx12.h', + 'backends/imgui_impl_glfw.h', + 'backends/imgui_impl_glut.h', + 'backends/imgui_impl_wgpu.h', + 'backends/imgui_impl_metal.h', + 'backends/imgui_impl_win32.h', + 'backends/imgui_impl_vulkan.h', + 'backends/imgui_impl_opengl2.h', + 'backends/imgui_impl_opengl3.h', + 'backends/imgui_impl_allegro5.h', + 'backends/imgui_impl_marmalade.h', + subdir: 'imgui') + +imgui_dep = declare_dependency(include_directories: include_dirs, link_with: imgui) diff --git a/media-libs/imgui/files/imgui-1.81-meson_options.txt b/media-libs/imgui/files/imgui-1.81-meson_options.txt new file mode 100644 index 000000000..b61e45adc --- /dev/null +++ b/media-libs/imgui/files/imgui-1.81-meson_options.txt @@ -0,0 +1,18 @@ +# renderer backends +option('dx9', type : 'feature', value : 'auto') +option('dx10', type : 'feature', value : 'auto') +option('dx11', type : 'feature', value : 'auto') +option('dx12', type : 'feature', value : 'auto') +option('metal', type : 'feature', value : 'auto') +option('opengl', type : 'feature', value : 'auto') +option('vulkan', type : 'feature', value : 'auto') + +# platform backends +option('glfw', type : 'feature', value : 'auto') +option('sdl2', type : 'feature', value : 'auto') +option('osx', type : 'feature', value : 'auto') +option('win', type : 'feature', value : 'auto') + +# frameworks (renderer + platform) +option('marmalade', type : 'feature', value : 'auto') +option('allegro5', type : 'feature', value : 'auto') diff --git a/media-libs/imgui/imgui-1.81.ebuild b/media-libs/imgui/imgui-1.81.ebuild new file mode 100644 index 000000000..939d77327 --- /dev/null +++ b/media-libs/imgui/imgui-1.81.ebuild @@ -0,0 +1,66 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit meson + +IMGUI_VER="1.81" +IMGUI_MESON_WRAP_VER="1" + +DESCRIPTION="Bloat-free graphical user interface library for C++" +HOMEPAGE=" + https://github.com/ocornut/imgui +" + +SRC_URI=" + https://github.com/ocornut/imgui/archive/v${IMGUI_VER}.tar.gz -> imgui-${IMGUI_VER}.tar.gz +" + +LICENSE="MIT" +SLOT="0/${PV}" +KEYWORDS="~amd64" +IUSE="dx9 dx10 dx11 dx12 metal opengl vulkan glfw sdl2 osx win marmalade allegro5" + +RDEPEND=" + dev-libs/stb:= + media-libs/glew + allegro5? ( media-libs/allegro:5 ) + glfw? ( media-libs/glfw:0 ) + opengl? ( virtual/opengl ) + sdl2? ( media-libs/libsdl2 ) + vulkan? ( media-libs/vulkan-loader ) +" +DEPEND=" + ${RDEPEND} + vulkan? ( dev-util/vulkan-headers ) +" +BDEPEND=" + virtual/pkgconfig +" + +src_unpack() { + default + + cp ${FILESDIR}/imgui-${IMGUI_VER}-meson.build ${S}/meson.build || die + cp ${FILESDIR}/imgui-${IMGUI_VER}-meson_options.txt ${S}/meson_options.txt || die +} + +src_configure() { + local emesonargs=( + $(meson_feature dx9) + $(meson_feature dx10) + $(meson_feature dx11) + $(meson_feature dx12) + $(meson_feature metal) + $(meson_feature opengl) + $(meson_feature vulkan) + $(meson_feature glfw) + $(meson_feature sdl2) + $(meson_feature osx) + $(meson_feature win) + $(meson_feature marmalade) + $(meson_feature allegro5) + ) + meson_src_configure +} |