這是編譯和鏈接一個靜態庫(所以只有一個構建時間依賴),源是從一個存儲庫中提取(就像主程序的源代碼)在Ubuntu的啓動板構建機器人。如何從pbuilder env debian/rules腳本中使用cmake的'make install'?
目前我在做什麼:
#!/usr/bin/make -f
export PREFIX=/usr
export CFLAGS= -O3 -fomit-frame-pointer -flto -fwhole-program
export CXXFLAGS= -O3 -fomit-frame-pointer -flto -fwhole-program
%:
dh [email protected]
override_dh_auto_configure:
cd src/munt;cmake -DCMAKE_CXX_FLAGS="-O3 -fomit-frame-pointer -flto" mt32emu;make;make install
#...compile of the program that depends on mt32emu...
但它失敗:
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/lib/libmt32emu.a
CMake Error at cmake_install.cmake:36 (FILE):
file INSTALL cannot copy file
"/tmp/buildd/dosbox-0.74+20121225/src/munt/libmt32emu.a" to
"/usr/local/lib/libmt32emu.a".
make[2]: *** [install] Error 1
make[2]: Leaving directory `/tmp/buildd/dosbox-0.74+20121225/src/munt'
make[1]: *** [override_dh_auto_configure] Error 2
make[1]: Leaving directory `/tmp/buildd/dosbox-0.74+20121225'
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
E: Failed autobuilding of package
I: unmounting /var/cache/pbuilder/ccache filesystem
I: unmounting dev/pts filesystem
I: unmounting proc filesystem
I: cleaning the build env
I: removing directory /var/cache/pbuilder/build//2751 and its subdirectories
的想法是要安裝沒有打包在Ubuntu軟件庫在Launchpad中pbuilder靜態庫的依賴env,因此可以像使用系統依賴一樣使用它。
如果我嘗試做'sudo make install'(並且在debian/control中爲build-deps添加sudo),它會在本地測試時詢問'pbuilder'的密碼,機器上的Ubuntu的buildbots。
編輯:它實際上在buildbots上失敗,因爲'沒有指定tty present和沒有askpass程序'。