2017-08-28 12:51:37 +02:00
|
|
|
{ stdenv, fetchurl, fetchpatch, pkgconfig, cmake
|
2014-01-11 08:24:54 +01:00
|
|
|
, glew, ftgl, ttf_bitstream_vera
|
|
|
|
, withQt ? true, qt4
|
|
|
|
, withLibvisual ? false, libvisual, SDL
|
2015-06-27 09:17:52 +02:00
|
|
|
, withJack ? false, libjack2
|
2015-05-27 21:42:15 +02:00
|
|
|
, withPulseAudio ? true, libpulseaudio
|
2014-01-11 08:24:54 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert withJack -> withQt;
|
|
|
|
assert withPulseAudio -> withQt;
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "projectm-2.1.0";
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Music Visualizer";
|
2017-08-01 22:03:30 +02:00
|
|
|
homepage = http://projectm.sourceforge.net/;
|
2014-01-11 08:24:54 +01:00
|
|
|
license = stdenv.lib.licenses.lgpl21Plus;
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/projectm/2.1.0/projectM-complete-2.1.0-Source.tar.gz";
|
|
|
|
sha256 = "1vh6jk68a0jdb6qwppb6f8cbgmhnv2ba3bcavzfd6sq06gq08cji";
|
|
|
|
};
|
|
|
|
|
2017-08-28 12:51:37 +02:00
|
|
|
patch_gcc6 = fetchpatch {
|
|
|
|
url = https://raw.githubusercontent.com/gentoo/gentoo/45abd63abc6644b6e177c057b5b42d894dbf8e29/media-libs/libprojectm/files/libprojectm-2.1.0-fix-c++14.patch;
|
|
|
|
sha256 = "1i50scxv1jlqvb3jm3sql89a7wqckxhlpvnhz20vvmm1kii6lrsn";
|
|
|
|
};
|
|
|
|
|
2014-01-11 08:24:54 +01:00
|
|
|
patchPhase = ''
|
2017-08-28 12:51:37 +02:00
|
|
|
patch -d src/libprojectM -p1 -i "$patch_gcc6"
|
2014-01-11 08:24:54 +01:00
|
|
|
sed -i 's:''${LIBVISUAL_PLUGINSDIR}:''${CMAKE_INSTALL_PREFIX}/lib/libvisual-0.4:' \
|
|
|
|
src/projectM-libvisual/CMakeLists.txt
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkgconfig cmake ];
|
|
|
|
|
|
|
|
cmakeFlags = ''
|
|
|
|
-DprojectM_FONT_MENU=${ttf_bitstream_vera}/share/fonts/truetype/VeraMono.ttf
|
|
|
|
-DprojectM_FONT_TITLE=${ttf_bitstream_vera}/share/fonts/truetype/Vera.ttf
|
|
|
|
-DINCLUDE-PROJECTM-TEST=OFF
|
|
|
|
-DINCLUDE-PROJECTM-QT=${if withQt then "ON" else "OFF"}
|
|
|
|
-DINCLUDE-PROJECTM-LIBVISUAL=${if withLibvisual then "ON" else "OFF"}
|
|
|
|
-DINCLUDE-PROJECTM-JACK=${if withJack then "ON" else "OFF"}
|
|
|
|
-DINCLUDE-PROJECTM-PULSEAUDIO=${if withPulseAudio then "ON" else "OFF"}
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = with stdenv.lib;
|
|
|
|
[ glew ftgl ]
|
|
|
|
++ optional withQt qt4
|
|
|
|
++ optionals withLibvisual [ libvisual SDL ]
|
2015-06-27 09:17:52 +02:00
|
|
|
++ optional withJack libjack2
|
2015-05-27 21:42:15 +02:00
|
|
|
++ optional withPulseAudio libpulseaudio
|
2014-01-11 08:24:54 +01:00
|
|
|
;
|
|
|
|
}
|