[Buildroot] [PATCH/RFC v3 02/50] package/libsquish: New package

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Sun Jul 19 19:24:45 UTC 2015


Dear Bernd Kuhls,

On Sun, 19 Jul 2015 21:05:07 +0200, Bernd Kuhls wrote:

> diff --git a/package/libsquish/libsquish.mk b/package/libsquish/libsquish.mk
> new file mode 100644
> index 0000000..df37368
> --- /dev/null
> +++ b/package/libsquish/libsquish.mk
> @@ -0,0 +1,36 @@
> +################################################################################
> +#
> +# libsquish
> +#
> +################################################################################
> +
> +LIBSQUISH_VERSION = 1.13
> +LIBSQUISH_SOURCE = libsquish-$(LIBSQUISH_VERSION).tgz
> +LIBSQUISH_SITE = http://downloads.sourceforge.net/project/libsquish
> +LIBSQUISH_INSTALL_STAGING = YES
> +LIBSQUISH_STRIP_COMPONENTS = 0
> +LIBSQUISH_LICENSE = MIT
> +LIBSQUISH_LICENSE_FILES = README
> +
> +define LIBSQUISH_BUILD_CMDS
> +	$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)
> +endef
> +
> +define LIBSQUISH_INSTALL_STAGING_CMDS
> +	mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig/
> +	$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) install \
> +		PREFIX=/usr INSTALL_DIR=$(STAGING_DIR)/usr
> +	$(INSTALL) -m 644 $(@D)/squish.pc $(STAGING_DIR)/usr/lib/pkgconfig
> +	ln -sf libsquish.so.0.0 $(STAGING_DIR)/usr/lib/libsquish.so
> +
> +endef
> +
> +define LIBSQUISH_INSTALL_TARGET_CMDS
> +	mkdir -p $(TARGET_DIR)/usr/include/
> +	mkdir -p $(TARGET_DIR)/usr/lib/pkgconfig/
> +	$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) install \
> +		PREFIX=/usr INSTALL_DIR=$(TARGET_DIR)/usr
> +	ln -sf libsquish.so.0.0 $(TARGET_DIR)/usr/lib/libsquish.so
> +endef
> +
> +$(eval $(generic-package))

Have you considered using the CMakeLists.txt provided in libsquish, and
therefore use the cmake-package infrastructure? It should properly
handle the shared vs. static library case, and reduce the amount of
manual stuff that you need to do in LIBSQUISH_INSTALL_STAGING_CMDS and
LIBSQUISH_INSTALL_TARGET_CMDS.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com



More information about the buildroot mailing list