Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: bzip2 build script default using tarball #95

Merged
merged 1 commit into from
Dec 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 37 additions & 15 deletions scripts/build.d/bzip2
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,45 @@

set -e

pkgname=bzip2
pkgbranch=${VERSION:-master}
pkgfull=$pkgname-$pkgbranch
if [ -z "${SYNCGIT}" ]; then
pkgname=bzip2
pkgver=${VERSION:-1.0.8}
pkgfull=${pkgname}-${pkgver}
pkgfn=${pkgname}-${pkgfull}.zip
pkgurl=https://gitlab.com/bzip2/bzip2/-/archive/${pkgfull}/${pkgfn}

syncgit https://gitlab.com/bzip2 ${pkgname} ${pkgbranch} ${pkgfull}
download_md5 ${pkgfn} ${pkgurl} 1e9f8675b1346c4a00251cb2dae05c9e

pushd ${DEVENVFLAVORROOT}/${DEVENVFLAVOR}/src/${pkgfull} > /dev/null
mkdir -p build
pushd build > /dev/null
cmakecmd=("cmake")
cmakecmd+=("-DCMAKE_INSTALL_PREFIX=${DEVENVPREFIX}")
cmakecmd+=("-DENABLE_SHARED_LIB=ON")
cmakecmd+=("../")
mkdir -p ${DEVENVFLAVORROOT}/${DEVENVFLAVOR}/src
pushd ${DEVENVFLAVORROOT}/${DEVENVFLAVOR}/src
unzip ${DEVENVDLROOT}/${pkgfn}
pushd "${pkgname}-${pkgfull}" > /dev/null
# Added -fPIC into bzip2 CLFAGS
sed -i "s/CFLAGS=-Wall*/CFLAGS=-fPIC -Wall/1" Makefile
Copy link
Collaborator Author

@j8xixo12 j8xixo12 Dec 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using sed to modify CFLAGS in bzip2’ Makefile, added -fPIC into gcc compile option, then bzip2 static library can be used by python.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful!

INSTALL_PREFIX=${DEVENVPREFIX}
buildcmd make.log make -j ${NP}
buildcmd make.log make clean
buildcmd make.log make install PREFIX=${INSTALL_PREFIX} -j ${NP}
popd > /dev/null
popd > /dev/null
else
pkgname=bzip2
pkgbranch=${VERSION:-master}
pkgfull=$pkgname-$pkgbranch

buildcmd cmake.log "${cmakecmd[@]}"
buildcmd make.log make -j ${NP}
buildcmd install.log make install
syncgit https://gitlab.com/bzip2 ${pkgname} ${pkgbranch} ${pkgfull}
pushd ${DEVENVFLAVORROOT}/${DEVENVFLAVOR}/src/${pkgfull} > /dev/null
mkdir -p build
pushd build > /dev/null
cmakecmd=("cmake")
cmakecmd+=("-DCMAKE_INSTALL_PREFIX=${DEVENVPREFIX}")
cmakecmd+=("-DENABLE_SHARED_LIB=ON")
cmakecmd+=("../")

buildcmd cmake.log "${cmakecmd[@]}"
buildcmd make.log make -j ${NP}
buildcmd install.log make install
popd > /dev/null
popd > /dev/null
popd > /dev/null
fi
# vim: set et nobomb ft=bash ff=unix fenc=utf8: