2021-04-16 20:39:20 +02:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, nix-update-script
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, makeWrapper
|
|
|
|
, zlib
|
|
|
|
, libX11
|
|
|
|
, libXrandr
|
|
|
|
, libXinerama
|
|
|
|
, libXcursor
|
|
|
|
, libXi
|
|
|
|
, libXext
|
|
|
|
, libGLU
|
2021-06-10 04:57:09 +02:00
|
|
|
, alsa-lib
|
2021-04-16 20:39:20 +02:00
|
|
|
, fontconfig
|
|
|
|
, AVFoundation
|
|
|
|
, Carbon
|
|
|
|
, Cocoa
|
|
|
|
, CoreAudio
|
|
|
|
, Kernel
|
|
|
|
, OpenGL
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "foxotron";
|
2021-05-03 11:15:22 +02:00
|
|
|
version = "2021-04-19";
|
2021-04-16 20:39:20 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Gargaj";
|
|
|
|
repo = "Foxotron";
|
|
|
|
rev = version;
|
|
|
|
fetchSubmodules = true;
|
2021-05-03 11:15:22 +02:00
|
|
|
sha256 = "sha256-YTCnWHXBNqvJmhRqRQRFCVvBcqbjKzcc3AKVXS0jvno=";
|
2021-04-16 20:39:20 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake pkg-config makeWrapper ];
|
|
|
|
|
|
|
|
buildInputs = [ zlib ]
|
2021-06-10 04:57:09 +02:00
|
|
|
++ lib.optionals stdenv.hostPlatform.isLinux [ libX11 libXrandr libXinerama libXcursor libXi libXext alsa-lib fontconfig libGLU ]
|
2021-04-16 20:39:20 +02:00
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [ AVFoundation Carbon Cocoa CoreAudio Kernel OpenGL ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/{bin,lib/foxotron}
|
|
|
|
cp -R ${lib.optionalString stdenv.hostPlatform.isDarwin "Foxotron.app/Contents/MacOS/"}Foxotron \
|
|
|
|
../{config.json,Shaders,Skyboxes} $out/lib/foxotron/
|
|
|
|
wrapProgram $out/lib/foxotron/Foxotron \
|
|
|
|
--run "cd $out/lib/foxotron"
|
|
|
|
ln -s $out/{lib/foxotron,bin}/Foxotron
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
updateScript = nix-update-script {
|
|
|
|
attrPath = pname;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "General purpose model viewer";
|
|
|
|
longDescription = ''
|
|
|
|
ASSIMP based general purpose model viewer ("turntable") created for the
|
|
|
|
Revision 2021 3D Graphics Competition.
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/Gargaj/Foxotron";
|
2021-05-03 11:35:44 +02:00
|
|
|
license = licenses.unlicense;
|
2021-04-16 20:39:20 +02:00
|
|
|
maintainers = with maintainers; [ OPNA2608 ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|