From bc35a1a876aaa7d27bda77b689160c83a9a78529 Mon Sep 17 00:00:00 2001 From: Tomasz CEDRO Date: Fri, 11 Jul 2014 17:22:46 +0200 Subject: [PATCH] Initial package.sh script builder for FreeBSD. --- package.sh | 45 +++++++++++++++++++++++++++++++++++- scripts/freebsd/cura | 2 ++ scripts/freebsd/cura.desktop | 10 ++++++++ scripts/freebsd/cura.py | 34 +++++++++++++++++++++++++++ 4 files changed, 90 insertions(+), 1 deletion(-) create mode 100755 scripts/freebsd/cura create mode 100755 scripts/freebsd/cura.desktop create mode 100755 scripts/freebsd/cura.py diff --git a/package.sh b/package.sh index 72d96b03..480e0a74 100755 --- a/package.sh +++ b/package.sh @@ -148,6 +148,50 @@ if [ "$BUILD_TARGET" = "darwin" ]; then exit fi +############################# +# FreeBSD by cederom@tlen.pl +############################# + +if [ "$BUILD_TARGET" = "freebsd" ]; then + export CXX="c++" + rm -rf Power + if [ ! -d "Power" ]; then + git clone https://github.com/GreatFruitOmsk/Power + else + cd Power + git pull + cd .. + fi + rm -rf CuraEngine + git clone ${CURA_ENGINE_REPO} + if [ $? != 0 ]; then echo "Failed to clone CuraEngine"; exit 1; fi + gmake -j4 -C CuraEngine VERSION=${BUILD_NAME} + if [ $? != 0 ]; then echo "Failed to build CuraEngine"; exit 1; fi + rm -rf scripts/freebsd/dist + mkdir -p scripts/freebsd/dist/usr/local/share/cura + mkdir -p scripts/freebsd/dist/usr/local/share/applications + mkdir -p scripts/freebsd/dist/usr/local/bin + cp -a Cura scripts/freebsd/dist/usr/local/share/cura/ + cp -a resources scripts/freebsd/dist/usr/local/share/cura/ + cp -a plugins scripts/freebsd/dist/usr/local/share/cura/ + cp -a CuraEngine/build/CuraEngine scripts/freebsd/dist/usr/local/share/cura/ + cp scripts/freebsd/cura.py scripts/freebsd/dist/usr/local/share/cura/ + cp scripts/freebsd/cura.desktop scripts/freebsd/dist/usr/local/share/applications/ + cp scripts/freebsd/cura scripts/freebsd/dist/usr/local/bin/ + cp -a Power/power scripts/freebsd/dist/usr/local/share/cura/ + echo $BUILD_NAME > scripts/freebsd/dist/usr/local/share/cura/Cura/version + # Create archive or package if root + if [ `whoami` == "root" ]; then + echo "Building a package for FreeBSD not yet implemented! Use the port Luke!" + else + echo "You are not root, building simple package archive..." + cd scripts/freebsd/dist + pwd + $TAR czf ../../../${TARGET_DIR}.tar.gz * + fi + exit +fi + ############################# # Debian 32bit .deb ############################# @@ -220,7 +264,6 @@ if [ "$BUILD_TARGET" = "debian_amd64" ]; then exit fi - ############################# # Rest ############################# diff --git a/scripts/freebsd/cura b/scripts/freebsd/cura new file mode 100755 index 00000000..63cc0612 --- /dev/null +++ b/scripts/freebsd/cura @@ -0,0 +1,2 @@ +#!/bin/sh +PYTHONPATH=$PYTHONPATH:/usr/local/share/cura/ `echo /usr/bin/env python` /usr/local/share/cura/cura.py "$@" diff --git a/scripts/freebsd/cura.desktop b/scripts/freebsd/cura.desktop new file mode 100755 index 00000000..aa62b2c2 --- /dev/null +++ b/scripts/freebsd/cura.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Application +Name=Cura +Comment=Cura is a complete and open slicing solution for RepRap 3D printers +Icon=/usr/local/share/cura/resources/images/c.png +Exec=/usr/local/bin/cura +Path=/usr/local/share/cura/ +StartupNotify=true +Terminal=false +Categories=GNOME;GTK;Utility; diff --git a/scripts/freebsd/cura.py b/scripts/freebsd/cura.py new file mode 100755 index 00000000..ef85a7c8 --- /dev/null +++ b/scripts/freebsd/cura.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python + +import os, sys + +sys.path.insert(1, os.path.dirname(__file__)) + +try: + import numpy + import OpenGL + import wx + import serial + import power +except ImportError as e: + if e.message[0:16] == 'No module named ': + module = e.message[16:] + + if module == 'OpenGL': + module = 'PyOpenGL' + elif module == 'serial': + module = 'pyserial' + print 'Requires ' + module + + if module == 'power': + print "Install from: https://github.com/GreatFruitOmsk/Power" + else: + print "Try sudo easy_install " + module + print e.message + + exit(1) + + +import Cura.cura as cura + +cura.main() -- 2.30.2