tebako 0.5.11 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c16daf8fea66ad1fffa3591812f55d57c4e44b5d784ec8b2abf9e509caa7030f
4
- data.tar.gz: e4289164c094ab415d2d067698a0d460d35f8e940c9ce25856aa2645b73f0e6b
3
+ metadata.gz: b3b1bac324a40524fe22b2c7026dcad437f62802fcaf57f37b4ae64eda383eb3
4
+ data.tar.gz: 1eec9bed248d7fc6d3f4c6d8c11e1ca7d7f9f1a10077b87cde00f61c2978cd33
5
5
  SHA512:
6
- metadata.gz: 040fb4c5517056c8f8eb12ef3e1db77d195b826d58646ef1073b128d0d904693b6e5e8d06e15371ec0a33679216e2a5cd6fdf19a90095d02418bb487838a6c70
7
- data.tar.gz: f56f7a1d47daf87661a3d75a2ea90d682116422feeb38e389c2e32a7a34636ea3b4fee83a816a5d64329c6e02aaad8407fcc94c369d7332d1cd4eae1b2123cfd
6
+ metadata.gz: da56a60c53abc22be03dbd4be569f547c0bb5f698883e3f3960c2ba8a43a2ef06c66df739c9dfd7bda55c129fb8f6e166c02372baad4cee1ce1af142709c0ad0
7
+ data.tar.gz: 902a593412bb255369c7dd69b98c178066cfe5209d7a3836bfe3d2b45382bcd9c29ba4119e0f8128b3b960d545af0f9881de9786e374e4a231e46d0c42971543
data/CMakeLists.txt CHANGED
@@ -38,33 +38,6 @@ determine_version("${CMAKE_CURRENT_SOURCE_DIR}" TEBAKO)
38
38
 
39
39
  project(tebako_packager VERSION ${TEBAKO_VERSION})
40
40
 
41
- execute_process(
42
- COMMAND pwd
43
- RESULT_VARIABLE PWD_RES
44
- OUTPUT_VARIABLE FS_CURRENT_RAW
45
- OUTPUT_STRIP_TRAILING_WHITESPACE
46
- )
47
-
48
- if(NOT (PWD_RES EQUAL 0))
49
- message(FATAL_ERROR "Could not determine current folder")
50
- endif()
51
-
52
- if (MINGW)
53
- execute_process(
54
- COMMAND "cygpath" "-w" ${FS_CURRENT_RAW}
55
- RESULT_VARIABLE CYGPATH_RES
56
- OUTPUT_VARIABLE FS_CURRENT
57
- OUTPUT_STRIP_TRAILING_WHITESPACE
58
- )
59
- if(NOT (CYGPATH_RES EQUAL 0))
60
- message(FATAL_ERROR "Could not map MSys path to Windows")
61
- endif()
62
- else(MINGW)
63
- set(FS_CURRENT ${FS_CURRENT_RAW})
64
- endif(MINGW)
65
-
66
- set(RUBY_DEBUG_BUILD OFF)
67
-
68
41
  include(ExternalProject)
69
42
  # This is the default that will be overwritten for MacOS and MSys
70
43
  set(GNU_BASH "bash")
@@ -78,13 +51,8 @@ if(NOT LOG_LEVEL)
78
51
  set(LOG_LEVEL "error")
79
52
  endif()
80
53
 
81
- set(START_WITH_PACKAGED_FILESYSTEM OFF CACHE BOOL "Start workflow from 'packaged filesystem' target!!!" FORCE)
82
-
83
54
  if (NOT ${SETUP_MODE})
84
55
  message("Running tebako press script")
85
- if (${START_WITH_PACKAGED_FILESYSTEM})
86
- message("*** Starting workflow from 'packaged filesystem' target ***")
87
- endif(${START_WITH_PACKAGED_FILESYSTEM})
88
56
 
89
57
  if ("-${ROOT}" STREQUAL "-")
90
58
  message(FATAL_ERROR "Project ROOT is not specified.")
@@ -94,12 +62,15 @@ if (NOT ${SETUP_MODE})
94
62
  message(FATAL_ERROR "Project ENTRANCE is not specified.")
95
63
  endif()
96
64
 
65
+ if ("-${PCKG}" STREQUAL "-")
66
+ message(FATAL_ERROR "Project OUTPUT PACKAGE is not specified.")
67
+ endif()
68
+
97
69
  cmake_path(SET FS_ENTRANCE NORMALIZE ${ENTRANCE})
98
70
 
99
71
  cmake_path(IS_RELATIVE ROOT IS_RT_RELATIVE)
100
72
  if(${IS_RT_RELATIVE})
101
- cmake_path(SET FS_ROOT NORMALIZE ${FS_CURRENT}/${ROOT})
102
- message("Relative path to root '${ROOT}' will be extended to '${FS_ROOT}'")
73
+ message(FATAL_ERROR "Path to root shall be absolute. Relative path '${FS_ROOT}' is not allowed.")
103
74
  else()
104
75
  cmake_path(SET FS_ROOT NORMALIZE ${ROOT})
105
76
  endif()
@@ -115,15 +86,11 @@ if (NOT ${SETUP_MODE})
115
86
  message("Absolute path to entry point '${FS_ENTR_TMP}' will be reduced '${FS_ENTRANCE}' relative to '${FS_ROOT}'")
116
87
  endif(${IS_EN_ABSOLUTE})
117
88
 
118
- if ("-${PCKG}" STREQUAL "-")
119
- set(APP_NAME "${FS_CURRENT}/tebako")
89
+ cmake_path(IS_RELATIVE PCKG IS_PK_RELATIVE)
90
+ if(${IS_PK_RELATIVE})
91
+ message(FATAL_ERROR "Path to output package shall be absolute. Relative path '${PCKG}' is not allowed.")
120
92
  else()
