public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [gentoo-commits] repo/proj/guru:master commit in: media-libs/imgui/
@ 2022-03-29  0:22 99% Ronny Gutbrod
  0 siblings, 0 replies; 1+ results
From: Ronny Gutbrod @ 2022-03-29  0:22 UTC (permalink / raw
  To: gentoo-commits

commit:     ab60e471e906e5ac8b529cf7e964c1e875b0dccd
Author:     Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
AuthorDate: Sun Mar 27 18:22:04 2022 +0000
Commit:     Ronny Gutbrod <gentoo <AT> tastytea <DOT> de>
CommitDate: Sun Mar 27 21:28:24 2022 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=ab60e471

media-libs/imgui: add 1.87

Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>

 media-libs/imgui/Manifest          |   1 +
 media-libs/imgui/imgui-1.87.ebuild | 157 +++++++++++++++++++++++++++++++++++++
 media-libs/imgui/metadata.xml      |   9 +++
 3 files changed, 167 insertions(+)

diff --git a/media-libs/imgui/Manifest b/media-libs/imgui/Manifest
index 6b3f46883..9bbf158f0 100644
--- a/media-libs/imgui/Manifest
+++ b/media-libs/imgui/Manifest
@@ -1 +1,2 @@
 DIST imgui-1.83.tar.gz 1448389 BLAKE2B 648306bd69181ad8315f12fc5b2c319b23005d6b3fc790ad64caaf1f80304e81b33af5d6f435fa97151fcf1e77eb15455838a09570b7a9c7dd9c56a61510b5a1 SHA512 2150e7101f384b1c749b2e89876b2085a7ff43435f04e88602d0e5e00db7a41c1ace5176bdb0963326845d1c8303b5092a7ca1c9c8e70c522ba96f899ed5bb9c
+DIST imgui-1.87.tar.gz 1460834 BLAKE2B f73b71400311e7c5f82248e242a932add5090670c78077ca2239f349730bab88a00bfe4deca4e854772ef7f6a2cff1fc0f38f7174a026995f93c9e7b55eb2a1d SHA512 3255b06698ab9c8951953e1e0b6d160d64adfa4c011b21a4288547292a7f8fff586875faf9dae0677818bde65bd7e98da92f16f6beb1e6a66aa835edf32e8ce2

diff --git a/media-libs/imgui/imgui-1.87.ebuild b/media-libs/imgui/imgui-1.87.ebuild
new file mode 100644
index 000000000..0b811f029
--- /dev/null
+++ b/media-libs/imgui/imgui-1.87.ebuild
@@ -0,0 +1,157 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="Bloat-free graphical user interface library for C++"
+HOMEPAGE="https://github.com/ocornut/imgui"
+SRC_URI="https://github.com/ocornut/imgui/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="allegro examples freetype glfw glut opengl sdl vulkan"
+
+RDEPEND="
+	allegro? ( media-libs/allegro:5 )
+	freetype? ( media-libs/freetype )
+	glfw? ( media-libs/glfw:0 )
+	glut? ( media-libs/freeglut )
+	opengl? ( virtual/opengl )
+	sdl? ( media-libs/libsdl2 )
+	vulkan? ( media-libs/vulkan-loader )
+"
+DEPEND="
+	${RDEPEND}
+	vulkan? ( dev-util/vulkan-headers )
+"
+BDEPEND="virtual/pkgconfig"
+
+REQUIRED_USE="
+	|| (
+		allegro
+		|| ( glfw glut sdl )
+		|| ( opengl vulkan )
+	)
+	examples? (
+		allegro
+		glfw
+		glut
+		opengl
+		sdl
+		vulkan
+	)
+"
+
+src_prepare() {
+	rm -r examples/libs || die
+	rm -r misc/*/*.ttf || die
+	rm -r misc/single_file || die
+	default
+}
+
+src_configure() {
+	tc-export CXX
+	append-cppflags "-DIMGUI_USE_WCHAR32"
+	append-cxxflags "-I${S} -I${S}/backends -I${S}/misc/freetype -fPIC -fpermissive"
+	local PKGCONF="$(tc-getPKG_CONFIG)" || die
+
+	use allegro && append-libs "-lallegro -lallegro_main -lallegro_primitives"
+	if use freetype; then
+		append-cppflags "-DIMGUI_ENABLE_FREETYPE -DIMGUI_ENABLE_STB_TRUETYPE"
+		append-cxxflags "$(${PKGCONF} --cflags freetype2)" || die
+		append-libs "$(${PKGCONF} --libs freetype2)" || die
+	fi
+	if use glfw; then
+		append-libs "$(${PKGCONF} --libs glfw3)" || die
+		append-cxxflags "$(${PKGCONF} --cflags glfw3)" || die
+	fi
+	if use glut; then
+		append-libs "$(${PKGCONF} --libs freeglut)" || die
+		append-cxxflags "$(${PKGCONF} --cflags freeglut)" || die
+	fi
+	use opengl && append-libs "-lGL"
+	if use sdl; then
+		append-libs "-ldl $(sdl2-config --libs)" || die
+		append-cxxflags "$(sdl2-config --cflags)" || die
+	fi
+	if use vulkan; then
+		append-libs "$(${PKGCONF} --libs vulkan)" || die
+		append-cxxflags "$(${PKGCONF} --cflags vulkan)" || die
+		append-cppflags "-DImTextureID=ImU64" || die
+	fi
+}
+
+src_compile() {
+	set -x || die
+
+	for i in imgui{,_draw,_demo,_tables,_widgets}; do
+		${CXX} ${CXXFLAGS} ${CPPFLAGS} -c ${i}.cpp -o ${i}.o || die
+	done
+
+	if use freetype; then
+		pushd misc/freetype || die
+		${CXX} ${CXXFLAGS} ${CPPFLAGS} -c imgui_freetype.cpp -o imgui_freetype.o || die
+		popd || die
+		pushd misc/fonts || die
+		${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS} -fPIE binary_to_compressed_c.cpp -o binary_to_compressed_c || die
+		popd || die
+	fi
+
+	pushd backends || die
+	if use allegro; then
+		${CXX} ${CXXFLAGS} ${CPPFLAGS} -c imgui_impl_allegro5.cpp -o imgui_impl_allegro5.o || die
+	fi
+	if use glfw; then
+		${CXX} ${CXXFLAGS} ${CPPFLAGS} -c imgui_impl_glfw.cpp -o imgui_impl_glfw.o || die
+	fi
+	if use glut; then
+		${CXX} ${CXXFLAGS} ${CPPFLAGS} -c imgui_impl_glut.cpp -o imgui_impl_glut.o || die
+	fi
+	if use opengl; then
+		${CXX} ${CXXFLAGS} ${CPPFLAGS} -c imgui_impl_opengl2.cpp -o imgui_impl_opengl2.o || die
+		${CXX} ${CXXFLAGS} ${CPPFLAGS} -c imgui_impl_opengl3.cpp -o imgui_impl_opengl3.o || die
+	fi
+	if use sdl; then
+		${CXX} ${CXXFLAGS} ${CPPFLAGS} -c imgui_impl_sdl.cpp -o imgui_impl_sdl.o || die
+		${CXX} ${CXXFLAGS} ${CPPFLAGS} -c imgui_impl_sdlrenderer.cpp -o imgui_impl_sdlrenderer.o || die
+	fi
+	if use vulkan; then
+		${CXX} ${CXXFLAGS} ${CPPFLAGS} -c imgui_impl_vulkan.cpp -o imgui_impl_vulkan.o || die
+	fi
+	popd || die
+	${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS} -shared -Wl,-soname,libimgui.so *.o backends/*.o misc/freetype/*.o -o libimgui.so ${LIBS} || die
+
+	if use examples; then
+		mkdir ex || die
+		for f in allegro5 glfw_opengl{2,3} glfw_vulkan null sdl_opengl{2,3} sdl_{sdlrenderer,vulkan} glut_opengl2 ; do
+			${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS} -fPIE examples/example_${f}/main.cpp "-L${S}" -limgui ${LIBS} -o "${S}/ex/example_${f}" || die
+		done
+	fi
+
+	set +x || die
+}
+
+src_install() {
+	dolib.so libimgui.so
+	dodoc docs/*
+	insinto "/usr/include/imgui"
+	doins *.h
+	doins -r misc/*/*.h
+	doins backends/*.h
+	insinto "/usr/share/${PN}/backends"
+	doins -r backends/vulkan
+	exeinto "/usr/libexec/${PN}"
+	use freetype && doexe misc/fonts/binary_to_compressed_c
+	rm -rf misc/{fonts,freetype} || die
+	dodoc -r misc
+
+	if use examples; then
+		exeinto "/usr/libexec/${PN}/examples"
+		doexe ex/*
+		dodoc -r examples
+		docompress -x "/usr/share/doc/${PF}/examples"
+	fi
+}

diff --git a/media-libs/imgui/metadata.xml b/media-libs/imgui/metadata.xml
index 25bcc732f..2a6d52b5d 100644
--- a/media-libs/imgui/metadata.xml
+++ b/media-libs/imgui/metadata.xml
@@ -10,4 +10,13 @@
         <bugs-to>https://github.com/ocornut/imgui/issues</bugs-to>
         <remote-id type="github">ocornut/imgui</remote-id>
     </upstream>
+    <use>
+        <flag name="allegro">Enable allegro backend and renderer</flag>
+        <flag name="freetype">Use FreeType to build and rasterize the font atlas</flag>
+        <flag name="glfw">Enable glfw backend</flag>
+        <flag name="glut">Enable glut backen</flag>
+        <flag name="opengl">Enable opengl renderer</flag>
+        <flag name="sdl">Enable sdl backend</flag>
+        <flag name="vulkan">Enable vulkan renderer</flag>
+    </use>
 </pkgmetadata>


^ permalink raw reply related	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2022-03-29  0:22 99% [gentoo-commits] repo/proj/guru:master commit in: media-libs/imgui/ Ronny Gutbrod

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox