|
| 1 | +# Maintainer: wingsummer <wing-summer@qq.com> |
| 2 | + |
| 3 | +pkgname=winghexexplorer2-git |
| 4 | +pkgver=2.2.3.r16.g2ea09fa |
| 5 | +pkgrel=1 |
| 6 | +pkgdesc='一个自由强大跨平台的十六进制编辑器(每日构建版) / A free, powerful, cross-platform hex editor (Nightly Builds)' |
| 7 | +url="https://github.com/Wing-summer/WingHexExplorer2" |
| 8 | + |
| 9 | +arch=(x86_64 aarch64) |
| 10 | +license=(AGPL-3.0-only) |
| 11 | +conflicts=(winghexexplorer2) |
| 12 | + |
| 13 | +depends=('qt6-base') |
| 14 | +makedepends=('git' 'cmake' 'gcc' 'clang' 'qt6-tools' 'qt6-translations') |
| 15 | +optdepends=('qt6-translations: translations') |
| 16 | +source=("git+$url.git#branch=main") |
| 17 | +sha256sums=('SKIP') |
| 18 | + |
| 19 | +install=winghexexplorer2.install |
| 20 | + |
| 21 | +pkgver() { |
| 22 | + cd "$srcdir/WingHexExplorer2" |
| 23 | + git describe --long --tags --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' |
| 24 | +} |
| 25 | + |
| 26 | +prepare() { |
| 27 | + cd "$srcdir/WingHexExplorer2" |
| 28 | + sed -i 's|git@github.com:|https://github.com/|g' .gitmodules |
| 29 | + git submodule sync |
| 30 | + git submodule update --init |
| 31 | + git submodule foreach --recursive " |
| 32 | + if [ -f .gitmodules ]; then |
| 33 | + sed -i 's|git@github.com:|https://github.com/|g' .gitmodules |
| 34 | + git submodule sync |
| 35 | + fi |
| 36 | + " |
| 37 | + git submodule update --init --recursive |
| 38 | +} |
| 39 | + |
| 40 | +build() { |
| 41 | + cd "$srcdir/WingHexExplorer2" |
| 42 | + local _flags=( |
| 43 | + -D CMAKE_INSTALL_PREFIX=/opt |
| 44 | + -D CMAKE_BUILD_TYPE=Release |
| 45 | + -D WINGHEX_USE_FRAMELESS=ON |
| 46 | + -D BUILD_TEST_PLUGIN=OFF |
| 47 | + -D BUILD_SHARED_MEM_EXT=OFF |
| 48 | + ) |
| 49 | + cmake -S . -B build "${_flags[@]}" |
| 50 | + cmake --build build -- -j"$(nproc)" |
| 51 | +} |
| 52 | + |
| 53 | +check() { |
| 54 | + true |
| 55 | +} |
| 56 | + |
| 57 | +package() { |
| 58 | + cd "$srcdir/WingHexExplorer2" |
| 59 | + local _optdir="$pkgdir/opt/WingHexExplorer2" |
| 60 | + local _mkinst="mkinstaller/pyscript" |
| 61 | + |
| 62 | + mkdir -p "$_optdir" |
| 63 | + install -Dm755 build/WingHexExplorer2 "$_optdir/WingHexExplorer2" |
| 64 | + install -Dm644 build/WingPlugin/libWingPlugin.so "$_optdir/libWingPlugin.so" |
| 65 | + |
| 66 | + for _sub in plugin scripts aslib; do |
| 67 | + mkdir -p "$_optdir/$_sub" |
| 68 | + done |
| 69 | + |
| 70 | + cp -a "$_mkinst/share" "build/lang" "$_optdir/" |
| 71 | + install -Dm644 mkinstaller/config.ini "$_optdir/config.ini" |
| 72 | + |
| 73 | + for _f in LICENSE authorband.svg licenseband.svg screenshot.png README.md images/author.jpg; do |
| 74 | + install -Dm644 "$srcdir/WingHexExplorer2/${_f}" "$_optdir/${_f##*/}" |
| 75 | + done |
| 76 | + |
| 77 | + local md5=$(md5sum "$_optdir/WingHexExplorer2" | cut -d' ' -f1 | tr '[:lower:]' '[:upper:]') |
| 78 | + echo "$md5" > "$_optdir/md5sums" |
| 79 | + |
| 80 | + install -Dm644 "$_mkinst/com.wingsummer.winghexexplorer2.desktop" "$pkgdir/usr/share/applications/com.wingsummer.winghexexplorer2.desktop" |
| 81 | +} |
0 commit comments