121
- cmake_path(IS_RELATIVE PCKG IS_PK_RELATIVE)
122
- if(${IS_PK_RELATIVE})
123
- cmake_path(SET APP_NAME NORMALIZE ${FS_CURRENT}/${PCKG})
124
- else()
125
- cmake_path(SET APP_NAME NORMALIZE ${PCKG})
126
- endif()
93
+ cmake_path(SET APP_NAME NORMALIZE ${PCKG})
127
94
  endif()
128
95
 
129
96
  message("Packaging ${FS_ROOT} folder with ${FS_ENTRANCE} entry point to ${APP_NAME}")
@@ -157,19 +124,22 @@ set(EXE_SUFFIX "")
157
124
  set(CMD_SUFFIX "")
158
125
  set(BAT_SUFFIX "")
159
126
  set(RUBY_MAKEFILE "")
127
+ set(DWARFS_PRELOAD OFF)
160
128
 
161
129
  if("${OSTYPE_TXT}" MATCHES "^linux-musl.*")
162
130
  set(IS_MUSL ON)
163
131
  set(FORCE_RUBY_PLATFORM "true")
164
132
  elseif("${OSTYPE_TXT}" MATCHES "^msys*")
165
133
  set(IS_MSYS ON)
134
+ set(FORCE_RUBY_PLATFORM "true")
135
+ # set(DWARFS_PRELOAD ON)
166
136
  set(RB_W32 ON)
167
137
  set(RUBY_WITHOUT_EXT "dbm,syslog,pty,gdbm,readline")
168
- set(RUBY_SUFFIX "w")
138
+ #set(RUBY_SUFFIX "w")
169
139
  set(EXE_SUFFIX ".exe")
170
140
  set(CMD_SUFFIX ".cmd")
171
141
  set(BAT_SUFFIX ".bat")
172
- set(RUBY_MAKEFILE "--file=GNUmakefile")
142
+ #set(RUBY_MAKEFILE "--file=GNUmakefile")
173
143
  elseif("${OSTYPE_TXT}" MATCHES "^darwin.*")
174
144
  set(IS_DARWIN ON)
175
145
  if(${RUBY_VER} VERSION_LESS "3.1.0")
@@ -234,24 +204,18 @@ set(RUBY_STASH_DIR ${DEPS}/stash_${RUBY_VER})
234
204
  string(SUBSTRING ${RUBY_VER} 0 3 RUBY_VER_BASE)
235
205
  string(CONCAT RUBY_API_VER ${RUBY_VER_BASE} ".0")
236
206
 
237
- # May be overwritten on MSys platform by setup-openssl.cmake
238
- set(WITH_OPENSSL_BUILD OFF)
207
+ if(DWARFS_PRELOAD)
208
+ def_ext_prj_t(LIBDWARFS_WR "0.5.1" "7bf8e5b4432f35b65f6034f614067c2018995c1bebaf935e8cdddc1a3e045c01")
239
209
 
240
- if(IS_MSYS)
241
- # ${RUBY_VER} VERSION_LESS "3.0.0"
242
- include(${CMAKE_SOURCE_DIR}/tools/cmake-scripts/setup-openssl.cmake)
243
- endif(IS_MSYS)
210
+ string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+).*" "\\1;\\2;\\3" LIBDWARFS_WR_VER_COMPONENTS ${LIBDWARFS_WR_VER})
244
211
 
245
- def_ext_prj_g(INCBIN "348e36b")
246
- def_ext_prj_g(DWARFS_WR "v0.4.3")
247
-
248
- find_library(_LIBNCURSES "libncurses.a")
249
- if(${_LIBNCURSES} STREQUAL "_LIBNCURSES-NOTFOUND")
250
- set(WITH_NCURSES_BUILD ON)
251
- def_ext_prj_t(NCURSES "6.3" "97fc51ac2b085d4cde31ef4d2c3122c21abc217e9090a43a30fc5ec21684e059")
252
- else()
253
- set(WITH_NCURSES_BUILD OFF)
254
- endif()
212
+ list(GET LIBDWARFS_WR_VER_COMPONENTS 0 LIBDWARFS_WR_VER_MAJOR)
213
+ list(GET LIBDWARFS_WR_VER_COMPONENTS 1 LIBDWARFS_WR_VER_MINOR)
214
+ list(GET LIBDWARFS_WR_VER_COMPONENTS 2 LIBDWARFS_WR_VER_PATCH)
215
+ set (LIBDWARFS_WR_VER_M ${LIBDWARFS_WR_VER_MAJOR}.${LIBDWARFS_WR_VER_MINOR}.${LIBDWARFS_WR_VER_PATCH})
216
+ else(DWARFS_PRELOAD)
217
+ def_ext_prj_g(DWARFS_WR "v0.5.1")
218
+ endif(DWARFS_PRELOAD)
255
219
 
256
220
  set(LIBYAML_RUBY_OPTION "")
257
221
  if(${RUBY_VER} VERSION_LESS "3.2.0")
@@ -260,18 +224,12 @@ endif(${RUBY_VER} VERSION_LESS "3.2.0")
260
224
 
261
225
  message("Configuration summary:")
262
226
  message(STATUS "ruby: v${RUBY_VER} at ${RUBY_SOURCE_DIR}")
263
- if(WITH_OPENSSL_BUILD)
264
- message(STATUS "openssl: building @${OPENSSL_TAG} at ${OPENSSL_SOURCE_DIR}")
265
- endif(WITH_OPENSSL_BUILD)
266
227
 
267
- if(WITH_NCURSES_BUILD)
268
- message(STATUS "ncurses: building v${NCURSES_VER} at ${NCURSES_SOURCE_DIR}")
269
- else()
270
- message(STATUS "ncurses: ${_LIBNCURSES}")
271
- endif(WITH_NCURSES_BUILD)
272
-
273
- message(STATUS "incbin: @${INCBIN_TAG} at ${INCBIN_SOURCE_DIR}")
274
- message(STATUS "dwarfs with tebako wrapper: @${DWARFS_WR_TAG} at ${DWARFS_WR_SOURCE_DIR}")
228
+ if(DWARFS_PRELOAD)
229
+ message(STATUS "dwarfs with tebako wrapper: deploying v${LIBDWARFS_WR_VER} to ${LIBDWARFS_WR_SOURCE_DIR}")
230
+ else(DWARFS_PRELOAD)
231
+ message(STATUS "dwarfs with tebako wrapper: @${DWARFS_WR_TAG} at ${DWARFS_WR_SOURCE_DIR}")
232
+ endif(DWARFS_PRELOAD)
275
233
 
