From e2df088ca4bfa11a6d5fa8ba59ad90bab07a0760 Mon Sep 17 00:00:00 2001 From: Alan Daniels Date: Mon, 8 Sep 2025 21:53:24 +1000 Subject: [PATCH] init --- README.md | 2 ++ flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 README.md create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/README.md b/README.md new file mode 100644 index 0000000..55cd0a4 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +Lovingly stolen & adapted from [ovitus/CDP8](https://github.com/ovitus/CDP8.nix). + diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..91de775 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1757068644, + "narHash": "sha256-NOrUtIhTkIIumj1E/Rsv1J37Yi3xGStISEo8tZm3KW4=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "8eb28adfa3dc4de28e792e3bf49fcf9007ca8ac9", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..4606ab6 --- /dev/null +++ b/flake.nix @@ -0,0 +1,41 @@ +{ + inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + outputs = { + nixpkgs, + self, + }: { + defaultPackage.x86_64-linux = with import nixpkgs {system = "x86_64-linux";}; let + cdp8 = + fetchFromGitHub + { + owner = "ComposersDesktop"; + repo = "CDP8"; + rev = "main"; + hash = "sha256-GG5RHgO5mwc24Rgq3lH+gan053vyZGPb1Gp8pOU5dG0="; + }; + in + stdenv.mkDerivation + { + name = "CDP 8.0.1"; + buildInputs = [clang cmake]; + buildCommand = '' + tar fx ${cdp8}/libaaio/libaaio-0.3.2.tar.bz2 + libaaio-0.3.2/configure --prefix $out + make install + mkdir $out/src + cp -r ${cdp8}/* $out/src + chmod -R +w $out + ln -s $out/include/* $out/src/dev/include + sed -i '/option(USE_LOCAL_PORTAUDIO/c\option(USE_LOCAL_PORTAUDIO OFF)' $out/src/CMakeLists.txt + sed -i 's/#*//' $out/src/dev/externals/CMakeLists.txt + mkdir $out/src/build + cd $out/src/build + cmake -DAAIOLIB=$out/lib/libaaio.so -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ .. + make + mkdir $out/bin + mv $out/src/NewRelease/* $out/bin + rm -r $out/include $out/lib $out/man $out/src + ''; + }; + }; +}