root.SlackBuild 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. #!/bin/bash
  2. # Slackware build script for ROOT
  3. # written by Jože Zobec <jozze.zepl@gmail.com>
  4. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY
  5. # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  6. # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  7. # DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  8. # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  9. # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  10. # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  11. # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  12. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  13. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. # Modified by the slackbuilds.org project
  15. cd $(dirname $0) ; CWD=$(pwd)
  16. PRGNAM=root
  17. VERSION=${VERSION:-6.24.06}
  18. BUILD=${BUILD:-1}
  19. TAG=${TAG:-_SBo}
  20. PKGTYPE=${PKGTYPE:-tgz}
  21. if [ -z "$ARCH" ]; then
  22. case "$( uname -m )" in
  23. i?86) ARCH=i586 ;;
  24. arm*) ARCH=arm ;;
  25. *) ARCH=$( uname -m ) ;;
  26. esac
  27. fi
  28. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  29. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  30. exit 0
  31. fi
  32. TMP=${TMP:-/tmp/SBo}
  33. PKG=$TMP/package-$PRGNAM
  34. OUTPUT=${OUTPUT:-/tmp}
  35. if [ "$ARCH" = "i586" ]; then
  36. SLKCFLAGS="-march=i586 -mtune=i686"
  37. elif [ "$ARCH" = "i686" ]; then
  38. SLKCFLAGS="-march=i686 -mtune=i686"
  39. elif [ "$ARCH" = "x86_64" ]; then
  40. SLKCFLAGS="-fPIC"
  41. else
  42. SLKCFLAGS=""
  43. fi
  44. CXXSTD=${CXXSTD:-17}
  45. set -e
  46. rm -rf $PKG
  47. mkdir -p $TMP $PKG $OUTPUT
  48. cd $TMP
  49. rm -rf $PRGNAM-$VERSION
  50. tar xvf $CWD/$PRGNAM\_v$VERSION.source.tar.gz
  51. mv root-$VERSION src
  52. mkdir -p $PRGNAM-$VERSION
  53. mv src $PRGNAM-$VERSION
  54. cd $PRGNAM-$VERSION
  55. chown -R root:root .
  56. find -L . \
  57. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  58. -o -perm 511 \) -exec chmod 755 {} \+ -o \
  59. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  60. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
  61. # prefix where to install stuff
  62. PREFIX=/opt/ROOT-${VERSION}
  63. mkdir -p build
  64. cd build
  65. CFLAGS="$SLKCFLAGS" \
  66. CXXFLAGS="$SLKCFLAGS" \
  67. cmake ../src \
  68. -DCMAKE_INSTALL_PREFIX=$PREFIX \
  69. -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
  70. -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
  71. -DCMAKE_CXX_STANDARD=${CXXSTD} \
  72. -DCMAKE_INSTALL_PYTHONDIR=lib \
  73. -DMAN_INSTALL_DIR=$PREFIX/man \
  74. -Dbuiltin_cfitsio=OFF \
  75. -Dbuiltin_davix=OFF \
  76. -Dbuiltin_fftw3=OFF \
  77. -Dbuiltin_gsl=OFF \
  78. -Dbuiltin_openssl=OFF \
  79. -Dbuiltin_tbb=OFF \
  80. -Dbuiltin_vc=OFF \
  81. -Dbuiltin_vdt=OFF \
  82. -Dbuiltin_veccore=OFF \
  83. -Dclad=OFF \
  84. -Dalien=OFF \
  85. -Dall=OFF \
  86. -Darrow=OFF \
  87. -Dassan=OFF \
  88. -Dasserts=OFF \
  89. -Dbuiltin_freetype=OFF \
  90. -Dfftw3=ON \
  91. -Dbuiltin_glew=OFF \
  92. -Dbuiltin_clang=ON \
  93. -Dbuiltin_cling=ON \
  94. -Dbuiltin_llvm=ON \
  95. -Dbuiltin_lz4=OFF \
  96. -Dbuiltin_lzma=OFF \
  97. -Dbuiltin_nlohmannjson=ON \
  98. -Dbuiltin_openui5=ON \
  99. -Dbuiltin_pcre=OFF \
  100. -Dbuiltin_unuran=OFF \
  101. -Dbuiltin_xrootd=OFF \
  102. -Dbuiltin_xxhash=OFF \
  103. -Dbuiltin_zlib=OFF \
  104. -Dbuiltin_zstd=OFF \
  105. -Dccache=OFF \
  106. -Dcefweb=OFF \
  107. -Dclingtest=OFF \
  108. -Dcocoa=OFF \
  109. -Dcompression_default=zlib \
  110. -Dcoverage=OFF \
  111. -Dcuda=OFF \
  112. -Dcudnn=OFF \
  113. -Dcxx_modules=OFF \
  114. -Ddataframe=ON \
  115. -Ddavix=OFF \
  116. -Ddcache=OFF \
  117. -Ddev=OFF \
  118. -Ddistcc=OFF \
  119. -Dexceptions=ON \
  120. -Dfail-on-missing=ON \
  121. -Dfcgi=OFF \
  122. -Dfitsio=ON \
  123. -Dfortran=ON \
  124. -Dgdml=ON \
  125. -Dgfal=OFF \
  126. -Dgminimal=OFF \
  127. -Dgnuinstall=OFF \
  128. -Dgsl_shared=ON \
  129. -Dmathmore=ON \
  130. -Dgviz=OFF \
  131. -Dhttp=ON \
  132. -Djemalloc=OFF \
  133. -Dlibcxx=OFF \
  134. -Dmacos_native=OFF \
  135. -Dmemory_termination=OFF \
  136. -Dminimal=OFF \
  137. -Dminuit2=ON \
  138. -Dmlp=ON \
  139. -Dmonalisa=OFF \
  140. -Dmpi=OFF \
  141. -Dmysql=OFF \
  142. -Dodbc=OFF \
  143. -Dopengl=ON \
  144. -Doracle=OFF \
  145. -Dpgsql=OFF \
  146. -Dpyroot=ON \
  147. -Dpyroot_legacy=OFF \
  148. -Dpythia6=OFF \
  149. -Dpythia6_nolink=OFF \
  150. -Dpythia8=OFF \
  151. -Dqt5web=OFF \
  152. -Dr=OFF \
  153. -Droofit=ON \
  154. -Droot7=ON \
  155. -Drootbench=OFF \
  156. -Droottest=OFF \
  157. -Drpath=OFF \
  158. -Druntime_cxxmodules=ON \
  159. -Dshadowpw=OFF \
  160. -Dshared=ON \
  161. -Dsoversion=ON \
  162. -Dspectrum=ON \
  163. -Dsqlite=OFF \
  164. -Dssl=ON \
  165. -Dtcmalloc=OFF \
  166. -Dtest_distrdf_pyspark=OFF \
  167. -Dtesting=OFF \
  168. -Dtmva=ON \
  169. -Dtmva-cpu=ON \
  170. -Dtmva-gpu=OFF \
  171. -Dtmva-pymva=ON \
  172. -Dtmva-rmva=OFF \
  173. -Dunuran=OFF \
  174. -During=OFF \
  175. -Dvc=OFF \
  176. -Dvdt=OFF \
  177. -Dveccore=OFF \
  178. -Dvmc=OFF \
  179. -Dwebgui=ON \
  180. -Dwin_broken_tests=OFF \
  181. -Dwinrtdebug=OFF \
  182. -Dx11=ON \
  183. -Dxml=ON \
  184. -Dxproofd=OFF \
  185. -Dxrootd=OFF \
  186. -DCMAKE_BUILD_TYPE=Release ../src
  187. make
  188. make install/strip DESTDIR=$PKG
  189. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  190. | cut -f 1 -d : | xargs strip --strip-unneded 2> /dev/null || true
  191. find $PKG$PREFIX/man -type f -exec gzip -9 {} \;
  192. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  193. # We are still in build directory
  194. # Copy documentation to system; also to ROOTSYS (ROOT expects it there)
  195. cp -a README/ README.md LICENSE LGPL2_1.txt ../src/CONTRIBUTING.md \
  196. $PKG/usr/doc/$PRGNAM-$VERSION
  197. find $PKG/usr/doc/$PRGNAM-$VERSION -type f -exec chmod 644 {} \;
  198. cp -a README/ LICENSE \
  199. $PKG$PREFIX
  200. chmod -R 644 $PKG$PREFIX/README
  201. chmod -R 644 $PKG$PREFIX/LICENSE
  202. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  203. # Install some profile.d scripts to use the right paths
  204. mkdir -p $PKG/etc/profile.d
  205. # Start with tcsh
  206. echo "setenv ROOTSYS $PREFIX" > $PKG/etc/profile.d/root.csh
  207. echo "set path = ( \$path $PREFIX/bin )" >> $PKG/etc/profile.d/root.csh
  208. echo "setenv MANPATH \${MANPATH}:$PREFIX/man" >> $PKG/etc/profile.d/root.csh
  209. echo "if ( ! \$?PYTHONPATH ) then" >> $PKG/etc/profile.d/root.csh
  210. echo "setenv PYTHONPATH $PREFIX/lib" >> $PKG/etc/profile.d/root.csh
  211. echo "else" >> $PKG/etc/profile.d/root.csh
  212. echo "if ( \"\$PYTHONPATH\" != \"\") then" >> $PKG/etc/profile.d/root.csh
  213. echo "setenv PYTHONPATH \$PYTHONPATH:$PREFIX/lib">> $PKG/etc/profile.d/root.csh
  214. echo "else" >> $PKG/etc/profile.d/root.csh
  215. echo "setenv PYTHONPATH $PREFIX/lib" >> $PKG/etc/profile.d/root.csh
  216. echo "endif" >> $PKG/etc/profile.d/root.csh
  217. echo "endif" >> $PKG/etc/profile.d/root.csh
  218. # And bash
  219. echo "ROOTSYS=$PREFIX" > $PKG/etc/profile.d/root.sh
  220. echo "PATH=\$PATH:$PREFIX/bin" >> $PKG/etc/profile.d/root.sh
  221. echo "MANPATH=\$MANPATH:$PREFIX/man" >> $PKG/etc/profile.d/root.sh
  222. echo "if [ -z \"\${PYTHONPATH}\" ]; then" >> $PKG/etc/profile.d/root.sh
  223. echo " export PYTHONPATH=$PREFIX/lib" >> $PKG/etc/profile.d/root.sh
  224. echo "else" >> $PKG/etc/profile.d/root.sh
  225. echo " export PYTHONPATH=\$PYTHONPATH:$PREFIX/lib" \
  226. >> $PKG/etc/profile.d/root.sh
  227. echo "fi" >> $PKG/etc/profile.d/root.sh
  228. chmod +x $PKG/etc/profile.d/root.*
  229. mkdir -p $PKG/etc/ld.so.conf.d
  230. echo "$PREFIX/lib" > $PKG/etc/ld.so.conf.d/root.conf
  231. mkdir -p $PKG/install
  232. cat $CWD/slack-desc > $PKG/install/slack-desc
  233. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  234. cd $PKG
  235. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE