From 362f8acb154bae5cfde02e41637fa57096734622 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Mon, 25 Jan 2021 15:09:30 +0100 Subject: [PATCH 1/4] Reenabled mac CI and trying to debug the capstone issue --- .github/workflows/build.yml | 44 ++++++++++++++++++------------------- CMakeLists.txt | 4 +++- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 20676d4f9..615c27ba3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -129,29 +129,29 @@ jobs: path: | build/*.msi -# macos-build: -# runs-on: macos-11.0 -# name: 🍎 macOS 11.0 -# steps: + macos-build: + runs-on: macos-11.0 + name: 🍎 macOS 11.0 + steps: -# - name: 🧰 Checkout -# uses: actions/checkout@v2 -# with: -# fetch-depth: 0 + - name: 🧰 Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 -# - name: ⬇️ Install dependencies -# run: | -# brew bundle --no-lock --file dist/Brewfile + - name: ⬇️ Install dependencies + run: | + brew bundle --no-lock --file dist/Brewfile -# - name: ✋ Build -# run: | -# mkdir build -# cd build -# CC=$(brew --prefix llvm)/bin/clang CXX=$(brew --prefix llvm)/bin/clang++ PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig":"$(brew --prefix)/lib/pkgconfig" cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCREATE_BUNDLE=ON -DCREATE_PACKAGE=ON .. -# make -j 4 package + - name: ✋ Build + run: | + mkdir build + cd build + CC=$(brew --prefix llvm)/bin/clang CXX=$(brew --prefix llvm)/bin/clang++ PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig":"$(brew --prefix)/lib/pkgconfig" cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCREATE_BUNDLE=ON -DCREATE_PACKAGE=ON .. + make -j 4 package -# - name: 📦 Upload DMG -# uses: actions/upload-artifact@v2 -# with: -# name: macOS DMG -# path: build/*.dmg + - name: 📦 Upload DMG + uses: actions/upload-artifact@v2 + with: + name: macOS DMG + path: build/*.dmg diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a2c0320b..d2683eb83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ set(PLUGINS # List extra magic databases to compile here set(MAGICDBS - nintendo_magic + magic_dbs/nintendo_magic ) createMagicDbList() @@ -29,6 +29,8 @@ add_subdirectory(plugins/libimhex) # Add include directories include_directories(include ${CRYPTO_INCLUDE_DIRS} ${CAPSTONE_INCLUDE_DIRS} ${MAGIC_INCLUDE_DIRS} ${Python_INCLUDE_DIRS}) +message(${CAPSTONE_INCLUDE_DIRS}) + detectOS() detectArch() From 27e5f8eeb6410bca0c8aa9b2ff95337e8400fbb9 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Mon, 25 Jan 2021 15:19:56 +0100 Subject: [PATCH 2/4] Fixed capstone build issue on mac On mac, capstone's include path is `include/capstone` instead of just `include`... --- CMakeLists.txt | 2 -- include/helpers/disassembler.hpp | 4 ++++ include/views/view_disassembler.hpp | 2 -- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d2683eb83..7bc791408 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,8 +29,6 @@ add_subdirectory(plugins/libimhex) # Add include directories include_directories(include ${CRYPTO_INCLUDE_DIRS} ${CAPSTONE_INCLUDE_DIRS} ${MAGIC_INCLUDE_DIRS} ${Python_INCLUDE_DIRS}) -message(${CAPSTONE_INCLUDE_DIRS}) - detectOS() detectArch() diff --git a/include/helpers/disassembler.hpp b/include/helpers/disassembler.hpp index 0ff8b96bb..03f6a8bcd 100644 --- a/include/helpers/disassembler.hpp +++ b/include/helpers/disassembler.hpp @@ -1,6 +1,10 @@ #pragma once +#if __has_include() #include +#else +#include +#endif #include namespace hex { diff --git a/include/views/view_disassembler.hpp b/include/views/view_disassembler.hpp index 054082e63..8349e67c4 100644 --- a/include/views/view_disassembler.hpp +++ b/include/views/view_disassembler.hpp @@ -4,8 +4,6 @@ #include "helpers/disassembler.hpp" -#include - #include #include #include From 896c13a612d08a438fd0bdeb7934709062b6e5ab Mon Sep 17 00:00:00 2001 From: WerWolv Date: Mon, 25 Jan 2021 15:27:33 +0100 Subject: [PATCH 3/4] Fixed magic include dirs not defined on mac --- cmake/build_helpers.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/build_helpers.cmake b/cmake/build_helpers.cmake index 8e403139a..4b63a1797 100644 --- a/cmake/build_helpers.cmake +++ b/cmake/build_helpers.cmake @@ -37,10 +37,12 @@ macro(findLibraries) find_package(PkgConfig REQUIRED) pkg_search_module(CRYPTO libcrypto) - if(NOT CRYPTO_FOUND) find_library(CRYPTO crypto REQUIRED) + else() + set(CRYPTO_INCLUDE_DIRS ${CRYPTO_INCLUDEDIR}) endif() + pkg_search_module(CAPSTONE REQUIRED capstone) find_package(OpenGL REQUIRED) @@ -60,6 +62,8 @@ macro(findLibraries) pkg_search_module(MAGIC libmagic) if(NOT MAGIC_FOUND) find_library(MAGIC magic REQUIRED) + else() + set(MAGIC_INCLUDE_DIRS ${MAGIC_INCLUDEDIR}) endif() endmacro() From a1b937b1fbe6c847799610d38a8d6087f940bea7 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Mon, 25 Jan 2021 15:49:20 +0100 Subject: [PATCH 4/4] Included direct link to nightlies in readme and removed old macOS note --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8fd78abee..e69f11279 100644 --- a/README.md +++ b/README.md @@ -95,9 +95,15 @@ For format patterns, includable libraries and magic files, check out the [ImHex- ## Nightly builds -See latest nightly builds on the artifacts result of the Build action [here](https://github.com/WerWolv/ImHex/actions?query=workflow%3ABuild). +Nightlies are available via GitHub Actions [here](https://github.com/WerWolv/ImHex/actions?query=workflow%3ABuild). -NOTE: **We currently only provide nightly builds for macOS (x86_64)** +- Windows • __x86_64__ + - [MSI Installer](https://nightly.link/WerWolv/ImHex/workflows/build/master/Windows%20Installer.zip) + - [Portable ZIP](https://nightly.link/WerWolv/ImHex/workflows/build/master/Windows%20Portable%20ZIP.zip) +- MacOS • __x86_64__ + - [DMG](https://nightly.link/WerWolv/ImHex/workflows/build/master/macOS%20DMG.zip) +- Linux • __x86_64__ + - [ELF](https://nightly.link/WerWolv/ImHex/workflows/build/master/Linux%20ELF.zip) ## Compiling