diff --git a/.gitignore b/.gitignore index bade6d8b3da5e3e54693addfd5ba1ac7cc31a051..94e928d681b452d3d24e1cd325da9ff0d4482468 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ build repo +source +source.tar stage stage.tar diff --git a/cook.sh b/cook.sh index 6736008f1b853ea05696eb6e9956c860bf883339..9a20c173aea9b21da5616a3cacca441207e5ac93 100755 --- a/cook.sh +++ b/cook.sh @@ -48,19 +48,45 @@ function op { op $1 unfetch ;; fetch) - if [ ! -d build ] + if [ -n "$TAR" ] then - git clone --recursive "$GIT" build + if [ ! -f source.tar ] + then + wget "$TAR" -O source.tar + fi + + if [ ! -d source ] + then + mkdir source + tar xvf source.tar -C source --strip-components 1 + fi + + rm -rf build + cp -r source build + elif [ -n "$GIT" ] + then + if [ ! -d source ] + then + git clone --recursive "$GIT" source + fi + + pushd source > /dev/null + git pull + git submodule sync + git submodule update --init --recursive + popd > /dev/null + + rm -rf build + cp -r source build fi - pushd build > /dev/null - git pull - git submodule sync - git submodule update --init --recursive - popd > /dev/null ;; unfetch) - rm -rfv build + rm -rfv build source + if [ -n "$TAR" ] + then + rm -f source.tar + fi ;; version) pushd build > /dev/null diff --git a/recipes/lua/recipe.sh b/recipes/lua/recipe.sh new file mode 100644 index 0000000000000000000000000000000000000000..453c9e04910ffc84d437119a257508cabb559e9f --- /dev/null +++ b/recipes/lua/recipe.sh @@ -0,0 +1,33 @@ +VERSION=5.3.1 +TAR=http://www.lua.org/ftp/lua-$VERSION.tar.gz + +function recipe_version { + echo "$VERSION" + return 1 +} + +function recipe_update { + echo "skipping update" + return 1 +} + +function recipe_build { + make generic CC="$CC -std=gnu99" + return 1 +} + +function recipe_test { + echo "skipping test" + return 1 +} + +function recipe_clean { + make clean + return 1 +} + +function recipe_stage { + mkdir -pv "$1/bin" + cp src/lua src/luac "$1/bin" + return 1 +}