Skip to content

Instantly share code, notes, and snippets.

@infinity0
Created November 7, 2015 21:04
Show Gist options
  • Save infinity0/44574909dbdadd2c4a5e to your computer and use it in GitHub Desktop.
Save infinity0/44574909dbdadd2c4a5e to your computer and use it in GitHub Desktop.
Build a ghetto binary debian package of OCamlEditor
#!/bin/sh
# Run this from a clone of:
# https://forge.ocamlcore.org/anonscm/git/ocamleditor/ocamleditor.git
set -e
VERSION="${VERSION:-1.13.2}"
git checkout $VERSION
git clean -fdx
sudo aptitude install checkinstall opam
sudo aptitude install libgtk2.0-dev libcurl4-gnutls-dev ncurses-dev libgtksourceview2.0-dev graphviz
opam switch "4.01.0"
eval `opam config env`
opam install lablgtk xml-light ocp-indent ocurl ocamldiff
ocaml build.ml ocamleditor
DEPS="$(ldd -r src/ocamleditor.opt | grep -o '/[^ ]*\s' | xargs -n1 dpkg -S | cut -f1 -d: | sort -u | sed -e's/^\(.*\)$/\1,/g' | xargs echo)"
DEPS="${DEPS%,}"
cat >description-pak <<EOF
A source code editor and build tool for the OCaml programming language.
EOF
sudo checkinstall -D --default \
--pkgname ocamleditor \
--pkgversion "$VERSION" \
--pkglicense "GPL-3" \
--maintainer "'Ximin Luo <infinity0@pwned.gg>'" \
--requires "$DEPS" \
--deldoc --deldesc --delspec \
ocaml build.ml install -prefix /usr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment