diff mbox series

[3/5] package/mupdf: fix building shared libraries

Message ID 20240216211344.1807353-4-raphael.melotte@mind.be
State New
Headers show
Series package/python-pymupdf: bump to version 1.23.22 | expand

Commit Message

Raphaël Mélotte Feb. 16, 2024, 9:13 p.m. UTC
By default mupdf generates static libraries, shared libraries must be
enabled explicitely.

The Makefile doesn't make it possible to build both static and shared
libs, so add a 'depends on' accordingly.

Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
---
 package/mupdf/Config.in | 4 ++++
 package/mupdf/mupdf.mk  | 5 +++++
 2 files changed, 9 insertions(+)

Comments

Arnout Vandecappelle April 1, 2024, 8:06 p.m. UTC | #1
On 16/02/2024 22:13, Raphaël Mélotte via buildroot wrote:
> By default mupdf generates static libraries, shared libraries must be
> enabled explicitely.
> 
> The Makefile doesn't make it possible to build both static and shared
> libs, so add a 'depends on' accordingly.

  There are many packages for which is the case, for example (almost) all CMake 
packages - unless a package does something specific, CMake supports only static 
_or_ dynamic libraries.

  We solve that by building only shared libraries even if BR2_SHARED_STATIC_LIBS 
is set.

> 
> Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
> ---
>   package/mupdf/Config.in | 4 ++++
>   package/mupdf/mupdf.mk  | 5 +++++
>   2 files changed, 9 insertions(+)
> 
> diff --git a/package/mupdf/Config.in b/package/mupdf/Config.in
> index cf97711160..092e1d8ac6 100644
> --- a/package/mupdf/Config.in
> +++ b/package/mupdf/Config.in
> @@ -1,9 +1,13 @@
> +comment "MuPDF can build static or shared libs, but not both at the same time."
> +	depends on BR2_SHARED_STATIC_LIBS
> +
>   config BR2_PACKAGE_MUPDF
>   	bool "mupdf"
>   	depends on BR2_INSTALL_LIBSTDCPP # harfbuzz
>   	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # harfbuzz
>   	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # harfbuzz
>   	depends on BR2_PACKAGE_XORG7
> +	depends on !BR2_SHARED_STATIC_LIBS

  So this bit should just be removed.

>   	select BR2_PACKAGE_FREETYPE
>   	select BR2_PACKAGE_GUMBO_PARSER
>   	select BR2_PACKAGE_HARFBUZZ
> diff --git a/package/mupdf/mupdf.mk b/package/mupdf/mupdf.mk
> index 08894d7980..d2105497be 100644
> --- a/package/mupdf/mupdf.mk
> +++ b/package/mupdf/mupdf.mk
> @@ -50,6 +50,11 @@ MUPDF_MAKE_OPTS = \
>   	HAVE_OBJCOPY=no \
>   	prefix="/usr"
>   
> +# The default in MuPDF is static libs
> +ifeq ($(BR2_SHARED_LIBS),y)

  And here it should check for BR2_STATIC_LIBS.

> +MUPDF_MAKE_OPTS += shared=yes

  And we probably want both the yes and no explicitly. So:

ifeq ($(BR2_STATIC_LIBS),y)
MUPDF_MAKE_OPTS += shared=no
else
MUPDF_MAKE_OPTS += shared=yes
endif


  Regards,
  Arnout

> +endif
> +
>   ifeq ($(BR2_PACKAGE_LIBFREEGLUT),y)
>   MUPDF_DEPENDENCIES += libfreeglut
>   else
diff mbox series

Patch

diff --git a/package/mupdf/Config.in b/package/mupdf/Config.in
index cf97711160..092e1d8ac6 100644
--- a/package/mupdf/Config.in
+++ b/package/mupdf/Config.in
@@ -1,9 +1,13 @@ 
+comment "MuPDF can build static or shared libs, but not both at the same time."
+	depends on BR2_SHARED_STATIC_LIBS
+
 config BR2_PACKAGE_MUPDF
 	bool "mupdf"
 	depends on BR2_INSTALL_LIBSTDCPP # harfbuzz
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # harfbuzz
 	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # harfbuzz
 	depends on BR2_PACKAGE_XORG7
+	depends on !BR2_SHARED_STATIC_LIBS
 	select BR2_PACKAGE_FREETYPE
 	select BR2_PACKAGE_GUMBO_PARSER
 	select BR2_PACKAGE_HARFBUZZ
diff --git a/package/mupdf/mupdf.mk b/package/mupdf/mupdf.mk
index 08894d7980..d2105497be 100644
--- a/package/mupdf/mupdf.mk
+++ b/package/mupdf/mupdf.mk
@@ -50,6 +50,11 @@  MUPDF_MAKE_OPTS = \
 	HAVE_OBJCOPY=no \
 	prefix="/usr"
 
+# The default in MuPDF is static libs
+ifeq ($(BR2_SHARED_LIBS),y)
+MUPDF_MAKE_OPTS += shared=yes
+endif
+
 ifeq ($(BR2_PACKAGE_LIBFREEGLUT),y)
 MUPDF_DEPENDENCIES += libfreeglut
 else