mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
59 lines
1.4 KiB
Nix
59 lines
1.4 KiB
Nix
{ stdenv, lib
|
|
, fetchFromGitHub
|
|
, cmake
|
|
, pkg-config
|
|
, obs-studio
|
|
, libuiohook
|
|
, qtbase
|
|
, xorg
|
|
, libxkbcommon
|
|
, libxkbfile
|
|
, SDL2
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "obs-input-overlay";
|
|
version = "5.0.5";
|
|
src = fetchFromGitHub {
|
|
owner = "univrsal";
|
|
repo = "input-overlay";
|
|
rev = "v${version}";
|
|
hash = "sha256-9HqEz+KnTt8MyhwqFWjalbl3H/DCzumckXMctCGhs3o=";
|
|
fetchSubmodules = true;
|
|
};
|
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
|
buildInputs = [
|
|
obs-studio libuiohook qtbase SDL2
|
|
xorg.libX11 xorg.libXau xorg.libXdmcp xorg.libXtst xorg.libXext
|
|
xorg.libXi xorg.libXt xorg.libXinerama libxkbcommon libxkbfile
|
|
];
|
|
|
|
cmakeFlags = [
|
|
"-DCMAKE_CXX_FLAGS=-msse4.1"
|
|
];
|
|
|
|
postUnpack = ''
|
|
sed -i '/set(CMAKE_CXX_FLAGS "-march=native")/d' 'source/CMakeLists.txt'
|
|
'';
|
|
|
|
postInstall = ''
|
|
mkdir $out/lib $out/share
|
|
mv $out/obs-plugins/64bit $out/lib/obs-plugins
|
|
rm -rf $out/obs-plugins
|
|
mv $out/data $out/share/obs
|
|
'';
|
|
|
|
dontWrapQtApps = true;
|
|
|
|
meta = with lib; {
|
|
description = "Show keyboard, gamepad and mouse input on stream";
|
|
homepage = "https://github.com/univrsal/input-overlay";
|
|
maintainers = with maintainers; [ glittershark ];
|
|
license = licenses.gpl2;
|
|
platforms = platforms.linux;
|
|
# never built on aarch64-linux since first introduction in nixpkgs
|
|
broken = stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64;
|
|
};
|
|
}
|