libchrome: install header to unversioned path.

Install header to /usr/include/libchrome.

Also, keep a symlink at /usr/include/base-$BASE_VER pointing to
libchrome for backward compatibility.

BUG=chromium:920513
TEST=emerge libchrome; equery files libchrome

Change-Id: Ibeccc63bb83d26444b4cbfdee027fb476193deff
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/2586584
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Tested-by: Qijiang Fan <fqj@google.com>
Commit-Queue: Qijiang Fan <fqj@google.com>
diff --git a/chromeos-base/libchrome/libchrome-9999.ebuild b/chromeos-base/libchrome/libchrome-9999.ebuild
index 1b2ec77..f66bf71 100644
--- a/chromeos-base/libchrome/libchrome-9999.ebuild
+++ b/chromeos-base/libchrome/libchrome-9999.ebuild
@@ -137,7 +137,7 @@
 	use dbus && header_dirs+=( dbus )
 	use timers && header_dirs+=( components/timers )
 
-	insinto /usr/include/base-"${BASE_VER}"/base/test
+	insinto /usr/include/libchrome/base/test
 	doins \
 		base/test/bind_test_util.h \
 		base/test/task_environment.h \
@@ -150,7 +150,7 @@
 		base/test/test_timeouts.h \
 
 	if use crypto; then
-		insinto /usr/include/base-${BASE_VER}/crypto
+		insinto /usr/include/libchrome/crypto
 		doins \
 			crypto/crypto_export.h \
 			crypto/hmac.h \
@@ -227,14 +227,13 @@
 	fi
 
 	# Install header files.
-	# TODO(fqj): Use unversioned path.
 	local d
 	for d in "${header_dirs[@]}" ; do
-		insinto /usr/include/base-"${BASE_VER}"/"${d}"
+		insinto /usr/include/libchrome/"${d}"
 		doins "${d}"/*.h
 	done
 	for d in "${mojom_dirs[@]}"; do
-		insinto /usr/include/base-"${BASE_VER}"/"${d}"
+		insinto /usr/include/libchrome/"${d}"
 		doins "${OUT}"/gen/include/"${d}"/*.h
 		# Not to install mojom and pickle file to prevent misuse until Chromium IPC
 		# team is ready to have a stable mojo_base. see crbug.com/1055379
@@ -244,6 +243,9 @@
 		# doins "${OUT}"/gen/include/"${d}"/*.p
 	done
 
+	# Remove symlink after all files migrated unversioned header path.
+	dosym libchrome /usr/include/base-"${BASE_VER}"
+
 	# TODO(fqj): Revisit later for type mapping (see libchrome/BUILD.gn)
 	# Install libchrome base type mojo mapping
 	# if use mojo; then