nixpkgs/pkgs/by-name/ro/roccat-tools/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

55 lines
1.6 KiB
Nix

{ lib, stdenv, fetchurl, cmake, pkg-config, gettext
, dbus, dbus-glib, libgaminggear, libgudev, lua
, harfbuzz, runtimeShell, coreutils, kmod
}:
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
substituteInPlace udev/90-roccat-kone.rules \
--replace "/bin/sh" "${runtimeShell}" \
--replace "/sbin/modprobe" "${kmod}/bin/modprobe" \
--replace "/bin/echo" "${coreutils}/bin/echo"
'';
nativeBuildInputs = [ cmake pkg-config gettext ];
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"
];
env.NIX_CFLAGS_COMPILE = toString [
"-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"
];
meta = {
description = "Tools to configure ROCCAT devices";
homepage = "https://roccat.sourceforge.net/";
platforms = lib.platforms.linux;
license = lib.licenses.gpl2Plus;
};
}