nixpkgs/pkgs/applications/office/mytetra/default.nix
Emery Hemingway b5526585c2 treewide: inject xdg-open into wrappers as $PATH suffix
The xdg-open utility is only ever a runtime dependency and its
dependents only expect that it accept a URI as a command line
argument and do something with it that the user would expect.
For such as a trivial relationship it should be possible for
users to override xdg-open with something else in their PATH.
2022-08-19 13:11:27 -05:00

42 lines
1.1 KiB
Nix

{ lib, mkDerivation, fetchFromGitHub, qmake, qtsvg, makeWrapper, xdg-utils }:
mkDerivation rec {
pname = "mytetra";
version = "1.44.55";
src = fetchFromGitHub {
owner = "xintrea";
repo = "mytetra_dev";
rev = "v.${version}";
sha256 = "sha256-jQXnDoLkqbDZxfsYKPDsTOE7p/BFeA8wEznpbkRVGdw=";
};
nativeBuildInputs = [ qmake makeWrapper ];
buildInputs = [ qtsvg ];
hardeningDisable = [ "format" ];
preBuild = ''
substituteInPlace app/app.pro \
--replace /usr/local/bin $out/bin \
--replace /usr/share $out/share
substituteInPlace app/src/views/mainWindow/MainWindow.cpp \
--replace ":/resource/pic/logo.svg" "$out/share/icons/hicolor/48x48/apps/mytetra.png"
'';
postFixup = ''
# make xdg-open overrideable at runtime
wrapProgram $out/bin/mytetra \
--suffix PATH : ${xdg-utils}/bin
'';
meta = with lib; {
description = "Smart manager for information collecting";
homepage = "https://webhamster.ru/site/page/index/articles/projectcode/138";
license = licenses.gpl3;
maintainers = [ ];
platforms = platforms.linux;
};
}