Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9792969023 | ||
|
|
f479989903 | ||
|
|
80994fc409 | ||
|
|
9231fff8c9 | ||
|
|
e77461733b | ||
|
|
d35fcb2558 | ||
|
|
76de8f4115 | ||
|
|
14733f4575 | ||
|
|
b5dc9ac015 | ||
|
|
404d390045 | ||
|
|
1e82342033 | ||
|
|
f6680093bc | ||
|
|
55ffd1ef80 | ||
|
|
5fbfd0bb68 | ||
|
|
84dd8dd351 |
9
.github/workflows/cmake.yml
vendored
9
.github/workflows/cmake.yml
vendored
@@ -15,7 +15,10 @@ jobs:
|
|||||||
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
|
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
|
||||||
# You can convert this to a matrix build if you need cross-platform coverage.
|
# You can convert this to a matrix build if you need cross-platform coverage.
|
||||||
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
|
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
|
||||||
runs-on: ubuntu-latest
|
strategy:
|
||||||
|
matrix:
|
||||||
|
platform: [ubuntu-latest,macos-latest]
|
||||||
|
runs-on: ${{ matrix.platform }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
@@ -36,7 +39,7 @@ jobs:
|
|||||||
- name: Package
|
- name: Package
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ${{github.workspace}}/artifacts
|
mkdir -p ${{github.workspace}}/artifacts
|
||||||
cp -rv ${{ env.nx_tzdb_dir }} ${{github.workspace}}/artifacts/
|
cp -Rv ${{ env.nx_tzdb_dir }} ${{github.workspace}}/artifacts/
|
||||||
|
|
||||||
- name: Version
|
- name: Version
|
||||||
run: |
|
run: |
|
||||||
@@ -45,5 +48,5 @@ jobs:
|
|||||||
- name: Upload
|
- name: Upload
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ env.nx_version }}
|
name: ${{ env.nx_version }}_${{ matrix.platform }}
|
||||||
path: artifacts/nx
|
path: artifacts/nx
|
||||||
|
|||||||
@@ -2,7 +2,18 @@ cmake_minimum_required(VERSION 3.10)
|
|||||||
|
|
||||||
project(tzdb2nx VERSION 1.0)
|
project(tzdb2nx VERSION 1.0)
|
||||||
|
|
||||||
|
option(TZDB2NX_ZONEINFO_DIR "Specify a custom zoneinfo directory containing time zone data you wish to use" "")
|
||||||
|
option(TZDB2NX_VERSION "Specify a custom zoneinfo version with the directory" "")
|
||||||
|
|
||||||
|
if (TZDB2NX_ZONEINFO_DIR AND NOT TZDB2NX_VERSION)
|
||||||
|
message(FATAL_ERROR "TZDB2NX_ZONEINFO_DIR was specified but TZDB2NX_VERSION was left undefined.")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
|
|
||||||
|
if (APPLE)
|
||||||
|
find_package(Intl REQUIRED)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_subdirectory(externals)
|
add_subdirectory(externals)
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|||||||
31
externals/tz/CMakeLists.txt
vendored
31
externals/tz/CMakeLists.txt
vendored
@@ -1,27 +1,49 @@
|
|||||||
set(TZ_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tz" CACHE PATH "Time zone source directory")
|
set(TZ_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tz" CACHE PATH "Time zone source directory")
|
||||||
set(TZ_DIR "${CMAKE_CURRENT_BINARY_DIR}/tz")
|
set(TZ_DIR "${CMAKE_CURRENT_BINARY_DIR}/tz")
|
||||||
set(TZ_TMP_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/tmpsrc")
|
set(TZ_TMP_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/tmpsrc")
|
||||||
set(TZ_ZONEINFO_DIR "${TZ_DIR}/usr/share/zoneinfo" CACHE PATH "Time zone info data directory")
|
|
||||||
set(TZIF_LIST_FILE "${CMAKE_CURRENT_BINARY_DIR}/tzif_list.txt" CACHE PATH "List of zone info files")
|
set(TZIF_LIST_FILE "${CMAKE_CURRENT_BINARY_DIR}/tzif_list.txt" CACHE PATH "List of zone info files")
|
||||||
|
if (TZDB2NX_ZONEINFO_DIR)
|
||||||
|
set(TZ_ZONEINFO_DIR "${TZDB2NX_ZONEINFO_DIR}" CACHE PATH "Time zone info data directory")
|
||||||
|
else()
|
||||||
|
set(TZ_ZONEINFO_DIR "${TZ_DIR}/usr/share/zoneinfo" CACHE PATH "Time zone info data directory")
|
||||||
|
endif()
|
||||||
|
|
||||||
find_program(GNU_MAKE make)
|
find_program(GNU_MAKE make)
|
||||||
if ("${GNU_MAKE}" STREQUAL "GNU_MAKE-NOTFOUND")
|
if (NOT GNU_MAKE)
|
||||||
message(FATAL_ERROR "GNU make not found")
|
message(FATAL_ERROR "GNU make not found")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
find_program(GIT_PROGRAM git)
|
||||||
|
if (NOT GIT_PROGRAM)
|
||||||
|
message(FATAL_ERROR "git program not found")
|
||||||
|
endif()
|
||||||
|
|
||||||
if (NOT EXISTS "${TZ_DIR}" OR NOT EXISTS "${TZIF_LIST_FILE}")
|
if (NOT EXISTS "${TZ_DIR}" OR NOT EXISTS "${TZIF_LIST_FILE}")
|
||||||
|
if (NOT TZDB2NX_ZONEINFO_DIR) # If a custom zoneinfo directory was specified
|
||||||
# tz's makefile can only build in-tree, so copy the whole source tree to a
|
# tz's makefile can only build in-tree, so copy the whole source tree to a
|
||||||
# separate directory before building.
|
# separate directory before building.
|
||||||
file(COPY ${TZ_SOURCE_DIR}/ DESTINATION ${TZ_TMP_SOURCE_DIR})
|
execute_process(
|
||||||
|
COMMAND
|
||||||
|
${GIT_PROGRAM} clone --depth 1 "file://${TZ_SOURCE_DIR}" "${TZ_TMP_SOURCE_DIR}"
|
||||||
|
COMMAND_ERROR_IS_FATAL ANY
|
||||||
|
)
|
||||||
|
|
||||||
|
if (APPLE)
|
||||||
|
set(TZ_MAKEFLAGS "LDLIBS=${Intl_LIBRARY}")
|
||||||
|
else()
|
||||||
|
set(TZ_MAKEFLAGS)
|
||||||
|
endif()
|
||||||
|
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND
|
COMMAND
|
||||||
${GNU_MAKE} DESTDIR=${TZ_DIR} install
|
${GNU_MAKE} DESTDIR=${TZ_DIR} ${TZ_MAKEFLAGS} install
|
||||||
WORKING_DIRECTORY
|
WORKING_DIRECTORY
|
||||||
${TZ_TMP_SOURCE_DIR}
|
${TZ_TMP_SOURCE_DIR}
|
||||||
COMMAND_ERROR_IS_FATAL ANY
|
COMMAND_ERROR_IS_FATAL ANY
|
||||||
)
|
)
|
||||||
|
|
||||||
|
unset(TZ_MAKEFLAGS)
|
||||||
|
|
||||||
# Step taken by Arch Linux packaging, but Nintendo apparently skips it
|
# Step taken by Arch Linux packaging, but Nintendo apparently skips it
|
||||||
# execute_process(
|
# execute_process(
|
||||||
# COMMAND
|
# COMMAND
|
||||||
@@ -30,6 +52,7 @@ if (NOT EXISTS "${TZ_DIR}" OR NOT EXISTS "${TZIF_LIST_FILE}")
|
|||||||
# "${TZDB_LOCATION}"
|
# "${TZDB_LOCATION}"
|
||||||
# COMMAND_ERROR_IS_FATAL ANY
|
# COMMAND_ERROR_IS_FATAL ANY
|
||||||
# )
|
# )
|
||||||
|
endif()
|
||||||
|
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND
|
COMMAND
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
find_program(GIT_PROGRAM git)
|
find_program(GIT_PROGRAM git)
|
||||||
if ("${GIT_PROGRAM}" STREQUAL "GIT_PROGRAM-NOTFOUND")
|
if (NOT GIT_PROGRAM)
|
||||||
message(FATAL_ERROR "git program not found")
|
message(FATAL_ERROR "git program not found")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_program(GNU_DATE date)
|
find_program(GNU_DATE date)
|
||||||
if ("${GNU_DATE}" STREQUAL "GNU_DATE-NOTFOUND")
|
if (NOT GNU_DATE)
|
||||||
message(FATAL_ERROR "date program not found")
|
message(FATAL_ERROR "date program not found")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -13,6 +13,9 @@ set(NX_ZONEINFO_DIR "${NX_TZDB_DIR}/zoneinfo")
|
|||||||
|
|
||||||
set(TZDB_VERSION_FILE ${TZ_SOURCE_DIR}/NEWS)
|
set(TZDB_VERSION_FILE ${TZ_SOURCE_DIR}/NEWS)
|
||||||
|
|
||||||
|
if (NOT "${TZDB2NX_VERSION}" STREQUAL "")
|
||||||
|
set(TZDB_VERSION "${TZDB2NX_VERSION}\n")
|
||||||
|
else()
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND
|
COMMAND
|
||||||
${GIT_PROGRAM} log --pretty=%at -n1 NEWS
|
${GIT_PROGRAM} log --pretty=%at -n1 NEWS
|
||||||
@@ -36,6 +39,7 @@ execute_process(
|
|||||||
OUTPUT_VARIABLE
|
OUTPUT_VARIABLE
|
||||||
TZDB_VERSION
|
TZDB_VERSION
|
||||||
COMMAND_ERROR_IS_FATAL ANY)
|
COMMAND_ERROR_IS_FATAL ANY)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(NX_VERSION_FILE ${NX_TZDB_DIR}/version.txt)
|
set(NX_VERSION_FILE ${NX_TZDB_DIR}/version.txt)
|
||||||
file(WRITE ${NX_VERSION_FILE} "${TZDB_VERSION}")
|
file(WRITE ${NX_VERSION_FILE} "${TZDB_VERSION}")
|
||||||
|
|||||||
@@ -122,6 +122,8 @@ int main(int argc, char *argv[]) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete[] buf;
|
||||||
|
|
||||||
std::vector<u_int8_t> output_buffer;
|
std::vector<u_int8_t> output_buffer;
|
||||||
tzif_data->ReformatNintendo(output_buffer);
|
tzif_data->ReformatNintendo(output_buffer);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user