2021-11-19 10:37:32 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, qmake, qtbase, qtsvg, poppler, libzip, pkg-config, wrapQtAppsHook }:
|
2021-03-06 15:52:57 +00:00
|
|
|
|
2021-11-19 10:37:32 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-03-06 15:52:57 +00:00
|
|
|
pname = "kitsas";
|
2021-11-19 10:37:32 +00:00
|
|
|
version = "3.1.1";
|
2021-03-06 15:52:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "artoh";
|
|
|
|
repo = "kitupiikki";
|
|
|
|
rev = "v${version}";
|
2021-11-19 10:37:32 +00:00
|
|
|
sha256 = "sha256-nmlGLrVsTQawYHNgaax9EiutL4xgFdOD34Q4/rnB/D0=";
|
2021-03-06 15:52:57 +00:00
|
|
|
};
|
|
|
|
|
2021-11-19 10:37:32 +00:00
|
|
|
# QList::swapItemsAt was introduced in Qt 5.13
|
|
|
|
patches = lib.optional (lib.versionOlder qtbase.version "5.13") ./qt-512.patch;
|
2021-03-06 15:52:57 +00:00
|
|
|
|
2021-11-19 10:37:32 +00:00
|
|
|
nativeBuildInputs = [ pkg-config qmake wrapQtAppsHook ];
|
|
|
|
|
|
|
|
buildInputs = [ qtsvg poppler libzip ];
|
2021-03-06 15:52:57 +00:00
|
|
|
|
|
|
|
# We use a separate build-dir as otherwise ld seems to get confused between
|
|
|
|
# directory and executable name on buildPhase.
|
|
|
|
preConfigure = ''
|
2021-11-19 10:37:32 +00:00
|
|
|
mkdir build && cd build
|
2021-03-06 15:52:57 +00:00
|
|
|
'';
|
|
|
|
|
2021-11-19 10:37:32 +00:00
|
|
|
qmakeFlags = [ "../kitsas/kitsas.pro" ];
|
2021-03-06 15:52:57 +00:00
|
|
|
|
2021-11-19 10:37:32 +00:00
|
|
|
installPhase = if stdenv.isDarwin then ''
|
|
|
|
mkdir -p $out/Applications
|
|
|
|
mv kitsas.app $out/Applications
|
|
|
|
'' else ''
|
|
|
|
install -Dm755 kitsas -t $out/bin
|
|
|
|
install -Dm644 ../kitsas.svg -t $out/share/icons/hicolor/scalable/apps
|
|
|
|
install -Dm644 ../kitsas.png -t $out/share/icons/hicolor/256x256/apps
|
|
|
|
install -Dm644 ../kitsas.desktop -t $out/share/applications
|
2021-03-06 15:52:57 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/artoh/kitupiikki";
|
|
|
|
description = "An accounting tool suitable for Finnish associations and small business";
|
|
|
|
maintainers = with maintainers; [ gspia ];
|
|
|
|
license = licenses.gpl3Plus;
|
2021-11-19 10:37:32 +00:00
|
|
|
platforms = platforms.unix;
|
2021-03-06 15:52:57 +00:00
|
|
|
};
|
|
|
|
}
|