Merge lp:~smspillaz/compiz-core/compiz-core.dist-buildsystem into lp:compiz-core/trunk
- compiz-core.dist-buildsystem
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 2760 |
Proposed branch: | lp:~smspillaz/compiz-core/compiz-core.dist-buildsystem |
Merge into: | lp:compiz-core/trunk |
Diff against target: |
394 lines (+287/-32) 5 files modified
CMakeLists.txt (+7/-7) VERSION (+1/-0) cmake/CompizCommon.cmake (+272/-20) cmake/CompizPlugin.cmake (+6/-0) include/compiz-common.h.in (+1/-5) |
To merge this branch: | bzr merge lp:~smspillaz/compiz-core/compiz-core.dist-buildsystem |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jason Smith (community) | Approve | ||
Review via email: mp+67100@code.launchpad.net |
Commit message
Description of the change
Adds new release targets to the buildsystem
make release-prep: generates NEWS ChangeLog and AUTHORS file
make distcheck: generates a tarball
make release-signoff: signs the tarball using the key in RELEASE_KEY and if
in a git repository, creates tags and branches for that
- 2760. By Sam Spilsbury
-
Add various fixes for distcheck, source distributions without a VCS
and non-C sources (eg python bindings where we can't do try_compile
because C and CXX are not in the enabled languages)
Aurélien Gâteau (agateau) wrote : | # |
- 2761. By Sam Spilsbury
-
Drop support for bz2, add targets for release uploads, cleanup
Aurélien Gâteau (agateau) wrote : | # |
Looks nicer, just two minor nitpicks:
1. The "if" cmake command allows you to simplify the tests from "if (${IS_GIT_REPO})" to "if (IS_GIT_REPO)".
2. There is some commented code, not sure if it is intentional or not.
- 2762. By Sam Spilsbury
-
Nitpicking and fix FTBFS on bzr
Jason Smith (jassmith) wrote : | # |
Can this be run by someone without commit access to compiz?
Sam Spilsbury (smspillaz) wrote : | # |
Yes, the targets are independent of each other
release-prep: updates the NEWS, ChangeLog, AUTHORS (in /build, NOT in the working tree)
distcheck: checks for build failure, does tests
release-signoff: creates git branches, tags, copies NEWS etc into working tree, commits, updates tarball, signs it + checksums it and bumps VERSION
release-push: pushes objects into git
release-upload: uploads tarball to releases.compiz.org
Preview Diff
1 | === modified file 'CMakeLists.txt' |
2 | --- CMakeLists.txt 2011-07-06 19:52:01 +0000 |
3 | +++ CMakeLists.txt 2011-07-07 16:29:45 +0000 |
4 | @@ -15,13 +15,10 @@ |
5 | set (CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type (Debug/Release/RelWithDebInfo/MinSizeRe)" FORCE) |
6 | endif (NOT CMAKE_BUILD_TYPE) |
7 | |
8 | -# compiz package version number |
9 | -# An odd micro number indicates in-progress development. |
10 | -# An even micro number indicates a released version. |
11 | -set (COMPIZ_VERSION_MAJOR 0) |
12 | -set (COMPIZ_VERSION_MINOR 9) |
13 | -set (COMPIZ_VERSION_MICRO 5) |
14 | -set (VERSION ${COMPIZ_VERSION_MAJOR}.${COMPIZ_VERSION_MINOR}.${COMPIZ_VERSION_MICRO}) |
15 | +file (READ ${CMAKE_SOURCE_DIR}/VERSION COMPIZ_RELEASE_VERSION LIMIT 12 OFFSET 0) |
16 | +string (STRIP ${COMPIZ_RELEASE_VERSION} COMPIZ_RELEASE_VERSION) |
17 | + |
18 | +set (VERSION ${COMPIZ_RELEASE_VERSION}) |
19 | |
20 | set (DECOR_INTERFACE_VERSION 20110504) |
21 | |
22 | @@ -126,6 +123,9 @@ |
23 | compiz_package_generation ("Compiz") |
24 | compiz_add_uninstall () |
25 | compiz_add_git_dist () |
26 | +compiz_add_distcheck () |
27 | +compiz_add_release () |
28 | +compiz_add_release_signoff () |
29 | |
30 | _print_configure_results () |
31 | |
32 | |
33 | === added file 'VERSION' |
34 | --- VERSION 1970-01-01 00:00:00 +0000 |
35 | +++ VERSION 2011-07-07 16:29:45 +0000 |
36 | @@ -0,0 +1,1 @@ |
37 | +0.9.5.0 |
38 | |
39 | === modified file 'cmake/CompizCommon.cmake' |
40 | --- cmake/CompizCommon.cmake 2011-02-22 11:27:28 +0000 |
41 | +++ cmake/CompizCommon.cmake 2011-07-07 16:29:45 +0000 |
42 | @@ -49,6 +49,24 @@ |
43 | set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") |
44 | endif () |
45 | |
46 | +if (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.git) |
47 | + set(IS_GIT_REPO 1) |
48 | +else (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.git) |
49 | + set(IS_GIT_REPO 0) |
50 | +endif (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.git) |
51 | + |
52 | +if (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.gitmodules) |
53 | + set(IS_GIT_SUBMODULES_REPO 1) |
54 | +else (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.gitmodules) |
55 | + set(IS_GIT_SUBMODULES_REPO 0) |
56 | +endif (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.gitmodules) |
57 | + |
58 | +if (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.bzr) |
59 | + set(IS_BZR_REPO 1) |
60 | +elseif (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.bzr) |
61 | + set(IS_BZR_REPO 0) |
62 | +endif (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.bzr) |
63 | + |
64 | function (compiz_ensure_linkage) |
65 | find_program (LDCONFIG_EXECUTABLE ldconfig) |
66 | mark_as_advanced (FORCE LDCONFIG_EXECUTABLE) |
67 | @@ -64,12 +82,243 @@ |
68 | endfunction () |
69 | |
70 | macro (compiz_add_git_dist) |
71 | - set(ARCHIVE_NAME ${CMAKE_PROJECT_NAME}-${VERSION}) |
72 | - add_custom_target(dist |
73 | - COMMAND git archive --prefix=${ARCHIVE_NAME}/ HEAD |
74 | - | bzip2 > ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.bz2 |
75 | - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
76 | -endmacro () |
77 | + |
78 | + # Try to use the git and bzr inbuilt functions for generating |
79 | + # archives first, otherwise do it manually |
80 | + if (${IS_GIT_REPO}) |
81 | + |
82 | + if (${IS_GIT_SUBMODULES_REPO}) |
83 | + find_program (GIT_ARCHIVE_ALL git-archive-all.sh) |
84 | + |
85 | + if (NOT (${GIT_ARCHIVE_ALL} STREQUAL "GIT_ARCHIVE_ALL-NOTFOUND")) |
86 | + add_custom_target (dist ${GIT_ARCHIVE_ALL} --prefix ${CMAKE_PROJECT_NAME}-${VERSION}/ ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}.tar |
87 | + COMMAND bzip2 ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}.tar |
88 | + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
89 | + COMMENT "Creating bz2 archive") |
90 | + else (NOT (${GIT_ARCHIVE_ALL} STREQUAL "GIT_ARCHIVE_ALL-NOTFOUND")) |
91 | + message ("[WARNING]: git-archive-all.sh is needed to make releases of git submodules, get it from https://github.com/meitar/git-archive-all.sh.git and install it into your PATH") |
92 | + endif (NOT (${GIT_ARCHIVE_ALL} STREQUAL "GIT_ARCHIVE_ALL-NOTFOUND")) |
93 | + else (${IS_GIT_SUBMODULES_REPO}) |
94 | + add_custom_target (dist git archive --format=tar --prefix ${CMAKE_PROJECT_NAME}-${VERSION}/ -o ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}.tar HEAD |
95 | + COMMAND bzip2 ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}.tar |
96 | + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
97 | + COMMENT "Creating bz2 archive") |
98 | + endif (${IS_GIT_SUBMODULES_REPO}) |
99 | + else (${IS_GIT_REPO}) |
100 | + if (${IS_BZR_REPO}) |
101 | + add_custom_target (dist |
102 | + COMMAND bzr export --root=${CMAKE_PROJECT_NAME}-${VERSION} ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2 |
103 | + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) |
104 | + else (${IS_BZR_REPO}) |
105 | + add_custom_target (dist) |
106 | + #add_custom_target (dist |
107 | + # COMMAND tar -cvf ${CMAKE_SOURCE_DIR} | bzip2 > ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2 |
108 | + # WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/../) |
109 | + endif (${IS_BZR_REPO}) |
110 | + endif (${IS_GIT_REPO}) |
111 | + |
112 | +endmacro () |
113 | + |
114 | +macro (compiz_add_distcheck) |
115 | + add_custom_target (distcheck |
116 | + COMMAND mkdir -p ${CMAKE_BINARY_DIR}/dist-build |
117 | + && cp ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2 ${CMAKE_BINARY_DIR}/dist-build |
118 | + && cd ${CMAKE_BINARY_DIR}/dist-build |
119 | + && tar xvf ${CMAKE_BINARY_DIR}/dist-build/${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2 |
120 | + && mkdir -p ${CMAKE_BINARY_DIR}/dist-build/${CMAKE_PROJECT_NAME}-${VERSION}/build |
121 | + && cd ${CMAKE_BINARY_DIR}/dist-build/${CMAKE_PROJECT_NAME}-${VERSION}/build |
122 | + && cmake -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/dist-build/buildroot -DCOMPIZ_PLUGIN_INSTALL_TYPE='package' .. -DCMAKE_MODULE_PATH=/usr/share/cmake -DCOMPIZ_DISABLE_PLUGIN_KDE=ON |
123 | + && make -j4 |
124 | + && make -j4 install |
125 | + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
126 | + add_dependencies (distcheck dist) |
127 | +endmacro () |
128 | + |
129 | +macro (compiz_add_release_signoff) |
130 | + |
131 | + add_custom_target (release-signoff) |
132 | + |
133 | + add_custom_target (release-update-working-tree |
134 | + COMMAND cp NEWS ${CMAKE_SOURCE_DIR} && |
135 | + cp AUTHORS ${CMAKE_SOURCE_DIR} && |
136 | + cp ChangeLog ${CMAKE_SOURCE_DIR}) |
137 | + |
138 | + if (${IS_GIT_REPO}) |
139 | + add_custom_target (release-commits |
140 | + COMMAND git commit -a -m "Update NEWS for ${VERSION}" |
141 | + COMMENT "Release Commit" |
142 | + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
143 | + add_custom_target (release-tags |
144 | + COMMAND git tag -u $ENV{RELEASE_KEY} compiz-${VERSION} HEAD -m "Compiz ${VERSION} Release" |
145 | + COMMENT "Release Tags" |
146 | + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
147 | + add_custom_target (release-branch |
148 | + COMMAND git checkout -b compiz-${VERSION}-series && |
149 | + touch RELEASED && |
150 | + git add RELEASED && |
151 | + cat VERSION > RELEASED && |
152 | + git commit -a -m "Add RELEASED file" |
153 | + COMMENT "Release Branch" |
154 | + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
155 | + add_custom_target (release-update-dist |
156 | + COMMAND git checkout master && |
157 | + rm ${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2 && |
158 | + make dist |
159 | + COMMENT "Updating bz2 archive" |
160 | + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) |
161 | + add_custom_target (release-version-bump |
162 | + COMMAND git checkout master && |
163 | + $ENV{EDITOR} VERSION && |
164 | + git add VERSION && |
165 | + git commit VERSION -m "Bump VERSION" |
166 | + COMMENT "Bumping VERSION" |
167 | + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
168 | + else (${IS_GIT_REPO}) |
169 | + add_custom_target (release-commits) |
170 | + add_custom_target (release-tags) |
171 | + add_custom_target (release-branch) |
172 | + add_custom_target (release-update-dist) |
173 | + add_custom_target (release-version-bump) |
174 | + |
175 | + endif (${IS_GIT_REPO}) |
176 | + |
177 | + add_custom_target (release-sign-tarballs |
178 | + COMMAND gpg --armor --sign --detach-sig ${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2 |
179 | + COMMENT "Signing tarball" |
180 | + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) |
181 | + add_custom_target (release-sha1-tarballs |
182 | + COMMAND sha1sum ${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2 > ${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2.sha1 |
183 | + COMMENT "SHA1Summing tarball" |
184 | + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) |
185 | + add_custom_target (release-sign-sha1-tarballs |
186 | + COMMAND gpg --armor --sign --detach-sig ${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2.sha1 |
187 | + COMMENT "Signing SHA1Sum checksum" |
188 | + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) |
189 | + |
190 | + add_dependencies (release-commits release-update-working-tree) |
191 | + add_dependencies (release-tags release-commits) |
192 | + add_dependencies (release-branch release-tags) |
193 | + add_dependencies (release-update-dist release-branch) |
194 | + add_dependencies (release-version-bump release-update-dist) |
195 | + add_dependencies (release-sign-tarballs release-version-bump) |
196 | + add_dependencies (release-sha1-tarballs release-sign-tarballs) |
197 | + add_dependencies (release-sign-sha1-tarballs release-sha1-tarballs) |
198 | + |
199 | + # This means that releasing needs to be done from a git repo for now |
200 | + # But that's fine |
201 | + add_dependencies (release-signoff release-sign-sha1-tarballs) |
202 | + |
203 | + # Actually pushes the release |
204 | + if (${IS_GIT_REPO}) |
205 | + add_custom_target (push-master |
206 | + COMMAND git push origin master |
207 | + COMMENT "Pushing to master" |
208 | + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
209 | + add_custom_target (push-release-branch |
210 | + COMMAND git push origin compiz-${VERISON}-series |
211 | + COMMENT "Pushing to compiz-${VERISON}-series" |
212 | + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
213 | + add_custom_target (push-tag |
214 | + COMMAND git push origin compiz-${VERSION} |
215 | + COMMENT "Pushing tag compiz-${VERSION}" |
216 | + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
217 | + else (${IS_GIT_REPO}) |
218 | + add_custom_target (push-master) |
219 | + add_custom_target (push-release-branch) |
220 | + add_custom_target (push-tag) |
221 | + endif (${IS_GIT_REPO}) |
222 | + |
223 | + add_custom_target (release-push) |
224 | + |
225 | + add_dependencies (release-push push-release-branch) |
226 | + add_dependencies (push-release-branch push-tag) |
227 | + add_dependencies (push-tag push-master) |
228 | + |
229 | + # Push the tarball to releases.compiz.org |
230 | + set (COMPIZ_RELEASE_UPLOAD_HOST releases.compiz.org) |
231 | + set (COMPIZ_RELEASE_UPLOAD_BASE /home/releases) |
232 | + set (COMPIZ_RELEASE_UPLOAD_DIR_VERSION ${COMPIZ_RELEASE_UPLOAD_BASE}/${VERSION}/) |
233 | + set (COMPIZ_RELEASE_UPLOAD_DIR_COMPONENT ${COMPIZ_RELEASE_UPLOAD_BASE}/components/${CMAKE_PROJECT_NAME}) |
234 | + |
235 | + message ("releasing to " ${COMPIZ_RELEASE_UPLOAD_HOST}) |
236 | + message (" base: " ${COMPIZ_RELEASE_UPLOAD_BASE}) |
237 | + message (" version: " ${COMPIZ_RELEASE_UPLOAD_BASE}/${VERSION}) |
238 | + message (" component: ${COMPIZ_RELEASE_UPLOAD_BASE}/components/${CMAKE_PROJECT_NAME}") |
239 | + |
240 | + add_custom_target (release-upload-version |
241 | + COMMAND ssh $ENV{USER}@${COMPIZ_RELEASE_UPLOAD_HOST} "mkdir -p ${COMPIZ_RELEASE_UPLOAD_BASE}/${VERSION}" && scp ${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2 $ENV{USER}@${COMPIZ_RELEASE_UPLOAD_HOST}:${COMPIZ_RELEASE_UPLOAD_DIR_VERSION} |
242 | + COMMENT "Uploading ${CMAKE_PROJECT_NAME}-${VERSION} to ${VERSION}" |
243 | + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) |
244 | + |
245 | + # Does nothing for now |
246 | + add_custom_target (release-upload-component) |
247 | + #add_custom_target (release-upload-component |
248 | + # COMMAND ssh $ENV{USER}@${COMPIZ_RELEASE_UPLOAD_HOST} "mkdir -p ${COMPIZ_RELEASE_UPLOAD_BASE}/${VERSION}" && scp ${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2 ${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2.asc ${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2.sha1 ${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2.sha1.asc $ENV{USER}@${COMPIZ_RELEASE_UPLOAD_HOST}:${COMPIZ_RELEASE_UPLOAD_BASE_DIR_COMPONENT} |
249 | + # COMMENT "Uploading ${CMAKE_PROJECT_NAME}-${VERSION} to ${CMAKE_PROJECT_NAME}/${VERSION}" |
250 | + # WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) |
251 | + |
252 | + add_custom_target (release-upload) |
253 | + |
254 | + add_dependencies (release-upload-component release-upload-version) |
255 | + add_dependencies (release-upload release-upload-component) |
256 | + |
257 | +endmacro () |
258 | + |
259 | +macro (compiz_add_release) |
260 | + |
261 | + if (${IS_GIT_REPO}) |
262 | + find_program (GEN_GIT_LOG gen-git-log.sh) |
263 | + add_custom_target (authors |
264 | + COMMAND git shortlog -se | cut -c8- > AUTHORS |
265 | + COMMENT "Generating AUTHORS" |
266 | + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) |
267 | + if (NOT (${GEN_GIT_LOG} STREQUAL "GEN_GIT_LOG-NOTFOUND")) |
268 | + add_custom_target (changelog |
269 | + COMMAND ${GEN_GIT_LOG} > ChangeLog |
270 | + COMMENT "Generating ChangeLog" |
271 | + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) |
272 | + else (NOT (${GEN_GIT_LOG} STREQUAL "GEN_GIT_LOG-NOTFOUND")) |
273 | + message ("[WARNING]: gen-git-log.sh is required to make releases, ensure that it is installed into your PATH") |
274 | + endif (NOT (${GEN_GIT_LOG} STREQUAL "GEN_GIT_LOG-NOTFOUND")) |
275 | + |
276 | + add_custom_target (news-header echo 'Release ${VERSION} ('`date +%Y-%m-%d`' '`git config user.name`' <'`git config user.email`'>)' > ${CMAKE_BINARY_DIR}/NEWS.update && seq -s "=" `cat ${CMAKE_BINARY_DIR}/NEWS.update | wc -c` | sed 's/[0-9]//g' >> ${CMAKE_BINARY_DIR}/NEWS.update && $ENV{EDITOR} ${CMAKE_BINARY_DIR}/NEWS.update && echo >> ${CMAKE_BINARY_DIR}/NEWS.update |
277 | + COMMAND $ENV{EDITOR} ${CMAKE_BINARY_DIR}/NEWS.update |
278 | + COMMENT "Generating NEWS Header" |
279 | + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) |
280 | + else (${IS_GIT_REPO}) |
281 | + if (${IS_BZR_REPO}) |
282 | + add_custom_target (authors |
283 | + COMMAND bzr log --long --levels=0 | grep -e "^\\s*author:" -e "^\\s*committer:" | cut -d ":" -f 2 | sort -u > AUTHORS |
284 | + COMMENT "Generating AUTHORS") |
285 | + add_custom_target (changelog |
286 | + COMMAND bzr log --gnu-changelog > ChangeLog |
287 | + COMMENT "Generating ChangeLog") |
288 | + |
289 | + add_custom_target (news-header echo > ${CMAKE_BINARY_DIR}/NEWS.update |
290 | + COMMAND echo 'Release ${VERSION} ('`date +%Y-%m-%d`' '`bzr config email`')' > ${CMAKE_BINARY_DIR}/NEWS.update && seq -s "=" `cat ${CMAKE_BINARY_DIR}/NEWS.update | wc -c` | sed 's/[0-9]//g' >> ${CMAKE_BINARY_DIR}/NEWS.update && $ENV{EDITOR} ${CMAKE_BINARY_DIR}/NEWS.update && echo >> ${CMAKE_BINARY_DIR}/NEWS.update |
291 | + COMMENT "Generating NEWS Header" |
292 | + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
293 | + else (${IS_BZR_REPO}) |
294 | + add_custom_target (authors) |
295 | + add_custom_target (changelog) |
296 | + add_custom_target (news-header) |
297 | + endif (${IS_BZR_REPO}) |
298 | + endif (${IS_GIT_REPO}) |
299 | + |
300 | + add_custom_target (news |
301 | + COMMAND cat ${CMAKE_SOURCE_DIR}/NEWS > NEWS.old && |
302 | + cat NEWS.old >> ${CMAKE_BINARY_DIR}/NEWS.update && |
303 | + cat NEWS.update > NEWS |
304 | + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) |
305 | + |
306 | + add_dependencies (changelog authors) |
307 | + add_dependencies (news-header changelog) |
308 | + add_dependencies (news news-header) |
309 | + |
310 | + add_custom_target (release-prep) |
311 | + add_dependencies (release-prep news) |
312 | + |
313 | +endmacro (compiz_add_release) |
314 | |
315 | # unsets the given variable |
316 | macro (compiz_unset var) |
317 | @@ -120,6 +369,7 @@ |
318 | endfunction () |
319 | |
320 | function (compiz_add_plugins_in_folder folder) |
321 | + set (COMPIZ_PLUGIN_PACK_BUILD 1) |
322 | file ( |
323 | GLOB _plugins_in |
324 | RELATIVE "${folder}" |
325 | @@ -256,21 +506,23 @@ |
326 | endmacro () |
327 | |
328 | #posix 2008 scandir check |
329 | -include (CheckCXXSourceCompiles) |
330 | -CHECK_CXX_SOURCE_COMPILES ( |
331 | - "# include <dirent.h> |
332 | - int func (const char *d, dirent ***list, void *sort) |
333 | - { |
334 | - int n = scandir(d, list, 0, (int(*)(const dirent **, const dirent **))sort); |
335 | - return n; |
336 | - } |
337 | +if (CMAKE_CXX_COMPILER) |
338 | + include (CheckCXXSourceCompiles) |
339 | + CHECK_CXX_SOURCE_COMPILES ( |
340 | + "# include <dirent.h> |
341 | + int func (const char *d, dirent ***list, void *sort) |
342 | + { |
343 | + int n = scandir(d, list, 0, (int(*)(const dirent **, const dirent **))sort); |
344 | + return n; |
345 | + } |
346 | |
347 | - int main (int, char **) |
348 | - { |
349 | - return 0; |
350 | - } |
351 | - " |
352 | - HAVE_SCANDIR_POSIX) |
353 | + int main (int, char **) |
354 | + { |
355 | + return 0; |
356 | + } |
357 | + " |
358 | + HAVE_SCANDIR_POSIX) |
359 | +endif (CMAKE_CXX_COMPILER) |
360 | |
361 | if (HAVE_SCANDIR_POSIX) |
362 | add_definitions (-DHAVE_SCANDIR_POSIX) |
363 | |
364 | === modified file 'cmake/CompizPlugin.cmake' |
365 | --- cmake/CompizPlugin.cmake 2011-05-17 23:51:02 +0000 |
366 | +++ cmake/CompizPlugin.cmake 2011-07-07 16:29:45 +0000 |
367 | @@ -423,6 +423,12 @@ |
368 | |
369 | compiz_add_uninstall () |
370 | |
371 | + if (NOT COMPIZ_PLUGIN_PACK_BUILD) |
372 | + compiz_add_git_dist () |
373 | + compiz_add_release () |
374 | + compiz_add_release_signoff () |
375 | + endif (NOT COMPIZ_PLUGIN_PACK_BUILD) |
376 | + |
377 | else () |
378 | message (STATUS "[WARNING] One or more dependencies for compiz plugin ${plugin} not found. Skipping plugin.") |
379 | message (STATUS "Missing dependencies :${COMPIZ_${_PLUGIN}_MISSING_DEPS}") |
380 | |
381 | === modified file 'include/compiz-common.h.in' |
382 | --- include/compiz-common.h.in 2009-03-15 23:01:06 +0000 |
383 | +++ include/compiz-common.h.in 2011-07-07 16:29:45 +0000 |
384 | @@ -1,9 +1,5 @@ |
385 | #ifndef COMPIZ_COMMON_H |
386 | #define COMPIZ_COMMON_H |
387 | |
388 | -#define COMPIZ_VERSION_MAJOR @COMPIZ_VERSION_MAJOR@ |
389 | -#define COMPIZ_VERSION_MINOR @COMPIZ_VERSION_MINOR@ |
390 | -#define COMPIZ_VERSION_MICRO @COMPIZ_VERSION_MICRO@ |
391 | - |
392 | -#define COMPIZ_VERSION_STRING "@COMPIZ_VERSION_MAJOR@.@COMPIZ_VERSION_MINOR@.@COMPIZ_VERSION_MICRO@" |
393 | +#define COMPIZ_VERSION_STRING "@VERSION@" |
394 | #endif |
(disclaimer: I only read the diff, didn't try it for real)
Some questions and suggestions:
1. You could get rid of one line when reading the version number by directly using the VERSION variable instead of an intermediate COMPIZ_ RELEASE_ VERSION one.
2. is there a real reason to support both bz2 and gz? I would expect everybody to be able to decode bz2 now. Supporting only bz2 would simplify this diff quite a bit.
3. The check for whether you are in a git or a bzr repository could be moved outside the macros to avoid duplication. I would also simplify it to something like this (untested):
if (IS_DIRECTORY ${CMAKE_ SOURCE_ DIR}/.git) SOURCE_ DIR}/.git) SOURCE_ DIR}/.git)
set(IS_GIT_REPO TRUE)
elseif (IS_DIRECTORY ${CMAKE_
set(IS_GIT_REPO FALSE)
endif (IS_DIRECTORY ${CMAKE_
if (IS_DIRECTORY ${CMAKE_ SOURCE_ DIR}/.bzr) SOURCE_ DIR}/.bzr) SOURCE_ DIR}/.bzr)
set(IS_BZR_REPO TRUE)
elseif (IS_DIRECTORY ${CMAKE_
set(IS_BZR_REPO FALSE)
endif (IS_DIRECTORY ${CMAKE_
You can then replace your tests with easier-to-read checks on IS_GIT_REPO and IS_BZR_REPO