aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'x11-libs/sdl-fakeqwerty')
-rw-r--r--x11-libs/sdl-fakeqwerty/Manifest1
-rw-r--r--x11-libs/sdl-fakeqwerty/files/Makefile-2019121736
-rw-r--r--x11-libs/sdl-fakeqwerty/metadata.xml19
-rw-r--r--x11-libs/sdl-fakeqwerty/sdl-fakeqwerty-20191217.ebuild77
4 files changed, 133 insertions, 0 deletions
diff --git a/x11-libs/sdl-fakeqwerty/Manifest b/x11-libs/sdl-fakeqwerty/Manifest
new file mode 100644
index 000000000..05256df7e
--- /dev/null
+++ b/x11-libs/sdl-fakeqwerty/Manifest
@@ -0,0 +1 @@
+DIST sdl-fakeqwerty-20191217.tar.gz 19099 BLAKE2B e75ab93a1c1e4a47c4a4a65e1842139768cdc0cf1333880ebf762c0ec5e9560af7af31a91928c89b115d10858045340c58dc3fbbc3fe4bf0887f9be3f4f6a12d SHA512 5487fc75f028254df82b2546e51909ae0db693e1989116812e35fac0c1bebebcd72d5eb5335a313074d93417e0d4cd831e14fde712856d98ad73d580794e1144
diff --git a/x11-libs/sdl-fakeqwerty/files/Makefile-20191217 b/x11-libs/sdl-fakeqwerty/files/Makefile-20191217
new file mode 100644
index 000000000..f99cae35d
--- /dev/null
+++ b/x11-libs/sdl-fakeqwerty/files/Makefile-20191217
@@ -0,0 +1,36 @@
+.PHONY: clean
+
+internal_CFLAGS = -shared -fPIC
+internal_CFLAGS += $(CFLAGS)
+internal_LDFLAGS = -ldl
+internal_LDFLAGS += $(LDFLAGS)
+
+all: i686 amd64
+
+i686: sdl1-hooks-i686.so sdl2-hooks-i686.so xlib-hooks-i686.so
+
+amd64: sdl1-hooks-amd64.so sdl2-hooks-amd64.so xlib-hooks-amd64.so
+
+sdl1-hooks-amd64.so: sdl1-hooks.c
+ $(CC) -m64 $(internal_CFLAGS) -o $@ $< $(internal_LDFLAGS)
+
+sdl1-peep-hooks-i686.so: sdl1-peep-hooks.c
+ $(CC) -m32 $(internal_CFLAGS) -o $@ $< $(internal_LDFLAGS)
+
+sdl1-peep-hooks-amd64.so: sdl1-peep-hooks.c
+ $(CC) -m64 $(internal_CFLAGS) -o $@ $< $(internal_LDFLAGS)
+
+sdl1-hooks-i686.so: sdl1-hooks.c
+ $(CC) -m32 $(internal_CFLAGS) -o $@ $< $(internal_LDFLAGS)
+
+sdl2-hooks-amd64.so: sdl2-hooks.c
+ $(CC) -m64 $(internal_CFLAGS) -o $@ $< $(internal_LDFLAGS)
+
+sdl2-hooks-i686.so: sdl2-hooks.c
+ $(CC) -m32 $(internal_CFLAGS) -o $@ $< $(internal_LDFLAGS)
+
+xlib-hooks-amd64.so: xlib-hooks.c
+ $(CC) -m64 $(internal_CFLAGS) -o $@ $< $(internal_LDFLAGS)
+
+xlib-hooks-i686.so: xlib-hooks.c
+ $(CC) -m32 $(internal_CFLAGS) -o $@ $< $(internal_LDFLAGS)
diff --git a/x11-libs/sdl-fakeqwerty/metadata.xml b/x11-libs/sdl-fakeqwerty/metadata.xml
new file mode 100644
index 000000000..b687ad63a
--- /dev/null
+++ b/x11-libs/sdl-fakeqwerty/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>lo48576@hard-wi.red</email>
+ <name>YOSHIOKA Takuma</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">micolous/sdl-fakeqwerty</remote-id>
+ </upstream>
+ <longdescription lang="en">
+ sdl-fakeqwerty makes your keyboard act like a US-QWERTY keyboard, while not changing any system settings.
+ </longdescription>
+ <use>
+ <flag name="sdl">Enable support for libsdl</flag>
+ <flag name="sdl2">Enable support for libsdl2</flag>
+ <flag name="xlib">Enable support for libX11</flag>
+ </use>
+</pkgmetadata>
diff --git a/x11-libs/sdl-fakeqwerty/sdl-fakeqwerty-20191217.ebuild b/x11-libs/sdl-fakeqwerty/sdl-fakeqwerty-20191217.ebuild
new file mode 100644
index 000000000..1cbd387f4
--- /dev/null
+++ b/x11-libs/sdl-fakeqwerty/sdl-fakeqwerty-20191217.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+MULTILIB_COMPAT=( abi_x86_{32,64} )
+inherit multilib-minimal
+
+DESCRIPTION="Fixes non-QWERTY keyboards on Prison Architect (and maybe other SDL games) on Linux"
+HOMEPAGE="https://github.com/micolous/sdl-fakeqwerty"
+ARCHIVE_VERSION="a79f201903c30e91dc3b4f79c789e25548cf9589"
+SRC_URI="https://github.com/micolous/${PN}/archive/${ARCHIVE_VERSION}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${PN}-${ARCHIVE_VERSION}"
+
+LICENSE="sdl? ( LGPL-2 ) sdl2? ( ZLIB ) xlib? ( ZLIB )"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="sdl sdl2 xlib"
+REQUIRED_USE="|| ( sdl sdl2 xlib )"
+
+RDEPEND=""
+DEPEND="
+ virtual/pkgconfig
+ xlib? ( x11-libs/libX11[${MULTILIB_USEDEP}] )
+ sdl? ( >=media-libs/libsdl-1.2[${MULTILIB_USEDEP}] )
+ sdl2? ( media-libs/libsdl2[${MULTILIB_USEDEP}] )"
+
+DOCS=( README.md background.md games )
+
+fakeqwerty_target() {
+ case "${MULTILIB_ABI_FLAG}" in
+ abi_x86_32)
+ echo 'i686'
+ ;;
+ abi_x86_64)
+ echo 'amd64'
+ ;;
+ *)
+ die "Unsupported ABI FLAG ${MULTILIB_ABI_FLAG}"
+ ;;
+ esac
+}
+
+src_prepare() {
+ default
+
+ cp -f "${FILESDIR}/Makefile-${PV}" "${S}/Makefile" || die
+ multilib_copy_sources
+}
+
+multilib_src_compile() {
+ local target="$(fakeqwerty_target)"
+ CFLAGS="${CFLAGS} $(get_abi_CFLAGS)"
+ if use sdl ; then
+ emake CFLAGS="${CFLAGS} $(pkg-config --cflags sdl)" "sdl1-hooks-${target}.so" "sdl1-peep-hooks-${target}.so" || die
+ fi
+ if use sdl2 ; then
+ emake CFLAGS="${CFLAGS} $(pkg-config --cflags sdl2)" "sdl2-hooks-${target}.so" || die
+ fi
+ if use xlib ; then
+ emake CFLAGS="${CFLAGS} $(pkg-config --cflags x11)" "xlib-hooks-${target}.so" || die
+ fi
+}
+
+multilib_src_install() {
+ local target="$(fakeqwerty_target)"
+ insinto "/usr/$(get_libdir)/sdl-fakeqwerty"
+ if use sdl ; then
+ newins "sdl1-hooks-${target}.so" "sdl1-hooks.so" || die
+ newins "sdl1-peep-hooks-${target}.so" "sdl1-peep-hooks.so" || die
+ fi
+ if use sdl2 ; then
+ newins "sdl2-hooks-${target}.so" "sdl2-hooks.so" || die
+ fi
+ if use xlib ; then
+ newins "xlib-hooks-${target}.so" "xlib-hooks.so" || die
+ fi
+}