Loading pkgs/applications/office/libreoffice/default.nix +2 −2 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ libxslt, perl, perlPackages, box2d, box2d_2, gettext, zlib, libjpeg, Loading Loading @@ -397,7 +397,7 @@ stdenv.mkDerivation (finalAttrs: { ant bluez5 boost box2d box2d_2 cairo clucene_core_2 cppunit Loading pkgs/by-name/bo/box2d/cmake_dont_fetch_enkits.patch 0 → 100644 +16 −0 Original line number Diff line number Diff line 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() pkgs/by-name/bo/box2d/cmake_use_system_glfw_and_imgui.patch 0 → 100644 +54 −0 Original line number Diff line number Diff line diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index 5020345..97af8c6 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -17,47 +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) -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) pkgs/by-name/bo/box2d/package.nix 0 → 100644 +101 −0 Original line number Diff line number Diff line { lib, stdenv, fetchFromGitHub, substituteAll, # 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.0"; src = fetchFromGitHub { owner = "erincatto"; repo = "box2d"; tag = "v${finalAttrs.version}"; hash = "sha256-QTSU1+9x8GoUK3hlTDMh43fc4vbNfFR7syt6xVHIuPs="; }; patches = [ # prevent CMake from trying to download some libraries from the internet (substituteAll { src = ./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; }; }) pkgs/development/libraries/box2d/default.nix→pkgs/by-name/bo/box2d_2/package.nix +68 −0 Original line number Diff line number Diff line Loading @@ -2,26 +2,27 @@ lib, stdenv, fetchFromGitHub, # nativeBuildInputs cmake, pkg-config, # buildInputs glfw3, libGLU, libGL, libglut, libX11, libXcursor, libXi, libXinerama, libXrandr, libglut, xorgproto, libXi, pkg-config, Carbon, Cocoa, Kernel, OpenGL, settingsFile ? "include/box2d/b2_settings.h", nix-update-script, }: let inherit (lib) cmakeBool optionals; inherit (lib) cmakeBool; in stdenv.mkDerivation (finalAttrs: { Loading @@ -31,7 +32,7 @@ stdenv.mkDerivation (finalAttrs: { src = fetchFromGitHub { owner = "erincatto"; repo = "box2d"; rev = "v${finalAttrs.version}"; tag = "v${finalAttrs.version}"; hash = "sha256-yvhpgiZpjTPeSY7Ma1bh4LwIokUUKB10v2WHlamL9D8="; }; Loading @@ -40,42 +41,28 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; buildInputs = [ buildInputs = [ glfw3 libGLU libGL libglut libX11 libXcursor libXi libXinerama libXrandr libglut xorgproto libXi ] ++ optionals stdenv.hostPlatform.isDarwin [ Carbon Cocoa Kernel OpenGL ]; cmakeFlags = [ (cmakeBool "BOX2D_BUILD_UNIT_TESTS" finalAttrs.finalPackage.doCheck) ]; prePatch = '' substituteInPlace ${settingsFile} \ --replace-fail 'b2_maxPolygonVertices 8' 'b2_maxPolygonVertices 15' ''; # tests are broken on 2.4.2 and 2.3.x doesn't have tests: https://github.com/erincatto/box2d/issues/677 doCheck = lib.versionAtLeast finalAttrs.version "2.4.2"; meta = with lib; { meta = { description = "2D physics engine"; homepage = "https://box2d.org/"; maintainers = with maintainers; [ raskin ]; platforms = platforms.unix; license = licenses.zlib; changelog = "https://github.com/erincatto/box2d/releases/tag/v${finalAttrs.version}"; maintainers = with lib.maintainers; [ raskin ]; platforms = lib.platforms.unix; license = lib.licenses.zlib; }; }) Loading
pkgs/applications/office/libreoffice/default.nix +2 −2 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ libxslt, perl, perlPackages, box2d, box2d_2, gettext, zlib, libjpeg, Loading Loading @@ -397,7 +397,7 @@ stdenv.mkDerivation (finalAttrs: { ant bluez5 boost box2d box2d_2 cairo clucene_core_2 cppunit Loading
pkgs/by-name/bo/box2d/cmake_dont_fetch_enkits.patch 0 → 100644 +16 −0 Original line number Diff line number Diff line 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()
pkgs/by-name/bo/box2d/cmake_use_system_glfw_and_imgui.patch 0 → 100644 +54 −0 Original line number Diff line number Diff line diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index 5020345..97af8c6 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -17,47 +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) -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)
pkgs/by-name/bo/box2d/package.nix 0 → 100644 +101 −0 Original line number Diff line number Diff line { lib, stdenv, fetchFromGitHub, substituteAll, # 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.0"; src = fetchFromGitHub { owner = "erincatto"; repo = "box2d"; tag = "v${finalAttrs.version}"; hash = "sha256-QTSU1+9x8GoUK3hlTDMh43fc4vbNfFR7syt6xVHIuPs="; }; patches = [ # prevent CMake from trying to download some libraries from the internet (substituteAll { src = ./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; }; })
pkgs/development/libraries/box2d/default.nix→pkgs/by-name/bo/box2d_2/package.nix +68 −0 Original line number Diff line number Diff line Loading @@ -2,26 +2,27 @@ lib, stdenv, fetchFromGitHub, # nativeBuildInputs cmake, pkg-config, # buildInputs glfw3, libGLU, libGL, libglut, libX11, libXcursor, libXi, libXinerama, libXrandr, libglut, xorgproto, libXi, pkg-config, Carbon, Cocoa, Kernel, OpenGL, settingsFile ? "include/box2d/b2_settings.h", nix-update-script, }: let inherit (lib) cmakeBool optionals; inherit (lib) cmakeBool; in stdenv.mkDerivation (finalAttrs: { Loading @@ -31,7 +32,7 @@ stdenv.mkDerivation (finalAttrs: { src = fetchFromGitHub { owner = "erincatto"; repo = "box2d"; rev = "v${finalAttrs.version}"; tag = "v${finalAttrs.version}"; hash = "sha256-yvhpgiZpjTPeSY7Ma1bh4LwIokUUKB10v2WHlamL9D8="; }; Loading @@ -40,42 +41,28 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; buildInputs = [ buildInputs = [ glfw3 libGLU libGL libglut libX11 libXcursor libXi libXinerama libXrandr libglut xorgproto libXi ] ++ optionals stdenv.hostPlatform.isDarwin [ Carbon Cocoa Kernel OpenGL ]; cmakeFlags = [ (cmakeBool "BOX2D_BUILD_UNIT_TESTS" finalAttrs.finalPackage.doCheck) ]; prePatch = '' substituteInPlace ${settingsFile} \ --replace-fail 'b2_maxPolygonVertices 8' 'b2_maxPolygonVertices 15' ''; # tests are broken on 2.4.2 and 2.3.x doesn't have tests: https://github.com/erincatto/box2d/issues/677 doCheck = lib.versionAtLeast finalAttrs.version "2.4.2"; meta = with lib; { meta = { description = "2D physics engine"; homepage = "https://box2d.org/"; maintainers = with maintainers; [ raskin ]; platforms = platforms.unix; license = licenses.zlib; changelog = "https://github.com/erincatto/box2d/releases/tag/v${finalAttrs.version}"; maintainers = with lib.maintainers; [ raskin ]; platforms = lib.platforms.unix; license = lib.licenses.zlib; }; })