Merge pull request #146531 from sikmir/kristall

kristall: fix build on darwin

authored by

Domen Kožar and committed by
GitHub
007f9f1e 8df86556

+27 -14
+27 -14
pkgs/applications/networking/browsers/kristall/default.nix
··· 1 - { lib, mkDerivation, fetchFromGitHub, qtbase, qtmultimedia }: 1 + { lib, stdenv, fetchFromGitHub, wrapQtAppsHook, qmake, qtmultimedia }: 2 2 3 - mkDerivation rec { 3 + stdenv.mkDerivation rec { 4 4 pname = "kristall"; 5 5 version = "0.3"; 6 + 6 7 src = fetchFromGitHub { 7 8 owner = "MasterQ32"; 8 9 repo = "kristall"; 9 - rev = "V" + version; 10 + rev = "V${version}"; 10 11 sha256 = "07nf7w6ilzs5g6isnvsmhh4qa1zsprgjyf0zy7rhpx4ikkj8c8zq"; 11 12 }; 12 13 13 - buildInputs = [ qtbase qtmultimedia ]; 14 + postPatch = lib.optionalString stdenv.cc.isClang '' 15 + sed -i '1i #include <errno.h>' src/browsertab.cpp 16 + ''; 17 + 18 + nativeBuildInputs = [ wrapQtAppsHook qmake ]; 19 + 20 + buildInputs = [ qtmultimedia ]; 14 21 15 22 qmakeFlags = [ "src/kristall.pro" ]; 16 23 17 - installPhase = '' 24 + installPhase = if stdenv.isDarwin then '' 25 + mkdir -p $out/Applications 26 + mv kristall.app $out/Applications 27 + '' else '' 18 28 install -Dt $out/bin kristall 19 29 install -D Kristall.desktop $out/share/applications/net.random-projects.kristall.desktop 30 + install -D src/icons/kristall.svg $out/share/icons/hicolor/scalable/apps/net.random-projects.kristall.svg 31 + for size in 16 32 64 128; do 32 + install -D src/icons/kristall-''${size}.png $out/share/icons/hicolor/''${size}x''${size}/apps/net.random-projects.kristall.png 33 + done 20 34 ''; 21 35 22 - meta = with lib; 23 - src.meta // { 24 - description = 25 - "Graphical small-internet client, supports gemini, http, https, gopher, finger"; 26 - homepage = "https://random-projects.net/projects/kristall.gemini"; 27 - maintainers = with maintainers; [ ehmry ]; 28 - license = licenses.gpl3; 29 - inherit (qtmultimedia.meta) platforms; 30 - }; 36 + meta = with lib; { 37 + description = 38 + "Graphical small-internet client, supports gemini, http, https, gopher, finger"; 39 + homepage = "https://random-projects.net/projects/kristall.gemini"; 40 + maintainers = with maintainers; [ ehmry ]; 41 + license = licenses.gpl3Only; 42 + inherit (qtmultimedia.meta) platforms; 43 + }; 31 44 }