2017-09-10 17:23:50 +02:00
|
|
|
{ stdenv, fetchFromGitHub, glfw, pkgconfig, libXrandr, libXdamage
|
|
|
|
, libXext, libXrender, libXinerama, libXcursor, libXxf86vm, libXi
|
2018-03-23 20:03:59 +01:00
|
|
|
, libX11, libGLU, python2Packages, ensureNewerSourcesForZipFilesHook
|
|
|
|
, Cocoa
|
2017-09-10 17:23:50 +02:00
|
|
|
}:
|
2017-08-04 01:29:26 +02:00
|
|
|
|
2019-08-13 23:52:01 +02:00
|
|
|
stdenv.mkDerivation {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "glslviewer";
|
2019-04-22 21:05:00 +02:00
|
|
|
version = "2019-04-22";
|
2017-08-04 01:29:26 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "patriciogonzalezvivo";
|
|
|
|
repo = "glslViewer";
|
2019-04-22 21:05:00 +02:00
|
|
|
rev = "fa3e2ed4810927d189e480b704366cca22f281f3";
|
|
|
|
sha256 = "1888jxi84f2nnc0kpzqrn2cada1z4zqyq8ss4ppb5y3wy7d87qjn";
|
2017-08-04 01:29:26 +02:00
|
|
|
};
|
|
|
|
|
2018-03-23 20:03:59 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ensureNewerSourcesForZipFilesHook ];
|
|
|
|
buildInputs = [
|
|
|
|
glfw libGLU glfw libXrandr libXdamage
|
|
|
|
libXext libXrender libXinerama libXcursor libXxf86vm
|
|
|
|
libXi libX11
|
|
|
|
] ++ (with python2Packages; [ python setuptools wrapPython ])
|
|
|
|
++ stdenv.lib.optional stdenv.isDarwin Cocoa;
|
2018-09-06 21:40:24 +02:00
|
|
|
pythonPath = with python2Packages; [ requests ];
|
2018-03-23 20:03:59 +01:00
|
|
|
|
2017-08-04 01:29:26 +02:00
|
|
|
# Makefile has /usr/local/bin hard-coded for 'make install'
|
|
|
|
preConfigure = ''
|
2017-09-10 17:23:50 +02:00
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace '/usr/local' "$out" \
|
|
|
|
--replace '/usr/bin/clang++' 'clang++'
|
2018-03-23 20:03:59 +01:00
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace 'python setup.py install' "python setup.py install --prefix=$out"
|
2017-08-04 01:29:26 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
preInstall = ''
|
2018-03-23 20:03:59 +01:00
|
|
|
mkdir -p $out/bin $(toPythonPath "$out")
|
|
|
|
export PYTHONPATH=$PYTHONPATH:$(toPythonPath "$out")
|
2017-08-04 01:29:26 +02:00
|
|
|
'';
|
2017-09-10 17:23:50 +02:00
|
|
|
|
2018-03-23 20:03:59 +01:00
|
|
|
postInstall = ''
|
|
|
|
wrapPythonPrograms
|
|
|
|
'';
|
2017-09-10 17:23:50 +02:00
|
|
|
|
2017-08-04 01:29:26 +02:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Live GLSL coding renderer";
|
|
|
|
homepage = http://patriciogonzalezvivo.com/2015/glslViewer/;
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
|
|
|
maintainers = [ maintainers.hodapp ];
|
|
|
|
};
|
|
|
|
}
|