summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorradioxoma2014-01-25 12:39:52 +0300
committerradioxoma2014-01-25 12:39:52 +0300
commit6d45f1ed0c4b9de07fe703d649bead876417e9b2 (patch)
tree9d0d2df3bd5faf347c96c333f90b5055e4f5ab61
downloadaur-6d45f1ed0c4b9de07fe703d649bead876417e9b2.tar.gz
Micromanager - microscope hardware control
-rw-r--r--.SRCINFO27
-rw-r--r--PKGBUILD83
-rw-r--r--info.txt90
-rw-r--r--micromanager-lib.conf1
-rw-r--r--mm.install15
-rw-r--r--python_makefile.diff22
-rw-r--r--python_setup.diff25
7 files changed, 263 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..d29cf7029dcb
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,27 @@
+pkgbase = micromanager-git
+ pkgdesc = Software package for microscopy hardware devices control. CMMCore and python2 bindings only.
+ pkgver = 1.4.13.r2326.g5117eb9
+ pkgrel = 1
+ url = http://www.micro-manager.org
+ install = mm.install
+ arch = x86_64
+ arch = i686
+ license = LGPL-2.1 BSD GPL-3
+ makedepends = git
+ makedepends = swig
+ depends = zlib
+ depends = boost
+ depends = libdc1394
+ depends = python2
+ depends = python2-numpy
+ source = micromanager-git::git+https://github.com/mdcurtis/micromanager-upstream.git
+ source = python_makefile.diff
+ source = python_setup.diff
+ source = micromanager-lib.conf
+ md5sums = SKIP
+ md5sums = 76a9fb824728a8397e3b5245ffe4ddaf
+ md5sums = e14361cc344c2fb0d03f3458d53eb152
+ md5sums = b7b6a68ce53d8ea1a4a29d187174ee4c
+
+pkgname = micromanager-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..d9d43a8072ae
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,83 @@
+# Maintainer: radioxoma <radioxoma from gmail com>
+# Last successful build with 1.4.13.r2306.gf5e50bd 22.01.2014 on x86_64.
+pkgname=micromanager-git
+pkgver=1.4.13.r2326.g5117eb9
+pkgrel=1
+epoch=
+pkgdesc="Software package for microscopy hardware devices control. CMMCore and python2 bindings only."
+arch=('x86_64' 'i686')
+url="http://www.micro-manager.org"
+license=('LGPL-2.1 BSD GPL-3')
+groups=()
+depends=('zlib' 'boost' 'libdc1394' 'python2' 'python2-numpy')
+makedepends=('git' 'swig')
+checkdepends=()
+optdepends=()
+provides=()
+conflicts=()
+replaces=()
+backup=()
+options=()
+install=mm.install
+changelog=
+source=($pkgname::git+https://github.com/mdcurtis/micromanager-upstream.git
+ 'python_makefile.diff'
+ 'python_setup.diff'
+ 'micromanager-lib.conf')
+noextract=()
+md5sums=('SKIP'
+ '76a9fb824728a8397e3b5245ffe4ddaf'
+ 'e14361cc344c2fb0d03f3458d53eb152'
+ 'b7b6a68ce53d8ea1a4a29d187174ee4c') #generate with 'makepkg -g'
+
+pkgver() {
+ cd "$srcdir/$pkgname"
+ git describe --long | sed -E 's/([^-]*-g)/r\1/;s/-/./g'
+}
+
+prepare() {
+ cd "$srcdir/$pkgname"
+
+ # Change python to python2.
+ # Remove installing commands form makefile and use setuptools instead.
+ # See PKGBUILD package() function.
+ patch -p0 < "$srcdir/python_makefile.diff"
+
+ # Patching setup.py to prevent
+ # >>> import MMCorePy
+ # ...
+ # ImportError: ./_MMCorePy.so: undefined symbol: _ZTI8CMMError
+ # ... etc
+ patch -p0 < "$srcdir/python_setup.diff"
+
+ sh mmUnixBuild.sh
+}
+
+build() {
+ cd "$srcdir/$pkgname"
+ # Without Java-based GUI too.
+ # Feel free to improve package to work with ImageJ or FIJI.
+ ./configure --prefix=/usr --without-imagej --enable-python
+ make
+}
+
+# check() {
+# cd "$srcdir/$pkgname"
+# make -k check
+# }
+
+package() {
+ cd "$srcdir/$pkgname"
+ make DESTDIR="$pkgdir/" install
+
+ # Micro-manager devs plan use autotools without setuptools for python.
+ cd "$srcdir/$pkgname/MMCorePy_wrap/"
+ python2 setup.py install --root="$pkgdir"
+
+ # We need to update ldconfig cache with new libs.
+ install -D -m644 "$srcdir/micromanager-lib.conf" "$pkgdir/etc/ld.so.conf.d/micromanager-lib.conf"
+}
+
+# This script print 'DemoCamera' property list if CMMCore and python bindings
+# was installed well.
+# $ python2 -c 'import MMCorePy; DEVICE = ["Camera", "DemoCamera", "DCam"]; mmc = MMCorePy.CMMCore(); mmc.loadDevice(*DEVICE); mmc.initializeDevice(DEVICE[0]); mmc.setCameraDevice(DEVICE[0]); print mmc.getDevicePropertyNames(DEVICE[0])'
diff --git a/info.txt b/info.txt
new file mode 100644
index 000000000000..95d9a7cf0eb1
--- /dev/null
+++ b/info.txt
@@ -0,0 +1,90 @@
+# extra/libraw1394 Provides an API to the Linux IEEE1394 (FireWire) driver
+# extra/libavc1394 0.5.4-2 A library to control A/V devices using the 1394ta AV/C commands.
+# extra/libdc1394 2.2.1-2 High level programming interface to control IEEE 1394 based cameras
+# extra/libiec61883 1.2.0-4 A higher level API for streaming DV, MPEG-2 and audio over Linux IEEE 1394
+
+# git clone https://github.com/mdcurtis/micromanager-upstream.git
+# git checkout tags/1.4.13
+wget -c http://github.com/mdcurtis/micromanager-upstream/archive/1.4.13.tar.gz
+Версия 1.4.13 вышла
+ 16.11.2012 21:05:26 Смена текстовой версии
+ 30.11.2012 11:49:07 На сайте и GitHub
+
+ 05.07.2013 1.4.13 ebuild python
+ 22.09.2013 1.4.13 ebuild zlib
+Версия 1.4.14
+ 20.03.2013 На сайте
+Версия 1.4.15
+ 23.09.2013 на сайте, коммит svn 10680
+ 23.09.2013 12:35:02 исключили адаптер камеры svn 11822
+
+ 16.10.2013 собирают под Ubuntu 13.10 x64
+ 21.10.2013 Открыт тикет [MMCorePy Unix build is missing libraries](https://valelab.ucsf.edu/trac/micromanager/ticket/685)
+ 27.10.2013 добавил boost_system in setup.py, но это сломало сборку в других местах.
+
+ # The error should be fixed in r11990 (i.e. there should no longer be
+ # any need for -fpermissive).
+
+ # Turns out the code causing the error wasn't actually ever being called
+ # -- although it may have crashed if called, so the compiler was doing
+ # its job right by making it an error.
+
+ # I've also addressed the include path issue you raised (r11991).
+
+ # Having looked at this code, I'd have to characterize MMCorePy
+ # (especially its Unix build system) as an unfinished project (which
+ # hasn't received much attention for a few years). Hopefully the basic
+ # functionality is there, though, once it's built.
+
+ # You are also right about the boost.system symbols missing (there are
+ # actually more symbols missing on Mac OS X; it looks like the Mac build
+ # has been broken for quite a while). There was also a source file
+ # missing, which I added in r11992.
+
+ # I think the best way to address the missing libraries issue is to
+ # remove the setup.py and compile the module from Makefile.am (this
+ # should allow it to use the same Boost as the other parts of MM,
+ # determined by the configure script). I'm going to leave this as an
+ # open ticket for now:
+
+prepare()
+
+# Needed
+# SWIG может для python2.
+# Используется сборка при помощи distutils
+$ sed -i -e 's/python setup.py build_ext --inplace/python2 setup.py build_ext --inplace/g' MMCorePy_wrap/Makefile.am
+$ sed -i -e 's: $(DEVICEADAPTERPATH): $(DESTDIR)\/$(DEVICEADAPTERPATH):' MMCorePy_wrap/Makefile.am
+
+# Z Вроде не обязательно.
+libraries = ['boost_system', 'z'],
+
+$ sh mmUnixBuild.sh
+build()
+$ ./configure --prefix=/usr --without-imagej --enable-python
+
+
+# Fixed
+# /usr/include/python2.7/numpy/
+# include_dirs=numpy.distutils.misc_util.get_numpy_include_dirs(),
+# $ sed -i -e "/include_dirs/s~=.*~= \[\/usr/include/python2.7/numpy/"\]~" MMCorePy_wrap/setup.py
+
+# Fixed
+# DeviceUtils.cpp add `include <unistd.h>`
+
+
+$ make -j9
+# cp MMCorePy.py ../bin
+# cp _MMCorePy.so ../bin
+
+package()
+# make DESTDIR="/home/radioxoma/build/mm/pkg/" install
+$ make DESTDIR="$pkgdir" install
+
+
+# This particular error should be fixed in r11992, but let me know if it
+# > still results in other undefined symbols (other than Boost.System).
+
+# https://stackoverflow.com/questions/11643666/python-importerror-undefined-symbol-for-custom-c-module
+
+g++ -fPIC -shared -o mymodule.so mymodule.cpp `pkg-config --cflags --libs python` `pkg-config --cflags --libs opencv` -I/usr/local/include/opencv2/legacy
+g++ -fPIC -shared -o mymodule.so mymodule.cpp `pkg-config --cflags --libs python` `pkg-config --cflags --libs opencv` -I/usr/local/include/opencv2/legacy \ No newline at end of file
diff --git a/micromanager-lib.conf b/micromanager-lib.conf
new file mode 100644
index 000000000000..9e5934ca167c
--- /dev/null
+++ b/micromanager-lib.conf
@@ -0,0 +1 @@
+/usr/lib/micro-manager
diff --git a/mm.install b/mm.install
new file mode 100644
index 000000000000..7a0e5d40fefb
--- /dev/null
+++ b/mm.install
@@ -0,0 +1,15 @@
+# arg 1: the new package version
+post_install() {
+ ldconfig
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+post_upgrade() {
+ post_install
+}
+
+# arg 1: the old package version
+post_remove() {
+ post_install
+}
diff --git a/python_makefile.diff b/python_makefile.diff
new file mode 100644
index 000000000000..00c06e191108
--- /dev/null
+++ b/python_makefile.diff
@@ -0,0 +1,22 @@
+--- MMCorePy_wrap/Makefile.am 2014-01-21 05:25:37.000000000 +0300
++++ MMCorePy_wrap/Makefile_new.am 2014-01-24 17:14:15.904157691 +0300
+@@ -34,18 +34,14 @@
+ $(top_srcdir)/MMCore/LoadableModules/LoadedDeviceAdapter.cpp
+
+ _MMCorePy.so: MMCorePy_wrap.cxx $(MMCOREPYSOURCES)
+- python setup.py build_ext --inplace
++ python2 setup.py build
+
+ all:
+ make MMCorePy_wrap.cxx
+ make MMCorePy.py
+ make _MMCorePy.so
+- cp MMCorePy.py ../bin
+- cp _MMCorePy.so ../bin
+
+ install:
+- cp MMCorePy.py $(DEVICEADAPTERPATH)
+- cp _MMCorePy.so $(DEVICEADAPTERPATH)
+
+ clean:
+ rm MMCorePy_wrap.cxx || echo "Not found, no problem"
diff --git a/python_setup.diff b/python_setup.diff
new file mode 100644
index 000000000000..17df60da04aa
--- /dev/null
+++ b/python_setup.diff
@@ -0,0 +1,25 @@
+--- MMCorePy_wrap/setup.py 2014-01-21 05:25:37.000000000 +0300
++++ MMCorePy_wrap/setup_new.py 2014-01-23 04:06:20.676996837 +0300
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+
+ """
+ This setup.py is intended for use from the Autoconf/Automake build system.
+@@ -27,10 +27,16 @@
+ '../MMCore/Host.cpp',
+ '../MMCore/MMCore.cpp',
+ '../MMCore/PluginManager.cpp',
++ '../MMCore/Error.cpp',
++ '../MMCore/LoadableModules/LoadedDeviceAdapter.cpp',
++ '../MMCore/LoadableModules/LoadedModule.cpp',
++ '../MMCore/LoadableModules/LoadedModuleImpl.cpp',
++ '../MMCore/LoadableModules/LoadedModuleImplUnix.cpp',
+ '../MMDevice/DeviceUtils.cpp',
+ '../MMDevice/ImgBuffer.cpp',
+ ],
+ language="c++",
++ libraries=['boost_system', 'z'],
+ include_dirs=numpy.distutils.misc_util.get_numpy_include_dirs(),
+ )
+