generated from batden/esteem
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathelucidate.sh
907 lines (796 loc) · 24.6 KB
/
elucidate.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
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
#!/bin/bash
# shellcheck disable=SC1091 disable=SC2164
# This script allows you to easily and safely install Enlightenment, along with
# other applications based on the Enlightenment Foundation Libraries (EFL),
# in your Ubuntu LTS desktop system.
# Supported distribution: Ubuntu Noble Numbat.
# ELUCIDATE.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.
# Also note that ELUCIDATE.SH is not compatible with non-standard package managers like Nix.
# ELUCIDATE.SH is licensed under a Creative Commons Attribution 4.0 International License,
# in memory of Aaron Swartz.
# See https://creativecommons.org/licenses/by/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.)
BOLD="\e[1m" # Bold text.
ITALIC="\e[3m" # Italic text.
OFF="\e[0m" # Turn off ANSI colors and formatting
GREEN_BRIGHT="\e[1;38;5;118m"
MAGENTA_BRIGHT="\e[1;38;5;201m"
ORANGE_BRIGHT="\e[1;38;5;208m"
YELLOW_BRIGHT="\e[1;38;5;226m"
BLUE_BRIGHT="\e[1;38;5;74m"
RED_BRIGHT="\e[1;38;5;1m"
GREEN_DIM="\e[2;38;5;118m"
MAGENTA_DIM="\e[2;38;5;201m"
ORANGE_DIM="\e[2;38;5;208m"
PREFIX=/usr/local
DLDIR=$(xdg-user-dir DOWNLOAD)
DOCDIR=$(xdg-user-dir DOCUMENTS)
SCRFLDR=$HOME/.elucidate
REBASEF="git config pull.rebase false"
AUTGN="./autogen.sh --prefix=$PREFIX"
SNIN="sudo ninja -C build install"
SMIL="sudo make install"
DISTRO=$(lsb_release -sc)
DDCTL=2.0.0
# Build dependencies, recommended and script-related packages.
DEPS=(arc-theme
automake
build-essential
ccache
check
cmake
cowsay
doxygen
fonts-noto
freeglut3-dev
gettext
graphviz
gstreamer1.0-plugins-bad
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
libjansson-dev
libjpeg-dev
libjson-c-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
pv
texlive-base
texlive-font-utils
unity-greeter-badges
valgrind
wayland-protocols
wmctrl
xdotool)
# Latest source code available.
CLONEFL="git clone https://git.enlightenment.org/enlightenment/efl.git"
CLONETY="git clone https://git.enlightenment.org/enlightenment/terminology.git"
CLONENL="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"
# “MBS” stands for Meson Build System.
PROG_MBS="
efl
terminology
enlightenment
ephoto
rage
evisum
express
ecrire
enventor
edi
entice
enlightenment-module-forecasts
enlightenment-module-penguins
enlightenment-module-places
eflete"
# Bug reporting: Before using this script, 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-frills, 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_selec() {
if [ $INPUT -lt 1 ]; then
echo
printf "1 $GREEN_BRIGHT%s $OFF%s\n\n" "INSTALL the Enlightenment ecosystem now" | pv -qL 20
printf "2 $MAGENTA_DIM%s $OFF%s\n\n" "(Update and rebuild the ecosystem in release mode)" | pv -qL 30
printf "3 $ORANGE_DIM%s $OFF%s\n\n" "(Update and rebuild the ecosystem with Wayland support)" | pv -qL 30
sleep 1 && printf "$ITALIC%s $OFF%s\n\n" "Or press Ctrl+C to quit."
read -r INPUT
fi
}
selec_menu() {
if [ $INPUT -lt 1 ]; then
echo
printf "1 $GREEN_DIM%s $OFF%s\n\n" "(Install the Enlightenment ecosystem now)" | pv -qL 30
printf "2 $MAGENTA_BRIGHT%s $OFF%s\n\n" "Update and rebuild the ecosystem in RELEASE mode" | pv -qL 20
printf "3 $ORANGE_BRIGHT%s $OFF%s\n\n" "Update and rebuild the ecosystem with WAYLAND support" | pv -qL 24
sleep 1 && printf "$ITALIC%s $OFF%s\n\n" "Or press Ctrl+C to quit."
read -r INPUT
fi
}
# Check binary dependencies.
bin_deps() {
if ! sudo apt install --no-install-recommends "${DEPS[@]}"; then
printf "\n$RED_BRIGHT%s %s\n" "CONFLICTING OR MISSING DEB PACKAGES"
printf "$RED_BRIGHT%s %s\n" "OR DPKG DATABASE IS LOCKED."
printf "$RED_BRIGHT%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$RED_BRIGHT%s %s\n" "FAILED TO DOWNLOAD MAIN COMPONENT."
printf "$RED_BRIGHT%s $OFF%s\n\n" "SCRIPT ABORTED."
beep_exit
exit 1
# You can try downloading the missing file(s) manually (see CLONEFL or CLONENL), 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 "$GREEN_BRIGHT%s $OFF%s\n\n" "All programs have been downloaded successfully."
beep_dl_complete
sleep 2
;;
0)
printf "\n$RED_BRIGHT%s %s\n" "OOPS! SOMETHING WENT WRONG."
printf "$RED_BRIGHT%s $OFF%s\n\n" "SCRIPT ABORTED."
beep_exit
exit 1
;;
*)
printf "\n$YELLOW_BRIGHT%s %s\n" "WARNING: ONLY $COUNT OF 15 PROGRAMS HAVE BEEN DOWNLOADED!"
printf "\n$YELLOW_BRIGHT%s $OFF%s\n\n" "WAIT 12 SECONDS OR HIT CTRL+C TO EXIT NOW."
beep_attention
sleep 12
;;
esac
}
mng_err() {
printf "\n$RED_BRIGHT%s $OFF%s\n\n" "BUILD ERROR——TRY AGAIN LATER."
beep_exit
exit 1
}
# 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_1737447643/.elementary/ /home/riley/
# cp -aR /home/riley/Documents/ebackups/E_1737447643/.e/ /home/riley/
# cp -aR /home/riley/Documents/ebackups/ETERM_1737447643/terminology/config/ /home/riley/.config/terminology/
# cp -aR /home/riley/Documents/ebackups/ETERM_1737447643/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" &>/dev/null
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" &>/dev/null
sleep 2
fi
}
e_tokens() {
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 -r -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$ITALIC%s $OFF%s\n\n" "(no backup made... OK)"
;;
*)
printf "\n$ITALIC%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...
#
# Add optional JXL support?
# For best results, jpeg xl has to be compiled from source. If you really need jxl
# support in efl, please follow the instructions below:
# https://gist.github.com/batden/0f45f8b8578ec70ee911b920b6eacd39
#
# Then change the option “-Devas-loaders-disabler=jxl” to
# "-Devas-loaders-disabler=” whenever it's applicable.
#
# Note: If building jxl is too much of a hassle for you, then install
# the libjxl-dev package instead (this older version still works).
#
# 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_MBS; do
cd "$ESRCDIR/enlighten/$I"
printf "\n$BOLD%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=jxl \
-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
;;
*)
meson setup build -Dbuildtype=plain
ninja -C build
;;
esac
beep_attention
$SNIN
sudo ldconfig
done
}
rebuild_optim() {
ESRCDIR=$(cat "$HOME/.cache/ebuilds/storepath")
bin_deps
e_tokens
cd "$ESRCDIR/rlottie"
printf "\n$BOLD%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
for I in $PROG_MBS; do
cd "$ESRCDIR/enlighten/$I"
printf "\n$BOLD%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=jxl \
-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
;;
*)
sudo chown "$USER" build/.ninja*
meson setup --reconfigure build -Dbuildtype=release
ninja -C build
;;
esac
beep_attention
$SNIN
sudo ldconfig
done
}
rebuild_wayld() {
ESRCDIR=$(cat "$HOME/.cache/ebuilds/storepath")
if [ "$XDG_SESSION_TYPE" == "tty" ] && [ "$XDG_CURRENT_DESKTOP" == "Enlightenment" ]; then
printf "\n$RED_BRIGHT%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
cd "$ESRCDIR/rlottie"
printf "\n$BOLD%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
for I in $PROG_MBS; do
cd "$ESRCDIR/enlighten/$I"
printf "\n$BOLD%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=jxl \
-Dglib=true \
-Ddrm=true \
-Dwl=true \
-Dopengl=es-egl \
-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
;;
*)
sudo chown "$USER" build/.ninja*
meson setup --reconfigure build -Dbuildtype=release
ninja -C build
;;
esac
beep_attention
$SNIN
sudo ldconfig
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$BOLD%s $OFF%s\n" "System check..."
if systemd-detect-virt -q --container; then
printf "\n$RED_BRIGHT%s %s\n" "ELUCIDATE IS NOT INTENDED FOR USE INSIDE CONTAINERS."
printf "$RED_BRIGHT%s $OFF%s\n\n" "SCRIPT ABORTED."
beep_exit
exit 1
fi
if [ "$DISTRO" == noble ]; then
printf "\n$GREEN_BRIGHT%s $OFF%s\n\n" "Ubuntu ${DISTRO^}... OK"
sleep 1
else
printf "\n$RED_BRIGHT%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$RED_BRIGHT%s %s\n" "REMOTE HOST IS UNREACHABLE——TRY AGAIN LATER"
printf "$RED_BRIGHT%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 ELUCIDATE.
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
# Keyring service workaround for Enlightenment.
# You also need to autostart some additional services at startup for this to work:
# See the repository's wiki (Startup Applications) for more info.
#
if printenv | grep -q 'XDG_CURRENT_DESKTOP=Enlightenment'; then
export SSH_AUTH_SOCK=/run/user/${UID}/keyring/ssh
fi
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 -r -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 prerequisites.
get_preq() {
ESRCDIR=$(cat "$HOME/.cache/ebuilds/storepath")
printf "\n\n$BOLD%s $OFF%s\n\n" "Installing prerequisites..."
cd "$DLDIR"
# See the ddcutil man page or visit https://www.ddcutil.com/commands/ for more information.
#
wget https://github.com/rockowitz/ddcutil/archive/refs/tags/v$DDCTL.tar.gz
tar xzvf v$DDCTL.tar.gz -C "$ESRCDIR"
cd "$ESRCDIR/ddcutil-$DDCTL"
$AUTGN
make
$SMIL
sudo ldconfig
rm -rf "$DLDIR/v$DDCTL.tar.gz"
echo
cd "$ESRCDIR"
git clone https://github.com/Samsung/rlottie.git
cd "$ESRCDIR/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$GREEN_BRIGHT%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_preq
cd "$HOME"
mkdir -p "$ESRCDIR/enlighten"
cd "$ESRCDIR/enlighten"
printf "\n\n$BOLD%s $OFF%s\n\n" "Fetching source code from the Enlightenment git repositories..."
$CLONEFL
echo
$CLONETY
echo
$CLONENL
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$BOLD%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 enlighten/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/enlighten/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$BLUE_BRIGHT%s %s" "INITIAL SETUP WIZARD TIPS:"
printf "\n$BLUE_BRIGHT%s %s" '“Update checking” —— you can disable this feature because it serves no useful purpose.'
printf "\n$BLUE_BRIGHT%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 Gnome 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/elucidate.sh" "$HOME/.local/bin"
exit 0
}
release_go() {
clear
printf "\n$MAGENTA_BRIGHT%s $OFF%s\n\n" "* UPDATING ENLIGHTENMENT DESKTOP ENVIRONMENT: RELEASE BUILD ON XORG SERVER *"
# Check for available updates of the script folder first.
cd "$SCRFLDR" && git pull &>/dev/null
cp -f elucidate.sh "$HOME/.local/bin"
chmod +x "$HOME/.local/bin/elucidate.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
}
wayld_go() {
clear
printf "\n$ORANGE_BRIGHT%s $OFF%s\n\n" "* UPDATING ENLIGHTENMENT DESKTOP ENVIRONMENT: RELEASE BUILD ON WAYLAND *"
# Check for available updates of the script folder first.
cd "$SCRFLDR" && git pull &>/dev/null
cp -f elucidate.sh "$HOME/.local/bin"
chmod +x "$HOME/.local/bin/elucidate.sh"
sleep 1
rebuild_wayld
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 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
}
chk_pv() {
if [ ! -x /usr/bin/pv ]; then
printf "\n$BOLD%s $OFF%s\n\n" "Installing pv command for menu animation..."
sudo apt install -y pv
fi
}
# Lo and behold (“bhd”)!
#
# Display the selection menu...
#
lo() {
trap '{ printf "\n$RED_BRIGHT%s $OFF%s\n\n" "KEYBOARD INTERRUPT."; exit 130; }' INT
INPUT=0
printf "\n$BOLD%s $OFF%s\n" "Please enter the number of your choice:"
if [ ! -x /usr/local/bin/enlightenment_start ]; then
menu_selec
else
selec_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
wayld_go
else
beep_exit
exit 1
fi
}
chk_pv
lo
bhd