276
234
  # ...................................................................
277
235
  # Filesystem locations
@@ -286,6 +244,8 @@ set(DATA_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}/packaged_filesystem)
286
244
  set(DATA_BIN_FILE ${DATA_BIN_DIR}/fs.bin)
287
245
  # Target binary directory
288
246
  set (TBD ${DATA_SRC_DIR}/bin)
247
+ # Target library directory
248
+ set (TLIBD ${DATA_SRC_DIR}/lib)
289
249
  # Target 'local' directory
290
250
  set (TLD ${DATA_SRC_DIR}/local)
291
251
  # TGD folder is used to install gems
@@ -302,9 +262,10 @@ message(STATUS "DATA_SRC_DIR: ${DATA_SRC_DIR}")
302
262
  message(STATUS "DATA_PRE_DIR: ${DATA_PRE_DIR}")
303
263
  message(STATUS "DATA_BIN_DIR: ${DATA_BIN_DIR}")
304
264
  message(STATUS "DATA_BIN_FILE: ${DATA_BIN_FILE}")
305
- message(STATUS "TBD: ${TBD}")
306
- message(STATUS "TLD: ${TLD}")
307
- message(STATUS "TGD: ${TGD}")
265
+ message(STATUS "Target binary directory: ${TBD}")
266
+ message(STATUS "Target library directory: ${TLIBD}")
267
+ message(STATUS "Target local directory: ${TLD}")
268
+ message(STATUS "Target Gem directory:: ${TGD}")
308
269
  message(STATUS "FS_MOUNT_POINT: ${FS_MOUNT_POINT}")
309
270
  message(STATUS "Building for Win32 Ruby (RB_W32): ${RB_W32}")
310
271
 
@@ -314,43 +275,6 @@ message(STATUS "Building for Win32 Ruby (RB_W32): ${RB_W32}")
314
275
  message(STATUS "Force Ruby platform for Gems: ${FORCE_RUBY_PLATFORM}")
315
276
  message(STATUS "Not building Ruby extensions: ${RUBY_WITHOUT_EXT}")
316
277
 
317
- # ...................................................................
318
- # incbin
319
-
320
- ExternalProject_Add(${INCBIN_PRJ}
321
- PREFIX ${DEPS}
322
- GIT_REPOSITORY https://github.com/graphitemaster/incbin.git
323
- GIT_TAG ${INCBIN_TAG}
324
- BUILD_IN_SOURCE true
325
- CONFIGURE_COMMAND ""
326
- BUILD_COMMAND ""
327
- INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INCLUDE_DIR}/incbin
328
- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${INCBIN_SOURCE_DIR}/incbin.h ${DEPS_INCLUDE_DIR}/incbin
329
- )
330
-
331
- # ...................................................................
332
- # OpenSSL
333
- if(WITH_OPENSSL_BUILD)
334
- message(STATUS "Building OpenSSL since Ruby 2.x requires 1.1.x")
335
- def_ext_prj_g(OPENSSL "OpenSSL_1_1_1s")
336
-
337
- set(__LIBSSL "${DEPS}/lib/libssl.a")
338
- set(__LIBCRYPTO "${DEPS}/lib/libcrypto.a")
339
-
340
- ExternalProject_Add(${OPENSSL_PRJ}
341
- PREFIX ${DEPS}
342
- GIT_REPOSITORY "https://github.com/openssl/openssl.git"
343
- GIT_TAG ${OPENSSL_TAG}
344
- UPDATE_COMMAND ""
345
- SOURCE_DIR ${OPENSSL_SOURCE_DIR}
346
- BINARY_DIR ${OPENSSL_BINARY_DIR}
347
- CONFIGURE_COMMAND ${GNU_BASH} -c "${OPENSSL_SOURCE_DIR}/config \
348
- --openssldir=${DEPS} \
349
- --prefix=${DEPS}"
350
- BUILD_BYPRODUCTS ${__LIBSSL} ${__LIBCRYPTO}
351
- )
352
- endif(WITH_OPENSSL_BUILD)
353
-
354
278
  # ...................................................................
355
279
  # DwarFS with tebako wrapper
356
280
 
@@ -370,47 +294,42 @@ set(__LIBXXHASH "${DEPS_LIB_DIR}/libxxhash.a")
370
294
  set(__LIBZSTD "${DEPS_LIB_DIR}/libzstd.a")
371
295
  set(__LIBARCHIVE "${DEPS_LIB_DIR}/libarchive.a")
372
296
 
