diff --git a/assets/etc/aeropkg.md b/assets/etc/aeropkg.md index 706a78e..abf108b 100644 --- a/assets/etc/aeropkg.md +++ b/assets/etc/aeropkg.md @@ -4,12 +4,18 @@ Aeropkg config file > # Repository > Global settings -``` cfg *** Repository list and priority *** +``` cfg *** .pkg files sources *** gnu /pkg/gnu/aeropkg/var/gnu musl /pkg/gnu/aeropkg/var/musl nolibc /pkg/gnu/aeropkg/var/nolibc ``` +``` cfg *** download sources *** +gnu root@aura:/pkg/gnu/ +musl root@aura:/pkg/musl/ +nolibc root@aura:/pkg/nolibc/ +``` + > # Env > Block name `env *** env ***` @@ -20,16 +26,14 @@ nolibc /pkg/gnu/aeropkg/var/nolibc > Repo, stages - optional > Valid stages: download, patch, build, config. > `Params` -> save_source=true (default: none) -> pgo=generate|use (default: none) -> disable=true|false (default: false) +> save_source +> pgo_gen +> pgo_use +> disable ``` env *** env *** SHELL=/bin/zsh -``` - -``` env *** env gnu *** -save_source=false +mount_usr_dir ``` > # Hooks diff --git a/assets/var/gnu/aider.md b/assets/var/gnu/aider.md new file mode 100644 index 0000000..1a29bd7 --- /dev/null +++ b/assets/var/gnu/aider.md @@ -0,0 +1,4 @@ +aider + +mkdir -p /pkg/gnu/aider/bin +UV_TOOL_BIN_DIR=/pkg/gnu/aider/bin uv tool install aider-chat diff --git a/assets/var/gnu/at-spi2-core.md b/assets/var/gnu/at-spi2-core.md new file mode 100644 index 0000000..332c9f8 --- /dev/null +++ b/assets/var/gnu/at-spi2-core.md @@ -0,0 +1,11 @@ +at-spi2-core 2.58.8 += +https://gitlab.gnome.org/GNOME/at-spi2-core/-/archive/2.58.8/at-spi2-core-2.58.8.tar.gz + +``` sh *** build *** +mkdir -p build +cd build +meson setup --prefix=$pkgpath --buildtype=release .. +ninja +ninja install +``` diff --git a/assets/var/gnu/atk.md b/assets/var/gnu/atk.md new file mode 100644 index 0000000..e4477ee --- /dev/null +++ b/assets/var/gnu/atk.md @@ -0,0 +1,13 @@ +atk += +https://gitlab.gnome.org/Archive/atk/-/archive/master/atk-master.tar.gz + +``` sh *** build *** +mkdir -p build +cd build +meson setup --prefix=$pkgpath --buildtype=release .. +ninja +ninja install +``` + + diff --git a/assets/var/gnu/bash/completion.md b/assets/var/gnu/bash/completion.md new file mode 100644 index 0000000..2851bb7 --- /dev/null +++ b/assets/var/gnu/bash/completion.md @@ -0,0 +1,10 @@ +bash/completion += +https://github.com/scop/bash-completion/archive/refs/tags/2.18.0.tar.gz + +``` sh *** build *** +autoreconf -i +./configure --prefix=$pkgpath +make -j$(nproc) +make install +``` diff --git a/assets/var/gnu/boost.md b/assets/var/gnu/boost.md new file mode 100644 index 0000000..8e20ee4 --- /dev/null +++ b/assets/var/gnu/boost.md @@ -0,0 +1,11 @@ +boost 1.92 += +https://github.com/boostorg/boost/releases/download/boost-1.91.0-1/boost-1.91.0-1-cmake.tar.xz + +``` sh *** build *** +mkdir -p build; cd build +cmake .. -DCMAKE_INSTALL_PREFIX="$pkgpath" \ + -DBOOST_ENABLE_CMAKE=ON +make -j$(nproc) +make install +``` diff --git a/assets/var/gnu/btop.md b/assets/var/gnu/btop.md index fb46f87..5d05306 100644 --- a/assets/var/gnu/btop.md +++ b/assets/var/gnu/btop.md @@ -6,3 +6,12 @@ https://github.com/aristocratos/btop.git make PREFIX=$pkgpath -j$(nproc) make install PREFIX=$pkgpath ``` + +``` cfg *** build deps *** +linux/kernel/firmware +``` + +без firmware не загрузится SMU при пробросе amdgpu +Хз стоит ли добавлять в зависимости именно сюда +В будующем указывать модули необходимые можно будет прям для пакета +Модули уже требует прошивки diff --git a/assets/var/gnu/coreutils.md b/assets/var/gnu/coreutils.md index c5ae331..1fc40df 100644 --- a/assets/var/gnu/coreutils.md +++ b/assets/var/gnu/coreutils.md @@ -10,3 +10,8 @@ FORCE_UNSAFE_CONFIGURE=1 \ make -j$(nproc) make install ``` + +``` sh *** config *** +mkdir -p share/zsh/zshrc-auto.d +echo "alias ls='ls --color=auto'" > share/zsh/zshrc-auto.d/coreutils.zsh +``` diff --git a/assets/var/gnu/cups-filters.md b/assets/var/gnu/cups-filters.md new file mode 100644 index 0000000..d64b24d --- /dev/null +++ b/assets/var/gnu/cups-filters.md @@ -0,0 +1,19 @@ +cups-filters 2.0.1 += +https://github.com/OpenPrinting/cups-filters/archive/refs/tags/2.0.1.tar.gz + +``` sh *** patch *** +sed -i 's/int (\*proc_func)()/int (*proc_func)(FILE *, FILE *, void *)/' filter/foomatic-rip/process.h +``` + +``` sh *** build *** +./autogen.sh +./configure --prefix=$pkgpath +make -j$(nproc) +make install +``` + +``` cfg *** build deps *** +libcupsfilters +libppd +``` diff --git a/assets/var/gnu/cups.md b/assets/var/gnu/cups.md index e9c73d4..ec34def 100644 --- a/assets/var/gnu/cups.md +++ b/assets/var/gnu/cups.md @@ -1,9 +1,9 @@ -cups 2.3.6 +cups 2.4.19 = -https://github.com/apple/cups/archive/refs/tags/v2.3.6.tar.gz +https://github.com/OpenPrinting/cups/archive/refs/tags/v2.4.19.tar.gz ``` sh *** build *** -./configure --prefix=/pkg/gnu/cups +./configure --prefix=$pkgpath make -j$(nproc) make install ``` diff --git a/assets/var/gnu/dnsmasq.md b/assets/var/gnu/dnsmasq.md new file mode 100644 index 0000000..429f15d --- /dev/null +++ b/assets/var/gnu/dnsmasq.md @@ -0,0 +1,22 @@ +dnsmasq 2.93 += +https://thekelleys.org.uk/dnsmasq/dnsmasq-2.93.tar.xz + +``` sh *** patch *** +sed -i \ + -e 's|^\(#\s*define CONFFILE\s*\)"/etc/dnsmasq.conf"|\1"/pkg/gnu/dnsmasq/etc/dnsmasq.conf"|' \ + -e 's|^\(#\s*define RUNFILE\s*\)"/var/run/dnsmasq.pid"|\1"/pkg/gnu/dnsmasq/var/run/dnsmasq.pid"|' \ + -e 's|^\(#\s*define LEASEFILE\s*\)"/var/lib/misc/dnsmasq.leases"|\1"/pkg/gnu/dnsmasq/var/lib/dnsmasq.leases"|' \ + -e 's|^\(#\s*define RESOLVFILE\s*\)"/etc/resolv.conf"|\1"/pkg/gnu/dnsmasq/etc/resolv.conf"|' \ + src/config.h +``` + +``` sh *** build *** +make PREFIX=$pkgpath install +mkdir -p ../etc ../var/{run,lib} +cp dnsmasq.conf.example ../etc +``` + +``` sh *** config *** +cp etc/dnsmasq.conf.example etc/dnsmasq.conf +``` diff --git a/assets/var/gnu/efibootmgr.md b/assets/var/gnu/efibootmgr.md index 53b04a9..31f3aa0 100644 --- a/assets/var/gnu/efibootmgr.md +++ b/assets/var/gnu/efibootmgr.md @@ -14,3 +14,7 @@ efivar modprobe efivarfs mount -t efivarfs efivarfs /sys/firmware/efi/efivars ``` + +``` cfg *** run deps *** +efivar +``` diff --git a/assets/var/gnu/flutter.md b/assets/var/gnu/flutter.md new file mode 100644 index 0000000..86066f6 --- /dev/null +++ b/assets/var/gnu/flutter.md @@ -0,0 +1,12 @@ +flutter += +https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.44.8-stable.tar.xz + +``` env *** env *** +disable=true +``` + +``` sh *** build *** +git config --global --add safe.directory /pkg/gnu/flutter +cp -rPl * .* .. +``` diff --git a/assets/var/gnu/fonts/dejavu.md b/assets/var/gnu/fonts/dejavu.md new file mode 100644 index 0000000..f0cf2d8 --- /dev/null +++ b/assets/var/gnu/fonts/dejavu.md @@ -0,0 +1,3 @@ +fonts/dejavu 2.37 += +https://github.com/dejavu-fonts/dejavu-fonts/archive/refs/tags/version_2_37.tar.gz diff --git a/assets/var/gnu/fonts/geist.md b/assets/var/gnu/fonts/geist.md new file mode 100644 index 0000000..bfcd539 --- /dev/null +++ b/assets/var/gnu/fonts/geist.md @@ -0,0 +1,21 @@ +geist 1.7.2 += +https://github.com/vercel/geist-font/releases/download/v1.7.2/geist-font-v1.7.2.zip + +``` sh *** build *** +DEST=/pkg/gnu/fonts/geist/share/fonts +SRC=./geist-font + +mkdir -p "$DEST/static" + +# Variable fonts (основные) +cp "$SRC/Geist/variable/"*.ttf "$DEST/" +cp "$SRC/GeistMono/variable/"*.ttf "$DEST/" + +# Static fallbacks +cp "$SRC/Geist/ttf/"*.ttf "$DEST/static/" +cp "$SRC/GeistMono/ttf/"*.ttf "$DEST/static/" + +cp "$SRC/OFL.txt" "$DEST/" +cp "$SRC/DESCRIPTION.en_us.html" "$DEST/" 2>/dev/null || true +``` diff --git a/assets/var/gnu/foomatic-db-engine.md b/assets/var/gnu/foomatic-db-engine.md new file mode 100644 index 0000000..a618a06 --- /dev/null +++ b/assets/var/gnu/foomatic-db-engine.md @@ -0,0 +1,16 @@ +foomatic-db-engine += +https://github.com/OpenPrinting/foomatic-db-engine.git + +``` sh *** build *** +./make_configure +./configure --prefix=$pkgpath +make -j$(nproc) +make install +``` + +``` cfg *** exec deps *** +perl/XML::LibXML +perl/Clone +perl/DBI +``` diff --git a/assets/var/gnu/foomatic-db.md b/assets/var/gnu/foomatic-db.md new file mode 100644 index 0000000..01e9bab --- /dev/null +++ b/assets/var/gnu/foomatic-db.md @@ -0,0 +1,10 @@ +foomatic-db += +https://github.com/OpenPrinting/foomatic-db.git + +``` sh *** build *** +./make_configure +./configure --prefix=$pkgpath +make -j$(nproc) +make install +``` diff --git a/assets/var/gnu/fzf.md b/assets/var/gnu/fzf.md index 44ce07f..b618619 100644 --- a/assets/var/gnu/fzf.md +++ b/assets/var/gnu/fzf.md @@ -2,8 +2,17 @@ fzf 0.65.2 = https://github.com/junegunn/fzf/archive/refs/tags/v0.65.2.tar.gz +``` env *** env *** +GOROOT=/pkg/gnu/go +``` + ``` sh *** build *** -make install PREFIX=/pkg/gnu/fzf FZF_VERSION=0.65.2 FZF_REVISION=tarball +make bin/fzf FZF_VERSION=0.65.2 FZF_REVISION=tarball +mkdir -p ../bin ../man/man1 ../share/fzf/shell +cp bin/fzf ../bin/ +chmod +x /pkg/gnu/fzf/bin/fzf +cp man/man1/*.1 ../man/man1/ +cp shell/* ../share/fzf/shell ``` ``` sh *** build deps *** diff --git a/assets/var/gnu/gcc.md b/assets/var/gnu/gcc.md index 198712e..de2e1b2 100644 --- a/assets/var/gnu/gcc.md +++ b/assets/var/gnu/gcc.md @@ -10,7 +10,7 @@ rg -l "/lib64/ld-linux-x86-64.so.2" ./ | xargs sed -i 's|/lib64/ld-linux-x86-64. mkdir -p build cd build ../configure \ - --prefix=/pkg/gnu/gcc \ + --prefix=$pkgpath \ --disable-multilib \ --enable-languages=c,c++,fortran \ --disable-werror @@ -20,6 +20,7 @@ make install ``` sh *** config *** ln bin/gcc bin/cc +ln -s lib lib64 ``` ``` cfg *** build deps *** diff --git a/assets/var/gnu/ghostpdl.md b/assets/var/gnu/ghostpdl.md new file mode 100644 index 0000000..beae724 --- /dev/null +++ b/assets/var/gnu/ghostpdl.md @@ -0,0 +1,10 @@ +ghostpdl 10.07.1 += +https://github.com/ArtifexSoftware/ghostpdl/archive/refs/tags/ghostpdl-10.07.1.tar.gz + +``` sh *** build *** +./autogen.sh +./configure --prefix=$pkgpath +make -j$(nproc) +make install +``` diff --git a/assets/var/gnu/git.md b/assets/var/gnu/git.md index 4339eec..edcdd1d 100644 --- a/assets/var/gnu/git.md +++ b/assets/var/gnu/git.md @@ -12,6 +12,7 @@ make install ``` sh *** config *** mkdir -p /pkg/gnu/git/etc git config --system http.sslCAInfo /pkg/gnu/openssl/ssl/cacert.pem +git config --global url."https://github.com/".insteadOf "git@github.com:" ``` ``` cfg *** build deps *** diff --git a/assets/var/gnu/glu.md b/assets/var/gnu/glu.md new file mode 100644 index 0000000..34441bb --- /dev/null +++ b/assets/var/gnu/glu.md @@ -0,0 +1,15 @@ +glu 9.0.3 += +https://gitlab.freedesktop.org/mesa/glu/-/archive/glu-9.0.3/glu-glu-9.0.3.tar.gz + +``` sh *** build *** +mkdir -p build +cd build +meson setup --prefix=$pkgpath --libdir=lib --buildtype=release .. +ninja +ninja install +``` + +``` cfg *** build deps *** +mesa +``` diff --git a/assets/var/gnu/hiddify-core.md b/assets/var/gnu/hiddify-core.md new file mode 100644 index 0000000..8589c29 --- /dev/null +++ b/assets/var/gnu/hiddify-core.md @@ -0,0 +1,10 @@ +hiddify-core += +https://github.com/hiddify/hiddify-core/releases/download/v4.1.0/hiddify-core-linux-amd64.tar.gz + +``` sh *** build *** +mkdir ../bin +mkdir ../lib +mv hiddify-core ../bin +mv libcronet.so ../lib +``` diff --git a/assets/var/gnu/hostap/hostapd.md b/assets/var/gnu/hostap/hostapd.md new file mode 100644 index 0000000..c9ff8e1 --- /dev/null +++ b/assets/var/gnu/hostap/hostapd.md @@ -0,0 +1,12 @@ +hostap/hostapd 2.12 += +https://git.w1.fi/hostap.git + +``` sh *** build *** +cd hostapd +cp defconfig .config +make +make install BINDIR=/pkg/gnu/hostap/hostapd/bin +mkdir -p ../etc +cp hostapd.conf ../etc +``` diff --git a/assets/var/gnu/hostap/wpa_supplicant.md b/assets/var/gnu/hostap/wpa_supplicant.md new file mode 100644 index 0000000..cc64096 --- /dev/null +++ b/assets/var/gnu/hostap/wpa_supplicant.md @@ -0,0 +1,27 @@ +hostap/wpa_supplicant 2.12 += +https://git.w1.fi/hostap.git + +``` sh *** build *** +cd wpa_supplicant +cp defconfig .config +make +make install \ + SBINDIR=/pkg/gnu/hostap/wpa_supplicant/sbin \ + BINDIR=/pkg/gnu/hostap/wpa_supplicant/bin \ + CONFDIR=/pkg/gnu/hostap/wpa_supplicant/etc \ + DBUSDIR=/pkg/gnu/hostap/wpa_supplicant/share/dbus-1/system.d \ + LIBDIR=/pkg/gnu/hostap/wpa_supplicant/lib \ + MANDIR=/pkg/gnu/hostap/wpa_supplicant/share/man +``` + +``` sh *** config *** +mkdir -p /pkg/gnu/hostap/wpa_supplicant/run +sed -i 's|^ctrl_interface=.*|ctrl_interface=/pkg/gnu/hostap/wpa_supplicant/run|' /pkg/gnu/wpa_supplicant/etc/wpa_supplicant.conf +``` + +``` cfg *** build deps *** +libnl +dbus +openssl +``` diff --git a/assets/var/gnu/hplip.md b/assets/var/gnu/hplip.md new file mode 100644 index 0000000..8b9ea72 --- /dev/null +++ b/assets/var/gnu/hplip.md @@ -0,0 +1,3 @@ +hplip += +https://sourceforge.net/projects/hplip/files/hplip/3.26.4/hplip-3.26.4.tar.gz diff --git a/assets/var/gnu/lcsm.md b/assets/var/gnu/lcsm.md new file mode 100644 index 0000000..f9f017d --- /dev/null +++ b/assets/var/gnu/lcsm.md @@ -0,0 +1,9 @@ +lcsm 2.19.1 += +https://github.com/mm2/Little-CMS/archive/refs/tags/lcms2.19.1.tar.gz + +``` sh *** build *** +./configure --prefix=$pkgpath +make -j$(nproc) +make install +``` diff --git a/assets/var/gnu/libcupsfilters.md b/assets/var/gnu/libcupsfilters.md new file mode 100644 index 0000000..8add981 --- /dev/null +++ b/assets/var/gnu/libcupsfilters.md @@ -0,0 +1,19 @@ +libcupsfilters 2.1.1 += +https://github.com/OpenPrinting/libcupsfilters/releases/download/2.1.1/libcupsfilters-2.1.1.tar.xz + +``` sh *** build *** +./configure --prefix=$pkgpath +make -j$(nproc) +make install +``` + +``` cfg *** build deps *** +libtiff +libexif +lcsm +libqpdf +poppler +ghostpdl +mupdf +``` diff --git a/assets/var/gnu/libeconf.md b/assets/var/gnu/libeconf.md index 1031aaf..764e183 100644 --- a/assets/var/gnu/libeconf.md +++ b/assets/var/gnu/libeconf.md @@ -5,9 +5,7 @@ https://github.com/openSUSE/libeconf/archive/refs/tags/v0.8.0.tar.gz ``` sh *** build *** mkdir -p build cd build -meson setup \ - --prefix=/pkg/gnu/libeconf \ - --libdir=lib \ - --buildtype=release \ - .. +meson setup --prefix=/pkg/gnu/libeconf --libdir=lib --buildtype=release .. +ninja +ninja install ``` diff --git a/assets/var/gnu/libexif.md b/assets/var/gnu/libexif.md new file mode 100644 index 0000000..9937149 --- /dev/null +++ b/assets/var/gnu/libexif.md @@ -0,0 +1,9 @@ +libexif 0.6.26 += +https://github.com/libexif/libexif/releases/download/v0.6.26/libexif-0.6.26.tar.xz + +``` sh *** build *** +./configure --prefix=$pkgpath +make -j$(nproc) +make install +``` diff --git a/assets/var/gnu/libpcap.md b/assets/var/gnu/libpcap.md new file mode 100644 index 0000000..5491bc5 --- /dev/null +++ b/assets/var/gnu/libpcap.md @@ -0,0 +1,9 @@ +libpcap += +https://www.tcpdump.org/release/libpcap-1.10.7.tar.xz + +``` sh *** build *** +./configure --prefix=$pkgpath +make -j$(nproc) +make install +``` diff --git a/assets/var/gnu/libppd.md b/assets/var/gnu/libppd.md new file mode 100644 index 0000000..39d9a17 --- /dev/null +++ b/assets/var/gnu/libppd.md @@ -0,0 +1,17 @@ +libppd 2.1.1 += +https://github.com/OpenPrinting/libppd/releases/download/2.1.1/libppd-2.1.1.tar.xz + +``` env *** env *** +LTCC=/pkg/gnu/gcc/bin/gcc +LTCXX=/pkg/gnu/gcc/bin/g++ +``` + +``` sh *** build *** +./autogen.sh +./configure --prefix=$pkgpath +make -j$(nproc) +make install +``` + + diff --git a/assets/var/gnu/libqpdf.md b/assets/var/gnu/libqpdf.md new file mode 100644 index 0000000..062263a --- /dev/null +++ b/assets/var/gnu/libqpdf.md @@ -0,0 +1,10 @@ +libqpdf 12.3.2 += +https://github.com/qpdf/qpdf/archive/refs/tags/v12.3.2.tar.gz + +``` sh *** build *** +mkdir -p build; cd build +cmake -DCMAKE_INSTALL_PREFIX="$pkgpath" .. +make -j$(nproc) +make install +``` diff --git a/assets/var/gnu/libtiff.md b/assets/var/gnu/libtiff.md new file mode 100644 index 0000000..fa65d2a --- /dev/null +++ b/assets/var/gnu/libtiff.md @@ -0,0 +1,10 @@ +libtiff 4.7.2 += +https://gitlab.com/libtiff/libtiff/-/archive/v4.7.2/libtiff-v4.7.2.tar.gz + +``` sh *** build *** +autoreconf --install --force +./configure --prefix=$pkgpath +make -j$(nproc) +make install +``` diff --git a/assets/var/gnu/libxcomposite.md b/assets/var/gnu/libxcomposite.md index 209028b..48829dd 100644 --- a/assets/var/gnu/libxcomposite.md +++ b/assets/var/gnu/libxcomposite.md @@ -1,3 +1,9 @@ libxcomposite 0.4.7 = https://www.x.org/releases/individual/lib/libXcomposite-0.4.7.tar.xz + +``` sh *** build *** +./configure --prefix=$pkgpath +make -j$(nproc) +make install +``` diff --git a/assets/var/gnu/libxcursor.md b/assets/var/gnu/libxcursor.md new file mode 100644 index 0000000..878330c --- /dev/null +++ b/assets/var/gnu/libxcursor.md @@ -0,0 +1,9 @@ +libxcursor 1.2.3 += +https://xorg.freedesktop.org/archive/individual/lib/libXcursor-1.2.3.tar.xz + +``` sh *** build *** +./configure --prefix=$pkgpath +make -j$(nproc) +make install +``` diff --git a/assets/var/gnu/libxdamage.md b/assets/var/gnu/libxdamage.md new file mode 100644 index 0000000..f3b6ada --- /dev/null +++ b/assets/var/gnu/libxdamage.md @@ -0,0 +1,9 @@ +libxdamage 1.1.7 += +https://xorg.freedesktop.org/archive/individual/lib/libXdamage-1.1.7.tar.xz + +``` sh *** build *** +./configure --prefix=$pkgpath +make -j$(nproc) +make install +``` diff --git a/assets/var/gnu/linux/headers.md b/assets/var/gnu/linux/headers.md index 4e766b4..549c22f 100644 --- a/assets/var/gnu/linux/headers.md +++ b/assets/var/gnu/linux/headers.md @@ -1,6 +1,6 @@ -linux/headers 7.1.4 +linux/headers 7.2.3 = -https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-7.1.4.tar.xz +https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-7.2.3.tar.xz ``` sh *** build *** make ARCH=x86 INSTALL_HDR_PATH=/pkg/gnu/linux/headers headers_install diff --git a/assets/var/gnu/linux/kernel-usb.md b/assets/var/gnu/linux/kernel-usb.md index ecbce2c..99428af 100644 --- a/assets/var/gnu/linux/kernel-usb.md +++ b/assets/var/gnu/linux/kernel-usb.md @@ -1,6 +1,6 @@ -linux/kernel-usb 7.0.12 +linux/kernel-usb 7.2.3 = -https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-7.0.12.tar.xz +https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-7.2.3.tar.xz ``` sh *** patch *** mkdir -p certs @@ -66,6 +66,10 @@ CONFIG_USB_HID=y CONFIG_HID=y CONFIG_HID_GENERIC=y +# AI +CONFIG_HSA_AMD=y +CONFIG_DRM_AMDGPU_USERPTR=y +CONFIG_DRM_AMDGPU=y # AeroLinux conf CONFIG_F2FS_FS=y @@ -98,5 +102,9 @@ cp {certs/signing_key.pem,certs/signing_key.x509} /pkg/gnu/linux/kernel-usb/var/ ``` ``` sh *** set *** +modprobe vfat +modprobe nls_cp437 +modprobe nls_iso8859-1 +mountpoint -q /boot/efi || mount /dev/nvme0n1p1 /boot/efi cp -r /pkg/gnu/linux/kernel-usb/var/BOOTX64.EFI /boot/efi/EFI/aerolinux/LinuxStub.efi ``` diff --git a/assets/var/gnu/linux/kernel.md b/assets/var/gnu/linux/kernel.md index 9f460af..d548871 100644 --- a/assets/var/gnu/linux/kernel.md +++ b/assets/var/gnu/linux/kernel.md @@ -1,6 +1,6 @@ -linux/kernel 7.1.4 +linux/kernel 7.2.3 = -https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-7.1.4.tar.xz +https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-7.2.3.tar.xz ``` sh *** patch *** mkdir -p certs @@ -53,9 +53,13 @@ CONFIG_NVME_CORE=y CONFIG_NVME_HWMON=y CONFIG_F2FS_FS=y +# AI +CONFIG_HSA_AMD=y +CONFIG_DRM_AMDGPU_USERPTR=y + # AeroLinux conf CONFIG_CMDLINE_BOOL=y -CONFIG_CMDLINE="root=PARTLABEL=aerolinux init=/pkg/gnu/s6/bin/s6-init rootwait rw console=tty0 earlycon=efifb loglevel=8 debug" +CONFIG_CMDLINE="root=PARTLABEL=aerolinux init=/pkg/gnu/s6/bin/s6-init rootwait rw console=tty0 earlycon=efifb loglevel=8 debug amdgpu.gttsize=49152" CONFIG_MODPROBE_PATH="/pkg/gnu/bin/modprobe" ENDCONFIG @@ -87,5 +91,9 @@ pkg run set linux/kernel ``` ``` sh *** set *** +modprobe vfat +modprobe nls_cp437 +modprobe nls_iso8859-1 +mountpoint -q /boot/efi || mount /dev/nvme0n1p1 /boot/efi cp -r /pkg/gnu/linux/kernel/var/BOOTX64.EFI /boot/efi/EFI/aerolinux/LinuxStub.efi ``` diff --git a/assets/var/gnu/linux/kernel/firmware/wireless-regdb.md b/assets/var/gnu/linux/kernel/firmware/wireless-regdb.md new file mode 100644 index 0000000..789c8a0 --- /dev/null +++ b/assets/var/gnu/linux/kernel/firmware/wireless-regdb.md @@ -0,0 +1,19 @@ +linux/kernel/firmware/wireless-regdb += +https://git.kernel.org/pub/scm/linux/kernel/git/wens/wireless-regdb.git/snapshot/wireless-regdb-master-2026-09-03.tar.gz + +``` sh *** build *** +mkdir -p ../lib +cp -Pl regulatory.db regulatory.db.p7s ../lib +``` + +``` sh *** config *** +pkg run set linux/kernel/firmware/wireless-regdb +``` + +``` sh *** set *** +cp -rPl lib ../ +``` + +# wireless regulatory db +https://git.kernel.org/pub/scm/linux/kernel/git/wens/wireless-regdb.git/ diff --git a/assets/var/gnu/linux/kernel/modules.md b/assets/var/gnu/linux/kernel/modules.md index 413511c..ee19833 100644 --- a/assets/var/gnu/linux/kernel/modules.md +++ b/assets/var/gnu/linux/kernel/modules.md @@ -1,9 +1,10 @@ -linux/kernel/modules 7.1.4 +linux/kernel/modules 7.2.3 = -https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-7.1.4.tar.xz +https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-7.2.3.tar.xz ``` env *** env *** disable=true +kernel_version=7.2.3 ``` ``` sh *** patch *** @@ -57,6 +58,10 @@ CONFIG_NVME_CORE=y CONFIG_NVME_HWMON=y CONFIG_F2FS_FS=y +# AI +CONFIG_HSA_AMD=y +CONFIG_DRM_AMDGPU_USERPTR=y + # AeroLinux conf CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="root=PARTLABEL=aerolinux init=/pkg/gnu/s6/bin/s6-init rootwait rw console=tty0 earlycon=efifb loglevel=8 debug" @@ -80,14 +85,9 @@ make olddefconfig ./scripts/kconfig/merge_config.sh -m .config .config.base make olddefconfig make -j$(nproc) vmlinux modules -make INSTALL_MOD_PATH=/pkg/gnu/linux/kernel/modules modules_install +make MODLIB=/pkg/gnu/linux/kernel/modules/lib/$kernel_version modules_install mkdir -p /pkg/gnu/linux/kernel/var/certs cp System.map /pkg/gnu/linux/kernel/var/System.map cp .config /pkg/gnu/linux/kernel/var/config cp {certs/signing_key.pem,certs/signing_key.x509} /pkg/gnu/linux/kernel/var/certs || true ``` - -``` sh *** config *** -mv lib/modules/* lib -rm -r lib/modules -``` diff --git a/assets/var/gnu/llama.cpp.md b/assets/var/gnu/llama.cpp.md new file mode 100644 index 0000000..72042e8 --- /dev/null +++ b/assets/var/gnu/llama.cpp.md @@ -0,0 +1,29 @@ +llama.cpp += +https://github.com/ggml-org/llama.cpp/archive/refs/tags/b10094.tar.gz + +``` env *** env *** +HIP_DEVICE_LIB_PATH=/pkg/gnu/rocm/llvm/amd/device-libs/amdgcn/bitcode +ROCM_PATH=/pkg/gnu +HIP_PATH=/pkg/gnu +GPU_TARGETS=gfx1150 +``` + +``` sh *** patch *** +sed -i '/^ggml_add_backend_library(ggml-hip$/,/^[[:space:]]*)$/{ /^[[:space:]]*)$/a\ +target_compile_options(ggml-hip PRIVATE $<$:-include __clang_hip_runtime_wrapper.h>) +}' ggml/src/ggml-hip/CMakeLists.txt +``` + +``` sh *** build *** +mkdir -p build; cd build +cmake .. \ + -DCMAKE_INSTALL_PREFIX="$pkgpath" \ + -DGGML_HIP=ON \ + -DCMAKE_C_COMPILER=amdclang \ + -DCMAKE_CXX_COMPILER=amdclang++ \ + -DCMAKE_CXX_FLAGS="-D_GNU_SOURCE -O3 -march=native" \ + -DGPU_TARGETS="gfx1150" +cmake --build . -j$(nproc) +cmake --install . +``` diff --git a/assets/var/gnu/llama.cpp/s6.md b/assets/var/gnu/llama.cpp/s6.md new file mode 100644 index 0000000..e69de29 diff --git a/assets/var/gnu/mesa.md b/assets/var/gnu/mesa.md index 49a1fd6..3e3c75f 100644 --- a/assets/var/gnu/mesa.md +++ b/assets/var/gnu/mesa.md @@ -19,6 +19,11 @@ ninja ninja install ``` +``` sh *** config *** +cd lib/pkgconfig +cp -Pl gl.pc opengl.pc +``` + ``` cfg *** build deps *** glslang llvm/libclc diff --git a/assets/var/gnu/msgpack-cxx.md b/assets/var/gnu/msgpack-cxx.md index 311d981..6d72cbd 100644 --- a/assets/var/gnu/msgpack-cxx.md +++ b/assets/var/gnu/msgpack-cxx.md @@ -4,6 +4,10 @@ https://github.com/msgpack/msgpack-c/releases/download/cpp-8.0.0/msgpack-cxx-8.0 ``` sh *** build *** mkdir -p build && cd build -cmake .. -DCMAKE_INSTALL_PREFIX=/pkg/gnu/msgpack-cxx -DMSGPACK_USE_BOOST=OFF +cmake .. -DCMAKE_INSTALL_PREFIX=/pkg/gnu/msgpack-cxx cmake --build . --target install ``` + +``` cfg *** build deps *** +boost +``` diff --git a/assets/var/gnu/mupdf.md b/assets/var/gnu/mupdf.md new file mode 100644 index 0000000..9b8132e --- /dev/null +++ b/assets/var/gnu/mupdf.md @@ -0,0 +1,13 @@ +mupdf += +https://casper.mupdf.com/downloads/archive/mupdf-1.28.1-source.tar.gz + +``` sh *** build *** +make prefix=/pkg/gnu/mupdf build=release -j$(nproc) +make prefix=/pkg/gnu/mupdf install +``` + +``` cfg *** build deps *** +glu +llvm +``` diff --git a/assets/var/gnu/neovim.md b/assets/var/gnu/neovim.md index 81c73d1..000e433 100644 --- a/assets/var/gnu/neovim.md +++ b/assets/var/gnu/neovim.md @@ -21,4 +21,6 @@ utf8proc ``` cfg *** run deps *** luajit +fzf +tree-siter ``` diff --git a/assets/var/gnu/nginx.md b/assets/var/gnu/nginx.md new file mode 100644 index 0000000..99b57f1 --- /dev/null +++ b/assets/var/gnu/nginx.md @@ -0,0 +1,32 @@ +nginx 1.31.3 += +https://github.com/nginx/nginx/releases/download/release-1.31.3/nginx-1.31.3.tar.gz + +``` sh *** build *** +./configure \ + --prefix=$pkgpath \ + --with-http_ssl_module \ + --with-http_v2_module \ + --with-http_sub_module \ + --conf-path=$pkgpath/etc/nginx.conf \ + --sbin-path=$pkgpath/bin/nginx \ + --error-log-path=$pkgpath/var/log/error.log \ + --http-log-path=$pkgpath/var/log/access.log \ + --pid-path=$pkgpath/var/run/nginx.pid \ + --lock-path=$pkgpath/var/lock/nginx.lock \ + --http-client-body-temp-path=$pkgpath/var/tmp/client_body \ + --http-proxy-temp-path=$pkgpath/var/tmp/proxy \ + --http-fastcgi-temp-path=$pkgpath/var/tmp/fastcgi \ + --http-uwsgi-temp-path=$pkgpath/var/tmp/uwsgi \ + --http-scgi-temp-path=$pkgpath/var/tmp/scgi \ + --user=nginx \ + --group=nginx +make -j$(nproc) +make install +``` + +``` sh *** config *** +mkdir -p var/tmp +groupadd -r nginx +useradd -r -g nginx -s /sbin/nologin -d /nonexistent -c "Nginx web server" nginx +``` diff --git a/assets/var/gnu/nodejs.md b/assets/var/gnu/nodejs.md new file mode 100644 index 0000000..e6f5bdf --- /dev/null +++ b/assets/var/gnu/nodejs.md @@ -0,0 +1,9 @@ +nodejs 26.5.0 += +https://github.com/nodejs/node/archive/refs/tags/v26.5.0.tar.gz + +``` sh *** build *** +./configure --prefix=$pkgpath +make -j$(nproc) +make install +``` diff --git a/assets/var/gnu/nspr.md b/assets/var/gnu/nspr.md new file mode 100644 index 0000000..ce85171 --- /dev/null +++ b/assets/var/gnu/nspr.md @@ -0,0 +1,13 @@ +nspr += +https://github.com/mozilla/nspr/archive/refs/tags/NSPR_4_40_RTM.tar.gz + +``` sh *** build *** +./configure \ + --prefix=$pkgpath \ + --enable-64bit \ + --enable-optimize \ + --disable-debug +make -j$(nproc) +make install +``` diff --git a/assets/var/gnu/nss.md b/assets/var/gnu/nss.md new file mode 100644 index 0000000..a71110a --- /dev/null +++ b/assets/var/gnu/nss.md @@ -0,0 +1,16 @@ +nss 3.126 += +https://github.com/mozilla/nss/archive/refs/tags/NSS_3_126_RTM.tar.gz + +``` sh *** build *** +make -j$(nproc) USE_64=1 BUILD_OPT=1 +cd .. +mkdir -p {bin,lib/nss,include/nss} +cp -aL dist/*/bin/* bin/ +cp -aL dist/*/lib/* lib/nss +cp -aL dist/public/nss/* include/nss/ +``` + +``` cfg *** build deps *** +nspr +``` diff --git a/assets/var/gnu/ollama.md b/assets/var/gnu/ollama.md new file mode 100644 index 0000000..01ff872 --- /dev/null +++ b/assets/var/gnu/ollama.md @@ -0,0 +1,32 @@ +ollama 0.32.1 += +https://github.com/ollama/ollama/archive/refs/tags/v0.32.1.tar.gz + +``` env *** env *** +HIP_DEVICE_LIB_PATH=/pkg/gnu/rocm/llvm/amd/device-libs/amdgcn/bitcode +GOROOT=/pkg/gnu/go +HIP_PATH=/pkg/gnu +ROCM_PATH=/pkg/gnu +``` + +``` sh *** build *** +mkdir -p build; cd build +cmake .. \ + -DCMAKE_INSTALL_PREFIX=/pkg/gnu/ollama \ + -DCMAKE_C_COMPILER=/pkg/gnu/rocm/llvm/bin/amdclang \ + -DCMAKE_CXX_COMPILER=/pkg/gnu/rocm/llvm/bin/amdclang++ \ + -DCMAKE_LINKER=/pkg/gnu/rocm/llvm/amd/hipcc/lib/llvm/bin/ld.lld \ + -DCMAKE_CXX_FLAGS="--rocm-device-lib-path=/pkg/gnu/rocm/llvm/amd/device-libs/amdgcn/bitcode -fuse-ld=lld" \ + -DOLLAMA_LLAMA_BACKENDS=rocm_v7_2 \ + -DAMDGPU_TARGETS="gfx1150" +make ollama-llama-cpp-source/fast +sed -i '/^ggml_add_backend_library(ggml-hip$/,/^[[:space:]]*)$/{ /^[[:space:]]*)$/a\ +target_compile_options(ggml-hip PRIVATE $<$:-include __clang_hip_runtime_wrapper.h>) +}' _deps/llama_cpp-src/ggml/src/ggml-hip/CMakeLists.txt +cmake --build . -j$(nproc) +cmake --install . +``` + +``` cfg *** build deps *** +rocm/libraries/hipblas +``` diff --git a/assets/var/gnu/ollama/nginx.md b/assets/var/gnu/ollama/nginx.md new file mode 100644 index 0000000..b2b79a2 --- /dev/null +++ b/assets/var/gnu/ollama/nginx.md @@ -0,0 +1,3 @@ + +pip install certbot +certbot certonly -d auraid.org diff --git a/assets/var/gnu/ollama/s6.md b/assets/var/gnu/ollama/s6.md new file mode 100644 index 0000000..e69de29 diff --git a/assets/var/gnu/openclaw.md b/assets/var/gnu/openclaw.md new file mode 100644 index 0000000..fac80de --- /dev/null +++ b/assets/var/gnu/openclaw.md @@ -0,0 +1,14 @@ + +``` env *** env *** +TZ=Europe/Moscow +OPENCLAW_STATE_DIR=/pkg/gnu/openclaw/var +OPENCLAW_CONFIG_PATH=/pkg/gnu/openclaw/etc/openclaw.json +HTTP_PROXY=http://127.0.0.1:12334 +HTTPS_PROXY=http://127.0.0.1:12334 +``` + +``` sh *** config *** +openclaw onboard --install-daemon +OPENCLAW_CONFIG_PATH=/pkg/gnu/openclaw/etc/openclaw.json \ +openclaw config set agents.defaults.workspace /pkg/gnu/openclaw/var/workspace +``` diff --git a/assets/var/gnu/openjpeg.md b/assets/var/gnu/openjpeg.md new file mode 100644 index 0000000..eccc307 --- /dev/null +++ b/assets/var/gnu/openjpeg.md @@ -0,0 +1,10 @@ +openjpeg 2.5.4 += +https://github.com/uclouvain/openjpeg/archive/refs/tags/v2.5.4.tar.gz + +``` sh *** build *** +mkdir -p build; cd build +cmake -DCMAKE_INSTALL_PREFIX="$pkgpath" .. +make -j$(nproc) +make install +``` diff --git a/assets/var/gnu/pango.md b/assets/var/gnu/pango.md index 67c2c8d..9c314bd 100644 --- a/assets/var/gnu/pango.md +++ b/assets/var/gnu/pango.md @@ -1,6 +1,6 @@ -pango 1.57.0 +pango 1.58.0 = -https://gitlab.gnome.org/GNOME/pango/-/archive/1.57.0/pango-1.57.0.tar.gz +https://gitlab.gnome.org/GNOME/pango/-/archive/1.58.0/pango-1.58.0.tar.gz ``` sh *** build *** mkdir -p build diff --git a/assets/var/gnu/poppler.md b/assets/var/gnu/poppler.md new file mode 100644 index 0000000..f448ddb --- /dev/null +++ b/assets/var/gnu/poppler.md @@ -0,0 +1,15 @@ +poppler 26.08.0 += +https://gitlab.freedesktop.org/poppler/poppler/-/archive/poppler-26.08.0/poppler-poppler-26.08.0.tar.gz + +``` sh *** build *** +mkdir -p build; cd build +cmake -DCMAKE_INSTALL_PREFIX="$pkgpath" -DENABLE_NSS3=OFF -DENABLE_GPGME=OFF -DENABLE_QT5=OFF -DENABLE_QT6=OFF .. +make -j$(nproc) +make install +``` + +``` cfg *** build deps *** +pango +openjpeg +``` diff --git a/assets/var/gnu/python3.10.md b/assets/var/gnu/python3.10.md new file mode 100644 index 0000000..e457f8e --- /dev/null +++ b/assets/var/gnu/python3.10.md @@ -0,0 +1,25 @@ +python3.10 3.10.20 += +https://www.python.org/ftp/python/3.10.20/Python-3.10.20.tar.xz + +``` env *** env *** +disable=true +``` + +``` sh *** build *** +./configure --prefix="$pkgpath" --enable-optimizations +make -j$(nproc) +make install +``` + +``` sh *** config *** +ln bin/python3 bin/python +``` + +``` cfg *** build deps *** +ncurses +zlib +readline +sqlite +libxcrypt +``` diff --git a/assets/var/gnu/python3.11.md b/assets/var/gnu/python3.11.md new file mode 100644 index 0000000..e5cb9fb --- /dev/null +++ b/assets/var/gnu/python3.11.md @@ -0,0 +1,27 @@ +python3.11 3.11.15 += +https://www.python.org/ftp/python/3.11.15/Python-3.11.15.tar.xz + +CFLAGS="-I/pkg/gnu/include/ncurses" + +``` env *** env *** +disable=true +``` + +``` sh *** build *** +./configure --prefix="$pkgpath" --enable-optimizations +make -j$(nproc) +make install +``` + +``` sh *** config *** +ln bin/python3 bin/python +``` + +``` cfg *** build deps *** +ncurses +zlib +readline +sqlite +libxcrypt +``` diff --git a/assets/var/gnu/python3.md b/assets/var/gnu/python3.md index 246cf4c..dea8cfb 100644 --- a/assets/var/gnu/python3.md +++ b/assets/var/gnu/python3.md @@ -3,7 +3,7 @@ python3 3.13.4 https://github.com/python/cpython/archive/refs/tags/v3.13.4.tar.gz ``` sh *** build *** -CFLAGS="-I/pkg/gnu/include/ncurses" ./configure --prefix=/pkg/gnu/python3 --enable-optimizations +./configure --prefix="$pkgpath" --enable-shared --with-lto --enable-optimizations make -j$(nproc) make install ``` diff --git a/assets/var/gnu/rocm/libraries/hipblas.md b/assets/var/gnu/rocm/libraries/hipblas.md index 24849ac..f0af869 100644 --- a/assets/var/gnu/rocm/libraries/hipblas.md +++ b/assets/var/gnu/rocm/libraries/hipblas.md @@ -1,28 +1,17 @@ -hipblas 7.2.4 +rocm/libraries/hipblas 7.2.4 = https://github.com/ROCm/rocm-libraries/releases/download/rocm-7.2.4/hipblas.tar.gz +``` env *** env *** +HIP_DEVICE_LIB_PATH=/pkg/gnu/rocm/llvm/amd/device-libs/amdgcn/bitcode +HIP_PATH=/pkg/gnu +ROCM_PATH=/pkg/gnu +``` + ``` sh *** build *** mkdir -p build; cd build -LDFLAGS="-L/pkg/gnu/rocm/systems/rocr-runtime/lib \ --L/pkg/gnu/rocm/llvm/amd/comgr/lib \ --L/pkg/gnu/rocm/systems/rocprofiler-register/lib \ --L/pkg/gnu/rocm/systems/clr/lib \ --Wl,-rpath-link,/pkg/gnu/rocm/systems/rocr-runtime/lib \ --Wl,-rpath-link,/pkg/gnu/rocm/llvm/amd/comgr/lib \ --Wl,-rpath-link,/pkg/gnu/rocm/systems/rocprofiler-register/lib \ --Wl,-rpath-link,/pkg/gnu/rocm/systems/clr/lib" \ -LIBRARY_PATH="/pkg/gnu/rocm/systems/rocr-runtime/lib:\ -/pkg/gnu/rocm/llvm/amd/comgr/lib:\ -/pkg/gnu/rocm/systems/rocprofiler-register/lib:\ -/pkg/gnu/rocm/systems/clr/lib" \ -HIP_CLANG_PATH=/pkg/gnu/rocm/llvm/amd/hipcc/lib/llvm/bin \ -ROCM_PATH=/pkg/gnu/rocm/systems/clr \ -HIP_PATH=/pkg/gnu/rocm/systems/clr \ -PATH=/pkg/gnu/rocm/llvm/amd/hipcc/lib/llvm/bin:/pkg/gnu/rocm/systems/clr/bin:$PATH \ cmake .. \ - -DCMAKE_INSTALL_PREFIX:PATH=/pkg/gnu/rocm/libraries/hipblas \ - -DCMAKE_C_COMPILER=/pkg/gnu/rocm/llvm/amd/hipcc/lib/llvm/bin/clang \ + -DCMAKE_INSTALL_PREFIX=/pkg/gnu/rocm/libraries/hipblas \ -DCMAKE_CXX_COMPILER=/pkg/gnu/rocm/llvm/amd/hipcc/bin/hipcc \ -DCMAKE_LINKER=/pkg/gnu/rocm/llvm/amd/hipcc/lib/llvm/bin/ld.lld \ -DCMAKE_CXX_FLAGS="--rocm-device-lib-path=/pkg/gnu/rocm/llvm/amd/device-libs/amdgcn/bitcode -fuse-ld=lld" \ @@ -30,8 +19,7 @@ cmake .. \ -Damd_comgr_DIR=/pkg/gnu/rocm/llvm/amd/comgr/lib/cmake/amd_comgr \ -Dhsa-runtime64_DIR=/pkg/gnu/rocm/systems/rocr-runtime/lib/cmake/hsa-runtime64 \ -DGPU_TARGETS="gfx1150" \ - -DBUILD_CLIENTS=OFF \ - -LH + -DBUILD_WITH_SOLVER=OFF cmake --build . -j$(nproc) cmake --install . ``` @@ -43,6 +31,6 @@ rocm/llvm/amd/hipcc rocm/systems/clr rocm/systems/rocr-runtime rocm/libraries/hipblas-common +rocm/libraries/rocblas ``` - -rocblas ? +rocm/libraries/rocsolver diff --git a/assets/var/gnu/rocm/libraries/hipblaslt.md b/assets/var/gnu/rocm/libraries/hipblaslt.md index a70af46..763112e 100644 --- a/assets/var/gnu/rocm/libraries/hipblaslt.md +++ b/assets/var/gnu/rocm/libraries/hipblaslt.md @@ -1,37 +1,48 @@ hipblaslt 7.2.4 = -https://github.com/ROCm/rocm-libraries/releases/download/rocm-7.2.4/hipblaslt.tar.gz +https://github.com/ROCm/rocm-libraries/archive/refs/tags/rocm-7.2.4.tar.gz + +``` env *** env *** +HIP_DEVICE_LIB_PATH=/pkg/gnu/rocm/llvm/amd/device-libs/amdgcn/bitcode +HIP_PATH=/pkg/gnu +``` + +``` sh *** patch *** +sed -i ' + /# make class look like dict/,/return self._state\[key\]/ { + /def keys(self):/!d + /def keys(self):/a\ return self._state.keys() + } + /self._state\[key\] = value/a\ +\ + def __getitem__(self, key):\ + return self._state[key]\ +\ + def __iter__(self):\ + return iter(self._state)\ +\ + def __len__(self):\ + return len(self._state) +' projects/hipblaslt/tensilelite/Tensile/SolutionStructs/Solution.py +``` ``` sh *** build *** mkdir -p build; cd build -LDFLAGS="-L/pkg/gnu/rocm/systems/rocr-runtime/lib \ --L/pkg/gnu/rocm/llvm/amd/comgr/lib \ --L/pkg/gnu/rocm/systems/rocprofiler-register/lib \ --L/pkg/gnu/rocm/systems/clr/lib \ --Wl,-rpath-link,/pkg/gnu/rocm/systems/rocr-runtime/lib \ --Wl,-rpath-link,/pkg/gnu/rocm/llvm/amd/comgr/lib \ --Wl,-rpath-link,/pkg/gnu/rocm/systems/rocprofiler-register/lib \ --Wl,-rpath-link,/pkg/gnu/rocm/systems/clr/lib" \ -LIBRARY_PATH="/pkg/gnu/rocm/systems/rocr-runtime/lib:\ -/pkg/gnu/rocm/llvm/amd/comgr/lib:\ -/pkg/gnu/rocm/systems/rocprofiler-register/lib:\ -/pkg/gnu/rocm/systems/clr/lib" \ -HIP_CLANG_PATH=/pkg/gnu/rocm/llvm/amd/hipcc/lib/llvm/bin \ -ROCM_PATH=/pkg/gnu/rocm/systems/clr \ -HIP_PATH=/pkg/gnu/rocm/systems/clr \ -PATH=/pkg/gnu/rocm/llvm/amd/hipcc/lib/llvm/bin:/pkg/gnu/rocm/systems/clr/bin:$PATH \ -cmake .. \ - -DCMAKE_INSTALL_PREFIX:PATH=/pkg/gnu/rocm/libraries/hipblaslt \ - -DCMAKE_PREFIX_PATH="/pkg/gnu/rocm/llvm/amd/device-libs;/pkg/gnu/rocm/systems/clr;/pkg/gnu/rocm/systems/rocr-runtime;/pkg/gnu/rocm/llvm/amd/comgr;/pkg/gnu/rocm/systems/rocprofiler-register" \ +/pkg/gnu/python3/bin/python3 -m pip install packaging joblib pyyaml msgpack +cmake ../projects/hipblaslt \ + -DCMAKE_INSTALL_PREFIX=/pkg/gnu/rocm/libraries/hipblaslt \ -Dhipblas-common_DIR=/pkg/gnu/rocm/libraries/hipblas-common/lib/cmake/hipblas-common \ -DGPU_TARGETS=gfx1150 \ - -DBUILD_CLIENTS=OFF \ - -DHIPBLASLT_ENABLE_BLIS=OFF \ - -DCMAKE_C_COMPILER=/pkg/gnu/rocm/llvm/amd/hipcc/lib/llvm/bin/clang \ - -DCMAKE_CXX_COMPILER=/pkg/gnu/rocm/llvm/amd/hipcc/bin/hipcc \ + -DCMAKE_C_COMPILER=/pkg/gnu/rocm/llvm/bin/amdclang \ + -DCMAKE_CXX_COMPILER=/pkg/gnu/rocm/llvm/bin/clang++ \ -DCMAKE_LINKER=/pkg/gnu/rocm/llvm/amd/hipcc/lib/llvm/bin/ld.lld \ - -DCMAKE_CXX_FLAGS="--rocm-device-lib-path=/pkg/gnu/rocm/llvm/amd/device-libs/amdgcn/bitcode -fuse-ld=lld" \ - -LH + -DPython3_EXECUTABLE=/pkg/gnu/python3/bin/python3 \ + -DHIPBLASLT_ENABLE_LLVM=ON \ + -DHIPBLASLT_ENABLE_ROCROLLER=OFF \ + -DHIPBLASLT_ENABLE_SAMPLES=OFF \ + -DHIPBLASLT_BUILD_TESTING=OFF \ + -DTENSILELITE_ENABLE_AUTOBUILD=ON \ + -DHIPBLASLT_ENABLE_CLIENT=OFF cmake --build . -j$(nproc) cmake --install . ``` @@ -44,4 +55,5 @@ openblas rocm/llvm/openmp rocm/libraries/rocroller msgpack-cxx +python3 ``` diff --git a/assets/var/gnu/rocm/libraries/rocblas.md b/assets/var/gnu/rocm/libraries/rocblas.md index 6d39236..a7e1dca 100644 --- a/assets/var/gnu/rocm/libraries/rocblas.md +++ b/assets/var/gnu/rocm/libraries/rocblas.md @@ -1,38 +1,28 @@ rocm/libraries/rocblas 7.2.4 = -https://github.com/ROCm/rocm-libraries/releases/download/rocm-7.2.4/rocblas.tar.gz +https://github.com/ROCm/rocm-libraries/archive/refs/tags/rocm-7.2.4.tar.gz + +``` env *** env *** +HIP_DEVICE_LIB_PATH=/pkg/gnu/rocm/llvm/amd/device-libs/amdgcn/bitcode +HIP_PATH=/pkg/gnu +ROCM_PATH=/pkg/gnu +``` ``` sh *** build *** mkdir -p build; cd build -LDFLAGS="-L/pkg/gnu/rocm/systems/rocr-runtime/lib \ --L/pkg/gnu/rocm/llvm/amd/comgr/lib \ --L/pkg/gnu/rocm/systems/rocprofiler-register/lib \ --L/pkg/gnu/rocm/systems/clr/lib \ --Wl,-rpath-link,/pkg/gnu/rocm/systems/rocr-runtime/lib \ --Wl,-rpath-link,/pkg/gnu/rocm/llvm/amd/comgr/lib \ --Wl,-rpath-link,/pkg/gnu/rocm/systems/rocprofiler-register/lib \ --Wl,-rpath-link,/pkg/gnu/rocm/systems/clr/lib" \ -LIBRARY_PATH="/pkg/gnu/rocm/systems/rocr-runtime/lib:\ -/pkg/gnu/rocm/llvm/amd/comgr/lib:\ -/pkg/gnu/rocm/systems/rocprofiler-register/lib:\ -/pkg/gnu/rocm/systems/clr/lib" \ -HIP_CLANG_PATH=/pkg/gnu/rocm/llvm/amd/hipcc/lib/llvm/bin \ -ROCM_PATH=/pkg/gnu/rocm/systems/clr \ -HIP_PATH=/pkg/gnu/rocm/systems/clr \ -PATH=/pkg/gnu/rocm/llvm/amd/hipcc/lib/llvm/bin:/pkg/gnu/rocm/systems/clr/bin:$PATH \ -cmake .. \ +cmake ../projects/rocblas \ -DCMAKE_INSTALL_PREFIX:PATH=/pkg/gnu/rocm/libraries/rocblas \ -DCMAKE_C_COMPILER=/pkg/gnu/rocm/llvm/amd/hipcc/lib/llvm/bin/clang \ -DCMAKE_CXX_COMPILER=/pkg/gnu/rocm/llvm/amd/hipcc/bin/hipcc \ -DCMAKE_LINKER=/pkg/gnu/rocm/llvm/amd/hipcc/lib/llvm/bin/ld.lld \ -DCMAKE_CXX_FLAGS="--rocm-device-lib-path=/pkg/gnu/rocm/llvm/amd/device-libs/amdgcn/bitcode -fuse-ld=lld" \ -DGPU_TARGETS="gfx1150" \ - -DBUILD_CLIENTS=OFF \ - -LH + -DBUILD_CLIENTS=OFF cmake --build . -j$(nproc) cmake --install . ``` ``` cfg *** build deps *** rocm/libraries/hipblaslt +msgpack-cxx ``` diff --git a/assets/var/gnu/rocm/libraries/rocprim.md b/assets/var/gnu/rocm/libraries/rocprim.md new file mode 100644 index 0000000..be12902 --- /dev/null +++ b/assets/var/gnu/rocm/libraries/rocprim.md @@ -0,0 +1,24 @@ +rocm/libraries/rocprim 7.2.4 += +https://github.com/ROCm/rocm-libraries/releases/download/rocm-7.2.4/rocprim.tar.gz + +``` env *** env *** +HIP_DEVICE_LIB_PATH=/pkg/gnu/rocm/llvm/amd/device-libs/amdgcn/bitcode +HIP_PATH=/pkg/gnu +ROCM_PATH=/pkg/gnu +``` + +``` sh *** build *** +mkdir -p build; cd build +cmake .. \ + -DCMAKE_INSTALL_PREFIX=/pkg/gnu/rocm/libraries/rocprim \ + -DCMAKE_CXX_COMPILER=/pkg/gnu/rocm/llvm/amd/hipcc/bin/hipcc \ + -DCMAKE_LINKER=/pkg/gnu/rocm/llvm/amd/hipcc/lib/llvm/bin/ld.lld \ + -DCMAKE_CXX_FLAGS="--rocm-device-lib-path=/pkg/gnu/rocm/llvm/amd/device-libs/amdgcn/bitcode -fuse-ld=lld" \ + -DAMDDeviceLibs_DIR=/pkg/gnu/rocm/llvm/amd/device-libs/lib/cmake/AMDDeviceLibs \ + -Damd_comgr_DIR=/pkg/gnu/rocm/llvm/amd/comgr/lib/cmake/amd_comgr \ + -Dhsa-runtime64_DIR=/pkg/gnu/rocm/systems/rocr-runtime/lib/cmake/hsa-runtime64 \ + -DGPU_TARGETS="gfx1150" +cmake --build . -j$(nproc) +cmake --install . +``` diff --git a/assets/var/gnu/rocm/libraries/rocroller.md b/assets/var/gnu/rocm/libraries/rocroller.md index 9e19289..a79ac76 100644 --- a/assets/var/gnu/rocm/libraries/rocroller.md +++ b/assets/var/gnu/rocm/libraries/rocroller.md @@ -2,30 +2,30 @@ rocm/libraries/rocroller 7.2.4 = https://github.com/ROCm/rocm-libraries/releases/download/rocm-7.2.4/rocroller.tar.gz -``` -cp /pkg/gnu/rocm/libraries/rocroller/src/lib/include/rocRoller/InstructionValues/Register_impl.hpp /pkg/gnu/rocm/libraries/rocroller/src/lib/include/rocRoller/InstructionValues/Register_impl.hpp.bkp -cp -f /pkg/gnu/rocm/libraries/rocroller/src/lib/include/rocRoller/InstructionValues/Register_impl.hpp.bkp /pkg/gnu/rocm/libraries/rocroller/src/lib/include/rocRoller/InstructionValues/Register_impl.hpp -sed -i 's/return val == 0;/return val == static_cast(0);/g' \ - /pkg/gnu/rocm/libraries/rocroller/src/lib/include/rocRoller/InstructionValues/Register_impl.hpp - -# 1. Восстанавливаем оригинал -cp -f /pkg/gnu/rocm/libraries/rocroller/src/lib/include/rocRoller/InstructionValues/Register_impl.hpp.bkp \ - /pkg/gnu/rocm/libraries/rocroller/src/lib/include/rocRoller/InstructionValues/Register_impl.hpp - -# 2. Применяем исправленный патч -# Заменяем "return val == 0;" на "return val == T{};" -# T{} для арифметических типов = 0, для __half = __half(), для E8M0 = E8M0() (default ctor) -sed -i 's/return val == 0;/return val == T{};/g' \ - /pkg/gnu/rocm/libraries/rocroller/src/lib/include/rocRoller/InstructionValues/Register_impl.hpp +``` env *** env *** +HIP_DEVICE_LIB_PATH=/pkg/gnu/rocm/llvm/amd/device-libs/amdgcn/bitcode +HIP_PATH=/pkg/gnu/rocm/systems/clr ``` +``` sh *** patch *** +sed -i '1i\#include ' /pkg/gnu/rocm/libraries/rocroller/src/lib/source/DataTypes_Utils.cpp +sed -i 's/return val == 0;/return val == T{};/g' /pkg/gnu/rocm/libraries/rocroller/src/lib/include/rocRoller/InstructionValues/Register_impl.hpp + +sed -i '/template <>$/,/^ }$/{ + /inline void EmitterOutput::output(Raw32& obj)/,/^ }$/{ + /^ }$/a\ +\ + template <>\ + inline void EmitterOutput::output(__half\& obj)\ + {\ + *emitter << static_cast(obj);\ + } + } +}' /pkg/gnu/rocm/libraries/rocroller/src/lib/include/rocRoller/Serialization/yaml-cpp/YAML.hpp +``` ``` sh *** build *** mkdir -p build; cd build -HIP_DEVICE_LIB_PATH=/pkg/gnu/rocm/llvm/amd/device-libs/amdgcn/bitcode \ -HIP_PATH=/pkg/gnu/rocm/systems/clr \ -CC=/pkg/gnu/rocm/llvm/amd/hipcc/lib/llvm/bin/clang \ -CXX=/pkg/gnu/rocm/llvm/amd/hipcc/bin/hipcc \ cmake .. \ -DCMAKE_INSTALL_PREFIX:PATH=/pkg/gnu/rocm/libraries/rocroller \ -DCMAKE_BUILD_TYPE=Release \ @@ -34,11 +34,7 @@ cmake .. \ -DGPU_BUILD_TARGETS=gfx1150 \ -DCMAKE_CXX_COMPILER=/pkg/gnu/rocm/llvm/amd/hipcc/bin/hipcc \ -DCMAKE_LINKER=/pkg/gnu/rocm/llvm/amd/hipcc/lib/llvm/bin/ld.lld \ - -DCMAKE_CXX_FLAGS="-fuse-ld=lld -Wno-deprecated-declarations" -CC=/pkg/gnu/rocm/llvm/amd/hipcc/lib/llvm/bin/clang \ -CXX=/pkg/gnu/rocm/llvm/amd/hipcc/bin/hipcc \ -HIP_DEVICE_LIB_PATH=/pkg/gnu/rocm/llvm/amd/device-libs/amdgcn/bitcode \ -HIP_PATH=/pkg/gnu/rocm/systems/clr \ + -DCMAKE_CXX_FLAGS="-fuse-ld=lld" cmake --build . -j$(nproc) cmake --install . ``` @@ -51,118 +47,3 @@ libdivide yaml-cpp msgpack-cxx ``` - -sed -i '/inline bool Value::isZeroLiteral() const/,/^ }$/{ - /inline bool Value::isZeroLiteral() const/,/^ }$/c\ - inline bool Value::isZeroLiteral() const\ - {\ - if(m_regType != Type::Literal)\ - return false;\ -\ - return std::visit(\ - [](auto const& val) -> bool {\ - using T = std::decay_t;\ - if constexpr(std::is_same_v)\ - return static_cast(val) == 0;\ - else if constexpr(std::is_same_v)\ - return val.desc0 == 0 && val.desc1 == 0 && val.desc2 == 0 && val.desc3 == 0;\ - else if constexpr(std::is_integral_v)\ - return val == 0;\ - else if constexpr(std::is_floating_point_v || std::is_same_v)\ - return val == static_cast(0);\ - else\ - return false;\ - },\ - m_literalValue);\ - } -}' Register_impl.hpp - -sed -i '/inline bool Value::isZeroLiteral() const/,/^ }$/{ - /inline bool Value::isZeroLiteral() const/,/^ }$/c\ - inline bool Value::isZeroLiteral() const\ - {\ - if(m_regType != Type::Literal)\ - return false;\ -\ - return std::visit(\ - [](auto const& val) -> bool {\ - using T = std::decay_t;\ - if constexpr(std::is_same_v)\ - return static_cast(val) == 0;\ - else if constexpr(std::is_same_v)\ - return val.desc0 == 0 && val.desc1 == 0 && val.desc2 == 0 && val.desc3 == 0;\ - else if constexpr(std::is_arithmetic_v || std::is_same_v)\ - return val == T{0};\ - else\ - return false;\ - },\ - m_literalValue);\ - } -}' Register_impl.hpp - - -DCMAKE_C_COMPILER=/pkg/gnu/rocm/llvm/amd/hipcc/lib/llvm/bin/clang \ - -DCMAKE_CXX_FLAGS="-fuse-ld=lld -stdlib=libc++" - -sed -i 's/return val == static_cast(0);/if constexpr(std::is_same_v) return false; else return val == static_cast(0);/g' Register_impl.hpp - -sed -i '/return val == static_cast(0);/c\ - else if constexpr(std::is_arithmetic_v || std::is_same_v)\ - return val == static_cast(0);\ - else\ - return false;' Register_impl.hpp - - -sed -i '/inline bool Value::isZeroLiteral/,/^ }$/c\ - inline bool Value::isZeroLiteral() const\ - {\ - if(m_regType != Type::Literal)\ - return false;\ -\ - return std::visit(\ - [](auto const& val) -> bool {\ - using T = std::decay_t;\ - if constexpr(std::is_same_v)\ - return static_cast(val) == 0;\ - else if constexpr(std::is_same_v)\ - return val.desc0 == 0 && val.desc1 == 0 && val.desc2 == 0 && val.desc3 == 0;\ - else if constexpr(std::is_arithmetic_v || std::is_same_v\ - || std::is_same_v\ - || std::is_same_v\ - || std::is_same_v\ - || std::is_same_v\ - || std::is_same_v\ - || std::is_same_v\ - || std::is_same_v)\ - return val == static_cast(0);\ - else\ - return false;\ - },\ - m_literalValue);\ - }' Register_impl.hpp - - -sed -i '/return std::visit(/,/m_literalValue);/{ - s/return static_cast(val) == 0.0f;/using T = std::decay_t;\ - if constexpr(std::is_same_v)\ - return static_cast(val) == 0;\ - else if constexpr(std::is_same_v)\ - return val.desc0 == 0 \&\& val.desc1 == 0 \&\& val.desc2 == 0 \&\& val.desc3 == 0;\ - else if constexpr(std::is_arithmetic_v)\ - return val == decltype(val)(0);\ - else\ - return false;/ -}' /pkg/gnu/rocm/libraries/rocroller/src/lib/include/rocRoller/InstructionValues/Register_impl.hpp - -sed -i '/return std::visit(/,/m_literalValue);/{ - s/return val == 0;/using T = std::decay_t;\ - if constexpr(std::is_same_v)\ - return static_cast(val) == 0;\ - else if constexpr(std::is_same_v)\ - return val.desc0 == 0 \&\& val.desc1 == 0 \&\& val.desc2 == 0 \&\& val.desc3 == 0;\ - else if constexpr(std::is_same_v)\ - return static_cast(val) == 0.0f;\ - else if constexpr(std::is_arithmetic_v)\ - return val == 0;\ - else\ - return false;/ -}' /pkg/gnu/rocm/libraries/rocroller/src/lib/include/rocRoller/InstructionValues/Register_impl.hpp diff --git a/assets/var/gnu/rocm/libraries/rocsolver.md b/assets/var/gnu/rocm/libraries/rocsolver.md new file mode 100644 index 0000000..27ac53e --- /dev/null +++ b/assets/var/gnu/rocm/libraries/rocsolver.md @@ -0,0 +1,77 @@ +rocm/libraries/rocsolver 7.2.4 += +https://github.com/ROCm/rocm-libraries/releases/download/rocm-7.2.4/rocsolver.tar.gz + +``` env *** env *** +HIP_DEVICE_LIB_PATH=/pkg/gnu/rocm/llvm/amd/device-libs/amdgcn/bitcode +HIP_PATH=/pkg/gnu +ROCM_PATH=/pkg/gnu +``` + +export HIP_DEVICE_LIB_PATH=/pkg/gnu/rocm/llvm/amd/device-libs/amdgcn/bitcode +export HIP_PATH=/pkg/gnu +export ROCM_PATH=/pkg/gnu + +[root@xuy /pkg/gnu/rocm/libraries/rocsolver/src/build]$ export HIP_CLANG_PATH=/pkg/gnu/rocm/llvm/amd/hipcc/lib/llvm/bin +export ROCM_PATH=/pkg/gnu/rocm +export HIP_DEVICE_LIB_PATH=/pkg/gnu/rocm/llvm/amd/device-libs/amdgcn/bitcode + +echo '#include +#include +__global__ void test() { double x = sqrt(2.0); }' > /tmp/test_sqrt.hip + +$HIP_CLANG_PATH/clang++ \ + --rocm-path=$ROCM_PATH \ + --offload-arch=gfx1150 \ + --rocm-device-lib-path=$HIP_DEVICE_LIB_PATH \ + -x hip -c /tmp/test_sqrt.hip -o /tmp/test_sqrt.o 2>&1 + +echo "Exit code: $?" +/tmp/test_sqrt.hip:2:10: fatal error: 'hip/hip_math_functions.h' file not found + 2 | #include + | ^~~~~~~~~~~~~~~~~~~~~~~~~~ +1 error generated when compiling for gfx1150. +Exit code: 1 + + + +``` sh *** patch *** +sed -i \ + -e '/#include "rocsolver_run_specialized_kernels.hpp"/a #include ' \ + -e 's/\bmin(n, LARF_SSKER_BLOCKS)/std::min(n, LARF_SSKER_BLOCKS)/g' \ + /pkg/gnu/rocm/libraries/rocsolver/src/library/src/specialized/rocauxiliary_larf_specialized_kernels.hpp +sed -i \ + -e '/#include /d' \ + -e 's/std::min(n, LARF_SSKER_BLOCKS)/((n) < (LARF_SSKER_BLOCKS) ? (n) : (LARF_SSKER_BLOCKS))/g' \ + -e 's/\bmin(m, LARF_SSKER_BLOCKS)/((m) < (LARF_SSKER_BLOCKS) ? (m) : (LARF_SSKER_BLOCKS))/g' \ + /pkg/gnu/rocm/libraries/rocsolver/src/library/src/specialized/rocauxiliary_larf_specialized_kernels.hpp +``` + +grep -n -E '(#include |std::min\(n, LARF_SSKER_BLOCKS\))' \ + /pkg/gnu/rocm/libraries/rocsolver/src/library/src/specialized/rocauxiliary_larf_specialized_kernels.hpp + +``` sh *** build *** +mkdir -p build; cd build +cmake .. \ + -DCMAKE_INSTALL_PREFIX=/pkg/gnu/rocm/libraries/rocsolver \ + -DCMAKE_C_COMPILER=/pkg/gnu/rocm/llvm/bin/amdclang \ + -DCMAKE_CXX_COMPILER=/pkg/gnu/rocm/llvm/bin/clang++ \ + -DAMDDeviceLibs_DIR=/pkg/gnu/rocm/llvm/amd/device-libs/lib/cmake/AMDDeviceLibs \ + -Damd_comgr_DIR=/pkg/gnu/rocm/llvm/amd/comgr/lib/cmake/amd_comgr \ + -DCMAKE_CXX_FLAGS="--rocm-device-lib-path=/pkg/gnu/rocm/llvm/amd/device-libs/amdgcn/bitcode -fuse-ld=lld" \ + -Dhsa-runtime64_DIR=/pkg/gnu/rocm/systems/rocr-runtime/lib/cmake/hsa-runtime64 \ + -DGPU_TARGETS="gfx1150" +cmake --build . -j$(nproc) +cmake --install . +``` + +``` cfg *** build deps *** +rocm/libraries/rocprim +``` + + -DCMAKE_C_COMPILER=/pkg/gnu/rocm/llvm/amd/hipcc/lib/llvm/bin/clang \ + -DCMAKE_CXX_COMPILER=/pkg/gnu/rocm/llvm/amd/hipcc/bin/hipcc \ + -DCMAKE_CXX_FLAGS="--rocm-device-lib-path=/pkg/gnu/rocm/llvm/amd/device-libs/amdgcn/bitcode -fuse-ld=lld" \ + + -DCMAKE_LINKER=/pkg/gnu/rocm/llvm/amd/hipcc/lib/llvm/bin/ld.lld \ + diff --git a/assets/var/gnu/rocm/llvm.md b/assets/var/gnu/rocm/llvm.md index 67ae69a..93696ae 100644 --- a/assets/var/gnu/rocm/llvm.md +++ b/assets/var/gnu/rocm/llvm.md @@ -1,12 +1,47 @@ rocm/llvm 7.2.4 = +https://github.com/ROCm/llvm-project/archive/refs/tags/therock-7.14.tar.gz + https://github.com/ROCm/llvm-project/archive/refs/tags/rocm-7.2.4.tar.gz -``` env *** env *** -disable=true +``` sh *** build *** +mkdir -p build; cd build +cmake ../llvm \ + -DCMAKE_INSTALL_PREFIX="$pkgpath" \ + -DCMAKE_BUILD_TYPE=Release \ + -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86" \ + -DLLVM_ENABLE_PROJECTS="clang;lld" \ + -DLLVM_ENABLE_RUNTIMES="compiler-rt" \ + -DCLANG_DEFAULT_RTLIB=compiler-rt \ + -DCLANG_DEFAULT_UNWINDLIB=libgcc \ + -DLLVM_ENABLE_LLD=ON +cmake --build . -j$(nproc) +cmake --install . ``` -``` sh *** patch *** +``` sh *** tmp disable config *** +``` + +``` cfg *** build deps *** +boost +``` + + -DLLVM_INCLUDE_BENCHMARKS=OFF \ + -DLLVM_INCLUDE_TESTS=OFF \ + -DLLVM_INCLUDE_EXAMPLES=OFF \ + -DLLVM_INCLUDE_DOCS=OFF \ + -DCLANG_INCLUDE_TESTS=OFF \ + +# patch +sed -i 's/^#define _fmaxd max$/#define _fmaxd fmax/; s/^#define _fmaxf max$/#define _fmaxf fmaxf/' lib/clang/22/include/__clang_cuda_complex_builtins.h +sed -i 's/^#define _fmaxd fmax$/#define _fmaxd __builtin_fmax/; s/^#define _fmaxf fmaxf$/#define _fmaxf __builtin_fmaxf/' \ + /pkg/gnu/rocm/llvm/lib/clang/22/include/__clang_cuda_complex_builtins.h + +# unpatch +sed -i 's/^#define _fmaxd __builtin_fmax$/#define _fmaxd max/; s/^#define _fmaxf __builtin_fmaxf$/#define _fmaxf max/' \ + /pkg/gnu/rocm/llvm/lib/clang/22/include/__clang_cuda_complex_builtins.h + +``` FILE=compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp sed -i 's|^#include |#if __has_include()\n#include \n#define SANITIZER_HAS_SCC_H 1\n#else\n#define SANITIZER_HAS_SCC_H 0\n#endif|' "$FILE" sed -i '/unsigned struct_scc_modem_sz = sizeof(struct scc_modem);/c\ @@ -22,26 +57,3 @@ sed -i '/unsigned struct_scc_stat_sz = sizeof(struct scc_stat);/c\ unsigned struct_scc_stat_sz = 0;\ #endif' "$FILE" ``` - -``` sh *** build *** -mkdir -p build; cd build -cmake ../llvm \ - -DCMAKE_INSTALL_PREFIX="$pkgpath" \ - -DCMAKE_BUILD_TYPE=Release \ - -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86" \ - -DLLVM_ENABLE_PROJECTS="clang;lld" \ - -DLLVM_ENABLE_RUNTIMES="compiler-rt" \ - -DLLVM_INCLUDE_BENCHMARKS=OFF \ - -DLLVM_INCLUDE_TESTS=OFF \ - -DLLVM_INCLUDE_EXAMPLES=OFF \ - -DLLVM_INCLUDE_DOCS=OFF \ - -DCLANG_INCLUDE_TESTS=OFF -cmake --build . -j$(nproc) -cmake --install . -``` - -``` sh *** config *** -sed -i 's/^#define _fmaxd max$/#define _fmaxd fmax/; s/^#define _fmaxf max$/#define _fmaxf fmaxf/' lib/clang/22/include/__clang_cuda_complex_builtins.h -sed -i 's/^#define _fmaxd fmax$/#define _fmaxd __builtin_fmax/; s/^#define _fmaxf fmaxf$/#define _fmaxf __builtin_fmaxf/' \ - /pkg/gnu/rocm/llvm/lib/clang/22/include/__clang_cuda_complex_builtins.h -``` diff --git a/assets/var/gnu/rocm/llvm/amd/device-libs.md b/assets/var/gnu/rocm/llvm/amd/device-libs.md index 2a0b8c6..b22b15a 100644 --- a/assets/var/gnu/rocm/llvm/amd/device-libs.md +++ b/assets/var/gnu/rocm/llvm/amd/device-libs.md @@ -6,10 +6,13 @@ https://github.com/ROCm/llvm-project/archive/refs/tags/rocm-7.2.4.tar.gz mkdir -p build cd build cmake ../amd/device-libs \ - -DCMAKE_INSTALL_PREFIX="$pkgpath" \ + -DCMAKE_INSTALL_PREFIX=/pkg/gnu/rocm/llvm/amd/device-libs \ -DCMAKE_BUILD_TYPE=Release \ - -DROCmCMakeBuildTools_DIR=/pkg/gnu/rocm/cmake/share/rocmcmakebuildtools/cmake \ - -DLLVM_DIR=/pkg/gnu/rocm/llvm/lib/cmake/llvm + -DCMAKE_C_COMPILER=/pkg/gnu/rocm/llvm/bin/clang \ + -DCMAKE_CXX_COMPILER=/pkg/gnu/rocm/llvm/bin/clang++ \ + -DLLVM_DIR=/pkg/gnu/rocm/llvm/lib/cmake/llvm \ + -DClang_DIR=/pkg/gnu/rocm/llvm/lib/cmake/clang \ + -DROCmCMakeBuildTools_DIR=/pkg/gnu/rocm/cmake/share/rocmcmakebuildtools/cmake cmake --build . -j$(nproc) cmake --install . ``` @@ -17,3 +20,10 @@ cmake --install . ``` cfg *** build deps *** rocm/cmake ``` + +cmake ../amd/device-libs \ + -DCMAKE_INSTALL_PREFIX="$pkgpath" \ + -DCMAKE_BUILD_TYPE=Release \ + -DROCmCMakeBuildTools_DIR=/pkg/gnu/rocm/cmake/share/rocmcmakebuildtools/cmake \ + -DLLVM_DIR=/pkg/gnu/rocm/llvm/lib/cmake/llvm + diff --git a/assets/var/gnu/rocm/llvm/amd/hipcc.md b/assets/var/gnu/rocm/llvm/amd/hipcc.md index 320bd05..5dec2ae 100644 --- a/assets/var/gnu/rocm/llvm/amd/hipcc.md +++ b/assets/var/gnu/rocm/llvm/amd/hipcc.md @@ -16,4 +16,5 @@ mkdir -p share/hip; echo "HIP_VERSION=7.2.4" > share/hip/version mkdir -p lib/llvm/bin ln -sf /pkg/gnu/rocm/llvm/bin/clang++ lib/llvm/bin/clang++ ln -sf /pkg/gnu/rocm/llvm/bin/clang lib/llvm/bin/clang +ln -sf /pkg/gnu/bin/rocm_agent_enumerator bin/rocm_agent_enumerator ``` diff --git a/assets/var/gnu/rocm/systems/clr.md b/assets/var/gnu/rocm/systems/clr.md index 8f6c2a8..d98a627 100644 --- a/assets/var/gnu/rocm/systems/clr.md +++ b/assets/var/gnu/rocm/systems/clr.md @@ -2,6 +2,10 @@ rocm/systems/clr 7.2.4 = https://github.com/ROCm/rocm-systems/archive/refs/tags/rocm-7.2.4.tar.gz +``` env *** env *** +disable=true +``` + ``` sh *** build *** pip3 install CppHeaderParser mkdir -p build; cd build @@ -22,9 +26,8 @@ cmake --install . ``` sh *** config *** mkdir -p /pkg/gnu/rocm/systems/clr/lib/llvm/bin -ln -sf /pkg/gnu/rocm/llvm/amd/hipcc/lib/llvm/bin/clang++ lib/llvm/bin/clang++ -ln -sf /pkg/gnu/rocm/llvm/amd/hipcc/lib/llvm/bin/clang lib/llvm/bin/clang -ln -sf /pkg/gnu/rocm/systems/rocminfo/bin/rocm_agent_enumerator bin/rocm_agent_enumerator +ln -sf /pkg/gnu/rocm/llvm/amd/hipcc/lib/llvm/bin/clang++ /pkg/gnu/rocm/systems/clr/lib/llvm/bin/clang++ +ln -sf /pkg/gnu/rocm/llvm/amd/hipcc/lib/llvm/bin/clang /pkg/gnu/rocm/systems/clr/lib/llvm/bin/clang ``` ``` cfg *** build deps *** diff --git a/assets/var/gnu/rocm/systems/rocr-runtime.md b/assets/var/gnu/rocm/systems/rocr-runtime.md index 7db7839..c17287b 100644 --- a/assets/var/gnu/rocm/systems/rocr-runtime.md +++ b/assets/var/gnu/rocm/systems/rocr-runtime.md @@ -13,7 +13,7 @@ cmake ../projects/rocr-runtime \ -DCMAKE_INSTALL_PREFIX="$pkgpath" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_LIBDIR=lib \ - -DTARGET_DEVICES=gfx1150 \ + -DTARGET_DEVICES="gfx90a;gfx90c;gfx700;gfx701;gfx702;gfx801;gfx802;gfx803;gfx805;gfx810;gfx900;gfx902;gfx904;gfx906;gfx908;gfx909;gfx942;gfx950;gfx1010;gfx1011;gfx1012;gfx1013;gfx1030;gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036;gfx1100;gfx1101;gfx1102;gfx1103;gfx1150;gfx1151;gfx1152;gfx1153;gfx1200;gfx1201" \ -DCMAKE_C_COMPILER=/pkg/gnu/rocm/llvm/bin/clang \ -DCMAKE_CXX_COMPILER=/pkg/gnu/rocm/llvm/bin/clang++ \ -DLLVM_TOOLS_BINARY_DIR=/pkg/gnu/rocm/llvm/bin \ @@ -22,7 +22,3 @@ cmake ../projects/rocr-runtime \ cmake --build . -j$(nproc) cmake --install . ``` - - - -DTARGET_DEVICES=gfx1150 \ - -DTARGET_DEVICES="gfx700;gfx701;gfx702;gfx801;gfx802;gfx803;gfx805;gfx810;gfx900;gfx902;gfx904;gfx906;gfx908;gfx909;gfx90a;gfx90c;gfx942;gfx950;gfx1010;gfx1011;gfx1012;gfx1013;gfx1030;gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036;gfx1100;gfx1101;gfx1102;gfx1103;gfx1150;gfx1151;gfx1152;gfx1153;gfx1200;gfx1201" \ diff --git a/assets/var/gnu/rustup.md b/assets/var/gnu/rustup.md index 7c3c2a3..ffd0b5e 100644 --- a/assets/var/gnu/rustup.md +++ b/assets/var/gnu/rustup.md @@ -29,4 +29,8 @@ low-speed-limit = 1024 [net] retry = 5 EOF + +mkdir -p share/zsh/site-functions +rustup completions zsh > share/zsh/site-functions/_rustup +rustup completions zsh cargo > share/zsh/site-functions/_cargo ``` diff --git a/assets/var/gnu/slint-prebuild.md b/assets/var/gnu/slint-prebuild.md new file mode 100644 index 0000000..3621fd7 --- /dev/null +++ b/assets/var/gnu/slint-prebuild.md @@ -0,0 +1,7 @@ +slint-prebuild 1.17.1 += +https://github.com/slint-ui/slint/releases/download/v1.17.1/Slint-cpp-1.17.1-Linux-x86_64.tar.gz + +``` sh *** build *** +mv * .. +``` diff --git a/assets/var/gnu/slint.md b/assets/var/gnu/slint.md new file mode 100644 index 0000000..4460d50 --- /dev/null +++ b/assets/var/gnu/slint.md @@ -0,0 +1,50 @@ +slint 1.17.1 += +https://github.com/slint-ui/slint/archive/refs/tags/v1.17.1.tar.gz + +``` env *** env *** +CARGO_PROFILE_RELEASE_LTO=fat +CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1 +CARGO_PROFILE_RELEASE_STRIP=symbols +CARGO_PROFILE_RELEASE_OPT_LEVEL=z +CARGO_PROFILE_RELEASE_PANIC=abort +CARGO_PROFILE_RELEASE_DEBUG=false +CARGO_INCREMENTAL=false +CARGO_NET_OFFLINE=true +``` + +``` sh *** patch *** +cat <> /pkg/gnu/slint/src/.cargo/config.toml + +[profile.release] +lto = "fat" +codegen-units = 1 +strip = "symbols" +opt-level = "z" +panic = "abort" +debug = false + +# Remove absolute paths from the binary +[build] +rustflags = ["--remap-path-prefix=/pkg/gnu/rustup/registry/src=/src", "--remap-path-prefix=/rustc=/rustc", "-Cpanic=abort"] +EOF +``` + + +``` sh *** build *** +mkdir -p build; cd build +cmake -DCMAKE_INSTALL_PREFIX="$pkgpath" \ + -DCMAKE_BUILD_TYPE=MinSizeRel \ + -DBUILD_SHARED_LIBS=OFF \ + -DBUILD_TESTING=OFF \ + -DSLINT_FEATURE_RENDERER_FEMTOVG=OFF \ + -DSLINT_FEATURE_RENDERER_SOFTWARE=ON \ + -DSLINT_FEATURE_INTERPRETER=OFF \ + -DSLINT_FEATURE_ACCESSIBILITY=OFF \ + -DSLINT_FEATURE_TESTING=OFF \ + -DSLINT_FEATURE_BACKEND_WINIT_X11=OFF \ + -DSLINT_FEATURE_BACKEND_WINIT_WAYLAND=ON \ + -G Ninja .. +cmake --build . +cmake --install . +``` diff --git a/assets/var/gnu/slint_pzd.md b/assets/var/gnu/slint_pzd.md new file mode 100644 index 0000000..6ac4668 --- /dev/null +++ b/assets/var/gnu/slint_pzd.md @@ -0,0 +1,50 @@ +slint 1.17.1 += +https://github.com/slint-ui/slint/archive/refs/tags/v1.17.1.tar.gz + +``` sh *** patch *** +# Remap путей (будет работать при прямой сборке cargo) +cat >> /pkg/gnu/slint/src/.cargo/config.toml << 'EOF' + +[build] +rustflags = ["--remap-path-prefix=/pkg/gnu/rustup/registry/src=/src", "--remap-path-prefix=/rustc=/rustc"] +EOF +``` + +``` env *** env *** +CARGO_INCREMENTAL=false +CARGO_NET_OFFLINE=true +``` + +``` sh *** build *** +cd /pkg/gnu/slint/src + +# Собираем slint-cpp напрямую через Cargo (НЕ через CMake/Corrosion) +cargo build --release \ + -p slint-cpp \ + --no-default-features \ + --features "compiler,backend-winit,renderer-software" + +# Генерируем CMake-конфиги и устанавливаем через CMake, +# но указываем уже собранный компилятор и библиотеку +mkdir -p build && cd build +cmake -DCMAKE_INSTALL_PREFIX="$pkgpath" \ + -DCMAKE_BUILD_TYPE=MinSizeRel \ + -DBUILD_SHARED_LIBS=OFF \ + -DBUILD_TESTING=OFF \ + -DSLINT_COMPILER=/pkg/gnu/slint/src/target/release/slint-compiler \ + -DSLINT_FEATURE_RENDERER_FEMTOVG=OFF \ + -DSLINT_FEATURE_RENDERER_SOFTWARE=ON \ + -DSLINT_FEATURE_INTERPRETER=OFF \ + -DSLINT_FEATURE_ACCESSIBILITY=OFF \ + -DSLINT_FEATURE_TESTING=OFF \ + -DSLINT_FEATURE_BACKEND_WINIT_X11=OFF \ + -DSLINT_FEATURE_BACKEND_WINIT_WAYLAND=ON \ + -DCMAKE_CXX_FLAGS="-fno-asynchronous-unwind-tables -fno-exceptions -fno-rtti" \ + -G Ninja .. +cmake --build . +cmake --install . + +# Копируем статическую библиотеку из cargo target поверх cmake-шной +cp /pkg/gnu/slint/src/target/release/libslint_cpp.a "$pkgpath/lib/libslint_cpp.a" +``` diff --git a/assets/var/gnu/sqlite.md b/assets/var/gnu/sqlite.md index 1187dea..a9d914c 100644 --- a/assets/var/gnu/sqlite.md +++ b/assets/var/gnu/sqlite.md @@ -3,7 +3,7 @@ sqlite 3.50.4 https://www.sqlite.org/2025/sqlite-autoconf-3500400.tar.gz ``` sh *** build *** -./configure --prefix=/pkg/gnu/sqlite +./configure --prefix=$pkgpath --fts5 make -j$(nproc) make install ``` diff --git a/assets/var/gnu/svelte.md b/assets/var/gnu/svelte.md new file mode 100644 index 0000000..6be25e1 --- /dev/null +++ b/assets/var/gnu/svelte.md @@ -0,0 +1,3 @@ +svelte 5.56.8 += +https://github.com/sveltejs/svelte/archive/refs/tags/svelte@5.56.8.tar.gz diff --git a/assets/var/gnu/tcpdump.md b/assets/var/gnu/tcpdump.md new file mode 100644 index 0000000..f8e8861 --- /dev/null +++ b/assets/var/gnu/tcpdump.md @@ -0,0 +1,13 @@ +tcpdump += +https://www.tcpdump.org/release/tcpdump-4.99.6.tar.xz + +``` sh *** build *** +./configure --prefix=$pkgpath +make -j$(nproc) +make install +``` + +``` cfg *** build deps *** +libpcap +``` diff --git a/assets/var/gnu/tree-sitter/cli.md b/assets/var/gnu/tree-sitter/cli.md new file mode 100644 index 0000000..fa27e28 --- /dev/null +++ b/assets/var/gnu/tree-sitter/cli.md @@ -0,0 +1,11 @@ +tree-sitter/cli 0.25.10 += +https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v0.25.10.tar.gz + +``` sh *** build *** +mkdir -p ../bin +cd cli +cargo build --release +cp -l ../target/release/tree-sitter ../../bin/ +``` + diff --git a/assets/var/gnu/unitprint/backend-local.md b/assets/var/gnu/unitprint/backend-local.md new file mode 100644 index 0000000..2fb1670 --- /dev/null +++ b/assets/var/gnu/unitprint/backend-local.md @@ -0,0 +1,20 @@ + + + + + + + + +cargo new backend-local + + +``` cfg *** run deps *** +cups +cups-filters +foomatic-db +foomatic-db-engine +hplip +``` + +Для раздачи инета службу поднять/конфиг сделать под unitprint ей diff --git a/assets/var/gnu/unitprint/backend.md b/assets/var/gnu/unitprint/backend.md new file mode 100644 index 0000000..e69de29 diff --git a/assets/var/gnu/unitprint/backend/scan.md b/assets/var/gnu/unitprint/backend/scan.md new file mode 100644 index 0000000..e69de29 diff --git a/assets/var/gnu/unitprint/backend/scan/DocRes.md b/assets/var/gnu/unitprint/backend/scan/DocRes.md new file mode 100644 index 0000000..26be60e --- /dev/null +++ b/assets/var/gnu/unitprint/backend/scan/DocRes.md @@ -0,0 +1,60 @@ +unitprint/backend/scan/DocRes += +https://github.com/ZZZHANG-jx/DocRes.git + +``` sh *** build *** +mv * .. +``` + +``` sh *** config *** +ln -sf /pkg/gnu/unitprint/backend/scan/venv +source venv/bin/activate +pip install einops scikit-image opencv-python-headless tqdm +``` + +``` sh *** upload_weights *** +mkdir -p data/weights +#rsync -avz ~/Downloads/mbd.pkl a:/pkg/gnu/unitprint/backend/scan/DocRes/data/weights +#rsync -avz ~/Downloads/docres.pkl a:/pkg/gnu/unitprint/backend/scan/DocRes/data/weights +``` + +mkdir -p ~/.config/miopen +export MIOPEN_USER_DB_PATH="/root/.config/miopen" +export MIOPEN_FIND_MODE=3 +export HIP_VISIBLE_DEVICES=0 + +time ../../venv/bin/python inference.py \ + --task deshadowing \ + --im_path ./IMG_20260905_172410_rec.jpg \ + --out_folder ./ + +time python inference.py \ + --task appearance \ + --im_path ./output_pipeline/IMG_20260905_172410_rec_deshadowing.png \ + --out_folder ./output_pipeline + +time python inference.py \ + --task deblurring \ + --im_path ./output_pipeline/IMG_20260905_172410_rec_deshadowing_appearance.png \ + --out_folder ./output_pipeline + +time python inference.py \ + --task deblurring \ + --im_path ../../DocScanner/src/rectified/IMG_20260905_172410_rec.png \ + --out_folder ./output_pipeline + +time python inference.py \ + --task appearance \ + --im_path ./output_pipeline/IMG_20260905_172410_rec_deblurring.png \ + --out_folder ./output_pipeline + +# 3. Appearance +time python inference.py \ + --task appearance \ + --im_path ./output_pipeline/IMG_20260905_172410_rec_deshadowing.png \ + --out_folder ./output_pipeline + +time python inference.py \ + --task dewarping \ + --im_path /pkg/gnu/unitprint/DocScanner/src/distorted/IMG_20260905_172410.jpg \ + --out_folder ./output_pipeline diff --git a/assets/var/gnu/unitprint/backend/scan/DocScanner.md b/assets/var/gnu/unitprint/backend/scan/DocScanner.md new file mode 100644 index 0000000..135f914 --- /dev/null +++ b/assets/var/gnu/unitprint/backend/scan/DocScanner.md @@ -0,0 +1,23 @@ +unitprint/backend/scan/DocScanner += +https://root-kit.ru/UnitPrint/scan-DocScanner.git + +``` sh *** build *** +mv * .. +``` + +``` sh *** config *** +ln -sf /pkg/gnu/unitprint/backend/scan/venv +source venv/bin/activate +pip install pip setuptools wheel +ROCM_SDK_TARGETS="gfx1150" pip install torch torchvision --index-url https://download.pytorch.org/whl/rocm7.14 +pip install numpy opencv-python Pillow scikit-image tqdm natsort matplotlib +``` + +``` sh *** upload_weights *** +source venv/bin/activate +pip install gdown +gdown --folder "https://drive.google.com/drive/folders/1W1_DJU8dfEh6FqDYqFQ7ypR38Z8c5r4D" +mkdir -p model_pretrained +mv DocScanner-L-Model/*.pth model_pretrained/ +``` diff --git a/assets/var/gnu/unitprint/certs.md b/assets/var/gnu/unitprint/certs.md new file mode 100644 index 0000000..978fcf1 --- /dev/null +++ b/assets/var/gnu/unitprint/certs.md @@ -0,0 +1,12 @@ + + +chgrp -R nginx /pkg/gnu/unitprint/certs +chmod 750 /pkg/gnu/unitprint/certs +chmod 640 /pkg/gnu/unitprint/certs/fullchain.pem +chmod 640 /pkg/gnu/unitprint/certs/fullchain.pem + + +# free bsd +rsync -aL root@d:/usr/local/etc/letsencrypt/live/unitprint.ru/fullchain.pem /pkg/gnu/unitprint/certs/ +rsync -aL root@d:/usr/local/etc/letsencrypt/live/unitprint.ru/privkey.pem /pkg/gnu/unitprint/certs/ + diff --git a/assets/var/gnu/unitprint/openclaw.md b/assets/var/gnu/unitprint/openclaw.md new file mode 100644 index 0000000..62544a7 --- /dev/null +++ b/assets/var/gnu/unitprint/openclaw.md @@ -0,0 +1,14 @@ + +``` env *** env *** +TZ=Europe/Moscow +OPENCLAW_STATE_DIR=/pkg/gnu/unitprint/openclaw/var +OPENCLAW_CONFIG_PATH=/pkg/gnu/unitprint/openclaw/etc/openclaw.json +HTTP_PROXY=http://127.0.0.1:12334 +HTTPS_PROXY=http://127.0.0.1:12334 +``` + +``` sh *** config *** +openclaw --profile unitprint onboard --install-daemon +openclaw config set agents.defaults.workspace /pkg/gnu/unitprint/openclaw/var/workspace +openclaw --profile unitprint config set gateway.port 18790 +``` diff --git a/assets/var/gnu/unitprint/slint-app.md b/assets/var/gnu/unitprint/slint-app.md new file mode 100644 index 0000000..21812f0 --- /dev/null +++ b/assets/var/gnu/unitprint/slint-app.md @@ -0,0 +1,28 @@ +unitprint/slint-app += + +``` sh *** build *** +cmake -DCMAKE_INSTALL_PREFIX="$pkgpath" \ + -DCMAKE_BUILD_TYPE=MinSizeRel \ + -DSLINT_STYLE=cosmic \ + -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_CXX_FLAGS="-fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti" \ + -DCMAKE_EXE_LINKER_FLAGS="-Wl,--gc-sections -Wl,--strip-all -Wl,-z,norelro" \ + -G Ninja .. +ninja +ninja install +``` + +``` sh *** test_xz *** +xz -9e -k --check=crc32 slint_test && du -sh slint_test.xz +``` + +``` sh *** test_symbols *** +strings slint_test | grep -c ' share/zsh/zshrc-auto.d/zoxide.zsh +cd bin +cp -l zoxide z +cp -l z Z +``` + diff --git a/assets/var/gnu/zsh.md b/assets/var/gnu/zsh.md index 3cbf049..2dfea4d 100644 --- a/assets/var/gnu/zsh.md +++ b/assets/var/gnu/zsh.md @@ -2,12 +2,12 @@ zsh 5.9.0.2 = https://github.com/zsh-users/zsh/archive/refs/tags/zsh-5.9.0.2-test.tar.gz - ``` sh *** build *** autoreconf --install ./configure \ --prefix=/pkg/gnu/zsh \ --enable-etcdir=/pkg/gnu/zsh/etc \ + --enable-additional-fpath=/pkg/gnu/share/zsh/site-functions \ --enable-multibyte \ --enable-pcre \ --enable-cap @@ -17,6 +17,7 @@ make install.bin install.modules install.fns ``` sh *** config *** mkdir -p /pkg/gnu/zsh/etc + cat > /pkg/gnu/zsh/etc/zprofile << 'EOF' if [ -d /pkg/gnu/s6/etc/envdir ]; then for f in /pkg/gnu/s6/etc/envdir/*; do @@ -24,5 +25,15 @@ if [ -d /pkg/gnu/s6/etc/envdir ]; then done fi EOF -echo "PROMPT='[%n@%m %~]$ '\nalias ls='ls --color=auto'\nsetopt no_hup\nsetopt no_checkjobs\nsetopt RM_STAR_SILENT" > /pkg/gnu/zsh/etc/zshrc + +cat > /pkg/gnu/zsh/etc/zshrc << 'EOF' +autoload -Uz compinit && compinit + +for f in /pkg/gnu/share/zsh/zshrc-auto.d/*.zsh(N); do + . "$f" +done + +PROMPT='[%n@%m %~]$ ' +setopt NO_HUP NO_CHECKJOBS RM_STAR_SILENT +EOF ``` diff --git a/assets/var/gnu/zsh/completions.md b/assets/var/gnu/zsh/completions.md new file mode 100644 index 0000000..245a604 --- /dev/null +++ b/assets/var/gnu/zsh/completions.md @@ -0,0 +1,8 @@ +zsh/completions += +https://github.com/zsh-users/zsh-completions/archive/refs/tags/0.36.0.tar.gz + +``` sh *** build *** +mkdir -p ../share/zsh/site-functions +cp -l src/* ../share/zsh/site-functions +``` diff --git a/install.sh b/install.sh index d9954a4..159f62d 100755 --- a/install.sh +++ b/install.sh @@ -20,9 +20,12 @@ mkdir -p "$SCRIPT_DIR/target/release/bin" cp -f "$SCRIPT_DIR/target/release/pkg" "$SCRIPT_DIR/target/release/bin" echo "Installing to '$INSTALL_PATH'..." -rsync -a --delete "$SCRIPT_DIR/assets/" "$SCRIPT_DIR/target/release/bin" "$INSTALL_PATH/" -#rsync -a --delete "$SCRIPT_DIR/assets/" "$SCRIPT_DIR/target/release/bin" air:"$INSTALL_PATH/" -rsync -a --delete "$SCRIPT_DIR/assets/" "$SCRIPT_DIR/target/release/bin" root@aura:"$INSTALL_PATH/" +rsync -a --delete --exclude='etc/' "$SCRIPT_DIR/assets/" "$SCRIPT_DIR/target/release/bin" "$INSTALL_PATH/" +PATH="/bin:/pkg/musl/bin:/pkg/musl/sbin:/pkg/gnu/bin:/pkg/gnu/sbin" chroot /mnt/aerolinux /pkg/gnu/aeropkg/bin/pkg link aeropkg +rsync -a --delete --exclude='etc/index-conflict.md' "$SCRIPT_DIR/assets/" "$SCRIPT_DIR/target/release/bin" air:"$INSTALL_PATH/" +ssh air /pkg/gnu/aeropkg/bin/pkg link aeropkg +rsync -a --delete --exclude='etc/index-conflict.md' "$SCRIPT_DIR/assets/" "$SCRIPT_DIR/target/release/bin" aura:"$INSTALL_PATH/" +ssh aura /pkg/gnu/aeropkg/bin/pkg link aeropkg BIN_PATH="$INSTALL_PATH/bin/pkg" if [ -f "$BIN_PATH" ]; then diff --git a/src/commands/download.rs b/src/commands/download.rs new file mode 100644 index 0000000..73bb33b --- /dev/null +++ b/src/commands/download.rs @@ -0,0 +1,178 @@ +use std::fs; +use std::path::Path; +use std::process::Command; +use std::io::{self, Write}; +use std::cell::RefCell; + +use super::get_aeropkg_base; +use crate::utils::parser::{self, env::get_install_env, pkginfo, repoinfo}; +use crate::commands::link::link; + +#[derive(Default)] +struct DownloadSummary { + no_changes: Vec, + updated: Vec<(String, u64)>, + errors: Vec<(String, String)>, +} + +thread_local! { + static SUMMARY: RefCell = RefCell::new(DownloadSummary::default()); +} + +pub fn print_download_summary() { + print!("\r\x1B[K"); + io::stdout().flush().unwrap(); + + SUMMARY.with(|s| { + let summary = s.borrow(); + + if !summary.no_changes.is_empty() { + println!("No changes: {}", summary.no_changes.join(", ")); + } + + if !summary.updated.is_empty() { + println!("Updated:"); + for (pkg, count) in &summary.updated { + println!(" {}: {} files", pkg, count); + } + } + + if !summary.errors.is_empty() { + eprintln!("Errors:"); + for (pkg, err) in &summary.errors { + eprintln!(" {}: {}", pkg, err); + } + } + + drop(summary); + s.replace(DownloadSummary::default()); + }); +} + +pub fn download_packages( + repo: Option<&str>, + packages: &[String], + force: bool, + recursive: bool, +) { + for pkgname in packages { + let effective_repo = match repo { + Some(r) => r.to_string(), + None => pkginfo::get_priority_repo(pkgname), + }; + + download(&effective_repo, pkgname, force, recursive); + } +} + +pub fn download(repo: &String, pkgname: &String, force: bool, recursive: bool) { + let pkg_md_path = &crate::commands::get_aeropkg_var().join(format!("{}/{}.md", repo, pkgname)); + + check_build_dependency(repo, pkg_md_path, force, recursive); + check_run_dependency(pkg_md_path, force, recursive); + + let source = repoinfo::get_download_source(repo); + + if source.is_empty() { + let msg = format!("Download source not found for repo '{}'", repo); + SUMMARY.with(|s| s.borrow_mut().errors.push((pkgname.clone(), msg))); + return; + } + + let remote_path = format!("{}/{}/", source.trim_end_matches('/'), pkgname); + let local_path = format!("/pkg/{}/{}", repo, pkgname); + + if let Err(e) = std::fs::create_dir_all(&local_path) { + let msg = format!("Failed to create directory {}: {}", local_path, e); + SUMMARY.with(|s| s.borrow_mut().errors.push((pkgname.clone(), msg))); + return; + } + let local_path_sync = format!("{}/", local_path); + + print!("\r\x1B[KDownloading {}", pkgname); + io::stdout().flush().unwrap(); + + let mut cmd = Command::new("rsync"); + cmd.arg("-azHX").arg("--stats"); + if force { cmd.arg("--delete"); } + cmd.arg(&remote_path); + cmd.arg(&local_path_sync); + + let result = cmd.output(); + + match result { + Ok(output) => { + let stdout = String::from_utf8_lossy(&output.stdout); + + let transferred = stdout + .lines() + .find(|line| line.contains("Number of regular files transferred:")) + .and_then(|line| line.split(':').nth(1)) + .map(|s| s.trim().parse::().unwrap_or(0)) + .unwrap_or(0); + + if transferred == 0 && output.status.success() { + SUMMARY.with(|s| s.borrow_mut().no_changes.push(pkgname.clone())); + } else if !output.status.success() { + let stderr = String::from_utf8_lossy(&output.stderr); + let err_msg = stderr.lines().rev().find(|l| !l.trim().is_empty()).unwrap_or("unknown error").to_string(); + SUMMARY.with(|s| s.borrow_mut().errors.push((pkgname.clone(), err_msg))); + } else { + SUMMARY.with(|s| s.borrow_mut().updated.push((pkgname.clone(), transferred))); + } + } + Err(e) => { + SUMMARY.with(|s| s.borrow_mut().errors.push((pkgname.clone(), e.to_string()))); + } + } + + let full_env = get_install_env(repo, pkgname, pkg_md_path, "build"); + if full_env.get("disable").is_some() { + let _ = fs::File::create(crate::commands::get_aeropkg_base().join(repo).join(pkgname).join("disabled")); + } else { + link(repo, pkgname) + } +} + +fn check_build_dependency(repo: &String, pkg_md_path: &Path, force: bool, recursive: bool) { + let deps = match parser::get_build_deps(pkg_md_path) { + Ok(deps) => deps, + Err(_) => return, + }; + + for dep in deps.split_whitespace() { + let dep = dep.trim(); + if dep.is_empty() { continue } + + if !get_aeropkg_base().join(repo).join(dep).exists() || recursive { + download(repo, &dep.to_string(), force, recursive); + } + } +} + +fn check_run_dependency(pkg_md_path: &Path, force: bool, recursive: bool) { + let deps = match parser::get_run_deps(pkg_md_path) { + Ok(deps) => deps, + Err(_) => return, + }; + let repo_list = parser::repoinfo::get_repo_list(); + + for dep in deps.split_whitespace() { + let dep = dep.trim(); + if dep.is_empty() { continue } + + let found_repo = repo_list.iter().find(|repo_name| { + get_aeropkg_base().join(repo_name).join(dep).exists() + }); + + match found_repo { + Some(found) if recursive => { + download(found, &dep.to_string(), force, recursive); + } + None => { + download(&pkginfo::get_priority_repo(&dep.to_string()), &dep.to_string(), force, recursive); + } + _ => {} + } + } +} diff --git a/src/commands/link.rs b/src/commands/link.rs index f95c845..818966d 100644 --- a/src/commands/link.rs +++ b/src/commands/link.rs @@ -1,5 +1,6 @@ use crate::utils::fs::hardcopy::hardcopy_handler; use crate::utils::shell::*; +use crate::utils::parser::env::get_install_env; pub fn link(repo: &String, pkgname: &String) { let source = crate::commands::get_aeropkg_base().join(repo).join(pkgname); @@ -26,6 +27,12 @@ pub fn link(repo: &String, pkgname: &String) { } } - mount_overlay(); + let builded_pkg_md_path = &crate::commands::get_aeropkg_base().join(repo).join(pkgname).join("build-script.md"); + let full_env = get_install_env(repo, pkgname, builded_pkg_md_path, "link"); + + let mount_usr_dir_flag = full_env.get("mount_usr_dir").is_some(); + if mount_usr_dir_flag { + mount_overlay(); + } shell_update() } diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 8d5ff23..f8ebc9c 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -5,6 +5,7 @@ pub mod disable; pub mod enable; pub mod trim; pub mod run; +pub mod download; use std::path::PathBuf; diff --git a/src/commands/run/build.rs b/src/commands/run/build.rs index 5ad04e6..3198e5d 100644 --- a/src/commands/run/build.rs +++ b/src/commands/run/build.rs @@ -31,8 +31,8 @@ pub fn build(repo: &String, pkgname: &String) { if build_script == builded_script { return } } - if src.join("aeropkg.applied-build").exists() { - let src_build = fs::read_to_string(src.join("aeropkg.applied-build")).unwrap_or("".to_string()); + if src.join(".aeropkg.applied-build").exists() { + let src_build = fs::read_to_string(src.join(".aeropkg.applied-build")).unwrap_or("".to_string()); if build_script == src_build { return } else { @@ -51,21 +51,21 @@ pub fn build(repo: &String, pkgname: &String) { let dest_path = &dest_dir.join("build-script.md"); fs::remove_file(dest_path).ok(); if let Err(e) = fs::hard_link(pkg_md_path, dest_path) { panic!("Failed to copy build script to destination: {}", e) } - fs::write(src.join("aeropkg.build-script"), &build_script).unwrap(); + fs::write(src.join(".aeropkg.applied-build"), &build_script).unwrap(); - let save_source_flag = full_env.get("save_source").map_or(false, |v| v == "true"); + let save_source_flag = full_env.get("save_source").is_some(); if !save_source_flag { if let Err(e) = fs::remove_dir_all(&src) { panic!("Failed to remove source directory: {}", e) } } hook(repo, pkgname); - let link_flag = full_env.get("disable").map_or(true, |v| v != "true"); - if !link_flag { + if !full_env.get("disable").is_some() { let _ = fs::File::create(crate::commands::get_aeropkg_base().join(repo).join(pkgname).join("disabled")); + } else { + link(repo, pkgname) } - link(repo, pkgname) } diff --git a/src/commands/run/download.rs b/src/commands/run/download.rs index f239e82..b25dd0e 100644 --- a/src/commands/run/download.rs +++ b/src/commands/run/download.rs @@ -23,7 +23,7 @@ pub fn download(repo: &String, pkgname: &String) { let src = pkgpath.join("src"); if src.exists() { - let src_url = fs::read_to_string(src.join("aeropkg.download-url")).unwrap_or("".to_string()); + let src_url = fs::read_to_string(src.join(".aeropkg.download-url")).unwrap_or("".to_string()); if url == src_url { return } else { fs::remove_dir_all(&src).unwrap() @@ -137,7 +137,10 @@ pub fn download(repo: &String, pkgname: &String) { .collect(); if dirs.len() == 1 { - let single_dir = dirs[0].path(); + let old_path = dirs[0].path(); + let single_dir = old_path.parent().unwrap() + .join(format!("{}.aeropkg.bkp", old_path.file_name().unwrap().to_string_lossy())); + fs::rename(&old_path, &single_dir).unwrap(); for entry in fs::read_dir(&single_dir).unwrap() { let entry = entry.unwrap(); @@ -149,7 +152,7 @@ pub fn download(repo: &String, pkgname: &String) { } } - fs::write(src.join("aeropkg.download-url"), &url).unwrap(); + fs::write(src.join(".aeropkg.download-url"), &url).unwrap(); run_install_script_hook(repo, "download", &full_env) } diff --git a/src/commands/run/patch.rs b/src/commands/run/patch.rs index c5d325f..68094cb 100644 --- a/src/commands/run/patch.rs +++ b/src/commands/run/patch.rs @@ -11,8 +11,8 @@ pub fn patch(repo: &String, pkgname: &String) { let pkg_md_path = &crate::commands::get_aeropkg_var().join(format!("{}/{}.md", repo, pkgname)); let patch_script = &parser::get_patch_script(pkg_md_path).unwrap_or("".to_string()); - if src.join("aeropkg.applied-patch").exists() { - let src_patch = &fs::read_to_string(src.join("aeropkg.applied-patch")).unwrap_or("".to_string()); + if src.join(".aeropkg.applied-patch").exists() { + let src_patch = &fs::read_to_string(src.join(".aeropkg.applied-patch")).unwrap_or("".to_string()); if patch_script == src_patch { return } else if src_patch != "" { fs::remove_dir_all(src).unwrap(); @@ -23,5 +23,5 @@ pub fn patch(repo: &String, pkgname: &String) { let full_env = get_install_env(repo, pkgname, pkg_md_path, "patch"); run_install_script(patch_script, src, &full_env); run_install_script_hook(repo, "patch", &full_env); - fs::write(src.join("aeropkg.applied-patch"), &patch_script).unwrap() + fs::write(src.join(".aeropkg.applied-patch"), &patch_script).unwrap() } diff --git a/src/main.rs b/src/main.rs index 04a00ce..259cc9a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,6 +26,7 @@ fn main() { .subcommand(utils::command_handler::disable::command()) .subcommand(utils::command_handler::enable::command()) .subcommand(utils::command_handler::trim::command()) + .subcommand(utils::command_handler::download::command()) .get_matches(); match matches.subcommand() { @@ -36,6 +37,7 @@ fn main() { Some(("disable", sub_m)) => utils::command_handler::disable::disable(sub_m), Some(("enable", sub_m)) => utils::command_handler::enable::enable(sub_m), Some(("trim", sub_m)) => utils::command_handler::trim::trim(sub_m), + Some(("download", sub_m)) => {utils::command_handler::download::download(sub_m); crate::commands::download::print_download_summary();}, _ => { println!("No command provided. Use `pkg --help` for usage information.") } } } diff --git a/src/utils/command_handler/download.rs b/src/utils/command_handler/download.rs new file mode 100644 index 0000000..876e94e --- /dev/null +++ b/src/utils/command_handler/download.rs @@ -0,0 +1,50 @@ +use clap::{Arg, ArgMatches, Command}; +use crate::commands; + +pub fn command() -> Command { + Command::new("download") + .about("Download packages from repositories") + .arg( + Arg::new("packages") + .help("List of packages to download") + .required(true) + .num_args(1..) + .index(1) + ) + .arg( + Arg::new("repo") + .short('r') + .long("repo") + .help("Repository name (e.g., gnu, musl). If omitted, determined per-package.") + .required(false), + ) + .arg( + Arg::new("force") + .short('d') + .long("delete") + .help("Pass --delete to rsync and force re-download") + .action(clap::ArgAction::SetTrue), + ) + .arg( + Arg::new("recursive") + .short('R') + .long("recursive") + .help("Recursively download dependencies") + .action(clap::ArgAction::SetTrue), + ) +} + +pub fn download(matches: &ArgMatches) { + let packages: Vec = matches + .get_many::("packages") + .unwrap_or_default() + .map(|s| s.to_string()) + .collect(); + + let force = matches.get_flag("force"); + let recursive = matches.get_flag("recursive"); + + let repo = matches.get_one::("repo").map(|s| s.as_str()); + + commands::download::download_packages(repo, &packages, force, recursive); +} diff --git a/src/utils/command_handler/mod.rs b/src/utils/command_handler/mod.rs index b2c16e2..8885363 100644 --- a/src/utils/command_handler/mod.rs +++ b/src/utils/command_handler/mod.rs @@ -5,3 +5,4 @@ pub mod enable; pub mod link; pub mod run; pub mod trim; +pub mod download; diff --git a/src/utils/fs/hardcopy.rs b/src/utils/fs/hardcopy.rs index 5e5ce9f..1357e3b 100644 --- a/src/utils/fs/hardcopy.rs +++ b/src/utils/fs/hardcopy.rs @@ -85,6 +85,7 @@ fn hardcopy( } fs::remove_file(destination).ok(); } + fs::remove_file(destination).ok(); unix::fs::symlink(symlink_value, destination)? } diff --git a/src/utils/parser/mod.rs b/src/utils/parser/mod.rs index e9efa07..de6db32 100644 --- a/src/utils/parser/mod.rs +++ b/src/utils/parser/mod.rs @@ -35,7 +35,7 @@ fn extract_block(file_path: &Path, start_marker: &str, end_marker: &str) -> io:: if line.trim() == start_marker { block_started = true; continue } if block_started { if line.trim() == end_marker { break } - result.push(line.trim().to_string()) + result.push(line.to_string()) } } diff --git a/src/utils/parser/repoinfo.rs b/src/utils/parser/repoinfo.rs index b002670..a112f2b 100644 --- a/src/utils/parser/repoinfo.rs +++ b/src/utils/parser/repoinfo.rs @@ -3,7 +3,25 @@ use super::*; pub fn get_repo_addr(repo: &str) -> String { let file_path = &crate::commands::get_aeropkg_etc().join("aeropkg.md"); - let block = extract_block(file_path, "``` cfg *** Repository list and priority ***", "```").expect("Can't parse repo list block"); + let block = extract_block(file_path, "``` cfg *** .pkg files sources ***", "```").expect("Can't parse .pkg source block"); + + for line in block.lines() { + let trimmed_line = line.trim(); + if !trimmed_line.is_empty() { + let parts: Vec<&str> = trimmed_line.split_whitespace().collect(); + if parts.len() >= 2 && parts[0] == repo { + return parts[1].to_string() + } + } + } + + panic!("Repository '{}' not found in the repository list", repo) +} + +pub fn get_download_source(repo: &str) -> String { + let file_path = &crate::commands::get_aeropkg_etc().join("aeropkg.md"); + + let block = extract_block(file_path, "``` cfg *** download sources ***", "```").expect("Can't parse download sources block"); for line in block.lines() { let trimmed_line = line.trim(); @@ -21,7 +39,7 @@ pub fn get_repo_addr(repo: &str) -> String { pub fn get_repo_list() -> Vec { let file_path = &crate::commands::get_aeropkg_etc().join("aeropkg.md"); - let block = extract_block(file_path, "``` cfg *** Repository list and priority ***", "```").expect("Can't parse repo list block"); + let block = extract_block(file_path, "``` cfg *** .pkg files sources ***", "```").expect("Can't parse repo list block"); let mut repo_list = Vec::new(); for line in block.lines() {