2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, glfw, pkg-config, libXrandr, libXdamage
|
2020-04-24 23:36:52 +00:00
|
|
|
, libXext, libXrender, libXinerama, libXcursor, libXxf86vm, libXi
|
2020-11-03 02:18:15 +00:00
|
|
|
, libX11, libGLU, python3Packages, ensureNewerSourcesForZipFilesHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, Cocoa
|
|
|
|
}:
|
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "glslviewer";
|
2020-11-03 02:18:15 +00:00
|
|
|
version = "1.6.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "patriciogonzalezvivo";
|
|
|
|
repo = "glslViewer";
|
2020-11-03 02:18:15 +00:00
|
|
|
rev = version;
|
|
|
|
sha256 = "0v7x93b61ama0gmzlx1zc56jgi7bvzsfvbkfl82xzwf2h5g1zni7";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ensureNewerSourcesForZipFilesHook python3Packages.six ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
|
|
|
glfw libGLU glfw libXrandr libXdamage
|
|
|
|
libXext libXrender libXinerama libXcursor libXxf86vm
|
|
|
|
libXi libX11
|
2020-11-03 02:18:15 +00:00
|
|
|
] ++ (with python3Packages; [ python setuptools wrapPython ])
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optional stdenv.isDarwin Cocoa;
|
2020-11-03 02:18:15 +00:00
|
|
|
pythonPath = with python3Packages; [ pyyaml requests ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Makefile has /usr/local/bin hard-coded for 'make install'
|
|
|
|
preConfigure = ''
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace '/usr/local' "$out" \
|
|
|
|
--replace '/usr/bin/clang++' 'clang++'
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace 'python setup.py install' "python setup.py install --prefix=$out"
|
2020-11-03 02:18:15 +00:00
|
|
|
2to3 -w bin/*
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -p $out/bin $(toPythonPath "$out")
|
|
|
|
export PYTHONPATH=$PYTHONPATH:$(toPythonPath "$out")
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapPythonPrograms
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Live GLSL coding renderer";
|
|
|
|
homepage = "http://patriciogonzalezvivo.com/2015/glslViewer/";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
|
|
|
maintainers = [ maintainers.hodapp ];
|
2022-12-17 10:02:37 +00:00
|
|
|
# never built on aarch64-darwin since first introduction in nixpkgs
|
|
|
|
broken = stdenv.isDarwin && stdenv.isAarch64;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|