Skip to content

Commit

Permalink
wasm-git (#1179)
Browse files Browse the repository at this point in the history
* wasm-git draft

* ..

* install
  • Loading branch information
DerThorsten authored Jul 10, 2024
1 parent e370354 commit 3570e7e
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
29 changes: 29 additions & 0 deletions recipes/recipes_emscripten/wasm-git/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash



curl -L https://github.com/libgit2/libgit2/archive/refs/tags/v1.7.1.tar.gz --output libgit2.tar.gz
tar -xzf libgit2.tar.gz
mv libgit2-1.7.1 libgit2
rm libgit2.tar.gz
rm libgit2/src/libgit2/transports/http.c
cp -r libgit2patchedfiles/examples/* libgit2/examples/
cp -r libgit2patchedfiles/src/* libgit2/src/libgit2/
echo 'set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=gnu90")' >> libgit2/examples/CMakeLists.txt
echo 'set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=gnu90")' >> libgit2/src/libgit2/CMakeLists.txt
echo 'set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=gnu90")' >> libgit2/src/util/CMakeLists.txt
# sed -i 's/GIT_PACK_FILE_MODE 0444/GIT_PACK_FILE_MODE 0644/g' libgit2/src/libgit2/pack.h
sed -i -e 's/GIT_PACK_FILE_MODE 0444/GIT_PACK_FILE_MODE 0644/g' libgit2/src/libgit2/pack.h
sed -i -e 's/GIT_OBJECT_FILE_MODE 0444/GIT_OBJECT_FILE_MODE 0644/g' libgit2/src/libgit2/odb.h

cd emscriptenbuild

# run the ./build.sh script
./build.sh Release
./build.sh Release-async

mkdir -p $PREFIX/bin
cp libgit2/examples/lg2.js $PREFIX/bin/lg2.js
cp libgit2/examples/lg2.wasm $PREFIX/bin/lg2.wasm
cp libgit2/examples/lg2_async.js $PREFIX/bin/lg2_async.js
cp libgit2/examples/lg2_async.wasm $PREFIX/bin/lg2_async.wasm
39 changes: 39 additions & 0 deletions recipes/recipes_emscripten/wasm-git/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
context:
version: 0.0.13

package:
name: wasm-git
version: ${{ version }}


source:
git: https://github.com/petersalomonsen/wasm-git
rev: 7236b20f1848f239337cf6721f3b6befe64f9d08


build:
number: 0

requirements:
build:
- ${{ compiler("cxx") }}
- cmake
- make
- pkg-config


tests:

- script:
- test -f $PREFIX/bin/lg2.js
- test -f $PREFIX/bin/lg2.wasm
- test -f $PREFIX/bin/lg2_async.js
- test -f $PREFIX/bin/lg2_async.wasm


about:
license_file: COPYING

extra:
recipe-maintainers:
- DerThorsten

0 comments on commit 3570e7e

Please sign in to comment.