Skip to content

Commit

Permalink
update toolchain and build scripts for ppc500
Browse files Browse the repository at this point in the history
  • Loading branch information
phnzb committed Jan 30, 2025
1 parent c7bd317 commit 8a3880b
Show file tree
Hide file tree
Showing 6 changed files with 1,916 additions and 494 deletions.
2 changes: 2 additions & 0 deletions cmake/par2-turbo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ set(CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR}
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DTOOLCHAIN_PREFIX=${TOOLCHAIN_PREFIX}
)

if(APPLE)
Expand Down
21 changes: 15 additions & 6 deletions linux/build-nzbget.sh
Original file line number Diff line number Diff line change
Expand Up @@ -619,11 +619,15 @@ build_bin()
export CPPFLAGS=$CXXFLAGS
fi

build_lib "https://ftp.gnu.org/pub/gnu/ncurses/ncurses-$NCURSES_VERSION.tar.gz"
build_lib "https://zlib.net/zlib-$ZLIB_VERSION.tar.gz"
build_lib "https://gitlab.gnome.org/GNOME/libxml2/-/archive/v2.12.4/libxml2-v$LIBXML2_VERSION.tar.gz"
build_lib "https://github.com/openssl/openssl/releases/download/openssl-3.1.2/openssl-$OPENSSL_VERSION.tar.gz"
build_lib "https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-$BOOST_VERSION.tar.gz"
# skip building libs and unpackers for ppc500 arch
# for ppc500 arch we use buildroot libs
if [ "$ARCH" != "ppc500" ]; then
build_lib "https://ftp.gnu.org/pub/gnu/ncurses/ncurses-$NCURSES_VERSION.tar.gz"
build_lib "https://zlib.net/zlib-$ZLIB_VERSION.tar.gz"
build_lib "https://gitlab.gnome.org/GNOME/libxml2/-/archive/v2.12.4/libxml2-v$LIBXML2_VERSION.tar.gz"
build_lib "https://github.com/openssl/openssl/releases/download/openssl-3.1.2/openssl-$OPENSSL_VERSION.tar.gz"
build_lib "https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-$BOOST_VERSION.tar.gz"
fi

build_7zip
build_unrar
Expand All @@ -644,7 +648,12 @@ build_bin()
CMAKE_EXTRA_ARGS="-DCMAKE_SYSROOT=$FREEBSD_SYSROOT"
;;
*)
export LIBS="$LDFLAGS -lxml2 -lrt -lboost_json -lz -lssl -lcrypto -lncursesw -latomic -Wl,--whole-archive -lpthread -Wl,--no-whole-archive"
if [ "$ARCH" != "ppc500" ]; then
export LIBS="$LDFLAGS -lxml2 -lrt -lboost_json -lz -lssl -lcrypto -lncursesw -latomic -Wl,--whole-archive -lpthread -Wl,--no-whole-archive"
else
export LIBS="-lncurses -lboost_json -lxml2 -lz -lm -lssl -lcrypto -lz -ltinfow -latomic"
export INCLUDES="$TOOLCHAIN_PATH/$ARCH/output/host/$HOST/sysroot/usr/include/;$TOOLCHAIN_PATH/$ARCH/output/host/$HOST/sysroot/usr/include/libxml2/"
fi
CMAKE_EXTRA_ARGS="-DTOOLCHAIN_PREFIX=$TOOLCHAIN_PREFIX"
;;
esac
Expand Down
16 changes: 12 additions & 4 deletions linux/buildroot/build-toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ fi
# config variables
BUILDROOT_PREFIX=/build/buildroot
BUILDROOT_VERSION="2022.05.3"
if [ "$ARCH" == "ppc500" ]; then
BUILDROOT_VERSION="2024.02.10"
fi

# download buildroot sources and apply config
NZBGET_ROOT=$PWD
Expand All @@ -40,10 +43,15 @@ rm -rf $ARCH
mv buildroot-$BUILDROOT_VERSION $ARCH && rm buildroot-$BUILDROOT_VERSION.tar.gz
cd $BUILDROOT_PREFIX/$ARCH
cp $NZBGET_ROOT/linux/buildroot/config/.config-$ARCH .config

# revert musl to musl-1.1.24
patch package/musl/musl.mk $NZBGET_ROOT/linux/buildroot/patch/musl.mk.patch
patch package/musl/musl.hash $NZBGET_ROOT/linux/buildroot/patch/musl.hash.patch
if [ "$ARCH" == "ppc500" ]; then
# patch uclibc and ncurses for ppc500
patch package/uclibc/uclibc.mk $NZBGET_ROOT/linux/buildroot/patch/uclibc.ppc500.patch
patch package/ncurses/ncurses.mk $NZBGET_ROOT/linux/buildroot/patch/ncurses.ppc500.patch
else
# revert musl to musl-1.1.24
patch package/musl/musl.mk $NZBGET_ROOT/linux/buildroot/patch/musl.mk.patch
patch package/musl/musl.hash $NZBGET_ROOT/linux/buildroot/patch/musl.hash.patch
fi

# build toolchain
time make
Expand Down
Loading

0 comments on commit 8a3880b

Please sign in to comment.