build: invoke metaglot directly instead of via uv tool run
This commit is contained in:
1 parent
a123b680ff
commit
3ef9d4eb42
3 files changed
+11
-11
No files matched your search
+9
-9
@@ -99,16 +99,16 @@ set (EXE_NAME scwpic)
|
||||
file (GLOB SCWPIC_TS_FILES locales/app/*.ts)
|
||||
set (SCWPIC_CPP_FILES_FOR_I18N ${SCWPIC_CPP_FILES})
|
||||
|
||||
find_program (UV_EXECUTABLE uv)
|
||||
if (NOT UV_EXECUTABLE)
|
||||
message (FATAL_ERROR "uv is required to run the metaglot tool, install it from https://docs.astral.sh/uv/")
|
||||
find_program (METAGLOT_EXECUTABLE metaglot)
|
||||
if (NOT METAGLOT_EXECUTABLE)
|
||||
message (FATAL_ERROR "metaglot is required to render the localized metadata, install it from https://github.com/SarasasChipWorkshop/metaglot")
|
||||
endif ()
|
||||
|
||||
if (WIN32)
|
||||
# Setup Windows RC files
|
||||
set (SCWPIC_RC_TEMPLATE_FILE ${CMAKE_CURRENT_BINARY_DIR}/sarasacw-picture.rc.in)
|
||||
execute_process (
|
||||
COMMAND ${UV_EXECUTABLE} tool run metaglot render rc
|
||||
COMMAND ${METAGLOT_EXECUTABLE} render rc
|
||||
--manifest ${CMAKE_SOURCE_DIR}/dist/sarasacw-picture.rc.in.toml
|
||||
--po ${CMAKE_SOURCE_DIR}/locales/winrc/*.po
|
||||
--template ${CMAKE_SOURCE_DIR}/dist/sarasacw-picture.rc.in.liquid
|
||||
@@ -240,7 +240,7 @@ if (WIN32)
|
||||
# Setup Inno Setup script file
|
||||
set (SCWPIC_INNO_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/inno-metadata)
|
||||
execute_process (
|
||||
COMMAND ${UV_EXECUTABLE} tool run metaglot render inno
|
||||
COMMAND ${METAGLOT_EXECUTABLE} render inno
|
||||
--manifest ${CMAKE_SOURCE_DIR}/dist/scwpic.iss.in.toml
|
||||
--po ${CMAKE_SOURCE_DIR}/locales/inno/*.po
|
||||
--iss-template ${CMAKE_SOURCE_DIR}/dist/scwpic.iss.in.liquid
|
||||
@@ -259,7 +259,7 @@ if (WIN32)
|
||||
# referenced by the manifest are not provided (marked with TODO comments).
|
||||
set (SCWPIC_MSIX_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/msix-metadata)
|
||||
execute_process (
|
||||
COMMAND ${UV_EXECUTABLE} tool run metaglot render msix
|
||||
COMMAND ${METAGLOT_EXECUTABLE} render msix
|
||||
--manifest ${CMAKE_SOURCE_DIR}/dist/AppxManifest.xml.in.toml
|
||||
--po ${CMAKE_SOURCE_DIR}/locales/msix/*.po
|
||||
--manifest-template ${CMAKE_SOURCE_DIR}/dist/AppxManifest.xml.in.liquid
|
||||
@@ -284,7 +284,7 @@ elseif (APPLE)
|
||||
set (SCWPIC_PLIST_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/plist-metadata)
|
||||
# Render Info.plist and its strings.
|
||||
execute_process (
|
||||
COMMAND ${UV_EXECUTABLE} tool run metaglot render plist
|
||||
COMMAND ${METAGLOT_EXECUTABLE} render plist
|
||||
--manifest ${CMAKE_SOURCE_DIR}/dist/Info.plist.in.toml
|
||||
--po ${CMAKE_SOURCE_DIR}/locales/plist/*.po
|
||||
--plist-template ${CMAKE_SOURCE_DIR}/dist/Info.plist.in.liquid
|
||||
@@ -331,7 +331,7 @@ elseif (UNIX)
|
||||
# generate and install desktop entry file
|
||||
set (SCWPIC_DESKTOP_FILE ${CMAKE_CURRENT_BINARY_DIR}/org.sarasaschipworkshop.picture.desktop)
|
||||
execute_process (
|
||||
COMMAND ${UV_EXECUTABLE} tool run metaglot render desktop
|
||||
COMMAND ${METAGLOT_EXECUTABLE} render desktop
|
||||
--manifest ${CMAKE_SOURCE_DIR}/dist/org.sarasaschipworkshop.picture.desktop.toml
|
||||
--po ${CMAKE_SOURCE_DIR}/locales/desktop/*.po
|
||||
--template ${CMAKE_SOURCE_DIR}/dist/org.sarasaschipworkshop.picture.desktop.liquid
|
||||
@@ -350,7 +350,7 @@ elseif (UNIX)
|
||||
# generate and install app metadata file for appstream (and some other stuff using this metadata like snapcraft)
|
||||
set (SCWPIC_METAINFO_FILE ${CMAKE_CURRENT_BINARY_DIR}/org.sarasaschipworkshop.picture.metainfo.xml)
|
||||
execute_process (
|
||||
COMMAND ${UV_EXECUTABLE} tool run metaglot render appstream
|
||||
COMMAND ${METAGLOT_EXECUTABLE} render appstream
|
||||
--manifest ${CMAKE_SOURCE_DIR}/dist/org.sarasaschipworkshop.picture.metainfo.xml.toml
|
||||
--po ${CMAKE_SOURCE_DIR}/locales/appstream/*.po
|
||||
--template ${CMAKE_SOURCE_DIR}/dist/org.sarasaschipworkshop.picture.metainfo.xml.liquid
|
||||
|
||||
@@ -35,7 +35,7 @@ The new feature request of this application are freezed now because this applica
|
||||
Current state, we need:
|
||||
|
||||
- `cmake`: as the build system.
|
||||
- `python3`, `uv` and [`metaglot`](https://github.com/SarasasChipWorkshop/metaglot): as the metadata localization processor.
|
||||
- `python3` and [`metaglot`](https://github.com/SarasasChipWorkshop/metaglot): as the metadata localization processor. An isolated install via `uv tool` (as opposed to a global install like pip) is recommended.
|
||||
- `qt6` with `qt6-svg` and `qt6-tools`: since the app is using Qt.
|
||||
- `libexiv2`: able to display more image metadata. (optional, but recommended)
|
||||
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ SCW 照片查看器是[菠萝看图](https://github.com/BLumia/pineapple-picture
|
||||
当前状态,我们需要先确保如下依赖可用:
|
||||
|
||||
- `cmake`:我们所使用的构建系统
|
||||
- `python3`、`uv` 和 [`metaglot`](https://github.com/SarasasChipWorkshop/metaglot):我们所使用的元数据本地化处理器
|
||||
- `python3` 和 [`metaglot`](https://github.com/SarasasChipWorkshop/metaglot):我们所使用的元数据本地化处理器,推荐使用 `uv tool` 进行隔离式安装(相较于 pip 那种全局式安装)
|
||||
- 包含 `qt6-svg` 与 `qt6-tools` 组件的 `qt6`:此应用基于 Qt
|
||||
- `libexiv2`:用以获取和显示更多的图像元信息(可选,推荐)
|
||||
|
||||
|
||||
Reference in new issue
Block a user