diff --git a/build.sh b/build.sh index 6d1cfca7..7d9d8071 100755 --- a/build.sh +++ b/build.sh @@ -62,13 +62,13 @@ build(){ cursor=$1 # building cursor with python script - show_pre "\n"$cursor" : Generating bitmaps...\\r" + show_pre "\n "$cursor" : šŸƒ Generating bitmaps...\\r" # if cursors source folder & file doesn't exist if [ ! "src/"$cursor"/source-cursors.svg" ]; then - error "\n"$cursor" : Source not found" - error "\nAborting..." + error "\n "$cursor" : šŸ˜” Source not found" + error "\n Aborting..." exit 1 else # for removing old build bitmaps(Not Recommended) @@ -93,56 +93,56 @@ build(){ # $? = is the exit status of the most recently-executed command; by convention, 0 means success and anything else indicates failure. if [ $? -eq 0 ] then - show ""$cursor" : Generating bitmaps... DONE" + show " "$cursor" : šŸ™‚ Generating bitmaps... DONE" else - error ""$cursor" : Generating bitmaps... FAIL" - error "\nAborting..." + error " "$cursor" : šŸ˜” Generating bitmaps... FAIL" + error "\n Aborting..." exit 1 fi - show_pre "\n"$cursor" : Tweaking Animation...\\r" + show_pre "\n "$cursor" : ✨ Tweaking Animation...\\r" sh tweak.sh "$cursor" if [ $? -eq 0 ] then - show ""$cursor" : Tweaking Animation... DONE" + show " "$cursor" : šŸ’– Tweaking Animation... DONE" else - error ""$cursor" : Tweaking Animation... FAIL" - error "\nAborting..." + error " "$cursor" : šŸ˜” Tweaking Animation... FAIL" + error "\n Aborting..." exit 1 fi - show_pre "\n"$cursor" : Building X11 cursor...\\r" + show_pre "\n "$cursor" : šŸ“Ø Building X11 cursor...\\r" # execute x11-make.sh file with theme_name argument sh x11-make.sh "$cursor" # Copy .index files to out/$cursor cp src/"$cursor"/*.theme "$cursor"/out/X11/"$cursor" if [ $? -eq 0 ] then - show ""$cursor" : Building X11 cursor... DONE" - echo "OUT: $PWD/$cursor/out/X11" + show " "$cursor" : šŸ“¦ Building X11 cursor... DONE" + echo " OUT: $PWD/$cursor/out/X11" else - error ""$cursor" : Building X11 cursor... FAIL" + error " "$cursor" : šŸ˜” Building X11 cursor... FAIL" error "\nAborting..." exit 1 fi - show_pre "\n"$cursor" : Building Window cursor...\\r" + show_pre "\n "$cursor" : šŸ“Ø Building Window cursor...\\r" # execute x11-make.sh file with theme_name argument sh w32-make.sh "$cursor" if [ $? -eq 0 ] then - show ""$cursor" : Building Window cursor... DONE" - echo "OUT: $PWD/$cursor/out/win" + show " "$cursor" : šŸ“¦ Building Window cursor... DONE" + echo " OUT: $PWD/$cursor/out/win" else - error ""$cursor" : Building Window cursor... FAIL" - error "\nAborting..." + error " "$cursor" : šŸ˜” Building Window cursor... FAIL" + error "\n Aborting..." exit 1 fi fi } installer(){ - show_pre "Generating Installer...\\r" + show_pre " ā³ Generating Installer...\\r" if [ "src/in.inst" ]; then cp src/install install.sh @@ -150,14 +150,14 @@ installer(){ if [ $? -eq 0 ] then - show "Generating Installer... DONE" + show " šŸ’Œ Generating Installer... DONE" else - error "Generating Installer... FAIL" + error " šŸ’” Generating Installer... FAIL" error "\nAborting..." exit 1 fi - show_pre "Making Installer Executable...\n" + show_pre " šŸ˜ Making Installer Executable...\n" if [ "install.sh" ]; then sudo chmod +x install.sh @@ -165,13 +165,13 @@ installer(){ if [ $? -eq 0 ] then - show "Making Installer Executable... DONE" - show_Msg "For Installation Use Following Command:\n" + show " šŸ˜Ž Making Installer Executable... DONE" + show_Msg " 🌈 For Installation Use Following Command:šŸš€ \n " show_Msg "\t sudo ./install.sh\n\t\tOR\n\t./install.sh" show_Msg "\nšŸŽ‰ BUILD COMPLETE! šŸŽ‰" else - error "Making Installer Executable... FAIL" - error "\nAborting..." + error " 😐 Making Installer Executable... FAIL" + error "\n Aborting..." exit 1 fi } @@ -179,50 +179,75 @@ installer(){ # main program # Requirment checking -show_pre "Checking Requirements...\\r" - -if ! type "inkscape" > /dev/null ; then - error "\\nFAIL: inkscape must be installed" - exit 1 -fi - -if ! type "xcursorgen" > /dev/null ; then - error "\\nFAIL: xcursorgen must be installed" - exit 1 -fi - -if ! command -v python3 &>/dev/null; then - error "\\nFAIL: python3 must be installed" - exit 1 -fi - -if ! command pip &>/dev/null; then - error "\\nFAIL: pip must be installed" - exit 1 -fi -show "Checking Requirements... DONE" - -# Install pip requirments -show_pre "Installing PiP Requirements...\\r" - -if [ ! "requirements.txt" ]; - then - error "\n"$cursor" : requirements.txt not found" - error "\nAborting..." - exit 1 -else - pip3 install -r requirements.txt --user -fi - -if [ $? -eq 0 ] +show "šŸ”— Dependencies" +# dependencies must be installed +if type "inkscape" > /dev/null; then - show "Installing PiP Requirements... DONE" + show_Msg "āœ… Inkscape" else - error "Installing PiP Requirements... FAIL" - error "\nAborting..." + error "\\nāŒ Inkscape" + show " Follow Docs to install build dependencies \n https://github.com/KaizIqbal/Bibata_Cursor#build-dependencies" exit 1 fi +if type "xcursorgen" > /dev/null; +then + show_Msg "āœ… Xcursorgen" +else + error "\\nāŒ Xcursorgen" + show " Follow Docs to install build dependencies \n https://github.com/KaizIqbal/Bibata_Cursor#build-dependencies" + exit 1 +fi + +if command -v python3 &> /dev/null; +then + show_Msg "āœ… Python 3" +else + error "\\nāŒ Python 3" + show " Follow Docs to install build dependencies \n https://github.com/KaizIqbal/Bibata_Cursor#build-dependencies" + exit 1 +fi + +# check pillow is accessible from other package if not pip is require +if python3 -c 'from PIL import Image'; +then + show_Msg "āœ… Pillow" + show "Pillow requirement already satiesfied 😊" +else + show_Msg "🧐 Installing Pillow with pip" + # python-pillow not found + # python-pillow not found pip must be require + if command pip3 &> /dev/null; + then + show_Msg "āœ… PiP 3" + # Install pip requirments + show_pre "Installing PiP Requirements...\\r" + + if [ ! "requirements.txt" ]; + then + error "\nBibata : requirements.txt not found" + error "\nAborting..." + exit 1 + else + show_Msg "šŸ’¬ Python Requirments installed as user" + pip3 install -r requirements.txt --user + fi + + if [ $? -eq 0 ] + then + show_Msg "āœ… Pillow" + else + error "āŒ Pillow" + error "\nAborting..." + exit 1 + fi + else + error "\\nāŒ PiP 3" + show " Follow Docs to install build dependencies \n https://github.com/KaizIqbal/Bibata_Cursor#build-dependencies" + exit 1 + fi +fi + # choice for build cursor selection "Cursor to build (Default is 'ALL')?"