ebuild per sci-physics/root [risolto]
Posted: Wed Nov 22, 2017 3:20 am
era: ebuild per sci-physics/root :access denied
a quanto pare, quancuno ha letto questo ebuild e ha prodotto un ebuild in portage che utilizza le osservaziono contenute sotto.
dunque il thread è risolto.
---
il thread che segue ha portato a scrivere l'ebuild qui sotto, che comincia ad essere abbastanza funzionale e che cercherò di aggiornare successivamente.
si raccomanda di farne uso con cautela.
sto cercando di produrre un ebuild per sci-physics/root visto che quello attuale è obsoleto.
in linea di principio, non dovrebbe essere una impresa impossibile, perché il software è ottimamente documentato.
in effetti, le istruzioni sono più che sufficienti per concludere felicemente la compilazione manuale in una cartella dedicata, a patto di introdurre le opzioni -Droot7=ON -Dcxx14=ON, necessarie per una installazione con gcc-5 o superiore.
appena provo a lanciare la compilazione in un ebuild, tuttavia, ottengo questo stupido errore:
è colpa di uno stupido demo (hsimple.C) che probabilmente non dovrebbe neppure essere lanciato, ma che non riesco a eliminare.
se commento la riga che lo lancia (con una patch), infatti, nascono altri errori.
che cosa si può fare, in questi casi?
aggiungo anche l'ebuild, del tutto maccheronico, che sto usando.
il fatto che sia maccheronico, tuttavia, non è probabilmente una concausa del problema che sto descrivendo.
a quanto pare, quancuno ha letto questo ebuild e ha prodotto un ebuild in portage che utilizza le osservaziono contenute sotto.
dunque il thread è risolto.
---
il thread che segue ha portato a scrivere l'ebuild qui sotto, che comincia ad essere abbastanza funzionale e che cercherò di aggiornare successivamente.
si raccomanda di farne uso con cautela.
Code: Select all
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python2_7 )
inherit cmake-utils elisp-common eutils fdo-mime fortran-2 multilib python-single-r1 \
toolchain-funcs user versionator
DESCRIPTION="C++ data analysis framework and interpreter from CERN"
HOMEPAGE="https://root.cern.ch"
SRC_URI="
https://root.cern.ch/download/${PN}_v${PV}.source.tar.gz
"
SLOT="0/$(get_version_component_range 1-3 ${PV})"
LICENSE="LGPL-2.1 freedist MSttfEULA LGPL-3 libpng UoI-NCSA"
KEYWORDS="amd64 ~x86 ~amd64-linux ~x86-linux"
# options extracted from configure
options="
afdsmgrd \
afs \
alien \
alloc \
+asimage \
+astiff \
bonjour \
-builtin_afterimage \
-builtin_ftgl \
-builtin_freetype \
-builtin_gl2ps \
-builtin_glew \
-builtin_pcre \
-builtin_unuran \
-builtin_zlib \
-builtin_lzma \
-builtin_lz4 \
-builtin_llvm \
+cxx14 \
cxx17 \
cxxmodules \
libcxx \
castor \
chirp \
cocoa \
davix \
dcache \
+explicitlink \
fink \
+fftw3 \
+fitsio \
gviz \
+gdml \
+genvector \
geocad \
gfal \
glite \
globus \
+gsl_shared \
hdfs \
http \
imt \
krb5 \
ldap \
+mathmore \
+memstat \
+minuit2 \
monalisa \
+mysql \
odbc \
+opengl \
oracle \
pgsql \
pythia6 \
+pythia8 \
+python \
+qt \
+qtgsi \
+roofit \
+r \
ruby \
rfio \
+rpath \
search_usrlocal \
sapdb \
+shadowpw \
+shared \
+soversion \
sqlite \
srp \
+ssl \
+table \
tbb \
+tmva \
+unuran \
vc \
-werror \
winrtdebug \
+x11 \
+xft \
+xml \
+xrootd \
"
options="${options} all gminimal minimal +root7"
options+=" $EXTRA_ECONF"
IUSE="${options}"
IUSE="${IUSE} +X doc emacs examples fits
graphviz kerberos +math mpi openmp oracle postgres prefix
R +tiff xinetd zeroconf"
# TODO: patches and useflags tuning and testing are needed
CDEPEND="${CDEPEND}
app-arch/xz-utils:0=
>=dev-lang/cfortran-4.4-r2
dev-libs/libpcre:3=
media-fonts/dejavu
media-libs/freetype:2=
media-libs/libpng:0=
>=sys-devel/clang-3.4:=
sys-libs/ncurses:=
sys-libs/zlib:0=
X? (
media-libs/ftgl:0=
media-libs/glew:0=
x11-libs/libX11:0=
x11-libs/libXext:0=
x11-libs/libXpm:0=
|| (
media-libs/libafterimage[gif,jpeg,png,tiff?]
>=x11-wm/afterstep-2.2.11[gif,jpeg,png,tiff?]
)
opengl? ( virtual/opengl virtual/glu x11-libs/gl2ps:0= )
x11-libs/libXft:0=
)
afs? ( net-fs/openafs )
emacs? ( virtual/emacs )
fits? ( sci-libs/cfitsio:0= )
fftw3? ( sci-libs/fftw:3.0= )
geocad? ( <sci-libs/opencascade-6.8.0:= )
graphviz? ( media-gfx/graphviz:0= )
http? ( dev-libs/fcgi:0= )
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap:0= )
math? (
sci-libs/gsl:0=
sci-mathematics/unuran:0=
mpi? ( virtual/mpi )
)
mysql? ( virtual/mysql )
odbc? ( || ( dev-db/libiodbc dev-db/unixODBC ) )
oracle? ( dev-db/oracle-instantclient-basic:0= )
postgres? ( dev-db/postgresql:= )
pythia6? ( sci-physics/pythia:6= )
pythia8? ( >=sci-physics/pythia-8.1.80:8= )
python? ( ${PYTHON_DEPS} )
R? ( dev-lang/R )
shadowpw? ( virtual/shadow )
sqlite? ( dev-db/sqlite:3= )
ssl? ( dev-libs/openssl:0= )
xml? ( dev-libs/libxml2:2= )
xrootd? ( >=net-libs/xrootd-3.3.5:0= )
zeroconf? ( net-dns/avahi:0= )
"
DEPEND="
virtual/pkgconfig
"
RDEPEND="${CDEPEND}
xinetd? ( sys-apps/xinetd )"
PDEPEND="doc? ( ~app-doc/root-docs-${PV}[http=,math=] )"
# install stuff in ${P} and not ${PF} for easier tracking in root-docs
DOC_DIR="/usr/share/doc/${P}"
OC_UNSUPPORTED="6.8.0"
die_compiler() {
eerror "You are using a $(tc-getCXX)-$5 without C++$1 capabilities"
die "Need one of the following C++$1 capable compilers:\n"\
" >=sys-devel/gcc[cxx]-$2\n"\
" >=sys-devel/clang-$3\n"\
" >=dev-lang/icc-$4"
}
# check compiler to satisfy minimal versions
# $1 - std version
# $2 - g++
# $3 - clang++
# $4 - icc/icpc
check_compiler() {
local cur ver
case "$(tc-getCXX)" in
*clang++*)
ver="$(best_version sys-devel/clang | sed 's:sys-devel/clang-::')"
cur="$3"
;;
*g++*)
ver="$(gcc-version)"
cur="$2"
;;
*icc*|*icpc*)
ver="$(best_version dev-lang/icc | sed 's:dev-lang/icc-::')"
eerror "ROOT-6 is known not to build with ICC."
eerror "Please report any issues upstream."
cur="$4"
;;
*)
ewarn "You are using an unsupported compiler."
ewarn "Please report any issues upstream."
return 0
;;
esac
version_is_at_least "${cur}" "${ver}" || die_compiler "$1" "$2" "$3" "$4" "${ver}"
}
pkg_setup() {
fortran-2_pkg_setup
use python && python-single-r1_pkg_setup
echo
elog "There are extra options on packages not yet in Gentoo:"
elog "Afdsmgrd, AliEn, castor, Chirp, dCache, gfal, Globus, gLite,"
elog "HDFS, Monalisa, MaxDB/SapDB, SRP."
elog "You can use the env variable EXTRA_ECONF variable for this."
elog "For example, for SRP, you would set: "
elog "EXTRA_ECONF=\"--enable-srp --with-srp-libdir=${EROOT%/}/usr/$(get_libdir)\""
echo
enewgroup rootd
enewuser rootd -1 -1 /var/spool/rootd rootd
if use math; then
if use openmp; then
if [[ "$(tc-getCXX)" == *g++* && "$(tc-getCXX)" != *clang++* ]] && ! tc-has-openmp; then
ewarn "You are using a g++ without OpenMP capabilities"
die "Need an OpenMP capable compiler"
else
export USE_OPENMP=1 USE_PARALLEL_MINUIT2=1
fi
elif use mpi; then
export USE_MPI=1 USE_PARALLEL_MINUIT2=1
fi
fi
# c++11 support is mandatory
check_compiler "11" "4.8" "3.4" "13"
# Active version of opencascade may be >= $OC_UNSUPPORTED,
# so we need to eselect proper version (it must exist due to DEPEND requirement)
if use geocad; then
oc_current=$(eselect opencascade show)
# Proceed only if active version is unsupported
if version_is_at_least "${OC_UNSUPPORTED}" "${oc_current}"; then
local -a vlist
vlist=( $(version_sort $(eselect opencascade list | awk '/^ / { print $2 }')) )
local i
# search for higehr version < $OC_UNSUPPORTED
# list is sorted acsending, so loop backwards
for (( i=$(( ${#vlist[@]} -1 )); i>=0; i-- )); do
version_is_at_least "${OC_UNSUPPORTED}" "${vlist[i]}" || break
done
[[ $i == "-1" ]] && die "No suitable opencascade eselect slot is available (<${OC_UNSUPPORTED})"
einfo "Switching opencascade to supported slot: ${oc_current} -> ${vlist[i]}"
eselect opencascade set ${vlist[i]} > /dev/null || die "eselect opencascade set ${vlist[i]} failed!"
else
# forget it, effectively disabling eselect cleanup
unset oc_current
fi
fi
}
PATCHES=(
"${FILESDIR}/${PN}-5.32.00-afs.patch" \
"${FILESDIR}/${PN}-5.32.00-cfitsio.patch" \
"${FILESDIR}/${PN}-5.28.00b-glibc212.patch" \
"${FILESDIR}/${PN}-5.32.00-chklib64.patch" \
"${FILESDIR}/${PN}-6.00.01-dotfont.patch" \
"${FILESDIR}/${PN}-6.04.06-prop-flags.patch" \
)
PROPERTIES="interactive"
export CMAKE_BUILD_TYPE="Release"
src_prepare() {
# make sure we use system libs and headers
rm montecarlo/eg/inc/cfortran.h README/cfortran.doc || die
LANG=C LC_ALL=C find core/zip -type f -name "[a-z]*" -print0 | \
xargs -0 rm || die
rm -r core/lzma/src/*.tar.gz || die
sed -i -e 's/^GLLIBS *:= .* $(OPENGLLIB)/& -lgl2ps/' \
graf3d/gl/Module.mk || die
# In Gentoo, libPythia6 is called libpythia6
# iodbc is in /usr/include/iodbc
# pg_config.h is checked instead of libpq-fe.h
sed -i \
-e 's:libPythia6:libpythia6:g' \
-e 's:$ODBCINCDIR:$ODBCINCDIR /usr/include/iodbc:' \
-e 's:libpq-fe.h:pg_config.h:' \
configure || die "adjusting configure for Gentoo failed"
default
}
src_configure() {
local mycmakeargs=(
-DWITH_root7=ON \
-DWITH_cxx14=ON \
-DWITH_builtin_afterimage=OFF \
-DWITH_builtin_ftgl=OFF \
-DWITH_builtin_freetype=OFF \
-DWITH_builtin_glew=OFF \
-DWITH_builtin_lzma=OFF \
-DWITH_builtin_pcre=OFF \
-DWITH_builtin_zlib=OFF \
-DWITH_explicitlink=ON \
-DWITH_soversion=ON \
-DWITH_fail-on-missing=ON \
)
for i in ${options}; do {
i=${i/-/}
i=${i/+/}
if use ${i}; then {
echo ON $i
mycmakeargs+="-DWITH_${i}=ON "
}
else {
echo OFF $i
mycmakeargs+="-DWITH_${i}=OFF "
}
fi
} done
CMAKE_C_FLAGS="${CFLAGS}"
CMAKE_CXX_FLAGS="${CXXFLAGS}"
CMAKE_CXX_LINK_FLAGS=${LDFLAGS}
CMAKE_Fortran_FLAGS="${FFLAGS}"
CMAKE_INSTALL_TUTDIR="${EPREFIX%/}/${DOC_DIR}/examples/tutorials"
CMAKE_INSTALL_TESTDIR="${EPREFIX%/}/${DOC_DIR}/examples/tests"
CMAKE_INSTALL_ICONDIR="${EPREFIX%/}/usr/share/pixmaps"
addwrite /dev/random
cmake-utils_src_configure
}
daemon_install() {
local daemons="rootd proofd"
dodir /var/spool/rootd
fowners rootd:rootd /var/spool/rootd
dodir /var/spool/rootd/{pub,tmp}
fperms 1777 /var/spool/rootd/{pub,tmp}
local i
for i in ${daemons}; do
newinitd "${FILESDIR}"/${i}.initd ${i}
newconfd "${FILESDIR}"/${i}.confd ${i}
done
if use xinetd; then
insinto /etc/xinetd
sed -e 's|@bindir@|/usr/bin/|' \
-e 's|@prefix@|/usr|' \
< ./config/rootd.xinetd.in > ${S}"/etc/daemons/rootd.xinetd"
sed -e 's|@bindir@|/usr/bin/|' \
-e 's|@prefix@|/usr|' \
< ./config/proofd.xinetd.in > ${S}"/etc/daemons/proofd.xinetd"
doins "${S}"/etc/daemons/{rootd,proofd}.xinetd
fi
}
desktop_install() {
cd "${S}"
echo "Icon=root-system-bin" >> etc/root.desktop
domenu etc/root.desktop
doicon build/package/debian/root-system-bin.png
insinto /usr/share/icons/hicolor/48x48/mimetypes
doins build/package/debian/application-x-root.png
insinto /usr/share/icons/hicolor/48x48/apps
doicon build/package/debian/root-system-bin.xpm
}
cleanup_install() {
rm "${D}"/usr/LICENSE
rm "${D}"/usr/lib64/libGLEW.so
rm "${D}"/usr/include/GL/glew.h
rm "${D}"/usr/include/GL/glxew.h
}
src_install() {
DOCS=($(find README/* -maxdepth 1 -type f))
insinto "${DOC_DIR}"
doins README.md
# /bin/bash -i
cmake-utils_src_install
daemon_install
desktop_install
cleanup_install
docompress -x "${DOC_DIR}"/{CREDITS,LICENSE,examples/tutorials}
dosym "${ED}"usr/portage/licenses/LGPL-2.1 "${DOC_DIR}/LICENSE"
}
in linea di principio, non dovrebbe essere una impresa impossibile, perché il software è ottimamente documentato.
in effetti, le istruzioni sono più che sufficienti per concludere felicemente la compilazione manuale in una cartella dedicata, a patto di introdurre le opzioni -Droot7=ON -Dcxx14=ON, necessarie per una installazione con gcc-5 o superiore.
appena provo a lanciare la compilazione in un ebuild, tuttavia, ottengo questo stupido errore:
Code: Select all
Scanning dependencies of target hsimple
[ 89%] Generating tutorials/hsimple.root
Processing hsimple.C...
* ACCESS DENIED: open_wr: /dev/random
open('/dev/random'): Permission denied
...
VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line
F: open_wr
S: deny
P: /dev/random
A: /dev/random
R: /dev/random
C: /tmp/ramtmp/.lnv/portage/sci-physics/root-6.10.08/work/root-6.10.08_build/bin/root.exe -l -q -b -n -x hsimple.C -e return
* --------------------------------------------------------------------------------
se commento la riga che lo lancia (con una patch), infatti, nascono altri errori.
che cosa si può fare, in questi casi?
aggiungo anche l'ebuild, del tutto maccheronico, che sto usando.
il fatto che sia maccheronico, tuttavia, non è probabilmente una concausa del problema che sto descrivendo.
Code: Select all
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=5
PYTHON_COMPAT=( python2_7 )
inherit epatch cmake-utils
#elisp-common eutils fdo-mime fortran-2 multilib python-single-r1 \
# toolchain-funcs user versionator
DESCRIPTION="C++ data analysis framework and interpreter from CERN"
HOMEPAGE="https://root.cern.ch"
SRC_URI="
https://root.cern.ch/download/root_v6.10.08.source.tar.gz
"
LICENSE="LGPL-2.1 freedist MSttfEULA LGPL-3 libpng UoI-NCSA"
KEYWORDS="amd64 ~x86 ~amd64-linux ~x86-linux"
IUSE=""
SLOT="0/$(get_version_component_range 1-3 ${PV})"
# TODO: ...
CDEPEND=""
DEPEND="${CDEPEND}
virtual/pkgconfig"
RDEPEND="${CDEPEND}
"
#inherit eutils cmake-utils
export CMAKE_BUILD_TYPE="Release"
pkg_setup() {
fortran-2_pkg_setup
}
src_prepare() {
#epatch "${FILESDIR}"/root-6.10.08_exe.patch
# In Gentoo, libPythia6 is called libpythia6
# iodbc is in /usr/include/iodbc
# pg_config.h is checked instead of libpq-fe.h
sed -i \
-e 's:libPythia6:libpythia6:g' \
-e 's:$ODBCINCDIR:$ODBCINCDIR /usr/include/iodbc:' \
-e 's:libpq-fe.h:pg_config.h:' \
#configure || die "adjusting configure for Gentoo failed"
#rm tutorials -rf || die
}
src_configure() {
mkdir ../root-6.10.08_build
cd ../root-6.10.08_build
cmake -Droot7=ON -Dcxx14=ON ../root-6.10.08
}