# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 # This is only notes / partial work and so, if want to try it, copy # bin/meka and /usr/share/${PN}/* to a single directory and run ./meka # TODO / issues to look into (likely more, needs audit): # - segfaults after first run needing to delete GL cache (at least with # nvidia, maybe just me? __GL_SHADER_DISK_CACHE=0 works around for nvidia) # - tiles window and png images display appears corrupted (allegro related?) # - meka expects to be ran from a _writable_ directory that contains # data files (see doins in src_install), writable meka.inp, with ability # to save extra files like meka.cfg dump, screenshots, etc.. This makes # previously used wrapper.eclass insufficient and file.cpp should # preferably be modified, i.e. EmulatorDir to /usr/share/${PN}, # internal/external_res to ~/.config/${PN}, and copy meka.inp over # (MACOSX build does something similar, but well). # - LICENSE needs revision, see sources.txt # - test x86, only arch available before and wouldn't hurt not to break it # Other notes: # - nasm is referenced but unused, likewise for libpng # - wall of warnings with gcc11, but it works fwiw # - makefile appends to CFLAGS, so don't add in emakeargs= # - sed could be replaced by backport of https://github.com/ocornut/meka/commit/76c6a26 # to indicate it's fixed upstream # - maybe should be renamed from mekanix to meka, nix is just to say # "meka-linux-version" and mekanix not really referenced anywhere. # (unless there's file collision worries) # - file.cpp is uncomfortable with its use of strcpy that doesn't check # bounds, a trend seen across the entire package inherit desktop toolchain-funcs MY_PV="${PV/*alpha/}" DESCRIPTION="SG-1000, SC-3000, SSC, SM3, SMS, GG, COLECO, and OMV emulator" HOMEPAGE="https://www.smspower.org/meka/" SRC_URI="https://github.com/ocornut/meka/archive/refs/tags/meka-${MY_PV}.tar.gz" S="${WORKDIR}/meka-meka-${MY_PV}/meka" LICENSE="mekanix" SLOT="0" KEYWORDS="~amd64 ~x86" RDEPEND=" media-libs/allegro:5[X,opengl,png,truetype] sys-libs/zlib:=" DEPEND="${RDEPEND}" src_prepare() { default sed -i '/^LIB_ALLEG/s/5\.0/5/g' srcs/Makefile || die } src_compile() { # makefile uses variables loosely, e.g. sets CC=g++ local emakeargs=( CC="$(tc-getCXX)" LINKER="$(tc-getCXX) ${LDFLAGS}" LIB_PNG= ) CFLAGS="${CXXFLAGS} ${CPPFLAGS}" emake -C srcs "${emakeargs[@]}" } src_install() { dobin meka dodoc ../README.md make_desktop_entry meka MEKA applications-games "Game;Emulator;" # .txt are used at runtime (help menu), see srcs/file.cpp insinto /usr/share/${PN} doins -r Data Themes meka.* {compat,multi,changes,debugger}.txt }