Compare commits

...

15 commits

Author SHA1 Message Date
d0465fa3e1 small update of flake and project URL 2023-11-24 18:42:15 +01:00
Amedeo Molnár
523265b2dc rework flake to include haskell build inputs 2023-04-20 10:33:18 +02:00
Amedeo Molnár
f92949b7f0 make threaded 2023-04-20 10:32:51 +02:00
1976a6c4c1 add cabal.project 2023-04-20 07:05:50 +02:00
086eb3e1f2 flake update 2023-04-20 06:47:54 +02:00
818a1e424c add .envrc 2023-04-20 06:37:05 +02:00
445b5807e0 ignore result symlink 2023-03-25 21:51:50 +01:00
f7e7c9dcc8 update 2023-03-25 13:40:07 +01:00
5bef189c30 get working flake 2022-12-01 19:56:25 +01:00
efbb9b4c5e remove ballast 2022-12-01 16:34:40 +01:00
76225dff4b more flakyness 2022-12-01 16:23:43 +01:00
eda79eb626 fix flake 2022-12-01 15:45:21 +01:00
04d6905de1 remove ballast 2022-12-01 15:45:07 +01:00
b56ed86e45 revert 2022-09-14 19:30:22 +02:00
af0dcc16da fix typo 2022-09-14 19:29:46 +02:00
7 changed files with 83 additions and 53 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

2
.gitignore vendored
View file

@ -17,4 +17,4 @@ dist*/
report.html report.html
*.bak *.bak
.direnv/ .direnv/
.envrc result

View file

@ -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

View file

@ -1,4 +1,4 @@
constraints: affection +verbose +examples packages: ./*.cabal
profiling: true
packages: package affection
./. flags: +examples

View file

@ -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",

View file

@ -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};
}; };
}); });
} }

View file

@ -1,2 +0,0 @@
cradle:
cabal: