2021-05-01 18:24:34 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
writeScriptBin,
|
|
|
|
bash,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fpc,
|
|
|
|
lazarus-qt,
|
2021-09-07 18:31:08 +00:00
|
|
|
wrapQtAppsHook,
|
2021-12-16 01:27:24 +00:00
|
|
|
breeze-qt5,
|
2021-09-07 18:31:08 +00:00
|
|
|
libGL,
|
|
|
|
libGLU,
|
2021-05-01 18:24:34 +00:00
|
|
|
libqt5pas,
|
2021-09-07 18:31:08 +00:00
|
|
|
libX11,
|
2021-05-01 18:24:34 +00:00
|
|
|
coreutils,
|
|
|
|
git,
|
|
|
|
gnugrep,
|
|
|
|
libnotify,
|
|
|
|
polkit,
|
|
|
|
procps,
|
|
|
|
systemd,
|
2021-10-28 00:16:20 +00:00
|
|
|
util-linux,
|
2021-05-01 18:24:34 +00:00
|
|
|
vulkan-tools,
|
|
|
|
which,
|
2021-12-01 04:16:03 +00:00
|
|
|
nix-update-script,
|
2021-05-01 18:24:34 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
# Finds data files using the XDG Base Directory Specification
|
2024-10-24 09:48:59 +00:00
|
|
|
# See https://specifications.freedesktop.org/basedir-spec/latest
|
2021-05-01 18:24:34 +00:00
|
|
|
find-xdg-data-files = writeScriptBin "find-xdg-data-files" ''
|
|
|
|
#!${bash}/bin/sh
|
|
|
|
IFS=:
|
|
|
|
for xdg_data_dir in ''${XDG_DATA_HOME:-$HOME/.local/share}:''${XDG_DATA_DIRS:-/usr/local/share:/usr/share}; do
|
|
|
|
if [ -f "$xdg_data_dir/$1" ]; then
|
|
|
|
echo "$xdg_data_dir/$1"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "goverlay";
|
2021-12-16 01:27:24 +00:00
|
|
|
version = "0.7.1";
|
2021-05-01 18:24:34 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "benjamimgois";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-12-16 01:27:24 +00:00
|
|
|
sha256 = "sha256-oXkGrMHjs8uui0pzGYW8jnttet/5IX0r8eat0n5saFk=";
|
2021-05-01 18:24:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"man"
|
|
|
|
];
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Find MangoHud & vkBasalt Vulkan layers using the XDG Base Directory Specification
|
|
|
|
./find-xdg-data-files.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace 'prefix = /usr/local' "prefix = $out"
|
|
|
|
|
|
|
|
substituteInPlace overlayunit.pas \
|
|
|
|
--replace '/usr/share/icons/hicolor/128x128/apps/goverlay.png' "$out/share/icons/hicolor/128x128/apps/goverlay.png"
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
fpc
|
|
|
|
lazarus-qt
|
2021-09-07 18:31:08 +00:00
|
|
|
wrapQtAppsHook
|
2021-05-01 18:24:34 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2021-12-16 01:27:24 +00:00
|
|
|
breeze-qt5
|
2021-09-07 18:31:08 +00:00
|
|
|
libGL
|
|
|
|
libGLU
|
2021-05-01 18:24:34 +00:00
|
|
|
libqt5pas
|
2021-09-07 18:31:08 +00:00
|
|
|
libX11
|
2021-05-01 18:24:34 +00:00
|
|
|
];
|
|
|
|
|
2021-09-07 18:31:08 +00:00
|
|
|
NIX_LDFLAGS = "-lGLU -rpath ${lib.makeLibraryPath buildInputs}";
|
2021-05-01 18:24:34 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
HOME=$(mktemp -d) lazbuild --lazarusdir=${lazarus-qt}/share/lazarus -B goverlay.lpi
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
qtWrapperArgs = [
|
|
|
|
"--prefix PATH : ${
|
|
|
|
lib.makeBinPath [
|
|
|
|
bash
|
|
|
|
coreutils
|
|
|
|
find-xdg-data-files
|
|
|
|
git
|
|
|
|
gnugrep
|
|
|
|
libnotify
|
|
|
|
polkit
|
|
|
|
procps
|
|
|
|
systemd
|
2021-10-28 00:16:20 +00:00
|
|
|
util-linux.bin
|
2021-05-01 18:24:34 +00:00
|
|
|
vulkan-tools
|
|
|
|
which
|
|
|
|
]
|
|
|
|
}"
|
|
|
|
|
|
|
|
# Force xcb since libqt5pas doesn't support Wayland
|
|
|
|
# See https://github.com/benjamimgois/goverlay/issues/107
|
|
|
|
"--set QT_QPA_PLATFORM xcb"
|
|
|
|
];
|
|
|
|
|
2022-12-25 22:11:14 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
2021-12-01 04:16:03 +00:00
|
|
|
|
2021-05-01 18:24:34 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Opensource project that aims to create a Graphical UI to help manage Linux overlays";
|
|
|
|
homepage = "https://github.com/benjamimgois/goverlay";
|
|
|
|
license = licenses.gpl3Plus;
|
2024-10-26 20:13:37 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2021-05-01 18:24:34 +00:00
|
|
|
platforms = platforms.linux;
|
2023-11-23 02:51:17 +00:00
|
|
|
mainProgram = "goverlay";
|
2021-05-01 18:24:34 +00:00
|
|
|
};
|
|
|
|
}
|