blob: 9d7e618e3e6758dbcb10d1e519b64d9a93dc6055 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
Submodule 3rd_party/bergamot-translator contains modified content
Submodule 3rd_party/marian-dev contains modified content
diff --git a/3rd_party/bergamot-translator/3rd_party/marian-dev/cmake/GetVersionFromFile.cmake b/3rd_party/bergamot-translator/3rd_party/marian-dev/cmake/GetVersionFromFile.cmake
index 31352565..d90a366d 100644
--- a/3rd_party/bergamot-translator/3rd_party/marian-dev/cmake/GetVersionFromFile.cmake
+++ b/3rd_party/bergamot-translator/3rd_party/marian-dev/cmake/GetVersionFromFile.cmake
@@ -22,10 +22,8 @@ else()
endif()
# Get current commit SHA from git
-execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- OUTPUT_VARIABLE PROJECT_VERSION_GIT_SHA
- OUTPUT_STRIP_TRAILING_WHITESPACE)
+# (dummy value for nix package without the .git)
+set(PROJECT_VERSION_GIT_SHA 000000000000)
# Get partial versions into a list
string(REGEX MATCHALL "-.*$|[0-9]+" PROJECT_PARTIAL_VERSION_LIST
diff --git a/3rd_party/bergamot-translator/3rd_party/marian-dev/src/CMakeLists.txt b/3rd_party/bergamot-translator/3rd_party/marian-dev/src/CMakeLists.txt
index 76aa0e2b..ca982bd3 100644
--- a/3rd_party/bergamot-translator/3rd_party/marian-dev/src/CMakeLists.txt
+++ b/3rd_party/bergamot-translator/3rd_party/marian-dev/src/CMakeLists.txt
@@ -149,23 +149,8 @@ target_compile_options(marian PRIVATE ${ALL_WARNINGS})
#
# We set MARIAN_GIT_DIR to the appropriate path, depending on whether
# ${CMAKE_CURRENT_SOURCE_DIR}/../.git is a directory or file.
-set(MARIAN_GIT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../.git)
-if(NOT IS_DIRECTORY ${MARIAN_GIT_DIR}) # i.e., it's a submodule
- file(READ ${MARIAN_GIT_DIR} MARIAN_GIT_DIR)
- string(REGEX REPLACE "gitdir: (.*)\n" "\\1" MARIAN_GIT_DIR ${MARIAN_GIT_DIR})
- if(NOT IS_ABSOLUTE ${MARIAN_GIT_DIR})
- get_filename_component(MARIAN_GIT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../${MARIAN_GIT_DIR}" ABSOLUTE)
- endif()
-endif(NOT IS_DIRECTORY ${MARIAN_GIT_DIR})
-
-add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/common/git_revision.h
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- COMMAND git log -1 --pretty=format:\#define\ GIT_REVISION\ \"\%h\ \%ai\" > ${CMAKE_CURRENT_SOURCE_DIR}/common/git_revision.h
- DEPENDS ${MARIAN_GIT_DIR}/logs/HEAD
- VERBATIM
-)
-add_custom_target(marian_version DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/common/git_revision.h)
-add_dependencies(marian marian_version) # marian must depend on it so that it gets created first
+# (generated by nix package instead)
+
# make sure all local dependencies are installed first before this is built
add_dependencies(marian 3rd_party_installs)
diff --git a/cmake/GetVersionFromFile.cmake b/cmake/GetVersionFromFile.cmake
index 83b7975..71cd861 100644
--- a/cmake/GetVersionFromFile.cmake
+++ b/cmake/GetVersionFromFile.cmake
@@ -23,10 +23,8 @@ else()
endif()
# Get current commit SHA from git
-execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
- OUTPUT_VARIABLE PROJECT_VERSION_GIT_SHA
- OUTPUT_STRIP_TRAILING_WHITESPACE)
+# (dummy value for nix package without the .git)
+set(PROJECT_VERSION_GIT_SHA 000000000000)
# Get partial versions into a list
string(REGEX MATCHALL "-.*$|[0-9]+" PROJECT_PARTIAL_VERSION_LIST
|