[packages/crossnacl-newlib] - script to get source
draenog
draenog at pld-linux.org
Sat Jul 7 11:13:51 CEST 2012
commit 74e16817af1fdebaf3690109efd3f3c74659288d
Author: Elan Ruusamäe <glen at pld-linux.org>
Date: Fri Jul 6 23:35:55 2012 +0000
- script to get source
Changed files:
get-source.sh -> 1.1
get-source.sh | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 88 insertions(+)
---
diff --git a/get-source.sh b/get-source.sh
new file mode 100644
index 0000000..c72dea3
--- /dev/null
+++ b/get-source.sh
@@ -0,0 +1,88 @@
+#!/bin/sh
+# Make snapshot of nacl-binutils
+# Author: Elan Ruusamäe <glen at pld-linux.org>
+# $Id$
+set -e
+
+# Generated from git
+# git clone http://git.chromium.org/native_client/nacl-newlib.git
+# (Checkout ID taken from chromium-15.0.874.106/native_client/tools/REVISIONS)
+# cd nacl-newlib
+# git checkout f5185a5726155efb578d4d0f6537bc15ee5edb7d
+# cd ..
+# For newlib version, grep PACKAGE_VERSION newlib/libm/configure
+# mv nacl-newlib nacl-newlib-1.18.0-gitf5185a57
+# tar cfj nacl-newlib-1.18.0-gitf5185a57.tar.bz2 nacl-newlib-1.18.0-gitf5185a57
+
+package=nacl-newlib
+repo_url=http://git.chromium.org/native_client/$package.git
+specfile=crossnacl-newlib.spec
+
+# if you get errors that sha1 hash not found, try increasing depth
+# fatal: Path 'gcc/BASE-VER' does not exist in 'c69a5b7252d2f073d0f526800e4fca3b63cd1fab'
+depth=
+
+chrome_version=20.0.1132.47
+
+chrome_revision=$(curl -s https://omahaproxy.appspot.com/revision?version=$chrome_version)
+chrome_branch=$(IFS=.; set -- $chrome_version; echo $3)
+test -e DEPS.py || svn cat http://src.chromium.org/chrome/branches/$chrome_branch/src/DEPS@$chrome_revision > DEPS.py
+nacl_revision=$(awk -F'"' '/nacl_revision.:/{print $4}' DEPS.py)
+
+export GIT_DIR=$package/.git
+
+if [ ! -d $package ]; then
+ install -d $package
+ git init
+ git remote add origin $repo_url
+ git fetch ${depth:+--depth $depth} origin refs/heads/master:refs/remotes/origin/master
+else
+ git fetch origin refs/heads/master:refs/remotes/origin/master
+fi
+
+# get src/native_client/tools/REVISIONS directly from svn
+test -e NACL_REVISIONS.sh || svn cat https://src.chromium.org/native_client/trunk/src/native_client/tools/REVISIONS@$nacl_revision > NACL_REVISIONS.sh
+
+if grep -Ev '^(#|(LINUX_HEADERS_FOR_NACL|NACL_(BINUTILS|GCC|GDB|GLIBC|NEWLIB))_COMMIT=[0-9a-f]+$|)' NACL_REVISIONS.sh >&2; then
+ echo >&2 "I refuse to execute grabbed file for security concerns"
+ exit 1
+fi
+. ./NACL_REVISIONS.sh
+
+githash=$NACL_NEWLIB_COMMIT
+git show $githash:newlib/libm/configure > configure
+version=$(awk -F"'" '/PACKAGE_VERSION=/{print $2}' configure)
+shorthash=$(git rev-parse --short $githash)
+prefix=$package-$version-git$shorthash
+
+if [ -f $prefix.tar.bz2 ]; then
+ echo "Tarball $prefix.tar.bz2 already exists at $shorthash"
+else
+ git archive $githash --prefix $prefix/ > $prefix.tar
+ bzip2 -9 $prefix.tar
+
+ ../dropin $prefix.tar.bz2
+fi
+
+# We need to copy some missing header files from chromium
+# mkdir ~/nacl-headers-15.0.874.106
+# cd chromium-15.0.874.106/native_client/
+# ./src/trusted/service_runtime/export_header.py src/trusted/service_runtime/include ~/nacl-headers-15.0.874.106/
+# cd ~/nacl-headers-15.0.874.106
+# tar cfj ~/nacl-headers-15.0.874.106.tar.bz2 .
+
+# http://src.chromium.org/native_client/trunk/src/native_client/src/trusted/service_runtime/
+package=nacl-headers
+prefix=$package-$chrome_version
+if [ -f $prefix.tar.bz2 ]; then
+ echo "Tarball $prefix.tar.bz2 already exists at $shorthash"
+ exit 0
+fi
+svn co http://src.chromium.org/native_client/trunk/src/native_client/src/trusted/service_runtime@$nacl_revision $package
+cd $package
+./export_header.py include ../$prefix
+cd ..
+tar -cjf $prefix.tar.bz2 --exclude-vcs $prefix
+../dropin $prefix.tar.bz2
+
+rm -f NACL_REVISIONS.sh DEPS.py configure
More information about the test
mailing list