From 510e77dacdcd351aaa8da914e203dbf4ef8f10ff Mon Sep 17 00:00:00 2001 From: Jeremy Soller <jackpot51@gmail.com> Date: Tue, 12 Dec 2023 19:43:55 -0700 Subject: [PATCH] freeglut: convert to toml, move to wip --- recipes/libs/freeglut/recipe.sh | 34 ------------- .../libs/freeglut/redox_cross_toolchain.cmake | 1 - recipes/wip/freeglut/recipe.toml | 49 +++++++++++++++++++ 3 files changed, 49 insertions(+), 35 deletions(-) delete mode 100644 recipes/libs/freeglut/recipe.sh delete mode 100644 recipes/libs/freeglut/redox_cross_toolchain.cmake create mode 100644 recipes/wip/freeglut/recipe.toml diff --git a/recipes/libs/freeglut/recipe.sh b/recipes/libs/freeglut/recipe.sh deleted file mode 100644 index b9e4b08b2..000000000 --- a/recipes/libs/freeglut/recipe.sh +++ /dev/null @@ -1,34 +0,0 @@ -TAR=https://cytranet.dl.sourceforge.net/project/freeglut/freeglut/3.0.0/freeglut-3.0.0.tar.gz - -BUILD_DEPENDS=(mesa mesa-glu) - -function recipe_version { - echo "3.0.0" - skip=1 -} - -function recipe_build { - sysroot="$(realpath ../sysroot)" - export CFLAGS="-I$sysroot/include" - export CPPFLAGS="-I$sysroot/include" - export LDFLAGS="-L$sysroot/lib" - cmake \ - -D CMAKE_TOOLCHAIN_FILE=../redox_cross_toolchain.cmake \ - -D CMAKE_INSTALL_PREFIX=/ \ - -D FREEGLUT_GLES=0 \ - . - #./configure --host="${HOST}" --prefix=/ --enable-osmesa - "$REDOX_MAKE" -j"$($NPROC)" - skip=1 -} - -function recipe_clean { - "$REDOX_MAKE" clean - skip=1 -} - -function recipe_stage { - dest="$(realpath $1)" - "$REDOX_MAKE" DESTDIR="$dest" install - skip=1 -} diff --git a/recipes/libs/freeglut/redox_cross_toolchain.cmake b/recipes/libs/freeglut/redox_cross_toolchain.cmake deleted file mode 100644 index d2a3fb7b6..000000000 --- a/recipes/libs/freeglut/redox_cross_toolchain.cmake +++ /dev/null @@ -1 +0,0 @@ -SET(CMAKE_SYSTEM_NAME Redox) diff --git a/recipes/wip/freeglut/recipe.toml b/recipes/wip/freeglut/recipe.toml new file mode 100644 index 000000000..cda382521 --- /dev/null +++ b/recipes/wip/freeglut/recipe.toml @@ -0,0 +1,49 @@ +[source] +tar = "https://cytranet.dl.sourceforge.net/project/freeglut/freeglut/3.0.0/freeglut-3.0.0.tar.gz" +blake3 = "08c8874d6ddad5be4860813865d4d4e2a84c294da0f3cf82a29e43920806b0da" + +[build] +dependencies = [ + "mesa", + "mesa-glu", +] +template = "custom" +script = """ +export CFLAGS="-I${COOKBOOK_SYSROOT}/include" +export CPPFLAGS="-I${COOKBOOK_SYSROOT}/include" +export CXXFLAGS="-I${COOKBOOK_SYSROOT}/include" +export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib" + +cat > redox.cmake <<EOF +# the name of the target operating system +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR "${TARGET%%-*}") + +# which compilers to use for C and C++ +set(CMAKE_C_COMPILER "${TARGET}-gcc") +set(CMAKE_CXX_COMPILER "${TARGET}-g++") + +# where is the target environment located +set(CMAKE_FIND_ROOT_PATH "${COOKBOOK_SYSROOT}") + +# adjust the default behavior of the FIND_XXX() commands: +# search programs in the host environment +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + +# search headers, libraries, and packages in the target environment +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) +EOF + +COOKBOOK_CONFIGURE=cmake +COOKBOOK_CONFIGURE_FLAGS=( + -DCMAKE_BUILD_TYPE=Release + -DCMAKE_INSTALL_PREFIX=/ + -DCMAKE_TOOLCHAIN_FILE=redox.cmake + -DCMAKE_VERBOSE_MAKEFILE=On + -DFREEGLUT_GLES=0 + "${COOKBOOK_SOURCE}" +) +cookbook_configure +""" -- GitLab