summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2017-03-08 19:01:10 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2017-03-08 19:01:10 +0100
commit6454da50559e0eee810f81d33365a621857d8068 (patch)
tree6122875defb3062b410ee787ee9b7b0e5d5fd4f5
parentc22d1fbab9ffd09d461b82b096d9cac0edea7775 (diff)
downloadtrivmix-6454da50559e0eee810f81d33365a621857d8068.tar
trivmix-6454da50559e0eee810f81d33365a621857d8068.tar.gz
trivmix-6454da50559e0eee810f81d33365a621857d8068.tar.bz2
trivmix-6454da50559e0eee810f81d33365a621857d8068.tar.xz
trivmix-6454da50559e0eee810f81d33365a621857d8068.zip
Fix build
-rw-r--r--.gitignore3
-rw-r--r--adjmix/Adjmix.hs1
-rw-r--r--all.gup3
-rw-r--r--default.nix11
-rw-r--r--package.nix13
-rw-r--r--result.gup8
-rw-r--r--trivmix.nix.gup5
-rw-r--r--trivmix/Trivmix.hs11
8 files changed, 32 insertions, 23 deletions
diff --git a/.gitignore b/.gitignore
index e2f5dd2..ec8ef8d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
1result \ No newline at end of file 1result
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
6import System.FileLock 6import System.FileLock
7 7
8import Data.Char 8import Data.Char
9import Data.Monoid
9 10
10import Trivmix.Types 11import Trivmix.Types
11 12
diff --git a/all.gup b/all.gup
new file mode 100644
index 0000000..c83d29c
--- /dev/null
+++ b/all.gup
@@ -0,0 +1,3 @@
1#!/usr/bin/env zsh
2
3gup -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 @@
1argumentPackages@{ ... }:
2
1let 3let
2 pkgs = import <nixpkgs> {}; 4 defaultPackages = with (import <nixpkgs> {}); haskellPackages;
3in rec { 5 pkgs = defaultPackages // argumentPackages;
4 trivmix = pkgs.stdenv.lib.overrideDerivation (pkgs.haskellPackages.callPackage ./trivmix.nix {}) (attrs : { 6in 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
6stdenv.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
3gup --always
4gup -u trivmix.nix default.nix
5
6nix-build -o ${1} ./default.nix
7
8find . \( \( -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
3gup -u ${2:r}.cabal
4cd ${2:h}
5cabal2nix ./. >! ${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
30import System.FileLock 30import System.FileLock
31import System.INotify 31import System.INotify
32 32
33import Data.Monoid
33import Data.Char 34import Data.Char
34import Data.Function 35import 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
87initialLevel :: Level
88initialLevel = def
89
90defFileMode :: FileMode 95defFileMode :: FileMode
91defFileMode = foldl unionFileModes nullFileMode [ ownerReadMode 96defFileMode = foldl unionFileModes nullFileMode [ ownerReadMode
92 , ownerWriteMode 97 , ownerWriteMode