373
- ExternalProject_Add(${DWARFS_WR_PRJ}
297
+ if(DWARFS_PRELOAD)
298
+ ExternalProject_Add(${LIBDWARFS_WR_PRJ}
374
299
  PREFIX ${DEPS}
375
- GIT_REPOSITORY https://github.com/tamatebako/libdwarfs.git
376
- GIT_TAG ${DWARFS_WR_TAG}
377
- SOURCE_DIR ${DWARFS_WR_SOURCE_DIR}
378
- BINARY_DIR ${DWARFS_WR_BINARY_DIR}
379
- UPDATE_COMMAND ""
380
- BUILD_COMMAND ${CMAKE_COMMAND} --build ${DWARFS_WR_BINARY_DIR} --parallel ${NCORES}
381
- CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${DEPS}
382
- -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
383
- -DWITH_TESTS:BOOL=OFF
384
- -DWITH_ASAN:BOOL=OFF
385
- -DWITH_COVERAGE:BOOL=OFF
386
- -DTEBAKO_BUILD_SCOPE=MKD
387
- -DRB_W32=${RB_W32}
388
- BUILD_BYPRODUCTS ${__LIBDWARFS_WR}
389
- ${__LIBDWARFS} ${__LIBFSST} ${__LIBFOLLY} ${__LIBT_METADATA}
390
- ${__LIBT_LIGHT} ${__LIBXXHASH} ${__LIBZSTD} ${__LIBARCHIVE}
391
- )
392
- if(WITH_OPENSSL_BUILD)
393
- add_dependencies(${DWARFS_WR_PRJ} ${OPENSSL_PRJ} )
394
- endif(WITH_OPENSSL_BUILD)
395
-
396
- if(WITH_NCURSES_BUILD)
397
- ExternalProject_Add(${NCURSES_PRJ}
398
- PREFIX ${DEPS}
399
- URL https://ftp.gnu.org/pub/gnu/ncurses/ncurses-${NCURSES_VER}.tar.gz
400
- URL_HASH SHA256=${NCURSES_HASH}
300
+ URL https://github.com/tamatebako/libdwarfs/releases/download/v${LIBDWARFS_WR_VER}/libdwarfs-wr-${LIBDWARFS_WR_VER_M}-mingw-ucrt64.7z
301
+ URL_HASH SHA256=${LIBDWARFS_WR_HASH}
401
302
  DOWNLOAD_NO_PROGRESS true
402
- SOURCE_DIR ${NCURSES_SOURCE_DIR}
303
+ SOURCE_DIR ${LIBDWARFS_WR_SOURCE_DIR}
403
304
  UPDATE_COMMAND ""
404
- CONFIGURE_COMMAND ${NCURSES_SOURCE_DIR}/configure
405
- --without-shared
406
- --without-cxx-shared
407
- --without-tests
408
- --prefix=${DEPS}
409
- --srcdir=${NCURSES_SOURCE_DIR}
410
- BUILD_COMMAND make
411
- INSTALL_COMMAND make install
305
+ CONFIGURE_COMMAND ""
306
+ BUILD_COMMAND ""
307
+ INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS}
308
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDWARFS_WR_SOURCE_DIR} ${DEPS}
309
+ TEST_COMMAND ""
310
+ )
311
+ else(DWARFS_PRELOAD)
312
+ ExternalProject_Add(${DWARFS_WR_PRJ}
313
+ PREFIX ${DEPS}
314
+ GIT_REPOSITORY https://github.com/tamatebako/libdwarfs.git
315
+ GIT_TAG ${DWARFS_WR_TAG}
316
+ SOURCE_DIR ${DWARFS_WR_SOURCE_DIR}
317
+ BINARY_DIR ${DWARFS_WR_BINARY_DIR}
318
+ UPDATE_COMMAND ""
319
+ BUILD_COMMAND ${CMAKE_COMMAND} --build ${DWARFS_WR_BINARY_DIR} --parallel ${NCORES}
320
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${DEPS}
321
+ -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
322
+ -DWITH_TESTS:BOOL=OFF
323
+ -DWITH_ASAN:BOOL=OFF
324
+ -DWITH_COVERAGE:BOOL=OFF
325
+ -DTEBAKO_BUILD_SCOPE=MKD
326
+ -DRB_W32=${RB_W32}
327
+ -GNinja
328
+ BUILD_BYPRODUCTS ${__LIBDWARFS_WR}
329
+ ${__LIBDWARFS} ${__LIBFSST} ${__LIBFOLLY} ${__LIBT_METADATA}
330
+ ${__LIBT_LIGHT} ${__LIBXXHASH} ${__LIBZSTD} ${__LIBARCHIVE}
412
331
  )
413
- endif(WITH_NCURSES_BUILD)
332
+ endif(DWARFS_PRELOAD)
414
333
 
415
334
  # ...................................................................
416
335
  # Ruby
@@ -441,6 +360,7 @@ else(IS_DARWIN)
441
360
 
442
361
  if(RB_W32)
443
362
  string(CONCAT RUBY_C_FLAGS ${RUBY_C_FLAGS} " -DRB_W32=1")
363
+ string(CONCAT RUBY_L_FLAGS ${RUBY_L_FLAGS} " -L${TLIBD}")
444
364
  endif(RB_W32)
445
365
  endif(IS_DARWIN)
446
366
 
@@ -470,27 +390,20 @@ ExternalProject_Add(${RUBY_PRJ}
470
390
  LDFLAGS=\"${RUBY_L_FLAGS}\""
471
391
  BUILD_COMMAND make ${RUBY_MAKEFILE} -j${NCORES}
472
392
  INSTALL_COMMAND make ${RUBY_MAKEFILE} install
473
- COMMAND ruby ${EXE}/tebako-packager pass2 ${OSTYPE_TXT} ${RUBY_SOURCE_DIR} ${DEPS_LIB_DIR} ${DATA_SRC_DIR} ${RUBY_STASH_DIR} ${RUBY_VER}
393
+ COMMAND ${GNU_BASH} -c "ruby ${EXE}/tebako-packager pass2 ${OSTYPE_TXT} ${RUBY_SOURCE_DIR} ${DEPS_LIB_DIR} ${DATA_SRC_DIR} ${RUBY_STASH_DIR} ${RUBY_VER}"
474
394
  )
475
395
 
476
- add_dependencies(${RUBY_PRJ} ${DWARFS_WR_PRJ})
477
- if(WITH_NCURSES_BUILD)
478
- add_dependencies(${RUBY_PRJ} ${NCURSES_PRJ})
479
- endif(WITH_NCURSES_BUILD)
480
-
481
- if(WITH_OPENSSL_BUILD)
482
- add_dependencies(${RUBY_PRJ} ${OPENSSL_PRJ} )
483
- endif(WITH_OPENSSL_BUILD)
396
+ add_dependencies(${RUBY_PRJ} ${DWARFS_WR_PRJ} ${LIBDWARFS_WR_PRJ})
484
397
 
485
398
  if (${SETUP_MODE})
