123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247 |
- # Maintainer: gborzi <gborzi@ieee.org>
- # Contributor: mickele <mimocciola@yahoo.com>
- pkgname=('gmsh' 'gmsh-docs')
- pkgver=4.8.4
- pkgrel=4
- pkgdesc="An automatic 3D finite element mesh generator with pre and post-processing facilities."
- arch=('x86_64')
- url="http://gmsh.info/"
- license=('custom')
- makedepends=('cmake' 'desktop-file-utils' 'sed' 'swig' 'texlive-core' 'voro++'
- 'fltk' 'med' 'opencascade' 'cairo' 'metis' 'alglib'
- 'glu' "hypre=2.18.2")
- optdepends=(
- "openmpi: Parallel processing (not used for meshing)"
- "openmp: Parallel distributed tasks"
- "eigen: Lightweight C++ template library for vector and matrix math"
- "cgns: recording and recovering numerical data"
- "gmm: finite element library (alternative to PETSc)"
- "petsc: toolkit for scientific computation"
- "hypre=2.18.2: Large and sparse linear with massive parallel computing (for PETSc)"
- "mumps: sparse solver library"
- "hxt: haskell xml library (for reparametrization and meshing)"
- "lapack: linear algebra library (if Eigen unavailable)"
- "blas: linear algebra subroutines (if Eigen unavailable)")
- options=(!emptydirs)
- source=("${url}src/${pkgname}-${pkgver}-source.tgz"
- gmsh.desktop
- gmsh.completion)
- sha256sums=('760dbdc072eaa3c82d066c5ba3b06eacdd3304eb2a97373fe4ada9509f0b6ace'
- '43a8ca33ac917ee7196fdae305ff2c8cb9ae1072569ee546c0ce8ff580c966ae'
- '11605e97636a56cf51e445e65019526ee253bd2e0553fb71ba6d94488dcd34ef')
- # From UPC: Building And Using Static And Shared "C"
- # Libraries.html
- # #+begin_QUOTE
- # we need that all jump calls ("goto", in assembly speak)
- # and subroutine calls will use relative addresses, and not
- # absolute addresses. Thus, we need to use ... ~-fPIC~ or
- # ~-fpic~
- # #+end_QUOTE
- #
- # From makepkg.conf
- # -march (or -mcpu) builds exclusively for an architecture
- # -mtune optimizes for an architecture, but builds for
- # whole processor family
- #
- # -O3 optimises
- #
- # -D-FORTIFY-SOURCE=2
- # | https://stackoverflow.com/a/16604146
- # |- man 7 feature_test_macros
- # checks to be performed to detect some buffer overflow
- # errors when employing various string and memory
- # manipulation functions ... some conforming programs
- # might fail
- #
- # -fcf-protection
- # | Info pages for gcc (gnu compiler collection)
- # intended to protect against such threats as
- # Return-oriented Programming (ROP), and similarly
- # call/jmp-oriented programming (COP/JOP)
- #
- # -pipe
- # | Info pages for gcc (controlling the kind of output)
- # Use pipes rather than temporary files for communication
- # between the various stages of compilation
- #
- # -fno-plt
- # | Info pages for gcc (code generation conventions)
- # leads to more efficient code by eliminating PLT stubs and
- # exposing GOT loads to optimizations
- #
- # -fopenmp
- # | Info pages for gcc (controlling c dialect)
- # Enable handling of OpenMP directives
- #
- safe_flags="-Wp,-D_FORTIFY_SOURCE=2,-D_GLIBCXX_ASSERTIONS"
- safe_flags+=" -fcf-protection -fno-plt"
- safe_flags+=" -fstack-clash-protection -Wformat"
- safe_flags+=" -Werror=format-security"
- generic_flags="-pipe -fno-plt -fPIC -fopenmp -march=amdfam10"
- generic_flags+=" -mtune=native ${safe_flags}"
- opt_flags="${generic_flags} -O3"
- generic_flags="${generic_flags} -O2"
- COPTFLAGS="${opt_flags}"
- CXXOPTFLAGS="$COPTFLAGS"
- FOPTFLAGS="$COPTFLAGS"
- CPPFLAGS="$generic_flags"
- CXXFLAGS="$CPPFLAGS"
- CFLAGS="$generic_flags"
- FFLAGS="$generic_flags"
- FCFLAGS="$generic_flags"
- F90FLAGS="$generic_flags"
- F77FLAGS="$generic_flags"
- export LANG=en
- export MAKEFLAGS="-j4"
- _install_dir="/usr/local/petsc/${_config}"
- _petsc_arch="arch-${_config}"
- prepare() {
- cd "${srcdir}/${pkgname}-${pkgver}-source"
- # Help links to local doc (package gmsh-docs)
- sed -e "s|https://gmsh.info/doc/texinfo/|" \
- "file:///usr/share/doc/gmsh/gmsh.html|" \
- -i Fltk/graphicWindow.cpp
- sed -e "s|https://gmsh.info/|" \
- "file:///usr/share/licenses/gmsh/|" \
- -i Fltk/helpWindow.cpp
- }
- build() {
- cd "${srcdir}/${pkgname}-${pkgver}-source"
- mkdir -p build
- cd build
- # Read cmake_options.texi
- CONFOPTS=(
- -DCMAKE_BUILD_TYPE:STRING="RelWithDebInfo"
- -DCMAKE_INSTALL_PREFIX:PATH=/usr
- -DCMAKE_PREFIX_PATH:PATH="/usr"
- -DDMUMPS_INC:PATH="/usr/include"
- -DCGNS_LIB:FILEPATH="/usr/lib/lib/libcgns.so"
- -DENABLE_ANN:BOOL="0"
- -DENABLE_BUILD_DYNAMIC:BOOL="1"
- -DENABLE_BUILD_LIB:BOOL="1"
- -DENABLE_BUILD_SHARED:BOOL="1"
- -DENABLE_GRAPHICS:BOOL="1"
- -DENABLE_MPI:BOOL="1"
- -DENABLE_MUMPS:BOOL="1"
- -DENABLE_NCURSES:BOOL="1"
- -DENABLE_OCC_TBB:BOOL="1"
- -DENABLE_OPENMP:BOOL="1"
- -DENABLE_POPPLER:BOOL="1"
- -DENABLE_PETSC:BOOL="1"
- -DENABLE_SLEPC:BOOL="0"
- -DENABLE_ZIPPER:BOOL="1"
- # Disabled: private API is unsupported
- -DENABLE_PRIVATE_API:BOOL="0"
- -DENABLE_NUMPY:BOOL="0"
- -DENABLE_PETSC4PY:BOOL="0"
- -DENABLE_WRAP_PYTHON:BOOL="0"
- )
- cmake $(for (( i=1; i<=${#CONFOPTS[@]}; i++)); do
- echo "${CONFOPTS[$i]}";
- done) "${srcdir}/${pkgname}-${pkgver}-source"
- # make clean
- make
- LC_ALL=C make doc
- }
- package_gmsh() {
- depends=('fltk' 'med' 'opencascade' 'cairo' 'metis' 'alglib'
- 'glu' "petsc")
- optdepends=(
- 'gmsh-docs: docs for gmsh'
- 'python2: for gmsh.py'
- 'python: for gmsh.py'
- 'julia: for gmsh.jl'
- "hypre=2.18.2: Large and sparse linear with massive parallel computing (for PETSc)"
- 'ann: nearest neighbour'
- )
- # TODO make sure that "${srcdir}" is not in package
- _src_dir="${srcdir}/${pkgname}-${pkgver}-source"
- _build_dir="${_src_dir}"/build
- cd "${_build_dir}"
- # Install Python and Julia API
- make DESTDIR=${pkgdir} install
- install -D -m644 "${pkgdir}/usr/lib/gmsh.py" \
- "${pkgdir}"/usr/share/gmsh/api/python/gmsh.py
- install -D -m644 "${pkgdir}/usr/lib/gmsh.jl" \
- "${pkgdir}"/usr/share/gmsh/api/julia/gmsh.jl
- rm -f "${pkgdir}"/usr/lib/gmsh.{py,jl}
- install -d "${pkgdir}"/etc/profile.d
- cd "${pkgdir}"/etc/profile.d/
- printf "%s%s\n" 'export JULIA_LOAD_PATH=' \
- '"/usr/share/gmsh/api/julia/:$JULIA_LOAD_PATH"'\
- > gmsh.sh
- printf "%s%s\n" 'setenv JULIA_LOAD_PATH ' \
- '"/usr/share/gmsh/api/julia/:$JULIA_LOAD_PATH"' \
- > gmsh.csh
- cd "${_build_dir}"
- install -d "${pkgdir}"/usr/share/pixmaps/"${pkgname}"
- install -m644 "${_src_dir}"/utils/icons/*.png \
- "${pkgdir}/usr/share/pixmaps/${pkgname}"
- install -D -m644 "${_src_dir}"/utils/icons/gmsh-no-text.png \
- "${pkgdir}/usr/share/icons/${pkgname}.png"
- desktop-file-install --dir="${pkgdir}/usr/share/applications" \
- "${srcdir}/${pkgname}.desktop"
- install -D -m 644 "${_src_dir}"/LICENSE.txt \
- "${pkgdir}"/usr/share/licenses/"${pkgname}"/LICENSE.txt
- install -D -m 644 "${_src_dir}"/CREDITS.txt \
- "${pkgdir}"/usr/share/licenses/"${pkgname}"/CREDITS.txt
- install -D -m644 "${srcdir}"/gmsh.completion \
- "${pkgdir}"/etc/bash_completion.d/gmsh
- # Hackish way to save the documentation (for gmsh-docs)
- mv "${pkgdir}"/usr/share/doc "${pkgdir}"/..
- }
- package_gmsh-docs() {
- pkgdesc="TXT, HMTL and PDF doc for Gmsh"
- arch=('any')
- license=('GPL2')
- # TODO make sure that "${srcdir}" is not in package
- _src_dir="${srcdir}/${pkgbase}-${pkgver}-source"
- _build_dir="${_src_dir}"/build
- cd ${_build_dir}
- bsdtar -xf ${pkgbase}-${pkgver}-*.tgz
- cd "${_src_dir}"/build/doc/texinfo
- install -D -m644 gmsh.html "${pkgdir}"/usr/share/doc/gmsh/gmsh.html
- install -D -m644 gmsh.txt "${pkgdir}"/usr/share/doc/gmsh/gmsh.txt
- install -D -m644 gmsh.pdf "${pkgdir}"/usr/share/doc/gmsh/gmsh.pdf
- install -D -m644 gmsh.info "${pkgdir}"/usr/share/info/gmsh.info
- # Get the texinfo pages in the right place
- install -D -m644 "${_src_dir}/doc/texinfo/gmsh.info-1" \
- "${pkgdir}/usr/share/info/gmsh.info-1"
- install -D -m644 "${_src_dir}/doc/texinfo/gmsh.info-2" \
- "${pkgdir}/usr/share/info/gmsh.info-2"
- # Hackish way to retrieve the documentation (for gmsh-docs)
- [ -d "${pkgdir}"/../doc ] &&
- mv "${pkgdir}"/../doc/gmsh/* "${pkgdir}"/usr/share/doc/gmsh/
- # Generate and save Doxygen documentation
- cd "${_build_dir}"/
- doxygen "${_src_dir}"/doc/doxygen/Doxyfile
- cp -a doc/html "${pkgdir}"/usr/share/doc/gmsh/
- }
|