vulkan-tutorial/shell.nix

62 lines
2.1 KiB
Nix
Raw Normal View History

2018-03-28 00:12:35 +00:00
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }:
let
inherit (nixpkgs) pkgs;
2018-06-18 18:10:13 +00:00
nanovgNeko = with haskellPackages; callPackage (
2018-06-18 18:12:36 +00:00
{ mkDerivation, base, bytestring, c2hs, containers, glew
2018-06-18 18:10:13 +00:00
, hspec, inline-c, libGL, libGLU, QuickCheck, stdenv, text, vector
}:
2018-03-28 00:12:35 +00:00
mkDerivation {
pname = "nanovg";
2018-06-18 18:10:13 +00:00
version = "0.6.0.0";
sha256 = "e35a2772f2a2e71916013cab70eeb8eedd6f66b5490ddf7ce237c8c76895d496";
2018-03-28 00:12:35 +00:00
isLibrary = true;
isExecutable = true;
doCheck = false;
libraryHaskellDepends = [ base bytestring containers text vector ];
2018-06-18 18:12:36 +00:00
librarySystemDepends = [ glew libGL libGLU ];
2018-06-18 18:10:13 +00:00
libraryPkgconfigDepends = [ glew ];
2018-03-28 00:12:35 +00:00
libraryToolDepends = [ c2hs ];
testHaskellDepends = [ base containers hspec inline-c QuickCheck ];
homepage = "https://github.com/cocreature/nanovg-hs";
description = "Haskell bindings for nanovg";
2018-06-18 18:10:13 +00:00
license = stdenv.lib.licenses.isc;
}) {};
2018-03-28 00:12:35 +00:00
f = { mkDerivation, base, bytestring, clock, containers, deepseq
, glib, linear, matrix, monad-loops, monad-parallel, mtl
, OpenGL, random, sdl2, stdenv, stm, text, uuid, vector
}:
mkDerivation {
pname = "affection";
version = "0.0.0.9";
src = ./.;
configureFlags = [ "-fexamples" ];
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
base bytestring clock containers glib linear monad-loops
monad-parallel mtl OpenGL sdl2 stm text uuid vector
];
executableHaskellDepends = [
base containers deepseq linear matrix nanovgNeko OpenGL random sdl2 stm
];
homepage = "https://github.com/nek0/affection#readme";
description = "A simple Game Engine using SDL";
license = stdenv.lib.licenses.lgpl3;
};
haskellPackages = if compiler == "default"
then pkgs.haskellPackages
else pkgs.haskell.packages.${compiler};
variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id;
drv = variant (haskellPackages.callPackage f {});
in
if pkgs.lib.inNixShell then drv.env else drv