Browse code

community release

Nat! authored on 06/06/2017 16:13:52
Showing 6 changed files
... ...
@@ -1 +1 @@
1
-https://github.com/mulle-nat
1
+https://github.com/mulle-objc
... ...
@@ -16,8 +16,9 @@ before_install:
16 16
    - sudo chown "$USER" /home/linuxbrew
17 17
    - git clone https://github.com/Linuxbrew/brew.git /home/linuxbrew/.linuxbrew
18 18
    - PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"
19
-   - brew install mulle-kybernetik/alpha/mulle-build
19
+   - brew update
20
+   - brew install mulle-kybernetik/software/mulle-build
20 21
 
21 22
 script:
22
-   - mulle-build
23
+   - mulle-build --bootstrap
23 24
    - mulle-test -vvv -V
... ...
@@ -1,7 +1,13 @@
1
+1.3.2
2
+===
3
+
4
+* community release
5
+
6
+
1 7
 1.3.1
2 8
 ===
3 9
 
4
-* if you init a pointerarray or hashmap with size == 0, initialization will be 
10
+* if you init a pointerarray or hashmap with size == 0, initialization will be
5 11
 done lazily, using a static empty storage first.
6 12
 
7 13
 1.1.5
... ...
@@ -1,71 +1,271 @@
1
-#! /bin/sh
1
+#! /usr/bin/env bash
2 2
 #
3
-# (c) 2016 Nat! for Mulle kybernetiK
3
+#   Copyright (c) 2017 Nat! - Mulle kybernetiK
4
+#   All rights reserved.
4 5
 #
5
-# BSD3-License
6
+#   Redistribution and use in source and binary forms, with or without
7
+#   modification, are permitted provided that the following conditions are met:
8
+#
9
+#   Redistributions of source code must retain the above copyright notice, this
10
+#   list of conditions and the following disclaimer.
11
+#
12
+#   Redistributions in binary form must reproduce the above copyright notice,
13
+#   this list of conditions and the following disclaimer in the documentation
14
+#   and/or other materials provided with the distribution.
15
+#
16
+#   Neither the name of Mulle kybernetiK nor the names of its contributors
17
+#   may be used to endorse or promote products derived from this software
18
+#   without specific prior written permission.
19
+#
20
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+#   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+#   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
+#   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24
+#   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25
+#   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
+#   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
+#   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28
+#   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29
+#   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
+#   POSSIBILITY OF SUCH DAMAGE.
31
+#
32
+
33
+
34
+# Define your project and the dependencies for homebrew
35
+# DEPENDENCIES and BUILD_DEPENDENCIES will be evaled later!
36
+# Then run this as
37
+#   ./bin/release.sh --publisher mulle-nat --publisher-tap mulle-kybernetik/alpha/
6 38
 #
7 39
 
8 40
 PROJECT="MulleConcurrent"    # requires camel-case
9 41
 DESC="Lock- and Wait-free Hashtable (and an Array too) in C"
10
-DEPENDENCIES='${DEPENDENCY_TAP}/mulle-allocator
11
-${DEPENDENCY_TAP}/mulle-aba
12
-${DEPENDENCY_TAP}/mulle-thread'  # no camel case, will be evaled later!
13 42
 LANGUAGE=c               # c,cpp, objc
14 43
 
44
+
45
+#
46
+# Keep these commented out, if the automatic detection works well
47
+# enough for you
48
+#
49
+# VERSIONFILE=
50
+# VERSIONNAME=
51
+
52
+#
53
+# Specify needed homebrew packages by name as you would when saying
54
+# `brew install`.
55
+#
56
+# Use the ${DEPENDENCY_TAP} prefix for non-official dependencies.
57
+#
58
+# DEPENDENCIES='${DEPENDENCY_TAP}mulle-concurrent
59
+# libpng
60
+# '
61
+
62
+DEPENDENCIES='${DEPENDENCY_TAP}mulle-allocator
63
+${DEPENDENCY_TAP}mulle-aba
64
+${DEPENDENCY_TAP}mulle-thread'  # no camel case, will be evaled later!
65
+
66
+BUILD_DEPENDENCIES='${BOOTSTRAP_TAP}mulle-bootstrap
67
+${BOOTSTRAP_TAP}mulle-build
68
+cmake'
69
+
70
+
71
+#######
72
+# If you are using mulle-build, you don't hafta change anything after this
73
+#######
74
+
75
+#
76
+# Generate your `def install` `test do` lines here to stdout.
77
+#
78
+generate_brew_formula_build()
79
+{
80
+   local project="$1"
81
+   local name="$2"
82
+   local version="$3"
83
+
84
+   generate_brew_formula_mulle_build "${project}" "${name}" "${version}"
85
+   generate_brew_formula_mulle_test  "${project}" "${name}" "${version}"
86
+}
87
+
88
+
15 89
 #
16
-# Ideally you don't hafta change anything below this line
90
+# If you are unhappy with the formula in general, then change
91
+# this function. Print your formula to stdout.
17 92
 #
18
-# source mulle-homebrew.sh (clumsily)
19
-MULLE_BOOTSTRAP_FAIL_PREFIX="release.sh"
93
+generate_brew_formula()
94
+{
95
+#   local project="$1"
96
+#   local name="$2"
97
+#   local version="$3"
98
+#   local dependencies="$4"
99
+#   local builddependencies="$5"
100
+#   local homepage="$6"
101
+#   local desc="$7"
102
+#   local archiveurl="$8"
103
+
104
+   _generate_brew_formula "$@"
105
+}
106
+
107
+#######
108
+# Ideally changes to the following values are done with the command line
109
+# which makes it easier for forks.
110
+#######
20 111
 
21
-. ./bin/repository-info.sh || exit 1
22
-. ./bin/mulle-homebrew/mulle-homebrew.sh || exit 1
112
+MULLE_BOOTSTRAP_FAIL_PREFIX="`basename -- $0`"
113
+MULLE_HOMEBREW_VERSION="3.4.5"
114
+
115
+EXEC_DIR="`dirname -- $0`"
116
+
117
+#
118
+# prefer local mulle-homebrew if available
119
+#
120
+if [ -x "${EXEC_DIR}/mulle-homebrew/mulle-homebrew-env" ]
121
+then
122
+   PATH="${EXEC_DIR}/mulle-homebrew:$PATH"
123
+fi
124
+
125
+if [ -z "`command -v mulle-homebrew-env`" ]
126
+then
127
+   echo "mulle-homebrew-env not found in PATH" >&2
128
+   exit 1
129
+fi
130
+
131
+
132
+INSTALLED_MULLE_HOMEBREW_VERSION="`mulle-homebrew-env version`" || exit 1
133
+LIBEXEC_DIR="`mulle-homebrew-env libexec-path`" || exit 1
134
+
135
+. "${LIBEXEC_DIR}/mulle-homebrew.sh" || exit 1
136
+. "${LIBEXEC_DIR}/mulle-git.sh"      || exit 1
137
+
138
+if ! homebrew_is_compatible_version "${INSTALLED_MULLE_HOMEBREW_VERSION}" "${MULLE_HOMEBREW_VERSION}"
139
+then
140
+   fail "Installed mulle-homebrew version ${INSTALLED_MULLE_HOMEBREW_VERSION} is \
141
+not compatible with this script from version ${MULLE_HOMEBREW_VERSION}"
142
+fi
23 143
 
24 144
 # parse options
25 145
 homebrew_parse_options "$@"
26 146
 
27
-# dial past options
147
+#
148
+# dial past options now as they have been parsed
149
+#
28 150
 while [ $# -ne 0 ]
29 151
 do
30 152
    case "$1" in
31 153
       -*)
32 154
          shift
33 155
       ;;
156
+
157
+      --*)
158
+         shift
159
+         shift
160
+      ;;
161
+
34 162
       *)
35 163
          break;
36 164
       ;;
37 165
    esac
38 166
 done
39 167
 
168
+# --- FORMULA GENERATION ---
169
+
170
+BOOTSTRAP_TAP="${BOOTSTRAP_TAP:-mulle-kybernetik/software/}"
171
+
172
+DEPENDENCY_TAP="${DEPENDENCY_TAP:-${PUBLISHER_TAP}}"
40 173
 
41 174
 #
42 175
 # these can usually be deduced, if you follow the conventions
43 176
 #
44
-NAME="`get_name_from_project "${PROJECT}" "${LANGUAGE}"`"
45
-HEADER="`get_header_from_name "${NAME}"`"
46
-VERSIONNAME="`get_versionname_from_project "${PROJECT}"`"
47
-VERSION="`get_header_version "${HEADER}" "${VERSIONNAME}"`"
177
+if [ -z "${NAME}" ]
178
+then
179
+   NAME="`get_name_from_project "${PROJECT}" "${LANGUAGE}"`"
180
+fi
48 181
 
