summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2016-06-02 15:19:14 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2016-06-02 15:19:14 +0200
commite4fe9710287960438856fa78b697ccae64b7e2eb (patch)
tree6d9283aa148a912f219acc6e0d9307f448736b69
download2017-01-16_17:13:37-e4fe9710287960438856fa78b697ccae64b7e2eb.tar
2017-01-16_17:13:37-e4fe9710287960438856fa78b697ccae64b7e2eb.tar.gz
2017-01-16_17:13:37-e4fe9710287960438856fa78b697ccae64b7e2eb.tar.bz2
2017-01-16_17:13:37-e4fe9710287960438856fa78b697ccae64b7e2eb.tar.xz
2017-01-16_17:13:37-e4fe9710287960438856fa78b697ccae64b7e2eb.zip
Build framework
-rw-r--r--LICENSE20
-rw-r--r--Setup.hs2
-rw-r--r--default.nix8
-rw-r--r--sequence.cabal24
-rw-r--r--sequence.nix10
-rw-r--r--shell.nix17
-rw-r--r--src/Main.hs2
7 files changed, 83 insertions, 0 deletions
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..bef535c
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,20 @@
1Copyright (c) 2016 Gregor Kleen
2
3Permission is hereby granted, free of charge, to any person obtaining
4a copy of this software and associated documentation files (the
5"Software"), to deal in the Software without restriction, including
6without limitation the rights to use, copy, modify, merge, publish,
7distribute, sublicense, and/or sell copies of the Software, and to
8permit persons to whom the Software is furnished to do so, subject to
9the following conditions:
10
11The above copyright notice and this permission notice shall be included
12in all copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/Setup.hs b/Setup.hs
new file mode 100644
index 0000000..9a994af
--- /dev/null
+++ b/Setup.hs
@@ -0,0 +1,2 @@
1import Distribution.Simple
2main = defaultMain
diff --git a/default.nix b/default.nix
new file mode 100644
index 0000000..ac19354
--- /dev/null
+++ b/default.nix
@@ -0,0 +1,8 @@
1{ pkgs ? (import <nixpkgs> {})
2, compilerName ? "ghc7103"
3}:
4
5rec {
6 haskellPackages = pkgs.haskell.packages."${compilerName}";
7 sequence = haskellPackages.callPackage ./sequence.nix {};
8}
diff --git a/sequence.cabal b/sequence.cabal
new file mode 100644
index 0000000..0cea160
--- /dev/null
+++ b/sequence.cabal
@@ -0,0 +1,24 @@
1-- Initial sequence.cabal generated by cabal init. For further
2-- documentation, see http://haskell.org/cabal/users-guide/
3
4name: sequence
5version: 0.0.0
6-- synopsis:
7-- description:
8license: MIT
9license-file: LICENSE
10author: Gregor Kleen
11maintainer: gkleen@yggdrasil.li
12-- copyright:
13category: Game
14build-type: Simple
15-- extra-source-files:
16cabal-version: >=1.10
17
18executable sequence
19 main-is: Main.hs
20 -- other-modules:
21 -- other-extensions:
22 build-depends: base >=4.8 && <4.9
23 hs-source-dirs: src
24 default-language: Haskell2010 \ No newline at end of file
diff --git a/sequence.nix b/sequence.nix
new file mode 100644
index 0000000..612eb30
--- /dev/null
+++ b/sequence.nix
@@ -0,0 +1,10 @@
1{ mkDerivation, base, stdenv }:
2mkDerivation {
3 pname = "sequence";
4 version = "0.0.0";
5 src = ./.;
6 isLibrary = false;
7 isExecutable = true;
8 executableHaskellDepends = [ base ];
9 license = stdenv.lib.licenses.mit;
10}
diff --git a/shell.nix b/shell.nix
new file mode 100644
index 0000000..294fea0
--- /dev/null
+++ b/shell.nix
@@ -0,0 +1,17 @@
1{ pkgs ? (import <nixpkgs> {})
2, haskellPackages ? (import ./default.nix { inherit pkgs; }).haskellPackages
3}:
4
5let
6 ghc = (haskellPackages.ghcWithPackages (ps: (payload ++ depends ++ (with ps; [ hlint cabal2nix cabal-install ])))).override { ignoreCollisions = true; };
7 payload = builtins.attrValues (import ./default.nix {});
8 depends = builtins.concatLists (builtins.map (x: if builtins.hasAttr "nativeBuildInputs" x then x.nativeBuildInputs else []) (builtins.attrValues (import ./default.nix {})));
9in pkgs.stdenv.mkDerivation rec {
10 bareName = "sequence";
11 name = "${bareName}-env";
12 buildInputs = [ ghc ];
13 shellHook = ''
14 eval $(egrep ^export ${ghc}/bin/ghc)
15 export PROMPT_INFO="${name}"
16 '';
17}
diff --git a/src/Main.hs b/src/Main.hs
new file mode 100644
index 0000000..e9e1deb
--- /dev/null
+++ b/src/Main.hs
@@ -0,0 +1,2 @@
1main :: IO ()
2main = undefined