diff options
author | physkets | 2019-03-18 22:36:54 +0530 |
---|---|---|
committer | physkets | 2019-03-18 22:36:54 +0530 |
commit | 6665ebf2edfd286eed273518c59fc17c0fa96098 (patch) | |
tree | 45d9304b259b6391a86224b153d82942e7616489 | |
parent | 5edd31bfab85c12d9adc692eed22ea8a320974ce (diff) | |
download | aur-6665ebf2edfd286eed273518c59fc17c0fa96098.tar.gz |
change optional build procedure
-rw-r--r-- | PKGBUILD | 30 |
1 files changed, 23 insertions, 7 deletions
@@ -1,5 +1,16 @@ # Maintainer: physkets <physkets // at // tutanota dot com> # Contributor: xpt <user.xpt@gmail.com> + +### BUILD OPTIONS +# Set these variables to '1' to enable them +# Doing so will add the requisite build commands, +# as well as add the needed dependencies + +# HTML documentation +_BUILD_DOC=0 +# KIM package +_ENABLE_KIM=0 + _pkgname=lammps pkgname=${_pkgname}-beta pkgver=20190228 @@ -17,9 +28,14 @@ provides=('lammps') source=("${_pkgname}-${_pkgver}.tar.gz::https://github.com/${_pkgname}/${_pkgname}/archive/patch_${_pkgver}.tar.gz") sha512sums=('dc264ec43a5a917a0a7905f89076c2e10e8d5613bb710fb970eb388721860d7d409db7d988803bde823ddd74691c4b3bdf5bf4a72713476dad5a4b0833a4dbd0') -_BUILD_DOC=false -# Set the above to 'true' if you want to build documentation -if $_BUILD_DOC ; then makedepends+=( 'python-sphinx' 'lammpsdoc') ; fi +# process the build settings from above +if (( $_BUILD_DOC )); then + makedepends+=('python-sphinx' 'lammpsdoc') +fi +if (( $_ENABLE_KIM )); then + depends+=('kim-api') + _feature_args+=('-DPKG_KIM=yes') +fi prepare(){ cd "${_pkgname}-patch_${_pkgver}" @@ -31,14 +47,14 @@ build() { cmake ../cmake \ -DCMAKE_INSTALL_PREFIX="/usr" \ -DCMAKE_INSTALL_LIBDIR="lib" \ - -DCMAKE_INSTALL_LIBEXECDIR="/usr/lib" #\ - #-DPKG_KIM=yes # KIM package. Also install 'kim-api' from the AUR + -DCMAKE_INSTALL_LIBEXECDIR="/usr/lib" \ + "${_feature_args[@]}" #\ # Add options for additional packages #-DPKG_<NAME>=yes make - if $_BUILD_DOC ; then + if (( $_BUILD_DOC )) ; then # Generate ReStructuredText from Text files mkdir -p rst @@ -60,7 +76,7 @@ build() { package() { cd "${_pkgname}-patch_${_pkgver}/build" make DESTDIR="${pkgdir}" install - if $_BUILD_DOC ; then + if (( $_BUILD_DOC )) ; then install -Dm644 -t "${pkgdir}/usr/share/doc/${_pkgname}/html" "html/"*.html install -Dm644 -t "${pkgdir}/usr/share/doc/${_pkgname}/html" "html/"*.js install -Dm644 -t "${pkgdir}/usr/share/doc/${_pkgname}/html/_images" "html/_images/"* |