nixpkgs/pkgs/development/tools/glslviewer/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

61 lines
1.9 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, glfw, pkg-config, libXrandr, libXdamage
2017-09-10 17:23:50 +02:00
, libXext, libXrender, libXinerama, libXcursor, libXxf86vm, libXi
, libX11, libGLU, python3Packages, ensureNewerSourcesForZipFilesHook
, Cocoa
2017-09-10 17:23:50 +02:00
}:
2017-08-04 01:29:26 +02:00
stdenv.mkDerivation rec {
pname = "glslviewer";
version = "1.6.8";
2017-08-04 01:29:26 +02:00
src = fetchFromGitHub {
owner = "patriciogonzalezvivo";
repo = "glslViewer";
rev = version;
sha256 = "0v7x93b61ama0gmzlx1zc56jgi7bvzsfvbkfl82xzwf2h5g1zni7";
2017-08-04 01:29:26 +02:00
};
postPatch = ''
sed '1i#include <cstring>' -i src/tools/text.cpp # gcc12
2024-01-28 17:30:22 +01:00
sed '8i#include <cstdint>' -i src/io/fs.cpp # gcc13
'';
nativeBuildInputs = [ pkg-config ensureNewerSourcesForZipFilesHook python3Packages.six ];
buildInputs = [
glfw libGLU glfw libXrandr libXdamage
libXext libXrender libXinerama libXcursor libXxf86vm
libXi libX11
] ++ (with python3Packages; [ python setuptools wrapPython ])
++ lib.optional stdenv.isDarwin Cocoa;
pythonPath = with python3Packages; [ pyyaml requests ];
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++'
substituteInPlace Makefile \
--replace 'python setup.py install' "python setup.py install --prefix=$out"
2to3 -w bin/*
2017-08-04 01:29:26 +02:00
'';
preInstall = ''
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
postInstall = ''
wrapPythonPrograms
'';
2017-09-10 17:23:50 +02:00
meta = with lib; {
2017-08-04 01:29:26 +02:00
description = "Live GLSL coding renderer";
homepage = "https://patriciogonzalezvivo.com/2015/glslViewer/";
2017-08-04 01:29:26 +02:00
license = licenses.bsd3;
platforms = platforms.linux ++ platforms.darwin;
maintainers = [ maintainers.hodapp ];
# never built on aarch64-darwin since first introduction in nixpkgs
broken = stdenv.isDarwin && stdenv.isAarch64;
2017-08-04 01:29:26 +02:00
};
}