push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8c1390e..791d3b7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -83,10 +83,7 @@ if(PROJECT_IS_TOP_LEVEL)
# Used in tests and samples
FetchContent_Declare(
enkits
- GIT_REPOSITORY https://github.com/dougbinks/enkiTS.git
- GIT_TAG master
- GIT_SHALLOW TRUE
- GIT_PROGRESS TRUE
+ URL @enkits_src@
)
FetchContent_MakeAvailable(enkits)
endif()

View File

@@ -0,0 +1,56 @@
diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt
index 46d5a23..7572b0b 100644
--- a/samples/CMakeLists.txt
+++ b/samples/CMakeLists.txt
@@ -17,49 +17,12 @@ set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "GLFW Examples")
set(GLFW_BUILD_TESTS OFF CACHE BOOL "GLFW Tests")
set(GLFW_INSTALL OFF CACHE BOOL "GLFW Install")
-FetchContent_Declare(
- glfw
- GIT_REPOSITORY https://github.com/glfw/glfw.git
- GIT_TAG 3.4
- GIT_SHALLOW TRUE
- GIT_PROGRESS TRUE
-)
-FetchContent_MakeAvailable(glfw)
+find_package(glfw)
# imgui and glfw backend for GUI
# https://gist.github.com/jeffamstutz/992723dfabac4e3ffff265eb71a24cd9
# Modified to pin to a specific imgui release
-FetchContent_Populate(imgui
- URL https://github.com/ocornut/imgui/archive/refs/tags/v1.91.3.zip
- SOURCE_DIR ${CMAKE_SOURCE_DIR}/build/imgui
-)
-
-set(IMGUI_DIR ${CMAKE_SOURCE_DIR}/build/imgui)
-
-add_library(imgui STATIC
- ${IMGUI_DIR}/imconfig.h
- ${IMGUI_DIR}/imgui.h
-
- ${IMGUI_DIR}/imgui.cpp
- ${IMGUI_DIR}/imgui_draw.cpp
- ${IMGUI_DIR}/imgui_demo.cpp
- ${IMGUI_DIR}/imgui_tables.cpp
- ${IMGUI_DIR}/imgui_widgets.cpp
-
- ${IMGUI_DIR}/backends/imgui_impl_glfw.cpp
- ${IMGUI_DIR}/backends/imgui_impl_opengl3.cpp
-)
-
-target_link_libraries(imgui PUBLIC glfw glad)
-target_include_directories(imgui PUBLIC ${IMGUI_DIR} ${IMGUI_DIR}/backends)
-target_compile_definitions(imgui PUBLIC IMGUI_DISABLE_OBSOLETE_FUNCTIONS)
-# The sample app also uses stb_truetype and this keeps the symbols separate
-target_compile_definitions(imgui PRIVATE IMGUI_STB_NAMESPACE=imgui_stb)
-set_target_properties(imgui PROPERTIES
- CXX_STANDARD 20
- CXX_STANDARD_REQUIRED YES
- CXX_EXTENSIONS NO
-)
+find_package(imgui)
# jsmn for json
set(JSMN_DIR ${CMAKE_SOURCE_DIR}/extern/jsmn)

View File

@@ -0,0 +1,100 @@
{
lib,
stdenv,
fetchFromGitHub,
replaceVars,
# nativeBuildInputs
cmake,
pkg-config,
# buildInputs
glfw3,
imgui,
libGLU,
libX11,
libXcursor,
libXi,
libXinerama,
libXrandr,
libglut,
xorgproto,
nix-update-script,
}:
let
inherit (lib) cmakeBool;
in
stdenv.mkDerivation (finalAttrs: {
pname = "box2d";
version = "3.1.1";
src = fetchFromGitHub {
owner = "erincatto";
repo = "box2d";
tag = "v${finalAttrs.version}";
hash = "sha256-IqQy9A8fWLG9H8ZPmOXeFZDaaks84miRuzXaFlNwm0g=";
};
patches = [
# prevent CMake from trying to download some libraries from the internet
(replaceVars ./cmake_dont_fetch_enkits.patch {
enkits_src = fetchFromGitHub {
owner = "dougbinks";
repo = "enkiTS";
rev = "686d0ec31829e0d9e5edf9ceb68c40f9b9b20ea9";
hash = "sha256-CerLj/WY+J3mrMvv7dGmZltjAM9v5C/IY4X+Ph78HVs=";
};
})
./cmake_use_system_glfw_and_imgui.patch
];
env.NIX_CFLAGS_COMPILE = toString (
lib.optionals stdenv.cc.isGNU [
# error: '*(float *)((char *)&localPointA + offsetof(b2Vec2, y))' may be used uninitialized
"-Wno-error=maybe-uninitialized"
]
);
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
glfw3
(imgui.override {
# GLFW backend is disabled by default on darwin but box2d imports it unconditionally
# https://github.com/erincatto/box2d/blob/v3.1.0/samples/main.cpp#L28
IMGUI_BUILD_GLFW_BINDING = true;
})
libGLU
libX11
libXcursor
libXi
libXinerama
libXrandr
libglut
xorgproto
];
cmakeFlags = [
(cmakeBool "BOX2D_BUILD_UNIT_TESTS" finalAttrs.finalPackage.doCheck)
];
passthru = {
updateScript = nix-update-script { };
};
meta = {
description = "2D physics engine";
homepage = "https://box2d.org/";
changelog = "https://github.com/erincatto/box2d/releases/tag/v${finalAttrs.version}";
maintainers = with lib.maintainers; [ raskin ];
platforms = lib.platforms.unix;
license = lib.licenses.zlib;
};
})