diff options
author | Sandro <sandro.jaeckel@gmail.com> | 2021-02-17 23:43:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-17 23:43:25 +0100 |
commit | 4175c392616f2a0459dea0d8339d48c9139e9a51 (patch) | |
tree | 8a7274fbe15edbf6c7be35e22cc0a748ad8a5f52 /pkgs/applications/radio | |
parent | fe952a16e4185bb1d52c666e7d0e0397d2b726a5 (diff) | |
parent | 055345eb8938dc18d56ea125cffa4688a9ed3130 (diff) |
Merge pull request #113228 from SCOTT-HAMILTON/cqrlog
Diffstat (limited to 'pkgs/applications/radio')
-rw-r--r-- | pkgs/applications/radio/cqrlog/default.nix | 101 | ||||
-rw-r--r-- | pkgs/applications/radio/cqrlog/fix-makefile-lazarusdir.patch | 13 |
2 files changed, 114 insertions, 0 deletions
diff --git a/pkgs/applications/radio/cqrlog/default.nix b/pkgs/applications/radio/cqrlog/default.nix new file mode 100644 index 0000000000000..d86a08f3a1b07 --- /dev/null +++ b/pkgs/applications/radio/cqrlog/default.nix @@ -0,0 +1,101 @@ +{ lib +, stdenv +, fetchFromGitHub +, fpc +, lazarus +, atk +, cairo +, gdk-pixbuf +, glib +, gtk2-x11 +, libX11 +, pango +, hamlib +, mysql57 +, tqsl +, xdg-utils +, xplanet +, autoPatchelfHook +, wrapGAppsHook +}: + +stdenv.mkDerivation rec { + pname = "cqrlog"; + version = "2.5.2"; + + src = fetchFromGitHub { + owner = "ok2cqr"; + repo = "cqrlog"; + rev = "v${version}"; + sha256 = "0zzcg0bl6mq4wfifj998x9x09w8sigbh46synpqx034fpr0swyhb"; + }; + + # Adds the possiblity to change the lazarus directory, + # otherwise, we would get error : "directory lcl not found" + patches = [ ./fix-makefile-lazarusdir.patch ]; + + postPatch = '' + substituteInPlace Makefile \ + --replace @Lazarusdir@ "${lazarus}/share/lazarus" \ + --replace /usr "" + substituteInPlace src/fTRXControl.pas \ + --replace "/usr/bin/rigctld" "${hamlib}/bin/rigctld" + substituteInPlace src/fCallAttachment.pas \ + --replace "/usr/bin/xdg-open" "${xdg-utils}/bin/xdg-open" + substituteInPlace src/fRotControl.pas \ + --replace "/usr/bin/rotctld" "${hamlib}/bin/rotctld" + substituteInPlace src/fPreferences.pas \ + --replace "/usr/bin/rigctld" "${hamlib}/bin/rigctld" \ + --replace "/usr/bin/rotctld" "${hamlib}/bin/rotctld" \ + --replace "/usr/bin/xplanet" "${xplanet}/bin/xplanet" + substituteInPlace src/fLoTWExport.pas \ + --replace "/usr/bin/tqsl" "${tqsl}/bin/tqsl" + substituteInPlace src/dUtils.pas \ + --replace "/usr/bin/xplanet" "${xplanet}/bin/xplanet" \ + --replace "/usr/bin/rigctld" "${hamlib}/bin/rigctld" + # Order is important + substituteInPlace src/dData.pas \ + --replace "/usr/bin/mysqld_safe" "${mysql57}/bin/mysqld_safe" \ + --replace "/usr/bin/mysqld" "${mysql57}/bin/mysqld" + + # To be fail when I need to patch a new hardcoded binary + ! grep -C src -RC0 "/usr" + ''; + + nativeBuildInputs = [ lazarus fpc autoPatchelfHook wrapGAppsHook ]; + buildInputs = [ + atk + cairo + gdk-pixbuf + glib + gtk2-x11 + libX11 + pango + ]; + propagatedBuildInputs = [ + hamlib + mysql57 + tqsl + xdg-utils + xplanet + ]; + + makeFlags = [ + "FPC=fpc" + "PP=fpc" + "DESTDIR=$(out)" + ]; + + postFixup = '' + libmysqlclient=$(find "${mysql57}/lib" -name "libmysqlclient.so.*" | tail -n1) + patchelf --add-needed "$libmysqlclient" "$out/bin/.cqrlog-wrapped" + ''; + + meta = with lib; { + description = "Linux logging program for amateur radio operators"; + homepage = "https://www.cqrlog.com/"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ shamilton ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/applications/radio/cqrlog/fix-makefile-lazarusdir.patch b/pkgs/applications/radio/cqrlog/fix-makefile-lazarusdir.patch new file mode 100644 index 0000000000000..9170387966acd --- /dev/null +++ b/pkgs/applications/radio/cqrlog/fix-makefile-lazarusdir.patch @@ -0,0 +1,13 @@ +Seulement dans b: logs +diff --color -ur a/Makefile b/Makefile +--- a/Makefile 2021-02-15 17:07:14.333810200 +0100 ++++ b/Makefile 2021-02-15 17:19:18.599426984 +0100 +@@ -6,7 +6,7 @@ + tmpdir = /tmp + + cqrlog: src/cqrlog.lpi +- $(CC) --ws=gtk2 --pcp=$(tmpdir)/.lazarus src/cqrlog.lpi ++ $(CC) --ws=gtk2 --pcp=$(tmpdir)/.lazarus --lazarusdir=@Lazarusdir@ src/cqrlog.lpi + $(ST) src/cqrlog + gzip tools/cqrlog.1 -c > tools/cqrlog.1.gz + |