486
399
  add_custom_target(setup
487
400
  ${CMAKE_COMMAND} -E echo "Tebako setup has completed"
488
- DEPENDS ${DWARFS_WR_PRJ} ${INCBIN_PRJ} ${RUBY_PRJ}
401
+ DEPENDS ${DWARFS_WR_PRJ} ${RUBY_PRJ}
489
402
  )
490
403
  else (${SETUP_MODE})
491
404
  add_custom_target(setup
492
405
  ${CMAKE_COMMAND} -E echo "Tebako setup has been verified"
493
- DEPENDS ${DWARFS_WR_PRJ} ${INCBIN_PRJ} ${RUBY_PRJ}
406
+ DEPENDS ${DWARFS_WR_PRJ} ${RUBY_PRJ}
494
407
  )
495
408
 
496
409
  file(GLOB GEMSPECS LIST_DIRECTORIES false ${FS_ROOT}/*.gemspec)
@@ -502,9 +415,12 @@ else (${SETUP_MODE})
502
415
  list(LENGTH GEMS GLENGTH)
503
416
 
504
417
  add_custom_target(clean_filesystem
505
- COMMAND ruby ${EXE}/tebako-packager deploy ${RUBY_STASH_DIR} ${DATA_SRC_DIR} ${DATA_PRE_DIR} ${DATA_BIN_DIR} ${GFLENGTH}
418
+ COMMAND ruby ${EXE}/tebako-packager deploy ${OSTYPE_TXT} ${RUBY_SOURCE_DIR} ${RUBY_STASH_DIR}
419
+ ${DATA_SRC_DIR} ${DATA_PRE_DIR} ${DATA_BIN_DIR}
420
+ ${GFLENGTH} ${APP_NAME} ${RUBY_VER}
506
421
  DEPENDS ${RUBY_PRJ}
507
422
  )
423
+
508
424
  if(GSLENGTH GREATER 0)
509
425
  if(GSLENGTH GREATER 1)
510
426
  message(FATAL_ERROR "Multiple gemspecs detected in ${FS_ROOT}")
@@ -519,11 +435,11 @@ else (${SETUP_MODE})
519
435
  COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${FS_ROOT} -DTARGET_DIR=${DATA_PRE_DIR} -P ${CMAKE_SOURCE_DIR}/cmake/copy_dir.cmake
520
436
  COMMAND ${CMAKE_COMMAND} -E make_directory ${TGD}
521
437
  COMMAND ${CMAKE_COMMAND} -E chdir ${DATA_PRE_DIR} ${CMAKE_COMMAND} -E env --unset=GEM_HOME --unset=GEM_PATH TEBAKO_PASS_THROUGH=1
522
- ${TBD}/bundle${CMD_SUFFIX} config set --local force_ruby_platform ${FORCE_RUBY_PLATFORM}
438
+ ${TBD}/bundle${BAT_SUFFIX} config set --local force_ruby_platform ${FORCE_RUBY_PLATFORM}
523
439
  COMMAND ${CMAKE_COMMAND} -E chdir ${DATA_PRE_DIR} ${CMAKE_COMMAND} -E env --unset=GEM_HOME --unset=GEM_PATH TEBAKO_PASS_THROUGH=1
524
- ${TBD}/bundle${CMD_SUFFIX} install
440
+ ${TBD}/bundle${BAT_SUFFIX} install
525
441
  COMMAND ${CMAKE_COMMAND} -E chdir ${DATA_PRE_DIR} ${CMAKE_COMMAND} -E env --unset=GEM_HOME --unset=GEM_PATH TEBAKO_PASS_THROUGH=1
526
- ${TBD}/bundle${CMD_SUFFIX} exec ${TBD}/gem${CMD_SUFFIX} build ${GEMSPEC}
442
+ ${TBD}/bundle${BAT_SUFFIX} exec ${TBD}/gem${CMD_SUFFIX} build ${GEMSPEC}
527
443
  COMMAND ${CMAKE_COMMAND} -E chdir ${DATA_PRE_DIR} ${CMAKE_COMMAND} -E env --unset=GEM_HOME --unset=GEM_PATH TEBAKO_PASS_THROUGH=1
528
444
  ${TBD}/gem${CMD_SUFFIX} install *.gem --verbose --no-document --install-dir ${TGD}
529
445
  COMMAND test -f ${DATA_SRC_DIR}${FS_ENTRY_POINT} ||
@@ -562,11 +478,11 @@ else (${SETUP_MODE})
562
478
  COMMAND ${CMAKE_COMMAND} -E make_directory ${TLD}
563
479
  COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${FS_ROOT} -DTARGET_DIR=${TLD} -P ${CMAKE_SOURCE_DIR}/cmake/copy_dir.cmake
564
480
  COMMAND ${CMAKE_COMMAND} -E chdir ${TLD} ${CMAKE_COMMAND} -E env --unset=GEM_HOME --unset=GEM_PATH TEBAKO_PASS_THROUGH=1
565
- ${TBD}/bundle${CMD_SUFFIX} config build.ffi --disable-system-libffi
481
+ ${TBD}/bundle${BAT_SUFFIX} config build.ffi --disable-system-libffi
566
482
  COMMAND ${CMAKE_COMMAND} -E chdir ${TLD} ${CMAKE_COMMAND} -E env --unset=GEM_HOME --unset=GEM_PATH TEBAKO_PASS_THROUGH=1
567
- ${TBD}/bundle${CMD_SUFFIX} config set --local force_ruby_platform ${FORCE_RUBY_PLATFORM}
483
+ ${TBD}/bundle${BAT_SUFFIX} config set --local force_ruby_platform ${FORCE_RUBY_PLATFORM}
568
484
  COMMAND ${CMAKE_COMMAND} -E chdir ${TLD} ${CMAKE_COMMAND} -E env --unset=GEM_HOME --unset=GEM_PATH TEBAKO_PASS_THROUGH=1
569
- ${TBD}/bundle${CMD_SUFFIX} install --jobs=${NCORES}
485
+ ${TBD}/bundle${BAT_SUFFIX} install --jobs=${NCORES}
570
486
  # COMMAND_EXPAND_LISTS
571
487
  # [TODO] Open question - how to deploy a project to source filesystem
572
488
  # ruby packer does bundle install --deployment --binstubs
@@ -626,38 +542,33 @@ else (${SETUP_MODE})
626
542
  @ONLY
627
543
  )
628
544
 
629
- if (${START_WITH_PACKAGED_FILESYSTEM})
630
- add_custom_target(packaged_filesystem
631
- COMMAND chmod +x ${DEPS_BIN_DIR}/*
632
- COMMAND ${DEPS_BIN_DIR}/mkdwarfs -o ${DATA_BIN_FILE} -i ${DATA_SRC_DIR}
633
- COMMAND ${CMAKE_COMMAND} -E touch ${DEPS_SRC_DIR}/tebako-fs.cpp
634
- BYPRODUCTS ${DATA_BIN_FILE}
635
- )
636
- else(${START_WITH_PACKAGED_FILESYSTEM})
637
- add_custom_target(packaged_filesystem
545
+ add_custom_target(packaged_filesystem
638
546
  # [TODO] Open question - whether we shall delete ruby binaries from memfs or not
639
547
  # For debugging purposes it is very handy to have it here
640
548
  #
641
- COMMAND ${CMAKE_COMMAND} -E rm -rf ${DATA_SRC_DIR}/share ${DATA_SRC_DIR}/include ${DATA_SRC_DIR}/lib/pkgconfig
642
- ${DATA_SRC_DIR}/bin/bundle${CMD_SUFFIX} ${DATA_SRC_DIR}/bin/bundle
643
- ${DATA_SRC_DIR}/bin/bundler${CMD_SUFFIX} ${DATA_SRC_DIR}/bin/bundler
644
- ${DATA_SRC_DIR}/bin/bundle${BAT_SUFFIX} ${DATA_SRC_DIR}/bin/bundler${BAT_SUFFIX}
645
- ${DATA_SRC_DIR}/bin/erb${CMD_SUFFIX} ${DATA_SRC_DIR}/bin/gem${CMD_SUFFIX}
646
- ${DATA_SRC_DIR}/bin/irb${CMD_SUFFIX} ${DATA_SRC_DIR}/bin/racc${CMD_SUFFIX}
647
- ${DATA_SRC_DIR}/bin/racc2y${CMD_SUFFIX} ${DATA_SRC_DIR}/bin/rake${BAT_SUFFIX}
648
- ${DATA_SRC_DIR}/bin/rake ${DATA_SRC_DIR}/bin/rdoc${CMD_SUFFIX}
649
- ${DATA_SRC_DIR}/bin/ri${CMD_SUFFIX} ${DATA_SRC_DIR}/bin/y2racc${CMD_SUFFIX}
650
- ${DATA_SRC_DIR}/bin/ruby${EXE_SUFFIX} ${DATA_SRC_DIR}/bin/ruby${RUBY_SUFFIX}${EXE_SUFFIX}
651
-
652
- COMMAND ${GNU_BASH} -c "rm -f ${DATA_SRC_DIR}/**/*.a"
653
- COMMAND ${GNU_BASH} -c "rm -f ${DATA_SRC_DIR}/**/*.o"
654
- COMMAND chmod +x ${DEPS_BIN_DIR}/*
655
- COMMAND ${DEPS_BIN_DIR}/mkdwarfs -o ${DATA_BIN_FILE} -i ${DATA_SRC_DIR}
656
- COMMAND ${CMAKE_COMMAND} -E touch ${DEPS_SRC_DIR}/tebako/tebako-fs.cpp
657
- DEPENDS setup source_filesystem
658
- BYPRODUCTS ${DATA_BIN_FILE}
659
- )
660
- endif (${START_WITH_PACKAGED_FILESYSTEM})
549
+ COMMAND ${CMAKE_COMMAND} -E rm -rf ${DATA_SRC_DIR}/share ${DATA_SRC_DIR}/include ${DATA_SRC_DIR}/lib/pkgconfig
550
+ ${DATA_SRC_DIR}/bin/bundle${CMD_SUFFIX} ${DATA_SRC_DIR}/bin/bundle
551
+ ${DATA_SRC_DIR}/bin/bundler${CMD_SUFFIX} ${DATA_SRC_DIR}/bin/bundler
552
+ ${DATA_SRC_DIR}/bin/bundle${BAT_SUFFIX} ${DATA_SRC_DIR}/bin/bundler${BAT_SUFFIX}
553
+ ${DATA_SRC_DIR}/bin/erb${CMD_SUFFIX} ${DATA_SRC_DIR}/bin/gem${CMD_SUFFIX}
554
+ ${DATA_SRC_DIR}/bin/irb${CMD_SUFFIX} ${DATA_SRC_DIR}/bin/racc${CMD_SUFFIX}
555
+ ${DATA_SRC_DIR}/bin/racc2y${CMD_SUFFIX} ${DATA_SRC_DIR}/bin/rake${BAT_SUFFIX}
556
+ ${DATA_SRC_DIR}/bin/rake ${DATA_SRC_DIR}/bin/rdoc${CMD_SUFFIX}
557
+ ${DATA_SRC_DIR}/bin/ri${CMD_SUFFIX} ${DATA_SRC_DIR}/bin/y2racc${CMD_SUFFIX}
558
+ ${DATA_SRC_DIR}/bin/ruby${EXE_SUFFIX} ${DATA_SRC_DIR}/bin/ruby${RUBY_SUFFIX}${EXE_SUFFIX}
559
+
560
+ COMMAND ${GNU_BASH} -c "rm -f ${DATA_SRC_DIR}/**/*.a"
561
+ COMMAND ${GNU_BASH} -c "rm -f ${DATA_SRC_DIR}/**/*.o"
562
+ COMMAND ${GNU_BASH} -c "chmod +x ${DEPS_BIN_DIR}/mkdwarfs${EXE_SUFFIX}"
563
+ # No progress below is crtitical since in reporting mode mkdwarfs tries to work directly with terminal
564
+ # and it creates critical issues for stderr redirects (&2 > 1) used by Ninja and our test srcipts
565
+ # It may be fixable bit is very difficult to reproduce in testi environment
566
+ COMMAND ${DEPS_BIN_DIR}/mkdwarfs -o ${DATA_BIN_FILE} -i ${DATA_SRC_DIR} --no-progress
567
+ COMMAND ${CMAKE_COMMAND} -E touch ${DEPS_SRC_DIR}/tebako/tebako-fs.cpp
568
+ DEPENDS setup source_filesystem
569
+ VERBATIM
570
+ BYPRODUCTS ${DATA_BIN_FILE}
571
+ )
661
572
 
