PKGBUILD 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # Maintainer: KokaKiwi <kokakiwi+aur@kokakiwi.net>
  2. # Contributor: George Rawlinson <george@rawlinson.net.nz>
  3. # Config
  4. ((DISABLE_DOTNET)) || optdepends+=('dotnet-runtime: support for .NET scripts') makedepends+=('dotnet-runtime')
  5. _pkgname=ImHex
  6. pkgname=${_pkgname,,}
  7. pkgver=1.32.2
  8. pkgrel=1
  9. pkgdesc='A Hex Editor for Reverse Engineers, Programmers and people that value their eye sight when working at 3 AM'
  10. url='https://imhex.werwolv.net'
  11. license=('GPL2')
  12. arch=('x86_64')
  13. depends=('glfw' 'mbedtls' 'curl' 'dbus'
  14. 'freetype2' 'file' 'hicolor-icon-theme' 'xdg-desktop-portal'
  15. 'fmt' 'yara' 'capstone')
  16. makedepends+=('git' 'cmake'
  17. 'llvm' 'librsvg' 'nlohmann-json'
  18. 'python' 'cli11')
  19. provides=('imhex-patterns')
  20. conflicts=('imhex-patterns-git')
  21. source=("imhex-${pkgver}.tar.gz::https://github.com/WerWolv/ImHex/releases/download/v${pkgver}/Full.Sources.tar.gz"
  22. "imhex-patterns.tar.gz::https://github.com/WerWolv/ImHex-Patterns/archive/refs/tags/ImHex-v${pkgver}.tar.gz"
  23. 0001-fix-cmake-Fix-when-multiple-.NET-packages-are-instal.patch
  24. 0002-fix-main-Handle-different-LLVM-version.patch)
  25. sha512sums=('72e3fda050220fa9098f4ad9ed1777db565c81549daf09a5d113e35036d26780ab50c5a45ddf97ec6daa22e832a0d0b916097082706bd7314d56c2f97abcbb11'
  26. '3f6d1c874e1d6bc4e2e035361c5c7c1da4374cfcaeb6123f187302cacf91ce781db3f4fbe74e259e1bdb18418987fe48067365dcc3324190fbadcaf0b5ab9333'
  27. 'af7a0b341a3ef5cb99b3a7d4f522610fa32d7af7034334ef6b88601d6d69c4749d71094ed6ddd155428feade244ded369b5f24f9ab0eec4ce1a0887eff6310ee'
  28. '702abff3858d77c617569c428a87521208901cf743b52f537b904ea484d58b6272558d6eb922a178b8e5e7f325271851d2fe08bfc8870d6c876def0c0ad79206')
  29. options=(!lto !strip)
  30. prepare() {
  31. cd "${_pkgname}"
  32. if ((!DISABLE_DOTNET)); then
  33. patch -p1 < "$srcdir/0001-fix-cmake-Fix-when-multiple-.NET-packages-are-instal.patch"
  34. fi
  35. patch -p1 < "$srcdir/0002-fix-main-Handle-different-LLVM-version.patch"
  36. }
  37. build() {
  38. export CXXFLAGS="$CXXFLAGS -Wno-inconsistent-missing-override"
  39. cmake -B build -S "${_pkgname}" \
  40. -Wno-dev \
  41. -D CMAKE_BUILD_TYPE=Release \
  42. -D CMAKE_INSTALL_PREFIX=/usr \
  43. -D CMAKE_SKIP_RPATH=ON \
  44. -D IMHEX_OFFLINE_BUILD=ON \
  45. -D IMHEX_IGNORE_BAD_CLONE=ON \
  46. -D IMHEX_STRIP_RELEASE=OFF \
  47. -D IMHEX_STRICT_WARNINGS=OFF \
  48. -D IMHEX_BUNDLE_DOTNET=OFF \
  49. -D USE_SYSTEM_LLVM=ON \
  50. -D USE_SYSTEM_YARA=ON \
  51. -D USE_SYSTEM_FMT=ON \
  52. -D USE_SYSTEM_NLOHMANN_JSON=ON \
  53. -D USE_SYSTEM_CAPSTONE=ON \
  54. -D USE_SYSTEM_CLI11=ON \
  55. -D IMHEX_VERSION="$pkgver"
  56. cmake --build build
  57. }
  58. package() {
  59. DESTDIR="$pkgdir" cmake --install build
  60. # Patterns
  61. install -dm0755 "$pkgdir/usr/share/imhex"
  62. cp -r -t "$pkgdir/usr/share/imhex" \
  63. "$srcdir/ImHex-Patterns-ImHex-v${pkgver}"/{constants,encodings,includes,magic,nodes,patterns,plugins,scripts,tests,themes,tips,yara}
  64. # Desktop file(s)
  65. install -Dm0644 "${_pkgname}/resources/icon.svg" "$pkgdir/usr/share/icons/hicolor/scalable/apps/imhex.svg"
  66. for size in 32 48 64 128 256; do
  67. install -dm0755 "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps"
  68. rsvg-convert -a -f png -w $size -o "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/imhex.png" \
  69. "${_pkgname}/resources/icon.svg"
  70. done
  71. # Documentation
  72. install -Dm0644 -t "$pkgdir/usr/share/doc/$pkgname" \
  73. "${_pkgname}/README.md"
  74. }