nixpkgs/pkgs/by-name/tr/translatelocally/version_without_git.patch
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

67 lines
3.2 KiB
Diff

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