haskelloids/shell.nix

91 lines
3.1 KiB
Nix
Raw Normal View History

2018-03-27 20:45:00 +00:00
{ nixpkgs ? import <nixpkgs> {}
, compiler ? "default"
, doBenchmark ? false
}:
let
inherit (nixpkgs) pkgs;
2018-12-27 12:49:12 +00:00
sdl = with haskellPackages; callPackage(
{ mkDerivation, base, bytestring, deepseq, exceptions, linear, SDL2
, StateVar, stdenv, text, transformers, vector, weigh
}:
mkDerivation {
pname = "sdl2";
version = "2.4.1.0";
sha256 = "21a569c0c19f8ff2bbe1cf1d3eb32f65e8143806de353cedd240df5e9d088b5c";
isLibrary = true;
isExecutable = true;
enableSeparateDataOutput = true;
libraryHaskellDepends = [
base bytestring exceptions linear StateVar text transformers vector
];
librarySystemDepends = [ SDL2 ];
libraryPkgconfigDepends = [ SDL2 ];
doCheck = false;
testHaskellDepends = [ base deepseq linear vector weigh ];
description = "Both high- and low-level bindings to the SDL library (version 2.0.4+).";
license = stdenv.lib.licenses.bsd3;
}) {};
2018-03-27 21:58:25 +00:00
nanovgNeko = with haskellPackages; callPackage ({
mkDerivation, base, bytestring, c2hs, containers, glew, hspec,
inline-c, libGL, libGLU, QuickCheck, text, vector, pkgconfig }:
mkDerivation {
pname = "nanovg";
2018-07-03 22:49:08 +00:00
version = "0.6.0.0";
2018-03-27 22:21:10 +00:00
#src = pkgs.fetchFromGitHub {
# owner = "nek0";
# repo = "nanovg-hs";
# rev = "21868dc2c8e6eae8e7c0962d22890a8f2522cab0";
# sha256 = "0diyyajniyxzmg5za34crwwlajf40x8bplja6mbgv2syax5d446d";
# fetchSubmodules = true;
#};
src = ../nanovg-hs;
2018-03-27 21:58:25 +00:00
revision = "1";
isLibrary = true;
isExecutable = true;
doCheck = false;
libraryHaskellDepends = [ base bytestring containers text vector ];
librarySystemDepends = [ glew libGL libGLU pkgconfig ];
libraryToolDepends = [ c2hs ];
testHaskellDepends = [ base containers hspec inline-c QuickCheck ];
homepage = "https://github.com/cocreature/nanovg-hs";
description = "Haskell bindings for nanovg";
license = pkgs.stdenv.lib.licenses.isc;
hydraPlatforms = pkgs.stdenv.lib.platforms.none;
}) { inherit (pkgs) glew; inherit (pkgs) libGL; inherit (pkgs) libGLU; inherit (pkgs) pkgconfig; };
2018-12-27 12:49:12 +00:00
f = { mkDerivation, affection, base, containers, glew
, linear, OpenGL, random, stdenv, stm
2018-03-27 20:45:00 +00:00
}:
mkDerivation {
pname = "haskelloids";
version = "0.0.0.1";
src = ./.;
isLibrary = false;
isExecutable = true;
2018-12-27 12:49:12 +00:00
enableExecutableProfiling = true;
2018-03-27 20:45:00 +00:00
executableHaskellDepends = [
2018-12-27 12:49:12 +00:00
affection base containers linear nanovgNeko OpenGL random sdl stm
2018-03-27 20:45:00 +00:00
];
executableSystemDepends = [ glew ];
executablePkgconfigDepends = [ glew ];
description = "A little game using Affection";
license = stdenv.lib.licenses.gpl3;
};
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