summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorfardragon2023-10-08 20:28:12 +0200
committerfardragon2023-10-08 20:28:12 +0200
commitf40045c927c988f69098de1b0c2c7b9681d751cb (patch)
tree4fe64b56a63345a7fd3ab58cdbe572f55da74639
parentbd799aa4fe880a222c105891c6cd3e530dda050c (diff)
downloadaur-imgui-sfml.tar.gz
bump imgui-sfml to 2.6, use imgui package instead of bundling it
-rw-r--r--.SRCINFO13
-rw-r--r--PKGBUILD37
-rw-r--r--use_system_imgui.patch76
3 files changed, 106 insertions, 20 deletions
diff --git a/.SRCINFO b/.SRCINFO
index d7d0e5f7c3d7..6c447ce1565c 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = imgui-sfml
pkgdesc = Library which allows you to use ImGui with SFML
- pkgver = 2.5
+ pkgver = 2.6
pkgrel = 1
url = https://github.com/eliasdaler/imgui-sfml/
arch = x86_64
@@ -11,10 +11,11 @@ pkgbase = imgui-sfml
arch = aarch64
license = MIT
makedepends = cmake
- depends = sfml
- source = imgui-sfml-2.5.tar.gz::https://github.com/eliasdaler/imgui-sfml/archive/v2.5.tar.gz
- source = imgui-1.86.tar.gz::https://github.com/ocornut/imgui/archive/v1.86.tar.gz
- sha512sums = d7b8a17492f34d252167763e4b5f1f70de9ffa27a9f33ec0d8da4ba27e20d6f47ac1895da36c90303d7801cfb1702c642be35016d4d53efed3091466d40631ff
- sha512sums = e84fdc0839e96e53dcbe3a5d13bbd0def860c09bafa709b22f8371d5c710f5c90f6957e5f12813156ed0c4d0fa2b56c5e3be701206f7770749ce169818697229
+ depends = sfml>=2.5.0
+ depends = imgui>=1.80.0
+ source = imgui-sfml-2.6.tar.gz::https://github.com/eliasdaler/imgui-sfml/archive/v2.6.tar.gz
+ source = use_system_imgui.patch
+ sha512sums = c8f2ed21ad5dfac417474f0caed1c59105b7dd8bf2dcb1db3b1f46a4fb07cec3c199d6fda0ff05ec5040a18000a0168f1a8caa978dee356c2b6874b5b2e10ec4
+ sha512sums = 889e4d4e8c95297b3d4f905f200bd0ce0c719b3f9538606616e6c520547ea109c119bda27d48a205587a026e9a115ffa8ba6d70d91381234106df39e78d42c34
pkgname = imgui-sfml
diff --git a/PKGBUILD b/PKGBUILD
index c420a0d33126..9813237e53ce 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,29 +1,38 @@
# Maintainer: fardragon <michaldrozd@protonmail.ch>
pkgname=imgui-sfml
-pkgver=2.5
+pkgver=2.6
pkgrel=1
-_imguiver=1.86
pkgdesc="Library which allows you to use ImGui with SFML"
arch=('x86_64' 'i686' 'arm' 'armv6h' 'armv7h' 'aarch64')
url="https://github.com/eliasdaler/imgui-sfml/"
license=("MIT")
-source=("${pkgname}-${pkgver}.tar.gz::https://github.com/eliasdaler/${pkgname}/archive/v${pkgver}.tar.gz"
- "imgui-${_imguiver}.tar.gz::https://github.com/ocornut/imgui/archive/v${_imguiver}.tar.gz")
-sha512sums=('d7b8a17492f34d252167763e4b5f1f70de9ffa27a9f33ec0d8da4ba27e20d6f47ac1895da36c90303d7801cfb1702c642be35016d4d53efed3091466d40631ff'
- 'e84fdc0839e96e53dcbe3a5d13bbd0def860c09bafa709b22f8371d5c710f5c90f6957e5f12813156ed0c4d0fa2b56c5e3be701206f7770749ce169818697229')
-depends=("sfml")
+source=(
+ "${pkgname}-${pkgver}.tar.gz::https://github.com/eliasdaler/${pkgname}/archive/v${pkgver}.tar.gz"
+ "use_system_imgui.patch"
+)
+sha512sums=('c8f2ed21ad5dfac417474f0caed1c59105b7dd8bf2dcb1db3b1f46a4fb07cec3c199d6fda0ff05ec5040a18000a0168f1a8caa978dee356c2b6874b5b2e10ec4'
+'889e4d4e8c95297b3d4f905f200bd0ce0c719b3f9538606616e6c520547ea109c119bda27d48a205587a026e9a115ffa8ba6d70d91381234106df39e78d42c34')
+
+depends=(
+ "sfml>=2.5.0"
+ "imgui>=1.80.0"
+)
makedepends=("cmake")
+prepare() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ patch --strip=1 --binary --input="${srcdir}/use_system_imgui.patch"
+}
+
build() {
- cd ${srcdir}/${pkgname}-${pkgver}
- cmake -DCMAKE_CXX_FLAGS="-ffile-prefix-map=${srcdir}=." -DCMAKE_INSTALL_PREFIX=${pkgdir}/usr -DBUILD_SHARED_LIBS=ON -DIMGUI_DIR=${srcdir}/imgui-${_imguiver} .
- cmake --build .
+ cd ${srcdir}/${pkgname}-${pkgver}
+ cmake -DCMAKE_CXX_FLAGS="-ffile-prefix-map=${srcdir}=." -DCMAKE_INSTALL_PREFIX=${pkgdir}/usr -DBUILD_SHARED_LIBS=ON .
+ cmake --build .
}
package() {
- cd ${srcdir}/${pkgname}-${pkgver}
- cmake --build . --target install
- install -Dm644 "${srcdir}/${pkgname}-${pkgver}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/${pkgname}-LICENSE"
- install -Dm644 "${srcdir}/imgui-${_imguiver}/LICENSE.txt" "${pkgdir}/usr/share/licenses/${pkgname}/imgui-LICENSE.txt"
+ cd ${srcdir}/${pkgname}-${pkgver}
+ cmake --build . --target install
+ install -Dm644 "${srcdir}/${pkgname}-${pkgver}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/${pkgname}-LICENSE"
}
diff --git a/use_system_imgui.patch b/use_system_imgui.patch
new file mode 100644
index 000000000000..d31d8ed8c93b
--- /dev/null
+++ b/use_system_imgui.patch
@@ -0,0 +1,76 @@
+diff --unified --recursive --text --color imgui-sfml-2.6/CMakeLists.txt imgui-sfml-2.6.new/CMakeLists.txt
+--- imgui-sfml-2.6/CMakeLists.txt 2023-08-16 21:48:26.000000000 +0200
++++ imgui-sfml-2.6.new/CMakeLists.txt 2023-10-08 19:41:15.245559223 +0200
+@@ -35,7 +35,7 @@
+ set(IMGUI_SFML_CONFIG_INSTALL_DIR "" CACHE PATH "Path where user's config header will be installed")
+
+ # For FindImGui.cmake
+-list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
++#list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
+
+ if (IMGUI_SFML_FIND_SFML)
+ if (NOT BUILD_SHARED_LIBS)
+@@ -51,28 +51,28 @@
+ # ImGui does not provide native support for CMakeLists, workaround for now to have
+ # users specify IMGUI_DIR. Waiting for this PR to get merged...
+ # https://github.com/ocornut/imgui/pull/1713
+-if(NOT IMGUI_DIR)
+- set(IMGUI_DIR "" CACHE PATH "imgui top-level directory")
+- message(FATAL_ERROR "ImGui directory not found. Set IMGUI_DIR to imgui's top-level path (containing 'imgui.h' and other files).\n")
+-endif()
++# if(NOT IMGUI_DIR)
++# set(IMGUI_DIR "" CACHE PATH "imgui top-level directory")
++# message(FATAL_ERROR "ImGui directory not found. Set IMGUI_DIR to imgui's top-level path (containing 'imgui.h' and other files).\n")
++# endif()
+
+ # This uses FindImGui.cmake provided in ImGui-SFML repo for now
+-find_package(ImGui 1.80 REQUIRED)
++find_package(imgui REQUIRED)
+
+ # these headers will be installed alongside ImGui-SFML
+-set(IMGUI_PUBLIC_HEADERS
+- ${IMGUI_INCLUDE_DIR}/imconfig.h
+- ${IMGUI_INCLUDE_DIR}/imgui.h
+- ${IMGUI_INCLUDE_DIR}/imgui_internal.h # not actually public, but users might need it
+- ${IMGUI_INCLUDE_DIR}/imstb_rectpack.h
+- ${IMGUI_INCLUDE_DIR}/imstb_textedit.h
+- ${IMGUI_INCLUDE_DIR}/imstb_truetype.h
+- ${IMGUI_INCLUDE_DIR}/misc/cpp/imgui_stdlib.h
+-)
+-
+-if (IMGUI_SFML_IMGUI_DEMO)
+- list(APPEND IMGUI_SOURCES ${IMGUI_DEMO_SOURCES})
+-endif()
++# set(IMGUI_PUBLIC_HEADERS
++# ${IMGUI_INCLUDE_DIR}/imconfig.h
++# ${IMGUI_INCLUDE_DIR}/imgui.h
++# ${IMGUI_INCLUDE_DIR}/imgui_internal.h # not actually public, but users might need it
++# ${IMGUI_INCLUDE_DIR}/imstb_rectpack.h
++# ${IMGUI_INCLUDE_DIR}/imstb_textedit.h
++# ${IMGUI_INCLUDE_DIR}/imstb_truetype.h
++# ${IMGUI_INCLUDE_DIR}/misc/cpp/imgui_stdlib.h
++# )
++
++#if (IMGUI_SFML_IMGUI_DEMO)
++# list(APPEND IMGUI_SOURCES ${IMGUI_DEMO_SOURCES})
++#endif()
+
+ # CMake 3.11 and later prefer to choose GLVND, but we choose legacy OpenGL just because it's safer
+ # (unless the OpenGL_GL_PREFERENCE was explicitly set)
+@@ -85,7 +85,7 @@
+
+ add_library(ImGui-SFML
+ imgui-SFML.cpp
+- ${IMGUI_SOURCES}
++# ${IMGUI_SOURCES}
+ )
+
+ # Add pretty alias
+@@ -93,6 +93,7 @@
+
+ target_link_libraries(ImGui-SFML
+ PUBLIC
++ imgui::imgui
+ sfml-graphics
+ sfml-system
+ sfml-window