depot/third_party/nixpkgs/pkgs/by-name/sy/syshud/package.nix
Default email 159e378cbb Project import generated by Copybara.
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
2024-09-19 17:19:46 +03:00

75 lines
1.6 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
gtk4-layer-shell,
gtkmm4,
nix-update-script,
pkg-config,
wireplumber,
wrapGAppsHook4,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "syshud";
version = "0-unstable-2024-08-27";
src = fetchFromGitHub {
owner = "System64fumo";
repo = "syshud";
rev = "aa2c153f6aa15962c6b97a77dbe8c45708155fe0";
hash = "sha256-SBpufr37K6LC4yc9ircUEBrzuRCKmJzD3C17N34qNGk=";
};
postPatch = ''
substituteInPlace Makefile \
--replace-fail 'pkg-config' ''${PKG_CONFIG}
'';
nativeBuildInputs = [
pkg-config
wrapGAppsHook4
];
buildInputs = [
gtk4-layer-shell
gtkmm4
wireplumber
];
makeFlags = [
"DESTDIR=${placeholder "out"}"
"PREFIX="
];
# populate version info used by `syshud -v`:
configurePhase = ''
runHook preConfigure
echo '#define GIT_COMMIT_MESSAGE "${finalAttrs.src.rev}"' >> src/git_info.hpp
echo '#define GIT_COMMIT_DATE "${lib.removePrefix "0-unstable-" finalAttrs.version}"' >> src/git_info.hpp
runHook postConfigure
'';
# syshud manually `dlopen`'s its library component
postInstall = ''
wrapProgram $out/bin/syshud --prefix LD_LIBRARY_PATH : $out/lib
'';
passthru.updateScript = nix-update-script {
extraArgs = [
"--version"
"branch"
];
};
meta = {
description = "simple heads up display written in gtkmm 4";
mainProgram = "syshud";
homepage = "https://github.com/System64fumo/syshud";
license = lib.licenses.wtfpl;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ colinsane ];
};
})