Prev / Next

2013-03-23 / Oracle Solaris で pycrypto をビルドする

#A君 が Shizuoka.py (http://atnd.org/events/38088) で fabric について話すようなので、
fabric のパッケージを作ろうとしたところ、

fabric -> paramiko -> pycrypto


という依存関係のため、pycrypto を作ることに。

いつも通り spec file を作って specbuild すると
src/_fastmath.c で warning がでまくり

pkgbuild: "src/_fastmath.c", line 1652: cannot dereference non-pointer type
pkgbuild: "src/_fastmath.c", line 1653: cannot dereference non-pointer type
pkgbuild: "src/_fastmath.c", line 1654: cannot dereference non-pointer type
pkgbuild: "src/_fastmath.c", line 1655: cannot dereference non-pointer type
pkgbuild: "src/_fastmath.c", line 1661: undefined symbol: X
pkgbuild: "src/_fastmath.c", line 1662: undefined symbol: X


というところで止まる。

ググると、
- an enthusiastic austrian solaris user: Compiling pycrypto 2.3 and paramiko 1.7.7.1 on OpenIndiana/Solaris
http://ewaldertl.blogspot.jp/2011/06/compiling-pycrypto-23-and-paramiko-1771.html

というのが見つかったので、これにしたがって、_fastmath.c を書き換え。

--- src/_fastmath.c.orig        2013年  3月 23日 (土)
+++ src/_fastmath.c     2013年  3月 23日 (土)
@@ -33,7 +33,7 @@
#include <longintrepr.h>                               /* for conversions */
#include "config.h"
#if HAVE_LIBGMP
-# include <gmp.h>
+# include <gmp/gmp.h>
#elif HAVE_LIBMPIR
# include <mpir.h>
#else


これでビルドできた。

動作確認は fabric の使い方を確認しつつやるつもり。

comments powered by Disqus