Binaries

From ENIGMA
Jump to navigation Jump to search

Binaries are generated bytecode files, or more generally, files that result from applying a process (such as building or compiling) to source code, and as a result are not intended to be directly edited. Executables and Jars are considered binaries, while .cpp and .png files are not. Technically they are not considered dependencies, because you usually obtain them and plug them in after getting the rest of the project's source code, rather than before.

In order to keep its repository small and fast, a project should keep binaries separate (in fact, usually there will even be special exclusion/ignore rules to make sure that binaries don't accidentally end up in the repository). As a result, when you check out the repository of the project, it will be missing binaries which may be needed to run the project.

You can build these binaries yourself if you want, but then you would need to obtain their source code and dependencies. Instead, you usually can find pre-built versions hosted either on their respective websites, or at a special location on the main project's website (in our case, here).

You will not only need to download them separately, but you'll need to keep them updated separately. Sometimes, projects will include a special checkout/update script that will handle all of these details for you, as long as you remember to run that script whenever you want to update.

ENIGMA

ENIGMA maintains the following binaries:

If you are an active git-privileged developer, you should not need to worry about these files accidentally ending up in the repository, because the .gitignore file has rules to ignore them.

We also maintain an md5 checksum of the binaries so that you can confirm whether yours are different from the latest (indicating either that you changed yours or else yours it outdated). It is at the following url:
https://github.com/enigma-dev/ExtraPackages/blob/master/Packages.md5 If one of these is out of date please let us know as an issue on the github (https://github.com/enigma-dev/ExtraPackages) or submit a pull request with the updated version.

Bash Update Script

We've been working on getting an update script that works on both Mac and Linux. First we have to consider what tools we have in common. The following list was compiled between User:TGMG (Mac) and User:IsmAvatar (Ubuntu)

  • md5 - Mac only.
  • md5sum - Ubuntu only.
  • openssl md5 - Both.
  • wget - Linux only.
  • curl - Both.
  • grep - Both.
  • sed - Both.
  • python - Both.

Bash script proposal:

#!/bin/sh
#Usage: ./update.sh
url=http://dl.dropbox.com/u/9975312/enigma-dep
# Download the checksums, for each checksum
curl -s $url/update.md5 | while read CHECK
do
 #CREATE PLUGINS / SHARED FOLDERS
 mkdir -p plugins/shared
 #CHECK is of the form "MD5(path/to/file.ext)= 0123456789abcdef"
 FILE=`echo $CHECK | sed 's/MD5(\(.*\)).*/\1/'` # Parse the filepath
 MYSUM=`openssl md5 $FILE` # Generate our own checksum of that file
 if [ "$MYSUM" != "$CHECK" ]; then # See if ours is different
  echo "Updating $FILE."
  FNAME=`echo $FILE | sed 's/.*\///'` # Get only the filename part (since the server doesn't directory them)
  curl $url/$FNAME -o $FILE # Download and replace the binary
 else
  echo "$FILE is up-to-date."
 fi
done

Python Update Script

Purpose: Easy to install enigma extensions, sdks (./updatescript androidSDK), easy to keep extensions up-to-date, easy to make sure users are on the same extension version (just run the updatescript).

A Python Script of the suggested/proposed package manager has found its way into the repository, and can be found here: https://github.com/enigma-dev/enigma-dev/blob/master/install.py

Python is preinstalled on Mac and Ubuntu, and easy to install on other platforms (like windows). You can run this script to update the main binaries like so:
python install.py

Or you can run it to install the hittheball example like so:
python install.py catch_the_clown

You can show packages for a specific category like so:
python install.py --show=extensions

You can show all extensions: python install.py --show=all

You can download or update the 39dylib extention like so (it will download and extract an .epackage file):
python install.py 39dylib

If called without a name argument it will update all the "main" binaries (lgm,enigma.jar,jna.jar)

Packages Repository

You can view the current repository of packages on github: https://github.com/enigma-dev/Enigma-packages/blob/master/packages.md5
If you would like to add a package you can fork the https://github.com/enigma-dev/Enigma-packages git repository and submit a pull request.

Format (packages.md5): <name> <hash> <localpath> <weburl> <csv dependencies>
e.g
main b5f6de84285a0795ad74f03c32bccafd plugins/enigma.jar http://dl.dropbox.com/u/9975312/enigma-dep/enigma.jar jnaJar,lgm

Release script (for bash script only)

For those interested in the script currently used by developers when they release a newer binary, it is here. Note, it is currently implemented to grab the binaries from specific development directories that other users are not likely to have. Because of this, the script will probably not work for you, and is mostly just kept here for reference.

#!/bin/sh
#Usage: ./release.sh [l][e]
DB=~/Dropbox/Public/enigma-dep
WORK=~/enigma-dev

if [ "$#" -gt "0" ]; then
 echo $1 | grep l > /dev/null 2>&1
 if [ $? = 0 ]; then
  cp ws-git/LateralGM/lgm16b4.jar $WORK/lgm16b4.jar
  cp ws-git/LateralGM/lgm16b4.jar $DB/lgm16b4.jar
  echo lgm16b4.jar
 fi
 echo $1 | grep e > /dev/null 2>&1
 if [ $? = 0 ]; then
  cp pluginsource/enigma.jar $WORK/plugins/enigma.jar
  cp pluginsource/enigma.jar $DB/enigma.jar
  echo enigma.jar
 fi
fi

cd $WORK
openssl md5 lgm16b4.jar plugins/enigma.jar plugins/shared/jna.jar > $DB/update.md5