1{
2 lib,
3 mkDerivation,
4 fetchFromGitHub,
5 qmake,
6 qtsvg,
7 makeWrapper,
8 xdg-utils,
9}:
10
11mkDerivation rec {
12 pname = "mytetra";
13 version = "1.44.183";
14
15 src = fetchFromGitHub {
16 owner = "xintrea";
17 repo = "mytetra_dev";
18 rev = "v.${version}";
19 sha256 = "sha256-9fPioIws+9rzczCsbtOS/ra4eW5FZZeiKmDpqJqx3MQ=";
20 };
21
22 nativeBuildInputs = [
23 qmake
24 makeWrapper
25 ];
26 buildInputs = [ qtsvg ];
27
28 hardeningDisable = [ "format" ];
29
30 preBuild = ''
31 substituteInPlace app/app.pro \
32 --replace /usr/local/bin $out/bin \
33 --replace /usr/share $out/share
34
35 substituteInPlace app/src/views/mainWindow/MainWindow.cpp \
36 --replace ":/resource/pic/logo.svg" "$out/share/icons/hicolor/48x48/apps/mytetra.png"
37
38 # https://github.com/xintrea/mytetra_dev/issues/164
39 substituteInPlace thirdParty/mimetex/mimetex.c \
40 --replace "const char *strcasestr" "char *strcasestr"
41 '';
42
43 postFixup = ''
44 # make xdg-open overrideable at runtime
45 wrapProgram $out/bin/mytetra \
46 --suffix PATH : ${xdg-utils}/bin
47 '';
48
49 meta = with lib; {
50 description = "Smart manager for information collecting";
51 mainProgram = "mytetra";
52 homepage = "https://webhamster.ru/site/page/index/articles/projectcode/138";
53 license = licenses.gpl3;
54 maintainers = [ ];
55 platforms = platforms.linux;
56 };
57}