2017-09-10 15:23:50 +00:00
|
|
|
{ stdenv, fetchFromGitHub, glfw, pkgconfig, libXrandr, libXdamage
|
|
|
|
, libXext, libXrender, libXinerama, libXcursor, libXxf86vm, libXi
|
2018-03-23 19:03:59 +00:00
|
|
|
, libX11, libGLU, python2Packages, ensureNewerSourcesForZipFilesHook
|
|
|
|
, Cocoa
|
2017-09-10 15:23:50 +00:00
|
|
|
}:
|
2017-08-03 23:29:26 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "glslviewer-${version}";
|
2018-03-23 19:03:59 +00:00
|
|
|
version = "2018-01-31";
|
2017-08-03 23:29:26 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "patriciogonzalezvivo";
|
|
|
|
repo = "glslViewer";
|
2018-03-23 19:03:59 +00:00
|
|
|
rev = "cac40f6984dbeb638950744c9508aa88591fea6c";
|
|
|
|
sha256 = "1bykpp68hdxjlxvi1xicyb6822mz69q0adz24faaac372pls4bk0";
|
2017-08-03 23:29:26 +00:00
|
|
|
};
|
|
|
|
|
2018-03-23 19:03:59 +00: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;
|
|
|
|
pythonPath = with python2Packages; [ requests.dev ];
|
|
|
|
|
2017-08-03 23:29:26 +00:00
|
|
|
# Makefile has /usr/local/bin hard-coded for 'make install'
|
|
|
|
preConfigure = ''
|
2017-09-10 15:23:50 +00:00
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace '/usr/local' "$out" \
|
|
|
|
--replace '/usr/bin/clang++' 'clang++'
|
2018-03-23 19:03:59 +00:00
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace 'python setup.py install' "python setup.py install --prefix=$out"
|
2017-08-03 23:29:26 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
preInstall = ''
|
2018-03-23 19:03:59 +00:00
|
|
|
mkdir -p $out/bin $(toPythonPath "$out")
|
|
|
|
export PYTHONPATH=$PYTHONPATH:$(toPythonPath "$out")
|
2017-08-03 23:29:26 +00:00
|
|
|
'';
|
2017-09-10 15:23:50 +00:00
|
|
|
|
2018-03-23 19:03:59 +00:00
|
|
|
postInstall = ''
|
|
|
|
wrapPythonPrograms
|
|
|
|
'';
|
2017-09-10 15:23:50 +00:00
|
|
|
|
2017-08-03 23:29:26 +00: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 ];
|
|
|
|
};
|
|
|
|
}
|