-
-
Notifications
You must be signed in to change notification settings - Fork 14k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #303682 from SomeoneSerge/feat/imgui-cmake
imgui: ship vcpkg' (cmake) distribution info
- Loading branch information
Showing
8 changed files
with
352 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
lib, | ||
stdenv, | ||
fetchFromGitHub, | ||
fetchpatch, | ||
cmake, | ||
imgui, | ||
SDL2, | ||
xorg, | ||
imnodes, | ||
withExamples ? false, | ||
}: | ||
|
||
stdenv.mkDerivation rec { | ||
pname = "imnodes"; | ||
version = "unstable-2024-03-12"; | ||
outputs = [ | ||
"out" | ||
"dev" | ||
]; | ||
|
||
src = fetchFromGitHub { | ||
owner = "Nelarius"; | ||
repo = "imnodes"; | ||
rev = "8563e1655bd9bb1f249e6552cc6274d506ee788b"; | ||
hash = "sha256-E7NNCxYq9dyVvutWbpl2a+D2Ap2ErvdYHBDqpX0kb0c="; | ||
}; | ||
patches = [ | ||
# CMake install rules | ||
(fetchpatch { | ||
url = "https://github.com/Nelarius/imnodes/commit/ff20336fcd82ce07c39fabd76d5bc9fa0a08b3bc.patch"; | ||
hash = "sha256-JHOUjwMofDwt2kg6SLPFZmuQC4bOfjGa3qHFr5MdPIE="; | ||
}) | ||
]; | ||
|
||
nativeBuildInputs = [ cmake ]; | ||
buildInputs = | ||
[ imgui ] | ||
++ lib.optionals withExamples [ | ||
SDL2 | ||
xorg.libXext | ||
]; | ||
|
||
cmakeFlags = [ (lib.cmakeBool "IMNODES_EXAMPLES" withExamples) ]; | ||
|
||
passthru.tests.examples = imnodes.override { withExamples = true; }; | ||
|
||
meta = { | ||
description = "A small, dependency-free node editor for dear imgui"; | ||
homepage = "https://github.com/Nelarius/imnodes"; | ||
license = lib.licenses.mit; | ||
maintainers = with lib.maintainers; [ SomeoneSerge ]; | ||
mainProgram = "imnodes"; | ||
platforms = lib.platforms.all; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
{ | ||
lib, | ||
stdenv, | ||
fetchFromGitHub, | ||
fetchpatch, | ||
cmake, | ||
pkg-config, | ||
darwin, | ||
fmt, | ||
gtk3, | ||
iir1, | ||
imgui, | ||
imnodes, | ||
implot, | ||
openssl, | ||
curl, | ||
}: | ||
|
||
stdenv.mkDerivation rec { | ||
pname = "implot-demos"; | ||
version = "unstable-2023-08-20"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "epezent"; | ||
repo = "implot_demos"; | ||
rev = "f33219d3ade192a2333d4a32e749842010952a29"; | ||
hash = "sha256-Xq0kVk8qncj/BzQyIX/l1OLvPSQJU8ckTxIIfLZdO/g="; | ||
}; | ||
|
||
patches = [ | ||
# Resolve "undefined symbols" (GetWindowContentRegionWidth &c) | ||
(fetchpatch { | ||
url = "https://github.com/epezent/implot_demos/commit/85a59612c102f8da97d6ead04f528f4c88f4ef9a.patch"; | ||
hash = "sha256-HRhfC3TUwz9Mv+1ODabaDxTWUaj4Nx1iH7C6vjUPo2s="; | ||
}) | ||
|
||
# CMake: make FetchContent optional, add install targets | ||
(fetchpatch { | ||
url = "https://github.com/epezent/implot_demos/commit/4add0433a46ed5e2099e1af1a77e8055e49230d0.patch"; | ||
hash = "sha256-jYdM8NuwbZk7INKo2wqMAbjLMTPdrAdM4Kr3xmtquIY="; | ||
}) | ||
|
||
# CMake: link libGL from the "app" target | ||
(fetchpatch { | ||
url = "https://github.com/epezent/implot_demos/commit/6742e4202858eb85bd0d67ca5fa15a7a07e6b618.patch"; | ||
hash = "sha256-h4EJ9u1iHLYkGHgxSynskkuCGmY6mmvKdZSRwHJKerY="; | ||
}) | ||
]; | ||
|
||
cmakeFlags = [ (lib.cmakeBool "FETCHCONTENT_FULLY_DISCONNECTED" true) ]; | ||
|
||
nativeBuildInputs = [ | ||
cmake | ||
pkg-config | ||
]; | ||
|
||
buildInputs = | ||
[ | ||
curl | ||
fmt | ||
iir1 | ||
imgui | ||
imnodes | ||
implot | ||
openssl | ||
] | ||
++ lib.optionals stdenv.hostPlatform.isLinux [ gtk3 ] | ||
++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.AppKit ]; | ||
|
||
meta = { | ||
description = "Standalone ImPlot Demos"; | ||
homepage = "https://github.com/epezent/implot_demos"; | ||
broken = | ||
stdenv.hostPlatform.isAarch64 # Target "mandel" relies on AVX2 | ||
|| stdenv.isDarwin; | ||
license = lib.licenses.mit; | ||
maintainers = with lib.maintainers; [ SomeoneSerge ]; | ||
mainProgram = "implot-demos"; | ||
platforms = lib.platforms.all; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
lib, | ||
stdenv, | ||
fetchFromGitHub, | ||
callPackage, | ||
cmake, | ||
vcpkg, | ||
imgui, | ||
}: | ||
|
||
stdenv.mkDerivation rec { | ||
pname = "implot"; | ||
version = "0.16"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "epezent"; | ||
repo = "implot"; | ||
rev = "v${version}"; | ||
hash = "sha256-/wkVsgz3wiUVZBCgRl2iDD6GWb+AoHN+u0aeqHHgem0="; | ||
}; | ||
|
||
cmakeRules = "${vcpkg.src}/ports/implot"; | ||
postPatch = '' | ||
cp "$cmakeRules"/CMakeLists.txt ./ | ||
''; | ||
|
||
buildInputs = [ imgui ]; | ||
nativeBuildInputs = [ cmake ]; | ||
|
||
passthru.tests = { | ||
implot-demos = callPackage ./demos { }; | ||
}; | ||
|
||
meta = { | ||
description = "Immediate Mode Plotting"; | ||
homepage = "https://github.com/epezent/implot"; | ||
license = lib.licenses.mit; | ||
maintainers = with lib.maintainers; [ SomeoneSerge ]; | ||
platforms = lib.platforms.all; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
project(ImguiDemo LANGUAGES CXX) | ||
cmake_minimum_required(VERSION 3.20) | ||
|
||
add_executable(demo ./main.cpp) | ||
|
||
find_package(imgui REQUIRED) | ||
find_package(glfw3 REQUIRED) | ||
find_package(OpenGL REQUIRED) | ||
target_link_libraries(demo PRIVATE imgui glfw OpenGL::GL) | ||
|
||
install(TARGETS demo RUNTIME DESTINATION bin) |
Oops, something went wrong.