From e7a2aa16ae7351d4c986a7ae5753ccb7ac880b8b Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 6 Nov 2012 18:21:53 +0000 Subject: Stole the packaging from libbu++ (again). --- build.conf | 35 ----------------------------------- build.sh | 60 +++++++++++++++++++++++++++++++++++------------------------- default.bld | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++----- version | 1 + 4 files changed, 87 insertions(+), 65 deletions(-) delete mode 100644 build.conf create mode 100644 version diff --git a/build.conf b/build.conf deleted file mode 100644 index cab11a8..0000000 --- a/build.conf +++ /dev/null @@ -1,35 +0,0 @@ -# build.conf for build, kind of whacky, eh? - -default action: check targets() - -set "CXXFLAGS" += "-ggdb -W -Wall" - -"build": - rule "exe", - target file, - requires "libbu++/libbu++.a", - set "LDFLAGS" += "-Llibbu++ -lbu++ -ldl", - set "CXXFLAGS" += "-Ilibbu++", - input filesIn("src") filter regexp(".*\\.(cpp|y|l)$") - -rule "exe": - matches regexp("(.*)\\.o$"), - aggregate toString(" "), - perform command("g++ -o {target} {match} {LDFLAGS}") - -rule "cpp": - matches regexp("(.*)\\.(cpp|c)$"), - produces "{re:1}.o", - requires commandToList("g++ -M {CXXFLAGS} {match}", "make"), - perform command("g++ {CXXFLAGS} -c -o {target} {match}") - -rule "bison": - matches regexp("(.*)\\.y$"), - produces ["{re:1}.tab.c", "{re:1}.tab.h", "{re:1}.output"], - perform command("bison -v -b{re:1} {match}") - -rule "flex": - matches regexp("(.*)\\.l$"), - produces ["{re:1}.yy.c","{re:1}.yy.h"], - perform command("flex {FLEXFLAGS} {match}") - diff --git a/build.sh b/build.sh index 0120833..3d8bfdb 100755 --- a/build.sh +++ b/build.sh @@ -33,12 +33,46 @@ function gpp() bld "$1" "$2" || cmd CXX "$1" g++ -ggdb -fPIC -W -Wall -Iminibu -c -o "$1" "$2" } +function presetup() +{ + for dir in minibu/src minibu/bu minibu/bu/compat; do + cmd MKDIR ${dir} mkdir -p ${dir} + done + cmd FAKE minibu/bu/autoconfig.h touch minibu/bu/autoconfig.h + for file in $(cd bootstrap; ls); do + cmd BOOTSTRAP minibu/bu/${file} cp bootstrap/${file} minibu/bu + done + for F in $BUSRC; do + bld minibu/src/$F || cmd WGET minibu/src/$F wget -q http://svn.xagasoft.com/libbu++/trunk/src/stable/$F -O minibu/src/$F + done + for F in $BUHDR; do + bld minibu/bu/$F || cmd WGET minibu/bu/$F wget -q http://svn.xagasoft.com/libbu++/trunk/src/stable/$F -O minibu/bu/$F + done + for F in $BUEXPSRC; do + bld minibu/src/$F || cmd WGET minibu/src/$F wget -q http://svn.xagasoft.com/libbu++/trunk/src/experimental/$F -O minibu/src/$F + done + for F in $BUEXPHDR; do + bld minibu/bu/$F || cmd WGET minibu/bu/$F wget -q http://svn.xagasoft.com/libbu++/trunk/src/experimental/$F -O minibu/bu/$F + done + for F in $BUCOMPAT; do + bld minibu/bu/$F || cmd WGET minibu/bu/$F wget -q http://svn.xagasoft.com/libbu++/trunk/src/$F -O minibu/bu/$F + done + + bld src/build.tab.c src/build.y || cmd BISON src/build.tab.c bison -bsrc/build src/build.y + bld src/build.yy.c src/build.l || cmd FLEX src/build.yy.c flex src/build.l +} + if [ ! -z "$1" ]; then if [ "$1" == "clean" -o "$1" == "-c" ]; then echo "Cleaning up, deleting all object code and downloaded source code..." echo rm -Rf minibu src/*.o exit + elif [ "$1" == "setup" -o "$1" == "-s" ]; then + echo "Only preforming download / setup" + echo + presetup + exit else echo "The only option supported is \"clean\", otherwise run $0" echo "with no parameters to compile build." @@ -47,31 +81,7 @@ if [ ! -z "$1" ]; then fi fi -for dir in minibu/src minibu/bu minibu/bu/compat; do - cmd MKDIR ${dir} mkdir -p ${dir} -done -cmd FAKE minibu/bu/autoconfig.h touch minibu/bu/autoconfig.h -for file in $(cd bootstrap; ls); do - cmd BOOTSTRAP minibu/bu/${file} cp bootstrap/${file} minibu/bu -done -for F in $BUSRC; do - bld minibu/src/$F || cmd WGET minibu/src/$F wget -q http://svn.xagasoft.com/libbu++/trunk/src/stable/$F -O minibu/src/$F -done -for F in $BUHDR; do - bld minibu/bu/$F || cmd WGET minibu/bu/$F wget -q http://svn.xagasoft.com/libbu++/trunk/src/stable/$F -O minibu/bu/$F -done -for F in $BUEXPSRC; do - bld minibu/src/$F || cmd WGET minibu/src/$F wget -q http://svn.xagasoft.com/libbu++/trunk/src/experimental/$F -O minibu/src/$F -done -for F in $BUEXPHDR; do - bld minibu/bu/$F || cmd WGET minibu/bu/$F wget -q http://svn.xagasoft.com/libbu++/trunk/src/experimental/$F -O minibu/bu/$F -done -for F in $BUCOMPAT; do - bld minibu/bu/$F || cmd WGET minibu/bu/$F wget -q http://svn.xagasoft.com/libbu++/trunk/src/$F -O minibu/bu/$F -done - -bld src/build.tab.c src/build.y || cmd BISON src/build.tab.c bison -bsrc/build src/build.y -bld src/build.yy.c src/build.l || cmd FLEX src/build.yy.c flex src/build.l +presetup for F in $BUSRC $BUEXPSRC; do OUTPUT=${F%.*}.o diff --git a/default.bld b/default.bld index 6309518..fbf33df 100644 --- a/default.bld +++ b/default.bld @@ -70,10 +70,20 @@ for IN in files("src/plugins/*.cpp") do } } -target "build-r$(svnversion "-n").tar.bz2" +target "minibu" +{ + profile "build" + { + condition always; + execute("./build.sh setup"); + } +} + +PKG_BASE = "build-$(cat version)-r$(svnversion "-n").tar"; + +target PKG_BASE { input [ - "build.conf", "Doxyfile", "default.bld", "docs/build.1", @@ -83,15 +93,52 @@ target "build-r$(svnversion "-n").tar.bz2" "support/vim/ftplugin/build.vim", files("src/*.y"), files("src/*.l"), + files("src/*.c"), files("src/*.cpp"), files("src/*.h"), files("share/autoinclude/*"), - files("share/include/*") + files("share/include/*"), + "minibu", + files("minibu/bu/*"), + files("minibu/src/*") ]; rule "tarball"; tag "pkg"; } +target PKG_BASE + ".gz" +{ + input PKG_BASE; + tag "pkg"; + display "gzip"; + profile "build" + { + execute("gzip -9 < ${INPUT} > ${OUTPUT}"); + } +} + +target PKG_BASE + ".bz2" +{ + input PKG_BASE; + tag "pkg"; + display "bzip2"; + profile "build" + { + execute("bzip2 -9 < ${INPUT} > ${OUTPUT}"); + } +} + +target PKG_BASE + ".xz" +{ + input PKG_BASE; + tag "pkg"; + display "xz"; + profile "build" + { + execute("xz -9vv < ${INPUT} > ${OUTPUT}"); + } +} + rule "tarball" { input matches("*.cpp", "*.h", "*.c", "*.y", "*.l", "*.conf", "Doxyfile", @@ -99,8 +146,7 @@ rule "tarball" profile "build" { OUTDIR = OUTPUT.replace(".tar.bz2",""); - execute("tar --transform=\"s@^@${OUTDIR}/@\" -c ${INPUT} |" - " bzip2 -9 > ${OUTPUT}"); + execute("tar -f ./${OUTPUT} --transform=\"s@^@${OUTDIR}/@\" -c ${INPUT}"); } } diff --git a/version b/version new file mode 100644 index 0000000..6e6566c --- /dev/null +++ b/version @@ -0,0 +1 @@ +0.01 -- cgit v1.2.3