mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 17:09:10 -07:00
app-laptop/msi-keyboard: fix build with GCC 12; respect CXX
Closes: https://bugs.gentoo.org/840329 Closes: https://bugs.gentoo.org/722324 Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
https://bugs.gentoo.org/840329
|
||||
--- a/main.cpp
|
||||
+++ b/main.cpp
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "Keyboard.h"
|
||||
+#include <cstring>
|
||||
#include <regex>
|
||||
#include <iostream>
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,6 +1,7 @@
|
||||
-CC=g++
|
||||
-CFLAGS=-c -Wall
|
||||
-LDFLAGS=-lhidapi-libusb
|
||||
+CXX?=g++
|
||||
+COMMON_FLAGS=-Wall
|
||||
+CXXFLAGS+=$(COMMON_FLAGS)
|
||||
+LIBS=-lhidapi-libusb
|
||||
SOURCES=main.cpp Keyboard.cpp Color.cpp
|
||||
OBJECTS=$(SOURCES:.cpp=.o)
|
||||
EXECUTABLE=msi-keyboard
|
||||
@@ -11,8 +12,8 @@ clean:
|
||||
rm $(OBJECTS) $(EXECUTABLE)
|
||||
|
||||
$(EXECUTABLE): $(OBJECTS)
|
||||
- $(CC) $(LDFLAGS) $(OBJECTS) -o $@
|
||||
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $@
|
||||
|
||||
.cpp.o:
|
||||
- $(CC) $(CFLAGS) $< -o $@
|
||||
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
|
||||
|
||||
39
app-laptop/msi-keyboard/msi-keyboard-1.0-r1.ebuild
Normal file
39
app-laptop/msi-keyboard/msi-keyboard-1.0-r1.ebuild
Normal file
@@ -0,0 +1,39 @@
|
||||
# Copyright 1999-2022 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
inherit toolchain-funcs udev
|
||||
|
||||
DESCRIPTION="Control backlight of MSI laptop keyboards"
|
||||
HOMEPAGE="https://github.com/makkarpov/msi-keyboard"
|
||||
SRC_URI="https://github.com/makkarpov/msi-keyboard/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
LICENSE="GPL-3"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
|
||||
RDEPEND="dev-libs/hidapi"
|
||||
DEPEND="${RDEPEND}"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${P}-r1-makefile.patch
|
||||
"${FILESDIR}"/${P}-gcc12.patch
|
||||
)
|
||||
|
||||
src_configure() {
|
||||
tc-export CXX
|
||||
}
|
||||
|
||||
src_install() {
|
||||
udev_dorules 99-msi-keyboard.rules
|
||||
dobin msi-keyboard
|
||||
}
|
||||
|
||||
pkg_prerm() {
|
||||
udev_reload
|
||||
}
|
||||
|
||||
pkg_postrm() {
|
||||
udev_reload
|
||||
}
|
||||
Reference in New Issue
Block a user