commit:     1bd791dae28b9af2b3e933939335a53fa303cfc9
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 30 20:37:20 2021 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Tue Mar 30 20:37:51 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1bd791da

media-libs/freetype: Fixed build with sys-devel/slibtool

Closes: https://bugs.gentoo.org/775881
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 .../freetype-2.10.4-dont_hardcode_libtool.patch    | 42 ++++++++++++++++
 .../files/freetype-2.10.4-slibtool_build_fix.patch | 40 +++++++++++++++
 .../files/ft2demos-2.10.4-install_target.patch     | 58 ++++++++++++++++++++++
 media-libs/freetype/freetype-2.10.4.ebuild         | 16 +++---
 4 files changed, 148 insertions(+), 8 deletions(-)

diff --git 
a/media-libs/freetype/files/freetype-2.10.4-dont_hardcode_libtool.patch 
b/media-libs/freetype/files/freetype-2.10.4-dont_hardcode_libtool.patch
new file mode 100644
index 00000000000..310b5aaca93
--- /dev/null
+++ b/media-libs/freetype/files/freetype-2.10.4-dont_hardcode_libtool.patch
@@ -0,0 +1,42 @@
+From 597566b2301deeff4e9832aebdab1bf659a2accf Mon Sep 17 00:00:00 2001
+From: orbea <[email protected]>
+Date: Mon, 22 Mar 2021 16:15:37 -0700
+Subject: [PATCH] * Makefile, mac/Makefile (LINK_CMD): Don't hard-code
+ `libtool`.
+
+---
+ Makefile     |    3 +--
+ mac/Makefile |    3 +--
+ 2 files changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 810142f..949402f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -165,8 +165,7 @@ else
+ 
+   ifeq ($(PLATFORM),unix)
+     override CC = $(CCraw)
+-    LINK_CMD    = $(subst /,$(SEP),$(OBJ_BUILD)/libtool) \
+-                  --mode=link $(CC) \
++    LINK_CMD    = $(LIBTOOL) --mode=link $(CC) \
+                   $(subst /,$(COMPILER_SEP),$(LDFLAGS))
+     LINK_LIBS   = $(subst /,$(COMPILER_SEP),$(FTLIB) $(EFENCE)) 
$(LIB_CLOCK_GETTIME)
+   else
+diff --git a/mac/Makefile b/mac/Makefile
+index 73ae99c..52038a4 100644
+--- a/mac/Makefile
++++ b/mac/Makefile
+@@ -68,8 +68,7 @@ else
+   LINK_ITEMS = $T$(subst /,$(COMPILER_SEP),$@ $<)
+ 
+   CC        = $(CCraw)
+-  LINK_CMD  = $(subst /,$(SEP),$(OBJ_BUILD)/libtool) \
+-              --mode=link $(CC) \
++  LINK_CMD  = $(LIBTOOL) --mode=link $(CC) \
+               $(subst /,$(COMPILER_SEP),$(LDFLAGS))
+   ifeq ($(findstring CoreServices,$(LDFLAGS)),)
+     LINK_LIBS = $(subst /,$(COMPILER_SEP),$(FTLIB) $(EFENCE)) $(MATH) \
+-- 
+GitLab
+

diff --git a/media-libs/freetype/files/freetype-2.10.4-slibtool_build_fix.patch 
b/media-libs/freetype/files/freetype-2.10.4-slibtool_build_fix.patch
new file mode 100644
index 00000000000..895a86c444d
--- /dev/null
+++ b/media-libs/freetype/files/freetype-2.10.4-slibtool_build_fix.patch
@@ -0,0 +1,40 @@
+From 8e9447b32dae7e6c95bee3f878ee1877f9b628a4 Mon Sep 17 00:00:00 2001
+From: orbea <[email protected]>
+Date: Mon, 22 Mar 2021 16:15:09 -0700
+Subject: [PATCH] [graph] Fix build with `slibtool`.
+
+* graph/rules.mk (GRAPH_LIB): Handle the case specially where
+`LIBTOOL` is defined.
+(COMPILE_GRAPH_LIB) <LIBTOOL>: Enable use of `dlopen`.
+---
+ rules.mk |    5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/graph/rules.mk b/graph/rules.mk
+index 4903a38..a3f0de1 100644
+--- a/graph/rules.mk
++++ b/graph/rules.mk
+@@ -12,7 +12,6 @@
+ 
+ 
+ GRAPH_INCLUDES := $(subst /,$(COMPILER_SEP),$(TOP_DIR_2)/graph)
+-GRAPH_LIB      := $(OBJ_DIR_2)/graph.$(SA)
+ 
+ GRAPH := $(TOP_DIR_2)/graph
+ 
+@@ -46,9 +45,11 @@ GRAPH_OBJS := $(OBJ_DIR_2)/gblblit.$(O)   \
+ # this value can be modified by the system-specific graphics drivers.
+ #
+ ifneq ($(LIBTOOL),)
+-  COMPILE_GRAPH_LIB = $(LIBTOOL) --mode=link $(CCraw) -static \
++  GRAPH_LIB        := $(OBJ_DIR_2)/graph.$(A)
++  COMPILE_GRAPH_LIB = $(LIBTOOL) --mode=link $(CCraw) -module -static \
+                                  -o $(subst /,$(COMPILER_SEP),$@ 
$(GRAPH_OBJS))
+ else
++  GRAPH_LIB        := $(OBJ_DIR_2)/graph.$(SA)
+   COMPILE_GRAPH_LIB = ar -r $(subst /,$(COMPILER_SEP),$@ $(GRAPH_OBJS))
+ endif
+ 
+-- 
+GitLab
+

