Files
haikuports/sci-chemistry/openbabel/openbabel-3.1.1.recipe
2025-12-25 07:10:13 +01:00

147 lines
4.5 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
SUMMARY="A chemical toolbox designed to speak the many languages of chemical data"
DESCRIPTION="Open Babel is a chemical toolbox designed to speak the many languages of chemical \
data. Its an open, collaborative project allowing anyone to search, convert, analyze, or store \
data from molecular modeling, chemistry, solid-state materials, biochemistry, or related areas.
* Ready-to-use programs, and complete programmers toolkit
* Read, write and convert over 110 chemical file formats
* Filter and search molecular files using SMARTS and other methods
* Supports molecular modeling, cheminformatics, bioinformatics
* Organic chemistry, inorganic chemistry, solid-state materials, nuclear chemistry
* Downloaded over 700,000 times and used by over 40 related projects
* How to cite Open Babel: The Open Babel and Pybel papers"
HOMEPAGE="http://openbabel.org/"
COPYRIGHT="2023 The Open Babel Team"
LICENSE="GNU GPL v2"
REVISION="1"
openbabelVersion=`echo $portVersion | sed 's/\./-/g'`
SOURCE_URI="https://github.com/openbabel/openbabel/archive/refs/tags/openbabel-$openbabelVersion.tar.gz"
CHECKSUM_SHA256="c97023ac6300d26176c97d4ef39957f06e68848d64f1a04b0b284ccff2744f02"
SOURCE_DIR="openbabel-openbabel-$openbabelVersion"
PATCHES="openbabel-$portVersion.patchset
2297.patch"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
# On x86_gcc2 we don't want to install the commands in bin/<arch>/, but in bin/.
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
openbabelLibVersion="7.0.0"
openbabelLibVersionCompat="$openbabelLibVersion compat >= ${openbabelLibVersion%%.*}"
inchiLibVersion="0.4.1"
inchiLibVersionCompat="$inchiLibVersion compat >= ${inchiLibVersion%%.*}"
PROVIDES="
openbabel$secondaryArchSuffix = $portVersion
lib:libinchi$secondaryArchSuffix = $inchiLibVersionCompat
lib:libopenbabel$secondaryArchSuffix = $openbabelLibVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libcairo$secondaryArchSuffix
lib:libcoordgen$secondaryArchSuffix
lib:libmaeparser$secondaryArchSuffix
lib:libxml2$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
PROVIDES_devel="
openbabel${secondaryArchSuffix}_devel = $portVersion
devel:libinchi$secondaryArchSuffix = $inchiLibVersionCompat
devel:libopenbabel$secondaryArchSuffix = $openbabelLibVersionCompat
"
REQUIRES_devel="
openbabel$secondaryArchSuffix == $portVersion base
"
PROVIDES_tools="
openbabel${secondaryArchSuffix}_tools = $portVersion
cmd:obabel$commandSuffix = $portVersion
cmd:obconformer$commandSuffix = $portVersion
cmd:obdistgen$commandSuffix = $portVersion
cmd:obenergy$commandSuffix = $portVersion
cmd:obfit$commandSuffix = $portVersion
cmd:obfitall$commandSuffix = $portVersion
cmd:obgen$commandSuffix = $portVersion
cmd:obgrep$commandSuffix = $portVersion
cmd:obminimize$commandSuffix = $portVersion
cmd:obmm$commandSuffix = $portVersion
cmd:obprobe$commandSuffix = $portVersion
cmd:obprop$commandSuffix = $portVersion
cmd:obrms$commandSuffix = $portVersion
cmd:obrotamer$commandSuffix = $portVersion
cmd:obrotate$commandSuffix = $portVersion
cmd:obspectrophore$commandSuffix = $portVersion
cmd:obsym$commandSuffix = $portVersion
cmd:obtautomer$commandSuffix = $portVersion
cmd:obthermo$commandSuffix = $portVersion
cmd:roundtrip$commandSuffix = $portVersion
"
REQUIRES_tools="
openbabel$secondaryArchSuffix == $portVersion base
$REQUIRES
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
eigen3$secondaryArchSuffix
devel:libboost_iostreams$secondaryArchSuffix >= 1.88.0
devel:libboost_program_options$secondaryArchSuffix >= 1.88.0
devel:libcairo$secondaryArchSuffix
devel:libcoordgen$secondaryArchSuffix
devel:libmaeparser$secondaryArchSuffix
devel:librapidjson$secondaryArchSuffix
devel:libxml2$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release \
$cmakeDirArgs \
-DCMAKE_INSTALL_BINDIR=$commandBinDir \
-DLIB_SUFFIX="$secondaryArchSubDir" \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_SKIP_RPATH=YES \
-DBUILD_TESTING=OFF \
-Wno-dev
make -C build $jobArgs
}
INSTALL()
{
make -C build install
prepareInstalledDevelLibs \
libinchi \
libopenbabel
fixPkgconfig
packageEntries devel \
$developDir \
$libDir/cmake
packageEntries tools \
$commandBinDir \
$manDir
}
TEST()
{
export LIBRARY_PATH="$sourceDir/build/lib${LIBRARY_PATH:+:$LIBRARY_PATH}"
ctest --test-dir build --output-on-failure
}