aboutsummaryrefslogtreecommitdiff
path: root/academic
diff options
context:
space:
mode:
Diffstat (limited to 'academic')
-rw-r--r--academic/avogadrolibs/README28
-rw-r--r--academic/avogadrolibs/avogadrolibs.SlackBuild142
-rw-r--r--academic/avogadrolibs/avogadrolibs.info16
-rw-r--r--academic/avogadrolibs/fix_cmake-find-package.diff42
-rw-r--r--academic/avogadrolibs/slack-desc19
5 files changed, 247 insertions, 0 deletions
diff --git a/academic/avogadrolibs/README b/academic/avogadrolibs/README
new file mode 100644
index 000000000000..4877412d767d
--- /dev/null
+++ b/academic/avogadrolibs/README
@@ -0,0 +1,28 @@
+Avogadro Libraries is a subproject of Avogadro 2 as implementation of
+Avogadro 1.x mantained by OpenChemistry. It provides 3D rendering,
+visualization, analysis and data processing useful in computational
+chemistry, molecular modeling, bioinformatics, materials science, and
+related areas.
+Avogadro Libraries is a dependency required by the graphic interface
+user Avogadro Application (avogadroapp).
+
+This slackbuild requires as needed some dependencies (autodetected)
+that improve Avogadro Libraries. You can enable or disable them by
+passing variables to the script
+(e.g. VAR=yes|no ./avogadrolibs.SlackBuild):
+
+LIBMSYM=yes|no (default: yes, libmsym required)
+SPGLIB=yes|no (default: yes, spglib required)
+MMTF=yes|no (default: yes, mmtf-cpp required)
+HDF5=yes|no (default: no, hdf5 required)
+
+The extension Avogadro Generators (disabled by default) installs
+Python input generators that can be run by the Avogadro 2 application
+(avogadroapp) to generate input for various codes (Dalton, Q-Chem,
+Orca, NWChem, ecc.): these scripts will be installed in a location
+where the Avogadro 2 application can find them if the Plugin
+Downloader is executed from the graphic interface user.
+To enable the extension the dependency pybind11 is required and you
+have to pass the variable PYTHON=yes to the slackbuild script:
+
+PYTHON=yes ./avogadrolibs.SlackBuild
diff --git a/academic/avogadrolibs/avogadrolibs.SlackBuild b/academic/avogadrolibs/avogadrolibs.SlackBuild
new file mode 100644
index 000000000000..fc45449bcad9
--- /dev/null
+++ b/academic/avogadrolibs/avogadrolibs.SlackBuild
@@ -0,0 +1,142 @@
+#!/bin/bash
+
+# Slackware build script for avogadrolibs
+
+# Copyright 2020-2022 Giancarlo Dessì, Cagliari, IT
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PRGNAM=avogadrolibs
+VERSION=${VERSION:-1.95.1}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
+MVERSION=${MVERSION:-1.0.0}
+CVERSION=${CVERSION:-1.0.1}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
+#These are features which are disabled by default
+USEHDF5="" ; [ "${HDF5:-no}" = "yes" ] && USEHDF5="-DUSE_HDF5=ON"
+USEPYTHON="" ; [ "${PYTHON:-no}" = "yes" ] && USEPYTHON="-DUSE_PYTHON=ON"
+
+#These are features which are enabled by default
+USELIBMSYM="" ; [ "${LIBMSYM:-yes}" = "no" ] && USELIBMSYM="-DUSE_LIBMSYM=OFF"
+USESPGLIB="-DSPGLIB_INCLUDE_DIR=/usr/include/spglib" ; [ "${SPGLIB:-yes}" = "no" ] && \
+ USESPGLIB="-DUSE_SPGLIB=OFF"
+USEMMTF="" ; [ "${MMTF:-yes}" = "no" ] && USEMMTF="-DUSE_MMTF=OFF"
+
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION molecules crystals avogadrogenerators
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+# Following archives must be unpacked in /tmp since the build process
+# searches them as parallel directories and tries to connect to github
+# if not found
+tar xvf $CWD/molecules-$MVERSION.tar.gz
+tar xvf $CWD/crystals-$CVERSION.tar.gz
+mv molecules-$MVERSION molecules
+mv crystals-$CVERSION crystals
+if [ "${PYTHON}" = "yes" ]; then
+ tar xvf $CWD/avogadrogenerators.tar.gz
+fi
+
+# Now we can change directory to $PRGNAM-$VERSION
+cd $PRGNAM-$VERSION
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+# fix issues that generate cmake warnings
+patch -p1 < $CWD/fix_cmake-find-package.diff
+
+mkdir -p build
+cd build
+ cmake \
+ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_POLICY_DEFAULT_CMP0072=NEW \
+ -DENABLE_TESTING=OFF \
+ -DENABLE_TRANSLATIONS=ON \
+ $USEHDF5 \
+ $USEPYTHON \
+ $USELIBMSYM \
+ $USESPGLIB \
+ $USEMMTF \
+ ..
+ make
+ make install DESTDIR=$PKG
+cd ..
+
+rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
+
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a *.md LICENSE $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+# Remove doc files installed by make install in /usr/share/doc/AvogadroLibs that are redundant
+rm -rf $PKG/usr/share/doc
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/academic/avogadrolibs/avogadrolibs.info b/academic/avogadrolibs/avogadrolibs.info
new file mode 100644
index 000000000000..98b38a281f49
--- /dev/null
+++ b/academic/avogadrolibs/avogadrolibs.info
@@ -0,0 +1,16 @@
+PRGNAM="avogadrolibs"
+VERSION="1.95.1"
+HOMEPAGE="https://github.com/OpenChemistry/avogadrolibs"
+DOWNLOAD="https://github.com/OpenChemistry/avogadrolibs/archive/1.95.1/avogadrolibs-1.95.1.tar.gz \
+ https://github.com/OpenChemistry/molecules/archive/1.0.0/molecules-1.0.0.tar.gz \
+ https://github.com/OpenChemistry/crystals/archive/1.0.1/crystals-1.0.1.tar.gz \
+ https://github.com/giandex/misc/raw/main/avogadrogenerators.tar.gz"
+MD5SUM="8e86fd39799bcc614f8982b3408f30b5 \
+ bad118f80a942fe0f082b2a9075ae3b9 \
+ b05b526928b89fd27a5784b24c419613 \
+ 4d8fe7ddb99069d777bead7d261abac9"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES="molequeue mmtf-cpp libmsym spglib"
+MAINTAINER="Giancarlo Dessì"
+EMAIL="slack@giand.it"
diff --git a/academic/avogadrolibs/fix_cmake-find-package.diff b/academic/avogadrolibs/fix_cmake-find-package.diff
new file mode 100644
index 000000000000..542919c2cc9b
--- /dev/null
+++ b/academic/avogadrolibs/fix_cmake-find-package.diff
@@ -0,0 +1,42 @@
+--- avogadrolibs-1.95.1/cmake/FindSpglib.cmake 2022-17-04 15:40:00.000000000 +0200
++++ avogadrolibs-1.95.1-fixed/cmake/FindSpglib.cmake 2022-17-04 15:40:01.000000000 +0200
+@@ -12,7 +12,7 @@
+ set(SPGLIB_INCLUDE_DIRS "${SPGLIB_INCLUDE_DIR}")
+
+ include(FindPackageHandleStandardArgs)
+-find_package_handle_standard_args(SPGLIB DEFAULT_MSG SPGLIB_INCLUDE_DIR
++find_package_handle_standard_args(Spglib DEFAULT_MSG SPGLIB_INCLUDE_DIR
+ SPGLIB_LIBRARY)
+
+ mark_as_advanced(SPGLIB_INCLUDE_DIR SPGLIB_LIBRARY)
+--- avogadrolibs-1.95.1/cmake/FindLibArchive.cmake 2022-17-04 15:50:00.000000000 +0200
++++ avogadrolibs-1.95.1-fixed/cmake/FindLibArchive.cmake 2022-17-04 15:50:01.000000000 +0200
+@@ -14,7 +14,7 @@
+ set(LIBARCHIVE_LIBRARIES "${LIBARCHIVE_LIBRARY}")
+
+ include(FindPackageHandleStandardArgs)
+-find_package_handle_standard_args(LIBARCHIVE DEFAULT_MSG LIBARCHIVE_INCLUDE_DIR
++find_package_handle_standard_args(LibArchive DEFAULT_MSG LIBARCHIVE_INCLUDE_DIR
+ LIBARCHIVE_LIBRARY)
+
+ mark_as_advanced(LIBARCHIVE_INCLUDE_DIR LIBARCHIVE_LIBRARY)
+--- avogadrolibs-1.95.1/python/CMakeLists.txt 2022-17-04 16:00:00.000000000 +0200
++++ avogadrolibs-1.95.1-fixed/python/CMakeLists.txt 2022-17-04 16:00:01.000000000 +0200
+@@ -1,7 +1,7 @@
+ find_package(PythonInterp 3 REQUIRED)
+ find_package(PythonLibs 3 REQUIRED)
+ set(PYBIND11_PYTHON_VERSION "3" CACHE STRING "")
+-set(PYBIND11_CPP_STANDARD "-std=c++11" CACHE STRING "")
++set(CMAKE_CXX_STANDARD 14 CACHE STRING "")
+ find_package(pybind11 REQUIRED)
+
+ find_package(Eigen3 REQUIRED)
+--- avogadrolibs-1.95.1/avogadro/qtplugins/quantuminput/CMakeLists.txt 2022-18-04 19:00:00.000000000 +0200
++++ avogadrolibs-1.95.1-fixed/avogadro/qtplugins/quantuminput/CMakeLists.txt 2022-18-04 19:00:01.000000000 +0200
+@@ -41,3 +41,5 @@
+ else()
++ if(USE_PYTHON)
+- message("Avogadro Generators not found at ${_prefix}!")
++ message("Avogadro Generators not found at ${_prefix}!")
++ endif()
+ endif()
diff --git a/academic/avogadrolibs/slack-desc b/academic/avogadrolibs/slack-desc
new file mode 100644
index 000000000000..a04b7ca2236b
--- /dev/null
+++ b/academic/avogadrolibs/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+avogadrolibs: avogadrolibs (Libraries for Avogadro 2)
+avogadrolibs:
+avogadrolibs: Avogadro libraries provide 3D rendering, visualization, analysis and
+avogadrolibs: data processing useful in computational chemistry, molecular
+avogadrolibs: modeling, bioinformatics, materials science, and related areas.
+avogadrolibs: Avogadro 2 is being developed as part of the Open Chemistry project
+avogadrolibs: at Kitware, along with companion tools and libraries to support.
+avogadrolibs:
+avogadrolibs: Homepage: https://github.com/OpenChemistry/avogadrolibs
+avogadrolibs:
+avogadrolibs: