Browse code

modernize project

Nat! authored on 09/06/2017 12:57:23
Showing 12 changed files
1 1
deleted file mode 100644
... ...
@@ -1 +0,0 @@
1
-https://github.com/mulle-objc
... ...
@@ -1,10 +1,2 @@
1
-#
2
-# override the repositories like so:
3
-#    echo "https://www.mulle-kybernetik.com/repositories" > .bootstrap.local/MULLE_REPOSITORIES
4
-#
5
-# override the branches like so:
6
-#    echo "master" > .bootstrap.local/MULLE_THREAD_BRANCH
7
-
8
-${MULLE_REPOSITORIES}/mulle-tests;tests/mulle-tests;${MULLE_TESTS_BRANCH:-release}
9
-${MULLE_REPOSITORIES}/mulle-homebrew;bin/mulle-homebrew;${MULLE_HOMEBREW_BRANCH:-release}
10
-${MULLE_REPOSITORIES}/mulle-configuration;;${MULLE_CONFIGURATION_BRANCH:-release}
1
+${MULLE_EMBEDDED_REPOSITORIES:-https://github.com/mulle-nat}/mulle-tests;tests/mulle-tests;${MULLE_TESTS_BRANCH:-release}
2
+${MULLE_EMBEDDED_REPOSITORIES:-https://github.com/mulle-nat}/mulle-configuration;;${MULLE_CONFIGURATION_BRANCH:-release}
... ...
@@ -6,4 +6,4 @@
6 6
 #    echo "master" > .bootstrap.local/MULLE_ABA_BRANCH
7 7
 
8 8
 # aba pulls threads and allocators
9
-${MULLE_REPOSITORIES}/mulle-aba;;${MULLE_ABA_BRANCH:-release}
9
+${MULLE_REPOSITORIES:-https://github.com/mulle-nat}/mulle-aba;;${MULLE_ABA_BRANCH:-release}
... ...
@@ -4,6 +4,7 @@
4 4
 .idea/
5 5
 *.dSYM/
6 6
 *.exe
7
+*.old
7 8
 
8 9
 .repos/
9 10
 .bootstrap.auto/
... ...
@@ -20,5 +20,5 @@ before_install:
20 20
    - brew install mulle-kybernetik/software/mulle-build
21 21
 
22 22
 script:
23
-   - mulle-build --bootstrap
24
-   - mulle-test -vvv -V
23
+   - mulle-build -vv -V --bootstrap
24
+   - mulle-test -vv -V
... ...
@@ -1,3 +1,8 @@
1
+### 1.3.3
2
+
3
+* modernize
4
+
5
+
1 6
 1.3.2
2 7
 ===
3 8
 
4 9
new file mode 100644
... ...
@@ -0,0 +1,5 @@
0
+PROJECT="MulleConcurrent"   # your project name, requires camel-case
1
+DESC="Lock- and Wait-free Hashtable (and an Array too) in C"
2
+DEPENDENCIES='${DEPENDENCY_TAP}mulle-allocator
3
+${DEPENDENCY_TAP}mulle-aba
4
+${DEPENDENCY_TAP}mulle-thread'
0 5
new file mode 100755
... ...
@@ -0,0 +1,8 @@
0
+# -- Version Info --
1
+#
2
+# Keep these commented out, if the automatic detection works well
3
+# enough for you. If you don't have this file, there will be 
4
+# not git operations. 
5
+#
6
+# VERSIONFILE=
7
+# VERSIONNAME=
... ...
@@ -1,6 +1,6 @@
1 1
 #! /usr/bin/env bash
2 2
 #
3
-#   Copyright (c) 2017 Nat! - Mulle kybernetiK
3
+#   Copyright (c) 2017 Nat! - Codeon GmbH
4 4
 #   All rights reserved.
5 5
 #
6 6
 #   Redistribution and use in source and binary forms, with or without
... ...
@@ -29,43 +29,29 @@
29 29
 #   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 30
 #   POSSIBILITY OF SUCH DAMAGE.
31 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/
38 32
 #
39
-
40
-PROJECT="MulleConcurrent"    # requires camel-case
41
-DESC="Lock- and Wait-free Hashtable (and an Array too) in C"
42
-LANGUAGE=c               # c,cpp, objc
43
-
44
-
33
+# For documentation and help see:
34
+#    https://github.com/mulle-nat/mulle-homebrew
45 35
 #
46
-# Keep these commented out, if the automatic detection works well
47
-# enough for you
36
+# Run this somewhat like this (for real: remove -n):
37
+#   ./bin/release.sh -v -n --publisher mulle-nat --publisher-tap mulle-kybernetik/software/
48 38
 #
49
-# VERSIONFILE=
50
-# VERSIONNAME=
51 39
 
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
-# '
40
+EXE_DIR="`dirname -- $0`"
61 41
 
62
-DEPENDENCIES='${DEPENDENCY_TAP}mulle-allocator
63
-${DEPENDENCY_TAP}mulle-aba
64
-${DEPENDENCY_TAP}mulle-thread'  # no camel case, will be evaled later!
42
+# if there is a release-info.sh file read it
43
+if [ -f "${EXE_DIR}/release-info.sh" ]
44
+then
45
+   DO_GIT_RELEASE="YES"
46
+   . "${EXE_DIR}/release-info.sh"
47
+fi
65 48
 
66
-BUILD_DEPENDENCIES='${BOOTSTRAP_TAP}mulle-bootstrap
67
-${BOOTSTRAP_TAP}mulle-build
68
-cmake'
49
+# if there is a formula-info.sh file read it
50
+if [ -f "${EXE_DIR}/formula-info.sh" ]
51
+then
52
+   DO_GENERATE_FORMULA="YES"
53
+   . "${EXE_DIR}/formula-info.sh"
54
+fi
69 55
 
70 56
 
71 57
 #######
... ...
@@ -73,7 +59,7 @@ cmake'
73 73
 #######
74 74
 
75 75
 #
76
-# Generate your `def install` `test do` lines here to stdout.
76
+# Generate your `def install` `test do` lines here. echo them to stdout.
77 77
 #
78 78
 generate_brew_formula_build()
79 79
 {
... ...
@@ -110,162 +96,58 @@ generate_brew_formula()
110 110
 #######
111 111
 
112 112
 MULLE_BOOTSTRAP_FAIL_PREFIX="`basename -- $0`"
113
-MULLE_HOMEBREW_VERSION="3.4.5"
114
-
115
-EXEC_DIR="`dirname -- $0`"
113
+MULLE_HOMEBREW_VERSION="4.0.0"
116 114
 
117 115
 #
118 116
 # prefer local mulle-homebrew if available
117
+# Do not embed it anymore!
119 118
 #
120
-if [ -x "${EXEC_DIR}/mulle-homebrew/mulle-homebrew-env" ]
121
-then
122
-   PATH="${EXEC_DIR}/mulle-homebrew:$PATH"
123
-fi
124
-
125 119
 if [ -z "`command -v mulle-homebrew-env`" ]
126 120
 then
127
-   echo "mulle-homebrew-env not found in PATH" >&2
121
+   cat <<EOF >&2
122
+mulle-homebrew-env not found in PATH.
123
+Visit the homepage for installation instructions:
124
+   https://github.com/mulle-nat/mulle-homebrew
125
+EOF
128 126
    exit 1
129 127
 fi
130 128
 
131
-
132 129
 INSTALLED_MULLE_HOMEBREW_VERSION="`mulle-homebrew-env version`" || exit 1
133 130
 LIBEXEC_DIR="`mulle-homebrew-env libexec-path`" || exit 1
134 131
 
135
-. "${LIBEXEC_DIR}/mulle-homebrew.sh" || exit 1
136
-. "${LIBEXEC_DIR}/mulle-git.sh"      || exit 1
132
+. "${LIBEXEC_DIR}/mulle-homebrew.sh"    || exit 1
133
+. "${LIBEXEC_DIR}/mulle-git.sh"         || exit 1
134
+. "${LIBEXEC_DIR}/mulle-version.sh"     || exit 1
135
+. "${LIBEXEC_DIR}/mulle-environment.sh" || exit 1
137 136
 
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
143 137
 
144
-# parse options
145
-homebrew_parse_options "$@"
146
-
147
-#
148
-# dial past options now as they have been parsed
149
-#
150
-while [ $# -ne 0 ]
151
-do
152
-   case "$1" in
153
-      -*)
154
-         shift
155
-      ;;
156
-
157
-      --*)
158
-         shift
159
-         shift
160
-      ;;
161
-
162
-      *)
163
-         break;
164
-      ;;
165
-   esac
166
-done
167
-
168
-# --- FORMULA GENERATION ---
169
-
170
-BOOTSTRAP_TAP="${BOOTSTRAP_TAP:-mulle-kybernetik/software/}"
171
-
172
-DEPENDENCY_TAP="${DEPENDENCY_TAP:-${PUBLISHER_TAP}}"
173
-
174
-#
175
-# these can usually be deduced, if you follow the conventions
176
-#
177
-if [ -z "${NAME}" ]
178
-then
179
-   NAME="`get_name_from_project "${PROJECT}" "${LANGUAGE}"`"
180
-fi
181
-
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}" ]
138
+main()
139
+{
140
+   if [ "${DO_GIT_RELEASE}" != "YES" -a "${DO_GENERATE_FORMULA}" != "YES" ]
198 141
    then
199
-      VERSION="`get_project_version "src/version.h" "${VERSIONNAME}"`"
142
+      fail "Nothing to do. release-info.sh and formula-info.sh are missing"
200 143
    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}}"
