aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2020-11-03 05:50:04 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-11-03 05:50:04 +0000
commitb6231833e5f5df7aa650d0c16bd677c1f9f0a9c4 (patch)
tree94569413d6f5439b6d8b2a9ff8b3a71cb1c3d4d5
parent585211024a759a507c3bc30bdf3b06161c85aa0f (diff)
parentd200a1033ef52d284f26790f710870b0e4b9dd62 (diff)
downloadserde-b6231833e5f5df7aa650d0c16bd677c1f9f0a9c4.tar.gz
Use cargo2android.py with a patch file. am: a84b8a190d am: b50be98112 am: d200a1033e
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/serde/+/1483517 Change-Id: I6f5582d7c73aa9cf69b39a2de7301ce0f2e0f74a
-rw-r--r--Android.bp2
-rw-r--r--patches/Android.bp.patch12
-rwxr-xr-xpost_update.sh15
3 files changed, 13 insertions, 16 deletions
diff --git a/Android.bp b/Android.bp
index 277296f..a55ed6d 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,4 +1,4 @@
-// This file is generated by cargo2android.py --run --device --dependencies.
+// This file is generated by cargo2android.py --run --device --dependencies --patch=patches/Android.bp.patch.
rust_library {
name: "libserde",
diff --git a/patches/Android.bp.patch b/patches/Android.bp.patch
new file mode 100644
index 0000000..4f03f0b
--- /dev/null
+++ b/patches/Android.bp.patch
@@ -0,0 +1,12 @@
+diff --git b/Android.bp a/Android.bp
+index 41d67cc..277296f 100644
+--- b/Android.bp
++++ a/Android.bp
+@@ -23,6 +23,6 @@ rust_library {
+ "--cfg ops_bound",
+ "--cfg range_inclusive",
+ "--cfg std_atomic",
+- "--cfg std_atomic64",
++ // "--cfg std_atomic64", // not for arm/arm64
+ ],
+ }
diff --git a/post_update.sh b/post_update.sh
deleted file mode 100755
index 7de4f29..0000000
--- a/post_update.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash
-
-# $1 Path to the new version.
-# $2 Path to the old version.
-
-set -x
-set -e
-
-# work around missing std_atomic64 on arm/arm64
-SRCFILE=Android.bp
-OLDSTR='"--cfg std_atomic64",'
-NEWSTR='// "--cfg std_atomic64", // not for arm/arm64'
-sed -i -e "s:$OLDSTR:$NEWSTR:" $SRCFILE
-# Make sure that sed replaced $OLDSTR with $NEWSTR
-grep "$NEWSTR" $SRCFILE > /dev/null