http://wl.widelands.org/ Reproducible: Always
Unfortunately, 'make all' target seems completely broken. I've managed to write an ebuild using scons, but it's horribly hackish.
--- widelands-0.0.13.ebuild +++ widelands-0.0.14.ebuild @@ -7,7 +7,7 @@ MY_PV=$(get_version_component_range 3) DESCRIPTION="A game similar to Settlers 2" HOMEPAGE="http://www.widelands.org/" -SRC_URI="mirror://sourceforge/${PN}/Widelands-Build${MY_PV}-src.tar.bz2" +SRC_URI="mirror://sourceforge/${PN}/Widelands-Build${MY_PV}-src.7z" LICENSE="GPL-2" SLOT="0" @@ -26,47 +26,36 @@ DEPEND="${RDEPEND} nls? ( sys-devel/gettext )" -S=${WORKDIR}/${PN}-b${MY_PV} +S=${WORKDIR}/${PN} src_unpack() { unpack ${A} - cd "${S}" - rm -f $(find . -name SConscript) + cd "${S}" || die "cd ${S} failed" # $(S) was changed epatch "${FILESDIR}"/${P}-build.patch - - sed -i 's:__ppc__:__PPC__:' src/s2map.cc \ - || die "sed s2map.cc failed" - sed -i "s:/usr/share/games:${GAMES_DATADIR}:" src/wlapplication.cc \ - || die "sed wlapplication.cc failed" - sed -i "s:/l/WiLa/Setup:${GAMES_DATADIR}/${PN}:" src/config.h.default \ - || die "sed config.h.default failed" } src_compile() { - filter-flags -fomit-frame-pointer - emake src/build_id.cc || die "emake src/build_id.cc failed" - emake all || die "emake all failed" - - if use nls ; then - utils/buildlocale.py || die "buildlocale.py failed" - fi + filter-flags -fomit-frame-pointer # May this help with scons? + + scons ${MAKEOPTS} \ + build=release \ + install_prefix="${D}" \ + bindir="${GAMES_BINDIR}" \ + datadir="${GAMES_DATADIR}/${PN}" \ + localedir="${GAMES_DATADIR}/${PN}/locale" \ + || die "scons build failed" } src_install() { - dogamesbin ${PN} || die "dogamesbin failed" - - insinto "${GAMES_DATADIR}"/${PN} - doins -r campaigns fonts global maps music pics sound tribes txts worlds \ - || die "doins failed" - - insinto "${GAMES_DATADIR}"/${PN}/locale - local d - for d in locale/* ; do - if [[ -d ${d} ]] ; then - doins -r ${d} || die "doins ${d} failed" - fi - done + scons ${MAKEOPTS} \ + build=release \ + install_prefix="${D}" \ + bindir="${D}/${GAMES_BINDIR}" \ + datadir="${D}/${GAMES_DATADIR}/${PN}" \ + localedir="${D}/${GAMES_DATADIR}/${PN}/locale" \ + install \ + || die "scons install failed" newicon pics/wl-ico-128.png ${PN}.png make_desktop_entry ${PN} Widelands
widelands-0.0.14-build.patch: --- Makefile +++ Makefile @@ -26,7 +26,7 @@ #most current glibc systems implicitly contain libintl.so ifndef IMPLICIT_LIBINTL -IMPLICIT_LIBINTL:=NO +IMPLICIT_LIBINTL:=YES endif # Is this a cross compile? @@ -64,7 +64,7 @@ # profile optimized, debugging symbols, profiling # ifndef BUILD -BUILD:=debug +BUILD:=release endif endif @@ -80,7 +80,7 @@ # COMPILE TIME configuration ifeq ($(USE_GGZ),YES) ADD_CFLAGS:= $(ADD_CFLAGS) -DUSE_GGZ -ADD_LDFLAGS:=-lggzmod -lggzcore -lggz +ADD_LIBS:=-lggzmod -lggzcore -lggz endif ############################################################################## @@ -108,11 +108,9 @@ BUILD:=$(strip $(BUILD)) ifeq ($(BUILD),release) -OPTIMIZE:=yes # heavy optimization #ADD_CFLAGS:=$(ADD_CFLAGS) -fomit-frame-pointer -finline-functions -ffast-math -funroll-loops -funroll-all-loops -fexpensive-optimizations # !!!! -fomit-frame-pointer breaks execeptions !!!! -ADD_CFLAGS:=$(ADD_CFLAGS) -finline-functions -ffast-math -funroll-loops -funroll-all-loops -fexpensive-optimizations else ifeq ($(BUILD),profile) OPTIMIZE:=yes @@ -144,16 +142,17 @@ endif ifeq ($(IMPLICIT_LIBINTL),NO) -ADD_LDFLAGS += -lintl +ADD_LIBS += -lintl endif ############################################################################## # Object files and directories, final compilation flags OBJECT_DIR:=src/$(TARGET)-$(BUILD) -CFLAGS:=-Wall $(shell $(SDL_CONFIG) --cflags) $(ADD_CFLAGS) +CFLAGS+=-Wall $(shell $(SDL_CONFIG) --cflags) $(ADD_CFLAGS) CXXFLAGS:=$(CFLAGS) -LDFLAGS:=$(shell $(SDL_CONFIG) --libs) $(ADD_LDFLAGS) -lz -lpng -lSDL_image -lSDL_mixer -lSDL_ttf -lSDL_net -lSDL_gfx +LDFLAGS+=$(ADD_LDFLAGS) +LIBS=$(shell $(SDL_CONFIG) --libs) $(ADD_LIBS) -lz -lpng -lSDL_image -lSDL_mixer -lSDL_ttf -lSDL_net -lSDL_gfx ############################################################################## # Building @@ -216,13 +215,13 @@ $(OBJECT_DIR)/widelands: $(OBJ) @echo "===> LD $@" - $(Q)$(CXX) $(OBJ) -o $@ $(LDFLAGS) $(CFLAGS) + $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) -include $(DEP) $(OBJECT_DIR)/%.o: src/%.cc src/config.h @echo "===> CXX $<" - $(Q)$(CXX) -pipe $(CXXFLAGS) -MMD -MP -MF $@.d -c -o $@ $< + $(CXX) $(CXXFLAGS) -MMD -MP -MF $@.d -c -o $@ $< $(Q)sed -e 's@^\(.*\)\.o:@\1.d \1.o:@' $@.d > $(OBJECT_DIR)/$*.d $(Q)rm $@.d @@ -237,4 +236,3 @@ src/build_info.cc: sed -e "s/UNKNOWN/$(VERSION)/" src/build_info.cc.default > $@ -
(In reply to comment #2) It works. Only it needs to add binary strips somewhere. And to make other improvements, maybe. (In reply to comment #3) I have done patch for Makefile also. But I do not know scons, and I suspect what this Makefile is not called by scons. Anyway, it has resulted not very clean package, but it works. But for what it was needed to make a hack in previous version? And why it was not able to use scons straightway?
Created attachment 208447 [details] Experimental ebuild using scons I had no trouble getting this to build using scons, so I'll stick my neck out and offer the ebuild I concocted, with no guarantees except that it allowed me to emerge this beastie on my amd64 system without requiring changes to any other files. It's basically the unholy love-child of the ebuild for the previous version of Widelands and the ebuild for Blender, the only one I could find that uses scons. The stuff for command-line arguments (CLOPTS and the contents of src_configure) is there mainly because I know I won't use the network-play functionality and so didn't want to have to emerge the extra libraries required. An extra DEPEND on app-arch/p7zip may also be needed--I'm not sure how Portage handles 7zip sources, and I already had the package on my system for unrelated reasons.
This version is now in portage. Thanks and please test it.