master
Caleb Fontenot 2024-03-08 10:59:57 +07:00
commit f49d58b540
3 changed files with 407 additions and 0 deletions

2
.gitignore vendored

@ -0,0 +1,2 @@
built_packages/
clone/

@ -0,0 +1,136 @@
#!/bin/bash
#set -x
### Color Codes
RED="\e[31m"
GREEN="\e[32m"
ENDCOLOR="\e[0m"
#find . -not -name "packages.txt" -not -name "clone.sh" -not -name "." -exec rm -rfv {} \;
working_directory=$(pwd)
mkdir $working_directory/built_packages/
mkdir $working_directory/clone/
function statisfy_dependencies() {
for line in "$@"; do
cd $working_directory/clone
# clone all the packages first
echo "Attempting to clone $line..."
if ! [ -d $line ]; then
timeout 10s git clone https://gitlab.archlinux.org/archlinux/packaging/packages/$line.git
cd $working_directory/clone/$line
git switch main
#git branch -a
else
cd $working_directory/clone/$line
# git pull
# git switch main
fi
done
cd $working_directory
}
function containsElement () {
local e match="$1"
shift
for e in "$@"; do
[[ "$e" == "$match" ]] && return 0; done
return 1
}
readarray first_pass < packages.txt
echo $first_pass
statisfy_dependencies ${first_pass[@]}
depends_array=()
makedepends_array=()
conflicts_array=()
while read line; do
# Check each PKGBUILD's dependencies.
cd $working_directory/clone/$line
# grab depends array
# eval $(source PKGBUILD; echo depends=$depends; echo makedepends=$makedepends; echo conflicts=$conflicts)
# cache the output of makepkg to a file, since makepkg is slow at parsing the srcinfo data
if [[ ! -f $working_directory/clone/$line/.SRCINFO ]]; then
makepkg_output=$(makepkg --printsrcinfo )
echo $makepkg_output | tee $working_directory/clone/$line/.SRCINFO
else
makepkg_output=$(cat $working_directory/clone/$line/.SRCINFO)
fi
#echo "$makepkg_output"
depends=$(echo "$makepkg_output" | grep -w "depends" | sed "s/depends = //g" | xargs)
makedepends=$(echo "$makepkg_output" | grep -w "makedepends" | sed "s/makedepends = //g" | xargs)
conflicts=$(echo "$makepkg_output" | grep -w "conflicts" | sed "s/conflicts = //g" | xargs)
# if we don't have the dependency, we need build it too
echo "depends for $line: ${depends[@]}"
for depends_element in ${depends[@]}; do
containsElement "$depends_element" "${depends_array[@]}"
if [[ $? == 1 ]]; then
echo "Adding ${depends_element}..."
depends_array+=("$depends_element")
fi
done
for depends_element in ${makedepends[@]}; do
containsElement "$depends_element" "${depends_array[@]}"
if [[ $? == 1 ]]; then
echo "Adding ${depends_element}..."
depends_array+=("$depends_element")
makedepends_array+=("$depends_element")
fi
done
for conflicts_element in ${conflicts[@]}; do
containsElement "$conflicts_element" "${conflicts_array[@]}"
if [[ $? == 1 ]]; then
echo -e "Conflicting elements for $line: ${RED} ${conflicts_element}${ENDCOLOR} ..."
conflicts_array+=("${conflicts_element}")
fi
done
done < packages.txt
cd $working_directory
# Remove these dependencies, they are already taken care of, anyway :P
#delete=(gcc-libs glibc appstream-qt futuresql-qt6 cron clang=16.0.6 boost-libs kcachegrind-common kquickimageeditor libkmahjongg marble-common libcolord corrosion flatpak colord cronie kwrite plasma-workspace kgamma5 kdesdk-kioslaves zeroconf-ioslave kalendar)
delete=(clang=17.0.6 llvm-libs appstream-qt gcc-libs futuresql-qt6 boost-libs util-linux-libs systemd-libs packagekit-qt6 polkit-qt6 sh mesa-utils mesa-utils libpipewire)
for target in "${delete[@]}"; do
for i in "${!depends_array[@]}"; do
if [[ ${depends_array[i]} = $target ]]; then
unset 'depends_array[i]'
fi
done
done
echo ${depends_array[@]}
statisfy_dependencies ${depends_array[@]}
cd $working_directory/clone
echo -e "Conflicts detected: ${RED} ${conflicts_array[@]} ${ENDCOLOR}"
#read -p "Press Enter to continue..." </dev/tty
function are_all_pkgs_built() {
for package in "$working_directory"/clone/*; do
if [ -f "$package"/*.pkg.* ]; then
return 0
fi
done
return 1
}
COUNTER = 0
while are_all_pkgs_built; do
COUNTER = 0
for i in "$working_directory"/clone/*; do
if [ ! -f "${working_directory}/built_packages/${i##*/}"*.pkg.* ]; then #Skip-built packages
echo "Attempting to build ${i##*/} ($COUNTER out of $(echo $working_directory/clone/* | wc | awk '{print $2}'))"
cd "$i"
eval "$(source PKGBUILD; echo makedepends="$makedepends")"
makepkg -ACcsi --noconfirm --nocheck --skipinteg
cp -v *.pkg.* "$working_directory"/built_packages/
else
echo "It appears that ${i##*/} is already built, skipping..."
fi
COUNTER=$((COUNTER+1))
done
done
#paru --sudoloop --useask -B *
#paru --sudoloop --mode repo --clonedir $working_directory/clone -B *
#for i in *; do
#done

