27 stdenv.mkDerivation rec {
29 version = "2024-09-23";
31 src = fetchFromGitHub {
35 fetchSubmodules = true;
36 hash = "sha256-OnZWoiQ5ASKQV73/W6nl17B2ANwqCy/PlybHbNwrOyQ=";
41 name = "0001-assimp-Include-cstdint-for-std-uint32_t.patch";
42 url = "https://github.com/assimp/assimp/commit/108e3192a201635e49e99a91ff2044e1851a2953.patch";
44 extraPrefix = "externals/assimp/";
45 hash = "sha256-rk0EFmgeZVwvx3NJOOob5Jwj9/J+eOtuAzfwp88o+J4=";
50 substituteInPlace CMakeLists.txt \
51 --replace "set(CMAKE_OSX_ARCHITECTURES x86_64)" ""
53 # Outdated vendored assimp, many warnings with newer compilers, too old for CMake option to control this
54 # Note that this -Werror caused issues on darwin, so make sure to re-check builds there before removing this
55 substituteInPlace externals/assimp/code/CMakeLists.txt \
56 --replace 'TARGET_COMPILE_OPTIONS(assimp PRIVATE -Werror)' ""
59 nativeBuildInputs = [ cmake pkg-config makeWrapper ];
61 buildInputs = [ zlib ]
62 ++ lib.optionals stdenv.hostPlatform.isLinux [ libX11 libXrandr libXinerama libXcursor libXi libXext alsa-lib fontconfig libGLU ]
63 ++ lib.optionals stdenv.hostPlatform.isDarwin [ AVFoundation Carbon Cocoa CoreAudio Kernel OpenGL ];
65 env.NIX_CFLAGS_COMPILE = toString [
67 "-Wno-error=array-bounds"
70 # error: writing 1 byte into a region of size 0
71 hardeningDisable = [ "fortify3" ];
76 mkdir -p $out/{bin,lib/foxotron}
77 cp -R ${lib.optionalString stdenv.hostPlatform.isDarwin "Foxotron.app/Contents/MacOS/"}Foxotron \
78 ../{config.json,Shaders,Skyboxes} $out/lib/foxotron/
79 wrapProgram $out/lib/foxotron/Foxotron \
80 --chdir "$out/lib/foxotron"
81 ln -s $out/{lib/foxotron,bin}/Foxotron
87 updateScript = nix-update-script { };
91 description = "General purpose model viewer";
93 ASSIMP based general purpose model viewer ("turntable") created for the
94 Revision 2021 3D Graphics Competition.
96 homepage = "https://github.com/Gargaj/Foxotron";
97 license = licenses.unlicense;
98 maintainers = with maintainers; [ OPNA2608 ];
99 platforms = platforms.all;
100 mainProgram = "Foxotron";