1{
2 stdenv,
3 mkDerivation,
4 lib,
5 fetchFromGitHub,
6 autoreconfHook,
7 pkg-config,
8 SDL2,
9 qtdeclarative,
10 libpulseaudio,
11 glm,
12 which,
13}:
14
15mkDerivation rec {
16 pname = "projectm";
17 version = "3.1.12";
18
19 src = fetchFromGitHub {
20 owner = "projectM-visualizer";
21 repo = "projectM";
22 rev = "v${version}";
23 sha256 = "sha256-oEfOx93JyR94II5NkUCvMwqxuV7ktpOHZ8PNMLCiqDw=";
24 };
25
26 nativeBuildInputs = [
27 pkg-config
28 autoreconfHook
29 which
30 ];
31
32 buildInputs = [
33 SDL2
34 qtdeclarative
35 libpulseaudio
36 glm
37 ];
38
39 configureFlags = [
40 "--enable-qt"
41 "--enable-sdl"
42 ];
43
44 fixupPhase =
45 lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
46 # NOTE: 2019-10-05: Upstream inserts the src path buring build into ELF rpath, so must delete it out
47 # upstream report: https://github.com/projectM-visualizer/projectm/issues/245
48 for entry in $out/bin/* ; do
49 patchelf --set-rpath "$(patchelf --print-rpath $entry | tr ':' '\n' | grep -v 'src/libprojectM' | tr '\n' ':')" "$entry"
50 done
51 ''
52 + ''
53 wrapQtApp $out/bin/projectM-pulseaudio
54 rm $out/bin/projectM-unittest
55 '';
56
57 meta = {
58 homepage = "https://github.com/projectM-visualizer/projectm";
59 description = "Cross-platform Milkdrop-compatible music visualizer";
60 license = lib.licenses.lgpl21;
61 platforms = lib.platforms.unix;
62 maintainers = [ ];
63 longDescription = ''
64 The open-source project that reimplements the esteemed Winamp Milkdrop by Geiss in a more modern, cross-platform reusable library.
65 Read an audio input and produces mesmerizing visuals, detecting tempo, and rendering advanced equations into a limitless array of user-contributed visualizations.
66 '';
67 };
68}