-
Notifications
You must be signed in to change notification settings - Fork 1
/
nix-install-i3
executable file
·77 lines (62 loc) · 1.39 KB
/
nix-install-i3
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
#!/bin/sh
### Package: nix-install-i3
### Version: v20210501.2300
### Author: Michael Gan "xmixahlx" [email protected]
### License: GPLv3
### Script Dependencies: (none)
## OVERRIDES
# NIXTOOLS
if [ -z $NIXTOOLSDIR ]; then
NIXTOOLSDIR="`pwd`"
fi
# INSTALLDEPS
if [ -z $INSTALLDEPS ]; then
INSTALLDEPS=debian
fi
# GITBRANCH
if [ -z $GITBRANCH ]; then
GITBRANCH=next
fi
## VARS
RESDIR=$NIXTOOLSDIR/resources
DEVDIR=$NIXTOOLSDIR/upstream
GITURL=https://github.com
GITREPO=i3
GITTREE=i3
PKGDIR=$GITTREE\_$GITBRANCH
## INSTALLDEPS
# Debian Dependencies
if [ $INSTALLDEPS = debian ]; then
sudo apt-get -y build-dep i3-wm
sudo apt-get -y install build-essential coreutils libc-bin git meson
fi
## PREP
set -e
mkdir -p $DEVDIR
cd $DEVDIR
## GIT
[ -d $PKGDIR ] || git clone --depth=1 $GITURL/$GITREPO/$GITTREE.git --branch=$GITBRANCH $PKGDIR
cd $PKGDIR
git clean -f
git reset --hard
git pull
git submodule init
git submodule update
## CLEAN
rm -Rf tmpbuild
## CONFIGURE
meson tmpbuild -Dprefix=/usr/local -Dbuildtype=release --libdir=/usr/local/lib/x86_64-linux-gnu \
-Ddocs=true -Dmans=true
## BUILD
ninja -C tmpbuild
## INSTALL
sudo ninja -C tmpbuild install
sudo ldconfig
## UPDATE-ALTERNATIVES
if [ $INSTALLDEPS = debian ]; then
sudo update-alternatives --install /usr/bin/x-window-manager x-window-manager /usr/local/bin/i3 999
sudo update-alternatives --config x-window-manager
fi
## EXIT
exit
## ENJOY