From 6983e6022b0e17dc24ba700ad2d183d562feffb0 Mon Sep 17 00:00:00 2001 From: Hadi Chokr <158838697+silverhadch@users.noreply.github.com> Date: Wed, 7 Aug 2024 17:48:27 +0000 Subject: [PATCH 01/15] Fixing build script and making it effiecent Its me the guy from reddit Java_enjoyer07 and here when running this script in the cosmic-epoch dir it will run the commands with efficiently and loop through them. --- cosmic-epoch/build.sh | 68 +++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 41 deletions(-) diff --git a/cosmic-epoch/build.sh b/cosmic-epoch/build.sh index afe8989..a2f79aa 100755 --- a/cosmic-epoch/build.sh +++ b/cosmic-epoch/build.sh @@ -1,44 +1,30 @@ #!/bin/bash +# Will get the numbers of cpu cores for max power +num_jobs=$(nproc) -cd cosmic-applet-host -paru -Ui -cd ../ -cd cosmic-applets -paru -Ui -cd ../ -cd cosmic-applibrary -paru -Ui -cd ../ -cd cosmic-bg -paru -Ui -cd ../ -cd cosmic-comp -paru -Ui -cd ../ -cd cosmic-launcher -paru -Ui -cd ../ -cd cosmic-osd -paru -Ui -cd ../ -cd cosmic-panel -paru -Ui -cd ../ -cd cosmic-workspaces-epoch -paru -Ui -cd ../ -cd cosmic-session -paru -Ui -cd ../ -#cd iced-workspaces-applet -#paru -Ui -#cd ../ -#cd user-color-editor -#paru -Ui -#cd ../ -cd cosmic-settings-daemon -paru -Ui -cd ../ -cd xdg-desktop-portal-cosmic -paru -Ui +# List +directories=( + "cosmic-applets-git" + "cosmic-applibrary-git" + "cosmic-bg-git" + "cosmic-comp-git" + "cosmic-launcher-git" + "cosmic-osd-git" + "cosmic-panel-git" + "cosmic-workspaces-epoch-git" + "cosmic-session-git" + "cosmic-settings-daemon-git" + "xdg-desktop-portal-cosmic-git" +) + +# Iterate over each directory and run paru +for dir in "${directories[@]}"; do + if [ -d "$dir" ]; then + cd "$dir" + paru --mflags="-j${num_jobs}" -Ui + cd .. + else + echo "Directory $dir does not exist." + fi +done From 4f22031dc68d4266b8f77dbcea246d25e62bab07 Mon Sep 17 00:00:00 2001 From: Hadi Chokr <158838697+silverhadch@users.noreply.github.com> Date: Wed, 7 Aug 2024 17:57:19 +0000 Subject: [PATCH 02/15] Update build.sh --- cosmic-epoch/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cosmic-epoch/build.sh b/cosmic-epoch/build.sh index a2f79aa..5ffa401 100755 --- a/cosmic-epoch/build.sh +++ b/cosmic-epoch/build.sh @@ -1,7 +1,8 @@ #!/bin/bash # Will get the numbers of cpu cores for max power num_jobs=$(nproc) - +export MOLD_JOBS=1 +export CARGO_TARGET_DIR=/tmp/ # List directories=( "cosmic-applets-git" From 71a4c7b1b829fae9ffbc5e5544fd1aa13555037d Mon Sep 17 00:00:00 2001 From: Hadi Chokr <158838697+silverhadch@users.noreply.github.com> Date: Wed, 7 Aug 2024 19:01:12 +0000 Subject: [PATCH 03/15] Update build.sh --- cosmic-epoch/build.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cosmic-epoch/build.sh b/cosmic-epoch/build.sh index 5ffa401..947f2fd 100755 --- a/cosmic-epoch/build.sh +++ b/cosmic-epoch/build.sh @@ -23,6 +23,9 @@ for dir in "${directories[@]}"; do if [ -d "$dir" ]; then cd "$dir" paru --mflags="-j${num_jobs}" -Ui + echo "Tempfiles are being deleted ignore the permission denied, these are important and will not be touched." + echo "The command will remove everything in tmp that is not protected, so dont worry" + rm -rf /tmp/* cd .. else echo "Directory $dir does not exist." From e5c0d42bac5509f5ba815a5e22bbc7e588504c29 Mon Sep 17 00:00:00 2001 From: Hadi Chokr <158838697+silverhadch@users.noreply.github.com> Date: Wed, 7 Aug 2024 19:11:45 +0000 Subject: [PATCH 04/15] Update build.sh --- cosmic-epoch/build.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cosmic-epoch/build.sh b/cosmic-epoch/build.sh index 947f2fd..b8f9a88 100755 --- a/cosmic-epoch/build.sh +++ b/cosmic-epoch/build.sh @@ -1,4 +1,10 @@ #!/bin/bash +#the claening tmp with sudo would bring temporary damage to system since cleaning without root will ignore important stuuf +# the tmp ram usage is important for build time optimazaton +if [ "$(id -u)" -eq 0 ]; then + echo "Error: This script should not be run as root or with sudo." + exit 1 +fi # Will get the numbers of cpu cores for max power num_jobs=$(nproc) export MOLD_JOBS=1 From 0212853abb596e1c110114a19ecf41b540f92cb6 Mon Sep 17 00:00:00 2001 From: Hadi Chokr <158838697+silverhadch@users.noreply.github.com> Date: Wed, 7 Aug 2024 19:26:40 +0000 Subject: [PATCH 05/15] Update build.sh Final update --- cosmic-epoch/build.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cosmic-epoch/build.sh b/cosmic-epoch/build.sh index b8f9a88..7b21c9a 100755 --- a/cosmic-epoch/build.sh +++ b/cosmic-epoch/build.sh @@ -1,6 +1,5 @@ #!/bin/bash -#the claening tmp with sudo would bring temporary damage to system since cleaning without root will ignore important stuuf -# the tmp ram usage is important for build time optimazaton +#makepkg and other cannot be run as root if [ "$(id -u)" -eq 0 ]; then echo "Error: This script should not be run as root or with sudo." exit 1 @@ -8,7 +7,9 @@ fi # Will get the numbers of cpu cores for max power num_jobs=$(nproc) export MOLD_JOBS=1 -export CARGO_TARGET_DIR=/tmp/ +mkdir -p "$HOME/cargo-target" + +export CARGO_TARGET_DIR="$HOME/cargo-target" # List directories=( "cosmic-applets-git" @@ -29,9 +30,6 @@ for dir in "${directories[@]}"; do if [ -d "$dir" ]; then cd "$dir" paru --mflags="-j${num_jobs}" -Ui - echo "Tempfiles are being deleted ignore the permission denied, these are important and will not be touched." - echo "The command will remove everything in tmp that is not protected, so dont worry" - rm -rf /tmp/* cd .. else echo "Directory $dir does not exist." From 25910f8e4deeab26adebe41420d8557ed60aaaad Mon Sep 17 00:00:00 2001 From: Hadi Chokr <158838697+silverhadch@users.noreply.github.com> Date: Wed, 7 Aug 2024 19:34:16 +0000 Subject: [PATCH 06/15] Test Bugfix Bugs because of makeflags removed them --- cosmic-epoch/build.sh | 55 ++++++++++++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 16 deletions(-) diff --git a/cosmic-epoch/build.sh b/cosmic-epoch/build.sh index 7b21c9a..3e4770d 100755 --- a/cosmic-epoch/build.sh +++ b/cosmic-epoch/build.sh @@ -1,38 +1,61 @@ #!/bin/bash -#makepkg and other cannot be run as root + +# Ensure the script is not run as root if [ "$(id -u)" -eq 0 ]; then echo "Error: This script should not be run as root or with sudo." exit 1 fi -# Will get the numbers of cpu cores for max power + +# Get the number of CPU cores for maximum parallelism num_jobs=$(nproc) + +# Export environment variables export MOLD_JOBS=1 -mkdir -p "$HOME/cargo-target" +# Set the Cargo target directory to a location in the user's home directory export CARGO_TARGET_DIR="$HOME/cargo-target" -# List -directories=( - "cosmic-applets-git" + +# Ensure the target directory exists +mkdir -p "$CARGO_TARGET_DIR" + +# List of AUR packages to install +packages=( + "osmic-applets-git" "cosmic-applibrary-git" "cosmic-bg-git" "cosmic-comp-git" + "cosmic-edit-git" + "cosmic-epoch-meta-git" + "cosmic-files-git" + "cosmic-greeter-git" "cosmic-launcher-git" + "cosmic-notifications-git" "cosmic-osd-git" "cosmic-panel-git" - "cosmic-workspaces-epoch-git" + "cosmic-player-git" + "cosmic-randr-git" + "cosmic-reader-git" + "cosmic-screenshot-git" "cosmic-session-git" "cosmic-settings-daemon-git" + "cosmic-settings-git" + "cosmic-store-git" + "cosmic-term-git" + "cosmic-workspaces-epoch-git" "xdg-desktop-portal-cosmic-git" ) -# Iterate over each directory and run paru -for dir in "${directories[@]}"; do - if [ -d "$dir" ]; then - cd "$dir" - paru --mflags="-j${num_jobs}" -Ui - cd .. - else - echo "Directory $dir does not exist." - fi +# Install AUR packages +for pkg in "${packages[@]}"; do + echo "Installing $pkg..." + paru -S --noconfirm "$pkg" done +# Safe cleanup of /tmp +echo "Cleaning up /tmp directory..." +# Print a warning +echo "Warning: This will delete all files in /tmp that are not protected." +# Clear /tmp but keep important files +find /tmp -mindepth 1 -maxdepth 1 ! -name 'important_file_or_directory' -exec rm -rf {} + + +echo "Done." From 20b7088abddc9432c6ab1138930a192db434868a Mon Sep 17 00:00:00 2001 From: Hadi Chokr <158838697+silverhadch@users.noreply.github.com> Date: Wed, 7 Aug 2024 19:37:14 +0000 Subject: [PATCH 07/15] forgot a c lol --- cosmic-epoch/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cosmic-epoch/build.sh b/cosmic-epoch/build.sh index 3e4770d..b16f70b 100755 --- a/cosmic-epoch/build.sh +++ b/cosmic-epoch/build.sh @@ -20,7 +20,7 @@ mkdir -p "$CARGO_TARGET_DIR" # List of AUR packages to install packages=( - "osmic-applets-git" + "cosmic-applets-git" "cosmic-applibrary-git" "cosmic-bg-git" "cosmic-comp-git" From 39605491679f1d0a706b877d14c96bb4c4f7e585 Mon Sep 17 00:00:00 2001 From: Hadi Chokr <158838697+silverhadch@users.noreply.github.com> Date: Wed, 7 Aug 2024 19:56:43 +0000 Subject: [PATCH 08/15] rearrange build order becuase dependencies --- cosmic-epoch/build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cosmic-epoch/build.sh b/cosmic-epoch/build.sh index b16f70b..99bc669 100755 --- a/cosmic-epoch/build.sh +++ b/cosmic-epoch/build.sh @@ -24,8 +24,8 @@ packages=( "cosmic-applibrary-git" "cosmic-bg-git" "cosmic-comp-git" - "cosmic-edit-git" "cosmic-epoch-meta-git" + "cosmic-edit-git" "cosmic-files-git" "cosmic-greeter-git" "cosmic-launcher-git" @@ -36,13 +36,13 @@ packages=( "cosmic-randr-git" "cosmic-reader-git" "cosmic-screenshot-git" - "cosmic-session-git" - "cosmic-settings-daemon-git" "cosmic-settings-git" + "cosmic-settings-daemon-git" "cosmic-store-git" "cosmic-term-git" "cosmic-workspaces-epoch-git" "xdg-desktop-portal-cosmic-git" + "cosmic-session-git" ) # Install AUR packages From a2c5fdcbd2e3771e1d6b814e90f70f5cca9204a2 Mon Sep 17 00:00:00 2001 From: Hadi Chokr <158838697+silverhadch@users.noreply.github.com> Date: Wed, 7 Aug 2024 20:04:38 +0000 Subject: [PATCH 09/15] git lfs insatll --- cosmic-epoch/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cosmic-epoch/build.sh b/cosmic-epoch/build.sh index 99bc669..87b71e7 100755 --- a/cosmic-epoch/build.sh +++ b/cosmic-epoch/build.sh @@ -44,7 +44,7 @@ packages=( "xdg-desktop-portal-cosmic-git" "cosmic-session-git" ) - +git lfs install # Install AUR packages for pkg in "${packages[@]}"; do echo "Installing $pkg..." From 0b0fc6c965bf8f65dd4a3707217e9e2626322d93 Mon Sep 17 00:00:00 2001 From: Hadi Chokr <158838697+silverhadch@users.noreply.github.com> Date: Thu, 8 Aug 2024 05:13:02 +0000 Subject: [PATCH 10/15] Update build.sh --- cosmic-epoch/build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cosmic-epoch/build.sh b/cosmic-epoch/build.sh index 87b71e7..f5d4d78 100755 --- a/cosmic-epoch/build.sh +++ b/cosmic-epoch/build.sh @@ -24,10 +24,8 @@ packages=( "cosmic-applibrary-git" "cosmic-bg-git" "cosmic-comp-git" - "cosmic-epoch-meta-git" - "cosmic-edit-git" + #"cosmic-epoch-meta-git" "cosmic-files-git" - "cosmic-greeter-git" "cosmic-launcher-git" "cosmic-notifications-git" "cosmic-osd-git" @@ -40,8 +38,10 @@ packages=( "cosmic-settings-daemon-git" "cosmic-store-git" "cosmic-term-git" + "cosmic-edit-git" "cosmic-workspaces-epoch-git" "xdg-desktop-portal-cosmic-git" + "cosmic-greeter-git" "cosmic-session-git" ) git lfs install From f124250683d74f4da6b5cbaa2900e2be9a0800a2 Mon Sep 17 00:00:00 2001 From: Hadi Chokr <158838697+silverhadch@users.noreply.github.com> Date: Thu, 8 Aug 2024 06:12:24 +0000 Subject: [PATCH 11/15] Update build.sh --- cosmic-epoch/build.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cosmic-epoch/build.sh b/cosmic-epoch/build.sh index f5d4d78..b4ef488 100755 --- a/cosmic-epoch/build.sh +++ b/cosmic-epoch/build.sh @@ -30,9 +30,9 @@ packages=( "cosmic-notifications-git" "cosmic-osd-git" "cosmic-panel-git" - "cosmic-player-git" + #"cosmic-player-git" "cosmic-randr-git" - "cosmic-reader-git" + #"cosmic-reader-git" "cosmic-screenshot-git" "cosmic-settings-git" "cosmic-settings-daemon-git" @@ -42,7 +42,7 @@ packages=( "cosmic-workspaces-epoch-git" "xdg-desktop-portal-cosmic-git" "cosmic-greeter-git" - "cosmic-session-git" + #"cosmic-session-git" ) git lfs install # Install AUR packages @@ -51,6 +51,10 @@ for pkg in "${packages[@]}"; do paru -S --noconfirm "$pkg" done +echo "Finishing install..." +paru -S cosmic-session-git + + # Safe cleanup of /tmp echo "Cleaning up /tmp directory..." # Print a warning From c9ebdf25cab404a149725ae8a515fca56166ad61 Mon Sep 17 00:00:00 2001 From: Hadi Chokr <158838697+silverhadch@users.noreply.github.com> Date: Thu, 8 Aug 2024 06:12:53 +0000 Subject: [PATCH 12/15] Update build.sh --- cosmic-epoch/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cosmic-epoch/build.sh b/cosmic-epoch/build.sh index b4ef488..034538c 100755 --- a/cosmic-epoch/build.sh +++ b/cosmic-epoch/build.sh @@ -48,7 +48,7 @@ git lfs install # Install AUR packages for pkg in "${packages[@]}"; do echo "Installing $pkg..." - paru -S --noconfirm "$pkg" + paru -Ui --noconfirm "$pkg" done echo "Finishing install..." From d85788247784d2c6ddfde3fd939708ee1f0fb4f4 Mon Sep 17 00:00:00 2001 From: Hadi Chokr <158838697+silverhadch@users.noreply.github.com> Date: Thu, 8 Aug 2024 06:19:00 +0000 Subject: [PATCH 13/15] Aktualisieren von build.sh --- cosmic-epoch/build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cosmic-epoch/build.sh b/cosmic-epoch/build.sh index 034538c..5b32594 100755 --- a/cosmic-epoch/build.sh +++ b/cosmic-epoch/build.sh @@ -48,7 +48,9 @@ git lfs install # Install AUR packages for pkg in "${packages[@]}"; do echo "Installing $pkg..." + cd "$pkg" paru -Ui --noconfirm "$pkg" + cd .. done echo "Finishing install..." From 37bb46c126356c82ef99df5294e99928f32896fc Mon Sep 17 00:00:00 2001 From: Hadi Chokr <158838697+silverhadch@users.noreply.github.com> Date: Thu, 8 Aug 2024 06:19:48 +0000 Subject: [PATCH 14/15] Aktualisieren von build.sh --- cosmic-epoch/build.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/cosmic-epoch/build.sh b/cosmic-epoch/build.sh index 5b32594..5a8a529 100755 --- a/cosmic-epoch/build.sh +++ b/cosmic-epoch/build.sh @@ -57,11 +57,6 @@ echo "Finishing install..." paru -S cosmic-session-git -# Safe cleanup of /tmp -echo "Cleaning up /tmp directory..." -# Print a warning -echo "Warning: This will delete all files in /tmp that are not protected." -# Clear /tmp but keep important files -find /tmp -mindepth 1 -maxdepth 1 ! -name 'important_file_or_directory' -exec rm -rf {} + + echo "Done." From a2b1b99ae090454a072d347c116bef36371fba61 Mon Sep 17 00:00:00 2001 From: Hadi Chokr <158838697+silverhadch@users.noreply.github.com> Date: Sat, 10 Aug 2024 11:01:25 +0200 Subject: [PATCH 15/15] Update build.sh --- cosmic-epoch/build.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cosmic-epoch/build.sh b/cosmic-epoch/build.sh index 5a8a529..2b6f43c 100755 --- a/cosmic-epoch/build.sh +++ b/cosmic-epoch/build.sh @@ -49,14 +49,12 @@ git lfs install for pkg in "${packages[@]}"; do echo "Installing $pkg..." cd "$pkg" - paru -Ui --noconfirm "$pkg" + paru -Ui --noconfirm cd .. done echo "Finishing install..." paru -S cosmic-session-git - - - echo "Done." +