diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2017-03-08 19:01:10 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2017-03-08 19:01:10 +0100 |
commit | 6454da50559e0eee810f81d33365a621857d8068 (patch) | |
tree | 6122875defb3062b410ee787ee9b7b0e5d5fd4f5 | |
parent | c22d1fbab9ffd09d461b82b096d9cac0edea7775 (diff) | |
download | trivmix-6454da50559e0eee810f81d33365a621857d8068.tar trivmix-6454da50559e0eee810f81d33365a621857d8068.tar.gz trivmix-6454da50559e0eee810f81d33365a621857d8068.tar.bz2 trivmix-6454da50559e0eee810f81d33365a621857d8068.tar.xz trivmix-6454da50559e0eee810f81d33365a621857d8068.zip |
Fix build
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | adjmix/Adjmix.hs | 1 | ||||
-rw-r--r-- | all.gup | 3 | ||||
-rw-r--r-- | default.nix | 11 | ||||
-rw-r--r-- | package.nix | 13 | ||||
-rw-r--r-- | result.gup | 8 | ||||
-rw-r--r-- | trivmix.nix.gup | 5 | ||||
-rw-r--r-- | trivmix/Trivmix.hs | 11 |
8 files changed, 32 insertions, 23 deletions
@@ -1 +1,2 @@ | |||
1 | result \ No newline at end of file | 1 | result |
2 | **/.gup | ||
diff --git a/adjmix/Adjmix.hs b/adjmix/Adjmix.hs index 0545395..c2f7fee 100644 --- a/adjmix/Adjmix.hs +++ b/adjmix/Adjmix.hs | |||
@@ -6,6 +6,7 @@ import System.FilePath | |||
6 | import System.FileLock | 6 | import System.FileLock |
7 | 7 | ||
8 | import Data.Char | 8 | import Data.Char |
9 | import Data.Monoid | ||
9 | 10 | ||
10 | import Trivmix.Types | 11 | import Trivmix.Types |
11 | 12 | ||
@@ -0,0 +1,3 @@ | |||
1 | #!/usr/bin/env zsh | ||
2 | |||
3 | gup -u result \ No newline at end of file | ||
diff --git a/default.nix b/default.nix index 804e871..57608b3 100644 --- a/default.nix +++ b/default.nix | |||
@@ -1,7 +1,6 @@ | |||
1 | argumentPackages@{ ... }: | ||
2 | |||
1 | let | 3 | let |
2 | pkgs = import <nixpkgs> {}; | 4 | defaultPackages = with (import <nixpkgs> {}); haskellPackages; |
3 | in rec { | 5 | pkgs = defaultPackages // argumentPackages; |
4 | trivmix = pkgs.stdenv.lib.overrideDerivation (pkgs.haskellPackages.callPackage ./trivmix.nix {}) (attrs : { | 6 | in pkgs.callPackage ./trivmix.nix {} |
5 | src = ./.; | ||
6 | }); | ||
7 | } | ||
diff --git a/package.nix b/package.nix deleted file mode 100644 index 37cc9e2..0000000 --- a/package.nix +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | { fetchgit | ||
2 | , stdenv | ||
3 | , callPackage | ||
4 | }: | ||
5 | |||
6 | stdenv.lib.overrideDerivation (callPackage ./trivmix.nix {}) (attrs : { | ||
7 | src = fetchgit { | ||
8 | url = git://git.yggdrasil.li/trivmix; | ||
9 | # nix-shell -p nix-prefetch-scripts --command 'nix-prefetch-git git://git.yggdrasil.li/beuteltier' 2>&1 | grep -E '(git revision|hash) is ' | sed -r 's/git revision is /rev = "/' | sed -r 's/hash is /sha256 = "/' | sed -r 's/$/";/' | ||
10 | rev = "304e7615ddee7a8b1d8f7d7690c8da57f8a2704e"; | ||
11 | sha256 = "1hz8zxqsv1700jn7siysm7prfjjx2a4cn1ip4kcrigckvjw6a67r"; | ||
12 | }; | ||
13 | }) | ||
diff --git a/result.gup b/result.gup new file mode 100644 index 0000000..86b28dd --- /dev/null +++ b/result.gup | |||
@@ -0,0 +1,8 @@ | |||
1 | #!/usr/bin/env zsh | ||
2 | |||
3 | gup --always | ||
4 | gup -u trivmix.nix default.nix | ||
5 | |||
6 | nix-build -o ${1} ./default.nix | ||
7 | |||
8 | find . \( \( -name '.gup' -or -name '.git' \) -prune \) -or \( -type f -exec shasum '{}' ';' \) | gup --contents | ||
diff --git a/trivmix.nix.gup b/trivmix.nix.gup new file mode 100644 index 0000000..bc92dcd --- /dev/null +++ b/trivmix.nix.gup | |||
@@ -0,0 +1,5 @@ | |||
1 | #!/usr/bin/env zsh | ||
2 | |||
3 | gup -u ${2:r}.cabal | ||
4 | cd ${2:h} | ||
5 | cabal2nix ./. >! ${1} | ||
diff --git a/trivmix/Trivmix.hs b/trivmix/Trivmix.hs index b437abc..a13460f 100644 --- a/trivmix/Trivmix.hs +++ b/trivmix/Trivmix.hs | |||
@@ -30,6 +30,7 @@ import System.IO | |||
30 | import System.FileLock | 30 | import System.FileLock |
31 | import System.INotify | 31 | import System.INotify |
32 | 32 | ||
33 | import Data.Monoid | ||
33 | import Data.Char | 34 | import Data.Char |
34 | import Data.Function | 35 | import Data.Function |
35 | 36 | ||
@@ -41,6 +42,7 @@ data Options = Options | |||
41 | { input :: String | 42 | { input :: String |
42 | , output :: String | 43 | , output :: String |
43 | , client :: String | 44 | , client :: String |
45 | , initialLevel :: Level | ||
44 | , run :: Maybe String | 46 | , run :: Maybe String |
45 | , levelFiles :: [FilePath] | 47 | , levelFiles :: [FilePath] |
46 | } | 48 | } |
@@ -63,6 +65,12 @@ optionParser = Options | |||
63 | <> metavar "STRING" | 65 | <> metavar "STRING" |
64 | <> help "Client name to use in jack (the part before the colon in port names)" | 66 | <> help "Client name to use in jack (the part before the colon in port names)" |
65 | ) | 67 | ) |
68 | <*> option auto ( long "level" | ||
69 | <> metavar "LEVEL" | ||
70 | <> help "Initial value for level" | ||
71 | <> value def | ||
72 | <> showDefault | ||
73 | ) | ||
66 | <*> optional ( strOption ( long "run" | 74 | <*> optional ( strOption ( long "run" |
67 | <> metavar "FILE" | 75 | <> metavar "FILE" |
68 | <> help "Execute a file once setup of jacks is done (use this to autoconnect)\nThe executable gets passed the input port (including client name) as its first argument and the output as its second." | 76 | <> help "Execute a file once setup of jacks is done (use this to autoconnect)\nThe executable gets passed the input port (including client name) as its first argument and the output as its second." |
@@ -84,9 +92,6 @@ watchedAttrs = [ Modify | |||
84 | , DeleteSelf | 92 | , DeleteSelf |
85 | ] | 93 | ] |
86 | 94 | ||
87 | initialLevel :: Level | ||
88 | initialLevel = def | ||
89 | |||
90 | defFileMode :: FileMode | 95 | defFileMode :: FileMode |
91 | defFileMode = foldl unionFileModes nullFileMode [ ownerReadMode | 96 | defFileMode = foldl unionFileModes nullFileMode [ ownerReadMode |
92 | , ownerWriteMode | 97 | , ownerWriteMode |