208
-
209
-
210
-# --- HOMEBREW TAP ---
211
-# Specify to where and under what name to publish via your brew tap
212
-#
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
217
-
218
-TAPS_LOCATION="${TAPS_LOCATION:-..}"
219
-
220
-HOMEBREW_TAP="${HOMEBREW_TAP:-${TAPS_LOCATION}/homebrew-`basename -- ${PUBLISHER_TAP}`}"
221
-
222
-RBFILE="${RBFILE:-${NAME}.rb}"
223
-
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
-
240
-# tag to tag your release
241
-TAG="${TAG:-${TAG_PREFIX}${VERSION}}"
242
-
243
-# git remote to push to, usually origin
244
-ORIGIN="${ORIGIN:-origin}"
245 144
 
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}"
251
-
252
-
253
-main()
254
-{
255
-   # do the release
256
-   git_main "${BRANCH}" "${ORIGIN}" "${TAG}" "${GITHUB}" || exit 1
145
+   if [ "${DO_GIT_RELEASE}" = "YES" ]
146
+   then
147
+     # do the release
148
+      git_main "${BRANCH}" "${ORIGIN}" "${TAG}" "${GITHUB}" || exit 1
149
+   fi
257 150
 
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}"
151
+   if [ "${DO_GENERATE_FORMULA}" = "YES" ]
152
+   then
153
+      # generate the formula and push it
154
+      homebrew_main "${PROJECT}" \
155
+                    "${NAME}" \
156
+                    "${VERSION}" \
157
+                    "${DEPENDENCIES}" \
158
+                    "${BUILD_DEPENDENCIES}" \
159
+                    "${HOMEPAGE_URL}" \
160
+                    "${DESC}" \
161
+                    "${ARCHIVE_URL}" \
162
+                    "${HOMEBREW_TAP}" \
163
+                    "${RBFILE}"
164
+   fi
269 165
 }
