自定义编译一个鸡蛋并安装控制台脚本

时间:2014-05-22 07:30:08

标签: buildout

我正在努力让以下构建工作正常。 buildout是自包含的,所以我不想安装任何系统包

[s3ql]
recipe = zc.recipe.egg:scripts
eggs =
    ${s3ql-build:egg}

[s3ql-build]
recipe = zc.recipe.egg:custom
egg = s3ql
find-links =
   https://bitbucket.org/nikratio/s3ql/downloads/s3ql-1.18.1.tar.bz2#egg=s3ql-1.18.1
   http://security.ubuntu.com/ubuntu/pool/universe/s/s3ql/s3ql_1.16.orig.tar.bz2#egg=s3ql
   https://github.com/wilkinson/s3ql/archive/master.zip#egg=s3ql
   https://github.com/rogerbinns/apsw/releases/download/3.8.4.3-r1/apsw-3.8.4.3-r1.zip
include-dirs =
    ${liblzma:location}/include
    ${sqlite:location}/include
library-dirs =
    ${liblzma:location}/lib
    ${sqlite:location}/lib
rpath =
    ${liblzma:location}/lib
    ${sqlite:location}/lib

[liblzma]
recipe = zc.recipe.cmmi
url = http://tukaani.org/xz/xz-5.0.5.tar.gz

[pysqlite]
recipe = zc.recipe.egg:custom
egg = pysqlite
include-dirs = ${sqlite:location}/include
library-dirs = ${sqlite:location}/lib
rpath = ${sqlite:location}/lib

[sqlite]
recipe = zc.recipe.cmmi
url = http://www.sqlite.org/2014/sqlite-autoconf-3080403.tar.gz

我得到以下

Updating liblzma.
Updating sqlite.
Updating s3ql-build.
Installing s3ql.
Getting distribution for 'pyliblzma>=0.5.3'.
/bin/sh: 1: pkg-config: not found
/bin/sh: 1: pkg-config: not found
In file included from src/liblzma.c:1:0:
src/liblzma.h:24:18: fatal error: lzma.h: No such file or directory
compilation terminated.
error: Setup script exited with error: 
command 'gcc' failed with exit status 1
An error occurred when trying to install pyliblzma 0.5.3. Look above this message for any errors that were output by easy_install.
While:
   Installing s3ql.
   Getting distribution for 'pyliblzma>=0.5.3'.
Error: Couldn't install: pyliblzma 0.5.3

似乎它试图再次编译它。

2 个答案:

答案 0 :(得分:0)

您需要在您的操作系统上安装liblzma-dev。

gottfried@dell-xt2:~/virtualenvs/liblzma$ sudo apt-get install liblzma-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  liblzma-doc
The following NEW packages will be installed:
  liblzma-dev
0 upgraded, 1 newly installed, 0 to remove and 22 not upgraded.
Need to get 159 kB of archives.
After this operation, 645 kB of additional disk space will be used.
Get:1 http://de.archive.ubuntu.com/ubuntu/ saucy/main liblzma-dev amd64 5.1.1alpha+20120614-2ubuntu1 [159 kB]
Fetched 159 kB in 1s (111 kB/s)       
Selecting previously unselected package liblzma-dev:amd64.
(Reading database ... 272326 files and directories currently installed.)
Unpacking liblzma-dev:amd64 (from .../liblzma-dev_5.1.1alpha+20120614-2ubuntu1_amd64.deb) ...
Setting up liblzma-dev:amd64 (5.1.1alpha+20120614-2ubuntu1) ...

gottfried@dell-xt2:~/virtualenvs/liblzma$ bin/easy_install pyliblzma
Searching for pyliblzma
Reading https://pypi.python.org/simple/pyliblzma/
Best match: pyliblzma 0.5.3
Downloading https://pypi.python.org/packages/source/p/pyliblzma/pyliblzma-0.5.3.tar.bz2#md5=500f61116ee1ab4063b49c121786863a
Processing pyliblzma-0.5.3.tar.bz2
Writing /tmp/easy_install-kAg4nj/pyliblzma-0.5.3/setup.cfg
Running pyliblzma-0.5.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-kAg4nj/pyliblzma-0.5.3/egg-dist-tmp-TmcZm_
/bin/sh: 1: pkg-config: not found
/bin/sh: 1: pkg-config: not found
zip_safe flag not set; analyzing archive contents...
Adding pyliblzma 0.5.3 to easy-install.pth file

Installed /home/gottfried/virtualenvs/liblzma/lib/python2.7/site-packages/pyliblzma-0.5.3-py2.7-linux-x86_64.egg
Processing dependencies for pyliblzma
Finished processing dependencies for pyliblzma

答案 1 :(得分:0)

好吧,我明白了。是的,使用zc.recipe.egg:scripts和zc.recipe.egg的组合:custom是正确的方法。但它令人困惑,因为zc.recipe.egg:custom不构建依赖项,因此看起来它没有拿起构建的s3ql。

这是为我构建的解决方案。

[s3ql]
recipe = zc.recipe.egg:scripts
eggs =
    ${pyliblzma:egg}
    ${llfuse:egg}
    ${apsw:egg}
    ${s3ql-build:egg}    

[s3ql-build]
recipe = zc.recipe.egg:custom
egg = s3ql
find-links =
   https://bitbucket.org/nikratio/s3ql/downloads/s3ql-1.18.1.tar.bz2#egg=s3ql-1.18.1
# need this patch to build on osx
# https://bitbucket.org/nikratio/s3ql/commits/39352e8e4cb48521dd9ff589e93fc2e4ae390f9d/raw/
include-dirs =
    ${liblzma:location}/include
    ${sqlite:location}/include
library-dirs =
    ${liblzma:location}/lib
    ${sqlite:location}/lib
rpath =
    ${liblzma:location}/lib
    ${sqlite:location}/lib

[pyliblzma]
recipe = zc.recipe.egg:custom
egg = pyliblzma
include-dirs = ${liblzma:location}/include
library-dirs = ${liblzma:location}/lib
rpath = ${liblzma:location}/lib

[llfuse]
recipe = zc.recipe.egg:custom
egg = llfuse
# NOTE: requires apt-get install libfuse-dev pkg-config libattr1-dev
# fuse has to go into the kernal so we can't compile it into the buildout


[apsw]
recipe = zc.recipe.egg:custom
egg = apsw
find-links =
   https://github.com/rogerbinns/apsw/releases/download/3.8.4.3-r1/apsw-3.8.4.3-r1.zip
# includes, libraries etc is ignored by apsw setup.py
environment = apsw-env
[apsw-env]
CPPFLAGS= -I${sqlite:location}/include -I${liblzma:location}/lib
LDFLAGS= -L${sqlite:location}/lib -Wl,-rpath=${sqlite:location}/lib -L${liblzma:location}/include -Wl,-rpath=${liblzma:location}/lib
PKG_CONFIG_PATH=${sqlite:location}/lib/pkgconfig:${liblzma:location}/lib/pkgconfig



[liblzma]
recipe = zc.recipe.cmmi
url = http://tukaani.org/xz/xz-5.0.5.tar.gz

[sqlite]
recipe = zc.recipe.cmmi
url = http://www.sqlite.org/2014/sqlite-autoconf-3080403.tar.gz
相关问题