summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2019-04-24 22:32:06 -0700
committerBen Sima <ben@bsima.me>2019-04-24 22:32:06 -0700
commitbc4c25e742d5e26aacf749372ce706bbfd899734 (patch)
tree0a71834d4edb1f03954a3df02dd40e88852be8d2
parentcb791831bc009827f797035ccc2e8c07db252349 (diff)
cmdwave experiment
-rw-r--r--apex/Cmdwave.hs8
-rw-r--r--pack/cmdwave.nix30
-rw-r--r--pack/default.nix1
3 files changed, 39 insertions, 0 deletions
diff --git a/apex/Cmdwave.hs b/apex/Cmdwave.hs
new file mode 100644
index 0000000..315f57a
--- /dev/null
+++ b/apex/Cmdwave.hs
@@ -0,0 +1,8 @@
+import Sound.Pulse.Simple
+
+main :: IO ()
+main = do
+ s <- simpleNew Nothing "example" Record Nothing "this is an example application"
+ (SampleSpec (F32 LittleEndian) 44100 1) Nothing Nothing
+ _ <- simpleRead s $ 44100*10 :: IO [Float]
+ simpleFree s
diff --git a/pack/cmdwave.nix b/pack/cmdwave.nix
new file mode 100644
index 0000000..a26945c
--- /dev/null
+++ b/pack/cmdwave.nix
@@ -0,0 +1,30 @@
+{ nixpkgs }:
+with nixpkgs;
+let
+ ghc = pkgs.haskell.packages.ghc844.ghcWithPackages (hp: with hp; [
+ hinotify
+
+ protolude
+ pulse-simple
+ ]);
+ entrypoint = "Cmdwave";
+in
+stdenv.mkDerivation rec {
+ name = "cmdwave";
+ version = "0";
+ src = ../.;
+ nativeBuildInputs = [
+ ghc
+ ];
+ strictDeps = true;
+ buildPhase = ''
+ ${ghc}/bin/ghc \
+ -iapex -ilore \
+ -main-is ${entrypoint} --make apex/${entrypoint}.hs \
+ -o bild/${name}
+ '';
+ installPhase = ''
+ mkdir -p $out/bin
+ cp bild/${name} $out/bin/${name}
+ '';
+}
diff --git a/pack/default.nix b/pack/default.nix
index 3c48884..a5a1313 100644
--- a/pack/default.nix
+++ b/pack/default.nix
@@ -5,4 +5,5 @@
fathom = import ./fathom.nix { inherit nixpkgs; };
ibb = import ./ibb.nix { inherit nixpkgs; };
bs = import ./bs.nix { inherit nixpkgs; };
+ cmdwave = import ./cmdwave.nix { inherit nixpkgs; };
}