From 3570e7ec3268987380115b789c12d4d4841120a8 Mon Sep 17 00:00:00 2001 From: Thorsten Beier Date: Wed, 10 Jul 2024 13:45:11 +0200 Subject: [PATCH] wasm-git (#1179) * wasm-git draft * .. * install --- recipes/recipes_emscripten/wasm-git/build.sh | 29 ++++++++++++++ .../recipes_emscripten/wasm-git/recipe.yaml | 39 +++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 recipes/recipes_emscripten/wasm-git/build.sh create mode 100644 recipes/recipes_emscripten/wasm-git/recipe.yaml diff --git a/recipes/recipes_emscripten/wasm-git/build.sh b/recipes/recipes_emscripten/wasm-git/build.sh new file mode 100644 index 000000000..1ce20accc --- /dev/null +++ b/recipes/recipes_emscripten/wasm-git/build.sh @@ -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 diff --git a/recipes/recipes_emscripten/wasm-git/recipe.yaml b/recipes/recipes_emscripten/wasm-git/recipe.yaml new file mode 100644 index 000000000..bf58aa349 --- /dev/null +++ b/recipes/recipes_emscripten/wasm-git/recipe.yaml @@ -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 \ No newline at end of file