diff options
author | SR_team | 2022-04-09 23:39:14 +0300 |
---|---|---|
committer | SR_team | 2022-04-09 23:39:14 +0300 |
commit | 0b70d7347333102df703f066f73b29d5859c02b6 (patch) | |
tree | 7c4af3e380d861c5a5700022aaedb4f270090333 | |
parent | d919719ca26e3e0699e63c68225f18daf704ac54 (diff) | |
download | aur-0b70d7347333102df703f066f73b29d5859c02b6.tar.gz |
Fix workground:
- fix applying patch
- fix ld path
- fix removing package
- fix errors on first links update
- remove unused files
-rw-r--r-- | .SRCINFO | 11 | ||||
-rw-r--r-- | PKGBUILD | 20 | ||||
-rw-r--r-- | android-ndk-ollvm.install | 4 | ||||
-rwxr-xr-x | update_links.sh | 5 |
4 files changed, 25 insertions, 15 deletions
@@ -1,7 +1,7 @@ pkgbase = android-ndk-ollvm - pkgdesc = Obfuscated llvm for Android NDK + pkgdesc = Obfuscated llvm for Android NDK. It install LLVM with obfuscation support outside of android-ndk and use symlinks to NDK. Symlinks updates automaticly (via pacman hooks) on each android-ndk upgrade pkgver = 14.0.1 - pkgrel = 1 + pkgrel = 2 url = https://github.com/sr-tream/obfuscator install = android-ndk-ollvm.install arch = x86_64 @@ -11,14 +11,15 @@ pkgbase = android-ndk-ollvm makedepends = cmake makedepends = clang makedepends = lld + makedepends = patch depends = android-ndk>=r23 replaces = android-ndk64-ollvm - options = !strip - options = staticlibs + options = strip + options = !staticlibs source = update_links.sh source = android-ndk-ollvm.hook source = git+https://github.com/sr-tream/obfuscator.git#branch=release/14.x - sha256sums = 8b644e42e6e33a607bcf2529c034007ee8bf2c3980f40c9da21cfc9450a4e7f5 + sha256sums = 7f4e245fa079367b26108cead08b5cb5033cba7595b842b97f3c1abec52c1d4f sha256sums = 4ff51c89e7b047b0ca396c829fa5dbbf572559f15cefdf6d14e56251e208c5e9 sha256sums = SKIP @@ -1,19 +1,19 @@ pkgname=android-ndk-ollvm pkgver=14.0.1 -pkgrel=1 +pkgrel=2 pkgdesc='Obfuscated llvm for Android NDK. It install LLVM with obfuscation support outside of android-ndk and use symlinks to NDK. Symlinks updates automaticly (via pacman hooks) on each android-ndk upgrade' arch=('x86_64') url='https://github.com/sr-tream/obfuscator' license=('GPL' 'LGPL' 'custom') -options=('!strip' '!staticlibs') +options=('strip' '!staticlibs') install="$pkgname.install" replaces=('android-ndk64-ollvm') depends=('android-ndk>=r23') -makedepends=('cmake' 'clang' 'lld') +makedepends=('cmake' 'clang' 'lld' 'patch') source=("update_links.sh" "${pkgname}.hook" "git+${url}.git#branch=release/14.x") -sha256sums=('8b644e42e6e33a607bcf2529c034007ee8bf2c3980f40c9da21cfc9450a4e7f5' +sha256sums=('7f4e245fa079367b26108cead08b5cb5033cba7595b842b97f3c1abec52c1d4f' '4ff51c89e7b047b0ca396c829fa5dbbf572559f15cefdf6d14e56251e208c5e9' 'SKIP') @@ -21,7 +21,7 @@ prepare() { cd ${srcdir}/obfuscator git submodule update --init llvm-project cd - && cd ${srcdir}/obfuscator/llvm-project - git apply ../obfuscator.patch + patch -p1 -i ../obfuscator.patch cd - } @@ -46,10 +46,16 @@ build() { -DLLVM_CCACHE_BUILD=ON fi - cmake --build build --parallel + cmake --build build --parallel 4 cmake --install build --prefix install - ln -s install/bin/ld.lld install/bin/ld + cd install/bin + ln -s ld.lld ld + cd - + + cd install/lib + rm -f lib*\.a + cd - } package() { diff --git a/android-ndk-ollvm.install b/android-ndk-ollvm.install index ab7229141586..29427895096e 100644 --- a/android-ndk-ollvm.install +++ b/android-ndk-ollvm.install @@ -11,6 +11,6 @@ pre_remove() { rm /opt/android-ndk-ollvm/source.properties rm /opt/android-ndk-ollvm/toolchains/llvm/prebuilt/linux-x86_64/sysroot - ollvm_ver=`${OLLVM_PATH}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --version | head -1 | awk {'print $3'}` - rm /opt/android-ndk-ollvm/toolchains/llvm/prebuilt/linux-x86_64/lib/clang/${ollvm_ver}/lib + rm `readlink /opt/android-ndk-ollvm/toolchains/llvm/prebuilt/linux-x86_64/ndk-libs` + rm /opt/android-ndk-ollvm/toolchains/llvm/prebuilt/linux-x86_64/ndk-libs } diff --git a/update_links.sh b/update_links.sh index aca43d758d07..1a0dd740afd3 100755 --- a/update_links.sh +++ b/update_links.sh @@ -13,7 +13,7 @@ processPath(){ return fi echo "Update path for ${OLLVM_PATH}/$1 -> ${ANDROID_NDK}/$ndk_path" - rm "${OLLVM_PATH}/$1" + rm -f "${OLLVM_PATH}/$1" ln -s "${ANDROID_NDK}/$ndk_path" "${OLLVM_PATH}/$1" } @@ -24,3 +24,6 @@ processPath "toolchains/llvm/prebuilt/linux-x86_64/sysroot" ollvm_ver=`${OLLVM_PATH}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --version | head -1 | awk {'print $3'}` andllvm_ver=`${ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --version | head -1 | awk {'print $8'}` processPath "toolchains/llvm/prebuilt/linux-x86_64/lib/clang/${ollvm_ver}/lib" "toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/${andllvm_ver}/lib" + +rm -f "${OLLVM_PATH}/toolchains/llvm/prebuilt/linux-x86_64/ndk-libs" +ln -s "${OLLVM_PATH}/toolchains/llvm/prebuilt/linux-x86_64/lib/clang/${ollvm_ver}/lib" "${OLLVM_PATH}/toolchains/llvm/prebuilt/linux-x86_64/ndk-libs" |