270 166
 
271 167
 main "$@"
... ...
@@ -388,7 +388,7 @@ int  _mulle_concurrent_hashmap_init( struct mulle_concurrent_hashmap *map,
388 388
 
389 389
    _mulle_atomic_pointer_nonatomic_write( &map->storage.pointer, storage);
390 390
    _mulle_atomic_pointer_nonatomic_write( &map->next_storage.pointer, storage);
391
-   
391
+
392 392
    return( 0);
393 393
 }
394 394
 
... ...
@@ -37,7 +37,7 @@
37 37
 //
38 38
 // community version is always even
39 39
 //
40
-#define MULLE_CONCURRENT_VERSION  ((1 << 20) | (3 << 8) | 2)
40
+#define MULLE_CONCURRENT_VERSION  ((1 << 20) | (3 << 8) | 3)
41 41
 
42 42
 #include <mulle_thread/mulle_thread.h>
43 43
 #include <mulle_allocator/mulle_allocator.h>
... ...
@@ -114,7 +114,7 @@ static void   *_mulle_concurrent_pointerarraystorage_get( struct _mulle_concurre
114 114
 //                                                    unsigned int i)
115 115
 //{
116 116
 //   void   *value;
117
-//   
117
+//
118 118
 //   do
119 119
 //   {
120 120
 //      assert( i < (unsigned int) (uintptr_t) _mulle_atomic_pointer_read( &p->n));
... ...
@@ -123,7 +123,7 @@ static void   *_mulle_concurrent_pointerarraystorage_get( struct _mulle_concurre
123 123
 //         break;
124 124
 //   }
125 125
 //   while( ! _mulle_atomic_pointer_compare_and_swap( &p->entries[ i], MULLE_CONCURRENT_NO_POINTER, value));
126
-//   
126
+//
127 127
 //   return( value);
128 128
 //}
129 129