about summary refs log tree commit diff
path: root/pkgs/applications/misc/valentina/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/misc/valentina/default.nix')
-rw-r--r--pkgs/applications/misc/valentina/default.nix75
1 files changed, 32 insertions, 43 deletions
diff --git a/pkgs/applications/misc/valentina/default.nix b/pkgs/applications/misc/valentina/default.nix
index 7329d8204cd7..f5cd55c534c3 100644
--- a/pkgs/applications/misc/valentina/default.nix
+++ b/pkgs/applications/misc/valentina/default.nix
@@ -1,65 +1,54 @@
-{ mkDerivation, lib, fetchhg
+{ lib, stdenv, fetchFromGitLab, substituteAll, installShellFiles
 , qmake, qttools
-, qtbase, qtsvg, qtxmlpatterns
-, poppler_utils
+, qtsvg, qttranslations, qtxmlpatterns
+, wrapQtAppsHook
 }:
 
-with lib;
-
-mkDerivation rec {
+stdenv.mkDerivation rec {
   pname = "valentina";
-  version = "0.6.1";
+  version = "0.7.51";
 
-  src = fetchhg {
-    url = "https://bitbucket.org/dismine/valentina";
+  src = fetchFromGitLab {
+    owner = "smart-pattern";
+    repo = "valentina";
     rev = "v${version}";
-    sha256 = "0dxk2av7xbsd233sr9wa1hamzb7pp8yx6p5b43rsnvnzchkqf423";
+    hash = "sha256-N9fC2tCP4TVNncatHaz5W5Mp3jOmAcEWYCl30+0myaE=";
   };
 
+  patches = (substituteAll {
+    # See https://github.com/NixOS/nixpkgs/issues/86054
+    src = ./fix-qttranslations-path.patch;
+    inherit qttranslations;
+  });
+
   postPatch = ''
-    substituteInPlace common.pri \
-      --replace '$$[QT_INSTALL_HEADERS]/QtXmlPatterns' '${getDev qtxmlpatterns}/include/QtXmlPatterns' \
-      --replace '$$[QT_INSTALL_HEADERS]/QtSvg' '${getDev qtsvg}/include/QtSvg' \
-      --replace '$$[QT_INSTALL_HEADERS]/' '${getDev qtbase}/include/' \
-      --replace '$$[QT_INSTALL_HEADERS]' '${getDev qtbase}'
-    substituteInPlace src/app/tape/tape.pro \
-      --replace '$$[QT_INSTALL_BINS]/rcc' '${getDev qtbase}/bin/rcc'
     substituteInPlace src/app/translations.pri \
-      --replace '$$[QT_INSTALL_BINS]/$$LRELEASE' '${getDev qttools}/bin/lrelease'
-    substituteInPlace src/app/valentina/mainwindowsnogui.cpp \
-      --replace 'define PDFTOPS "pdftops"' 'define PDFTOPS "${getBin poppler_utils}/bin/pdftops"'
-    substituteInPlace src/app/valentina/dialogs/dialogsavelayout.h \
-      --replace 'define PDFTOPS "pdftops"' 'define PDFTOPS "${getBin poppler_utils}/bin/pdftops"'
+      --replace '$$[QT_INSTALL_BINS]/$$LRELEASE' '${lib.getDev qttools}/bin/lrelease'
   '';
 
-  nativeBuildInputs = [ qmake qttools ];
+  nativeBuildInputs = [ qmake qttools wrapQtAppsHook installShellFiles ];
 
-  buildInputs = [ qtbase qtsvg qtxmlpatterns poppler_utils ];
-
-  configurePhase = ''
-    qmake PREFIX=/ Valentina.pro -r "CONFIG += noTests noRunPath no_ccache noDebugSymbols"
-  '';
+  buildInputs = [ qtsvg qtxmlpatterns ];
 
-  installFlags = [ "INSTALL_ROOT=$(out)" ];
+  qmakeFlags = [
+    "-r"
+    "PREFIX=${placeholder "out"}"
+    "CONFIG+=noTests"
+    "CONFIG+=noRunPath"
+    "CONFIG+=no_ccache"
+    "CONFIG+=noDebugSymbols"
+  ];
 
   postInstall = ''
-    mv $out/usr/share $out/
-    rmdir $out/usr
-
-    mkdir -p $out/share/man/man1
-    gzip -9c dist/debian/valentina.1 > $out/share/man/man1/valentina.1.gz
-    gzip -9c dist/debian/tape.1 > $out/share/man/man1/tape.1.gz
-
-    mkdir -p $out/share/mime/packages
-    cp dist/debian/valentina.sharedmimeinfo $out/share/mime/packages/valentina.xml
+    installManPage dist/debian/*.1
+    install -Dm644 dist/debian/valentina.sharedmimeinfo $out/share/mime/packages/valentina.xml
   '';
 
-  enableParallelBuilding = true;
-
-  meta = {
+  meta = with lib; {
     description = "An open source sewing pattern drafting software";
-    homepage = "https://valentinaproject.bitbucket.io/";
-    license = licenses.gpl3;
+    homepage = "https://smart-pattern.com.ua/";
+    changelog = "https://gitlab.com/smart-pattern/valentina/-/blob/v${version}/ChangeLog.txt";
+    license = licenses.gpl3Plus;
     platforms = platforms.linux;
     maintainers = with maintainers; [ jfrankenau ];
   };