3
0
Fork 0
forked from mirrors/nixpkgs

octoprint-plugins.m33-fio: 1.11 -> 1.17

This commit is contained in:
Nikolay Amiantov 2017-01-29 20:03:38 +03:00
parent d19b83e32b
commit e89f6e3a7c
2 changed files with 23 additions and 23 deletions

View file

@ -1,4 +1,4 @@
From c84b2130dab0d26be35294d023ed8f4be404c3c1 Mon Sep 17 00:00:00 2001
From 0defcf6ec155899c414f66524b7df629f59327f0 Mon Sep 17 00:00:00 2001
From: Nikolay Amiantov <ab@fmap.me>
Date: Wed, 23 Nov 2016 00:40:48 +0300
Subject: [PATCH] Build and use one version of preprocessor library
@ -9,10 +9,10 @@ Subject: [PATCH] Build and use one version of preprocessor library
2 files changed, 6 insertions(+), 123 deletions(-)
diff --git a/octoprint_m33fio/__init__.py b/octoprint_m33fio/__init__.py
index f9f84c4..b365024 100755
index 4b43c59..d1259e4 100755
--- a/octoprint_m33fio/__init__.py
+++ b/octoprint_m33fio/__init__.py
@@ -1061,71 +1061,8 @@ class M33FioPlugin(
@@ -1062,71 +1062,8 @@ class M33FioPlugin(
# Check if using shared library or checking if it is usable
if self._settings.get_boolean(["UseSharedLibrary"]) or isUsable :
@ -23,19 +23,19 @@ index f9f84c4..b365024 100755
- if platform.uname()[4].startswith("armv6l") and self.getCpuHardware() == "BCM2708" :
-
- # Set shared library
- self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace('\\', '/') + "/static/libraries/preprocessor_arm1176jzf-s.so")
- self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace("\\", "/") + "/static/libraries/preprocessor_arm1176jzf-s.so")
-
- # Otherwise check if running on a Raspberry Pi 2 or Raspberry Pi 3
- elif platform.uname()[4].startswith("armv7l") and self.getCpuHardware() == "BCM2709" :
-
- # Set shared library
- self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace('\\', '/') + "/static/libraries/preprocessor_arm_cortex-a7.so")
- self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace("\\", "/") + "/static/libraries/preprocessor_arm_cortex-a7.so")
-
- # Otherwise check if running on an ARM7 device
- elif platform.uname()[4].startswith("armv7") :
-
- # Set shared library
- self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace('\\', '/') + "/static/libraries/preprocessor_arm7.so")
- self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace("\\", "/") + "/static/libraries/preprocessor_arm7.so")
-
- # Otherwise check if using an i386 or x86-64 device
- elif platform.uname()[4].endswith("86") or platform.uname()[4].endswith("64") :
@ -44,13 +44,13 @@ index f9f84c4..b365024 100755
- if platform.architecture()[0].startswith("32") :
-
- # Set shared library
- self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace('\\', '/') + "/static/libraries/preprocessor_i386.so")
- self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace("\\", "/") + "/static/libraries/preprocessor_i386.so")
-
- # Otherwise check if Python is running as 64-bit
- elif platform.architecture()[0].startswith("64") :
-
- # Set shared library
- self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace('\\', '/') + "/static/libraries/preprocessor_x86-64.so")
- self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace("\\", "/") + "/static/libraries/preprocessor_x86-64.so")
-
- # Otherwise check if running on Windows and using an i386 or x86-64 device
- elif platform.uname()[0].startswith("Windows") and (platform.uname()[4].endswith("86") or platform.uname()[4].endswith("64")) :
@ -59,39 +59,39 @@ index f9f84c4..b365024 100755
- if platform.architecture()[0].startswith("32") :
-
- # Set shared library
- self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace('\\', '/') + "/static/libraries/preprocessor_i386.dll")
- self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace("\\", "/") + "/static/libraries/preprocessor_i386.dll")
-
- # Otherwise check if Python is running as 64-bit
- elif platform.architecture()[0].startswith("64") :
-
- # Set shared library
- self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace('\\', '/') + "/static/libraries/preprocessor_x86-64.dll")
- self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace("\\", "/") + "/static/libraries/preprocessor_x86-64.dll")
-
- # Otherwise check if running on OS X and using an i386 or x86-64 device
- # Otherwise check if running on macOS and using an i386 or x86-64 device
- elif platform.uname()[0].startswith("Darwin") and (platform.uname()[4].endswith("86") or platform.uname()[4].endswith("64")) :
-
- # Check if Python is running as 32-bit
- if platform.architecture()[0].startswith("32") :
-
- # Set shared library
- self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace('\\', '/') + "/static/libraries/preprocessor_i386.dylib")
- self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace("\\", "/") + "/static/libraries/preprocessor_i386.dylib")
-
- # Otherwise check if Python is running as 64-bit
- elif platform.architecture()[0].startswith("64") :
-
- # Set shared library
- self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace('\\', '/') + "/static/libraries/preprocessor_x86-64.dylib")
+ # Set shared library
+ self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace('\\', '/') + "/static/libraries/libpreprocessor.so")
- self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace("\\", "/") + "/static/libraries/preprocessor_x86-64.dylib")
+ # Set shared library
+ self.sharedLibrary = ctypes.cdll.LoadLibrary(self._basefolder.replace('\\', '/') + "/static/libraries/libpreprocessor.so")
# Check if shared library was set
if self.sharedLibrary :
diff --git a/shared library source/Makefile b/shared library source/Makefile
index 887899b..4c74f5c 100755
index 792b4f4..4c74f5c 100755
--- a/shared library source/Makefile
+++ b/shared library source/Makefile
@@ -1,68 +1,14 @@
-# Target platform options: LINUX32, LINUX64, WINDOWS32, WINDOWS64, PI, PI2, ARM7, OSX32, OSX64
-# Target platform options: LINUX32, LINUX64, WINDOWS32, WINDOWS64, PI, PI2, ARM7, MACOS32, MACOS64
-LIBRARY_NAME = preprocessor
-TARGET_PLATFORM = LINUX64
+LIBRARY_NAME = libpreprocessor
@ -139,14 +139,14 @@ index 887899b..4c74f5c 100755
- CFLAGS = -fPIC -mcpu=generic-armv7-a -mfpu=vfp -mfloat-abi=hard -static-libgcc -O3 -Wl,-soname,$(PROG)$(VER) -static-libstdc++
-endif
-
-ifeq ($(TARGET_PLATFORM), OSX32)
-ifeq ($(TARGET_PLATFORM), MACOS32)
- PROG = $(LIBRARY_NAME)_i386.dylib
- CC = clang++
- CFLAGS = -fPIC -m32 -stdlib=libc++ -O3 -Wl,-install_name,$(PROG)$(VER)
-
-endif
-
-ifeq ($(TARGET_PLATFORM), OSX64)
-ifeq ($(TARGET_PLATFORM), MACOS64)
- PROG = $(LIBRARY_NAME)_x86-64.dylib
- CC = clang++
- CFLAGS = -fPIC -m64 -stdlib=libc++ -O3 -Wl,-install_name,$(PROG)$(VER)
@ -164,5 +164,5 @@ index 887899b..4c74f5c 100755
clean:
rm -f ../octoprint_m33fio/static/libraries/$(PROG)
--
2.10.2
2.11.0

View file

@ -12,13 +12,13 @@ let
m33-fio = buildPlugin rec {
name = "M33-Fio-${version}";
version = "1.11";
version = "1.17";
src = fetchFromGitHub {
owner = "donovan6000";
repo = "M33-Fio";
rev = "V${version}";
sha256 = "11nbsi93clrqlnmaj73ak87hkqyghybccqz5jzhn2dhp0263adhl";
sha256 = "19r860hqax09a79s9bl181ab7jsgx0pa8fvnr62lbgkwhis7m8mh";
};
patches = [
@ -34,7 +34,7 @@ let
'';
meta = with stdenv.lib; {
homepage = "https://github.com/donovan6000/M3D-Fio";
homepage = "https://github.com/donovan6000/M33-Fio";
description = "OctoPrint plugin for the Micro 3D printer";
platforms = platforms.all;
license = licenses.gpl3;