chiark / gitweb /
Initial package.sh script builder for FreeBSD.
authorTomasz CEDRO <cederom@tlen.pl>
Fri, 11 Jul 2014 15:22:46 +0000 (17:22 +0200)
committerTomasz CEDRO <cederom@tlen.pl>
Fri, 11 Jul 2014 16:11:36 +0000 (18:11 +0200)
package.sh
scripts/freebsd/cura [new file with mode: 0755]
scripts/freebsd/cura.desktop [new file with mode: 0755]
scripts/freebsd/cura.py [new file with mode: 0755]

index 72d96b0350308b189b369ae3d95bbcae5b57f90a..480e0a740bd0447bb5a31185cfd49c28e4021732 100755 (executable)
@@ -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 (executable)
index 0000000..63cc061
--- /dev/null
@@ -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 (executable)
index 0000000..aa62b2c
--- /dev/null
@@ -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 (executable)
index 0000000..ef85a7c
--- /dev/null
@@ -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()