diff options
author | Jack Chen | 2020-01-17 23:54:08 +0800 |
---|---|---|
committer | Jack Chen | 2020-01-17 23:54:08 +0800 |
commit | db83268457cee66efe0e0a455cf5af2b7522a147 (patch) | |
tree | 25413c09a29295bd52ca97adba7d320b966e4761 | |
parent | 2590b829543937a4e74daa52bbf60e95f5b7b712 (diff) | |
download | aur-db83268457cee66efe0e0a455cf5af2b7522a147.tar.gz |
clean up folders before building
-rw-r--r-- | .SRCINFO | 13 | ||||
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | PKGBUILD | 225 |
3 files changed, 105 insertions, 135 deletions
@@ -1,7 +1,7 @@ pkgbase = anbox-image-gapps - pkgdesc = Android image for running in Anbox, with OpenGApps and houdini + pkgdesc = Android image for running in Anbox, with OpenGApps and Houdini pkgver = 2018.07.19 - pkgrel = 12 + pkgrel = 13 url = https://anbox.io arch = x86_64 license = custom @@ -11,17 +11,14 @@ pkgbase = anbox-image-gapps makedepends = unzip provides = anbox-image conflicts = anbox-image - noextract = open_gapps-x86_64-7.1-mini-20191221.zip - source = https://build.anbox.io/android-images/2018/07/19/android_amd64.img - source = https://downloads.sourceforge.net/project/opengapps/x86_64/20191221/open_gapps-x86_64-7.1-mini-20191221.zip - source = https://downloads.sourceforge.net/project/opengapps/x86_64/20191221/open_gapps-x86_64-7.1-mini-20191221.zip.md5 + source = http://build.anbox.io/android-images/2018/07/19/android_amd64.img source = houdini_y.sfs::http://dl.android-x86.org/houdini/7_y/houdini.sfs source = houdini_z.sfs::http://dl.android-x86.org/houdini/7_z/houdini.sfs + source = https://downloads.sourceforge.net/project/opengapps/x86_64/20200117/open_gapps-x86_64-7.1-pico-20200117.zip md5sums = 26874452a6521ec2e37400670d438e33 - md5sums = SKIP - md5sums = SKIP md5sums = 7ebf618b1af94a02322d9f2d2610090b md5sums = 5ca37e1629edb7d13b18751b72dc98ad + md5sums = f4085066cb505112699a710b6bd0be65 pkgname = anbox-image-gapps diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..62514e8a2fb9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +* +.* @@ -1,10 +1,11 @@ # Maintainer: Jack Chen <redchenjs at live dot com> # Contributor: Mark Wagie <mark dot wagie at tutanota dot com> # Contributor: Robosky <fangyuhao0612 at gmail dot com> + pkgname=anbox-image-gapps pkgver=2018.07.19 -pkgrel=12 -pkgdesc="Android image for running in Anbox, with OpenGApps and houdini" +pkgrel=13 +pkgdesc="Android image for running in Anbox, with OpenGApps and Houdini" arch=('x86_64') url="https://anbox.io" license=('custom') @@ -12,136 +13,106 @@ makedepends=('curl' 'lzip' 'squashfs-tools' 'unzip') provides=('anbox-image') conflicts=('anbox-image') -# anbox image -source=("https://build.anbox.io/android-images/${pkgver//./\/}/android_amd64.img") - -# opengapps -_OPENGAPPS_RELEASEDATE="$(curl -s https://api.github.com/repos/opengapps/x86_64/releases/latest | head -n 10 | grep tag_name | grep -o "\"[0-9][0-9]*\"" | grep -o "[0-9]*")" -_OPENGAPPS_FILE="open_gapps-x86_64-7.1-mini-${_OPENGAPPS_RELEASEDATE}.zip" -_OPENGAPPS_URL="https://downloads.sourceforge.net/project/opengapps/x86_64/${_OPENGAPPS_RELEASEDATE}/${_OPENGAPPS_FILE}" -source+=("${_OPENGAPPS_URL}") -source+=("${_OPENGAPPS_URL}.md5") - -# houdini -source+=("houdini_y.sfs::http://dl.android-x86.org/houdini/7_y/houdini.sfs" - "houdini_z.sfs::http://dl.android-x86.org/houdini/7_z/houdini.sfs") - -noextract=("${_OPENGAPPS_FILE}") -md5sums=('26874452a6521ec2e37400670d438e33' - 'SKIP' - 'SKIP' - '7ebf618b1af94a02322d9f2d2610090b' - '5ca37e1629edb7d13b18751b72dc98ad') - -prepare() { - # verify OpenGApps against provided md5 file - if [ `md5sum "${_OPENGAPPS_FILE}" | awk '{print $1}'` = `cat "${_OPENGAPPS_FILE}".md5 | awk '{print $1}'` ] - then - echo 'OpenGApps md5sums passed' - else - echo 'WARNING: OpenGApps md5sums failed!' - exit 1 - fi -} +_gapps_rel="$(curl -s -L https://api.github.com/repos/opengapps/x86_64/releases/latest | head -n 10 | grep tag_name | sed -r 's/.*\"([0-9]+)\".*/\1/')" +_gapps_src="https://downloads.sourceforge.net/project/opengapps/x86_64/$_gapps_rel/open_gapps-x86_64-7.1-pico-$_gapps_rel.zip" +_gapps_md5="$(curl -s -L $_gapps_src.md5 | sed -r 's/^([0-9a-z]+).*/\1/')" +_gapps_list=( + 'gsfcore-all' + 'gsflogin-all' + 'gmscore-x86_64' + 'vending-x86_64' +) +source=( + "http://build.anbox.io/android-images/${pkgver//./\/}/android_amd64.img" + "houdini_y.sfs::http://dl.android-x86.org/houdini/7_y/houdini.sfs" + "houdini_z.sfs::http://dl.android-x86.org/houdini/7_z/houdini.sfs" + "$_gapps_src" +) +md5sums=( + '26874452a6521ec2e37400670d438e33' + '7ebf618b1af94a02322d9f2d2610090b' + '5ca37e1629edb7d13b18751b72dc98ad' + "$_gapps_md5" +) build () { - cd "${srcdir}" - - # unsquash anbox image - unsquashfs android_amd64.img - - # install opengapps - unzip -d opengapps ./${_OPENGAPPS_FILE} - - cd ./opengapps/Core/ - for filename in *.tar.lz - do - tar --lzip -xvf ./${filename} - done - - cd "${srcdir}" - - cp -r ./$(find opengapps -type d -name "PrebuiltGmsCore") ./squashfs-root/system/priv-app/ - cp -r ./$(find opengapps -type d -name "GoogleLoginService") ./squashfs-root/system/priv-app/ - cp -r ./$(find opengapps -type d -name "Phonesky") ./squashfs-root/system/priv-app/ - cp -r ./$(find opengapps -type d -name "GoogleServicesFramework") ./squashfs-root/system/priv-app/ - - # load houdini_y - mkdir -p houdini_y - rm -rf ./houdini_y/* - unsquashfs -f -d ./houdini_y ./houdini_y.sfs - - mkdir -p ./squashfs-root/system/lib/arm - cp -r ./houdini_y/* ./squashfs-root/system/lib/arm - mv ./squashfs-root/system/lib/arm/libhoudini.so ./squashfs-root/system/lib/libhoudini.so - - # load houdini_z - mkdir -p houdini_z - rm -rf ./houdini_z/* - unsquashfs -f -d ./houdini_z ./houdini_z.sfs - - mkdir -p ./squashfs-root/system/lib64/arm64 - cp -r ./houdini_z/* ./squashfs-root/system/lib64/arm64 - mv ./squashfs-root/system/lib64/arm64/libhoudini.so ./squashfs-root/system/lib64/libhoudini.so - - # add houdini parser - mkdir -p ./squashfs-root/system/etc/binfmt_misc - echo ':arm_exe:M::\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28::/system/lib/arm/houdini:P' >> ./squashfs-root/system/etc/binfmt_misc/arm_exe - echo ':arm_dyn:M::\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x28::/system/lib/arm/houdini:P' >> ./squashfs-root/system/etc/binfmt_misc/arm_dyn - echo ':arm64_exe:M::\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7::/system/lib64/arm64/houdini64:P' >> ./squashfs-root/system/etc/binfmt_misc/arm64_exe - echo ':arm64_dyn:M::\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\xb7::/system/lib64/arm64/houdini64:P' >> ./squashfs-root/system/etc/binfmt_misc/arm64_dyn - - - # add features - _C=$(cat <<-END - <feature name="android.hardware.touchscreen" />\n - <feature name="android.hardware.audio.output" />\n - <feature name="android.hardware.camera" />\n - <feature name="android.hardware.camera.any" />\n - <feature name="android.hardware.location" />\n - <feature name="android.hardware.location.gps" />\n - <feature name="android.hardware.location.network" />\n - <feature name="android.hardware.microphone" />\n - <feature name="android.hardware.screen.portrait" />\n - <feature name="android.hardware.screen.landscape" />\n - <feature name="android.hardware.wifi" />\n - <feature name="android.hardware.bluetooth" />" - END - ) - - _C=$(echo ${_C} | sed 's/\//\\\//g') - _C=$(echo ${_C} | sed 's/\"/\\\"/g') - sed -i "/<\/permissions>/ s/.*/${_C}\n&/" ./squashfs-root/system/etc/permissions/anbox.xml - - # make wifi and bt available - sed -i "/<unavailable-feature name=\"android.hardware.wifi\" \/>/d" ./squashfs-root/system/etc/permissions/anbox.xml - sed -i "/<unavailable-feature name=\"android.hardware.bluetooth\" \/>/d" ./squashfs-root/system/etc/permissions/anbox.xml - - sed -i '/^ro.product.cpu.abilist=x86_64,x86/ s/$/,arm64-v8a,armeabi-v7a,armeabi/' ./squashfs-root/system/build.prop - sed -i '/^ro.product.cpu.abilist32=x86/ s/$/,armeabi-v7a,armeabi/' ./squashfs-root/system/build.prop - sed -i '/^ro.product.cpu.abilist64=x86_64/ s/$/,arm64-v8a/' ./squashfs-root/system/build.prop - - # enable nativebridge - echo "persist.sys.nativebridge=1" >> ./squashfs-root/system/build.prop - sed -i 's/ro.dalvik.vm.native.bridge=0/ro.dalvik.vm.native.bridge=libhoudini.so/' ./squashfs-root/default.prop - - # enable opengles - echo "ro.opengles.version=131072" >> ./squashfs-root/system/build.prop + cd "$srcdir" + + # unpack anbox image + mkdir -p squashfs-root + rm -rf ./squashfs-root/* + unsquashfs -f -d ./squashfs-root ./android_amd64.img + + # load houdini_y + mkdir -p houdini_y + rm -rf ./houdini_y/* + unsquashfs -f -d ./houdini_y ./houdini_y.sfs + + mkdir -p ./squashfs-root/system/lib/arm + cp -r ./houdini_y/* ./squashfs-root/system/lib/arm + mv ./squashfs-root/system/lib/arm/libhoudini.so ./squashfs-root/system/lib/libhoudini.so + + # load houdini_z + mkdir -p houdini_z + rm -rf ./houdini_z/* + unsquashfs -f -d ./houdini_z ./houdini_z.sfs + + mkdir -p ./squashfs-root/system/lib64/arm64 + cp -r ./houdini_z/* ./squashfs-root/system/lib64/arm64 + mv ./squashfs-root/system/lib64/arm64/libhoudini.so ./squashfs-root/system/lib64/libhoudini.so + + # add houdini parser + mkdir -p ./squashfs-root/system/etc/binfmt_misc + echo ':arm_exe:M::\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28::/system/lib/arm/houdini:P' >> ./squashfs-root/system/etc/binfmt_misc/arm_exe + echo ':arm_dyn:M::\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x28::/system/lib/arm/houdini:P' >> ./squashfs-root/system/etc/binfmt_misc/arm_dyn + echo ':arm64_exe:M::\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7::/system/lib64/arm64/houdini64:P' >> ./squashfs-root/system/etc/binfmt_misc/arm64_exe + echo ':arm64_dyn:M::\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\xb7::/system/lib64/arm64/houdini64:P' >> ./squashfs-root/system/etc/binfmt_misc/arm64_dyn + + # add features + sed -i '/<\/permissions>/d' ./squashfs-root/system/etc/permissions/anbox.xml + sed -i '/<unavailable-feature name=\"android.hardware.wifi\" \/>/d' ./squashfs-root/system/etc/permissions/anbox.xml + sed -i '/<unavailable-feature name=\"android.hardware.bluetooth\" \/>/d' ./squashfs-root/system/etc/permissions/anbox.xml + + echo ' <feature name="android.hardware.touchscreen" /> + <feature name="android.hardware.audio.output" /> + <feature name="android.hardware.camera" /> + <feature name="android.hardware.camera.any" /> + <feature name="android.hardware.location" /> + <feature name="android.hardware.location.gps" /> + <feature name="android.hardware.location.network" /> + <feature name="android.hardware.microphone" /> + <feature name="android.hardware.screen.portrait" /> + <feature name="android.hardware.screen.landscape" /> + <feature name="android.hardware.wifi" /> + <feature name="android.hardware.bluetooth" />' >> ./squashfs-root/system/etc/permissions/anbox.xml + echo '</permissions>' >> ./squashfs-root/system/etc/permissions/anbox.xml + + # set processors + sed -i '/^ro.product.cpu.abilist=x86_64,x86/ s/$/,arm64-v8a,armeabi-v7a,armeabi/' ./squashfs-root/system/build.prop + sed -i '/^ro.product.cpu.abilist32=x86/ s/$/,armeabi-v7a,armeabi/' ./squashfs-root/system/build.prop + sed -i '/^ro.product.cpu.abilist64=x86_64/ s/$/,arm64-v8a/' ./squashfs-root/system/build.prop + + # enable nativebridge + echo 'persist.sys.nativebridge=1' >> ./squashfs-root/system/build.prop + sed -i 's/ro.dalvik.vm.native.bridge=0/ro.dalvik.vm.native.bridge=libhoudini.so/' ./squashfs-root/default.prop + + # enable opengles + echo 'ro.opengles.version=131072' >> ./squashfs-root/system/build.prop + + # install gapps + for i in ${_gapps_list[*]}; do + mkdir -p $i + rm -rf ./$i/* + tar --lzip -xvf ./Core/$i.tar.lz + cp -r ./$i/nodpi/priv-app/* ./squashfs-root/system/priv-app/ + done } package() { - cd "${srcdir}" + cd "$srcdir" - # set owner - chown -R 100000:100000 ./squashfs-root/system/priv-app/{Phonesky,GoogleLoginService,GoogleServicesFramework,PrebuiltGmsCore} - chown -R 100000:100000 ./squashfs-root/system/lib/{libhoudini.so,arm} - chown -R 100000:100000 ./squashfs-root/system/lib64/{libhoudini.so,arm64} - chown -R 100000:100000 ./squashfs-root/system/etc/binfmt_misc + # repack image + mksquashfs ./squashfs-root ./android.img -noappend -b 131072 -comp xz -Xbcj x86 - # squash image - mksquashfs squashfs-root android.img -b 131072 -comp xz -Xbcj x86 - - #install image - install -Dm644 ./android.img "${pkgdir}/"var/lib/anbox/android.img + install -Dm 644 ./android.img "$pkgdir/var/lib/anbox/android.img" } - |