[125665] trunk/dports/graphics
mf2k at macports.org
mf2k at macports.org
Tue Sep 23 14:42:10 PDT 2014
Revision: 125665
https://trac.macports.org/changeset/125665
Author: mf2k at macports.org
Date: 2014-09-23 14:42:10 -0700 (Tue, 23 Sep 2014)
Log Message:
-----------
mandelbrot-set-viewer: New port.
Added Paths:
-----------
trunk/dports/graphics/mandelbrot-set-viewer/
trunk/dports/graphics/mandelbrot-set-viewer/Portfile
trunk/dports/graphics/mandelbrot-set-viewer/files/
trunk/dports/graphics/mandelbrot-set-viewer/files/patch-main.py.diff
Added: trunk/dports/graphics/mandelbrot-set-viewer/Portfile
===================================================================
--- trunk/dports/graphics/mandelbrot-set-viewer/Portfile (rev 0)
+++ trunk/dports/graphics/mandelbrot-set-viewer/Portfile 2014-09-23 21:42:10 UTC (rev 125665)
@@ -0,0 +1,56 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id$
+
+PortSystem 1.0
+
+name mandelbrot-set-viewer
+version 5.01
+set python_version 27
+categories graphics
+platforms darwin
+maintainers nomaintainer
+license unknown
+
+description Python Mandelbrot Set Viewer
+long_description ${description}
+
+homepage http://pygame.org/project-Mandelbrot+Set+Viewer-698-4788.html
+
+master_sites http://www.geometrian.com/data/programming/projects/Mandelbrot%20Set/Viewer%20${version}/
+
+distname Mandelbrot Set Viewer ${version}
+worksrcdir ${version}
+use_zip yes
+supported_archs noarch
+
+checksums rmd160 2324558ff47c91453650156c9137dffe87bcfbf4 \
+ sha256 1cf037a2b0b759e5702e2cc06261d110179fe5a8e6deaa4fc8bc069780e17a93
+
+patchfiles patch-main.py.diff
+
+depends_run port:py${python_version}-game \
+ port:py${python_version}-opengl \
+ port:python${python_version}
+
+use_configure no
+build {}
+
+destroot {
+ file mkdir ${destroot}${prefix}/share/${name}
+ xinstall -m 644 -W ${worksrcpath} README.txt config.py ${destroot}${prefix}/share/${name}
+ xinstall -m 755 -W ${worksrcpath} gl_shader.py main.py ${destroot}${prefix}/share/${name}
+ file rename ${destroot}${prefix}/share/${name}/config.py ${destroot}${prefix}/share/${name}/config.py.dist
+ ln -s ${destroot}${prefix}/share/${name}/main.py ${destroot}${prefix}/bin/${name}
+}
+
+post-activate {
+ if {![file exists ${prefix}/share/${name}/config.py]} {
+ file copy ${prefix}/share/${name}/config.py.dist ${prefix}/share/${name}/config.py
+ }
+}
+
+notes "To run this program, type 'python2.7 ${prefix}/share/${name}/main.py'.
+You can modify the output by changing ${prefix}/share/${name}/config.py"
+
+livecheck.url ${homepage}
+livecheck.regex Mandelbrot Set Viewer - (\\d+(\\.\\d+)+)
Property changes on: trunk/dports/graphics/mandelbrot-set-viewer/Portfile
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Added: trunk/dports/graphics/mandelbrot-set-viewer/files/patch-main.py.diff
===================================================================
--- trunk/dports/graphics/mandelbrot-set-viewer/files/patch-main.py.diff (rev 0)
+++ trunk/dports/graphics/mandelbrot-set-viewer/files/patch-main.py.diff 2014-09-23 21:42:10 UTC (rev 125665)
@@ -0,0 +1,98 @@
+--- main.py.orig 2014-09-23 13:57:41.000000000 -0600
++++ main.py 2014-09-23 14:16:46.000000000 -0600
+@@ -20,7 +20,7 @@
+ font = pygame.font.SysFont("Times New Roman.ttf",12)
+
+ icon = pygame.Surface((1,1)); icon.set_alpha(0); pygame.display.set_icon(icon)
+-pygame.display.set_caption("MandebrotGLSL - Ian Mallett - v.5.01 - 2014")
++pygame.display.set_caption("MandebrotGLSL - Ian Mallett - v.5.02 - 2014")
+ pygame.display.set_mode(screen_size,RESIZABLE|OPENGL|DOUBLEBUF)
+
+ glEnable(GL_BLEND)
+@@ -28,8 +28,9 @@
+
+ mandelbrot_shader = shader_module.Program([
+ shader_module.ShaderFragment("""
+-//#define SIMPLE
+-#ifndef SIMPLE
++//#define BLACK_AND_WHITE
++#ifndef BLACK_AND_WHITE
++// #define HAS_SWITCH
+ #define HAS_MOD
+ #ifdef HAS_MOD
+ #extension GL_EXT_gpu_shader4 : enable /*for "%"*/
+@@ -52,32 +53,51 @@
+ uniform FVEC2 bounds_y;
+ uniform FVEC2 screen_size;
+ vec3 get_color(int iter) {
+- #ifndef SIMPLE
++ #ifdef BLACK_AND_WHITE
++ return vec3(255.0);
++ #else
+ #ifdef HAS_MOD
+- switch (iter%16) {
++ iter %= 16;
+ #else
+- iter -= (iter/16)*16;
+- switch (iter) {
++ iter -= (iter/16)*16;
++ #endif
++ #ifdef HAS_SWITCH
++ switch (iter) {
++ case 0: return vec3(241,233,191);
++ case 1: return vec3(248,201, 95);
++ case 2: return vec3(255,170, 0);
++ case 3: return vec3(204,108, 0);
++ case 4: return vec3(153, 87, 0);
++ case 5: return vec3(106, 52, 3);
++ case 6: return vec3( 66, 30, 15);
++ case 7: return vec3( 25, 7, 26);
++ case 8: return vec3( 9, 1, 47);
++ case 9: return vec3( 4, 4, 73);
++ case 10: return vec3( 0, 7,100);
++ case 11: return vec3( 12, 44,138);
++ case 12: return vec3( 24, 82,177);
++ case 13: return vec3( 57,125,209);
++ case 14: return vec3(134,181,229);
++ case 15: return vec3(211,236,248);
++ }
++ #else
++ if (iter== 0) return vec3(241,233,191);
++ else if (iter== 1) return vec3(248,201, 95);
++ else if (iter== 2) return vec3(255,170, 0);
++ else if (iter== 3) return vec3(204,108, 0);
++ else if (iter== 4) return vec3(153, 87, 0);
++ else if (iter== 5) return vec3(106, 52, 3);
++ else if (iter== 6) return vec3( 66, 30, 15);
++ else if (iter== 7) return vec3( 25, 7, 26);
++ else if (iter== 8) return vec3( 9, 1, 47);
++ else if (iter== 9) return vec3( 4, 4, 73);
++ else if (iter==10) return vec3( 0, 7,100);
++ else if (iter==11) return vec3( 12, 44,138);
++ else if (iter==12) return vec3( 24, 82,177);
++ else if (iter==13) return vec3( 57,125,209);
++ else if (iter==14) return vec3(134,181,229);
++ else /*if (iter==15)*/ return vec3(211,236,248);
+ #endif
+- case 0: return vec3(241,233,191);
+- case 1: return vec3(248,201, 95);
+- case 2: return vec3(255,170, 0);
+- case 3: return vec3(204,108, 0);
+- case 4: return vec3(153, 87, 0);
+- case 5: return vec3(106, 52, 3);
+- case 6: return vec3( 66, 30, 15);
+- case 7: return vec3( 25, 7, 26);
+- case 8: return vec3( 9, 1, 47);
+- case 9: return vec3( 4, 4, 73);
+- case 10: return vec3( 0, 7,100);
+- case 11: return vec3( 12, 44,138);
+- case 12: return vec3( 24, 82,177);
+- case 13: return vec3( 57,125,209);
+- case 14: return vec3(134,181,229);
+- case 15: return vec3(211,236,248);
+- }
+- #else
+- return vec3(255.0);
+ #endif
+ }
+ int shade_index(int iter) {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140923/f993dbd6/attachment.html>
More information about the macports-changes
mailing list