Advertisement
IssyPutchy

Simple script to compile NetSurf in Termux

Nov 15th, 2020 (edited)
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.37 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. echo "Going to install some essential packages"
  4.  
  5. pkg up
  6. pkg i git curl wget pkg-config libexpat x11-repo \
  7.     openssl libcurl perl python gtk3 libjpeg-turbo \
  8.     libpng librsvg flex bison gperf ccache screen sed debianutils
  9. pkg up
  10. pkg i xorgproto xterm
  11.  
  12. echo -n "Checkng for It's Pointless repo..."
  13.  if [ -f /data/data/com.termux/files/usr/etc/apt/sources.list.d/pointless.list ]; then
  14.   echo "Found! Installing essential build packages"
  15.   pkg i build-essential clang make
  16.    else
  17.   echo "Not found! Adding now..."
  18.   wget -O - https://its-pointless.github.io/setup-pointless-repo.sh | bash
  19.   pkg i build-essential clang make
  20.   echo "Running setupclang..."
  21.   setupclang
  22.  fi
  23.  
  24. echo "Repos and packages ready, now fetchung NetSurf"; echo
  25. mkdir ~/ns-tmp; cd ~/ns-tmp
  26. unset HOST
  27. wget https://git.netsurf-browser.org/netsurf.git/plain/docs/env.sh
  28. sed -i 's/export PREFIX/export NOFIX/' env.sh
  29. source env.sh
  30. ns-clone; echo; echo -n "Patching libcss..."
  31. sed -i 's/\<float\>/double/g'  ~/dev-netsurf/workspace/libcss/include/libcss/fpmath.h
  32. echo "Done. Compiling libs..."
  33. if ns-pull-install; then
  34.  echo "Done!"
  35.   else
  36.  echo "Sonething went wrong!"
  37.  exit 1
  38. fi
  39. rm -f env.sh
  40.  
  41. echo -n "Patching NetSurf env.."
  42. sed -i 's/export PREFIX/export NOFIX/'  ~/dev-netsurf/workspace/env.sh
  43. cat ~/dev-netsurf/workspace/env.sh |grep PREFIX
  44. echo "done!"; echo
  45. unset HOST
  46. source ~/dev-netsurf/workspace/env.sh
  47. echo -n "Patching Makefiles..."
  48. sed -i 's/NETSURF_USE_LIBICONV_PLUG := YES/NETSURF_USE_LIBICONV_PLUG := NO/'  ~/dev-netsurf/workspace/netsurf/Makefile.defaults
  49. echo "done!"; echo
  50.  
  51.  if pkg show ndk-multilib > /dev/null; then
  52.   NDKUSED=true
  53.   echo "Temporarily removing ndk-multilib so compiler can link ns..."; echo; echo
  54.   pkg remove ndk-multilib
  55.    else
  56.   unset NDKUSED
  57.  fi
  58.  
  59. echo "Going for gold... This may take a while"
  60. cd ~/dev-netsurf/workspace/netsurf
  61. if NETSURF_GTK_MAJOR=3 make; then
  62.  echo "SUCCESS!!"; echo "Installing..."
  63.  make install
  64.    if [ -z $NDKUSED ]; then
  65.     echo "Reinstalling NDK libs"
  66.     pkg i ndk-multilib
  67.    fi
  68.   else
  69.  echo "Ahhh poop! Something went wrong!"
  70.  unset HOST
  71.  unset NDKUSE
  72.  unset NOFIX
  73.  unset MAKE
  74.  unset NDKUSED
  75.  unset NETSURF_GTK_MAJOR
  76.  exit 1
  77. fi
  78.  
  79. unset HOST
  80. unset NDKUSE
  81. unset NOFIX
  82. unset MAKE
  83. unset NDKUSED
  84. unset NETSURF_GTK_MAJOR
  85. echo; echo
  86. echo "All done! Launch your method of X and run netsurf-gtk3"
  87.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement