diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..b5be26491 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,172 @@ +name: Build + +on: + push: + pull_request: + +env: + BUILD_TYPE: Release + +jobs: + + + lin: + runs-on: ubuntu-20.04 + name: 🐧 Ubuntu 20.04 + steps: + + - name: 🧰 Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: ⬇️ Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential \ + gcc-10 \ + g++-10 \ + pkg-config \ + cmake \ + make \ + libglfw3-dev \ + libglm-dev \ + libmagic-dev \ + libssl-dev \ + libcapstone-dev \ + llvm-dev \ + nlohmann-json3-dev \ + python3-dev \ + + - name: ✋ Build + run: | + mkdir build + cd build + CC=gcc-10 CXX=g++-10 cmake .. + make -j 4 + + + win-manual: + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + include: + - { msystem: MINGW64, arch: x86_64 } + #- { msystem: MINGW32, arch: i686 } # currently fail + name: 🟪 ${{ matrix.msystem }} · ${{ matrix.arch }} · manual + defaults: + run: + shell: msys2 {0} + env: + MINGW_INSTALLS: ${{ matrix.msystem }} + steps: + + - name: 🧰 Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: 🟪 Setup MSYS2 + uses: msys2/setup-msys2@v2 + with: + msystem: ${{ matrix.msystem }} + update: true + install: > + mingw-w64-${{ matrix.arch }}-gcc + mingw-w64-${{ matrix.arch }}-cmake + mingw-w64-${{ matrix.arch }}-make + mingw-w64-${{ matrix.arch }}-capstone + mingw-w64-${{ matrix.arch }}-glfw + mingw-w64-${{ matrix.arch }}-glm + mingw-w64-${{ matrix.arch }}-file + mingw-w64-${{ matrix.arch }}-llvm + mingw-w64-${{ matrix.arch }}-nlohmann-json + mingw-w64-${{ matrix.arch }}-openssl + mingw-w64-${{ matrix.arch }}-polly + mingw-w64-${{ matrix.arch }}-python + + - name: ✋ Build + run: | + mkdir build + cd build + cmake -G "MinGW Makefiles" .. + mingw32-make -j 4 + + + win-makepkg: + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + include: + - { msystem: MINGW64, arch: x86_64 } + #- { msystem: MINGW32, arch: i686 } # currently fail + name: 🟪 ${{ matrix.msystem }} · ${{ matrix.arch }} · makepkg + defaults: + run: + shell: msys2 {0} + steps: + + - run: git config --global core.autocrlf input + shell: bash + + - name: 🧰 Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: 🟪 Setup MSYS2 + uses: msys2/setup-msys2@v2 + with: + msystem: ${{ matrix.msystem }} + update: true + install: > + base-devel + mingw-w64-${{ matrix.arch }}-toolchain + + - name: 🔧 Build + run: | + cd msys2 + makepkg-mingw --noconfirm --noprogressbar -sCLf + env: + MINGW_INSTALLS: ${{ matrix.msystem }} + + - name: '📤 Upload artifact: package' + uses: actions/upload-artifact@v2 + with: + path: msys2/*.zst + + + win-test: + needs: win-makepkg + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + include: + - { msystem: MINGW64, arch: x86_64 } + #- { msystem: MINGW32, arch: i686 } # currently fail + name: 🟪 ${{ matrix.msystem }} · ${{ matrix.arch }} · test + defaults: + run: + shell: msys2 {0} + steps: + + - name: 🟪 Setup MSYS2 + uses: msys2/setup-msys2@v2 + with: + msystem: ${{ matrix.msystem }} + update: true + + - name: '📥 Download artifacts' + uses: actions/download-artifact@v2 + + - name: ⚙️ Install + run: | + pacman -U --noconfirm --noprogressbar artifact/*.zst + + - name: ▶️ Test + run: | + which ImHex diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml deleted file mode 100644 index ef2328afc..000000000 --- a/.github/workflows/build_linux.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: build-linux - -on: - push: - pull_request: - -env: - BUILD_TYPE: Release - -jobs: - build: - runs-on: ubuntu-20.04 - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup - shell: bash - run: | - sudo apt-get update - sudo apt-get install -y build-essential \ - gcc-10 \ - g++-10 \ - pkg-config \ - cmake \ - make \ - libglfw3-dev \ - libglm-dev \ - libmagic-dev \ - libssl-dev \ - libcapstone-dev \ - llvm-dev \ - nlohmann-json3-dev \ - python3-dev \ - - - name: Build - shell: bash - run: | - mkdir build - cd build - CC=gcc-10 CXX=g++-10 cmake .. - make -j 4 diff --git a/.github/workflows/build_win.yml b/.github/workflows/build_win.yml deleted file mode 100644 index 399479ac7..000000000 --- a/.github/workflows/build_win.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: build-win - -on: - push: - pull_request: - -env: - BUILD_TYPE: Release - -jobs: - build: - runs-on: windows-latest - strategy: - fail-fast: false - matrix: - include: [ - { msystem: MINGW64, arch: x86_64 }, - # currently fail - #{ msystem: MINGW32, arch: i686 } - ] - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup - uses: msys2/setup-msys2@v2 - with: - msystem: ${{ matrix.msystem }} - install: mingw-w64-${{ matrix.arch }}-gcc mingw-w64-${{ matrix.arch }}-cmake mingw-w64-${{ matrix.arch }}-make mingw-w64-${{ matrix.arch }}-capstone mingw-w64-${{ matrix.arch }}-glfw mingw-w64-${{ matrix.arch }}-glm mingw-w64-${{ matrix.arch }}-file mingw-w64-${{ matrix.arch }}-llvm mingw-w64-${{ matrix.arch }}-nlohmann-json mingw-w64-${{ matrix.arch }}-openssl mingw-w64-${{ matrix.arch }}-polly mingw-w64-${{ matrix.arch }}-python - update: true - - - name: Build - shell: msys2 {0} - run: | - mkdir build - cd build - cmake -G "MinGW Makefiles" .. - mingw32-make -j 4 diff --git a/CMakeLists.txt b/CMakeLists.txt index d255ead40..b00c96465 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,4 +96,6 @@ endif (WIN32) if (UNIX) target_link_libraries(ImHex libglfw.so libmagic.so libcrypto.so libdl.so libcapstone.so ${llvm_libs} ${Python_LIBRARIES} nlohmann_json::nlohmann_json) -endif (UNIX) \ No newline at end of file +endif (UNIX) + +install(TARGETS ImHex DESTINATION bin) diff --git a/README.md b/README.md index 0e8820bd1..fa9cc820a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ +

