summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshish Gupta <ashmew2@gmail.com>2017-09-16 19:09:55 (GMT)
committer Ashish Gupta <ashmew2@gmail.com>2017-09-16 19:09:55 (GMT)
commit49ea4c25e589c84e99d7536ec9446655ac9763a7 (patch)
treeea75c968316eb76e189ede0adce5fcac37a98067
parentad1165ef129ab3d87e271d58b45f57651b8b0e47 (diff)
downloadnetsurf-49ea4c25e589c84e99d7536ec9446655ac9763a7.tar.gz
netsurf-49ea4c25e589c84e99d7536ec9446655ac9763a7.tar.bz2
Add tools for building on Linux for KolibriOS
-rwxr-xr-xfrontends/kolibrios/tools/mkimg.sh50
-rwxr-xr-xfrontends/kolibrios/tools/nskbuild.sh53
2 files changed, 103 insertions, 0 deletions
diff --git a/frontends/kolibrios/tools/mkimg.sh b/frontends/kolibrios/tools/mkimg.sh
new file mode 100755
index 0000000..40197bb
--- a/dev/null
+++ b/frontends/kolibrios/tools/mkimg.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+set -x
+SVNDIR=/opt/netsurf/kos32-gcc/env/kolibrios/
+BINDIR=/opt/netsurf/kos32-gcc/env/bin/
+LIBS="libpng libjpeg"
+DLL="libpng16.dll libjpeg.dll"
+
+wget http://builds.kolibrios.org/eng/latest-distr.7z --directory-prefix=$BINDIR
+pushd $PWD
+cd $BINDIR
+rm -rf kolibrios/lib kolibri.lbl
+7z x latest-distr.7z kolibrios/lib kolibri.lbl
+rm -f latest-distr.7z
+popd
+
+cd $SVNDIR/contrib/sdk/sources/
+for i in $LIBS; do
+ cd $i
+ make
+ cd ..
+done
+
+for i in $DLL; do
+ cp ../bin/$i $BINDIR/kolibrios/lib/
+done
+
+######
+# Create the VDI image from $BINDIR
+# Use this as the VDI image in VirtualBox
+######
+
+FILENAME=bin.img
+MOUNTPOINT=/mnt/temp
+OUTPUT=/opt/netsurf/kos32-gcc/env/bin/netsurf-$(date +%Y%m%d-%H%M%S).vdi
+
+rm -f $FILENAME
+rm -f $OUTPUT
+sudo umount $MOUNTPOINT
+
+dd if=/dev/urandom of=$FILENAME bs=32M count=4
+/usr/sbin/mkfs.vfat $FILENAME
+sudo mkdir -p $MOUNTPOINT
+sudo mount -o loop $FILENAME $MOUNTPOINT
+sudo cp -r /opt/netsurf/kos32-gcc/env/bin/* $MOUNTPOINT/
+sudo umount $MOUNTPOINT
+
+rm -f $OUTPUT
+VBoxManage convertfromraw $FILENAME $OUTPUT --format=VDI
+echo "VDI Image at : $OUTPUT : Mount it with KolibriOS"
diff --git a/frontends/kolibrios/tools/nskbuild.sh b/frontends/kolibrios/tools/nskbuild.sh
new file mode 100755
index 0000000..483752b
--- a/dev/null
+++ b/frontends/kolibrios/tools/nskbuild.sh
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+# Place me in a new directory somewhere!
+PREFIX=/opt/netsurf/
+
+sudo mkdir -p $PREFIX
+sudo chown $USER:$USER $PREFIX
+
+function gitclone() {
+ [[ ! -d $2 ]] && git clone $1
+}
+
+# # clone all ns libs
+for lib in libcss libdom libhubbub libnsbmp libnsfb libnsgif libnsutils libparserutils libsvgtiny libutf8proc libwapcaplet; do
+ gitclone git://git.netsurf-browser.org/${lib}.git ${lib}
+done
+
+# # clone toolchains, buildsystem and netsurf.
+for repo in toolchains buildsystem netsurf; do
+ gitclone git://git.netsurf-browser.org/${repo}.git ${repo}
+done
+
+# Set up the buildsystem
+cd buildsystem
+git checkout ashmew2/kolibri-cross
+make install
+cd ..
+
+# Set up the kolibrios compiler toolchain
+cd toolchains
+git checkout ashmew2/kolibrios
+cd kos32-gcc
+make install
+cd ../..
+
+# Set up all netsurf libs (Order is important for libs)
+for lib in libparserutils libwapcaplet libcss libhubbub libdom libnsbmp libnsgif libnsutils libsvgtiny libutf8proc; do
+ cd $lib
+ HOST=kolibrios make install
+ cd ..
+done
+
+cd libnsfb
+git checkout ashmew2/kolibri
+HOST=kolibrios make install
+cd ..
+
+# Compile and install Netsurf
+cd netsurf
+git checkout ashmew2/nskolibrios
+make TARGET=kolibrios install
+cd ..
+