首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >自定义编译一个鸡蛋并安装控制台脚本

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

Stack Overflow用户
提问于 2014-05-22 07:30:08
回答 2查看 534关注 0票数 0

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

代码语言:javascript
复制
[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

我得到以下信息

代码语言:javascript
复制
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

它似乎又试图编译它。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-05-23 05:51:06

好吧,我想出来了。是的,结合使用zc.recipe.egg:scripts和zc.recipe.egg:custom是正确的方法。但这让人困惑,因为zc.recipe.egg:custom没有构建依赖项,因此它似乎没有选择构建的s3ql。

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

代码语言:javascript
复制
[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
票数 0
EN

Stack Overflow用户

发布于 2014-05-22 19:07:13

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

代码语言:javascript
复制
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
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23800406

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档