+ 'Build' workflow Status +

+ # ImHex A Hex Editor for Reverse Engineers, Programmers and people that value their eye sight when working at 3 AM. @@ -6,9 +11,11 @@ A Hex Editor for Reverse Engineers, Programmers and people that value their eye If you like my work, consider supporting me on GitHub Sponsors, Patreon or PayPal. Thanks a lot! +

GitHub donate button Patreon donate button PayPal donate button +

## Features diff --git a/msys2/PKGBUILD b/msys2/PKGBUILD new file mode 100644 index 000000000..b9bf2fae4 --- /dev/null +++ b/msys2/PKGBUILD @@ -0,0 +1,46 @@ +_realname=ImHex +pkgbase=mingw-w64-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" +pkgver=ci +pkgrel=1 +pkgdesc="${_realname}: a Hex Editor for Reverse Engineers, Programmers and people that value their eye sight when working at 3 AM (mingw-w64)" +arch=('any') +url="https://github.com/WerWolv/ImHex" +license=('GPLv2') +depends=("${MINGW_PACKAGE_PREFIX}-python") +makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" + "${MINGW_PACKAGE_PREFIX}-cmake" + "${MINGW_PACKAGE_PREFIX}-make" + "${MINGW_PACKAGE_PREFIX}-capstone" + "${MINGW_PACKAGE_PREFIX}-glfw" + "${MINGW_PACKAGE_PREFIX}-glm" + "${MINGW_PACKAGE_PREFIX}-file" + "${MINGW_PACKAGE_PREFIX}-llvm" + "${MINGW_PACKAGE_PREFIX}-nlohmann-json" + "${MINGW_PACKAGE_PREFIX}-openssl" + "${MINGW_PACKAGE_PREFIX}-polly" + "${MINGW_PACKAGE_PREFIX}-python") + +source=() +sha256sums=() + +build() { + cd "${srcdir}"/../.. + mkdir build + cd build + export BUILD_TYPE='Release' + MSYS2_ARG_CONV_EXCL=- cmake \ + -G "MinGW Makefiles" \ + -DCMAKE_INSTALL_PREFIX="${MINGW_PREFIX}" \ + ../ + mingw32-make +} + +package() { + cd "${srcdir}"/../../build + mingw32-make DESTDIR="${pkgdir}" install + + _licenses="${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}" + mkdir -p "${_licenses}" + install -m 644 ../LICENSE "${_licenses}" +}