@ -0,0 +1,269 @@
kcrash
kdeclarative
kglobalaccel
kidletime
kio
kirigami
kpackage
ksvg
kxmlgui
libplasma
kmime
kcoreaddons
ki18n
bluedevil
breeze
breeze-gtk
breeze-plymouth
discover
drkonqi
flatpak-kcm
kactivitymanagerd
kde-cli-tools
kde-gtk-config
kdecoration
kdeplasma-addons
kgamma
khotkeys
kinfocenter
kmenuedit
kpipewire
kscreen
kscreenlocker
ksshaskpass
ksystemstats
kwallet-pam
kwayland-integration
kwin
kwrited
layer-shell-qt
libkscreen
libksysguard
milou
oxygen
oxygen-sounds
plasma-browser-integration
plasma-desktop
plasma-disks
plasma-firewall
plasma-integration
plasma-nm
plasma-pa
plasma-sdk
plasma-systemmonitor
plasma-thunderbolt
plasma-vault
plasma-welcome
plasma-workspace
plasma-workspace-wallpapers
plymouth-kcm
polkit-kde-agent
powerdevil
sddm-kcm
systemsettings
xdg-desktop-portal-kde
akonadi-calendar-tools
akonadi-import-wizard
akonadiconsole
akregator
alligator
angelfish
arianna
ark
artikulate
audiocd-kio
audiotube
blinken
bomber
bovo
cantor
cervisia
colord-kde
dolphin
dolphin-plugins
dragon
elisa
falkon
ffmpegthumbs
filelight
ghostwriter
granatier
grantlee-editor
gwenview
itinerary
juk
k3b
kaddressbook
kajongg
kalarm
kalgebra
kalk
kalzium
kamera
kamoso
kanagram
kapman
kapptemplate
kasts
kate
katomic
kbackup
kblackbox
kblocks
kbounce
kbreakout
kbruch
kcachegrind
kcalc
kcharselect
kclock
kcolorchooser
kde-dev-scripts
kde-dev-utils
kde-inotify-survey
kdebugsettings
kdeconnect
kdegraphics-thumbnailers
kdenetwork-filesharing
kdenlive
kdepim-addons
kdesdk-kio
kdesdk-thumbnailers
kdevelop
kdevelop-php
kdevelop-python
kdf
kdialog
kdiamond
keditbookmarks
keysmith
kfind
kfourinline
kgeography
kget
kgoldrunner
kgpg
khangman
khelpcenter
kig
kigo
killbots
kimagemapeditor
kio-admin
kio-extras
kio-gdrive
kio-zeroconf
kirigami-gallery
kiriki
kiten
kjournald
kjumpingcube
kleopatra
klettres
klickety
klines
kmag
kmahjongg
kmail
kmail-account-wizard
kmines
kmix
kmousetool
kmouth
kmplot
knavalbattle
knetwalk
knights
knotes
koko
kolf
kollision
kolourpaint
kompare
kongress
konqueror
konquest
konsole
kontact
kontrast
konversation
kopete
korganizer
kpat
krdc
krecorder
kreversi
krfb
kruler
kshisen
ksirk
ksnakeduel
kspaceduel
ksquares
ksudoku
ksystemlog
kteatime
ktimer
ktorrent
ktouch
ktrip
ktuberling
kturtle
kubrick
kwalletmanager
kwave
kweather
kwordquiz
lokalize
lskat
marble
markdownpart
mbox-importer
merkuro
minuet
neochat
okular
palapeli
parley
partitionmanager
picmi
pim-data-exporter
pim-sieve-editor
plasmatube
poxml
print-manager
rocs
signon-kwallet-extension
skanlite
skanpage
skladnik
spectacle
step
svgpart
sweeper
telly-skout
tokodon
umbrello
yakuake
zanshin
qt6-base
svt-av1
vmaf
qt6-multimedia
karchive
kwindowsystem
kconfigwidgets
kitemviews
knotifications
kwidgetsaddons
kcodecs
kconfig
kcontacts
kdbusaddons
kio
kitemmodels
kxmlgui
ktextwidgets
kcmutils
kparts
kdoctools