Compare commits

..

No commits in common. "master" and "resourcetify" have entirely different histories.

7 changed files with 53 additions and 83 deletions

1
.envrc
View file

@ -1 +0,0 @@
use flake

2
.gitignore vendored
View file

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

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@nek0.eu maintainer: nek0@chelnok.de
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://gitea.nek0.eu/nek0/affection.git location: https://github.com/nek0/affection
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: -threaded -Wall ghc-options: -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,11 +127,12 @@ executable example00
ghc-options: -threaded -Wall ghc-options: -threaded -Wall
default-language: Haskell2010 default-language: Haskell2010
default-extensions: OverloadedStrings default-extensions: OverloadedStrings
build-depends: base >=4.9 && < 5 if flag(examples)
, affection build-depends: base >=4.9 && < 5
, sdl2 >= 2.5 , affection
, stm , sdl2 >= 2.5
if !flag(examples) , stm
else
buildable: False buildable: False
-- A small game of life implementation -- A small game of life implementation
@ -142,18 +143,19 @@ executable example01
ghc-options: -threaded -Wall ghc-options: -threaded -Wall
default-language: Haskell2010 default-language: Haskell2010
default-extensions: OverloadedStrings default-extensions: OverloadedStrings
build-depends: base >=4.9 && < 5 if flag(examples)
, affection build-depends: base >=4.9 && < 5
, sdl2 >= 2.5 , affection
, stm , sdl2 >= 2.5
, OpenGL , stm
, random , OpenGL
, containers , random
, linear , containers
, matrix , linear
, nanovg >= 0.6.0.0 , matrix
, deepseq , nanovg >= 0.6.0.0
if !flag(examples) , deepseq
else
buildable: False buildable: False
-- Another small game of life implementation -- Another small game of life implementation
@ -164,16 +166,17 @@ executable example02
ghc-options: -threaded -Wall ghc-options: -threaded -Wall
default-language: Haskell2010 default-language: Haskell2010
default-extensions: OverloadedStrings default-extensions: OverloadedStrings
build-depends: base >=4.9 && < 5 if flag(examples)
, affection build-depends: base >=4.9 && < 5
, sdl2 >= 2.5 , affection
, stm , sdl2 >= 2.5
, OpenGL , stm
, random , OpenGL
, containers , random
, linear , containers
, matrix , linear
, nanovg >= 0.6.0.0 , matrix
, deepseq , nanovg >= 0.6.0.0
if !flag(examples) , deepseq
else
buildable: False buildable: False

View file

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

View file

@ -1,15 +1,12 @@
{ {
"nodes": { "nodes": {
"flake-utils": { "flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": { "locked": {
"lastModified": 1694529238, "lastModified": 1659877975,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384", "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -20,11 +17,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1700844339, "lastModified": 1663173135,
"narHash": "sha256-VRlPYk0eRn1ao75hoA99LGehYhxZH5RlkP1YXpVROHM=", "narHash": "sha256-QL4JZYUlbt0ex78w30XJ0h9idUMj0DBxppyDsoxEPjE=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "33576fdfce2d11204067d6cfa99a2f990ef2169a", "rev": "5d1ddac9493642d7311a064351e643de9a0e24ee",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -38,21 +35,6 @@
"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,37 +17,21 @@
pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; })); pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; }));
packageName = "affection"; packageName = "affection";
in rec { in {
packages.${packageName} = # (ref:haskell-package-def) packages.${packageName} = # (ref:haskell-package-def)
haskellPackages.callCabal2nixWithOptions packageName self "--flag examples" { haskellPackages.callCabal2nix packageName self rec {
# Dependency overrides go here # Dependency overrides go here
}; };
defaultPackage = self.packages.${system}.${packageName}; defaultPackage = self.packages.${system}.${packageName};
apps = { devShell = pkgs.mkShell {
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 Normal file
View file

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