49
-HOMEPAGE="`eval echo "${HOMEPAGE}"`"
182
+if [ -z "${VERSIONFILE}" ]
183
+then
184
+   VERSIONFILE="`get_header_from_name "${NAME}"`"
185
+fi
186
+
187
+if [ -z "${VERSIONNAME}" ]
188
+then
189
+   VERSIONNAME="`get_versionname_from_project "${PROJECT}"`"
190
+fi
191
+
192
+if [ -f VERSION ]
193
+then
194
+   VERSION="`head -1 VERSION`"
195
+else
196
+   VERSION="`get_project_version "${VERSIONFILE}" "${VERSIONNAME}"`"
197
+   if [ -z "${VERSION}" ]
198
+   then
199
+      VERSION="`get_project_version "src/version.h" "${VERSIONNAME}"`"
200
+   fi
201
+fi
202
+
203
+# where homebrew grabs the archive off
204
+ARCHIVE_URL="${ARCHIVE_URL:-https://github.com/${PUBLISHER}/${NAME}/archive/${VERSION}.tar.gz}"
205
+
206
+# written into formula for homebrew, will be evaled
207
+HOMEPAGE_URL="${HOMEPAGE_URL:-https://github.com/${PUBLISHER}/${NAME}}"
50 208
 
51 209
 
52 210
 # --- HOMEBREW TAP ---
53
-# Specify to where and under what bame to publish via your brew tap
211
+# Specify to where and under what name to publish via your brew tap
54 212
 #
55
-RBFILE="${NAME}.rb"                    # ruby file for brew
56
-HOMEBREWTAP="../homebrew-software"     # your tap repository path
213
+if [ -z "${PUBLISHER_TAP}" ]
214
+then
215
+   fail "you need to specify a publisher tap with --publisher-tap (hint: <mulle-kybernetik/software/>)"
216
+fi
57 217
 
218
+TAPS_LOCATION="${TAPS_LOCATION:-..}"
219
+
220
+HOMEBREW_TAP="${HOMEBREW_TAP:-${TAPS_LOCATION}/homebrew-`basename -- ${PUBLISHER_TAP}`}"
221
+
222
+RBFILE="${RBFILE:-${NAME}.rb}"
58 223
 
59 224
 # --- GIT ---
225
+
226
+#
227
+# require PUBLISHER (and PUBLISHER_TAP) as command line parameter, so
228
+# that forks don't have to edit this constantly
229
+#
230
+if [ -z "${PUBLISHER}" ]
231
+then
232
+   fail "You need to specify a publisher with --publisher (hint: https://github.com/<publisher>)"
233
+fi
234
+
235
+if [ -z "${VERSION}" ]
236
+then
237
+   fail "Could not figure out the version. (hint: check VERSIONNAME, VERSIONFILE)"
238
+fi
239
+
60 240
 # tag to tag your release
61
-# and the origin where
62
-TAG="${1:-${TAGPREFIX}${VERSION}}"
241
+TAG="${TAG:-${TAG_PREFIX}${VERSION}}"
242
+
243
+# git remote to push to, usually origin
244
+ORIGIN="${ORIGIN:-origin}"
245
+
246
+# git remote to push to, usually github, can be empty
247
+GITHUB="${GITHUB:-github}"
248
+
249
+# git branch to release to, source is always current
250
+BRANCH="${BRANCH:-release}"
63 251
 
64 252
 
65 253
 main()
66 254
 {
67
-   git_main "${ORIGIN}" "${TAG}" || exit 1
68
-   homebrew_main
255
+   # do the release
256
+   git_main "${BRANCH}" "${ORIGIN}" "${TAG}" "${GITHUB}" || exit 1
257
+
258
+   # generate the formula and push it
259
+   homebrew_main "${PROJECT}" \
260
+                 "${NAME}" \
261
+                 "${VERSION}" \
262
+                 "${DEPENDENCIES}" \
263
+                 "${BUILD_DEPENDENCIES}" \
264
+                 "${HOMEPAGE_URL}" \
265
+                 "${DESC}" \
266
+                 "${ARCHIVE_URL}" \
267
+                 "${HOMEBREW_TAP}" \
268
+                 "${RBFILE}"
69 269
 }
70 270
 
71 271
 main "$@"
... ...
@@ -37,7 +37,7 @@
37 37
 //
38 38
 // community version is always even
39 39
 //
40
-#define MULLE_CONCURRENT_VERSION  ((1 << 20) | (3 << 8) | 1)
40
+#define MULLE_CONCURRENT_VERSION  ((1 << 20) | (3 << 8) | 2)
41 41
 
42 42
 #include <mulle_thread/mulle_thread.h>
43 43
 #include <mulle_allocator/mulle_allocator.h>
... ...
@@ -1,4 +1,4 @@
1
-#!/usr/bin/env bash
1
+#! /usr/bin/env bash
2 2
 #
3 3
 #  run-test.sh
4 4
 #  MulleObjC