Skip to content

Commit

Permalink
games-strategy/0ad: fix AR/RANLIB usage
Browse files Browse the repository at this point in the history
  • Loading branch information
thesamesam committed Mar 1, 2021
1 parent c81340c commit c0ca48e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
5 changes: 2 additions & 3 deletions games-strategy/0ad/0ad-0.0.24b_alpha.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ RDEPEND="
PATCHES=(
"${FILESDIR}"/${PN}-0.0.24_alpha_pre20210116040036-build.patch
"${FILESDIR}"/${PN}-0.0.24b_alpha-rust-1.50.patch
"${FILESDIR}"/${PN}-0.0.24b_alpha-respect-tc.patch
)

pkg_setup() {
Expand Down Expand Up @@ -106,7 +107,7 @@ src_configure() {
--datadir="/usr/share/${PN}"
)

tc-export CC CXX
tc-export AR CC CXX RANLIB

# Stock premake5 does not work, use the shipped one
# TODO: revisit this, see above BDEPEND note re premake5
Expand All @@ -132,8 +133,6 @@ src_configure() {
}

src_compile() {
tc-export AR

# Build 3rd party fcollada
einfo "Building bundled fcollada"
emake -C libraries/source/fcollada/src
Expand Down
32 changes: 32 additions & 0 deletions games-strategy/0ad/files/0ad-0.0.24b_alpha-respect-tc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
--- a/libraries/source/fcollada/src/Makefile
+++ b/libraries/source/fcollada/src/Makefile
@@ -7,6 +7,7 @@
PIC_FLAGS ?= -fpic
endif

+AR? ?= ar
CXX ?= g++
CXXFLAGS += -fvisibility=hidden -W -Wall -Wno-unused-parameter -Wno-unused-function $(OS_DEFINE) $(PIC_FLAGS) $(CPPFLAGS)
CXXFLAGS_DEBUG := -D_DEBUG -DRETAIL
@@ -16,6 +17,7 @@
LIBS += `pkg-config libxml-2.0 --libs`
INCLUDES += -IFCollada `pkg-config libxml-2.0 --cflags`
INCLUDES_TEST := -IFCollada/FColladaTest $(INCLUDES)
+RANLIB ?= ranlib

# FCollada is not aliasing-safe, so disallow dangerous optimisations
# (TODO: It'd be nice to fix FCollada, but that looks hard)
@@ -246,11 +248,11 @@

output/libFColladaSD.a: $(OBJECTS_DEBUG) | output_dirs
@echo "$@"
- @ar -cr $@ $(OBJECTS_DEBUG); ranlib $@
+ @$(AR) -cr $@ $(OBJECTS_DEBUG); $(RANLIB) $@

output/libFColladaSR.a: $(OBJECTS_RELEASE) | output_dirs
@echo "$@"
- @ar -cr $@ $(OBJECTS_RELEASE); ranlib $@
+ @$(AR) -cr $@ $(OBJECTS_RELEASE); $(RANLIB) $@

output/FColladaTest: $(OBJECTS_TEST) | output_dirs
$(CXX) -o $@ $(OBJECTS_TEST) $(LIBS) $(LDFLAGS_TEST)

0 comments on commit c0ca48e

Please sign in to comment.