Compare commits
No commits in common. "83e5cb81e83a4375460c411a42cd199a62041e14" and "9355ab1656232bfecd99fa5c0b7e2cd137795a5e" have entirely different histories.
83e5cb81e8
...
9355ab1656
|
|
@ -3,4 +3,3 @@
|
||||||
build/
|
build/
|
||||||
base/
|
base/
|
||||||
script/fakeroot-context
|
script/fakeroot-context
|
||||||
tools/update-image-perms
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ DOWNLOAD_URL="https://github.com/libsdl-org/SDL/releases/download/release-$VERSI
|
||||||
DEPENDENCIES=('mesa' 'libiconv')
|
DEPENDENCIES=('mesa' 'libiconv')
|
||||||
|
|
||||||
configure() {
|
configure() {
|
||||||
cmake --fresh -S . -B build -G Ninja \
|
$BANAN_CMAKE --fresh -S . -B build -G Ninja \
|
||||||
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
||||||
-DCMAKE_INSTALL_PREFIX='/usr' \
|
-DCMAKE_INSTALL_PREFIX='/usr' \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
|
@ -16,9 +16,9 @@ configure() {
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cmake --build build || exit 1
|
$BANAN_CMAKE --build build || exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
cmake --install build || exit 1
|
$BANAN_CMAKE --install build || exit 1
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ DOWNLOAD_URL="https://github.com/libsdl-org/SDL_image/releases/download/release-
|
||||||
DEPENDENCIES=('SDL2' 'libpng' 'libjpeg' 'libtiff' 'libwebp')
|
DEPENDENCIES=('SDL2' 'libpng' 'libjpeg' 'libtiff' 'libwebp')
|
||||||
|
|
||||||
configure() {
|
configure() {
|
||||||
cmake --fresh -S . -B build -G Ninja \
|
$BANAN_CMAKE --fresh -S . -B build -G Ninja \
|
||||||
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
||||||
-DCMAKE_INSTALL_PREFIX='/usr' \
|
-DCMAKE_INSTALL_PREFIX='/usr' \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
|
@ -15,9 +15,9 @@ configure() {
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cmake --build build || exit 1
|
$BANAN_CMAKE --build build || exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
cmake --install build || exit 1
|
$BANAN_CMAKE --install build || exit 1
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ DOWNLOAD_URL="https://github.com/libsdl-org/SDL_mixer/releases/download/release-
|
||||||
DEPENDENCIES=('SDL2' 'timidity')
|
DEPENDENCIES=('SDL2' 'timidity')
|
||||||
|
|
||||||
configure() {
|
configure() {
|
||||||
cmake --fresh -S . -B build -G Ninja \
|
$BANAN_CMAKE --fresh -S . -B build -G Ninja \
|
||||||
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
||||||
-DCMAKE_INSTALL_PREFIX='/usr' \
|
-DCMAKE_INSTALL_PREFIX='/usr' \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
|
@ -19,9 +19,9 @@ configure() {
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cmake --build build || exit 1
|
$BANAN_CMAKE --build build || exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
cmake --install build || exit 1
|
$BANAN_CMAKE --install build || exit 1
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,11 @@ TAR_CONTENT="SuperTux-v$VERSION-Source"
|
||||||
DEPENDENCIES=('boost' 'SDL2' 'SDL2_image' 'curl' 'openal-soft' 'libvorbis' 'freetype' 'physfs' 'glm')
|
DEPENDENCIES=('boost' 'SDL2' 'SDL2_image' 'curl' 'openal-soft' 'libvorbis' 'freetype' 'physfs' 'glm')
|
||||||
|
|
||||||
configure() {
|
configure() {
|
||||||
cmake --fresh -B build -S . -G Ninja \
|
mkdir -p build
|
||||||
|
pushd build
|
||||||
|
$BANAN_CMAKE \
|
||||||
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
||||||
|
-G Ninja --fresh .. \
|
||||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DINSTALL_SUBDIR_BIN=bin \
|
-DINSTALL_SUBDIR_BIN=bin \
|
||||||
|
|
@ -16,13 +19,14 @@ configure() {
|
||||||
-DENABLE_OPENGL=OFF \
|
-DENABLE_OPENGL=OFF \
|
||||||
-DENABLE_BOOST_STATIC_LIBS=ON \
|
-DENABLE_BOOST_STATIC_LIBS=ON \
|
||||||
|| exit 1
|
|| exit 1
|
||||||
|
popd
|
||||||
# crashes in `std::ostream::sentry::sentry(std::ostream&)` with shared boost
|
# crashes in `std::ostream::sentry::sentry(std::ostream&)` with shared boost
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cmake --build build || exit 1
|
$BANAN_CMAKE --build build || exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
cmake --install build || exit 1
|
$BANAN_CMAKE --install build || exit 1
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ TAR_CONTENT="SuperTuxKart-$VERSION-src"
|
||||||
DEPENDENCIES=('SDL2' 'curl' 'openal-soft' 'freetype' 'harfbuzz' 'libvorbis' 'libjpeg' 'libpng' 'zlib')
|
DEPENDENCIES=('SDL2' 'curl' 'openal-soft' 'freetype' 'harfbuzz' 'libvorbis' 'libjpeg' 'libpng' 'zlib')
|
||||||
|
|
||||||
configure() {
|
configure() {
|
||||||
cmake --fresh -B build -S . -G Ninja \
|
$BANAN_CMAKE -B build -S . -G Ninja --fresh \
|
||||||
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
||||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
|
@ -20,9 +20,9 @@ configure() {
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cmake --build build || exit 1
|
$BANAN_CMAKE --build build || exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
cmake --install build || exit 1
|
$BANAN_CMAKE --install build || exit 1
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,9 @@ DOWNLOAD_URL="https://github.com/Kitware/CMake/releases/download/v$VERSION/cmake
|
||||||
DEPENDENCIES=('openssl' 'libuv' 'make' 'bash')
|
DEPENDENCIES=('openssl' 'libuv' 'make' 'bash')
|
||||||
|
|
||||||
configure() {
|
configure() {
|
||||||
cmake --fresh -B build -S . -G Ninja \
|
$BANAN_CMAKE \
|
||||||
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
||||||
|
-B build -GNinja --fresh \
|
||||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||||
-DCMAKE_USE_OPENSSL=ON \
|
-DCMAKE_USE_OPENSSL=ON \
|
||||||
-DCMAKE_USE_SYSTEM_LIBUV=ON \
|
-DCMAKE_USE_SYSTEM_LIBUV=ON \
|
||||||
|
|
@ -17,10 +18,10 @@ configure() {
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cmake --build build || exit 1
|
$BANAN_CMAKE --build build || exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
cmake --install build || exit 1
|
$BANAN_CMAKE --install build || exit 1
|
||||||
cp $BANAN_TOOLCHAIN_DIR/cmake-platform/* $BANAN_SYSROOT/usr/share/cmake-3.26/Modules/Platform/
|
cp $BANAN_TOOLCHAIN_DIR/cmake-platform/* $BANAN_SYSROOT/usr/share/cmake-3.26/Modules/Platform/
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,9 @@ VERSION='1.0.2'
|
||||||
DOWNLOAD_URL="https://github.com/g-truc/glm/archive/refs/tags/$VERSION.tar.gz#19edf2e860297efab1c74950e6076bf4dad9de483826bc95e2e0f2c758a43f65"
|
DOWNLOAD_URL="https://github.com/g-truc/glm/archive/refs/tags/$VERSION.tar.gz#19edf2e860297efab1c74950e6076bf4dad9de483826bc95e2e0f2c758a43f65"
|
||||||
|
|
||||||
configure() {
|
configure() {
|
||||||
cmake --fresh -B build -S . -G Ninja \
|
$BANAN_CMAKE \
|
||||||
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
||||||
|
-B build -G Ninja --fresh . \
|
||||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DGLM_BUILD_TESTS=OFF \
|
-DGLM_BUILD_TESTS=OFF \
|
||||||
|
|
@ -14,9 +15,9 @@ configure() {
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cmake --build build || exit 1
|
$BANAN_CMAKE --build build || exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
cmake --install build || exit 1
|
$BANAN_CMAKE --install build || exit 1
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,17 +6,18 @@ DOWNLOAD_URL="https://dist.libuv.org/dist/v$VERSION/libuv-v$VERSION.tar.gz#5f055
|
||||||
TAR_CONTENT="libuv-v$VERSION"
|
TAR_CONTENT="libuv-v$VERSION"
|
||||||
|
|
||||||
configure() {
|
configure() {
|
||||||
cmake --fresh -B build -S . -G Ninja \
|
$BANAN_CMAKE \
|
||||||
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
||||||
|
-B build -GNinja --fresh \
|
||||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||||
-DBUILD_TESTING=OFF \
|
-DBUILD_TESTING=OFF \
|
||||||
. || exit 1
|
. || exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cmake --build build || exit 1
|
$BANAN_CMAKE --build build || exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
cmake --install build || exit 1
|
$BANAN_CMAKE --install build || exit 1
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ DEPENDENCIES=('zlib' 'zstd')
|
||||||
configure() {
|
configure() {
|
||||||
unset CC CXX LD
|
unset CC CXX LD
|
||||||
|
|
||||||
cmake --fresh -B build -S llvm -G Ninja \
|
$BANAN_CMAKE -B build -S llvm -G Ninja \
|
||||||
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||||
|
|
@ -24,7 +24,7 @@ configure() {
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cmake --build build || exit 1
|
$BANAN_CMAKE --build build || exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
|
|
|
||||||
|
|
@ -16,24 +16,15 @@ CONFIGURE_OPTIONS=(
|
||||||
|
|
||||||
pre_configure() {
|
pre_configure() {
|
||||||
llvm_version='20.1.8'
|
llvm_version='20.1.8'
|
||||||
llvm_dir_name="llvm-banan_os-$llvm_version-$BANAN_ARCH"
|
llvm_root="$(realpath ../../llvm)/llvm-$llvm_version-$BANAN_ARCH"
|
||||||
|
llvm_lib="$llvm_root/build/lib"
|
||||||
|
|
||||||
if [ ! -d "../$llvm_dir_name" ]; then
|
if [ ! -d "$llvm_lib" ]; then
|
||||||
pushd ..
|
pushd ../../llvm >/dev/null || exit 1
|
||||||
|
./build.sh || exit 1
|
||||||
if [ ! -f "$llvm_dir_name.tar.gz" ]; then
|
popd >/dev/null
|
||||||
wget "https://bananymous.com/files/$llvm_dir_name.tar.gz" || exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tar xf "$llvm_dir_name.tar.gz" || exit 1
|
|
||||||
|
|
||||||
popd
|
|
||||||
fi
|
|
||||||
|
|
||||||
llvm_abs_path=$(realpath ../$llvm_dir_name || exit 1)
|
|
||||||
llvm_abs_lib="$llvm_abs_path/lib"
|
|
||||||
llvm_abs_inc="$llvm_abs_path/include"
|
|
||||||
|
|
||||||
mkdir -p subprojects/llvm
|
mkdir -p subprojects/llvm
|
||||||
|
|
||||||
wrap_file='subprojects/llvm/meson.build'
|
wrap_file='subprojects/llvm/meson.build'
|
||||||
|
|
@ -42,9 +33,9 @@ pre_configure() {
|
||||||
echo "cpp = meson.get_compiler('cpp')" >>$wrap_file
|
echo "cpp = meson.get_compiler('cpp')" >>$wrap_file
|
||||||
echo "" >>$wrap_file
|
echo "" >>$wrap_file
|
||||||
echo "_deps = []" >>$wrap_file
|
echo "_deps = []" >>$wrap_file
|
||||||
echo "_search = '$llvm_abs_lib'" >>$wrap_file
|
echo "_search = '$llvm_lib'" >>$wrap_file
|
||||||
echo "foreach d : [" >>$wrap_file
|
echo "foreach d : [" >>$wrap_file
|
||||||
for path in $llvm_abs_lib/libLLVM*.a; do
|
for path in $llvm_lib/libLLVM*.a; do
|
||||||
name=$(basename $path)
|
name=$(basename $path)
|
||||||
echo " '${name:3:-2}'," >>$wrap_file
|
echo " '${name:3:-2}'," >>$wrap_file
|
||||||
done
|
done
|
||||||
|
|
@ -54,7 +45,8 @@ pre_configure() {
|
||||||
echo "" >>$wrap_file
|
echo "" >>$wrap_file
|
||||||
echo "dep_llvm = declare_dependency(" >>$wrap_file
|
echo "dep_llvm = declare_dependency(" >>$wrap_file
|
||||||
echo " include_directories : include_directories(" >>$wrap_file
|
echo " include_directories : include_directories(" >>$wrap_file
|
||||||
echo " '$llvm_abs_inc'," >>$wrap_file
|
echo " '$llvm_root/llvm/include'," >>$wrap_file
|
||||||
|
echo " '$llvm_root/build/include'," >>$wrap_file
|
||||||
echo " )," >>$wrap_file
|
echo " )," >>$wrap_file
|
||||||
echo " dependencies : _deps," >>$wrap_file
|
echo " dependencies : _deps," >>$wrap_file
|
||||||
echo " version : '$llvm_version'," >>$wrap_file
|
echo " version : '$llvm_version'," >>$wrap_file
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ DOWNLOAD_URL="https://github.com/kcat/openal-soft/archive/refs/tags/$VERSION.tar
|
||||||
DEPENDENCIES=('SDL2' 'zlib' 'libsndfile')
|
DEPENDENCIES=('SDL2' 'zlib' 'libsndfile')
|
||||||
|
|
||||||
configure() {
|
configure() {
|
||||||
cmake --fresh -B build -S . -G Ninja \
|
$BANAN_CMAKE -B build -S . -G Ninja --fresh \
|
||||||
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
||||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
|
@ -17,9 +17,9 @@ configure() {
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cmake --build build || exit 1
|
$BANAN_CMAKE --build build || exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
cmake --install build || exit 1
|
$BANAN_CMAKE --install build || exit 1
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,9 @@ DOWNLOAD_URL="https://github.com/icculus/physfs/archive/refs/tags/release-$VERSI
|
||||||
TAR_CONTENT="physfs-release-$VERSION"
|
TAR_CONTENT="physfs-release-$VERSION"
|
||||||
|
|
||||||
configure() {
|
configure() {
|
||||||
cmake --fresh -B build -S . -G Ninja \
|
$BANAN_CMAKE \
|
||||||
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
||||||
|
-B build -G Ninja --fresh . \
|
||||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DPHYSFS_BUILD_TEST=ON \
|
-DPHYSFS_BUILD_TEST=ON \
|
||||||
|
|
@ -16,9 +17,9 @@ configure() {
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cmake --build build || exit 1
|
$BANAN_CMAKE --build build || exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
cmake --install build || exit 1
|
$BANAN_CMAKE --install build || exit 1
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,16 +9,17 @@ DEPENDENCIES=('SDL2' 'glu')
|
||||||
configure() {
|
configure() {
|
||||||
sed -i 's/CMAKE_INSTALL_FULL_DATAROOTDIR/CMAKE_INSTALL_FULL_DATADIR/' CMakeLists.txt
|
sed -i 's/CMAKE_INSTALL_FULL_DATAROOTDIR/CMAKE_INSTALL_FULL_DATADIR/' CMakeLists.txt
|
||||||
|
|
||||||
cmake --fresh -B build -S . -G Ninja \
|
$BANAN_CMAKE \
|
||||||
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
||||||
|
--fresh -GNinja -S . -B build \
|
||||||
-DCMAKE_INSTALL_PREFIX="$BANAN_SYSROOT/usr" \
|
-DCMAKE_INSTALL_PREFIX="$BANAN_SYSROOT/usr" \
|
||||||
-DSDL2_INCLUDE_DIR="$BANAN_SYSROOT/usr/include/SDL2"
|
-DSDL2_INCLUDE_DIR="$BANAN_SYSROOT/usr/include/SDL2"
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cmake --build build || exit 1
|
$BANAN_CMAKE --build build || exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
cmake --install build || exit 1
|
$BANAN_CMAKE --install build || exit 1
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,16 +5,16 @@ VERSION='1.5.7'
|
||||||
DOWNLOAD_URL="https://github.com/facebook/zstd/releases/download/v$VERSION/zstd-$VERSION.tar.gz#eb33e51f49a15e023950cd7825ca74a4a2b43db8354825ac24fc1b7ee09e6fa3"
|
DOWNLOAD_URL="https://github.com/facebook/zstd/releases/download/v$VERSION/zstd-$VERSION.tar.gz#eb33e51f49a15e023950cd7825ca74a4a2b43db8354825ac24fc1b7ee09e6fa3"
|
||||||
|
|
||||||
configure() {
|
configure() {
|
||||||
cmake --fresh -B _build -S build/cmake -G Ninja \
|
$BANAN_CMAKE -B _build -S build/cmake -G Ninja \
|
||||||
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
||||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||||
|| exit 1
|
|| exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cmake --build _build ||exit 1
|
$BANAN_CMAKE --build _build ||exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
cmake --install _build ||exit 1
|
$BANAN_CMAKE --install _build ||exit 1
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,17 +42,9 @@ build_toolchain () {
|
||||||
$BANAN_TOOLCHAIN_DIR/build.sh
|
$BANAN_TOOLCHAIN_DIR/build.sh
|
||||||
}
|
}
|
||||||
|
|
||||||
build_tools() {
|
|
||||||
perm_tool="$BANAN_TOOLS_DIR/update-image-perms"
|
|
||||||
if [ ! -f "$perm_tool" ] || [ "$perm_tool" -ot "$perm_tool.c" ]; then
|
|
||||||
gcc -O2 -Wall -Wextra -Werror -o "$perm_tool" "$perm_tool.c" || exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
create_image () {
|
create_image () {
|
||||||
build_target all
|
build_target all
|
||||||
build_target install
|
build_target install
|
||||||
build_tools
|
|
||||||
$BANAN_SCRIPT_DIR/image.sh "$1"
|
$BANAN_SCRIPT_DIR/image.sh "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,6 @@ export BANAN_BUILD_DIR="$BANAN_ROOT_DIR/build"
|
||||||
|
|
||||||
export BANAN_PORT_DIR="$BANAN_ROOT_DIR/ports"
|
export BANAN_PORT_DIR="$BANAN_ROOT_DIR/ports"
|
||||||
|
|
||||||
export BANAN_TOOLS_DIR="$BANAN_ROOT_DIR/tools"
|
|
||||||
|
|
||||||
export BANAN_SYSROOT="$BANAN_BUILD_DIR/sysroot"
|
export BANAN_SYSROOT="$BANAN_BUILD_DIR/sysroot"
|
||||||
|
|
||||||
export BANAN_FAKEROOT="$BANAN_BUILD_DIR/fakeroot-context"
|
export BANAN_FAKEROOT="$BANAN_BUILD_DIR/fakeroot-context"
|
||||||
|
|
|
||||||
|
|
@ -20,38 +20,57 @@ if [ -z $BANAN_BUILD_DIR ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$1" == "full" ] || [ ! -f "$BANAN_DISK_IMAGE_PATH" ]; then
|
if [ "$1" == "full" ] || [ ! -f $BANAN_DISK_IMAGE_PATH ]; then
|
||||||
"$BANAN_SCRIPT_DIR/image-create.sh" || exit 1
|
$BANAN_SCRIPT_DIR/image-create.sh || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set -u
|
set -u
|
||||||
|
|
||||||
MOUNT_DIR="$BANAN_BUILD_DIR/mount"
|
MOUNT_DIR="$BANAN_BUILD_DIR/mount"
|
||||||
mkdir -p "$MOUNT_DIR"
|
mkdir -p $MOUNT_DIR
|
||||||
|
|
||||||
LOOP_DEV="$(sudo losetup --show -Pf "$BANAN_DISK_IMAGE_PATH" || exit 1)"
|
LOOP_DEV="$(sudo losetup --show -Pf $BANAN_DISK_IMAGE_PATH || exit 1)"
|
||||||
ROOT_PARTITION="${LOOP_DEV}p2"
|
ROOT_PARTITION="${LOOP_DEV}p2"
|
||||||
if [ ! -b "$ROOT_PARTITION" ]; then
|
if [ ! -b $ROOT_PARTITION ]; then
|
||||||
echo "Failed to probe partitions for banan disk image." >&2
|
echo "Failed to probe partitions for banan disk image." >&2
|
||||||
sudo losetup -d "$LOOP_DEV"
|
sudo losetup -d $LOOP_DEV
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if sudo mount "$ROOT_PARTITION" "$MOUNT_DIR"; then
|
if sudo mount $ROOT_PARTITION $MOUNT_DIR; then
|
||||||
if (($BANAN_INITRD)); then
|
if (($BANAN_INITRD)); then
|
||||||
fakeroot -i "$BANAN_FAKEROOT" tar -C "$BANAN_SYSROOT" -cf "$BANAN_SYSROOT.initrd" .
|
fakeroot -i $BANAN_FAKEROOT tar -C $BANAN_SYSROOT -cf $BANAN_SYSROOT.initrd .
|
||||||
|
|
||||||
sudo mkdir -p "$MOUNT_DIR/boot"
|
sudo mkdir -p $MOUNT_DIR/boot
|
||||||
sudo cp "$BANAN_BUILD_DIR/kernel/banan-os.kernel" "$MOUNT_DIR/boot/banan-os.kernel"
|
sudo cp $BANAN_BUILD_DIR/kernel/banan-os.kernel $MOUNT_DIR/boot/banan-os.kernel
|
||||||
sudo mv "$BANAN_SYSROOT.initrd" "$MOUNT_DIR/boot/banan-os.initrd"
|
sudo mv $BANAN_SYSROOT.initrd $MOUNT_DIR/boot/banan-os.initrd
|
||||||
else
|
else
|
||||||
sudo rsync -rulHpt "$BANAN_SYSROOT/" "$MOUNT_DIR"
|
sudo rsync -rulHpt $BANAN_SYSROOT/ $MOUNT_DIR
|
||||||
|
|
||||||
fakeroot -i "$BANAN_FAKEROOT" find "$BANAN_SYSROOT" -printf '%P|%U|%G|%04m\n' >"$BANAN_BUILD_DIR/sysroot-perms.txt"
|
fakeroot -i $BANAN_FAKEROOT find $BANAN_SYSROOT -printf './%P|%U|%G|%04m\n' >$BANAN_BUILD_DIR/sysroot-perms.txt
|
||||||
sudo "$BANAN_TOOLS_DIR/update-image-perms" "$MOUNT_DIR" "$BANAN_BUILD_DIR/sysroot-perms.txt"
|
sudo bash -c "
|
||||||
|
if enable stat &>/dev/null; then
|
||||||
|
while IFS='|' read -r path uid gid mode; do
|
||||||
|
full=\"$MOUNT_DIR/\$path\"
|
||||||
|
stat \"\$full\"
|
||||||
|
if [[ \${STAT[uid]} != \$uid ]] || [[ \${STAT[gid]} != \$gid ]] || [[ \${STAT[perms]} != \$mode ]]; then
|
||||||
|
chown -h \"\$uid:\$gid\" \"\$full\"
|
||||||
|
test ! -h \"\$full\" && chmod \"\$mode\" \"\$full\"
|
||||||
|
fi
|
||||||
|
done <$BANAN_BUILD_DIR/sysroot-perms.txt
|
||||||
|
else
|
||||||
|
while IFS='|' read -r path uid gid mode; do
|
||||||
|
full=\"$MOUNT_DIR/\$path\"
|
||||||
|
if [[ \$(stat -c '%u %g %a' \"\$full\") != \"\$uid \$gid \$mode\" ]]; then
|
||||||
|
chown -h \"\$uid:\$gid\" \"\$full\"
|
||||||
|
test ! -h \"\$full\" && chmod \"\$mode\" \"\$full\"
|
||||||
|
fi
|
||||||
|
done <$BANAN_BUILD_DIR/sysroot-perms.txt
|
||||||
|
fi
|
||||||
|
"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo umount "$MOUNT_DIR"
|
sudo umount $MOUNT_DIR
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo losetup -d "$LOOP_DEV"
|
sudo losetup -d $LOOP_DEV
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,6 @@ CMAKE_VERSION="cmake-3.26.6-linux-x86_64"
|
||||||
CMAKE_TAR="$CMAKE_VERSION.tar.gz"
|
CMAKE_TAR="$CMAKE_VERSION.tar.gz"
|
||||||
CMAKE_URL="https://cmake.org/files/v3.26/$CMAKE_TAR"
|
CMAKE_URL="https://cmake.org/files/v3.26/$CMAKE_TAR"
|
||||||
|
|
||||||
MESON_VERSION="meson-1.10.0"
|
|
||||||
MESON_TAR="$MESON_VERSION.tar.gz"
|
|
||||||
MESON_URL="https://github.com/mesonbuild/meson/releases/download/1.10.0/$MESON_TAR"
|
|
||||||
|
|
||||||
if [[ -z $BANAN_SYSROOT ]]; then
|
if [[ -z $BANAN_SYSROOT ]]; then
|
||||||
echo "You must set the BANAN_SYSROOT environment variable" >&2
|
echo "You must set the BANAN_SYSROOT environment variable" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
|
@ -72,14 +68,14 @@ enter_clean_build () {
|
||||||
}
|
}
|
||||||
|
|
||||||
build_binutils () {
|
build_binutils () {
|
||||||
|
echo "Building ${BINUTILS_VERSION}"
|
||||||
|
|
||||||
cd $BANAN_BUILD_DIR/toolchain
|
cd $BANAN_BUILD_DIR/toolchain
|
||||||
|
|
||||||
if [ ! -d $BINUTILS_VERSION ]; then
|
if [ ! -d $BINUTILS_VERSION ]; then
|
||||||
if [ ! -f $BINUTILS_TAR ]; then
|
if [ ! -f $BINUTILS_TAR ]; then
|
||||||
echo "Downloading ${BINUTILS_TAR}"
|
|
||||||
wget $BINUTILS_URL
|
wget $BINUTILS_URL
|
||||||
fi
|
fi
|
||||||
echo "Unpacking ${BINUTILS_TAR}"
|
|
||||||
tar xf $BINUTILS_TAR
|
tar xf $BINUTILS_TAR
|
||||||
patch -ruN -p1 -d "$BINUTILS_VERSION" < "$BANAN_TOOLCHAIN_DIR/$BINUTILS_VERSION.patch"
|
patch -ruN -p1 -d "$BINUTILS_VERSION" < "$BANAN_TOOLCHAIN_DIR/$BINUTILS_VERSION.patch"
|
||||||
fi
|
fi
|
||||||
|
|
@ -87,8 +83,6 @@ build_binutils () {
|
||||||
cd $BANAN_BUILD_DIR/toolchain/$BINUTILS_VERSION
|
cd $BANAN_BUILD_DIR/toolchain/$BINUTILS_VERSION
|
||||||
enter_clean_build
|
enter_clean_build
|
||||||
|
|
||||||
echo "Building ${BINUTILS_VERSION}"
|
|
||||||
|
|
||||||
../configure \
|
../configure \
|
||||||
--target="$BANAN_TOOLCHAIN_TRIPLE" \
|
--target="$BANAN_TOOLCHAIN_TRIPLE" \
|
||||||
--prefix="$BANAN_TOOLCHAIN_PREFIX" \
|
--prefix="$BANAN_TOOLCHAIN_PREFIX" \
|
||||||
|
|
@ -104,14 +98,14 @@ build_binutils () {
|
||||||
}
|
}
|
||||||
|
|
||||||
build_gcc () {
|
build_gcc () {
|
||||||
|
echo "Building ${GCC_VERSION}"
|
||||||
|
|
||||||
cd $BANAN_BUILD_DIR/toolchain
|
cd $BANAN_BUILD_DIR/toolchain
|
||||||
|
|
||||||
if [ ! -d $GCC_VERSION ]; then
|
if [ ! -d $GCC_VERSION ]; then
|
||||||
if [ ! -f $GCC_TAR ]; then
|
if [ ! -f $GCC_TAR ]; then
|
||||||
echo "Downloading ${GCC_TAR}"
|
|
||||||
wget $GCC_URL
|
wget $GCC_URL
|
||||||
fi
|
fi
|
||||||
echo "Unpacking ${GCC_TAR}"
|
|
||||||
tar xf $GCC_TAR
|
tar xf $GCC_TAR
|
||||||
patch -ruN -p1 -d "$GCC_VERSION" < "$BANAN_TOOLCHAIN_DIR/$GCC_VERSION.patch"
|
patch -ruN -p1 -d "$GCC_VERSION" < "$BANAN_TOOLCHAIN_DIR/$GCC_VERSION.patch"
|
||||||
fi
|
fi
|
||||||
|
|
@ -119,8 +113,6 @@ build_gcc () {
|
||||||
cd $BANAN_BUILD_DIR/toolchain/$GCC_VERSION
|
cd $BANAN_BUILD_DIR/toolchain/$GCC_VERSION
|
||||||
enter_clean_build
|
enter_clean_build
|
||||||
|
|
||||||
echo "Building ${GCC_VERSION}"
|
|
||||||
|
|
||||||
../configure \
|
../configure \
|
||||||
--target="$BANAN_TOOLCHAIN_TRIPLE" \
|
--target="$BANAN_TOOLCHAIN_TRIPLE" \
|
||||||
--prefix="$BANAN_TOOLCHAIN_PREFIX" \
|
--prefix="$BANAN_TOOLCHAIN_PREFIX" \
|
||||||
|
|
@ -155,22 +147,21 @@ build_libstdcpp () {
|
||||||
}
|
}
|
||||||
|
|
||||||
build_grub () {
|
build_grub () {
|
||||||
|
echo "Building ${GRUB_VERSION}"
|
||||||
|
|
||||||
cd $BANAN_BUILD_DIR/toolchain
|
cd $BANAN_BUILD_DIR/toolchain
|
||||||
|
|
||||||
if [ ! -d $GRUB_VERSION ]; then
|
|
||||||
if [ ! -f $GRUB_TAR ]; then
|
if [ ! -f $GRUB_TAR ]; then
|
||||||
echo "Downloading ${GRUB_TAR}"
|
|
||||||
wget $GRUB_URL
|
wget $GRUB_URL
|
||||||
fi
|
fi
|
||||||
echo "Unpacking ${GRUB_TAR}"
|
|
||||||
|
if [ ! -d $GRUB_VERSION ]; then
|
||||||
tar xvf $GRUB_TAR
|
tar xvf $GRUB_TAR
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd $GRUB_VERSION
|
cd $GRUB_VERSION
|
||||||
enter_clean_build
|
enter_clean_build
|
||||||
|
|
||||||
echo "Building ${GRUB_VERSION}"
|
|
||||||
|
|
||||||
../configure \
|
../configure \
|
||||||
--target="$BANAN_ARCH" \
|
--target="$BANAN_ARCH" \
|
||||||
--prefix="$BANAN_TOOLCHAIN_PREFIX" \
|
--prefix="$BANAN_TOOLCHAIN_PREFIX" \
|
||||||
|
|
@ -183,21 +174,20 @@ build_grub () {
|
||||||
}
|
}
|
||||||
|
|
||||||
build_cmake() {
|
build_cmake() {
|
||||||
|
echo "Downloading ${CMAKE_VERSION}"
|
||||||
|
|
||||||
cd $BANAN_BUILD_DIR/toolchain
|
cd $BANAN_BUILD_DIR/toolchain
|
||||||
|
|
||||||
if [ ! -d $CMAKE_VERSION ]; then
|
|
||||||
if [ ! -f $CMAKE_TAR ]; then
|
if [ ! -f $CMAKE_TAR ]; then
|
||||||
echo "Downloading ${CMAKE_TAR}"
|
|
||||||
wget $CMAKE_URL
|
wget $CMAKE_URL
|
||||||
fi
|
fi
|
||||||
echo "Unpacking ${CMAKE_TAR}"
|
|
||||||
|
if [ ! -d $CMAKE_VERSION ]; then
|
||||||
tar xvf $CMAKE_TAR
|
tar xvf $CMAKE_TAR
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd $CMAKE_VERSION
|
cd $CMAKE_VERSION
|
||||||
|
|
||||||
echo "Building ${CMAKE_VERSION}"
|
|
||||||
|
|
||||||
mkdir -p $BANAN_TOOLCHAIN_PREFIX/bin
|
mkdir -p $BANAN_TOOLCHAIN_PREFIX/bin
|
||||||
mkdir -p $BANAN_TOOLCHAIN_PREFIX/share
|
mkdir -p $BANAN_TOOLCHAIN_PREFIX/share
|
||||||
|
|
||||||
|
|
@ -207,27 +197,6 @@ build_cmake() {
|
||||||
cp $BANAN_TOOLCHAIN_DIR/cmake-platform/* $BANAN_TOOLCHAIN_PREFIX/share/cmake-3.26/Modules/Platform/
|
cp $BANAN_TOOLCHAIN_DIR/cmake-platform/* $BANAN_TOOLCHAIN_PREFIX/share/cmake-3.26/Modules/Platform/
|
||||||
}
|
}
|
||||||
|
|
||||||
build_meson() {
|
|
||||||
cd "$BANAN_BUILD_DIR/toolchain"
|
|
||||||
|
|
||||||
if [ ! -d $MESON_VERSION ]; then
|
|
||||||
if [ ! -f $MESON_TAR ]; then
|
|
||||||
echo "Downloading ${MESON_TAR}"
|
|
||||||
wget $MESON_URL
|
|
||||||
fi
|
|
||||||
echo "Unpacking ${MESON_TAR}"
|
|
||||||
tar xvf $MESON_TAR
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd $MESON_VERSION
|
|
||||||
|
|
||||||
echo "Building ${MESON_VERSION}"
|
|
||||||
|
|
||||||
mkdir -p "$BANAN_TOOLCHAIN_PREFIX/bin"
|
|
||||||
|
|
||||||
./packaging/create_zipapp.py --outfile "$BANAN_TOOLCHAIN_PREFIX/bin/meson" --interpreter '/usr/bin/env python3'
|
|
||||||
}
|
|
||||||
|
|
||||||
BUILD_BINUTILS=1
|
BUILD_BINUTILS=1
|
||||||
if [[ -f $BANAN_TOOLCHAIN_PREFIX/bin/$BANAN_TOOLCHAIN_TRIPLE-ld ]]; then
|
if [[ -f $BANAN_TOOLCHAIN_PREFIX/bin/$BANAN_TOOLCHAIN_TRIPLE-ld ]]; then
|
||||||
echo "You already seem to have a binutils installed."
|
echo "You already seem to have a binutils installed."
|
||||||
|
|
@ -272,15 +241,6 @@ if [[ -f $BANAN_TOOLCHAIN_PREFIX/bin/cmake ]]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BUILD_MESON=1
|
|
||||||
if [[ -f $BANAN_TOOLCHAIN_PREFIX/bin/meson ]]; then
|
|
||||||
echo "You already seem to have a meson installed."
|
|
||||||
read -e -p "Do you want to rebuild it [y/N]? " choice
|
|
||||||
if ! [[ "$choice" == [Yy]* ]]; then
|
|
||||||
BUILD_MESON=0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# delete everything but toolchain
|
# delete everything but toolchain
|
||||||
mkdir -p $BANAN_BUILD_DIR
|
mkdir -p $BANAN_BUILD_DIR
|
||||||
find $BANAN_BUILD_DIR -mindepth 1 -maxdepth 1 ! -name toolchain -exec rm -r {} +
|
find $BANAN_BUILD_DIR -mindepth 1 -maxdepth 1 ! -name toolchain -exec rm -r {} +
|
||||||
|
|
@ -308,10 +268,6 @@ if (($BUILD_CMAKE)); then
|
||||||
build_cmake
|
build_cmake
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (($BUILD_MESON)); then
|
|
||||||
build_meson
|
|
||||||
fi
|
|
||||||
|
|
||||||
if (($BUILD_LIBSTDCPP)); then
|
if (($BUILD_LIBSTDCPP)); then
|
||||||
# delete sysroot and install libc
|
# delete sysroot and install libc
|
||||||
rm -r $BANAN_SYSROOT
|
rm -r $BANAN_SYSROOT
|
||||||
|
|
|
||||||
|
|
@ -1,60 +0,0 @@
|
||||||
#include <errno.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <limits.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
if (argc != 3)
|
|
||||||
{
|
|
||||||
fprintf(stderr, "usage: %s MOUNT_POINT PERMS_FILE\n", argv[0]);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int mount_fd = open(argv[1], O_RDONLY | O_DIRECTORY);
|
|
||||||
if (mount_fd == -1)
|
|
||||||
{
|
|
||||||
fprintf(stderr, "could not open %s: %s\n", argv[1], strerror(errno));
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
FILE* perm_fp = fopen(argv[2], "r");
|
|
||||||
if (perm_fp == NULL)
|
|
||||||
{
|
|
||||||
fprintf(stderr, "could not open %s: %s\n", argv[2], strerror(errno));
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
char buffer[1024];
|
|
||||||
while (fgets(buffer, sizeof(buffer), perm_fp))
|
|
||||||
{
|
|
||||||
char path[PATH_MAX];
|
|
||||||
uid_t uid;
|
|
||||||
gid_t gid;
|
|
||||||
mode_t mode;
|
|
||||||
|
|
||||||
if (sscanf(buffer, "%[^|\n]|%d|%d|%o\n", path, &uid, &gid, &mode) != 4)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
struct stat st;
|
|
||||||
if (fstatat(mount_fd, path, &st, AT_SYMLINK_NOFOLLOW) != 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (st.st_uid != uid || st.st_gid != gid)
|
|
||||||
if (fchownat(mount_fd, path, uid, gid, AT_SYMLINK_NOFOLLOW) != 0)
|
|
||||||
fprintf(stderr, "fchownat: %s: %s\n", path, strerror(errno));
|
|
||||||
|
|
||||||
const mode_t mode_mask = S_ISUID | S_ISGID | S_ISVTX | 0777;
|
|
||||||
if (mode != (st.st_mode & mode_mask))
|
|
||||||
if (fchmodat(mount_fd, path, mode, AT_SYMLINK_NOFOLLOW) != 0)
|
|
||||||
fprintf(stderr, "fchmodat: %s: %s\n", path, strerror(errno));
|
|
||||||
}
|
|
||||||
|
|
||||||
fclose(perm_fp);
|
|
||||||
close(mount_fd);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue