Ports: Fix bugs in the port system

Fix some bugs and add pkg-config for the port system. Also ncurses is
now downloaded from the gnu mirror in the hope that it works better
This commit is contained in:
Bananymous 2024-08-06 16:07:02 +03:00
parent fe94d6cf89
commit 5aca6c7c1f
4 changed files with 22 additions and 9 deletions

View File

@ -5,10 +5,19 @@ if (( $# != 1 )); then
exit 1 exit 1
fi fi
BANAN_ROOT_DIR="$(dirname $(realpath $0))/.." if [[ -z $BANAN_ROOT_DIR ]]; then
BANAN_ROOT_DIR="$(dirname $(realpath $0))/.."
fi
source "$BANAN_ROOT_DIR/script/config.sh" source "$BANAN_ROOT_DIR/script/config.sh"
export PATH="$BANAN_TOOLCHAIN_PREFIX/bin:$PATH" export PATH="$BANAN_TOOLCHAIN_PREFIX/bin:$PATH"
export PKG_CONFIG='pkg-config --static'
export PKG_CONFIG_SYSROOT_DIR="$BANAN_SYSROOT"
export PKG_CONFIG_LIBDIR="$PKG_CONFIG_SYSROOT_DIR/usr/lib/pkgconfig"
export PKG_CONFIG_PATH="$PKG_CONFIG_SYSROOT_DIR/usr/share/pkgconfig"
if [ ! -f "$BANAN_SYSROOT/usr/lib/libc.a" ]; then if [ ! -f "$BANAN_SYSROOT/usr/lib/libc.a" ]; then
pushd "$BANAN_ROOT_DIR" >/dev/null pushd "$BANAN_ROOT_DIR" >/dev/null
./bos libc || exit 1 ./bos libc || exit 1
@ -21,7 +30,7 @@ clean() {
} }
build() { build() {
configure_options=("--host=$BANAN_ARCH-banan_os" "--prefix=/usr" ) configure_options=("--host=$BANAN_ARCH-banan_os" '--prefix=/usr')
configure_options+=(${CONFIGURE_OPTIONS[*]}) configure_options+=(${CONFIGURE_OPTIONS[*]})
./configure ${configure_options[*]} || exit 1 ./configure ${configure_options[*]} || exit 1
@ -51,6 +60,10 @@ done
build_dir="$NAME-$VERSION-$BANAN_ARCH" build_dir="$NAME-$VERSION-$BANAN_ARCH"
if [ ! -d "$build_dir" ]; then
rm -f ".compile_hash-$BANAN_ARCH"
fi
if [ "$VERSION" = "git" ]; then if [ "$VERSION" = "git" ]; then
regex="(.*/.*\.git)#(.*)" regex="(.*/.*\.git)#(.*)"
@ -71,7 +84,7 @@ if [ "$VERSION" = "git" ]; then
pushd "$build_dir" >/dev/null pushd "$build_dir" >/dev/null
git checkout "$COMMIT" || exit 1 git checkout "$COMMIT" || exit 1
if [ -d patches ]; then if [ -d ../patches ]; then
for patch in ../patches/*; do for patch in ../patches/*; do
git apply "$patch" || exit 1 git apply "$patch" || exit 1
done done
@ -111,7 +124,7 @@ else
if [ -d patches ]; then if [ -d patches ]; then
for patch in ./patches/*; do for patch in ./patches/*; do
patch -ruN -d "$build_dir" < "$patch" || exit 1 patch -ruN -p1 -d "$build_dir" < "$patch" || exit 1
done done
fi fi
fi fi
@ -123,7 +136,7 @@ fi
needs_compile=1 needs_compile=1
if [ -f ".compile_hash-$BANAN_ARCH" ]; then if [ -f ".compile_hash-$BANAN_ARCH" ]; then
cat ".compile_hash-$BANAN_ARCH" | sha256sum --check >/dev/null sha256sum --check ".compile_hash-$BANAN_ARCH" &>/dev/null
needs_compile=$? needs_compile=$?
fi fi

View File

@ -2,7 +2,7 @@
NAME='ncurses' NAME='ncurses'
VERSION='6.5' VERSION='6.5'
DOWNLOAD_URL="https://invisible-island.net/archives/ncurses/ncurses-$VERSION.tar.gz#136d91bc269a9a5785e5f9e980bc76ab57428f604ce3e5a5a90cebc767971cc6" DOWNLOAD_URL="https://ftp.gnu.org/gnu/ncurses/ncurses-$VERSION.tar.gz#136d91bc269a9a5785e5f9e980bc76ab57428f604ce3e5a5a90cebc767971cc6"
CONFIGURE_OPTIONS=( CONFIGURE_OPTIONS=(
'--disable-db-intall' '--disable-db-intall'
'--disable-widec' '--disable-widec'

View File

@ -2,8 +2,8 @@
cd $(dirname $(realpath $0)) cd $(dirname $(realpath $0))
for port in ./*/.compile_hash*; do while IFS= read -r port; do
pushd $(dirname "$port") >/dev/null pushd $(dirname "$port") >/dev/null
./build.sh ./build.sh
popd >/dev/null popd >/dev/null
done done < <(find . -name '.compile_hash*')

View File

@ -4,7 +4,7 @@ NAME='vim'
VERSION='9.0' VERSION='9.0'
DOWNLOAD_URL="ftp://ftp.vim.org/pub/vim/unix/vim-$VERSION.tar.bz2#a6456bc154999d83d0c20d968ac7ba6e7df0d02f3cb6427fb248660bacfb336e" DOWNLOAD_URL="ftp://ftp.vim.org/pub/vim/unix/vim-$VERSION.tar.bz2#a6456bc154999d83d0c20d968ac7ba6e7df0d02f3cb6427fb248660bacfb336e"
TAR_CONTENT='vim90' TAR_CONTENT='vim90'
DEPENDENCIES=( 'ncurses' ) DEPENDENCIES=('ncurses' )
CONFIGURE_OPTIONS=( CONFIGURE_OPTIONS=(
'--with-tlib=ncurses' '--with-tlib=ncurses'
'--disable-nls' '--disable-nls'