File README.Maintainers of Package rubygem-libv8
== How to maintain rubygem-libv8? ==
NOTICE: Please do not override the specfile of rubygem-libv8 with the
automatic update script that applies on all gem packages in d:l:ruby:extensions.
AND repository maintainers please take careful look at the SRs w/ modifications
to the specfile.
## Why?
rubygem-libv8 upstream had decided not to bundle v8 source code with its releases.
but our gem2rpm program assumes that every .gem file is self-satisfied.
it means gem2rpm can't insert the outside v8 source code into the gem file.
and the vitual machine on our build service doesn't have any running network during
the build. it means `gclient fetch/sync` command is not available and we can't download
v8 source code during the build.
so I invented a trick: we include v8 source code as a standalone RPM source. and
modify the upstream gem to be a gem that contains upstream codes and v8 source code.
then we use the mechanism that gem2rpm provides to actually package it.
## How to get v8's source code?
You can't use the snapshot releases that on github.com/v8/v8/releases, which contains
no build dependencies that are needed to build v8 source code.
You need to get [depot_tools](http://www.chromium.org/developers/how-tos/install-depot-tools)
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
and get the [v8 git tree](https://chromium.googlesource.com/v8/v8.git):
mkdir -p ~/v8
cd ~/v8
export PATH=$PATH:~/depot_tools
fetch v8
cd v8
git checkout $V8_VERSION
gclient sync
cp -r ../.cipd .
cd ~
if the gem version is 8.4.255.0, then $V8_VERSION needed will be 8.4.255
next:
cp -r ~/v8/v8 ~/v8-$V8_VERSION
find v8-$V8_VERSION -type d -name ".git" -exec rm -rf {} \;
find v8-$V8_VERSION -type f -name ".gitignore" -delete -print
tar -cf v8-$V8_VERSION.tar v8-$V8_VERSION
xz -z -9 v8-$V8_VERSION.tar
now v8-$V8_VERSION.tar.xz is the RPM source for v8.
## About patches
Patches for rubygem-libv8 gem itself and Patches for the BUILD.gn of v8 should be added and described as usual.
Patches for v8 should be added as Source(N) and copied to libv8-5.3.332.38.3/patches directory, they will be applied automatically.
## Remember to update the version in build_clean.rb to the gem version