# -*- 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
PortGroup active_variants 1.1
name gnome-chemistry-utils
set major [join [lrange [split ${version} .] 0 1] .]
categories gnome science chemistry
platforms darwin linux freebsd
description This package provides a set of Gtk3-based applications for drawing \
and viewing molecules, crystals and spectra.
long_description This package provides the following programs: \
\n- GChem3D displays molecule structures in 3D \
\n- GChemCalc provides calculations for chemistry \
\n- GChemPaint draws 2D chemical structures and reactions \
\n- GChemTable provides the periodic table of the elements \
\n- GCrystal displays and edits 3D crystal structures \
\n- GSpectrum displays spectra files (NMR, IR, etc) \
\n- Includes plugins for Gnumeric spreadsheet
homepage http://gchemutils.nongnu.org/index.html
master_sites https://download.savannah.gnu.org/releases/gchemutils/${major}/
checksums sha256 add1433fcaa9861b59426d8db236e51047752b47fd788575ee0fe2dc3af3926e \
rmd160 096bf5606326ee894885a81a0160b9600a1f4477
depends_build port:pkgconfig \
depends_lib port:desktop-file-utils \
port:chemical-mime-data \
depends_run port:adwaita-icon-theme \
patchfiles patch-libs-gcr-document.cc.diff \
patch-plugins-loaders.diff
# reconfigure using upstream autogen.sh for intltool 0.51 compatibility
xinstall -m 755 ${filespath}/autogen.sh ${worksrcpath}
reinplace "s|/usr|${prefix}|" ${worksrcpath}/autogen.sh
configure.cmd ./autogen.sh
configure.args --disable-mozilla-plugin \
--disable-schemas-compile \
--disable-update-databases \
# TODO: work with the upstream devs to make a +quartz variant…
# currently it fails to build in a +quartz environment
# due to <gdk/gdkx.h> and OpenGL dependencies in the code.
require_active_variants gtk3 x11
system "${prefix}/bin/update-mime-database ${prefix}/share/mime"
system "${prefix}/bin/update-desktop-database ${prefix}/share/applications"
system "${prefix}/bin/scrollkeeper-update"
system "${prefix}/bin/gtk-update-icon-cache-3.0 -f -t ${prefix}/share/icons/hicolor"
system "${prefix}/bin/glib-compile-schemas ${prefix}/share/glib-2.0/schemas"
system "${prefix}/bin/update-mime-database ${prefix}/share/mime"
system "${prefix}/bin/update-desktop-database ${prefix}/share/applications"