Skip to content

Commit

Permalink
add ossp-uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
pmp-p committed Jul 31, 2024
1 parent 4cafaae commit 4a07822
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python-wasi-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ END
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
export PS1="[PyDK:wasi] \[\e[32m\]\w \[\e[91m\]\$(parse_git_branch)\[\e[00m\]\$ "
export PS1="[PyDK:wasi] \[\e[32m\]\w \[\e[91m\]\$(parse_git_branch)\[\e[00m\]\$ "
END
chmod +x ${SDKROOT}/python3-wasi ${SDKROOT}/wasm32-wasi-shell.sh
Expand Down
2 changes: 1 addition & 1 deletion python-wasm-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ END
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
export PS1="[PyDK:wasi] \[\e[32m\]\w \[\e[91m\]\$(parse_git_branch)\[\e[00m\]\$ "
export PS1="[PyDK:wasi] \[\e[32m\]\w \[\e[91m\]\$(parse_git_branch)\[\e[00m\]\$ "
END
chmod +x ${SDKROOT}/python3-wasi ${SDKROOT}/wasm32-wasi-shell.sh
Expand Down
4 changes: 4 additions & 0 deletions scripts/emsdk-fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ END
export PKG_CONFIG_SYSROOT_DIR="${SDKROOT}/devices/emsdk"
export PKG_CONFIG_LIBDIR="${SDKROOT}/emsdk/upstream/emscripten/system/lib/pkgconfig"
export PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig:${HOST_PREFIX}/lib/pkgconfig"
export EM_PKG_CONFIG_PATH=$PKG_CONFIG_PATH

if echo $PATH|grep -q $EMSDK/upstream/emscripten/system/bin
then
Expand All @@ -489,6 +490,9 @@ END
export PATH=$EMSDK/upstream/emscripten/system/bin:$EMSDK/upstream/emscripten:$PATH
fi

#ln $EMSDK/upstream/emscripten/emstrip $EMSDK/upstream/emscripten/strip
#ln $EMSDK/upstream/emscripten/emstrip.py $EMSDK/upstream/emscripten/strip.py

mkdir -p ${SDKROOT}/devices/$(arch)/usr/bin/
cp $SDKROOT/wasisdk/bin/wasm-objdump* ${SDKROOT}/devices/$(arch)/usr/bin/

Expand Down
2 changes: 2 additions & 0 deletions sources.wasm/libicu.sh → sources.wasm/libxml2-libicu.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

. ${CONFIG:-config}

. scripts/emsdk-fetch.sh

cd ${ROOT}/src
Expand Down
2 changes: 2 additions & 0 deletions sources.wasm/libxml2.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

. ${CONFIG:-config}

. scripts/emsdk-fetch.sh


Expand Down
56 changes: 56 additions & 0 deletions sources.wasm/uuid-ossp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash

. ${CONFIG:-config}

. scripts/emsdk-fetch.sh

cd ${ROOT}/src

if [ -d icu ]
then
echo ok
else
wget -c http://www.mirrorservice.org/sites/ftp.ossp.org/pkg/lib/uuid/uuid-1.6.2.tar.gz
tar xfz uuid-1.6.2.tar.gz
fi

if [ -f $PREFIX/lib/libossp-uuid.a ]
then
echo "
already built in $PREFIX/lib/
"
else

mkdir -p $ROOT/build/libuuid
cat > config.site <<END
ac_cv_prog_ac_ct_STRIP=/bin/true
ac_cv_prog_STRIP=/bin/true
END
pushd $ROOT/build/libuuid
mkdir -p bin
ln -sf /bin/true bin/strip
export PATH=$(pwd)/bin:$PATH
if STRIP=/bin/true CONFIG_SITE=config.site emconfigure ../../src/uuid-1.6.2/configure --with-gnu-ld --with-pic --disable-shared --prefix=$PREFIX
then
emmake make
sed -i 's|luuid|lossp-uuid|g' uuid.pc
cp uuid.pc ../../src/uuid-1.6.2/
echo "------ installing uuid ---------"
emmake make install
mkdir -p $EMSDK/upstream/emscripten/cache/sysroot/include/ossp
mv $PREFIX/include/uuid.h $EMSDK/upstream/emscripten/cache/sysroot/include/ossp/
cp -r $EMSDK/upstream/emscripten/cache/sysroot/include/ossp $PREFIX/include/
mv $PREFIX/lib/libuuid.a $PREFIX/lib/libossp-uuid.a
cp $PREFIX/lib/libossp-uuid.a $EMSDK/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/
rm $PREFIX/lib/libuuid.la
else
echo "
failed to build uuid-ossp
"
exit 44
fi
popd
fi

0 comments on commit 4a07822

Please sign in to comment.