# -*- 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 PortSystem 1.0 PortGroup active_variants 1.1 PortGroup compilers 1.0 name imager version 202412 set source_version 4.4-01 set my_version [string tolower [clock format [clock scan 2000-[string range ${version} 4 5]-10] -format %b]][string range ${version} 2 3][string range ${version} 6 end] supported_archs arm64 x86_64 set my_machine [if {[string match *arm* ${os.arch}]} {list arm64} {list x86_64}] categories science maintainers {u-bordeaux.fr:julien.penguen @PenguenJulien} license permissive description Radio-interferometry data analysis software long_description IMAGER (and its associated visualization tool VIEWER) is a state-of-the-art \ software oriented toward (sub-)millimeter radioastronomical interferometry. \ It is used to reduce data acquired with the IRAM NOEMA interferometer \ and the ALMA or JVLA arrays, with a simple, convenient user interface. homepage https://imager.oasu.u-bordeaux.fr set site_base https://dave.oasu.u-bordeaux.fr:5000/5964614a-44f2-47fd-ba18-5f155543044e master_sites ${site_base}/ distname patched-macport-${name}-${my_version} checksums rmd160 3da16815b5082ec070aa9f001b6cf6f4fa899d11 \ sha256 0264b12a408ec409b73380028e6adb20f16a73045f01b002aefa4d72c5a54742 \ size 32706448 set py_ver 3.12 set py_ver_nodot [string map {. {}} ${py_ver}] # coreutils needed to use GNU gsort instead of native BSD sort as older version # of sort do not support sort -V: depends_build-append \ port:cfitsio \ path:libexec/coreutils/libstdbuf.so:coreutils \ port:groff \ port:pkgconfig depends_lib-append \ port:fftw-3-single \ path:lib/pkgconfig/gdk-pixbuf-2.0.pc:gdk-pixbuf2 \ path:lib/pkgconfig/gtk+-2.0.pc:gtk2 \ path:lib/pkgconfig/harfbuzz.pc:harfbuzz \ port:libpng \ port:python${py_ver_nodot} \ port:py${py_ver_nodot}-numpy set my_build_opts "-o openmp" #variant openmp description {Add OpenMP support} {set my_build_opts "-o openmp"} # need x11 and cannot be used with quartz; see ticket #42886 require_active_variants gtk2 x11 quartz # need the fortran interface; see ticket #50543 compilers.enforce_some_fortran cfitsio # correction bug duplicate LC_RPATH compilers.add_gcc_rpath_support no compilers.choose fc compilers.setup -gcc46 require_fortran configure.python ${prefix}/bin/python${py_ver} configure { reinplace -W ${worksrcpath}/admin "s|@PREFIX@|${prefix}|g" define-system.sh imager-env.sh reinplace -W ${worksrcpath}/admin "s|@CC@|${configure.cc}|g" define-system.sh reinplace -W ${worksrcpath}/admin "s|@CCFLAGS@|${configure.cflags}|g" Makefile.def reinplace -W ${worksrcpath}/admin "s|@FC@|${configure.fc}|g" define-system.sh reinplace -W ${worksrcpath}/admin "s|@FCFLAGS@|${configure.fcflags}|g" Makefile.def reinplace -W ${worksrcpath}/admin "s|@CXX@|${configure.cxx}|g" define-system.sh reinplace -W ${worksrcpath}/admin "s|@CPP@|${configure.cpp}|g" Makefile.def define-system.sh reinplace -W ${worksrcpath}/admin "s|@CPPFLAGS@|${configure.cppflags}|g" Makefile.def reinplace -W ${worksrcpath}/admin "s|@LDFLAGS@|${configure.ldflags}|g" Makefile.def reinplace -W ${worksrcpath}/admin "s|@PYTHON@|${configure.python}|g" Makefile.build Makefile.def Makefile.python imager-env.sh } build { system -W ${worksrcpath} "source admin/imager-env.sh -c ${configure.fc} ${my_build_opts} -s ${prefix}/include:${prefix}/lib:/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Versions/Current/ && export GAG_SLDFLAGS='-shared -o ${prefix}/lib/imager/${my_machine}-darwin-gfortran/lib/\$(notdir \$@) -install_name ${prefix}/lib/imager/${my_machine}-darwin-gfortran/lib/\$(notdir \$@)' && export DYLD_LIBRARY_PATH=${worksrcpath}/integ/${my_machine}-darwin-gfortran/lib && export GAG_ADDONS=yes && make --jobs=${build.jobs} -w install" } destroot { copy ${workpath}/imager-exe ${destroot}${prefix}/lib/imager xinstall ${filespath}/imager.in ${destroot}${prefix}/bin/imager xinstall ${filespath}/viewer.in ${destroot}${prefix}/bin/viewer reinplace -W ${destroot}${prefix}/bin s|@PREFIX@|${prefix}|g imager viewer reinplace -W ${destroot}${prefix}/bin s|@ARCH@|${my_machine}|g imager viewer } livecheck.url ${site_base}