FS#28668 - [x264] Building x264 from git instead of snapshots
Attached to Project:
Arch Linux
Opened by Krzysztof Grygiencz (kfgz) - Sunday, 26 February 2012, 21:52 GMT
Last edited by Ionut Biru (wonder) - Wednesday, 06 February 2013, 20:11 GMT
Opened by Krzysztof Grygiencz (kfgz) - Sunday, 26 February 2012, 21:52 GMT
Last edited by Ionut Biru (wonder) - Wednesday, 06 February 2013, 20:11 GMT
|
Details
Hi,
Some application (i.e. hybrid-encoder in AUR) requires version check of x264. x264 built from snapshot has only x at the end of version string. Snapshot version x264 0.120.x Git version x264 0.120.2164 da19765 Currently x264 is built from snapshots but Arch policy (bleeding edge) allows "git snapshots" so maybe it will be good idea to built x264 from git. Regards, kfgz |
This task depends upon
Closed by Ionut Biru (wonder)
Wednesday, 06 February 2013, 20:11 GMT
Reason for closing: Implemented
Additional comments about closing: x264 20130206
Wednesday, 06 February 2013, 20:11 GMT
Reason for closing: Implemented
Additional comments about closing: x264 20130206
Possible fix
./configure --enable-shared
#fix
sed -i "s|0.120.x|0.120.REV_NUM|g" x264_config.h
This method is:
when configure is executed (with or withour arguments) it calls the version.sh script, to see the total number of commits that the repository has.
[1], Exactly [2]...
If the whole script is read, with this total number of commits (and some equations) determines the build.
The Zip has no folder .git to generate the version, but if the git repository is used, it will fix the problem, because the x264 repository has the master and stable heads.
Master is under development, but stable freezes when the whole code has been tested.
No need for sed workground, just (the real problem) to stablish the variable pkgver= with the info generated by version.sh, but this only works if the repository is cloned
and extracting the info from the x264_config.h file before launching build() function in the pkgbuild.
I've not found the method to get all the info from the repository like git rev-list in the local repository. Only if a painful hack is built:
Download from [3] with curl -sL (pg=0 is a variable that determines the number of pages that the log has; this number increments if you add more commits to the repository.
Today, the log has 22 pages; tomorrow, or in a month, it might have 30... or 50...), extract the hash from the commits, run the command uniq to eliminate the repeated commits,
and make your own algorithm (like in the version.sh) to get the version.
I'm working on it. For now, only this works:
_getver() {
msg "Connecting to server to get version"
rm -fr .temp
git clone "${_gitroot}" .temp > /dev/null 2>&1
cd .temp
./configure > /dev/null 2>&1
echo "$(< x264_config.h)" | grep X264_VERSION | cut -d ' ' -f4 | cut -b2-
cd ..
rm -fr .temp
}
pkgver="$(_getver)"
and running a clonation for the second time in the function build()
if anyone have any idea to complete this (without cloning the repository twice and with compatibility with pkgbuild), you'd make me a wooden son.
greetings
[1] http://git.videolan.org/?p=x264.git;a=blob;f=version.sh;h=5466ef242d2cecffb886fa5b9a819a8b1b4af846;hb=HEAD
[2] http://git.videolan.org/?p=x264.git;a=blob;f=version.sh;h=5466ef242d2cecffb886fa5b9a819a8b1b4af846;hb=HEAD#l6
[3] http://git.videolan.org/?p=x264.git;a=log;h=refs/heads/stable;pg=0