-
Notifications
You must be signed in to change notification settings - Fork 1
/
nix-install-darktable
executable file
·83 lines (68 loc) · 1.82 KB
/
nix-install-darktable
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
#!/bin/sh
### Package: nix-install-darktable
### Version: v20240414.2300
### Author: Michael Gan "xmixahlx" [email protected]
### License: GPLv3
### Script Dependencies: wlroots wayland wayland-protocols
## OVERRIDES
# NIXTOOLS
if [ -z $NIXTOOLSDIR ]; then
NIXTOOLSDIR="`pwd`"
PATH=$NIXTOOLSDIR:$PATH
fi
echo "*** NIXTOOLSDIR selected is $NIXTOOLSDIR."
# INSTALLDEPS
if [ -z $INSTALLDEPS ]; then
INSTALLDEPS=debian
fi
echo "*** INSTALLDEPS selected is $INSTALLDEPS."
# GITBRANCH
# Upstream branch is "master".
if [ -z $GITBRANCH ]; then
GITBRANCH=master
fi
echo "*** GITBRANCH selected is $GITBRANCH."
## VARS
RESDIR=$NIXTOOLSDIR/resources
DEVDIR=$NIXTOOLSDIR/upstream
GITURL=https://github.com
GITREPO=darktable-org
GITTREE=darktable
GITPRURL=https://patch-diff.githubusercontent.com
GITPRPATCH=$GITPRURL/raw/$GITREPO/$GITTREE/pull/$GITPR.patch
PKGDIR=$GITTREE\_$GITBRANCH
## INSTALLDEPS
# Debian Dependencies
if [ $INSTALLDEPS = debian ]; then
sudo apt-get -y build-dep darktable
sudo apt-get -y install build-essential coreutils libc-bin git cmake
fi
## PREP
set -e
mkdir -p $DEVDIR
cd $DEVDIR
## CLEAN
sudo rm -Rf $PKGDIR/tmpbuild
## GIT
[ -d $PKGDIR ] || git clone --recursive --depth=1 $GITURL/$GITREPO/$GITTREE.git --branch=$GITBRANCH $PKGDIR
cd $PKGDIR
git clean -dfx
git reset --hard
git pull
git submodule update --init --recursive --depth=1
## GITPR
if [ $GITPR ]; then
rm -f $DEVDIR/$GITTREE\_$GITPR.patch
wget $GITPRPATCH -O $DEVDIR/$GITTREE\_$GITPR.patch
patch -p1 < $DEVDIR/$GITTREE\_$GITPR.patch
fi
## CONFIGURE
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr/local -S . -B ./tmpbuild
## BUILD
cmake --build ./tmpbuild --config Release --target all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF`
## INSTALL
sudo cmake --install ./tmpbuild
sudo ldconfig
## EXIT
exit
## ENJOY