Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 74 lines (53 sloc) 1.24 KB
#!/bin/bash
{
set -x
set -e
set -u
. build.profile
. ${PREFIX}/${BUILD_python}/profile
. ${PREFIX}/${BUILD_ffmpeg}/profile
function B_UNPAPER {
SRCURL="${BUILD_unpaper_SRCURL}"
BUILD_PKG="${BUILD_unpaper}"
PREFIX=${PREFIX}/${BUILD_PKG}
if [[ -e "${BUILD_PKG}".tar ]]; then
tar -xf "${BUILD_PKG}".tar
fi
if [[ ! -d ${BUILD_PKG} ]]; then
git clone "${SRCURL}" --single-branch "${BUILD_PKG}"
# check version
pushd "${BUILD_PKG}"
GITVER=$(git describe --tags)
popd
if [ "${GITVER}" != "${BUILD_PKG}" ]; then
echo "${BUILD_PKG} should be updated to ${GITVER} update!"
exit 1
fi
fi
if [[ ! -e ${BUILD_PKG}.tar ]]; then
tar cf "${BUILD_PKG}".tar "${BUILD_PKG}"
fi
mkdir -pv "${PREFIX}"
cat >"${PREFIX}"/profile <<-EOF
PATH=${PREFIX}/bin:\$PATH
PKG_CONFIG_PATH=${PROJECT}/${BUILD_PKG}/lib/pkgconfig\${PKG_CONFIG_PATH:+:}\${PKG_CONFIG_PATH:-}
EOF
pushd "${BUILD_PKG}"
local _cflags=(
-march=native
-Wno-discarded-qualifiers
-Wno-maybe-uninitialized
)
local _conf=(
--prefix "${PREFIX}"
--buildtype=debugoptimized
--pkg-config-path="${PKG_CONFIG_PATH}"
)
CFLAGS="${_cflags[*]}" meson setup "${_conf[@]}" builddir
meson install -C builddir
popd
}
pushd "${BUILD_DIR}"
B_UNPAPER
popd
}