Skip to content

Commit

Permalink
Bump GOverlay to 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Chais committed Dec 25, 2024
1 parent de18642 commit 3566735
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 79 deletions.
59 changes: 20 additions & 39 deletions pkgs/tools/graphics/goverlay/default.nix
Original file line number Diff line number Diff line change
@@ -1,91 +1,73 @@
{
lib,
writeScriptBin,
bash,
stdenv,
coreutils,
fetchFromGitHub,
fpc,
lazarus-qt,
wrapQtAppsHook,
breeze-qt5,
libGL,
libGLU,
libqt5pas,
libX11,
coreutils,
git,
gnugrep,
iproute2,
lazarus-qt6,
lib,
libGL,
libGLU,
libnotify,
libqt6pas,
libX11,
nix-update-script,
polkit,
procps,
stdenv,
systemd,
util-linux,
vulkan-tools,
which,
nix-update-script,
wrapQtAppsHook,
}:

let
# Finds data files using the XDG Base Directory Specification
# See https://specifications.freedesktop.org/basedir-spec/latest
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";
version = "0.7.1";
version = "1.2";

src = fetchFromGitHub {
owner = "benjamimgois";
repo = pname;
rev = version;
sha256 = "sha256-oXkGrMHjs8uui0pzGYW8jnttet/5IX0r8eat0n5saFk=";
sha256 = "sha256-tSpM+XLlFQLfL750LTNWbWFg1O+0fSfsPRXuRCm/KlY=";
};

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"
--replace-fail '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"
--replace-fail '/usr/share/icons/hicolor/128x128/apps/goverlay.png' "$out/share/icons/hicolor/128x128/apps/goverlay.png" \
--replace-fail '/sbin/ip' "${lib.getExe' iproute2 "ip"}" \
--replace-fail '/bin/bash' "${lib.getExe' bash "bash"}"
'';

nativeBuildInputs = [
fpc
lazarus-qt
lazarus-qt6
wrapQtAppsHook
];

buildInputs = [
breeze-qt5
libGL
libGLU
libqt5pas
libqt6pas
libX11
];

NIX_LDFLAGS = "-lGLU -rpath ${lib.makeLibraryPath buildInputs}";

buildPhase = ''
runHook preBuild
HOME=$(mktemp -d) lazbuild --lazarusdir=${lazarus-qt}/share/lazarus -B goverlay.lpi
HOME=$(mktemp -d) lazbuild --lazarusdir=${lazarus-qt6}/share/lazarus -B goverlay.lpi
runHook postBuild
'';

Expand All @@ -94,7 +76,6 @@ stdenv.mkDerivation rec {
lib.makeBinPath [
bash
coreutils
find-xdg-data-files
git
gnugrep
libnotify
Expand Down
40 changes: 0 additions & 40 deletions pkgs/tools/graphics/goverlay/find-xdg-data-files.patch

This file was deleted.

0 comments on commit 3566735

Please sign in to comment.