* [Buildroot] Installing libpq
@ 2015-08-16 11:59 Chris Reeves
2015-08-24 20:51 ` Arnout Vandecappelle
0 siblings, 1 reply; 2+ messages in thread
From: Chris Reeves @ 2015-08-16 11:59 UTC (permalink / raw)
To: buildroot
Hi
I'm new to using buildroot, trying to create some lightweight containers.
My application requires libpq in order to install psycopg2. I don't really
want to install al of Postgres to get it so I had a go at creating a
package that is basically the equivalent too libpq-dev in the liks of
Ubuntu and Debian.
I basically copied the postgres.mk file and amended to do what I think
should be correct though I must confess I'm not really sure what I'm doing,
here is the libpq.mk file i've created:
LIBPQ_VERSION = 9.4.4
LIBPQ_SOURCE = postgresql-$(LIBPQ_VERSION).tar.bz2
LIBPQ_SITE = http://ftp.postgresql.org/pub/source/v$(LIBPQ_VERSION)
LIBPQ_LICENSE = PostgreSQL
LIBPQ_LICENSE_FILES = COPYRIGHT
LIBPQ_INSTALL_STAGING = YES
ifneq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
LIBPQ_CONF_OPTS += --disable-thread-safety
endif
ifeq
($(BR2_arcle)$(BR2_arceb)$(BR2_microblazeel)$(BR2_microblazebe)$(BR2_nios2)$(BR2_xtensa),y)
LIBPQ_CONF_OPTS += --disable-spinlocks
endif
ifeq ($(BR2_PACKAGE_READLINE),y)
LIBPQ_DEPENDENCIES += readline
else
LIBPQ_CONF_OPTS += --without-readline
endif
ifeq ($(BR2_PACKAGE_ZLIB),y)
LIBPQ_DEPENDENCIES += zlib
else
LIBPQ_CONF_OPTS += --without-zlib
endif
ifeq ($(BR2_PACKAGE_TZDATA),y)
LIBPQ_DEPENDENCIES += tzdata
LIBPQ_CONF_OPTS += --with-system-tzdata=/usr/share/zoneinfo
else
LIBPQ_DEPENDENCIES += host-zic
LIBPQ_CONF_ENV += ZIC=$$(ZIC)
endif
ifeq ($(BR2_PACKAGE_OPENSSL),y)
LIBPQ_DEPENDENCIES += openssl
LIBPQ_CONF_OPTS += --with-openssl
endif
define LIBPQ_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/src/interfaces/libpq
DESTDIR=$(TARGET_DIR) install
endef
$(eval $(autotools-package))
This seems to work since I see buildroot install to target:
PATH="/tmp/buildroot/output/host/bin:/tmp/buildroot/output/host/sbin:/tmp/buildroot/output/host/usr/bin:/tmp/buildroot/output/host/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
/usr/bin/make -j2 -C
/tmp/buildroot/output/build/libpq-9.4.4/src/interfaces/libpq
DESTDIR=/tmp/buildroot/output/target install
make[1]: Entering directory
'/tmp/buildroot/output/build/libpq-9.4.4/src/interfaces/libpq'
/bin/mkdir -p '/tmp/buildroot/output/target/usr/lib'
'/tmp/buildroot/output/target/usr/lib/pkgconfig'
/bin/mkdir -p '/tmp/buildroot/output/target/usr/include'
'/tmp/buildroot/output/target/usr/include/postgresql/internal'
'/tmp/buildroot/output/target/usr/share/postgresql'
/usr/bin/install -c -m 755 libpq.so.5.7
'/tmp/buildroot/output/target/usr/lib/libpq.so.5.7'
cd '/tmp/buildroot/output/target/usr/lib' && \
rm -f libpq.so.5 && \
ln -s libpq.so.5.7 libpq.so.5
/usr/bin/install -c -m 644 libpq.a
'/tmp/buildroot/output/target/usr/lib/libpq.a'
/usr/bin/install -c -m 644 libpq.pc
'/tmp/buildroot/output/target/usr/lib/pkgconfig/libpq.pc'
cd '/tmp/buildroot/output/target/usr/lib' && \
rm -f libpq.so && \
ln -s libpq.so.5.7 libpq.so
/usr/bin/install -c -m 644 ./libpq-fe.h
'/tmp/buildroot/output/target/usr/include'
/usr/bin/install -c -m 644 ./libpq-events.h
'/tmp/buildroot/output/target/usr/include'
/usr/bin/install -c -m 644 ./libpq-int.h
'/tmp/buildroot/output/target/usr/include/postgresql/internal'
/usr/bin/install -c -m 644 ./pqexpbuffer.h
'/tmp/buildroot/output/target/usr/include/postgresql/internal'
/usr/bin/install -c -m 644 ./pg_service.conf.sample
'/tmp/buildroot/output/target/usr/share/postgresql/pg_service.conf.sample'
make[1]: Leaving directory
'/tmp/buildroot/output/build/libpq-9.4.4/src/interfaces/libpq'
However the files I expect like the .so's and the headers don't end up in
the rootfs.
I'm not exactly sure what I'm doing wrong.
Any help / pointer in the right would be greatly appreciated :)
Thanks,
Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20150816/e83d96b1/attachment.html>
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Buildroot] Installing libpq
2015-08-16 11:59 [Buildroot] Installing libpq Chris Reeves
@ 2015-08-24 20:51 ` Arnout Vandecappelle
0 siblings, 0 replies; 2+ messages in thread
From: Arnout Vandecappelle @ 2015-08-24 20:51 UTC (permalink / raw)
To: buildroot
On 08/16/2015 01:59 PM, Chris Reeves wrote:
> Hi
>
> I'm new to using buildroot, trying to create some lightweight containers. My
> application requires libpq in order to install psycopg2. I don't really want to
> install al of Postgres to get it so I had a go at creating a package that is
> basically the equivalent too libpq-dev in the liks of Ubuntu and Debian.
For something like this, you don't want to create a new package. Instead, you
should add options to the postgresql package to build just the library or also
the server (see libidn for a simple example).
[snip]
> '/tmp/buildroot/output/build/libpq-9.4.4/src/interfaces/libpq'
> /bin/mkdir -p '/tmp/buildroot/output/target/usr/lib'
> '/tmp/buildroot/output/target/usr/lib/pkgconfig'
> /bin/mkdir -p '/tmp/buildroot/output/target/usr/include'
> '/tmp/buildroot/output/target/usr/include/postgresql/internal'
> '/tmp/buildroot/output/target/usr/share/postgresql'
> /usr/bin/install -c -m 755 libpq.so.5.7
> '/tmp/buildroot/output/target/usr/lib/libpq.so.5.7'
> cd '/tmp/buildroot/output/target/usr/lib' && \
> rm -f libpq.so.5 && \
> ln -s libpq.so.5.7 libpq.so.5
> /usr/bin/install -c -m 644 libpq.a '/tmp/buildroot/output/target/usr/lib/libpq.a'
> /usr/bin/install -c -m 644 libpq.pc
> '/tmp/buildroot/output/target/usr/lib/pkgconfig/libpq.pc'
> cd '/tmp/buildroot/output/target/usr/lib' && \
> rm -f libpq.so && \
> ln -s libpq.so.5.7 libpq.so
> /usr/bin/install -c -m 644 ./libpq-fe.h '/tmp/buildroot/output/target/usr/include'
> /usr/bin/install -c -m 644 ./libpq-events.h
> '/tmp/buildroot/output/target/usr/include'
> /usr/bin/install -c -m 644 ./libpq-int.h
> '/tmp/buildroot/output/target/usr/include/postgresql/internal'
> /usr/bin/install -c -m 644 ./pqexpbuffer.h
> '/tmp/buildroot/output/target/usr/include/postgresql/internal'
> /usr/bin/install -c -m 644 ./pg_service.conf.sample
> '/tmp/buildroot/output/target/usr/share/postgresql/pg_service.conf.sample'
> make[1]: Leaving directory
> '/tmp/buildroot/output/build/libpq-9.4.4/src/interfaces/libpq'
>
> However the files I expect like the .so's and the headers don't end up in the
> rootfs.
That the headers don't appear in the rootfs is normal: they are removed by
buildroot. Since your target doesn't have a compiler, the headers are useless.
However, the .so library should still be there. If not, the server wouldn't
even be able to run...
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-08-24 20:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-16 11:59 [Buildroot] Installing libpq Chris Reeves
2015-08-24 20:51 ` Arnout Vandecappelle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox