mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-29 00:53:57 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
45 lines
1.6 KiB
Nix
45 lines
1.6 KiB
Nix
{ stdenv, lib, fetchFromGitHub, cmake, libGL, SDL2, libGLU, catch }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "recastai";
|
|
# use latest revision for the CMake build process and OpenMW
|
|
# OpenMW use e75adf86f91eb3082220085e42dda62679f9a3ea
|
|
version = "unstable-2023-01-02";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "recastnavigation";
|
|
repo = "recastnavigation";
|
|
rev = "405cc095ab3a2df976a298421974a2af83843baf";
|
|
sha256 = "sha256-WVzDI7+UuAl10Tm1Zjkea/FMk0cIe7pWg0iyFLbwAdI=";
|
|
};
|
|
|
|
postPatch = ''
|
|
cp ${catch}/include/catch/catch.hpp Tests/catch.hpp
|
|
|
|
# https://github.com/recastnavigation/recastnavigation/issues/524
|
|
substituteInPlace CMakeLists.txt \
|
|
--replace '\$'{exec_prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \
|
|
--replace '\$'{prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR}
|
|
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
|
|
# Expects SDL2.framework in specific location, which we don't have
|
|
# Change where SDL2 headers are searched for to match what we do have
|
|
substituteInPlace RecastDemo/CMakeLists.txt \
|
|
--replace 'include_directories(''${SDL2_LIBRARY}/Headers)' 'include_directories(${SDL2.dev}/include/SDL2)'
|
|
'';
|
|
|
|
doCheck = true;
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
buildInputs = [ libGL SDL2 libGLU ];
|
|
|
|
meta = with lib; {
|
|
homepage = "https://github.com/recastnavigation/recastnavigation";
|
|
description = "Navigation-mesh Toolset for Games";
|
|
mainProgram = "RecastDemo";
|
|
license = licenses.zlib;
|
|
maintainers = with maintainers; [ marius851000 ];
|
|
platforms = platforms.all;
|
|
};
|
|
}
|