This repository was archived by the owner on May 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathesteem.sh
825 lines (712 loc) · 23.3 KB
/
esteem.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
#!/bin/bash
# This script allows you to easily and safely install Enlightenment, along with
# other applications based on the Enlightenment Foundation Libraries (EFL),
# in your Ubuntu, Kubuntu or Xubuntu desktop system.
# Supported distribution: Mantic Minotaur.
# ESTEEM.SH takes care of downloading, configuring and building everything you
# need to enjoy the very latest version of the Enlightenment environment
# (DEB packages, if they exist, tend to lag far behind). Once installed,
# you can update your Enlightenment desktop whenever you like.
# Facultative: Additional steps may be taken in order to achieve optimal results.
# Please refer to the comments of the build_plain() function.
# Tip: Set your terminal scrollback to unlimited so that you can scroll up
# to look at earlier output at any time.
# See README.md for instructions on how to use this script.
# See also the repository's wiki for post-installation hints.
# Heads up!
# Enlightenment programs compiled from git source code will inevitably come into conflict
# with the ones installed from DEB packages. Therefore, remove any previous binary
# installations of EFL, Enlightenment and related applications before
# running this script.
# We recommend doing a complete uninstallation of your Enlightenment desktop
# if you plan to upgrade your system to a newer version of the distribution,
# in order to ensure a smooth reinstallation of the environment afterwards.
# ESTEEM.SH is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License,
# in memory of Aaron Swartz.
# See https://creativecommons.org/licenses/by-sa/4.0/
# Got a GitHub account? Please consider starring our repositories to show your support.
# Thank you!
# ---------------
# USER VARIABLES
# ---------------
# (These variables are not available to be used outside of this script.)
BLD="\e[1m" # Bold text.
ITA="\e[3m" # Italic text.
BDR="\e[1;31m" # Bold red text.
BDG="\e[1;32m" # Bold green text.
BTC="\e[1;96m" # Bright cyan text.
BDP="\e[1;35m" # Bold purple text.
BDY="\e[1;33m" # Bold yellow text.
LWG="\e[2;32m" # Low intensity green text.
LWP="\e[2;35m" # Low intensity purple text.
LWY="\e[2;33m" # Low intensity yellow text.
OFF="\e[0m" # Turn off ANSI colors and formatting.
DLDIR=$(xdg-user-dir DOWNLOAD)
DOCDIR=$(xdg-user-dir DOCUMENTS)
SCRFLR=$HOME/.esteem
REBASEF="git config pull.rebase false"
SNIN="sudo ninja -C build install"
DISTRO=$(lsb_release -sc)
# Build dependencies, recommended and script-related packages.
DEPS="acpid arc-theme aspell build-essential ccache check cmake cowsay ddcutil doxygen \
fonts-noto freeglut3-dev graphviz gstreamer1.0-libav gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly hwdata i2c-tools imagemagick \
libaom-dev libasound2-dev libavahi-client-dev libavif-dev libblkid-dev \
libbluetooth-dev libegl1-mesa-dev libexif-dev libfontconfig-dev libdrm-dev \
libfreetype-dev libfribidi-dev libgbm-dev libgeoclue-2-dev libgif-dev libgraphviz-dev \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libharfbuzz-dev \
libheif-dev libi2c-dev libibus-1.0-dev libinput-dev libinput-tools \
libjpeg-dev libjson-c-dev libjxl-dev libkmod-dev liblua5.2-dev liblz4-dev \
libmenu-cache-dev libmount-dev libopenjp2-7-dev libosmesa6-dev libpam0g-dev \
libpoppler-cpp-dev libpoppler-dev libpoppler-private-dev libpulse-dev libraw-dev \
librsvg2-dev libsdl1.2-dev libscim-dev libsndfile1-dev libspectre-dev \
libssl-dev libsystemd-dev libtiff5-dev libtool libudev-dev libudisks2-dev \
libunibreak-dev libunwind-dev libusb-1.0-0-dev libwebp-dev \
libxcb-keysyms1-dev libxcursor-dev libxinerama-dev libxkbcommon-x11-dev \
libxkbfile-dev lxmenu-data libxrandr-dev libxss-dev libxtst-dev libyuv-dev \
lolcat manpages-dev manpages-posix-dev meson ninja-build papirus-icon-theme \
texlive-base texlive-font-utils unity-greeter-badges valgrind \
wayland-protocols wmctrl xdotool xserver-xephyr xwayland"
# Latest source code available.
CLONEFL="git clone https://git.enlightenment.org/enlightenment/efl.git"
CLONETY="git clone https://git.enlightenment.org/enlightenment/terminology.git"
CLONE26="git clone https://git.enlightenment.org/enlightenment/enlightenment.git"
CLONEPH="git clone https://git.enlightenment.org/enlightenment/ephoto.git"
CLONERG="git clone https://git.enlightenment.org/enlightenment/rage.git"
CLONEVI="git clone https://git.enlightenment.org/enlightenment/evisum.git"
CLONEXP="git clone https://git.enlightenment.org/enlightenment/express.git"
CLONECR="git clone https://git.enlightenment.org/enlightenment/ecrire.git"
CLONEVE="git clone https://git.enlightenment.org/enlightenment/enventor.git"
CLONEDI="git clone https://git.enlightenment.org/enlightenment/edi.git"
CLONENT="git clone https://git.enlightenment.org/vtorri/entice.git"
CLONEFT="git clone https://git.enlightenment.org/enlightenment/enlightenment-module-forecasts.git"
CLONEPN="git clone https://git.enlightenment.org/enlightenment/enlightenment-module-penguins.git"
CLONEPL="git clone https://git.enlightenment.org/enlightenment/enlightenment-module-places.git"
CLONETE="git clone https://github.com/dimmus/eflete.git"
# “MN” stands for Meson——the Meson build system.
PROG_MN="
efl
terminology
enlightenment
ephoto
rage
evisum
express
ecrire
enventor
edi
entice
enlightenment-module-forecasts
enlightenment-module-penguins
enlightenment-module-places
eflete"
# Bug reporting: Uncomment the following (remove the leading # character) to force messages to
# display in English during the build process.
#
# export LC_ALL=C
# ---------
# FUNCTIONS
# ---------
# Audible feedback (event, sudo prompt...) on most systems.
beep_dl_complete() {
aplay --quiet /usr/share/sounds/sound-icons/glass-water-1.wav 2>/dev/null
}
beep_attention() {
aplay --quiet /usr/share/sounds/sound-icons/percussion-50.wav 2>/dev/null
}
beep_question() {
aplay --quiet /usr/share/sounds/sound-icons/guitar-13.wav 2>/dev/null
}
beep_exit() {
aplay --quiet /usr/share/sounds/sound-icons/pipe.wav 2>/dev/null
}
beep_ok() {
aplay --quiet /usr/share/sounds/sound-icons/trumpet-12.wav 2>/dev/null
}
# Hints.
# 1: A no frill, plain build.
# 2: A feature-rich, decently optimized build on Xorg; recommended for most users.
# 3: Similar to the above, but running Enlightenment as a Wayland compositor is still considered experimental.
# Avoid the third option with Nvidia drivers.
#
menu_sel() {
if [ $INPUT -lt 1 ]; then
echo
printf "1 $BDG%s $OFF%s\n\n" "INSTALL the Enlightenment ecosystem now"
printf "2 $LWP%s $OFF%s\n\n" "Update and rebuild the ecosystem in release mode"
printf "3 $LWY%s $OFF%s\n\n" "Update and rebuild the ecosystem with Wayland support"
sleep 1 && printf "$ITA%s $OFF%s\n\n" "Or press Ctrl+C to quit."
read INPUT
fi
}
sel_menu() {
if [ $INPUT -lt 1 ]; then
echo
printf "1 $LWG%s $OFF%s\n\n" "Install the Enlightenment ecosystem now"
printf "2 $BDP%s $OFF%s\n\n" "Update and rebuild the ecosystem in RELEASE mode"
printf "3 $BDY%s $OFF%s\n\n" "Update and rebuild the ecosystem with WAYLAND support"
sleep 1 && printf "$ITA%s $OFF%s\n\n" "Or press Ctrl+C to quit."
read INPUT
fi
}
# Check binary dependencies.
bin_deps() {
if ! sudo apt install $DEPS; then
printf "\n$BDR%s %s\n" "CONFLICTING OR MISSING DEB PACKAGES"
printf "$BDR%s %s\n" "OR DPKG DATABASE IS LOCKED."
printf "$BDR%s $OFF%s\n\n" "SCRIPT ABORTED."
beep_exit
exit 1
fi
}
# Check source dependencies.
cnt_dir() {
COUNT=$(find . -mindepth 1 -maxdepth 1 -type d | wc -l)
if [ ! -d efl ] || [ ! -d enlightenment ]; then
printf "\n$BDR%s %s\n" "FAILED TO DOWNLOAD MAIN COMPONENT."
printf "$BDR%s $OFF%s\n\n" "SCRIPT ABORTED."
beep_exit
exit 1
# You can try downloading the missing file(s) manually (see CLONEFL or CLONE26), then relaunch
# the script and select option 1 again; or relaunch the script at a later time.
# In both cases, be sure to enter the same path for the Enlightenment source
# folders as you previously used.
fi
case $COUNT in
15)
printf "$BDG%s $OFF%s\n\n" "All programs have been downloaded successfully."
beep_dl_complete
sleep 2
;;
0)
printf "\n$BDR%s %s\n" "OOPS! SOMETHING WENT WRONG."
printf "$BDR%s $OFF%s\n\n" "SCRIPT ABORTED."
beep_exit
exit 1
;;
*)
printf "\n$BDY%s %s\n" "WARNING: ONLY $COUNT OF 15 PROGRAMS HAVE BEEN DOWNLOADED!"
printf "\n$BDY%s $OFF%s\n\n" "WAIT 12 SECONDS OR HIT CTRL+C TO EXIT NOW."
beep_attention
sleep 12
;;
esac
}
mng_err() {
printf "\n$BDR%s $OFF%s\n\n" "BUILD ERROR——TRY AGAIN LATER."
beep_exit
exit 1
}
elap_start() {
START=$(date +%s)
}
elap_stop() {
DELTA=$(($(date +%s) - START))
printf "\n$ITA%s $OFF%s\n" "Compilation and linking time: "
eval "echo $(date -ud "@$DELTA" +'%H hr %M min %S sec')"
}
# Timestamp: See the date man page to convert epoch to human-readable date
# or visit https://www.epochconverter.com/
#
# To restore a backup, use the same commands that were executed but with
# the source and destination reversed, similar to this:
# cp -aR /home/riley/Documents/ebackups/E_1714028828/.elementary/ /home/riley/
# cp -aR /home/riley/Documents/ebackups/E_1714028828/.e/ /home/riley/
# cp -aR /home/riley/Documents/ebackups/ETERM_1714028828/terminology/config/ /home/riley/.config/terminology/
# cp -aR /home/riley/Documents/ebackups/ETERM_1714028828/terminology/themes/ /home/riley/.config/terminology/
# (Then press Ctrl+Alt+End to restart Enlightenment if you are currently logged into.)
#
e_bkp() {
TSTAMP=$(date +%s)
if [ -d $DOCDIR/ebackups ]; then
rm -rf $DOCDIR/ebackups
mkdir -p $DOCDIR/ebackups/E_$TSTAMP && mkdir -p $DOCDIR/ebackups/ETERM_$TSTAMP &&
cp -aR $HOME/.elementary $DOCDIR/ebackups/E_$TSTAMP &&
cp -aR $HOME/.e $DOCDIR/ebackups/E_$TSTAMP &&
cp -aR $HOME/.config/terminology $DOCDIR/ebackups/ETERM_$TSTAMP
sleep 2
else
mkdir -p $DOCDIR/ebackups/E_$TSTAMP && mkdir -p $DOCDIR/ebackups/ETERM_$TSTAMP &&
cp -aR $HOME/.elementary $DOCDIR/ebackups/E_$TSTAMP &&
cp -aR $HOME/.e $DOCDIR/ebackups/E_$TSTAMP &&
cp -aR $HOME/.config/terminology $DOCDIR/ebackups/ETERM_$TSTAMP
sleep 2
fi
}
e_tokens() {
echo $(date +%s) >>$HOME/.cache/ebuilds/etokens
TOKEN=$(wc -l <$HOME/.cache/ebuilds/etokens)
if [ "$TOKEN" -gt 3 ]; then
echo
# Questions: Enter either y or n, or press Enter to accept the default value (capital letter).
beep_question
read -t 12 -p "Do you want to back up your Enlightenment and Terminology settings now? [y/N] " answer
case $answer in
y | Y)
e_bkp
;;
n | N)
printf "\n$ITA%s $OFF%s\n\n" "(no backup made... OK)"
;;
*)
printf "\n$ITA%s $OFF%s\n\n" "(no backup made... OK)"
;;
esac
fi
}
rstrt_e() {
if [ "$XDG_CURRENT_DESKTOP" == "Enlightenment" ]; then
enlightenment_remote -restart
if [ -x /usr/bin/spd-say ]; then
spd-say --language Rob 'enlightenment is awesome'
fi
fi
}
# BEFORE EXECUTING THE SCRIPT...
#
# Fetch EDI's additional dependencies?
# If you want edi to compile, you will also need to install the packages
# listed in the link below:
# https://gist.github.com/batden/99a7ebdd5ba9d9e83b2446ab5f05f3dc
#
build_plain() {
sudo ln -sf /usr/lib/x86_64-linux-gnu/preloadable_libintl.so /usr/lib/libintl.so
sudo ldconfig
for I in $PROG_MN; do
cd $ESRC/e26/$I
printf "\n$BLD%s $OFF%s\n\n" "Building $I..."
case $I in
efl)
meson setup build -Dbuildtype=plain \
-Dfb=true \
-Dbuild-tests=false \
-Dlua-interpreter=lua \
-Devas-loaders-disabler= \
-Dglib=true \
-Ddocs=true
ninja -C build || mng_err
;;
enlightenment)
meson setup build -Dbuildtype=plain
ninja -C build || mng_err
;;
edi)
meson setup build -Dbuildtype=plain \
-Dlibclang-headerdir=/usr/lib/llvm-11/include \
-Dlibclang-libdir=/usr/lib/llvm-11/lib
ninja -C build
;;
eflete)
meson setup build -Dbuildtype=plain \
-Dwerror=false
ninja -C build
;;
*)
meson setup build -Dbuildtype=plain
ninja -C build
;;
esac
beep_attention
$SNIN
sudo ldconfig
done
}
rebuild_optim() {
ESRC=$(cat $HOME/.cache/ebuilds/storepath)
bin_deps
e_tokens
elap_start
cd $ESRC/rlottie
printf "\n$BLD%s $OFF%s\n\n" "Updating rlottie..."
git reset --hard &>/dev/null
$REBASEF && git pull
echo
sudo chown $USER build/.ninja*
meson setup --reconfigure build -Dbuildtype=release \
-Dexample=false
ninja -C build
beep_attention
$SNIN
sudo ldconfig
elap_stop
for I in $PROG_MN; do
elap_start
cd $ESRC/e26/$I
printf "\n$BLD%s $OFF%s\n\n" "Updating $I..."
git reset --hard &>/dev/null
$REBASEF && git pull
case $I in
efl)
sudo chown $USER build/.ninja*
meson setup --reconfigure build -Dbuildtype=release \
-Dnative-arch-optimization=true \
-Dfb=true \
-Dharfbuzz=true \
-Dlua-interpreter=lua \
-Delua=true \
-Dbindings=lua,cxx \
-Devas-loaders-disabler= \
-Dglib=true \
-Dopengl=full \
-Ddrm=false \
-Dwl=false \
-Dbuild-tests=false \
-Ddocs=true
ninja -C build || mng_err
;;
enlightenment)
sudo chown $USER build/.ninja*
meson setup --reconfigure build -Dbuildtype=release \
-Dwl=false
ninja -C build || mng_err
;;
edi)
sudo chown $USER build/.ninja*
meson setup --reconfigure build -Dbuildtype=release \
-Dlibclang-headerdir=/usr/lib/llvm-11/include \
-Dlibclang-libdir=/usr/lib/llvm-11/lib
ninja -C build
;;
eflete)
sudo chown $USER build/.ninja*
meson setup --reconfigure build -Dbuildtype=release \
-Denable-audio=true -Dwerror=false
ninja -C build
;;
*)
sudo chown $USER build/.ninja*
meson setup --reconfigure build -Dbuildtype=release
ninja -C build
;;
esac
beep_attention
$SNIN
sudo ldconfig
elap_stop
done
}
rebuild_wld() {
ESRC=$(cat $HOME/.cache/ebuilds/storepath)
if [ "$XDG_SESSION_TYPE" == "tty" ] && [ "$XDG_CURRENT_DESKTOP" == "Enlightenment" ]; then
printf "\n$BDR%s $OFF%s\n\n" "PLEASE LOG IN TO THE DEFAULT DESKTOP ENVIRONMENT TO EXECUTE THIS SCRIPT."
beep_exit
exit 1
fi
bin_deps
e_tokens
elap_start
cd $ESRC/rlottie
printf "\n$BLD%s $OFF%s\n\n" "Updating rlottie..."
git reset --hard &>/dev/null
$REBASEF && git pull
echo
sudo chown $USER build/.ninja*
meson setup --reconfigure build -Dbuildtype=release \
-Dexample=false
ninja -C build
beep_attention
$SNIN
sudo ldconfig
elap_stop
for I in $PROG_MN; do
elap_start
cd $ESRC/e26/$I
printf "\n$BLD%s $OFF%s\n\n" "Updating $I..."
git reset --hard &>/dev/null
$REBASEF && git pull
case $I in
efl)
sudo chown $USER build/.ninja*
meson setup --reconfigure build -Dbuildtype=release \
-Dnative-arch-optimization=true \
-Dfb=true \
-Dharfbuzz=true \
-Dlua-interpreter=lua \
-Delua=true \
-Dbindings=lua,cxx \
-Devas-loaders-disabler= \
-Dglib=true \
-Dopengl=es-egl \
-Ddrm=true \
-Dwl=true \
-Dbuild-tests=false \
-Ddocs=true
ninja -C build || mng_err
;;
enlightenment)
sudo chown $USER build/.ninja*
meson setup --reconfigure build -Dbuildtype=release \
-Dwl=true
ninja -C build || mng_err
;;
edi)
sudo chown $USER build/.ninja*
meson setup --reconfigure build -Dbuildtype=release \
-Dlibclang-headerdir=/usr/lib/llvm-11/include \
-Dlibclang-libdir=/usr/lib/llvm-11/lib
ninja -C build
;;
eflete)
sudo chown $USER build/.ninja*
meson setup --reconfigure build -Dbuildtype=release \
-Denable-audio=true -Dwerror=false
ninja -C build
;;
*)
sudo chown $USER build/.ninja*
meson setup --reconfigure build -Dbuildtype=release
ninja -C build
;;
esac
beep_attention
$SNIN
sudo ldconfig
elap_stop
done
}
do_tests() {
if [ -x /usr/bin/wmctrl ]; then
if [ "$XDG_SESSION_TYPE" == "x11" ]; then
wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz
fi
fi
printf "\n\n$BLD%s $OFF%s\n" "System check..."
if systemd-detect-virt -q --container; then
printf "\n$BDR%s %s\n" "ESTEEM IS NOT INTENDED FOR USE INSIDE CONTAINERS."
printf "$BDR%s $OFF%s\n\n" "SCRIPT ABORTED."
beep_exit
exit 1
fi
if [ $DISTRO == mantic ]; then
printf "\n$BDG%s $OFF%s\n\n" "Ubuntu ${DISTRO^}... OK"
sleep 1
else
printf "\n$BDR%s $OFF%s\n\n" "UNSUPPORTED OPERATING SYSTEM [ $(lsb_release -d | cut -f2) ]."
beep_exit
exit 1
fi
if ! git ls-remote http://git.enlightenment.org/enlightenment/efl.git HEAD &>/dev/null; then
printf "\n$BDR%s %s\n" "REMOTE HOST IS UNREACHABLE——TRY AGAIN LATER"
printf "$BDR%s $OFF%s\n\n" "OR CHECK YOUR INTERNET CONNECTION."
beep_exit
exit 1
fi
if ! test -d "$HOME/.local/bin"; then
mkdir -p "$HOME/.local/bin"
fi
if ! test -d "$HOME/.cache/ebuilds"; then
mkdir -p "$HOME/.cache/ebuilds"
fi
}
do_bsh_alias() {
if [ -f $HOME/.bash_aliases ]; then
mv -vb $HOME/.bash_aliases $HOME/.bash_aliases_bak
echo
touch $HOME/.bash_aliases
else
touch $HOME/.bash_aliases
fi
cat >$HOME/.bash_aliases <<EOF
# ---------------------
# ENVIRONMENT VARIABLES
# ---------------------
# (These variables can be accessed from any shell sessions.)
# Compiler and linker flags added by ESTEEM.
export CC="ccache gcc"
export CXX="ccache g++"
export USE_CCACHE=1
export CCACHE_COMPRESS=1
export CPPFLAGS=-I/usr/local/include
export LDFLAGS=-L/usr/local/lib
export PKG_CONFIG_PATH=/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig
EOF
source $HOME/.bash_aliases
}
set_p_src() {
echo
beep_attention
# Do not append a trailing slash (/) to the end of the path prefix,
# and double-check the path you entered before validating.
#
read -p "Please enter a path for the Enlightenment source folders \
(e.g. /home/$LOGNAME/Documents or /home/$LOGNAME/testing): " mypath
mkdir -p "$mypath"/sources
SRCDIR="$mypath"/sources
echo $SRCDIR >$HOME/.cache/ebuilds/storepath
printf "\n%s\n\n" "You have chosen: $SRCDIR"
sleep 2
}
# Fetch and install recommended program.
get_rcmd() {
ESRC=$(cat $HOME/.cache/ebuilds/storepath)
printf "\n\n$BLD%s $OFF%s\n\n" "Installing rlottie..."
cd $ESRC
git clone https://github.com/Samsung/rlottie.git
cd $ESRC/rlottie
meson setup build -Dbuildtype=plain \
-Dexample=false
ninja -C build
$SNIN
sudo ldconfig
echo
}
do_link() {
sudo ln -sf /usr/local/etc/enlightenment/sysactions.conf /etc/enlightenment/sysactions.conf
sudo ln -sf /usr/local/etc/enlightenment/system.conf /etc/enlightenment/system.conf
sudo ln -sf /usr/local/etc/xdg/menus/e-applications.menu /etc/xdg/menus/e-applications.menu
}
install_now() {
clear
printf "\n$BDG%s $OFF%s\n\n" "* INSTALLING ENLIGHTENMENT DESKTOP ENVIRONMENT: PLAIN BUILD ON XORG SERVER *"
do_bsh_alias
beep_attention
bin_deps
set_p_src
get_rcmd
cd $HOME
mkdir -p $ESRC/e26
cd $ESRC/e26
printf "\n\n$BLD%s $OFF%s\n\n" "Fetching source code from the Enlightenment git repositories..."
$CLONEFL
echo
$CLONETY
echo
$CLONE26
echo
$CLONEPH
echo
$CLONERG
echo
$CLONEVI
echo
$CLONEXP
echo
$CLONECR
echo
$CLONEVE
echo
$CLONEDI
echo
$CLONENT
echo
$CLONEFT
echo
$CLONEPN
echo
$CLONEPL
printf "\n\n$BLD%s $OFF%s\n\n" "Fetching source code from Dimmus' git repository..."
$CLONETE
echo
cnt_dir
build_plain
# Doxygen outputs HTML-based (as well as LaTeX-formatted) documentation. Click on e26/efl/build/html/index.html
# to open the HTML documentation in your browser.
#
printf "\n\n$BOLD%s $OFF%s\n\n" "Generating the documentation for EFL..."
cd $ESRCDIR/e26/efl/build/doc
doxygen
sudo mkdir -p /etc/enlightenment
do_link
sudo ln -sf /usr/local/share/xsessions/enlightenment.desktop \
/usr/share/xsessions/enlightenment.desktop
# Protect this file from accidental deletion.
sudo chattr +i $HOME/.cache/ebuilds/storepath
printf "\n%s\n\n" "All done!"
beep_ok
printf "\n\n$BTC%s %s" "INITIAL SETUP WIZARD TIPS:"
printf "\n$BTC%s %s" '“Update checking” —— you can disable this feature because it serves no useful purpose.'
printf "\n$BTC%s $OFF%s\n\n" '“Network management support” —— Connman is not needed (ignore the warning message).'
# Note: Enlightenment adds three shortcut icons (namely home.desktop, root.desktop and tmp.desktop)
# to your Desktop, you can safely delete them if it bothers you.
echo
cowsay "Now log out of your existing session then select Enlightenment on the login screen... \
That's All Folks!" | lolcat -a
echo
cp -f $DLDIR/esteem.sh $HOME/.local/bin
exit 0
}
release_go() {
clear
printf "\n$BDP%s $OFF%s\n\n" "* UPDATING ENLIGHTENMENT DESKTOP ENVIRONMENT: RELEASE BUILD ON XORG SERVER *"
# Check for available updates of the script folder first.
cd $SCRFLR && git pull &>/dev/null
cp -f esteem.sh $HOME/.local/bin
chmod +x $HOME/.local/bin/esteem.sh
sleep 1
rebuild_optim
sudo ln -sf /usr/local/share/xsessions/enlightenment.desktop \
/usr/share/xsessions/enlightenment.desktop
if [ -f /usr/share/wayland-sessions/enlightenment.desktop ]; then
sudo rm -rf /usr/share/wayland-sessions/enlightenment.desktop
fi
if [ -f /usr/local/share/wayland-sessions/enlightenment.desktop ]; then
sudo rm -rf /usr/local/share/wayland-sessions/enlightenment.desktop
fi
beep_ok
rstrt_e
echo
cowsay -f www "That's All Folks!"
echo
exit 0
}
wld_go() {
clear
printf "\n$BDY%s $OFF%s\n\n" "* UPDATING ENLIGHTENMENT DESKTOP ENVIRONMENT: RELEASE BUILD ON WAYLAND *"
cd $SCRFLR && git pull &>/dev/null
cp -f esteem.sh $HOME/.local/bin
chmod +x $HOME/.local/bin/esteem.sh
sleep 1
rebuild_wld
sudo mkdir -p /usr/share/wayland-sessions
sudo ln -sf /usr/local/share/wayland-sessions/enlightenment.desktop \
/usr/share/wayland-sessions/enlightenment.desktop
beep_ok
if [ "$XDG_SESSION_TYPE" == "x11" ] || [ "$XDG_SESSION_TYPE" == "wayland" ]; then
echo
cowsay -f www "Now log out of your existing session and press Ctrl+Alt+F3 to switch to tty3, \
then enter your credentials and type: enlightenment_start" | lolcat -a
echo
# Wait a few seconds for the Wayland session to start.
# When you're done, type exit
# Pressing Ctrl+Alt+F1 (or Ctrl+Alt+F7) will bring you back to the login screen.
else
echo
cowsay -f www "That's it. Now type: enlightenment_start"
echo
# If Enlightenment fails to start, relaunch the script and select option 2.
# After the build is complete type exit, then go back to the login screen.
fi
exit 0
}
# Lo and behold (“bhd”)!
#
# Display the selection menu...
#
lo() {
trap '{ printf "\n$BDR%s $OFF%s\n\n" "KEYBOARD INTERRUPT."; exit 130; }' INT
INPUT=0
printf "\n$BLD%s $OFF%s\n" "Please enter the number of your choice:"
if [ ! -x /usr/local/bin/enlightenment_start ]; then
menu_sel
else
sel_menu
fi
}
# and get the user's choice.
bhd() {
if [ $INPUT == 1 ]; then
do_tests
install_now
elif [ $INPUT == 2 ]; then
do_tests
release_go
elif [ $INPUT == 3 ]; then
do_tests
wld_go
else
beep_exit
exit 1
fi
}
lo
bhd