662
573
  set(CMAKE_CXX_FLAGS "${RUBY_C_FLAGS}")
663
574
 
@@ -669,7 +580,7 @@ else (${SETUP_MODE})
669
580
  ${DEPS_INCLUDE_DIR}/tebako/tebako-version.h
670
581
  )
671
582
 
672
- add_dependencies(tebako-fs ${INCBIN_PRJ} packaged_filesystem)
583
+ add_dependencies(tebako-fs packaged_filesystem)
673
584
 
674
585
  if (${RUBY_VER} VERSION_LESS "3.0.0")
675
586
  add_custom_target(patched_ruby
data/README.adoc CHANGED
@@ -3,11 +3,13 @@
3
3
  image:https://github.com/tamatebako/tebako/actions/workflows/ubuntu.yml/badge.svg["Ubuntu amd64", link="https://github.com/tamatebako/tebako/actions/workflows/ubuntu.yml"]
4
4
  image:https://github.com/tamatebako/tebako/actions/workflows/alpine.yml/badge.svg["Alpine", link="https://github.com/tamatebako/tebako/actions/workflows/alpine.yml"]
5
5
  image:https://github.com/tamatebako/tebako/actions/workflows/macos.yml/badge.svg["MacOS amd64", link="https://github.com/tamatebako/tebako/actions/workflows/macos.yml"]
6
- image:https://github.com/tamatebako/tebako/actions/workflows/lint.yml/badge.svg["lint", link="https://github.com/tamatebako/tebako/actions/workflows/lint.yml"]
6
+ image:https://github.com/tamatebako/tebako/actions/workflows/windows-msys.yml/badge.svg["Windows msys", link="https://github.com/tamatebako/tebako/actions/workflows/windows-msys.yml"]
7
7
 
8
8
  image:https://api.cirrus-ci.com/github/tamatebako/tebako.svg?branch=main&task=macos-arm64["MacOS arm64", link="https://cirrus-ci.com/github/tamatebako/tebako"]
9
9
  image:https://api.cirrus-ci.com/github/tamatebako/tebako.svg?branch=main&task=ubuntu-aarch64["Ubuntu aarch64", link="https://cirrus-ci.com/github/tamatebako/tebako"]
10
10
 
11
+ image:https://github.com/tamatebako/tebako/actions/workflows/lint.yml/badge.svg["lint", link="https://github.com/tamatebako/tebako/actions/workflows/lint.yml"]
12
+
11
13
  == Purpose
12
14
 
13
15
  Tebako is an executable packager. It packages a set of files into a DwarFS file
@@ -34,27 +36,45 @@ In the future:
34
36
  The Tebako packager is tested on the following platforms:
35
37
 
36
38
  * Linux: Ubuntu 20.04; Alpine 3.17
37
- * macOS: macOS 11 (Big Sur), 12 (Monterey), 13 (Ventura)
38
- * Windows: TBD
39
+ * MacOS: macOS 12 (Monterey), 13 (Ventura)
40
+ * Windows: 2019, 2022 (using MinGW ucrt64 toolchain)
41
+
42
+ Please note that Windows support is in pre-release and is a subject of further testing and optimization
39
43
 
40
44
  == Supported Ruby versions
41
45
 
42
46
  The Tebako packager supports the following versions of Ruby for packaging:
43
47
 
44
- * 2.7.8
45
- * 3.0.6
46
- * 3.1.4
47
- * 3.2.3
48
+ * 2.7.8 (Linux, MacOS)
49
+ * 3.0.6 (Linux, MacOS)
50
+ * 3.1.4 (Linux, MacOS, Windows)
51
+ * 3.2.3 (Linux, MacOS)
48
52
 
49
53
  Support of specific version including minor release requires some effort, sometimes extensive
50
54
  but our goal is to be able to package all maintained Ruby releases.
51
55
 
52
56
  == Prerequisites
53
57
 
54
- === Ubuntu
58
+ === Ubuntu 20.04
55
59
 
56
60
  ==== GNU C/C++ 10+ or Clang C/C++ 12+
57
61
 
62
+ [source,sh]
63
+ ----
64
+ apt install -y gcc-10 g++-10
65
+ update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
66
+ update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
67
+ ----
68
+
69
+ or
70
+
71
+ [source,sh]
72
+ ----
73
+ apt install -y clang-12
74
+ update-alternatives --install /usr/bin/clang clang /usr/bin/clang-12 150
75
+ update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-12 150
76
+ ----
77
+
58
78
  ==== CMake version 3.20+
59
79
 
60
80
  Tebako relies on CMake 3.20+, which may not be available as a default package.
@@ -75,16 +95,39 @@ apt-get install cmake
75
95
 
76
96
  [source,sh]
77
97
  ----
78
- apt-get install -y curl git ruby ruby-dev pkg-config bison flex make autoconf
79
- apt-get install -y binutils-dev libarchive-dev libevent-dev libjemalloc-dev acl-dev \
80
- libdouble-conversion-dev libiberty-dev liblz4-dev liblzma-dev libssl-dev \
81
- libboost-context-dev libboost-filesystem-dev libboost-program-options-dev \
82
- libboost-regex-dev libboost-system-dev libboost-thread-dev \
83
- libunwind-dev libdwarf-dev libelf-dev libfuse-dev libgoogle-glog-dev \
84
- libffi-dev libgdbm-dev libyaml-dev libncurses-dev libreadline-dev \
85
- libfmt-dev
98
+ apt-get -y install sudo git curl build-essential pkg-config bison flex autoconf \
99
+ binutils-dev libevent-dev acl-dev libfmt-dev libjemalloc-dev libiberty-dev \
100
+ libdouble-conversion-dev liblz4-dev liblzma-dev libssl-dev libunwind-dev \
101
+ libboost-filesystem-dev libboost-program-options-dev libboost-system-dev \
102
+ libboost-iostreams-dev libboost-date-time-dev libboost-context-dev \
103
+ libboost-regex-dev libboost-thread-dev libbrotli-dev libdwarf-dev libelf-dev \
104
+ libgoogle-glog-dev libffi-dev libgdbm-dev libyaml-dev libncurses-dev \
105
+ libreadline-dev libncurses-dev libreadline-dev ruby-dev ruby-bundler \
106
+ libutfcpp-dev
107
+ ----
108
+
109
+ === Alpine 3.17
110
+
111
+ [source,sh]
112
+ ----
113
+ apk --no-cache --upgrade add build-base cmake git bash autoconf boost-static \
114
+ boost-dev flex-dev bison make binutils-dev libevent-dev acl-dev sed python3 \
115
+ pkgconfig lz4-dev openssl-dev zlib-dev xz ninja zip unzip curl libdwarf-dev \
116
+ libunwind-dev gflags-dev elfutils-dev libevent-static openssl-libs-static \
117
+ lz4-static xz-dev zlib-static libunwind-static acl-static tar libffi-dev \
118
+ gdbm-dev yaml-dev yaml-static ncurses-dev ncurses-static readline-dev \
119
+ readline-static p7zip ruby-dev gcompat gettext-dev gperf brotli-dev \
120
+ brotli-static jemalloc-dev fmt-dev xz-static
86
121
  ----
87
122
 
123
+ === macOS 12 (Monterey)
124
+
125
+ [source,sh]
126
+ ----
127
+ brew update
128
+ brew install gnu-sed bash pkg-config bison flex binutils libffi gdbm zlib ncurses \
129
+ double-conversion boost jemalloc fmt glog libevent libsodium lz4 xz libyaml openssl@3
130
+ ----
88
131
 
89
132
  == Installation
90
133
 
@@ -97,6 +140,20 @@ Tebako is distributed as a Ruby gem
97
140
  gem install tebako
98
141
  ----
99
142
 
143
+ === Windows (2019, 2022)
144
+
145
+ The simplest approach is to use Ruby development environment provided by RubyInstaller, for example Ruby+Devkit 3.1.4-1
146
+ Once it is is installed use the follwoing commands
147
+
148
+ [source,sh]
149
+ ----
150
+ ridk enable ucrt64
151
+ pacman -S git tar bison flex toolchain make cmake
152
+ boost diffutils libevent double-conversion
153
+ fmt glog dlfcn gtest autotools ncurses libyaml
154
+ ----
155
+
156
+
100
157
  === Quick setup on Ubuntu 20.04 on Docker
101
158
 
102
159
  Launch a container on the target platform:
@@ -126,12 +183,15 @@ apt-get install -y curl git ruby ruby-dev pkg-config bison flex make autoconf
126
183
  curl https://apt.kitware.com/kitware-archive.sh | bash
127
184
  apt-get install -y cmake
128
185
 
129
- apt-get install -y binutils-dev libarchive-dev libevent-dev libjemalloc-dev acl-dev \
130
- libdouble-conversion-dev libiberty-dev liblz4-dev liblzma-dev libssl-dev \
131
- libboost-context-dev libboost-filesystem-dev libboost-program-options-dev \
132
- libboost-regex-dev libboost-system-dev libboost-thread-dev \
133
- libunwind-dev libdwarf-dev libelf-dev libfuse-dev libgoogle-glog-dev \
134
- libffi-dev libgdbm-dev libyaml-dev libncurses-dev libreadline-dev libfmt-dev
186
+ apt-get -y install sudo git curl build-essential pkg-config bison flex autoconf \
187
+ binutils-dev libevent-dev acl-dev libfmt-dev libjemalloc-dev libiberty-dev \
188
+ libdouble-conversion-dev liblz4-dev liblzma-dev libssl-dev libunwind-dev \
189
+ libboost-filesystem-dev libboost-program-options-dev libboost-system-dev \
190
+ libboost-iostreams-dev libboost-date-time-dev libboost-context-dev \
191
+ libboost-regex-dev libboost-thread-dev libbrotli-dev libdwarf-dev libelf-dev \
192
+ libgoogle-glog-dev libffi-dev libgdbm-dev libyaml-dev libncurses-dev \
193
+ libreadline-dev libutfcpp-dev libncurses-dev libreadline-dev gcc-10 g++-10 \
194
+ ruby-dev ruby-bundler
135
195
 
136
196
  gem install tebako
137
197
 
@@ -209,6 +269,8 @@ directories differ and nultiple Ruby versions within single configuration
209
269
 
210
270
  This command is optional, tebako creates packaging environment automatically upon the first
211
271
  invocation of press command.
272
+ However, if you plan to use tebako in CI/CD environment with caching it is highly recommended to build cache
273
+ based on ```tebako setup``` output. Building cache based on ```tebako press``` may create inconsistent environment upon restore.
212
274
 
213
275
  [source]
214
276
  ----
data/common.env CHANGED
@@ -1,5 +1,5 @@
1
1
  BUILD_TYPE=Release
2
2
  DEPS=deps
3
3
  INCBIN_TAG=348e36b
4
- DWARFS_WR_TAG=v0.4.3
4
+ DWARFS_WR_TAG=v0.5.1
5
5
  RUBY_VER=3.1.4