2010-08-08 02:44:25 +04:00
|
|
|
x@{builderDefsPackage
|
|
|
|
, cmake, curl, patch, zlib, icu, sqlite, libuuid
|
|
|
|
, readline, openssl, spidermonkey_1_8_0rc1
|
2010-11-15 15:39:50 +03:00
|
|
|
, nspr, nss
|
2011-09-03 14:21:55 +04:00
|
|
|
, unzip, glibcLocales
|
2011-05-05 20:58:21 +04:00
|
|
|
, runTests ? false
|
2010-08-08 02:44:25 +04:00
|
|
|
, ...}:
|
|
|
|
builderDefsPackage
|
|
|
|
(a :
|
|
|
|
let
|
|
|
|
s = import ./src-for-default.nix;
|
|
|
|
helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
|
2011-05-05 20:58:21 +04:00
|
|
|
["runTests"];
|
2010-08-08 02:44:25 +04:00
|
|
|
buildInputs = map (n: builtins.getAttr n x)
|
|
|
|
(builtins.attrNames (builtins.removeAttrs x helperArgNames));
|
|
|
|
|
|
|
|
in
|
|
|
|
rec {
|
|
|
|
src = a.fetchUrlFromSrcInfo s;
|
|
|
|
|
|
|
|
inherit (s) name;
|
|
|
|
inherit buildInputs;
|
|
|
|
|
2011-09-03 14:21:55 +04:00
|
|
|
phaseNames = ["prepare_sgneeds" "dump0" "prepareMakefiles" "fixPaths" "doMake" "doTest" "doDeploy"];
|
2010-09-01 14:12:56 +04:00
|
|
|
|
|
|
|
dump0 = (a.doDump "0");
|
|
|
|
|
2011-05-05 20:58:21 +04:00
|
|
|
runTests = a.stdenv.lib.attrByPath ["runTests"] false a;
|
|
|
|
|
|
|
|
doTest = a.fullDepEntry (if runTests then ''
|
2011-02-28 23:56:01 +03:00
|
|
|
mkdir pseudo-home
|
|
|
|
export HOME=$PWD/pseudo-home
|
2011-09-03 14:21:55 +04:00
|
|
|
export LC_ALL=en_US.UTF-8
|
2011-09-11 20:46:17 +04:00
|
|
|
export LANG=en_US.UTF-8
|
|
|
|
${if a.stdenv.isLinux then "export LOCALE_ARCHIVE=${a.glibcLocales}/lib/locale/locale-archive;" else ""}
|
2011-03-18 11:25:02 +03:00
|
|
|
make test || true
|
2011-05-05 20:58:21 +04:00
|
|
|
'' else "") ["doMake" "minInit"];
|
2011-02-28 23:56:01 +03:00
|
|
|
|
2010-09-01 14:12:56 +04:00
|
|
|
prepare_sgneeds = a.fullDepEntry (''
|
2012-01-19 00:16:00 +04:00
|
|
|
mkdir -p "$out/sgneeds/include/spidermonkey"
|
2010-09-01 14:12:56 +04:00
|
|
|
for d in bin include lib; do
|
2012-01-19 00:16:00 +04:00
|
|
|
mkdir -p "$out/sgneeds/$d"
|
|
|
|
mkdir -p "$out/sgneeds/$d"
|
2010-09-01 14:12:56 +04:00
|
|
|
for p in "${spidermonkey_1_8_0rc1}"; do
|
|
|
|
for f in "$p"/"$d"/*; do
|
|
|
|
ln -sf "$f" "$out"/sgneeds/"$d"
|
|
|
|
done
|
|
|
|
done
|
|
|
|
done
|
2011-02-28 23:56:01 +03:00
|
|
|
for p in "${spidermonkey_1_8_0rc1}/include" "${spidermonkey_1_8_0rc1}/include/js"; do
|
|
|
|
for f in "$p"/*; do
|
|
|
|
ln -sf "$f" "$out"/sgneeds/include/spidermonkey/
|
|
|
|
done
|
|
|
|
done
|
2010-09-01 14:12:56 +04:00
|
|
|
|
2012-01-19 00:16:00 +04:00
|
|
|
mkdir -p "$out/sgneeds/include/sgbrings"
|
2010-09-01 14:12:56 +04:00
|
|
|
ln -s "$out/sgneeds/include/js" "$out/sgneeds/include/sgbrings/js"
|
|
|
|
for f in "$out/sgneeds/lib/"libjs*; do
|
|
|
|
bn="$(basename "$f")"
|
|
|
|
ln -s "$f" "$out/sgneeds/lib/''${bn/libjs/libsgbrings_js}"
|
|
|
|
done
|
|
|
|
|
|
|
|
export SGNEEDS_DIR="$out"/sgneeds/
|
2011-02-28 23:56:01 +03:00
|
|
|
export VVTHIRDPARTY="$out"/sgneeds/
|
|
|
|
|
2012-08-09 11:05:43 +04:00
|
|
|
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I"$out/sgneeds/include" -Wno-error"
|
2010-09-01 14:12:56 +04:00
|
|
|
'') ["minInit" "defEnsureDir"];
|
2010-08-08 02:44:25 +04:00
|
|
|
|
|
|
|
prepareMakefiles = a.fullDepEntry ''
|
2011-05-21 09:07:53 +04:00
|
|
|
sed -e 's@ /bin/uname @ uname @g' -i CMakeLists.txt
|
2011-08-04 20:01:50 +04:00
|
|
|
sed -e 's@ /bin/uname @ uname @g' -i common-CMakeLists.txt
|
2010-08-08 02:44:25 +04:00
|
|
|
cd ..
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
export NIX_LDFLAGS="$NIX_LDFLAGS -lssl"
|
2011-02-28 23:56:01 +03:00
|
|
|
cmake -G "Unix Makefiles" -D SGNEEDS_DIR="$SGNEEDS_DIR" -D VVTHIRDPARTY="$VVTHIRDPARTY" -D SPIDERMONKEY_INCDIR="${a.spidermonkey_1_8_0rc1}/include" -D SPIDERMONKEY_LIB="${a.spidermonkey_1_8_0rc1}/lib/libjs.so" ../veracity*
|
2010-08-08 02:44:25 +04:00
|
|
|
'' ["minInit" "addInputs" "doUnpack"];
|
|
|
|
|
2011-09-03 14:21:55 +04:00
|
|
|
fixPaths = a.fullDepEntry ''
|
|
|
|
sed -e "s@/bin/bash@${a.stdenv.shell}@" -i $(find .. -type f)
|
|
|
|
sed -e 's@/bin/ln@#{a.coreutils}/bin/ln@g' -i ../veracity/src/js_tests/*.js
|
|
|
|
sed -e 's@/usr/bin/gdb@#{a.gdb}/bin/gdb@g' -i ../veracity/testsuite/c_test.sh
|
|
|
|
sed -e 's@"/bin/@"@g' -i ../veracity/testsuite/u*.c
|
|
|
|
'' ["minInit"];
|
|
|
|
|
2010-08-08 02:44:25 +04:00
|
|
|
doDeploy = a.fullDepEntry ''
|
2012-01-19 00:16:00 +04:00
|
|
|
mkdir -p "$out/bin" "$out/share/veracity/"
|
2010-08-08 02:44:25 +04:00
|
|
|
cp -r .. "$out/share/veracity/build-dir"
|
|
|
|
ln -s "$out/share/veracity/build-dir/build/src/cmd/vv" "$out/bin"
|
|
|
|
ln -s "$out/share/veracity/build-dir/build/src/script/vscript" "$out/bin"
|
2011-05-05 20:58:21 +04:00
|
|
|
${if runTests then "" else ''
|
|
|
|
rm -rf "$out/share/veracity/build-dir/veracity/testsuite"
|
|
|
|
rm -rf "$out/share/veracity/build-dir/build/testsuite"
|
|
|
|
''}
|
2010-08-08 02:44:25 +04:00
|
|
|
'' ["doMake" "minInit" "defEnsureDir"];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A distributed version control system with template-based merging";
|
|
|
|
maintainers = with a.lib.maintainers;
|
|
|
|
[
|
|
|
|
raskin
|
|
|
|
];
|
|
|
|
platforms = with a.lib.platforms;
|
|
|
|
linux ;
|
2013-11-05 00:07:57 +04:00
|
|
|
broken = true;
|
2010-08-08 02:44:25 +04:00
|
|
|
};
|
|
|
|
}) x
|
|
|
|
|