From c3da3ce7390bbd7933d50090e668439baf050b2e Mon Sep 17 00:00:00 2001 From: Nikolay Korotkiy Date: Thu, 18 Nov 2021 23:27:51 +0300 Subject: [PATCH] kristall: fix build on darwin --- .../networking/browsers/kristall/default.nix | 39 ++++++++++++------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/pkgs/applications/networking/browsers/kristall/default.nix b/pkgs/applications/networking/browsers/kristall/default.nix index 4028f8622c3c..1ec6a6e36406 100644 --- a/pkgs/applications/networking/browsers/kristall/default.nix +++ b/pkgs/applications/networking/browsers/kristall/default.nix @@ -1,31 +1,44 @@ -{ lib, mkDerivation, fetchFromGitHub, qtbase, qtmultimedia }: +{ lib, stdenv, mkDerivation, fetchFromGitHub, qmake, qtmultimedia }: mkDerivation rec { pname = "kristall"; version = "0.3"; + src = fetchFromGitHub { owner = "MasterQ32"; repo = "kristall"; - rev = "V" + version; + rev = "V${version}"; sha256 = "07nf7w6ilzs5g6isnvsmhh4qa1zsprgjyf0zy7rhpx4ikkj8c8zq"; }; - buildInputs = [ qtbase qtmultimedia ]; + postPatch = lib.optionalString stdenv.cc.isClang '' + sed -i '1i #include ' src/browsertab.cpp + ''; + + nativeBuildInputs = [ qmake ]; + + buildInputs = [ qtmultimedia ]; qmakeFlags = [ "src/kristall.pro" ]; - installPhase = '' + installPhase = if stdenv.isDarwin then '' + mkdir -p $out/Applications + mv kristall.app $out/Applications + '' else '' install -Dt $out/bin kristall install -D Kristall.desktop $out/share/applications/net.random-projects.kristall.desktop + install -D src/icons/kristall.svg $out/share/icons/hicolor/scalable/apps/net.random-projects.kristall.svg + for size in 16 32 64 128; do + install -D src/icons/kristall-''${size}.png $out/share/icons/hicolor/''${size}x''${size}/apps/net.random-projects.kristall.png + done ''; - meta = with lib; - src.meta // { - description = - "Graphical small-internet client, supports gemini, http, https, gopher, finger"; - homepage = "https://random-projects.net/projects/kristall.gemini"; - maintainers = with maintainers; [ ehmry ]; - license = licenses.gpl3; - inherit (qtmultimedia.meta) platforms; - }; + meta = with lib; { + description = + "Graphical small-internet client, supports gemini, http, https, gopher, finger"; + homepage = "https://random-projects.net/projects/kristall.gemini"; + maintainers = with maintainers; [ ehmry ]; + license = licenses.gpl3Only; + inherit (qtmultimedia.meta) platforms; + }; }