2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, cmake, pkg-config, gettext
|
2020-04-24 23:36:52 +00:00
|
|
|
, dbus, dbus-glib, libgaminggear, libgudev, lua
|
2022-09-09 14:08:57 +00:00
|
|
|
, harfbuzz, runtimeShell, coreutils, kmod
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "roccat-tools";
|
|
|
|
version = "5.9.0";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/roccat/${pname}-${version}.tar.bz2";
|
|
|
|
sha256 = "12j02rzbz3iqxprz8cj4kcfcdgnqlva142ci177axqmckcq6crvg";
|
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i -re 's,/(etc/xdg),\1,' roccateventhandler/CMakeLists.txt
|
|
|
|
|
|
|
|
sed -i -e '/roccat_profile_dir(void).*{/,/}/ {
|
|
|
|
/return/c \
|
|
|
|
return g_build_path("/", g_get_user_data_dir(), "roccat", NULL);
|
|
|
|
}' libroccat/roccat_helper.c
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
substituteInPlace udev/90-roccat-kone.rules \
|
|
|
|
--replace "/bin/sh" "${runtimeShell}" \
|
|
|
|
--replace "/sbin/modprobe" "${kmod}/bin/modprobe" \
|
|
|
|
--replace "/bin/echo" "${coreutils}/bin/echo"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config gettext ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ dbus dbus-glib libgaminggear libgudev lua ];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DUDEVDIR=\${out}/lib/udev/rules.d"
|
|
|
|
"-DCMAKE_MODULE_PATH=${libgaminggear.dev}/lib/cmake"
|
|
|
|
"-DWITH_LUA=${lua.luaversion}"
|
|
|
|
"-DLIBDIR=lib"
|
|
|
|
];
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString [
|
2022-06-16 17:23:12 +00:00
|
|
|
"-I${harfbuzz.dev}/include/harfbuzz"
|
|
|
|
|
|
|
|
# Workaround build failure on -fno-common toolchains:
|
|
|
|
# ld: ryos_talk.c.o:(.bss+0x0): multiple definition of `RyosWriteCheckWait';
|
|
|
|
# ryos_custom_lights.c.o:(.bss+0x0): first defined here
|
|
|
|
"-fcommon"
|
|
|
|
];
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
|
|
|
description = "Tools to configure ROCCAT devices";
|
2023-02-02 18:25:31 +00:00
|
|
|
homepage = "https://roccat.sourceforge.net/";
|
2021-02-05 17:12:51 +00:00
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
license = lib.licenses.gpl2Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|