Skip to content

Commit

Permalink
treewide: clean up all qttranslations workarounds
Browse files Browse the repository at this point in the history
There are two kinds of changes here:
- removing explicit qttranslations path hardcoding from applications that were patched to do it
- replacing qttranslations in buildInputs with qttools for packages that really depend on the latter

After this, qttranslation is never used outside Qt itself, as it should.
  • Loading branch information
K900 committed Aug 4, 2023
1 parent 503a2e8 commit d11dcf2
Show file tree
Hide file tree
Showing 34 changed files with 40 additions and 318 deletions.
5 changes: 2 additions & 3 deletions pkgs/applications/editors/molsketch/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
, fetchurl
, cmake
, pkg-config
, qttools
, wrapQtAppsHook
, hicolor-icon-theme
, openbabel
, desktop-file-utils
, qttranslations
}:

mkDerivation rec {
Expand Down Expand Up @@ -37,12 +37,11 @@ mkDerivation rec {
mv $out/lib/molsketch/* $out/lib
'';

nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook ];
nativeBuildInputs = [ cmake pkg-config qttools wrapQtAppsHook ];
buildInputs = [
hicolor-icon-theme
openbabel
desktop-file-utils
qttranslations
];

meta = with lib; {
Expand Down
2 changes: 0 additions & 2 deletions pkgs/applications/emulators/pcsx2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
, qtbase
, qtsvg
, qttools
, qttranslations
, qtwayland
, rapidyaml
, SDL2
Expand Down Expand Up @@ -83,7 +82,6 @@ llvmPackages_16.stdenv.mkDerivation rec {
qtbase
qtsvg
qttools
qttranslations
qtwayland
rapidyaml
SDL2
Expand Down
7 changes: 0 additions & 7 deletions pkgs/applications/gis/openorienteering-mapper/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
, qtlocation
, qtsensors
, qttools
, qttranslations
, substituteAll
, zlib
}:

Expand All @@ -31,11 +29,6 @@ mkDerivation rec {
};

patches = [
# https://github.com/NixOS/nixpkgs/issues/86054
(substituteAll {
src = ./fix-qttranslations-path.diff;
inherit qttranslations;
})
# https://github.com/OpenOrienteering/mapper/pull/1907
(fetchpatch {
url = "https://github.com/OpenOrienteering/mapper/commit/bc52aa567e90a58d6963b44d5ae1909f3f841508.patch";
Expand Down

This file was deleted.

12 changes: 2 additions & 10 deletions pkgs/applications/gis/qmapshack/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ mkDerivation, lib, fetchFromGitHub, cmake, substituteAll
, qtscript, qttranslations, qtwebengine, gdal, proj, routino, quazip }:
{ mkDerivation, lib, fetchFromGitHub, cmake
, qtscript, qtwebengine, gdal, proj, routino, quazip }:

mkDerivation rec {
pname = "qmapshack";
Expand All @@ -12,14 +12,6 @@ mkDerivation rec {
sha256 = "sha256-2otvRKtFb51PLrIh/Hxltp69n5nyR63HGGvk73TFjqA=";
};

patches = [
# See https://github.com/NixOS/nixpkgs/issues/86054
(substituteAll {
src = ./fix-qttranslations-path.patch;
inherit qttranslations;
})
];

nativeBuildInputs = [ cmake ];

buildInputs = [ qtscript qtwebengine gdal proj routino quazip ];
Expand Down
74 changes: 0 additions & 74 deletions pkgs/applications/gis/qmapshack/fix-qttranslations-path.patch

This file was deleted.

11 changes: 0 additions & 11 deletions pkgs/applications/misc/birdtray/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
, qtbase
, qttools
, qtx11extras
, qttranslations
}:

mkDerivation rec {
Expand All @@ -21,21 +20,11 @@ mkDerivation rec {
sha256 = "1469ng6zk0qx0qfsihrnlz1j9i1wk0hx4vqdaplz9mdpyxvmlryk";
};

patches = [
# See https://github.com/NixOS/nixpkgs/issues/86054
./fix-qttranslations-path.diff
];

nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [
qtbase qttools qtx11extras
];

postPatch = ''
substituteInPlace src/birdtrayapp.cpp \
--subst-var-by qttranslations ${qttranslations}
'';

# Wayland support is broken.
# https://github.com/gyunaev/birdtray/issues/113#issuecomment-621742315
qtWrapperArgs = [ "--set QT_QPA_PLATFORM xcb" ];
Expand Down
13 changes: 0 additions & 13 deletions pkgs/applications/misc/birdtray/fix-qttranslations-path.diff

This file was deleted.

10 changes: 0 additions & 10 deletions pkgs/applications/misc/crow-translate/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{ lib
, stdenv
, fetchzip
, substituteAll
, cmake
, extra-cmake-modules
, qttools
Expand All @@ -10,7 +9,6 @@
, tesseract4
, qtmultimedia
, qtx11extras
, qttranslations
, wrapQtAppsHook
, gst_all_1
, testers
Expand All @@ -26,14 +24,6 @@ stdenv.mkDerivation rec {
hash = "sha256-OVRl9yQKK3hJgRVV/W4Fl3LxdFpJs01Mo3pwxLg2RXg=";
};

patches = [
(substituteAll {
# See https://github.com/NixOS/nixpkgs/issues/86054
src = ./fix-qttranslations-path.patch;
inherit qttranslations;
})
];

postPatch = ''
substituteInPlace data/io.crow_translate.CrowTranslate.desktop \
--replace "Exec=qdbus" "Exec=${lib.getBin qttools}/bin/qdbus"
Expand Down

This file was deleted.

7 changes: 3 additions & 4 deletions pkgs/applications/misc/edgetx/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ lib, mkDerivation, fetchFromGitHub
, cmake, gcc-arm-embedded, python3Packages
, qtbase, qtmultimedia, qttranslations, SDL, gtest
, qtbase, qtmultimedia, qttools, SDL, gtest
, dfu-util
}:

Expand All @@ -16,9 +16,9 @@ mkDerivation rec {
sha256 = "sha256-bKMAyONy1Udd+2nDVEMrtIsnfqrNuBVMWU7nCqvZ+3E=";
};

nativeBuildInputs = [ cmake gcc-arm-embedded python3Packages.pillow ];
nativeBuildInputs = [ cmake gcc-arm-embedded python3Packages.pillow qttools ];

buildInputs = [ qtbase qtmultimedia qttranslations SDL ];
buildInputs = [ qtbase qtmultimedia SDL ];

postPatch = ''
sed -i companion/src/burnconfigdialog.cpp \
Expand All @@ -27,7 +27,6 @@ mkDerivation rec {

cmakeFlags = [
"-DGTEST_ROOT=${gtest.src}/googletest"
"-DQT_TRANSLATIONS_DIR=${qttranslations}/translations"
"-DDFU_UTIL_PATH=${dfu-util}/bin/dfu-util"
# file RPATH_CHANGE could not write new RPATH
"-DCMAKE_SKIP_BUILD_RPATH=ON"
Expand Down
7 changes: 1 addition & 6 deletions pkgs/applications/misc/gpsbabel/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ lib, stdenv, fetchFromGitHub, fetchurl, pkg-config, which
, qtbase, qmake, qttools, qttranslations, wrapQtAppsHook
, qmake, qttools, wrapQtAppsHook
, libusb1, shapelib, zlib
, withGUI ? false, qtserialport
, withMapPreview ? (!stdenv.isDarwin), qtwebengine
Expand All @@ -21,11 +21,6 @@ stdenv.mkDerivation rec {

postPatch = ''
patchShebangs testo
'' + lib.optionalString withGUI ''
# See https://github.com/NixOS/nixpkgs/issues/86054
substituteInPlace gui/mainwindow.cc \
--replace 'QLibraryInfo::location(QLibraryInfo::TranslationsPath)' \
'QLatin1String("${qttranslations}/translations")'
'' + lib.optionalString withDoc ''
substituteInPlace gbversion.h.qmake.in \
--replace /usr/share/doc $doc/share/doc
Expand Down
10 changes: 2 additions & 8 deletions pkgs/applications/misc/gpxlab/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ stdenv, mkDerivation, lib, fetchFromGitHub, substituteAll
, qmake, qttools, qttranslations
{ stdenv, mkDerivation, lib, fetchFromGitHub
, qmake, qttools
}:

mkDerivation rec {
Expand All @@ -13,12 +13,6 @@ mkDerivation rec {
sha256 = "080vnwcciqblfrbfyz9gjhl2lqw1hkdpbgr5qfrlyglkd4ynjd84";
};

patches = (substituteAll {
# See https://github.com/NixOS/nixpkgs/issues/86054
src = ./fix-qttranslations-path.patch;
inherit qttranslations;
});

nativeBuildInputs = [ qmake qttools ];

preConfigure = ''
Expand Down
17 changes: 0 additions & 17 deletions pkgs/applications/misc/gpxlab/fix-qttranslations-path.patch

This file was deleted.

8 changes: 0 additions & 8 deletions pkgs/applications/misc/gpxsee/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
, fetchFromGitHub
, qmake
, nix-update-script
, substituteAll
, qtbase
, qttools
, qttranslations
, qtlocation ? null # qt5 only
, qtpositioning ? null # qt6 only
, qtpbfimageplugin
Expand All @@ -31,12 +29,6 @@ stdenv.mkDerivation rec {
hash = "sha256-Zf2eyDx5QK69W6HNz/IGGHkX2qCDnxYsU8KLCgU9teY=";
};

patches = (substituteAll {
# See https://github.com/NixOS/nixpkgs/issues/86054
src = ./fix-qttranslations-path.diff;
inherit qttranslations;
});

buildInputs = [ qtpbfimageplugin qtserialport ]
++ (if isQt6 then [
qtbase
Expand Down
18 changes: 0 additions & 18 deletions pkgs/applications/misc/gpxsee/fix-qttranslations-path.diff

This file was deleted.

Loading

0 comments on commit d11dcf2

Please sign in to comment.