1 |
commit: bca7d1609499b0f7c76a71596f3f9dfe550d9c86 |
2 |
Author: Michael Palimaka <kensington <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jul 9 15:48:00 2014 +0000 |
4 |
Commit: Michael Palimaka <kensington <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jul 9 15:48:00 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/kde.git;a=commit;h=bca7d160 |
7 |
|
8 |
[eclass] Add support for svn live ebuilds. |
9 |
|
10 |
--- |
11 |
eclass/kde5-functions.eclass | 10 +++++++ |
12 |
eclass/kde5.eclass | 68 +++++++++++++++++++++++++++++--------------- |
13 |
2 files changed, 55 insertions(+), 23 deletions(-) |
14 |
|
15 |
diff --git a/eclass/kde5-functions.eclass b/eclass/kde5-functions.eclass |
16 |
index 5147ed9..6f365f1 100644 |
17 |
--- a/eclass/kde5-functions.eclass |
18 |
+++ b/eclass/kde5-functions.eclass |
19 |
@@ -38,6 +38,16 @@ elif [[ ${KMNAME-${PN}} = kdevelop ]]; then |
20 |
KDEBASE=kdevelop |
21 |
fi |
22 |
|
23 |
+# @ECLASS-VARIABLE: KDE_SCM |
24 |
+# @DESCRIPTION: |
25 |
+# SCM to use if this is a live ebuild. |
26 |
+: ${KDE_SCM:=git} |
27 |
+ |
28 |
+case ${KDE_SCM} in |
29 |
+ svn|git) ;; |
30 |
+ *) die "KDE_SCM: ${KDE_SCM} is not supported" ;; |
31 |
+esac |
32 |
+ |
33 |
# determine the build type |
34 |
if [[ ${PV} = *9999* ]]; then |
35 |
KDE_BUILD_TYPE="live" |
36 |
|
37 |
diff --git a/eclass/kde5.eclass b/eclass/kde5.eclass |
38 |
index e96e6ed..48ea1e4 100644 |
39 |
--- a/eclass/kde5.eclass |
40 |
+++ b/eclass/kde5.eclass |
41 |
@@ -24,7 +24,10 @@ CMAKE_MIN_VERSION="2.8.12" |
42 |
inherit kde5-functions toolchain-funcs fdo-mime flag-o-matic gnome2-utils virtualx eutils cmake-utils |
43 |
|
44 |
if [[ ${KDE_BUILD_TYPE} = live ]]; then |
45 |
- inherit git-r3 |
46 |
+ case ${KDE_SCM} in |
47 |
+ svn) inherit subversion ;; |
48 |
+ git) inherit git-r3 ;; |
49 |
+ esac |
50 |
fi |
51 |
|
52 |
EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm |
53 |
@@ -227,28 +230,40 @@ _calculate_live_repo() { |
54 |
|
55 |
SRC_URI="" |
56 |
|
57 |
- local _kmname |
58 |
- # @ECLASS-VARIABLE: EGIT_MIRROR |
59 |
- # @DESCRIPTION: |
60 |
- # This variable allows easy overriding of default kde mirror service |
61 |
- # (anongit) with anything else you might want to use. |
62 |
- EGIT_MIRROR=${EGIT_MIRROR:=git://anongit.kde.org} |
63 |
- |
64 |
- # @ECLASS-VARIABLE: EGIT_REPONAME |
65 |
- # @DESCRIPTION: |
66 |
- # This variable allows overriding of default repository |
67 |
- # name. Specify only if this differ from PN and KMNAME. |
68 |
- if [[ -n ${EGIT_REPONAME} ]]; then |
69 |
- # the repository and kmname different |
70 |
- _kmname=${EGIT_REPONAME} |
71 |
- elif [[ -n ${KMNAME} ]]; then |
72 |
- _kmname=${KMNAME} |
73 |
- else |
74 |
- _kmname=${PN} |
75 |
- fi |
76 |
+ case ${KDE_SCM} in |
77 |
+ svn) |
78 |
+ # @ECLASS-VARIABLE: ESVN_MIRROR |
79 |
+ # @DESCRIPTION: |
80 |
+ # This variable allows easy overriding of default kde mirror service |
81 |
+ # (anonsvn) with anything else you might want to use. |
82 |
+ ESVN_MIRROR=${ESVN_MIRROR:=svn://anonsvn.kde.org/home/kde} |
83 |
+ ESVN_REPO_URI="${ESVN_MIRROR}/trunk/KDE/${PN}" |
84 |
+ ;; |
85 |
+ git) |
86 |
+ # @ECLASS-VARIABLE: EGIT_MIRROR |
87 |
+ # @DESCRIPTION: |
88 |
+ # This variable allows easy overriding of default kde mirror service |
89 |
+ # (anongit) with anything else you might want to use. |
90 |
+ EGIT_MIRROR=${EGIT_MIRROR:=git://anongit.kde.org} |
91 |
+ |
92 |
+ local _kmname |
93 |
+ |
94 |
+ # @ECLASS-VARIABLE: EGIT_REPONAME |
95 |
+ # @DESCRIPTION: |
96 |
+ # This variable allows overriding of default repository |
97 |
+ # name. Specify only if this differ from PN and KMNAME. |
98 |
+ if [[ -n ${EGIT_REPONAME} ]]; then |
99 |
+ # the repository and kmname different |
100 |
+ _kmname=${EGIT_REPONAME} |
101 |
+ elif [[ -n ${KMNAME} ]]; then |
102 |
+ _kmname=${KMNAME} |
103 |
+ else |
104 |
+ _kmname=${PN} |
105 |
+ fi |
106 |
|
107 |
- # default repo uri |
108 |
- EGIT_REPO_URI="${EGIT_MIRROR}/${_kmname}" |
109 |
+ EGIT_REPO_URI="${EGIT_MIRROR}/${_kmname}" |
110 |
+ ;; |
111 |
+ esac |
112 |
} |
113 |
|
114 |
case ${KDE_BUILD_TYPE} in |
115 |
@@ -282,7 +297,14 @@ kde5_src_unpack() { |
116 |
debug-print-function ${FUNCNAME} "$@" |
117 |
|
118 |
if [[ ${KDE_BUILD_TYPE} = live ]]; then |
119 |
- git-r3_src_unpack |
120 |
+ case ${KDE_SCM} in |
121 |
+ svn) |
122 |
+ subversion_src_unpack |
123 |
+ ;; |
124 |
+ git) |
125 |
+ git-r3_src_unpack |
126 |
+ ;; |
127 |
+ esac |
128 |
else |
129 |
unpack ${A} |
130 |
fi |