make affection dependency and nixify
This commit is contained in:
parent
58fd609095
commit
9787364ae6
|
@ -0,0 +1,3 @@
|
||||||
|
packages:
|
||||||
|
./
|
||||||
|
./extern/*/
|
|
@ -20,5 +20,6 @@ executable pituicat
|
||||||
-- other-modules:
|
-- other-modules:
|
||||||
-- other-extensions:
|
-- other-extensions:
|
||||||
build-depends: base ^>=4.13.0.0
|
build-depends: base ^>=4.13.0.0
|
||||||
|
, affection
|
||||||
hs-source-dirs: src
|
hs-source-dirs: src
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }:
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
inherit (nixpkgs) pkgs;
|
||||||
|
|
||||||
|
affection = with haskellPackages; callPackage(
|
||||||
|
{ mkDerivation, base, bytestring, clock, containers, glib, linear
|
||||||
|
, monad-loops, monad-parallel, mtl, OpenGL, sdl2, stdenv, stm, text
|
||||||
|
, uuid, vector
|
||||||
|
}:
|
||||||
|
mkDerivation {
|
||||||
|
pname = "affection";
|
||||||
|
version = "0.0.0.10";
|
||||||
|
src = ./extern/affection;
|
||||||
|
isLibrary = true;
|
||||||
|
isExecutable = true;
|
||||||
|
libraryHaskellDepends = [
|
||||||
|
base bytestring clock containers glib linear monad-loops
|
||||||
|
monad-parallel mtl OpenGL sdl2 stm text uuid vector
|
||||||
|
];
|
||||||
|
homepage = "https://github.com/nek0/affection#readme";
|
||||||
|
description = "A simple Game Engine using SDL";
|
||||||
|
license = stdenv.lib.licenses.lgpl3;
|
||||||
|
}) {};
|
||||||
|
|
||||||
|
f = { mkDerivation, base, stdenv }:
|
||||||
|
mkDerivation {
|
||||||
|
pname = "pituicat";
|
||||||
|
version = "0.0.0.0";
|
||||||
|
src = ./.;
|
||||||
|
isLibrary = false;
|
||||||
|
isExecutable = true;
|
||||||
|
executableHaskellDepends = [ affection base ];
|
||||||
|
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
|
Loading…
Reference in New Issue