Skip to content

Commit

Permalink
Update to libloot v0.21.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Ortham committed Sep 13, 2023
1 parent 013d56f commit f31ff5c
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 16 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,23 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y --no-upgrade \
g++-8 \
libhttp-parser-dev \
libssh2-1-dev
g++-10 \
libtbb-dev
- name: Get ICU
id: get-icu
run: |
wget https://github.com/unicode-org/icu/releases/download/release-71-1/icu4c-71_1-Ubuntu20.04-x64.tgz
tar -xf icu4c-71_1-Ubuntu20.04-x64.tgz
echo "root=${{ github.workspace }}/icu/usr/local" >> $GITHUB_OUTPUT
- name: Run CMake
run: |
mkdir build
cd build
export CXX="g++-8" CC="gcc-8"
cmake .. -DCPACK_PACKAGE_VERSION="${{ steps.get-version.outputs.version }}"
export CXX="g++-10" CC="gcc-10"
cmake .. -DCPACK_PACKAGE_VERSION="${{ steps.get-version.outputs.version }}" -DICU_ROOT="${{ steps.get-icu.outputs.root }}"
make all
- name: Build archive
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,23 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y \
g++-8 \
libhttp-parser-dev \
libssh2-1-dev
g++-10 \
libtbb-dev
- name: Get ICU
id: get-icu
run: |
wget https://github.com/unicode-org/icu/releases/download/release-71-1/icu4c-71_1-Ubuntu20.04-x64.tgz
tar -xf icu4c-71_1-Ubuntu20.04-x64.tgz
echo "root=${{ github.workspace }}/icu/usr/local" >> $GITHUB_OUTPUT
- name: Run CMake
run: |
mkdir build
cd build
export CXX="g++-8" CC="gcc-8"
cmake .. -DCPACK_PACKAGE_VERSION="${{ steps.get-version.outputs.version }}"
export CXX="g++-10" CC="gcc-10"
cmake .. -DCPACK_PACKAGE_VERSION="${{ steps.get-version.outputs.version }}" -DICU_ROOT="${{ steps.get-icu.outputs.root }}"
make all
- name: Build archive
Expand Down
23 changes: 17 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.4)
cmake_policy(SET CMP0015 NEW)
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif()
project(metadata-validator)
include(ExternalProject)

Expand Down Expand Up @@ -30,24 +32,33 @@ configure_file("${CMAKE_SOURCE_DIR}/src/version.cpp.in"
@ONLY)

##############################
# libloot
# External projects
##############################

if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
find_package(ICU 71.1 EXACT REQUIRED COMPONENTS data uc)
find_package(TBB REQUIRED)
endif()

if(NOT DEFINED LIBLOOT_URL)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
if(CMAKE_GENERATOR_PLATFORM STREQUAL "Win32")
set(LIBLOOT_URL "https://github.com/loot/libloot/releases/download/0.18.0/libloot-0.18.0-0-g632b85c_0.18.0-win32.7z")
set(LIBLOOT_URL "https://github.com/loot/libloot/releases/download/0.21.0/libloot-0.21.0-win32.7z")
set(LIBLOOT_HASH "SHA256=b7ea3369e4eae60be38c3d7f7b9194e8d6284e78dc862d13f0644b990b44011a")
else()
set(LIBLOOT_URL "https://github.com/loot/libloot/releases/download/0.18.0/libloot-0.18.0-0-g632b85c_0.18.0-win64.7z")
set(LIBLOOT_URL "https://github.com/loot/libloot/releases/download/0.21.0/libloot-0.21.0-win64.7z")
set(LIBLOOT_HASH "SHA256=7a1ed5a5b9ecec748f2dde43d73786f25b844874e116d86ddb603ede5933b5db")
endif()
else()
set(LIBLOOT_URL "https://github.com/loot/libloot/releases/download/0.18.0/libloot-0.18.0-0-g632b85c_0.18.0-Linux.tar.xz")
set(LIBLOOT_URL "https://github.com/loot/libloot/releases/download/0.21.0/libloot-0.21.0-Linux.tar.xz")
set(LIBLOOT_HASH "SHA256=2ce58a64380ef436ea5d01fa647ee6cfeb23f76b2468162bf099f4de07e31ea3")
endif()
endif()

ExternalProject_Add(libloot
PREFIX "external"
URL ${LIBLOOT_URL}
URL_HASH ${LIBLOOT_HASH}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND "")
Expand Down Expand Up @@ -85,7 +96,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")

target_link_libraries(metadata_validator PRIVATE ${LIBLOOT_STATIC_LIBRARY})
else()
target_link_libraries(metadata_validator PRIVATE ${LIBLOOT_SHARED_LIBRARY} pthread http_parser ssh2 stdc++fs)
target_link_libraries(metadata_validator PRIVATE ${LIBLOOT_SHARED_LIBRARY} pthread stdc++fs ICU::data ICU::uc TBB::tbb)
endif()

if(CMAKE_COMPILER_IS_GNUCXX)
Expand Down

0 comments on commit f31ff5c

Please sign in to comment.