Estou tentando fazer um snap para um aplicativo do Qt chamado Cockatrice. Para compilar, requer a biblioteca protobuf. Meu arquivo snapcraft é o seguinte:
name: cockatrice
version: '2016-10-30'
summary: 'A cross-platform virtual tabletop for multiplayer card games'
description: |
Cockatrice is an open-source multiplatform supported program for playing tabletop card games over a network.
The program's server design prevents any kind of client modifications to gain an unfair advantage in a game.
The client also has a built in single-player mode where you can brew without being connected to a server.
This project is written in C++ and is using the Qt5 libraries.
grade: stable
confinement: strict
parts:
protobuf:
source: https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
plugin: autotools
snap:
- -bin
- -lib
- -include
- -share
cockatrice:
source: .
plugin: cmake
stage-packages:
- qt5-default
- qttools5-dev
- qttools5-dev-tools
- qtmultimedia5-dev
- libqt5multimedia5-plugins
- libqt5svg5-dev
- libqt5sql5-mysql
after:
- protobuf
# - qt5conf
- desktop/qt5
apps:
cockatrice:
command: bin/cockatrice
plugs:
- network
- unity7
O que acontece é, protobuf compila corretamente, e então o cmake do cockatrice começa a rodar, e encontra o arquivo protobuf .so
corretamente:
-- Found Protobuf: /home/michael/Programming/Cockatrice/stage/lib/libprotobuf.so
-- Found ZLIB: /home/michael/Programming/Cockatrice/parts/cockatrice/install/usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8")
No entanto, quando se trata de ligar a aplicação, parece que não é possível encontrar cabeçalhos para protobuf (existem milhares destes erros com todos os tipos de protobufs diferentes):
../common/pb/libcockatrice_protocol.a(admin_commands.pb.cc.o): In function 'Command_ShutdownServer::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)':
admin_commands.pb.cc:(.text+0xe02): undefined reference to 'google::protobuf::io::CodedInputStream::ReadVarint32Fallback(unsigned int*)'
admin_commands.pb.cc:(.text+0xe84): undefined reference to 'google::protobuf::io::CodedInputStream::ReadTagFallback()'
admin_commands.pb.cc:(.text+0xec0): undefined reference to 'google::protobuf::internal::kEmptyString[abi:cxx11]'
admin_commands.pb.cc:(.text+0xece): undefined reference to 'google::protobuf::internal::WireFormatLite::ReadString(google::protobuf::io::CodedInputStream*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
admin_commands.pb.cc:(.text+0xee4): undefined reference to 'google::protobuf::internal::WireFormat::VerifyUTF8StringFallback(char const*, int, google::protobuf::internal::WireFormat::Operation)'
../common/pb/libcockatrice_protocol.a(admin_commands.pb.cc.o): In function 'AdminCommand::AdminCommand()':
admin_commands.pb.cc:(.text+0x139f): undefined reference to 'google::protobuf::UnknownFieldSet::UnknownFieldSet()'
admin_commands.pb.cc:(.text+0x13bd): undefined reference to 'google::protobuf::Message::~Message()'
admin_commands.pb.cc:(.text+0x13d3): undefined reference to 'google::protobuf::UnknownFieldSet::~UnknownFieldSet()'
Isso tem algo a ver com o campo snap
do protobuf, não expondo seus arquivos .h
corretamente? Se eu olhar no diretório de inclusão, parece que os arquivos de cabeçalho existem, no entanto:
ls /home/michael/Programming/Cockatrice/stage/include/google/protobuf/
compiler/ descriptor.pb.h extension_set.h generated_message_util.h message_lite.h service.h unknown_field_set.h wire_format_lite_inl.h
descriptor_database.h descriptor.proto generated_enum_reflection.h io/ reflection_ops.h stubs/ wire_format.h
descriptor.h dynamic_message.h generated_message_reflection.h message.h repeated_field.h text_format.h wire_format_lite.h
Como posso obter o cockatrice para vincular corretamente?