Compare commits
15 commits
resourceti
...
master
Author | SHA1 | Date | |
---|---|---|---|
d0465fa3e1 | |||
|
523265b2dc | ||
|
f92949b7f0 | ||
1976a6c4c1 | |||
086eb3e1f2 | |||
818a1e424c | |||
445b5807e0 | |||
f7e7c9dcc8 | |||
5bef189c30 | |||
efbb9b4c5e | |||
76225dff4b | |||
eda79eb626 | |||
04d6905de1 | |||
b56ed86e45 | |||
af0dcc16da |
7 changed files with 83 additions and 53 deletions
1
.envrc
Normal file
1
.envrc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
use flake
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -17,4 +17,4 @@ dist*/
|
||||||
report.html
|
report.html
|
||||||
*.bak
|
*.bak
|
||||||
.direnv/
|
.direnv/
|
||||||
.envrc
|
result
|
||||||
|
|
|
@ -16,7 +16,7 @@ homepage: https://github.com/nek0/affection#readme
|
||||||
license: LGPL-3
|
license: LGPL-3
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: nek0
|
author: nek0
|
||||||
maintainer: nek0@chelnok.de
|
maintainer: nek0@nek0.eu
|
||||||
category: Game
|
category: Game
|
||||||
build-type: Simple
|
build-type: Simple
|
||||||
extra-source-files: ChangeLog.md
|
extra-source-files: ChangeLog.md
|
||||||
|
@ -29,7 +29,7 @@ cabal-version: >=2.0
|
||||||
|
|
||||||
source-repository head
|
source-repository head
|
||||||
type: git
|
type: git
|
||||||
location: https://github.com/nek0/affection
|
location: https://gitea.nek0.eu/nek0/affection.git
|
||||||
|
|
||||||
flag verbose
|
flag verbose
|
||||||
description: Enable verbose debug messages
|
description: Enable verbose debug messages
|
||||||
|
@ -99,7 +99,7 @@ library
|
||||||
-- , UndecidableInstances
|
-- , UndecidableInstances
|
||||||
hs-source-dirs: src
|
hs-source-dirs: src
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
ghc-options: -Wall
|
ghc-options: -threaded -Wall
|
||||||
-- Other library packages from which modules are imported.
|
-- Other library packages from which modules are imported.
|
||||||
build-depends: base >=4.9 && < 5
|
build-depends: base >=4.9 && < 5
|
||||||
, sdl2 >= 2.5
|
, sdl2 >= 2.5
|
||||||
|
@ -127,12 +127,11 @@ executable example00
|
||||||
ghc-options: -threaded -Wall
|
ghc-options: -threaded -Wall
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
default-extensions: OverloadedStrings
|
default-extensions: OverloadedStrings
|
||||||
if flag(examples)
|
build-depends: base >=4.9 && < 5
|
||||||
build-depends: base >=4.9 && < 5
|
, affection
|
||||||
, affection
|
, sdl2 >= 2.5
|
||||||
, sdl2 >= 2.5
|
, stm
|
||||||
, stm
|
if !flag(examples)
|
||||||
else
|
|
||||||
buildable: False
|
buildable: False
|
||||||
|
|
||||||
-- A small game of life implementation
|
-- A small game of life implementation
|
||||||
|
@ -143,19 +142,18 @@ executable example01
|
||||||
ghc-options: -threaded -Wall
|
ghc-options: -threaded -Wall
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
default-extensions: OverloadedStrings
|
default-extensions: OverloadedStrings
|
||||||
if flag(examples)
|
build-depends: base >=4.9 && < 5
|
||||||
build-depends: base >=4.9 && < 5
|
, affection
|
||||||
, affection
|
, sdl2 >= 2.5
|
||||||
, sdl2 >= 2.5
|
, stm
|
||||||
, stm
|
, OpenGL
|
||||||
, OpenGL
|
, random
|
||||||
, random
|
, containers
|
||||||
, containers
|
, linear
|
||||||
, linear
|
, matrix
|
||||||
, matrix
|
, nanovg >= 0.6.0.0
|
||||||
, nanovg >= 0.6.0.0
|
, deepseq
|
||||||
, deepseq
|
if !flag(examples)
|
||||||
else
|
|
||||||
buildable: False
|
buildable: False
|
||||||
|
|
||||||
-- Another small game of life implementation
|
-- Another small game of life implementation
|
||||||
|
@ -166,17 +164,16 @@ executable example02
|
||||||
ghc-options: -threaded -Wall
|
ghc-options: -threaded -Wall
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
default-extensions: OverloadedStrings
|
default-extensions: OverloadedStrings
|
||||||
if flag(examples)
|
build-depends: base >=4.9 && < 5
|
||||||
build-depends: base >=4.9 && < 5
|
, affection
|
||||||
, affection
|
, sdl2 >= 2.5
|
||||||
, sdl2 >= 2.5
|
, stm
|
||||||
, stm
|
, OpenGL
|
||||||
, OpenGL
|
, random
|
||||||
, random
|
, containers
|
||||||
, containers
|
, linear
|
||||||
, linear
|
, matrix
|
||||||
, matrix
|
, nanovg >= 0.6.0.0
|
||||||
, nanovg >= 0.6.0.0
|
, deepseq
|
||||||
, deepseq
|
if !flag(examples)
|
||||||
else
|
|
||||||
buildable: False
|
buildable: False
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
constraints: affection +verbose +examples
|
packages: ./*.cabal
|
||||||
profiling: true
|
|
||||||
packages:
|
package affection
|
||||||
./.
|
flags: +examples
|
||||||
|
|
30
flake.lock
30
flake.lock
|
@ -1,12 +1,15 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1659877975,
|
"lastModified": 1694529238,
|
||||||
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
|
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
|
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -17,11 +20,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1663173135,
|
"lastModified": 1700844339,
|
||||||
"narHash": "sha256-QL4JZYUlbt0ex78w30XJ0h9idUMj0DBxppyDsoxEPjE=",
|
"narHash": "sha256-VRlPYk0eRn1ao75hoA99LGehYhxZH5RlkP1YXpVROHM=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "5d1ddac9493642d7311a064351e643de9a0e24ee",
|
"rev": "33576fdfce2d11204067d6cfa99a2f990ef2169a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -35,6 +38,21 @@
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
26
flake.nix
26
flake.nix
|
@ -17,21 +17,37 @@
|
||||||
pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; }));
|
pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; }));
|
||||||
|
|
||||||
packageName = "affection";
|
packageName = "affection";
|
||||||
in {
|
in rec {
|
||||||
packages.${packageName} = # (ref:haskell-package-def)
|
packages.${packageName} = # (ref:haskell-package-def)
|
||||||
haskellPackages.callCabal2nix packageName self rec {
|
haskellPackages.callCabal2nixWithOptions packageName self "--flag examples" {
|
||||||
# Dependency overrides go here
|
# Dependency overrides go here
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultPackage = self.packages.${system}.${packageName};
|
defaultPackage = self.packages.${system}.${packageName};
|
||||||
|
|
||||||
devShell = pkgs.mkShell {
|
apps = {
|
||||||
|
example00 = {
|
||||||
|
type = "app";
|
||||||
|
program = "${self.packages.${system}.${packageName}}/bin/example00";
|
||||||
|
};
|
||||||
|
example01 = {
|
||||||
|
type = "app";
|
||||||
|
program = "${self.packages.${system}.${packageName}}/bin/example01";
|
||||||
|
};
|
||||||
|
example02 = {
|
||||||
|
type = "app";
|
||||||
|
program = "${self.packages.${system}.${packageName}}/bin/example02";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
devShell = haskellPackages.shellFor {
|
||||||
|
packages = p: [ defaultPackage ];
|
||||||
|
withHoogle = true;
|
||||||
buildInputs = with haskellPackages; [
|
buildInputs = with haskellPackages; [
|
||||||
haskell-language-server
|
haskell-language-server
|
||||||
ghcid
|
ghcid
|
||||||
cabal-install
|
cabal-install
|
||||||
];
|
] ++ (builtins.attrValues self.packages.${system});
|
||||||
inputsFrom = builtins.attrValues self.packages.${system};
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
2
hie.yaml
2
hie.yaml
|
@ -1,2 +0,0 @@
|
||||||
cradle:
|
|
||||||
cabal:
|
|
Loading…
Reference in a new issue