-
Notifications
You must be signed in to change notification settings - Fork 0
/
kdevelop.sh
161 lines (130 loc) · 4.94 KB
/
kdevelop.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
#!/bin/sh
# vim:set syntax=sh:
# kate: syntax bash;
# SPDX-License-Identifier: CC-BY-SA-4.0
# Copyright 2021 Jakob Meng, <[email protected]>
exit # do not run any commands when file is executed
################################################################################
#
# Build KDevelop 5 with kdesrc-build
#
# References:
# http://kfunk.org/2016/02/16/building-kdevelop-5-from-source-on-ubuntu-15-10/
# https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source
# Prerequisites:
# - Install required debian packages, e.g. as described in
# ~/documents/Programmierung/Docker/debian-stretch-kde-dev/Dockerfile
cat << 'EOF' >> ~/.gitconfig
[url "git://anongit.kde.org/"]
insteadOf = kde:
[url "ssh://[email protected]/"]
pushInsteadOf = kde:
EOF
mkdir ~/kdesrc && cd ~/kdesrc
git clone kde:kdesrc-build
cd kdesrc-build
[ ! -d "$HOME/usr/bin" ] && mkdir -p "$HOME/usr/bin"
[ ! -e "$HOME/.bashrc-$USER" ] && \
cat << 'EOF' >> "$HOME/.bashrc-$USER"
# 2016 Jakob Meng, <[email protected]>
# bash startup commands sourced by .bashrc
export CMAKE_PREFIX_PATH=$HOME/usr
export PATH=$PATH:$HOME/usr/bin
[ -e ~/.env-kf5 ] && . ~/.env-kf5
EOF
cat << 'EOF' >> ~/.bashrc
. "$HOME/.bashrc-$USER"
EOF
. "$HOME/.bashrc-$USER"
ln -s ~/kdesrc/kdesrc-build/kdesrc-build ~/usr/bin
# Option 1: Create a fresh kdesrc-buildrc configuration
cp -i kdesrc-buildrc-kf5-sample ~/.kdesrc-buildrc
vi ~/.kdesrc-buildrc
# Replace
# /path/to/kdesrc-build/kf5-qt5-build-include
# with
# ~/kdesrc/kdesrc-build/kf5-qt5-build-include
# Add ignore-kde-structure option which will fetch and compile all projects in the same dir, meaning that instead of:
# extragear/network/kde-telepathy/ktp-text-ui
# it would be just
# ktp-text-ui
# Reference: https://git.reviewboard.kde.org/r/114525/
#
# Example:
# global
# ...
# ignore-kde-structure true
# ...
# end global
# Add
# make-options -jN
# where N is the number of jobs, this should usually be (number-of-cpu-cores + 1)
# Example:
# global
# ...
# make-options -j5
# ...
# end global
# Option 2: Use an existing kdesrc-buildrc configuration
cat << 'EOF' > ~/.kdesrc-buildrc
# This is a sample kdesrc-build configuration file appropriate for KDE
# Frameworks 5-based build environments.
#
# See the kdesrc-buildrc-sample for explanations of what the options do, or
# view the manpage or kdesrc-build documentation at
# https://docs.kde.org/trunk5/en/extragear-utils/kdesrc-build/index.html
global
branch-group kf5-qt5
kdedir ~/kde-5 # Where to install KF5-based software
qtdir /usr # Where to find Qt5
# Where to download source code. By default the build directory and
# logs will be kept under this directory as well.
source-dir ~/kdesrc
ignore-kde-structure true
make-options -j5
#make-install-prefix sudo -S
cmake-options -DCMAKE_BUILD_TYPE=Release
end global
# Instead of specifying modules here, the current best practice is to refer to
# KF5 module lists maintained with kdesrc-build by the KF5 developers. As new
# modules are added or modified, the kdesrc-build KF5 module list is altered to
# suit, and when you update kdesrc-build you will automatically pick up the
# needed changes.
# NOTE: You MUST change the path below to include the actual path to your
# kdesrc-build installation.
include ~/kdesrc/kdesrc-build/kf5-qt5-build-include
# If you wish to maintain the module list yourself that is possible, simply
# look at the files pointed to above and use the "module-set" declarations that
# they use, with your own changes.
# It is possible to change the options for modules loaded from the file
# included above (since it's not possible to add a module that's already been
# included), e.g.
options kcoreaddons
#make-options -j4
end options
EOF
# Workarounds (which might become obsolete in future)
[ ! -d ~/.local/share/kservicetypes5/ ] && {
mkdir -p ~/.local/share/kservicetypes5/ && \
ln -s /usr/share/kservicetypes5/plasma-dataengine.desktop ~/.local/share/kservicetypes5/plasma-dataengine.desktop;
}
ln -s /usr/share/kf5/ ~/.local/share/kf5
kdesrc-build --debug libkomparediff2 grantlee kdevplatform kdevelop-pg-qt kdevelop kdev-php kdev-python
# NOTE: You have to edit this file e.g. if you change kdedir in .kdesrc-buildrc!
cat << 'EOF' >> ~/.env-kf5
export KF5=~/kde-5
export QTDIR=/usr
export CMAKE_PREFIX_PATH=$KF5:$CMAKE_PREFIX_PATH
export XDG_DATA_DIRS=$KF5/share:$XDG_DATA_DIRS:/usr/share
export XDG_CONFIG_DIRS=$KF5/etc/xdg:$XDG_CONFIG_DIRS:/etc/xdg
export PATH=$KF5/bin:$QTDIR/bin:$PATH
export QT_PLUGIN_PATH=$KF5/lib/plugins:$KF5/lib64/plugins:$KF5/lib/x86_64-linux-gnu/plugins:$QTDIR/plugins:$QT_PLUGIN_PATH
# (lib64 instead of lib, on OpenSUSE and similar)
export QML2_IMPORT_PATH=$KF5/lib/qml:$KF5/lib64/qml:$KF5/lib/x86_64-linux-gnu/qml:$QTDIR/qml
export QML_IMPORT_PATH=$QML2_IMPORT_PATH
export KDE_SESSION_VERSION=5
export KDE_FULL_SESSION=true
EOF
. ~/.env-kf5
kdevelop
################################################################################