From 10a4f897fc27400e66306e8a40f80ce253c7e8c9 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Fri, 19 Nov 2021 15:01:39 +0100 Subject: [PATCH] colorchord2: init at unstable-2021-11-12 --- colorchord2/default.nix | 66 +++++++++++++++++++++++++++++++++++++++++ default.nix | 2 ++ flake.nix | 1 + 3 files changed, 69 insertions(+) create mode 100644 colorchord2/default.nix diff --git a/colorchord2/default.nix b/colorchord2/default.nix new file mode 100644 index 0000000..84224b9 --- /dev/null +++ b/colorchord2/default.nix @@ -0,0 +1,66 @@ +{ lib +, stdenv +, fetchFromGitHub +, pkg-config +, alsa-lib +, freeglut +, libusb +, pulseaudio +, xlibs +}: + +stdenv.mkDerivation rec { + pname = "colorchord"; + version = "unstable-2021-11-12"; + + src = fetchFromGitHub { + owner = "cnlohr"; + repo = pname; + rev = "0a44c600243636ef8fbaf11c728c49412e8ad8d4"; + sha256 = "sha256-a9nOdj7Q8vDoseoE+u5/DWRxSCXiSxs/7r74PcoDc2k="; + fetchSubmodules = true; + }; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ + alsa-lib + freeglut + libusb + pulseaudio + ] ++ (with xlibs; [ + libX11 + libXext + libXinerama + ]); + + postPatch = '' + substituteInPlace colorchord2/configs.c \ + --replace "default.conf" "$out/share/colorchord2/default.conf" + ''; + + # settings sourceRoot makes the rest read-only, which breaks the build + preBuild = '' + cd colorchord2 + ''; + + makeFlags = [ "colorchord" "colorchord-opengl" ]; + + installPhase = '' + runHook preInstall + + mkdir -p $out/{bin,share/colorchord2} + + cp colorchord{,-opengl} $out/bin/ + cp *.conf $out/share/colorchord2/ + + runHook postInstall + ''; + + meta = with lib; { + description = "Chromatic Sound to Light Conversion System"; + homepage = "https://github.com/cnlohr/colorchord"; + license = licenses.free; # 3-clause BSD license with modified 3rd clause (https://github.com/cnlohr/colorchord/blob/master/LICENSE) + maintainers = with maintainers; [ sbruder ]; + platforms = platforms.all; + }; +} diff --git a/default.nix b/default.nix index be01d84..8277f40 100644 --- a/default.nix +++ b/default.nix @@ -17,6 +17,8 @@ in }; python3Packages = prev.recurseIntoAttrs final.python3.pkgs; + colorchord2 = callPackage ./colorchord2 { }; + cyanrip = callPackage ./cyanrip { }; deemix = callPythonPackage ./deemix { }; diff --git a/flake.nix b/flake.nix index fe9f658..65c0f50 100644 --- a/flake.nix +++ b/flake.nix @@ -47,6 +47,7 @@ (flake-utils.lib.flattenTree { inherit (pkgs) VisiCut + colorchord2 cyanrip deemix fSpy