From b7299248e67b8410428fb374b8af24080a983f94 Mon Sep 17 00:00:00 2001 From: Alfred Wingate Date: Fri, 23 Aug 2024 21:42:13 +0300 Subject: [PATCH] app-editors/lite: update eapi and fixup to respect user options Signed-off-by: Alfred Wingate --- app-editors/lite/lite-1.11-r2.ebuild | 81 ++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 app-editors/lite/lite-1.11-r2.ebuild diff --git a/app-editors/lite/lite-1.11-r2.ebuild b/app-editors/lite/lite-1.11-r2.ebuild new file mode 100644 index 0000000..5a5f5aa --- /dev/null +++ b/app-editors/lite/lite-1.11-r2.ebuild @@ -0,0 +1,81 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit desktop toolchain-funcs xdg + +DESCRIPTION="A lightweight text editor written in Lua" +HOMEPAGE="https://github.com/rxi/lite" + +if [[ "${PV}" == *9999* ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/rxi/lite.git" +else + SRC_URI="https://github.com/rxi/lite/archive/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64" +fi + +LICENSE="MIT" +SLOT="0" + +BDEPEND=" + media-gfx/imagemagick +" +DEPEND=" + media-libs/libsdl2 +" +RDEPEND=" + ${DEPEND} +" + +src_prepare() { + default + + # 1. no automagic ccache please + # 2. respect user compiler + # 3. respect user CFLAGS + # 4. respect user LDFLAGS + sed -i \ + -e '/if command -v ccache/,/fi/d' \ + -e 's/compiler="gcc"/compiler="${CC}"/' \ + -e '/^cflags=/acflags+=" ${CFLAGS}"' \ + -e '/^lflags=/alflags+=" ${LDFLAGS}"' \ + build.sh || die +} + +src_compile() { + tc-export_build_env CC + bash -x build.sh release || die + + cp icon.ico lite.ico || die + # This converts to 4 png files + convert icon.ico "${PN}.png" || die + mv lite-0.png lite-64.png || die + mv lite-1.png lite-48.png || die + mv lite-2.png lite-32.png || die + mv lite-3.png lite-16.png || die +} + +src_install() { + insinto "/opt/${PN}" + doins -r data + exeinto "/opt/${PN}" + doexe lite + dosym "../../opt/${PN}/${PN}" "/usr/bin/${PN}" + + local res + for res in 16 32 48 64 + do + # We do this 'mv' to install to + # /usr/share/icons/hicolor/16x16/apps/lite.png + # instead of + # /usr/share/icons/hicolor/16x16/apps/lite-16.png + mv "${PN}-${res}.png" "${PN}.png" || die + doicon -s "${res}" "${PN}.png" + done + doicon "${PN}.ico" + make_desktop_entry "${PN}" "${PN^}" "${PN}" "Development;IDE" + + einstalldocs +}