1 | # -*- 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 |
---|
2 | # $Id$ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | PortGroup active_variants 1.1 |
---|
6 | |
---|
7 | name xcrysden |
---|
8 | version 1.5.53 |
---|
9 | categories science |
---|
10 | platforms darwin |
---|
11 | license GPL-2+ |
---|
12 | maintainers gmail.com:dstrubbe |
---|
13 | |
---|
14 | description X-windows CRYstalline Structures and DENsities |
---|
15 | |
---|
16 | long_description XCrySDen is a crystalline and molecular structure visualisation program aiming at display of \ |
---|
17 | isosurfaces and contours, which can be superimposed on crystalline structures and interactively \ |
---|
18 | rotated and manipulated. |
---|
19 | |
---|
20 | homepage http://www.xcrysden.org/ |
---|
21 | master_sites ${homepage}/download |
---|
22 | |
---|
23 | checksums rmd160 2ae5fdf510e5900e36047533e730c841cc18755f \ |
---|
24 | sha1 7bf5432412982747923f446494f5e5e7437ba645 |
---|
25 | |
---|
26 | require_active_variants tk x11 |
---|
27 | |
---|
28 | depends_lib port:fftw-3 port:mesa702 port:tcl port:tk \ |
---|
29 | port:xorg-libXmu port:xorg-libX11 port:xorg-libXext |
---|
30 | depends_run port:BWidget |
---|
31 | |
---|
32 | set prefix_share ${prefix}/share/${distname} |
---|
33 | notes "You can test this installation via the command:\ |
---|
34 | XCRYSDEN_TOPDIR=${prefix_share} XCRYSDEN_SCRATCH=/tmp ${prefix_share}/tests/run_test.sh structures" \ |
---|
35 | "Additional functionality can be enabled by installing any of these ports, detected at runtime:\ |
---|
36 | netpbm (for ppmtompeg), openbabel, whirlgif, imagemagick, mplayer (for mencoder), gifsicle." |
---|
37 | |
---|
38 | # Patched issues: |
---|
39 | # Makefile did not respect DESTDIR, or install tests |
---|
40 | # CRYSTAL tests should only be run if CRYSTAL package is available |
---|
41 | # WIEN2K conversion (str2xcr) wrote into working directory not scratch |
---|
42 | |
---|
43 | patchfiles patch-Makefile.diff \ |
---|
44 | patch-tests-crystals.tcl.diff \ |
---|
45 | patch-Tcl-wnOpen.tcl.diff |
---|
46 | |
---|
47 | configure { |
---|
48 | system -W ${worksrcpath} "echo ' |
---|
49 | CC=${configure.cc} |
---|
50 | CFLAGS=-O3 -DUSE_INTERP_RESULT |
---|
51 | FC=${configure.f90} |
---|
52 | FFLAGS=-O3 |
---|
53 | COMPILE_TCLTK=no |
---|
54 | COMPILE_MESA=no |
---|
55 | COMPILE_FFTW=no |
---|
56 | FFTW3_LIB=${prefix}/lib/libfftw3.dylib |
---|
57 | X_LIB=${prefix}/lib/libXmu.dylib ${prefix}/lib/libX11.dylib ${prefix}/lib/libXext.dylib |
---|
58 | TK_LIB=${prefix}/lib/libtk.dylib |
---|
59 | TCL_LIB=${prefix}/lib/libtcl.dylib |
---|
60 | GL_LIB=${prefix}/lib/mesa702/libGL.dylib |
---|
61 | GLU_LIB=${prefix}/lib/mesa702/libGLU.dylib |
---|
62 | FFTW3_INCDIR=-I${prefix}/include/mesa702 -I${prefix}/include' > Make.sys" |
---|
63 | } |
---|
64 | # for simplicity and to control order (mesa702 first) put it all in one variable |
---|
65 | |
---|
66 | use_parallel_build yes |
---|
67 | universal_variant no |
---|
68 | |
---|
69 | build.target xcrysden |
---|
70 | |
---|
71 | destroot.env prefix=${prefix} |
---|
72 | |
---|
73 | # replace path to where XCrySDen would install BWidget itself |
---|
74 | post-build { |
---|
75 | reinplace -W ${worksrcpath}/Tcl "s|\$system(TOPDIR)/external/lib/bwidget-\*|${prefix}/lib/BWidget|" xcInit.tcl |
---|
76 | } |
---|
77 | |
---|
78 | # Doesn't work to run test, I guess X11 display cannot be used in that. Error message: |
---|
79 | # cannot application-specific initialization failed: couldn't connect to display "/tmp/launch-TfisC0/org.macosforge.xquartz:0" |
---|
80 | # See way to run by hand in notes above. |
---|
81 | |
---|
82 | #test { |
---|
83 | # xinstall -W ${worksrcpath} C/xcrys bin/xcrys |
---|
84 | # system -W ${worksrcpath}/tests "sh run_test.sh structures" |
---|
85 | #} |
---|
86 | |
---|
87 | set gcc_versions {4.3 4.4 4.5 4.6 4.7 4.8 4.9} |
---|
88 | set default_fortran_variant +gcc48 |
---|
89 | set g95_conflicts {} |
---|
90 | |
---|
91 | foreach ver ${gcc_versions} { |
---|
92 | set ver_no_dot [join [split ${ver} "."] ""] |
---|
93 | |
---|
94 | set variant_line {variant gcc${ver_no_dot} description "build with gfortran from gcc${ver_no_dot}" conflicts g95} |
---|
95 | |
---|
96 | foreach over ${gcc_versions} { |
---|
97 | if {${ver} == ${over}} { |
---|
98 | continue |
---|
99 | } |
---|
100 | |
---|
101 | set over_no_dot [join [split ${over} "."] ""] |
---|
102 | append variant_line " conflicts gcc${over_no_dot}" |
---|
103 | } |
---|
104 | append variant_line { {}} |
---|
105 | |
---|
106 | eval $variant_line |
---|
107 | |
---|
108 | append g95_conflicts " conflicts gcc${ver_no_dot}" |
---|
109 | |
---|
110 | if {[variant_isset gcc${ver_no_dot}]} { |
---|
111 | set default_fortran_variant "" |
---|
112 | } |
---|
113 | } |
---|
114 | |
---|
115 | eval [concat {variant g95 description {build with g95}} $g95_conflicts {{}}] |
---|
116 | |
---|
117 | if {[variant_isset g95]} { |
---|
118 | set default_fortran_variant "" |
---|
119 | } |
---|
120 | |
---|
121 | if {${default_fortran_variant} != ""} { |
---|
122 | default_variants-append "${default_fortran_variant}" |
---|
123 | } |
---|
124 | |
---|
125 | foreach ver ${gcc_versions} { |
---|
126 | set ver_no_dot [join [split ${ver} "."] ""] |
---|
127 | |
---|
128 | if {[variant_isset gcc${ver_no_dot}]} { |
---|
129 | depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc |
---|
130 | depends_build-append port:gcc${ver_no_dot} |
---|
131 | |
---|
132 | configure.f90 ${prefix}/bin/gfortran-mp-${ver} |
---|
133 | } |
---|
134 | } |
---|
135 | |
---|
136 | if {[variant_isset g95]} { |
---|
137 | depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc |
---|
138 | depends_build-append port:g95 |
---|
139 | |
---|
140 | configure.f90 ${prefix}/bin/g95 |
---|
141 | } |
---|
142 | |
---|
143 | livecheck.type regex |
---|
144 | livecheck.url [lindex ${master_sites} 0] |
---|
145 | livecheck.regex xcrysden-(\[0-9.\]+)${extract.suffix} |
---|