From 41faa71643c0433f2af7d2450fe5f3d1d90d4aef Mon Sep 17 00:00:00 2001 From: Brandon Elam Barker Date: Mon, 10 Sep 2018 00:40:32 +0000 Subject: [PATCH] fixing compile for modern ghc; adding nix build method --- .gitignore | 3 +++ MazesOfMonad.cabal | 2 +- default.nix | 9 +++++++++ mmaze.nix | 17 +++++++++++++++++ src/MoresmauJP/Rpg/Save.hs | 3 +-- 5 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 default.nix create mode 100644 mmaze.nix diff --git a/.gitignore b/.gitignore index ca8a8f3..66fd291 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ /.dist-buildwrapper /cabal.sandbox.config /.project + +# Editor related: +*~ diff --git a/MazesOfMonad.cabal b/MazesOfMonad.cabal index db5e5bf..b30da11 100644 --- a/MazesOfMonad.cabal +++ b/MazesOfMonad.cabal @@ -11,7 +11,7 @@ Category: Game Maintainer: jpmoresmau@gmail.com Synopsis: Console-based Role Playing Game Build-Type: Simple -tested-with: GHC==7.0.2 +tested-with: GHC==8.4.3 data-files: README.txt, WHATSNEW.txt, TODO.txt cabal-version: >= 1.6 diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..bf6110d --- /dev/null +++ b/default.nix @@ -0,0 +1,9 @@ +with import { }; +let + monadMaze = (haskellPackages.callPackage ./mmaze.nix {}); +in stdenv.mkDerivation { + name = "maze-monad-env"; + buildInputs = [ + monadMaze + ]; +} diff --git a/mmaze.nix b/mmaze.nix new file mode 100644 index 0000000..2bb847b --- /dev/null +++ b/mmaze.nix @@ -0,0 +1,17 @@ +{ mkDerivation, array, base, containers, directory, filepath, HUnit +, mtl, old-locale, pretty, random, regex-posix, stdenv, time +}: +mkDerivation { + pname = "MazesOfMonad"; + version = "1.0.9"; + src = ./.; + isLibrary = false; + isExecutable = true; + enableSeparateDataOutput = true; + executableHaskellDepends = [ + array base containers directory filepath HUnit mtl old-locale + pretty random regex-posix time + ]; + description = "Console-based Role Playing Game"; + license = stdenv.lib.licenses.bsd3; +} diff --git a/src/MoresmauJP/Rpg/Save.hs b/src/MoresmauJP/Rpg/Save.hs index 12965b7..f7f49ef 100644 --- a/src/MoresmauJP/Rpg/Save.hs +++ b/src/MoresmauJP/Rpg/Save.hs @@ -16,7 +16,6 @@ import MoresmauJP.Rpg.MazeObjects import System.Directory import System.FilePath import System.IO -import System.Locale import Text.Printf import System.IO.Error (catchIOError) @@ -261,4 +260,4 @@ readBackup s=do - \ No newline at end of file +