1 { lib, stdenv, fetchFromGitHub, qmake, qtsvg, poppler, libzip, pkg-config, wrapQtAppsHook }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitHub {
11 hash = "sha256-ODl1yrtrCVhuBWbA1AvHl22d+JSdySG/Gi2hlpVW3jg=";
15 substituteInPlace kitsas/kitsas.pro \
16 --replace "LIBS += -L/usr/local/opt/poppler-qt5/lib -lpoppler-qt6" "LIBS += -lpoppler-qt5"
19 nativeBuildInputs = [ pkg-config qmake wrapQtAppsHook ];
21 buildInputs = [ qtsvg poppler libzip ];
23 # We use a separate build-dir as otherwise ld seems to get confused between
24 # directory and executable name on buildPhase.
26 mkdir build && cd build
29 qmakeFlags = [ "../kitsas/kitsas.pro" ];
31 installPhase = lib.optionalString stdenv.hostPlatform.isDarwin ''
32 mkdir -p $out/Applications
33 mv kitsas.app $out/Applications
34 '' + lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
35 install -Dm755 kitsas -t $out/bin
36 install -Dm644 ../kitsas.svg -t $out/share/icons/hicolor/scalable/apps
37 install -Dm644 ../kitsas.png -t $out/share/icons/hicolor/256x256/apps
38 install -Dm644 ../kitsas.desktop -t $out/share/applications
42 homepage = "https://github.com/artoh/kitupiikki";
43 description = "Accounting tool suitable for Finnish associations and small business";
44 mainProgram = "kitsas";
45 maintainers = with maintainers; [ gspia ];
46 license = licenses.gpl3Plus;
47 platforms = platforms.unix;