tebako 0.5.0 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CMakeLists.txt +4 -5
- data/README.adoc +1 -1
- data/Rakefile +10 -0
- data/exe/tebako +3 -2
- data/exe/tebako-packager +94 -0
- data/lib/tebako/cli.rb +3 -13
- data/lib/tebako/cli_helpers.rb +12 -5
- data/lib/tebako/error.rb +1 -1
- data/lib/tebako/packager/pass1.rb +111 -109
- data/lib/tebako/packager/pass2.rb +306 -308
- data/lib/tebako/packager.rb +17 -77
- data/lib/tebako/version.rb +1 -1
- data/lib/{cli.rb → tebako.rb} +7 -1
- data/tebako.gemspec +3 -0
- data/tests-2/tebako-test.rb +3 -2
- data/tools/.gitattributes +4 -0
- data/tools/.github/workflows/lint.yml +41 -0
- data/tools/README.md +5 -0
- data/tools/ci-scripts/arm-brew-install.sh +43 -0
- data/tools/ci-scripts/arm-brew-setup.sh +33 -0
- data/tools/ci-scripts/level-up.sh +35 -0
- data/tools/ci-scripts/patch-fbthrift.sh +92 -0
- data/tools/ci-scripts/patch-folly.sh +447 -0
- data/tools/ci-scripts/patch-system-includes.sh +59 -0
- data/tools/ci-scripts/x86-brew-install.sh +43 -0
- data/tools/ci-scripts/x86-brew-setup.sh +33 -0
- data/tools/cmake-scripts/def-external-project.cmake +96 -0
- data/tools/cmake-scripts/macos-environment.cmake +116 -0
- data/tools/cmake-scripts/msys-environment.cmake +78 -0
- data/tools/cmake-scripts/setup-openssl.cmake +69 -0
- data/tools/cmake-scripts/version.cmake +162 -0
- data/tools/include/pro-statvfs.h +57 -0
- data/version.txt +1 -0
- metadata +23 -3
@@ -0,0 +1,116 @@
|
|
1
|
+
# Copyright (c) 2021-2023, [Ribose Inc](https://www.ribose.com).
|
2
|
+
# All rights reserved.
|
3
|
+
# This file is a part of tamatebako
|
4
|
+
#
|
5
|
+
# Redistribution and use in source and binary forms, with or without
|
6
|
+
# modification, are permitted provided that the following conditions
|
7
|
+
# are met:
|
8
|
+
# 1. Redistributions of source code must retain the above copyright
|
9
|
+
# notice, this list of conditions and the following disclaimer.
|
10
|
+
# 2. Redistributions in binary form must reproduce the above copyright
|
11
|
+
# notice, this list of conditions and the following disclaimer in the
|
12
|
+
# documentation and/or other materials provided with the distribution.
|
13
|
+
#
|
14
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
15
|
+
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
16
|
+
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
17
|
+
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
|
18
|
+
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
19
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
20
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
21
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
22
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
23
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
24
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
25
|
+
#
|
26
|
+
|
27
|
+
set(GNU_BASH "bash")
|
28
|
+
|
29
|
+
if (CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin")
|
30
|
+
# If we are cross compiling TARGET_HOMEBREW will point to homebrew environment for target
|
31
|
+
# If we are not cross-compiling it will be empty
|
32
|
+
# Note that below for Bison, Flex and bash we are using host homebrew environment (just 'brew')
|
33
|
+
# while other packages refer target environment potentially specified by BREW_BIN
|
34
|
+
execute_process(
|
35
|
+
COMMAND brew --prefix
|
36
|
+
RESULT_VARIABLE BREW_PREFIX_RES
|
37
|
+
OUTPUT_VARIABLE BUILD_BREW_PREFIX
|
38
|
+
OUTPUT_STRIP_TRAILING_WHITESPACE
|
39
|
+
)
|
40
|
+
if(NOT (BREW_PREFIX_RES EQUAL 0 AND EXISTS ${BUILD_BREW_PREFIX}))
|
41
|
+
message(FATAL "Could not find build brew setup")
|
42
|
+
endif()
|
43
|
+
|
44
|
+
message("Using build brew environment at ${BUILD_BREW_PREFIX}")
|
45
|
+
# https://github.com/actions/virtual-environments/blob/main/images/macos/macos-10.15-Readme.me
|
46
|
+
set(BUILD_OPENSSL_ROOT_DIR "${BUILD_BREW_PREFIX}/opt/openssl@1.1")
|
47
|
+
set(BUILD_CMAKE_PREFIX_PATH "${BUILD_BREW_PREFIX}")
|
48
|
+
|
49
|
+
# https://stackoverflow.com/questions/53877344/cannot-configure-cmake-to-look-for-homebrew-installed-version-of-bison
|
50
|
+
execute_process(
|
51
|
+
COMMAND brew --prefix bison
|
52
|
+
RESULT_VARIABLE BREW_BISON
|
53
|
+
OUTPUT_VARIABLE BREW_BISON_PREFIX
|
54
|
+
OUTPUT_STRIP_TRAILING_WHITESPACE
|
55
|
+
)
|
56
|
+
if (BREW_BISON EQUAL 0 AND EXISTS "${BREW_BISON_PREFIX}")
|
57
|
+
message(STATUS "Found Bison keg installed by Homebrew at ${BREW_BISON_PREFIX}")
|
58
|
+
set(BISON_EXECUTABLE "${BREW_BISON_PREFIX}/bin/bison")
|
59
|
+
endif()
|
60
|
+
|
61
|
+
execute_process(
|
62
|
+
COMMAND brew --prefix flex
|
63
|
+
RESULT_VARIABLE BREW_FLEX
|
64
|
+
OUTPUT_VARIABLE BREW_FLEX_PREFIX
|
65
|
+
OUTPUT_STRIP_TRAILING_WHITESPACE
|
66
|
+
)
|
67
|
+
if (BREW_FLEX EQUAL 0 AND EXISTS "${BREW_FLEX_PREFIX}")
|
68
|
+
message(STATUS "Found Flex keg installed by Homebrew at ${BREW_FLEX_PREFIX}")
|
69
|
+
set(FLEX_EXECUTABLE "${BREW_FLEX_PREFIX}/bin/flex")
|
70
|
+
endif()
|
71
|
+
|
72
|
+
execute_process(
|
73
|
+
COMMAND brew --prefix bash
|
74
|
+
RESULT_VARIABLE BREW_BASH
|
75
|
+
OUTPUT_VARIABLE BREW_BASH_PREFIX
|
76
|
+
OUTPUT_STRIP_TRAILING_WHITESPACE
|
77
|
+
)
|
78
|
+
if (BREW_BASH EQUAL 0 AND EXISTS "${BREW_BASH_PREFIX}")
|
79
|
+
message(STATUS "Found GNU bash keg installed by Homebrew at ${BREW_BASH_PREFIX}")
|
80
|
+
set(GNU_BASH "${BREW_BASH_PREFIX}/bin/bash")
|
81
|
+
endif()
|
82
|
+
|
83
|
+
if(NOT TARGET_HOMEBREW)
|
84
|
+
set(TARGET_BREW_PREFIX ${BUILD_BREW_PREFIX} )
|
85
|
+
else()
|
86
|
+
execute_process(
|
87
|
+
COMMAND "${TARGET_HOMEBREW}/bin/brew" --prefix
|
88
|
+
RESULT_VARIABLE BREW_PREFIX_RES
|
89
|
+
OUTPUT_VARIABLE TARGET_BREW_PREFIX
|
90
|
+
OUTPUT_STRIP_TRAILING_WHITESPACE
|
91
|
+
)
|
92
|
+
if(NOT (BREW_PREFIX_RES EQUAL 0 AND EXISTS ${TARGET_BREW_PREFIX}))
|
93
|
+
message(FATAL "Could not find target brew setup")
|
94
|
+
endif()
|
95
|
+
endif()
|
96
|
+
|
97
|
+
message("Using target brew environment at ${TARGET_BREW_PREFIX}")
|
98
|
+
set(OPENSSL_ROOT_DIR "${TARGET_BREW_PREFIX}/opt/openssl@1.1")
|
99
|
+
set(CMAKE_PREFIX_PATH "${TARGET_BREW_PREFIX}")
|
100
|
+
include_directories("${TARGET_BREW_PREFIX}/include")
|
101
|
+
|
102
|
+
# Suppress superfluous randlib warnings about "*.a" having no symbols on MacOSX.
|
103
|
+
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
104
|
+
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
105
|
+
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
|
106
|
+
set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
|
107
|
+
|
108
|
+
set(CMAKE_CXX_FLAGS "-DTARGET_OS_SIMULATOR=0 -DTARGET_OS_IPHONE=0")
|
109
|
+
|
110
|
+
set(BUILD_CMAKE_ARGUMENTS -DCMAKE_PREFIX_PATH=${BUILD_CMAKE_PREFIX_PATH}
|
111
|
+
-DOPENSSL_ROOT_DIR=${BUILD_OPENSSL_ROOT_DIR}
|
112
|
+
-DBISON_EXECUTABLE=${BISON_EXECUTABLE}
|
113
|
+
-DFLEX_EXECUTABLE=${FLEX_EXECUTABLE}
|
114
|
+
)
|
115
|
+
|
116
|
+
endif()
|
@@ -0,0 +1,78 @@
|
|
1
|
+
# Copyright (c) 2022, [Ribose Inc](https://www.ribose.com).
|
2
|
+
# All rights reserved.
|
3
|
+
# This file is a part of tamatebako
|
4
|
+
#
|
5
|
+
# Redistribution and use in source and binary forms, with or without
|
6
|
+
# modification, are permitted provided that the following conditions
|
7
|
+
# are met:
|
8
|
+
# 1. Redistributions of source code must retain the above copyright
|
9
|
+
# notice, this list of conditions and the following disclaimer.
|
10
|
+
# 2. Redistributions in binary form must reproduce the above copyright
|
11
|
+
# notice, this list of conditions and the following disclaimer in the
|
12
|
+
# documentation and/or other materials provided with the distribution.
|
13
|
+
#
|
14
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
15
|
+
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
16
|
+
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
17
|
+
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
|
18
|
+
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
19
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
20
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
21
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
22
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
23
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
24
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
25
|
+
#
|
26
|
+
|
27
|
+
if(MINGW)
|
28
|
+
# These days Windows has its own bash.exe that points to WSL installation even if nothing is installed
|
29
|
+
# So we (1) go look for 'sh' (presumably we will find MSys version)
|
30
|
+
# (2) assume that MSys bash is add_subdirectory
|
31
|
+
# (3) convert path to Windows
|
32
|
+
execute_process(
|
33
|
+
COMMAND "which" "sh"
|
34
|
+
RESULT_VARIABLE SH_RES
|
35
|
+
OUTPUT_VARIABLE SH
|
36
|
+
OUTPUT_STRIP_TRAILING_WHITESPACE
|
37
|
+
)
|
38
|
+
|
39
|
+
if(NOT (SH_RES EQUAL 0))
|
40
|
+
message(FATAL_ERROR "Could not find MSystem /usr/bin")
|
41
|
+
endif()
|
42
|
+
|
43
|
+
get_filename_component(BASH_DIR "${SH}" DIRECTORY)
|
44
|
+
|
45
|
+
execute_process(
|
46
|
+
COMMAND "cygpath" "-w" "${BASH_DIR}"
|
47
|
+
RESULT_VARIABLE BASH_RES
|
48
|
+
OUTPUT_VARIABLE MSYS_BIN_RAW
|
49
|
+
OUTPUT_STRIP_TRAILING_WHITESPACE
|
50
|
+
)
|
51
|
+
|
52
|
+
if(NOT (BASH_RES EQUAL 0))
|
53
|
+
message(FATAL_ERROR "Could not find MSys root")
|
54
|
+
endif()
|
55
|
+
|
56
|
+
# Some black magic below
|
57
|
+
cmake_path(SET MSYS_USR_RAW NORMALIZE "${MSYS_BIN_RAW}\\..\\..\\usr")
|
58
|
+
cmake_path(SET MSYS_TMP_RAW NORMALIZE "${MSYS_USR_RAW}\\..\\tmp")
|
59
|
+
|
60
|
+
string(REPLACE "\\" "\\\\" MSYS_BIN ${MSYS_BIN_RAW} )
|
61
|
+
string(REPLACE "/" "\\\\" MSYS_USR ${MSYS_USR_RAW} )
|
62
|
+
string(REPLACE "/" "\\\\" MSYS_TMP ${MSYS_TMP_RAW} )
|
63
|
+
|
64
|
+
set(BASH "${BASH_DIR}/bash.exe")
|
65
|
+
|
66
|
+
execute_process(
|
67
|
+
COMMAND "cygpath" "-w" "${BASH}"
|
68
|
+
RESULT_VARIABLE BASH_RES
|
69
|
+
OUTPUT_VARIABLE GNU_BASH
|
70
|
+
OUTPUT_STRIP_TRAILING_WHITESPACE
|
71
|
+
)
|
72
|
+
|
73
|
+
if(NOT (BASH_RES EQUAL 0 AND EXISTS ${GNU_BASH}))
|
74
|
+
message(FATAL_ERROR "Could not find gnu bash")
|
75
|
+
endif()
|
76
|
+
|
77
|
+
message(STATUS "Using gnu bash at ${GNU_BASH}")
|
78
|
+
endif(MINGW)
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# Copyright (c) 2023 [Ribose Inc](https://www.ribose.com).
|
2
|
+
# All rights reserved.
|
3
|
+
# This file is a part of tebako
|
4
|
+
#
|
5
|
+
# Redistribution and use in source and binary forms, with or without
|
6
|
+
# modification, are permitted provided that the following conditions
|
7
|
+
# are met:
|
8
|
+
# 1. Redistributions of source code must retain the above copyright
|
9
|
+
# notice, this list of conditions and the following disclaimer.
|
10
|
+
# 2. Redistributions in binary form must reproduce the above copyright
|
11
|
+
# notice, this list of conditions and the following disclaimer in the
|
12
|
+
# documentation and/or other materials provided with the distribution.
|
13
|
+
#
|
14
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
15
|
+
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
16
|
+
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
17
|
+
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
|
18
|
+
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
19
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
20
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
21
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
22
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
23
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
24
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
25
|
+
|
26
|
+
set(WITH_OPENSSL_BUILD ON)
|
27
|
+
|
28
|
+
execute_process(
|
29
|
+
COMMAND "${DEPS}/bin/openssl" "version"
|
30
|
+
RESULT_VARIABLE OPENSSL_RES
|
31
|
+
OUTPUT_VARIABLE OPENSSL_VER_STR
|
32
|
+
OUTPUT_STRIP_TRAILING_WHITESPACE
|
33
|
+
)
|
34
|
+
|
35
|
+
if(OPENSSL_RES EQUAL 0)
|
36
|
+
string(REGEX MATCH "^OpenSSL ([1-9][.][0-9][.][0-9])" OPENSSL_VER_TMP ${OPENSSL_VER_STR})
|
37
|
+
set(OPENSSL_VER ${CMAKE_MATCH_1})
|
38
|
+
message(STATUS "Found OpenSSL version ${OPENSSL_VER} at ${DEPS}/bin/openssl")
|
39
|
+
if((${OPENSSL_VER} VERSION_GREATER_EQUAL "1.1.0") AND (${OPENSSL_VER} VERSION_LESS "3.0.0"))
|
40
|
+
set(WITH_OPENSSL_BUILD OFF)
|
41
|
+
endif((${OPENSSL_VER} VERSION_GREATER_EQUAL "1.1.0") AND (${OPENSSL_VER} VERSION_LESS "3.0.0"))
|
42
|
+
endif(OPENSSL_RES EQUAL 0)
|
43
|
+
|
44
|
+
if(WITH_OPENSSL_BUILD)
|
45
|
+
execute_process(
|
46
|
+
COMMAND "openssl" "version"
|
47
|
+
RESULT_VARIABLE OPENSSL_RES
|
48
|
+
OUTPUT_VARIABLE OPENSSL_VER_STR
|
49
|
+
OUTPUT_STRIP_TRAILING_WHITESPACE
|
50
|
+
)
|
51
|
+
if(OPENSSL_RES EQUAL 0)
|
52
|
+
execute_process(
|
53
|
+
COMMAND "which" "openssl"
|
54
|
+
RESULT_VARIABLE OPENSSL_RES
|
55
|
+
OUTPUT_VARIABLE OPENSSL_LOC
|
56
|
+
OUTPUT_STRIP_TRAILING_WHITESPACE
|
57
|
+
)
|
58
|
+
if(NOT OPENSSL_RES EQUAL 0)
|
59
|
+
set(OPENSSL_LOC "<unknown>")
|
60
|
+
endif(NOT OPENSSL_RES EQUAL 0)
|
61
|
+
|
62
|
+
string(REGEX MATCH "^OpenSSL ([1-9][.][0-9][.][0-9])" OPENSSL_VER_TMP ${OPENSSL_VER_STR})
|
63
|
+
set(OPENSSL_VER ${CMAKE_MATCH_1})
|
64
|
+
message(STATUS "Found OpenSSL version ${OPENSSL_VER} at ${OPENSSL_LOC}")
|
65
|
+
if((${OPENSSL_VER} VERSION_GREATER_EQUAL "1.1.0") AND (${OPENSSL_VER} VERSION_LESS "3.0.0"))
|
66
|
+
set(WITH_OPENSSL_BUILD OFF)
|
67
|
+
endif((${OPENSSL_VER} VERSION_GREATER_EQUAL "1.1.0") AND (${OPENSSL_VER} VERSION_LESS "3.0.0"))
|
68
|
+
endif(OPENSSL_RES EQUAL 0)
|
69
|
+
endif(WITH_OPENSSL_BUILD)
|
@@ -0,0 +1,162 @@
|
|
1
|
+
# Copyright (c) 2018-2021 Ribose Inc.
|
2
|
+
# All rights reserved.
|
3
|
+
#
|
4
|
+
# Redistribution and use in source and binary forms, with or without
|
5
|
+
# modification, are permitted provided that the following conditions
|
6
|
+
# are met:
|
7
|
+
# 1. Redistributions of source code must retain the above copyright
|
8
|
+
# notice, this list of conditions and the following disclaimer.
|
9
|
+
# 2. Redistributions in binary form must reproduce the above copyright
|
10
|
+
# notice, this list of conditions and the following disclaimer in the
|
11
|
+
# documentation and/or other materials provided with the distribution.
|
12
|
+
#
|
13
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
14
|
+
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
15
|
+
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
16
|
+
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
|
17
|
+
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
18
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
19
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
20
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
21
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
22
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
23
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
24
|
+
|
25
|
+
# desired length of commit hash
|
26
|
+
set(GIT_REV_LEN 7)
|
27
|
+
|
28
|
+
# call git, store output in var (can fail)
|
29
|
+
macro(_git var)
|
30
|
+
execute_process(
|
31
|
+
COMMAND "${GIT_EXECUTABLE}" ${ARGN}
|
32
|
+
WORKING_DIRECTORY "${source_dir}"
|
33
|
+
RESULT_VARIABLE _git_ec
|
34
|
+
OUTPUT_VARIABLE ${var}
|
35
|
+
OUTPUT_STRIP_TRAILING_WHITESPACE
|
36
|
+
ERROR_QUIET
|
37
|
+
)
|
38
|
+
endmacro()
|
39
|
+
|
40
|
+
function(extract_version_info version var_prefix)
|
41
|
+
# extract the main components
|
42
|
+
# v1.9.0-3-g5b92266+1546836556
|
43
|
+
# v1.9.0-3-g5b92266-dirty+1546836556
|
44
|
+
string(REGEX MATCH "^v?([0-9]+\\.[0-9]+\\.[0-9]+)(-([0-9]+)-g([0-9a-f]+)(-dirty)?)?(\\+([0-9]+))?$" matches "${version}")
|
45
|
+
if (NOT matches)
|
46
|
+
message(FATAL_ERROR "Failed to extract version components from ${version}.")
|
47
|
+
endif()
|
48
|
+
set(${var_prefix}_VERSION "${CMAKE_MATCH_1}" PARENT_SCOPE) # 1.9.0
|
49
|
+
if (NOT CMAKE_MATCH_3)
|
50
|
+
set(CMAKE_MATCH_3 "0")
|
51
|
+
endif()
|
52
|
+
set(${var_prefix}_VERSION_NCOMMITS "${CMAKE_MATCH_3}" PARENT_SCOPE) # 3
|
53
|
+
if (NOT CMAKE_MATCH_4)
|
54
|
+
set(CMAKE_MATCH_4 "0")
|
55
|
+
endif()
|
56
|
+
set(${var_prefix}_VERSION_GIT_REV "${CMAKE_MATCH_4}" PARENT_SCOPE) # 5b92266
|
57
|
+
if (CMAKE_MATCH_5 STREQUAL "-dirty")
|
58
|
+
set(${var_prefix}_VERSION_IS_DIRTY TRUE PARENT_SCOPE)
|
59
|
+
else()
|
60
|
+
set(${var_prefix}_VERSION_IS_DIRTY FALSE PARENT_SCOPE)
|
61
|
+
endif()
|
62
|
+
# timestamp is optional, default to 0
|
63
|
+
if (NOT CMAKE_MATCH_7)
|
64
|
+
set(CMAKE_MATCH_7 "0")
|
65
|
+
endif()
|
66
|
+
set(${var_prefix}_VERSION_COMMIT_TIMESTAMP "${CMAKE_MATCH_7}" PARENT_SCOPE) # 1546836556
|
67
|
+
endfunction()
|
68
|
+
|
69
|
+
function(determine_version source_dir var_prefix)
|
70
|
+
set(has_release_tag NO)
|
71
|
+
set(has_version_txt NO)
|
72
|
+
set(local_prefix "_determine_ver")
|
73
|
+
# find out base version via version.txt
|
74
|
+
set(base_version "0.0.0")
|
75
|
+
if (EXISTS "${source_dir}/version.txt")
|
76
|
+
set(has_version_txt YES)
|
77
|
+
file(STRINGS "${source_dir}/version.txt" version_file)
|
78
|
+
extract_version_info("${version_file}" "${local_prefix}")
|
79
|
+
set(base_version "${${local_prefix}_VERSION}")
|
80
|
+
message(STATUS "Found version.txt with ${version_file}")
|
81
|
+
else()
|
82
|
+
message(STATUS "Found no version.txt.")
|
83
|
+
endif()
|
84
|
+
# for GIT_EXECUTABLE
|
85
|
+
find_package(Git)
|
86
|
+
# get a description of the version, something like:
|
87
|
+
# v1.9.1-0-g38ffe82 (a tagged release)
|
88
|
+
# v1.9.1-0-g38ffe82-dirty (a tagged release with local modifications)
|
89
|
+
# v1.9.0-3-g5b92266 (post-release snapshot)
|
90
|
+
# v1.9.0-3-g5b92266-dirty (post-release snapshot with local modifications)
|
91
|
+
_git(version describe --abbrev=${GIT_REV_LEN} --match "v[0-9]*" --long --dirty)
|
92
|
+
if (NOT _git_ec EQUAL 0)
|
93
|
+
# no annotated tags, fake one
|
94
|
+
message(STATUS "Found no annotated tags.")
|
95
|
+
_git(revision rev-parse --short=${GIT_REV_LEN} --verify HEAD)
|
96
|
+
if (_git_ec EQUAL 0)
|
97
|
+
set(version "v${base_version}-0-g${revision}")
|
98
|
+
# check if dirty (this won't detect untracked files, but should be ok)
|
99
|
+
_git(changes diff-index --quiet HEAD --)
|
100
|
+
if (NOT _git_ec EQUAL 0)
|
101
|
+
string(APPEND version "-dirty")
|
102
|
+
endif()
|
103
|
+
# append the commit timestamp of the most recent commit (only
|
104
|
+
# in non-release branches -- typically master)
|
105
|
+
_git(commit_timestamp show -s --format=%ct)
|
106
|
+
if (_git_ec EQUAL 0)
|
107
|
+
string(APPEND version "+${commit_timestamp}")
|
108
|
+
endif()
|
109
|
+
elseif(has_version_txt)
|
110
|
+
# Nothing to get from git - so use version.txt completely
|
111
|
+
set(version "${version_file}")
|
112
|
+
else()
|
113
|
+
# Sad case - no git, no version.txt
|
114
|
+
set(version "v${base_version}")
|
115
|
+
endif()
|
116
|
+
else()
|
117
|
+
set(has_release_tag YES)
|
118
|
+
message(STATUS "Found annotated tag ${version}")
|
119
|
+
endif()
|
120
|
+
extract_version_info("${version}" "${local_prefix}")
|
121
|
+
if ("${has_version_txt}" AND NOT ${base_version} STREQUAL ${local_prefix}_VERSION)
|
122
|
+
message(WARNING "Tagged version ${${local_prefix}_VERSION} doesn't match one from the version.txt: ${base_version}")
|
123
|
+
if (${base_version} VERSION_GREATER ${local_prefix}_VERSION)
|
124
|
+
set(${local_prefix}_VERSION ${base_version})
|
125
|
+
endif()
|
126
|
+
endif()
|
127
|
+
foreach(suffix VERSION VERSION_NCOMMITS VERSION_GIT_REV VERSION_IS_DIRTY VERSION_COMMIT_TIMESTAMP)
|
128
|
+
if (NOT DEFINED ${local_prefix}_${suffix})
|
129
|
+
message(FATAL_ERROR "Unable to determine version.")
|
130
|
+
endif()
|
131
|
+
set(${var_prefix}_${suffix} "${${local_prefix}_${suffix}}" PARENT_SCOPE)
|
132
|
+
message(STATUS "${var_prefix}_${suffix}: ${${local_prefix}_${suffix}}")
|
133
|
+
endforeach()
|
134
|
+
# Set VERSION_SUFFIX and VERSION_FULL. When making changes, be aware that
|
135
|
+
# this is used in packaging as well and will affect ordering.
|
136
|
+
# | state | version_full |
|
137
|
+
# |-----------------------------------------------------|
|
138
|
+
# | exact tag | 0.9.0 |
|
139
|
+
# | exact tag, dirty | 0.9.0+git20180604 |
|
140
|
+
# | after tag | 0.9.0+git20180604.1.085039f |
|
141
|
+
# | no tag, version.txt | 0.9.0+git20180604.2ee02af |
|
142
|
+
# | no tag, no version.txt| 0.0.0+git20180604.2ee02af |
|
143
|
+
string(TIMESTAMP date "%Y%m%d" UTC)
|
144
|
+
set(version_suffix "")
|
145
|
+
if (NOT ${local_prefix}_VERSION_NCOMMITS EQUAL 0)
|
146
|
+
# 0.9.0+git20150604.4.289818b
|
147
|
+
string(APPEND version_suffix "+git${date}.${${local_prefix}_VERSION_NCOMMITS}.${${local_prefix}_VERSION_GIT_REV}")
|
148
|
+
elseif ((NOT has_release_tag) AND ((NOT has_version_txt) OR ("${base_version}" STREQUAL "0.0.0") OR (NOT "${revision}" STREQUAL "")))
|
149
|
+
# 0.9.0+git20150604.289818b
|
150
|
+
string(APPEND version_suffix "+git${date}.${${local_prefix}_VERSION_GIT_REV}")
|
151
|
+
elseif(${local_prefix}_VERSION_IS_DIRTY)
|
152
|
+
# 0.9.0+git20150604
|
153
|
+
string(APPEND version_suffix "+git${date}")
|
154
|
+
endif()
|
155
|
+
set(version_full "${${local_prefix}_VERSION}${version_suffix}")
|
156
|
+
# set the results
|
157
|
+
set(${var_prefix}_VERSION_SUFFIX "${version_suffix}" PARENT_SCOPE)
|
158
|
+
set(${var_prefix}_VERSION_FULL "${version_full}" PARENT_SCOPE)
|
159
|
+
# for informational purposes
|
160
|
+
message(STATUS "${var_prefix}_VERSION_SUFFIX: ${version_suffix}")
|
161
|
+
message(STATUS "${var_prefix}_VERSION_FULL: ${version_full}")
|
162
|
+
endfunction()
|
@@ -0,0 +1,57 @@
|
|
1
|
+
/**
|
2
|
+
*
|
3
|
+
* Copyright (c) 2022, [Ribose Inc](https://www.ribose.com).
|
4
|
+
* All rights reserved.
|
5
|
+
* This file is a part of tebako (libdwarfs-wr)
|
6
|
+
*
|
7
|
+
* Redistribution and use in source and binary forms, with or without
|
8
|
+
* modification, are permitted provided that the following conditions
|
9
|
+
* are met:
|
10
|
+
* 1. Redistributions of source code must retain the above copyright
|
11
|
+
* notice, this list of conditions and the following disclaimer.
|
12
|
+
* 2. Redistributions in binary form must reproduce the above copyright
|
13
|
+
* notice, this list of conditions and the following disclaimer in the
|
14
|
+
* documentation and/or other materials provided with the distribution.
|
15
|
+
*
|
16
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
18
|
+
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
19
|
+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
|
20
|
+
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
21
|
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
22
|
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
23
|
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
24
|
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
25
|
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
26
|
+
* POSSIBILITY OF SUCH DAMAGE.
|
27
|
+
*
|
28
|
+
*/
|
29
|
+
|
30
|
+
#pragma once
|
31
|
+
|
32
|
+
#ifdef _WIN32
|
33
|
+
using fsblkcnt_t = unsigned long;
|
34
|
+
using fsfilcnt_t = unsigned long;
|
35
|
+
struct statvfs {
|
36
|
+
unsigned long f_bsize; /* Filesystem block size */
|
37
|
+
unsigned long f_frsize; /* Fragment size */
|
38
|
+
fsblkcnt_t f_blocks; /* Size of fs in f_frsize units */
|
39
|
+
fsblkcnt_t f_bfree; /* Number of free blocks */
|
40
|
+
fsblkcnt_t f_bavail; /* Number of free blocks for
|
41
|
+
unprivileged users */
|
42
|
+
fsfilcnt_t f_files; /* Number of inodes */
|
43
|
+
fsfilcnt_t f_ffree; /* Number of free inodes */
|
44
|
+
fsfilcnt_t f_favail; /* Number of free inodes for
|
45
|
+
unprivileged users */
|
46
|
+
unsigned long f_fsid; /* Filesystem ID */
|
47
|
+
unsigned long f_flag; /* Mount flags */
|
48
|
+
unsigned long f_namemax; /* Maximum filename length */
|
49
|
+
};
|
50
|
+
|
51
|
+
enum {
|
52
|
+
ST_RDONLY = 1, /* Mount read-only. */
|
53
|
+
#define ST_RDONLY ST_RDONLY
|
54
|
+
ST_NOSUID = 2 /* Ignore suid and sgid bits. */
|
55
|
+
#define ST_NOSUID ST_NOSUID
|
56
|
+
};
|
57
|
+
#endif
|
data/version.txt
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.5.2
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tebako
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -46,6 +46,7 @@ email:
|
|
46
46
|
- open.source@ribose.com
|
47
47
|
executables:
|
48
48
|
- tebako
|
49
|
+
- tebako-packager
|
49
50
|
extensions: []
|
50
51
|
extra_rdoc_files: []
|
51
52
|
files:
|
@@ -59,9 +60,10 @@ files:
|
|
59
60
|
- cmake/def_tty_colours.cmake
|
60
61
|
- common.env
|
61
62
|
- exe/tebako
|
63
|
+
- exe/tebako-packager
|
62
64
|
- include/tebako/tebako-fs.h
|
63
65
|
- include/tebako/tebako-main.h
|
64
|
-
- lib/
|
66
|
+
- lib/tebako.rb
|
65
67
|
- lib/tebako/cli.rb
|
66
68
|
- lib/tebako/cli_helpers.rb
|
67
69
|
- lib/tebako/error.rb
|
@@ -133,6 +135,24 @@ files:
|
|
133
135
|
- tests/test-18/tebako-test-run.rb
|
134
136
|
- tests/test-19/Gemfile
|
135
137
|
- tests/test-19/tebako-test-run.rb
|
138
|
+
- tools/.gitattributes
|
139
|
+
- tools/.github/workflows/lint.yml
|
140
|
+
- tools/README.md
|
141
|
+
- tools/ci-scripts/arm-brew-install.sh
|
142
|
+
- tools/ci-scripts/arm-brew-setup.sh
|
143
|
+
- tools/ci-scripts/level-up.sh
|
144
|
+
- tools/ci-scripts/patch-fbthrift.sh
|
145
|
+
- tools/ci-scripts/patch-folly.sh
|
146
|
+
- tools/ci-scripts/patch-system-includes.sh
|
147
|
+
- tools/ci-scripts/x86-brew-install.sh
|
148
|
+
- tools/ci-scripts/x86-brew-setup.sh
|
149
|
+
- tools/cmake-scripts/def-external-project.cmake
|
150
|
+
- tools/cmake-scripts/macos-environment.cmake
|
151
|
+
- tools/cmake-scripts/msys-environment.cmake
|
152
|
+
- tools/cmake-scripts/setup-openssl.cmake
|
153
|
+
- tools/cmake-scripts/version.cmake
|
154
|
+
- tools/include/pro-statvfs.h
|
155
|
+
- version.txt
|
136
156
|
homepage: https://github.com/tamatebako/tebako
|
137
157
|
licenses:
|
138
158
|
- BSD-2-Clause
|