upd parser

This commit is contained in:
2025-08-25 00:34:04 +03:00
parent eeb4377bb3
commit 12583471f1
4 changed files with 24 additions and 30 deletions

View File

@ -1,6 +1,3 @@
cd /mnt/sexlinux/source/linux-6.14.11 && make ARCH=x86 INSTALL_HDR_PATH=/mnt/sexlinux/pkg/gnu/linux headers_install #LINUX#################
cd /mnt/sexlinux/source/binutils-2.44 && ./configure --disable-nls --prefix=/pkg/gnu/binutils && make -j$(nproc) && make DESTDIR=/mnt/sexlinux install #BINUTILS##############
cd /mnt/sexlinux/source/glibc-2.41 && mkdir build; cd build && ../configure --with-headers=/mnt/sexlinux/pkg/gnu/linux/include --disable-multilib --enable-install-ldconfig --prefix=/pkg/gnu/glibc && make -j$(nproc) && make DESTDIR=/mnt/sexlinux install && mkdir -p /mnt/sexlinux/pkg/gnu/glibc/{share/i18n/charmaps,lib/locale,etc/ld.so.conf.d} && echo "include /pkg/gnu/glibc/etc/ld.so.conf.d/*.conf" > /mnt/sexlinux/pkg/gnu/glibc/etc/ld.so.conf && echo "/pkg/gnu/lib" > /mnt/sexlinux/pkg/gnu/glibc/etc/ld.so.conf.d/lib.conf && cp /mnt/sexlinux/source/glibc-2.41/localedata/charmaps/* /mnt/sexlinux/pkg/gnu/glibc/share/i18n/charmaps/ && chroot /mnt/sexlinux /pkg/gnu/glibc/bin/localedef -i en_US -f UTF-8 en_US.UTF-8 && sed -i 's|/pkg/gnu/glibc/lib64/ld-linux-x86-64.so.2|/pkg/gnu/glibc/lib/ld-linux-x86-64.so.2|g' /mnt/sexlinux/pkg/gnu/glibc/bin/ldd #GLIBC#################
cd /mnt/sexlinux/source/gmp-6.3.0 && ./configure --enable-cxx --prefix=/pkg/gnu/gmp && make -j$(nproc) && make DESTDIR=/mnt/sexlinux install #GMP###################
cd /mnt/sexlinux/source/mpfr-4.2.2 && ./configure --with-gmp=/mnt/sexlinux/pkg/gnu/gmp --prefix=/pkg/gnu/mpfr && make -j$(nproc) && make DESTDIR=/mnt/sexlinux install #MPFR##################
cd /mnt/sexlinux/source/mpc-1.3.1 && ./configure --with-gmp=/mnt/sexlinux/pkg/gnu/gmp --with-mpfr=/mnt/sexlinux/pkg/gnu/mpfr --prefix=/pkg/gnu/mpc && make -j$(nproc) && make DESTDIR=/mnt/sexlinux install #MPC###################
@ -68,12 +65,6 @@ cd /source/re2c-4.2 && ./configure --prefix=/pkg/gnu/re2c && make -j$(nproc) &&
cd /source/ninja-1.12.1 && ./configure.py --bootstrap && mkdir -p /pkg/gnu/ninja/bin && cp ninja /pkg/gnu/ninja/bin
# GCC
wget https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.14.11.tar.xz
tar -xf linux-6.14.11.tar.xz
wget https://ftp.gnu.org/gnu/binutils/binutils-2.44.tar.xz
tar -xf binutils-2.44.tar.xz
wget https://ftp.gnu.org/gnu/libc/glibc-2.41.tar.xz
tar -xf glibc-2.41.tar.xz
wget https://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.xz
tar -xf gmp-6.3.0.tar.xz
wget https://ftp.gnu.org/gnu/mpfr/mpfr-4.2.2.tar.xz

View File

@ -2,7 +2,7 @@ glibc 2.41
=
https://ftp.gnu.org/gnu/libc/glibc-2.41.tar.xz
``` sh *** build.sctipt ***
``` sh *** build ***
mkdir build; cd build &&
../configure \
--with-headers=/pkg/gnu/linux/include \
@ -12,7 +12,7 @@ mkdir build; cd build &&
make -j$(nproc) && make install
```
``` sh *** build.config ***
``` sh *** config ***
mkdir -p /pkg/gnu/glibc/{share/i18n/charmaps,lib/locale,etc/ld.so.conf.d} &&
echo "include /pkg/gnu/glibc/etc/ld.so.conf.d/*.conf" > /pkg/gnu/glibc/etc/ld.so.conf &&
echo "/pkg/gnu/lib" > /pkg/gnu/glibc/etc/ld.so.conf.d/lib.conf &&
@ -21,10 +21,10 @@ cp localedata/charmaps/* /pkg/gnu/glibc/share/i18n/charmaps/ &&
sed -i 's|/pkg/gnu/glibc/lib64/ld-linux-x86-64.so.2|/pkg/gnu/glibc/lib/ld-linux-x86-64.so.2|g' /pkg/gnu/glibc/bin/ldd
```
``` cfg *** build dependencies ***
``` cfg *** build deps ***
linux
```
``` cfg *** run dependencies ***
``` cfg *** run deps ***
binutils
```

View File

@ -7,16 +7,22 @@ if [ -z "$1" ]; then
fi
INSTALL_PATH="$1"
echo "Сборка проекта..."
cargo build --release
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
echo "Установка в '$INSTALL_PATH'..."
cargo install --path . --root "$INSTALL_PATH"
SEXPKG_HOME=$INSTALL_PATH cargo install --path . --root "$INSTALL_PATH"
if [ $? -eq 0 ]; then
echo "Проект успешно установлен в '$INSTALL_PATH'."
else
if [ $? -ne 0 ]; then
echo "Ошибка при установке."
exit 1
fi
ASSETS_DIR="$SCRIPT_DIR/assets"
if [ -d "$ASSETS_DIR" ]; then
echo "Копирование файлов из '$ASSETS_DIR' в '$INSTALL_PATH'..."
cp -r "$ASSETS_DIR"/* "$INSTALL_PATH"
else
echo "Предупреждение: Директория '$ASSETS_DIR' не найдена. Пропуск копирования."
fi
echo "Проект успешно установлен в '$INSTALL_PATH'."

View File

@ -39,31 +39,28 @@ pub fn get_url<P: AsRef<Path>>(file_path: P) -> io::Result<String> {
pub fn get_build_deps<P: AsRef<Path>>(file_path: P) -> io::Result<String> {
extract_block(file_path, "``` cfg build dependencies", "```")
extract_block(file_path, "``` cfg *** build deps ***", "```")
}
pub fn get_run_deps<P: AsRef<Path>>(file_path: P) -> io::Result<String> {
extract_block(file_path, "``` cfg build dependencies", "```")
extract_block(file_path, "``` cfg *** run deps ***", "```")
}
pub fn get_build_script<P: AsRef<Path>>(file_path: P) -> io::Result<String> {
extract_block(file_path, "``` sh build.sctipt", "```")
extract_block(file_path, "``` sh *** build ***", "```")
}
pub fn get_config_script<P: AsRef<Path>>(file_path: P) -> io::Result<String> {
extract_block(file_path, "``` sh build.config", "```")
extract_block(file_path, "``` sh *** config ***", "```")
}
pub fn get_repo_list() -> io::Result<Vec<String>> {
let exe_path = env::current_exe()?;
let file_path = exe_path
.parent()
.ok_or_else(|| io::Error::new(io::ErrorKind::Other, "Failed to get executable directory"))?
.join("../etc/sexpkg.md");
let base_path = env!("SEXPKG_HOME");
let file_path = PathBuf::from(base_path).join("var").join("sexpkg.md");
let block = extract_block(file_path, "``` sh *** Repository list and priority ***", "```")?;
let block = extract_block(file_path, "``` cfg *** Repository list and priority ***", "```")?;
let mut repo_list = Vec::new();
for line in block.lines() {