kitsas: 3.0 → 3.1.1, enable on darwin
This commit is contained in:
parent
03a46c8b3d
commit
d49cad9bad
|
@ -1,44 +1,39 @@
|
||||||
{ lib, mkDerivation, fetchFromGitHub, qmake, qtsvg, qtcreator, poppler, libzip, pkg-config }:
|
{ lib, stdenv, fetchFromGitHub, qmake, qtbase, qtsvg, poppler, libzip, pkg-config, wrapQtAppsHook }:
|
||||||
|
|
||||||
mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "kitsas";
|
pname = "kitsas";
|
||||||
version = "3.0";
|
version = "3.1.1";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "artoh";
|
owner = "artoh";
|
||||||
repo = "kitupiikki";
|
repo = "kitupiikki";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "sha256-UH2bFJZd83APRjlv6JR+Uy+ng4DWnnLmavAgjgSOiRo=";
|
sha256 = "sha256-nmlGLrVsTQawYHNgaax9EiutL4xgFdOD34Q4/rnB/D0=";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ pkg-config ];
|
# QList::swapItemsAt was introduced in Qt 5.13
|
||||||
|
patches = lib.optional (lib.versionOlder qtbase.version "5.13") ./qt-512.patch;
|
||||||
|
|
||||||
buildInputs = [ qmake qtsvg poppler libzip ];
|
nativeBuildInputs = [ pkg-config qmake wrapQtAppsHook ];
|
||||||
|
|
||||||
|
buildInputs = [ qtsvg poppler libzip ];
|
||||||
|
|
||||||
# We use a separate build-dir as otherwise ld seems to get confused between
|
# We use a separate build-dir as otherwise ld seems to get confused between
|
||||||
# directory and executable name on buildPhase.
|
# directory and executable name on buildPhase.
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
mkdir build-linux
|
mkdir build && cd build
|
||||||
cd build-linux
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
qmakeFlags = [
|
qmakeFlags = [ "../kitsas/kitsas.pro" ];
|
||||||
"../kitsas/kitsas.pro"
|
|
||||||
"-spec"
|
|
||||||
"linux-g++"
|
|
||||||
"CONFIG+=release"
|
|
||||||
];
|
|
||||||
|
|
||||||
preFixup = ''
|
installPhase = if stdenv.isDarwin then ''
|
||||||
make clean
|
mkdir -p $out/Applications
|
||||||
rm Makefile
|
mv kitsas.app $out/Applications
|
||||||
'';
|
'' else ''
|
||||||
|
install -Dm755 kitsas -t $out/bin
|
||||||
installPhase = ''
|
install -Dm644 ../kitsas.svg -t $out/share/icons/hicolor/scalable/apps
|
||||||
mkdir -p $out/bin $out/share/applications
|
install -Dm644 ../kitsas.png -t $out/share/icons/hicolor/256x256/apps
|
||||||
cp kitsas $out/bin
|
install -Dm644 ../kitsas.desktop -t $out/share/applications
|
||||||
cp $src/kitsas.png $out/share/applications
|
|
||||||
cp $src/kitsas.desktop $out/share/applications
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
@ -46,6 +41,6 @@ mkDerivation rec {
|
||||||
description = "An accounting tool suitable for Finnish associations and small business";
|
description = "An accounting tool suitable for Finnish associations and small business";
|
||||||
maintainers = with maintainers; [ gspia ];
|
maintainers = with maintainers; [ gspia ];
|
||||||
license = licenses.gpl3Plus;
|
license = licenses.gpl3Plus;
|
||||||
platforms = platforms.linux;
|
platforms = platforms.unix;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
24
pkgs/applications/office/kitsas/qt-512.patch
Normal file
24
pkgs/applications/office/kitsas/qt-512.patch
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
diff --git i/kitsas/apuri/siirtoapuri.cpp w/kitsas/apuri/siirtoapuri.cpp
|
||||||
|
index 9a2c51f3..9565200f 100644
|
||||||
|
--- i/kitsas/apuri/siirtoapuri.cpp
|
||||||
|
+++ w/kitsas/apuri/siirtoapuri.cpp
|
||||||
|
@@ -25,6 +25,7 @@
|
||||||
|
#include "db/tositetyyppimodel.h"
|
||||||
|
#include "tiliote/tiliotekirjaaja.h"
|
||||||
|
|
||||||
|
+#include <QtAlgorithms>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
SiirtoApuri::SiirtoApuri(QWidget *parent, Tosite *tosite) :
|
||||||
|
@@ -361,8 +362,9 @@ void SiirtoApuri::laskunmaksu()
|
||||||
|
TositeVienti eka = lista.at(0).toMap();
|
||||||
|
tosite()->asetaPvm(eka.pvm());
|
||||||
|
tosite()->asetaOtsikko( eka.selite() );
|
||||||
|
- if( eka.kreditEuro() )
|
||||||
|
- lista.swapItemsAt(0,1);
|
||||||
|
+ if( eka.kreditEuro() ) {
|
||||||
|
+ qSwap(lista.begin()[0], lista.begin()[1]);
|
||||||
|
+ }
|
||||||
|
tosite()->viennit()->asetaViennit(lista);
|
||||||
|
reset();
|
||||||
|
|
Loading…
Reference in a new issue