summaryrefslogtreecommitdiff
path: root/mk
blob: 05739bc972506812e2c9c681af553045654e25e3 (plain)
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
#!/bin/bash

readonly NO_UPGRADE=1
readonly RUN_INSTALLED=1
# [ "`lsmod | grep squashfs`" ] || sudo modprobe squashfs


function print() { printf "\033[01;34m%s\033[00m\n" "$(echo -e $*)" ; }


sudo echo
if pacman --version 2> /dev/null | grep libalpm > /dev/null
then print "\n--- running pacman ---\n"
     BASE_PKGS="$(pacman -Qg base-devel | cut -d ' ' -f 2)"
     CALAMARES_PKGS="boost extra-cmake-modules git kconfig kpmcore kservice kwindowsystem \
                     plasma-framework qt5-tools polkit-qt5 yaml-cpp" # squashfs-tools os-prober
#      PARABOLA_PKGS="arch-install-scripts"
     PKGS="$BASE_PKGS $CALAMARES_PKGS $PARABOLA_PKGS"
     pacman -Qi calamares > /dev/null 2>&1 && sudo pacman -R calamares
     pacman -Qi $PKGS > /dev/null && (($NO_UPGRADE)) || sudo pacman -Sy --needed $PKGS || exit 1
elif which apt-get &> /dev/null
then print "\n--- running apt ---\n"
     apt-get install extra-cmake-modules libatasmart-dev libboost-python-dev \
                     libkf5coreaddons-dev libkf5kio-dev libkf5plasma-dev     \
                     libkf5service-dev libkpmcore4-dev libparted-dev         \
                     libpolkit-qt5-1-dev qtdeclarative5-dev                    || exit 1
fi


if [ ! -d ./build ]
then print "\n--- preparing build environment ---\n"
     mkdir ./build
# else rm -f build/Makefile 2> /dev/null
fi
# if [ ! -d /etc/calamares/ ]
# then sudo mkdir                         /etc/calamares
#      sudo ln -s `pwd`/settings.conf     /etc/calamares/
#      sudo ln -s `pwd`/src/branding      /etc/calamares/
# fi


print "\n--- running cmake ---\n"
cd ./build
cmake -DCMAKE_BUILD_TYPE=Debug                                                       \
      -DCMAKE_INSTALL_PREFIX=/usr                                                    \
      -DCMAKE_INSTALL_LIBDIR=lib                                                     \
      -DSKIP_MODULES="dracut dracutlukscfg dummycpp dummyprocess dummypython         \
                      dummypythonqt grubcfg initramfs initramfscfg tracking          \
                      interactiveterminal license plymouthcfg removeuser webview" ..


if [ -d /usr/share/calamares/ -o -f /usr/bin/calamares ]
then print "\n--- running make uninstall ---\n"
     sudo make uninstall
     sudo rm -rf /usr/share/calamares/ /usr/bin/calamares
fi


if [ ! -f Makefile ]
then print "\n--- Makefile does not exist - bailing ---\n"
     cd ..
     exit 1
fi


if (($RUN_INSTALLED))
then print "\n--- running make install ---\n"
     sudo make install
else print "\n--- running make ---\n"
     make
fi
cd ..


if (($RUN_INSTALLED)) && [ -f /usr/bin/calamares ]
then print "\n--- launching calamares installed ---\n"
     sudo calamares
elif [ -f build/calamares ]
then print "\n--- launching calamares uninstalled ---\n"
     cp ./settings.conf ./build
     cd ./build
     sudo ./calamares -d
     cd ..
fi