# -*- 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 PortGroup active_variants 1.1 PortGroup compilers 1.0 name xcrysden version 1.5.60 revision 2 categories science platforms darwin license GPL-2+ # depends on mesa->py27-xml2->python27->openssl, but nothing from openssl is actually used in XCrySDen license_noconflict openssl maintainers dstrubbe description X-windows CRYstalline Structures and DENsities long_description XCrySDen is a crystalline and molecular structure visualisation program aiming at display of \ isosurfaces and contours, which can be superimposed on crystalline structures and interactively \ rotated and manipulated. homepage http://www.xcrysden.org/ master_sites ${homepage}/download checksums rmd160 2473752e074b2877df890b232cdc7bd02580a9e5 \ sha1 388cf837aa757e612f36a12eb7fb592c36cfd6f3 compilers.choose fc compilers.setup require_fortran # unfortunately, since the default variant for tk is +quartz, this means we cannot build binaries on the buildbots require_active_variants tk x11 depends_lib port:fftw-3 port:mesa port:libGLU port:tcl port:tk \ port:xorg-libXmu port:xorg-libX11 port:xorg-libXext depends_run port:BWidget set prefix_share ${prefix}/share/${distname} notes "You can test this installation via the command:" \ "XCRYSDEN_TOPDIR=${prefix_share} XCRYSDEN_SCRATCH=/tmp ${prefix_share}/tests/run_test.sh structures" \ "Additional functionality can be enabled by installing any of these ports, detected at runtime:" \ "netpbm (for ppmtompeg), openbabel, whirlgif, ImageMagick, MPlayer (for mencoder), gifsicle." # Package ImageMagick's convert: /opt/local/bin/convert # Package ImageMagick's import: /opt/local/bin/import # Package Gifsicle: /opt/local/bin/gifsicle # Package Whirlgif: /opt/local/bin/whirlgif # Package Mencoder: /opt/local/bin/mencoder # Package Ppmtompeg: /opt/local/bin/ppmtompeg # Package Babel: /opt/local/bin/babel # Package Xwd: /opt/X11/bin/xwd # Patched issues: # Makefile did not respect DESTDIR, or install tests, or allow use of external BWidget # CRYSTAL tests should only be run if CRYSTAL package is available # WIEN2K conversion (str2xcr) wrote into working directory not scratch # last 3 are to fix this error that would happen with Mesa versions later than 7.0.2: # X Error of failed request: BadWindow (invalid Window parameter) # Major opcode of failed request: 3 # ResourceID in failed request: 0xffffffff # Serial number of failed request: 567 # X Error of failed request: BadWindow (invalid Window parameter) # Major opcode of failed request: 3 # ResourceID in failed request: 0xffffffff # Serial number of failed request: 569 patchfiles patch-Makefile.diff \ patch-tests-crystals.tcl.diff \ patch-Tcl-wnOpen.tcl.diff \ patch-Tcl-Viewer.tcl.diff \ patch-Tcl-fs-FS_Main.tcl.diff \ patch-Tcl-fs-FS_Multi.tcl.diff configure { configure.optflags -O3 configure.cflags-append -DUSE_INTERP_RESULT if {[string match "*gcc-4.2" ${configure.compiler}]} { configure.cflags-append -DXC_HAVE_NO_GETLINE } system -W ${worksrcpath} "echo ' CC=${configure.cc} CFLAGS=${configure.cflags} FC=${configure.fc} FFLAGS=${configure.fcflags} COMPILE_TCLTK=no COMPILE_MESA=no COMPILE_FFTW=no FFTW3_LIB=${prefix}/lib/libfftw3.dylib X_LIB=${prefix}/lib/libXmu.dylib ${prefix}/lib/libX11.dylib ${prefix}/lib/libXext.dylib TK_LIB=${prefix}/lib/libtk.dylib TCL_LIB=${prefix}/lib/libtcl.dylib GL_LIB=${prefix}/lib/libGL.dylib GLU_LIB=${prefix}/lib/libGLU.dylib GL_INCDIR=-I${prefix}/include/mesa FFTW3_INCDIR=-I${prefix}/include' > Make.sys" } test { ui_error "The normal test infrastructure cannot be used because tests for this port need to use X11." ui_error "You can test this installation by hand via the command:" ui_error "XCRYSDEN_TOPDIR=${prefix_share} XCRYSDEN_SCRATCH=/tmp ${prefix_share}/tests/run_test.sh structures" return -code error "Test can only be run by hand." } use_parallel_build yes universal_variant no build.target xcrysden destroot.env prefix=${prefix} # replace path to where XCrySDen would install BWidget itself post-build { reinplace -W ${worksrcpath}/Tcl "s|\$system(TOPDIR)/external/lib/bwidget-\*|${prefix}/lib/BWidget|" xcInit.tcl } # Doesn't work to run test, I guess X11 display cannot be used in that. Error message: # cannot application-specific initialization failed: couldn't connect to display "/tmp/launch-TfisC0/org.macosforge.xquartz:0" # See way to run by hand in notes above. #test { # xinstall -W ${worksrcpath} C/xcrys bin/xcrys # system -W ${worksrcpath}/tests "sh run_test.sh structures" #} livecheck.type regex livecheck.url [lindex ${master_sites} 0] livecheck.regex xcrysden-(\[0-9.\]+)${extract.suffix}