Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[enhance] build: added option to not install ocaml

  • Loading branch information...
commit 465b5518c9aa3802ced514743e5feac8ca27f22d 1 parent 6e3a9c5
@Aqua-Ye Aqua-Ye authored BourgerieQuentin committed
Showing with 38 additions and 11 deletions.
  1. +3 −0  Makefile
  2. +21 −5 install_release.sh
  3. +14 −6 make_package.sh
View
3  Makefile
@@ -216,6 +216,9 @@ install-man:
install: install-bin install-lib install-share install-plugins install-packages install-node-packages install-man
@printf "Installation into $(INSTALL_DIR) done.\n"
+install-node: install-bin install-lib install-share install-plugins install-node-packages install-man
+ @printf "Installation into $(INSTALL_DIR) done.\n"
+
.PHONY: uninstall
uninstall:
rm -rf $(INSTALL_DIR)/lib/opa
View
26 install_release.sh
@@ -9,8 +9,9 @@ set -u
PREFIX=/usr
INSTALLDIR=$PWD/release_install_root
-NODOC="true"
-NOMAN="false"
+NODOC="true" # build the book
+NOMAN="false" # build manpages
+NOOCAML="false" # build and embed ocaml backend
# the version string will be MAJORNAME+BUILDnnnn with nnnn the build number
# (MAJORNAME if BUILD is empty)
@@ -26,11 +27,11 @@ MYDIR=$PWD
OPAGENERAL=$MYDIR
-CLEAN=true
+CLEAN="true"
KEEP_INSTALL_SYS="false"
help() {
- echo "Installs a stripped stand-alone (including ocaml and node) version of OPA in the system."
+ echo "Installs a stripped stand-alone (including ocaml and node) version of Opa in the system."
echo "The installed system can then be used for building packages."
echo "Options"
echo " -prefix <dir> Build for install in <dir>. Warning, you may need to recompile"
@@ -45,6 +46,7 @@ help() {
echo " option to freshly clone the sources at branch/tag"
echo " (default remotes/origin/master)"
echo " -license <prefix> Use given license (files <prefix>_EN, <prefix>_FR)"
+ echo " -no-ocaml Do not build and install OCaml"
echo
echo "GUIDELINES: Run from a proper opalang or with the fetch-git option."
echo "In the former case, you'll need an opa-doc repo along your opalang."
@@ -90,6 +92,8 @@ while [ $# -gt 0 ]; do
if [ $# -lt 2 ]; then echo "Error: option $1 requires an argument"; exit 1; fi
shift
OPAGENERAL="$1";;
+ -no-ocaml)
+ NOOCAML="true";;
-help|--help|-h)
help
exit 0;;
@@ -215,7 +219,11 @@ if [ $NOMAN = "false" ]; then
TARGETS="$TARGETS manpages"
fi
-make clean $TARGETS install
+if [ $NOOCAML = "false" ]; then
+ make $TARGETS install
+else
+ make $TARGETS install-node
+fi
mkdir -p $INSTALLDIR/share/opa/
mkdir -p $INSTALLDIR/share/doc/opa/
@@ -282,6 +290,7 @@ for i in {findlib,etc,camlp4,labltk,ocamldoc,objinfo_helper,toplevellib.cma,addl
echo " -- Removing $INSTALLDIR_LIBOPAOCAML/lib/ocaml/$i"
rm -rvf $INSTALLDIR_LIBOPAOCAML/lib/ocaml/$i
done
+
rm -rvf $INSTALLDIR/lib/ocaml/mascot
rm -fv $INSTALLDIR/bin/mascot.*
@@ -291,6 +300,13 @@ if [ -z "$IS_MAC" ] ; then
fi
+if [ $NOOCAML = "true" ]; then
+ echo " -- Removing $INSTALLDIR_LIBOPA/lib/opa/stdlib/*.opp/*ML*"
+ rm -fv $INSTALLDIR_LIBOPA/lib/opa/stdlib/*.opp/*ML*
+ # echo " -- Removing $INSTALLDIR_LIBOPA/lib/opa/static"
+ # rm -rfv $INSTALLDIR_LIBOPA/lib/opa/static
+fi
+
msg "Cleaning RPATH of binaries and shared libraries"
if ! which chrpath &> /dev/null; then
msg "WARNING: chrpath not found, you'll have dirty stuff in your libs/binaries"
View
20 make_package.sh
@@ -34,6 +34,7 @@ AUTOINSTALL=""
DEB="false"
PKG="false"
WINPKG="false"
+NOOCAML="false"
PACK_MAN="/Applications/PackageMaker.app" # PackageManager path for OS X
@@ -46,6 +47,7 @@ help() {
echo " -dir <dir> Where to get the installed tree (as specified"
echo " to install_release.sh; default $INSTALLDIR)"
echo " -dst <dir> Where to put the package (default $MYDIR)"
+ echo " -no-ocaml Filter out OCaml"
echo " -make-autoinstall <filename> builds an auto-installing archive (you will need"
echo " MakeSelf installed). {} in filename is replaced by"
echo " the version string"
@@ -92,6 +94,8 @@ while [ $# -gt 0 ]; do
if [ $# -lt 2 ]; then echo "Error: option $1 requires an argument"; exit 1; fi
shift
MYDIR="$1";;
+ -no-ocaml)
+ NOOCAML="true";;
-help|--help|-h)
help
exit 0;;
@@ -246,12 +250,16 @@ if [ "$PKG" = "true" ]; then
OS_VARIANT=`sw_vers -productVersion`
PKG_NAME="Opa $VERSION_MAJOR - Build $BUILDNUM for Mac OS X (64-bit)"
echo "Making package '$MYDIR/$PKG_NAME.pkg'"
- $PACK_MAN/Contents/MacOS/PackageMaker --root $INSTALLDIR --resources $OPAGENERAL/installer/Mac/Resources/ --scripts $OPAGENERAL/installer/Mac/Scripts --info $OPAGENERAL/installer/Mac/Info.plist --id com.mlstate.opa.pkg -o "$MYDIR/$PKG_NAME.pkg" -n $BUILDNUM --domain system --root-volume-only --discard-forks -m --verbose --title "Opa $VERSION_MAJOR"
- echo "Creating image '$MYDIR/$PKG_NAME.dmg'"
- if [ -f "$MYDIR/$PKG_NAME.dmg" ]; then
- rm "$MYDIR/$PKG_NAME.dmg"
- fi
- hdiutil create "$MYDIR/$PKG_NAME.dmg" -srcfolder "$MYDIR/$PKG_NAME.pkg"
+ MOREOPTS=""
+ if [ $NOOCAML = "true" ]; then
+ MOREOPTS="--filter lib/opa/static/*"
+ fi
+ $PACK_MAN/Contents/MacOS/PackageMaker --root $INSTALLDIR --resources $OPAGENERAL/installer/Mac/Resources/ --scripts $OPAGENERAL/installer/Mac/Scripts --info $OPAGENERAL/installer/Mac/Info.plist --id com.mlstate.opa.pkg -o "$MYDIR/$PKG_NAME.pkg" -n $BUILDNUM --domain system --root-volume-only --discard-forks -m --verbose --title "Opa $VERSION_MAJOR" $MOREOPTS
+ echo "Creating image '$MYDIR/$PKG_NAME.dmg'"
+ if [ -f "$MYDIR/$PKG_NAME.dmg" ]; then
+ rm "$MYDIR/$PKG_NAME.dmg"
+ fi
+ hdiutil create "$MYDIR/$PKG_NAME.dmg" -srcfolder "$MYDIR/$PKG_NAME.pkg"
fi
Please sign in to comment.
Something went wrong with that request. Please try again.