diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2018-06-28 22:23:40 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-28 22:23:40 -0400 |
commit | ef7a63e2ef810e5248e04b75f7f8d4e7bc736398 (patch) | |
tree | 64ee06fa1a31813922e59538a5565e9571139f40 /pkgs/tools/graphics | |
parent | dc5eb16de7493371bc96b44dfadbfde96c5babcc (diff) | |
parent | ec73f89a55dec7cfd75ba51d453a2fb62712e5f7 (diff) | |
download | nixlib-ef7a63e2ef810e5248e04b75f7f8d4e7bc736398.tar nixlib-ef7a63e2ef810e5248e04b75f7f8d4e7bc736398.tar.gz nixlib-ef7a63e2ef810e5248e04b75f7f8d4e7bc736398.tar.bz2 nixlib-ef7a63e2ef810e5248e04b75f7f8d4e7bc736398.tar.lz nixlib-ef7a63e2ef810e5248e04b75f7f8d4e7bc736398.tar.xz nixlib-ef7a63e2ef810e5248e04b75f7f8d4e7bc736398.tar.zst nixlib-ef7a63e2ef810e5248e04b75f7f8d4e7bc736398.zip |
Merge pull request #42534 from Hodapp87/structuresynth
structure-synth: init at v1.5
Diffstat (limited to 'pkgs/tools/graphics')
-rw-r--r-- | pkgs/tools/graphics/structure-synth/default.nix | 47 | ||||
-rw-r--r-- | pkgs/tools/graphics/structure-synth/gcc47.patch | 50 |
2 files changed, 97 insertions, 0 deletions
diff --git a/pkgs/tools/graphics/structure-synth/default.nix b/pkgs/tools/graphics/structure-synth/default.nix new file mode 100644 index 000000000000..92a7d69aa915 --- /dev/null +++ b/pkgs/tools/graphics/structure-synth/default.nix @@ -0,0 +1,47 @@ +{ stdenv, fetchurl, qt4, qmake4Hook, unzip, mesa_glu, makeWrapper }: + +stdenv.mkDerivation rec { + + name = "structure-synth-${version}"; + version = "v1.5"; + + src = fetchurl { + url = mirror://sourceforge/structuresynth/StructureSynth-Source-v1.5.0.zip; + sha256 = "1kiammx46719az6jzrav8yrwz82nk4m72ybj0kpbnvp9wfl3swbb"; + }; + + buildInputs = [ qt4 unzip mesa_glu makeWrapper ]; + nativeBuildInputs = [ qmake4Hook ]; + + # Thanks to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=672000#15: + patches = [ ./gcc47.patch ]; + + enableParallelBuilding = true; + + preConfigure = '' + ${qt4}/bin/qmake -project -after "CONFIG+=opengl" -after "QT+=xml opengl script" -after "unix:LIBS+=-lGLU" + ''; + + installPhase = '' + mkdir -p $out/bin; + mkdir -p $out/share/Examples $out/share/Misc; + cp "Structure Synth Source Code" $out/bin/structure-synth; + cp -r Examples/* $out/share/Examples; + cp -r Misc/* $out/share/Misc; + ''; + + # Structure Synth expects to see 'Examples' and 'Misc' directory in + # either $HOME or $PWD - so help it along by moving $PWD to 'share', + # where we just copied those two directories: + preFixup = '' + wrapProgram "$out/bin/structure-synth" --run "cd $out/share" + ''; + + meta = with stdenv.lib; { + description = "Application for generating 3D structures by specifying a design grammar"; + homepage = http://structuresynth.sourceforge.net; + maintainers = with maintainers; [ hodapp ]; + license = licenses.gpl3; + platforms = platforms.linux; + }; +} diff --git a/pkgs/tools/graphics/structure-synth/gcc47.patch b/pkgs/tools/graphics/structure-synth/gcc47.patch new file mode 100644 index 000000000000..8726e89c8308 --- /dev/null +++ b/pkgs/tools/graphics/structure-synth/gcc47.patch @@ -0,0 +1,50 @@ +diff -rc "Structure Synth Source Code/SyntopiaCore/GLEngine/Raytracer/RayTracer.cpp" "Structure Synth Source Code2/SyntopiaCore/GLEngine/Raytracer/RayTracer.cpp" +*** "Structure Synth Source Code/SyntopiaCore/GLEngine/Raytracer/RayTracer.cpp" 2010-11-13 22:32:44.000000000 -0500 +--- "Structure Synth Source Code2/SyntopiaCore/GLEngine/Raytracer/RayTracer.cpp" 2018-06-24 14:23:30.794296776 -0400 +*************** +*** 1,5 **** + #include <QThread> +! + + #include "RayTracer.h" + +--- 1,5 ---- + #include <QThread> +! #include <GL/glu.h> + + #include "RayTracer.h" + +diff -rc "Structure Synth Source Code/SyntopiaCore/GLEngine/Raytracer/VoxelStepper.cpp" "Structure Synth Source Code2/SyntopiaCore/GLEngine/Raytracer/VoxelStepper.cpp" +*** "Structure Synth Source Code/SyntopiaCore/GLEngine/Raytracer/VoxelStepper.cpp" 2010-09-08 21:25:30.000000000 -0400 +--- "Structure Synth Source Code2/SyntopiaCore/GLEngine/Raytracer/VoxelStepper.cpp" 2018-06-24 14:23:12.542868194 -0400 +*************** +*** 122,128 **** + currentT = p; + + // We do not intersect grid. +! if (!found) return false; + } + + stepX = (dir.x() > 0) ? 1 : -1; +--- 122,128 ---- + currentT = p; + + // We do not intersect grid. +! if (!found) return NULL; + } + + stepX = (dir.x() > 0) ? 1 : -1; +Only in Structure Synth Source Code2/SyntopiaCore/GLEngine/Raytracer: VoxelStepper.cpp.orig +diff -rc "Structure Synth Source Code/SyntopiaCore/GLEngine/Sphere.h" "Structure Synth Source Code2/SyntopiaCore/GLEngine/Sphere.h" +*** "Structure Synth Source Code/SyntopiaCore/GLEngine/Sphere.h" 2010-08-11 15:12:22.000000000 -0400 +--- "Structure Synth Source Code2/SyntopiaCore/GLEngine/Sphere.h" 2018-06-24 14:23:30.793296807 -0400 +*************** +*** 2,7 **** +--- 2,8 ---- + + #include "SyntopiaCore/Math/Vector3.h" + #include "Object3D.h" ++ #include <GL/glu.h> + + namespace SyntopiaCore { + namespace GLEngine { |