58 lines
1.8 KiB
Plaintext
Executable File
58 lines
1.8 KiB
Plaintext
Executable File
#!/usr/bin/env modbuild
|
|
|
|
# Check 'version-to-gitcommit.txt'
|
|
# - If version exists, we will compile directly from GIT cloned commit.
|
|
# - If version does not exist, install from GIT repository package (tag).
|
|
GITURL=$(grep -E "^${V}" files/from-git.txt | awk '{print $2}')
|
|
BRANCH=$(grep -E "^${V}" files/from-git.txt | awk '{print $3}')
|
|
CHERRY=$(grep -E "^${V}" files/from-git.txt | awk -F'cherry-pick:' '{print $2}')
|
|
CHERRY_COMMIT=$(echo "$CHERRY" | awk -F'|' '{print $1}')
|
|
CHERRY_REPO=$(echo "$CHERRY" | awk -F'|' '{print $2}')
|
|
|
|
if [[ -n ${GITURL} ]]; then
|
|
pbuild::pre_prep() {
|
|
if [[ ! -f ${PMODULES_DISTFILESDIR}/${P}-${V}.tar.bz2 ]]; then
|
|
git clone ${GITURL} ${P}
|
|
cd ${P}
|
|
if [[ -n ${BRANCH} ]]; then
|
|
git fetch -a
|
|
git checkout ${BRANCH}
|
|
fi
|
|
if [[ -n ${CHERRY_REPO} ]]; then
|
|
git remote add remotetmp $CHERRY_REPO
|
|
git fetch --all
|
|
fi
|
|
|
|
if [[ -n ${CHERRY_COMMIT} ]]; then
|
|
git cherry-pick $CHERRY_COMMIT
|
|
fi
|
|
|
|
# Use archive with top-level directory
|
|
git archive \
|
|
--format=tar \
|
|
--prefix="${P}-${V}/" \
|
|
HEAD > "${PMODULES_DISTFILESDIR}/${P}-${V}.tar"
|
|
|
|
bzip2 "${PMODULES_DISTFILESDIR}/${P}-${V}.tar"
|
|
cd ..
|
|
fi
|
|
}
|
|
fi
|
|
|
|
pbuild::pre_configure() {
|
|
./autogen.sh
|
|
|
|
if [[ -v CUDA_VERSION ]]; then
|
|
std::info "Enabling CUDA ${CUDA_VERSION}."
|
|
pbuild::add_configure_args "--with-cuda=${CUDA_HOME}"
|
|
fi
|
|
|
|
pbuild::add_configure_args "--with-udevrulesdir=${PREFIX}/lib/udev/rules.d"
|
|
pbuild::add_configure_args "--with-systemdsystemunitdir=${PREFIX}/lib/systemd/system"
|
|
|
|
if [[ -v SHS_CASSINI_HEADERS_VERSION ]]; then
|
|
std::info "Enabling SHS_CASSINI_HEADERS ${SHS_CASSINI_HEADERS_VERSION}."
|
|
pbuild::add_configure_args "--with-cassini-csr_defs=${SHS_CASSINI_HEADERS_HOME}/share/cassini-headers/csr_defs.json"
|
|
fi
|
|
}
|