Skip to content

Commit

Permalink
[Build] Add env variables for pipy build. (flomesh-io#27)
Browse files Browse the repository at this point in the history
* [Build] Add env variables for pipy build.

Co-authored-by: Kevein Liu <kevein@flomesh.cn>
  • Loading branch information
khas-flomesh and keveinliu authored Oct 14, 2021
1 parent cd7ca96 commit 66d6366
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ RUN rm -fr pipy/build \
&& mkdir pipy/build \
&& cd pipy/gui \
&& npm install \
&& npm run build \
&& cd ../build \
&& cmake -DCMAKE_BUILD_TYPE=Release .. \
&& cmake -DPIPY_GUI=OFF -DPIPY_TUTORIAL=ON -DCMAKE_BUILD_TYPE=Release .. \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& mkdir ${pkg_confdir} \
&& cp /pipy/bin/pipy ${pkg_bindir} \
Expand Down
7 changes: 5 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

##### Default environment variables #########
PIPY_CONF=pipy.cfg
PIPY_CONF=pipy.js

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
PIPY_DIR=$(dirname $(readlink -e $(basename $0)))
Expand Down Expand Up @@ -34,6 +34,9 @@ TEST_CASE=all
IMAGE_TAG=${IMAGE_TAG:-latest}
DOCKERFILE=${DOCKERFILE:-Dockerfile}

PIPY_GUI=${PIPY_GUI:-OFF}
PIPY_TUTORIAL=${PIPY_TUTORIAL:-ON}

##### End Default environment variables #########

SHORT_OPTS="bthcr:p:"
Expand Down Expand Up @@ -140,7 +143,7 @@ function build() {
mkdir ${PIPY_DIR}/build 2>&1 > /dev/null || true
rm -fr ${PIPY_DIR}/build/*
cd ${PIPY_DIR}/build
$CMAKE -DPIPY_GUI=ON -DCMAKE_BUILD_TYPE=Release $PIPY_DIR
$CMAKE -DPIPY_GUI=${PIPY_GUI} -DPIPY_TUTORIAL=${PIPY_TUTORIAL} -DCMAKE_BUILD_TYPE=Release $PIPY_DIR
make -j${__NPROC}
if [ $? -eq 0 ];then
echo "pipy now is in ${PIPY_DIR}/bin"
Expand Down
3 changes: 2 additions & 1 deletion rpm/pipy.spec
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ rm -fr pipy/build
%{__mkdir} pipy/build
cd pipy/gui
npm install
npm run build
cd ../build
CXX=clang++ CC=clang cmake3 -DCMAKE_BUILD_TYPE=Release ..
CXX=clang++ CC=clang cmake3 -DPIPY_GUI=OFF -DPIPY_TUTORIAL=ON -DCMAKE_BUILD_TYPE=Release ..
make -j$(getconf _NPROCESSORS_ONLN)

%preun
Expand Down

0 comments on commit 66d6366

Please sign in to comment.