1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 libprojectm,
7 libGL,
8 libX11,
9 poco,
10 utf8proc,
11 SDL2,
12 unstableGitUpdater,
13}:
14
15stdenv.mkDerivation {
16 pname = "projectm-sdl-cpp";
17 version = "0-unstable-2025-05-20";
18
19 src = fetchFromGitHub {
20 owner = "projectM-visualizer";
21 repo = "frontend-sdl-cpp";
22 rev = "85dfdda3dcb139c7e1eb47fd5e4723114e4fb86b";
23 hash = "sha256-FHOncC6fhs1CPNMBGtA+QB+NHVn4QlF2Qn9NJb5j3p8=";
24 fetchSubmodules = true;
25 };
26
27 # Probably an artifact of the vcpkg package
28 postPatch = ''
29 substituteInPlace ImGui.cmake \
30 --replace-fail "SDL2::SDL2main" ""
31 substituteInPlace src/CMakeLists.txt \
32 --replace-fail "SDL2::SDL2main" ""
33 '';
34
35 cmakeFlags = [
36 # Doesn't seem to be present in the source tree, so the installation fails if enabled
37 (lib.cmakeBool "ENABLE_DESKTOP_ICON" false)
38 ];
39
40 nativeBuildInputs = [
41 cmake
42 ];
43
44 buildInputs = [
45 libprojectm
46 poco
47 utf8proc
48 libGL
49 libX11
50 SDL2
51 ];
52
53 # poco 1.14 requires c++17
54 NIX_CFLAGS_COMPILE = [ "-std=gnu++17" ];
55
56 strictDeps = true;
57
58 passthru.updateScript = unstableGitUpdater { };
59
60 meta = {
61 description = "Standalone application based on libprojectM and libSDL that turns your desktop audio into awesome visuals";
62 homepage = "https://github.com/projectM-visualizer/frontend-sdl-cpp";
63 license = lib.licenses.gpl3Only;
64 maintainers = with lib.maintainers; [ fgaz ];
65 mainProgram = "projectMSDL";
66 platforms = lib.platforms.all;
67 broken = stdenv.hostPlatform.isDarwin; # TODO build probably needs some fixing
68 };
69}