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 62 lines (46 sloc) 1.16 KB
#!/bin/bash
{
set -x
set -e
set -u
. build.profile
. ${PREFIX}/${BUILD_python}/profile
function B_PNGQUANT {
BUILD_PKG=${BUILD_pngquant}
PREFIX=${PREFIX}/${BUILD_PKG}
if [ ! -d ${BUILD_pngquant} ]; then
if [ ! -e ${BUILD_pngquant}.tar ]; then
git clone --recursive https://github.com/kornelski/pngquant.git --single-branch ${BUILD_pngquant}
pushd ${BUILD_pngquant}
GITVER=$(git describe --tags)
popd
if [ "${GITVER}" != "${BUILD_pngquant##pngquant-}" ]; then
echo "${GITVER} should be ${BUILD_pngquant}. update!"
exit 1
fi
tar cf ${BUILD_pngquant}.tar ${BUILD_pngquant}
else
tar -xf ${BUILD_pngquant}.tar
fi
fi
if [ ! -d ${PREFIX} ]; then
git clone ${BUILD_pngquant} $PREFIX
else
pushd ${PREFIX}
git pull origin
popd
fi
cat >$PREFIX/profile <<-EOF
PATH=$PREFIX/bin:\$PATH
PKG_CONFIG_PATH=${PROJECT}/${BUILD_PKG}/lib/pkgconfig\${PKG_CONFIG_PATH:+:}\${PKG_CONFIG_PATH:-}
EOF
cd ${BUILD_PKG}
local _conf=(
--release
)
[ -d /usr/local/package/bin ] && PATH=${PATH}:/usr/local/package/bin
CARGO_HOME=.cargo cargo build "${_conf[@]}"
install -v -Dm0755 ./target/release/pngquant $PREFIX/bin/pngquant
}
B_PNGQUANT
}