diff --git a/media-libs/freetype/files/ft2demos-2.10.4-install_target.patch 
b/media-libs/freetype/files/ft2demos-2.10.4-install_target.patch
new file mode 100644
index 00000000000..f3d7f8de43e
--- /dev/null
+++ b/media-libs/freetype/files/ft2demos-2.10.4-install_target.patch
@@ -0,0 +1,58 @@
+From b88cd2f027e77bd26d1334fc13c4eda796423d19 Mon Sep 17 00:00:00 2001
+From: orbea <[email protected]>
+Date: Wed, 24 Mar 2021 09:04:41 -0700
+Subject: [PATCH] [build] Add an `install` target for binaries and man pages.
+
+* Makefile (MANPAGES): New variable.
+(install) <unix>: New target.
+---
+ Makefile |   19 ++++++++++++++++++-
+ 1 file changed, 18 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 949402f..8352f61 100644
+--- a/Makefile
++++ b/Makefile
+@@ -194,7 +194,7 @@ else
+                 $(LINK_LIBS) $(subst /,$(COMPILER_SEP),$(GRAPH_LIB)) \
+                 $(GRAPH_LINK) $(MATH)
+ 
+-  .PHONY: exes clean distclean
++  .PHONY: exes clean distclean install
+ 
+ 
+   ###################################################################
+@@ -317,6 +317,11 @@ else
+   # EXES += fttimer
+   # EXES += testname
+ 
++  # Not all demo programs have a man page; we thus check for existence in a
++  # loop.
++  #
++  MANPAGES := $(foreach man,$(EXES),$(wildcard $(TOP_DIR_2)/man/$(man).1))
++
+   exes: $(EXES:%=$(BIN_DIR_2)/%$E)
+ 
+ 
+@@ -567,6 +572,18 @@ else
+                         $(GRAPH_LIB) $(COMMON_OBJ) $(FTCOMMON_OBJ)
+         $(LINK_NEW)
+ 
++  ifeq ($(PLATFORM),unix)
++    install: exes
++          $(MKINSTALLDIRS) $(DESTDIR)$(bindir) \
++                             $(DESTDIR)$(mandir)/man1
++          $(foreach bin,$(EXES), \
++              $(LIBTOOL) --mode=install \
++                $(INSTALL) $(BIN_DIR_2)/$(bin) \
++                           $(DESTDIR)$(bindir)/$(bin);)
++          $(foreach man,$(MANPAGES), \
++              $(INSTALL) $(man) \
++                         $(DESTDIR)$(mandir)/man1/$(notdir $(man));)
++  endif
+ endif
+ 
+ 
+-- 
+GitLab
+

diff --git a/media-libs/freetype/freetype-2.10.4.ebuild 
b/media-libs/freetype/freetype-2.10.4.ebuild
index 6ede5206ae8..2a38b5388be 100644
--- a/media-libs/freetype/freetype-2.10.4.ebuild
+++ b/media-libs/freetype/freetype-2.10.4.ebuild
@@ -148,6 +148,11 @@ src_prepare() {
                if ! use X; then
                        sed -i -e "/EXES\ +=\ ftdiff/ s:^:#:" Makefile || die
                fi
+
+               # Taken from upstream (https://bugs.gentoo.org/775881)
+               eapply "${FILESDIR}/${P}-slibtool_build_fix.patch"
+               eapply "${FILESDIR}/${P}-dont_hardcode_libtool.patch"
+               eapply "${FILESDIR}/ft2demos-2.10.4-install_target.patch"
                cd "${S}" || die
        fi
 
@@ -204,15 +209,10 @@ multilib_src_compile() {
 multilib_src_install() {
        default
 
-       if multilib_is_native_abi && use utils; then
+       if multilib_is_native_abi && use utils ; then
                einfo "Installing utils"
-               rm "${WORKDIR}"/ft2demos-${PV}/bin/README || die
-               dodir /usr/bin #654780
-               local ft2demo
-               for ft2demo in ../ft2demos-${PV}/bin/*; do
-                       ./libtool --mode=install $(type -P install) -m 755 
"${ft2demo}" \
-                               "${ED}"/usr/bin || die
-               done
+               emake DESTDIR="${D}" FT2DEMOS=1 \
+                       TOP_DIR_2="${WORKDIR}/ft2demos-${PV}" install
        fi
 }
 

Reply via email to