Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
os: [ubuntu, macos]
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
- uses: cachix/install-nix-action@v31
# TODO: the "sofa" account on cachix does not exist yet
#- uses: cachix/cachix-action@v15
#with:
Expand Down
3 changes: 2 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
devShells.default = pkgs.mkShell { inputsFrom = [ self'.packages.default ]; };
packages = {
default = self'.packages.sofa;
sofa = pkgs.callPackage ./package.nix { };
sofa = pkgs.callPackage ./package.nix { inherit (self'.packages) tight_inclusion; };
tight_inclusion = pkgs.callPackage ./tight_inclusion.nix { };
};
};
};
Expand Down
4 changes: 4 additions & 0 deletions package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
qt6Packages,
libGL,
metis,
nlohmann_json,
stdenv,
tight_inclusion,
tinyxml-2,
zlib,
}:
Expand Down Expand Up @@ -53,7 +55,9 @@ stdenv.mkDerivation (finalAttrs: {
qt6Packages.qtbase
libGL
metis
nlohmann_json
tinyxml-2
tight_inclusion
zlib
];

Expand Down
71 changes: 71 additions & 0 deletions tight_inclusion.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
lib,

stdenv,
fetchFromGitHub,

cmake,

eigen,
spdlog,
}:

let
cf = fetchFromGitHub {
owner = "conda-forge";
repo = "tight-inclusion-feedstock";
rev = "ad0bb48ec12aa991ae208252cdd7e61fa37bdc10";
hash = "sha256-4v6h1c2fe0DK5z/s86B7oUyUBAYXTnMHzOpBM91NEpY=";
};

in

stdenv.mkDerivation (finalAttrs: {
pname = "tight-inclusion";
version = "1.0.6";

src = fetchFromGitHub {
owner = "Continuous-Collision-Detection";
repo = "Tight-Inclusion";
tag = "v${finalAttrs.version}";
hash = "sha256-Yq79qShpA5VmPan+QV05GrGrmsoUuVFCrJDK7F207Qs=";
};

patches = [
"${cf}/recipe/patches/0001-Export-target-install-header-in-right-dir-still-need.patch"
"${cf}/recipe/patches/0002-Export-symbols-on-windows.patch"
"${cf}/recipe/patches/0003-patch-for-conda-forge-package.patch"
"${cf}/recipe/patches/0004-add-cmake-config-file-homogenize-project-name.patch"
"${cf}/recipe/patches/0005-fix-installation-of-configured-config.hpp-file.patch"
];

postPatch = ''
# we don't need the bin
substituteInPlace CMakeLists.txt \
--replace-fail \
"add_subdirectory(app)" \
""
'';

nativeBuildInputs = [
cmake
];

propagatedBuildInputs = [
eigen
spdlog
];

cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON"
"-DTIGHT_INCLUSION_TOPLEVEL_PROJECT=ON"
];

meta = {
description = "Conservative continuous collision detection (CCD) method with support for minimum separation";
homepage = "https://github.com/Continuous-Collision-Detection/Tight-Inclusion";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ nim65s ];
platforms = lib.platforms.unix;
};
})
Loading