From 57cbfa4e94b939000bc1509338633f858a795b28 Mon Sep 17 00:00:00 2001 From: Thomas Butter Date: Sun, 21 Jun 2026 17:00:30 +0000 Subject: [PATCH] detect-it-easy: 3.10 -> 3.21 --- ...-remove-hard-coded-paths-in-xoptions.patch | 44 ------------------- pkgs/by-name/de/detect-it-easy/package.nix | 20 +++++++-- 2 files changed, 17 insertions(+), 47 deletions(-) delete mode 100644 pkgs/by-name/de/detect-it-easy/0001-remove-hard-coded-paths-in-xoptions.patch diff --git a/pkgs/by-name/de/detect-it-easy/0001-remove-hard-coded-paths-in-xoptions.patch b/pkgs/by-name/de/detect-it-easy/0001-remove-hard-coded-paths-in-xoptions.patch deleted file mode 100644 index 02ca8649949e..000000000000 --- a/pkgs/by-name/de/detect-it-easy/0001-remove-hard-coded-paths-in-xoptions.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff --git a/XOptions/xoptions.cpp b/XOptions/xoptions.cpp -index 8c887c3..36cdbc3 100755 ---- a/XOptions/xoptions.cpp -+++ b/XOptions/xoptions.cpp -@@ -1754,14 +1754,7 @@ bool XOptions::checkNative(const QString &sIniFileName) - #if defined(Q_OS_MAC) - bResult = true; - #elif defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) -- QString sApplicationDirPath = qApp->applicationDirPath(); -- -- if ((sApplicationDirPath == "/bin") || (sApplicationDirPath == "/usr/bin") || (sApplicationDirPath == "/usr/local/bin") || (sApplicationDirPath == "/app/bin") || -- (sApplicationDirPath.contains("/usr/local/bin$")) || isAppImage()) { -- bResult = true; -- } else { -- bResult = false; -- } -+ bResult = true; - #elif defined(Q_OS_WIN) - QString sApplicationDirPath = qApp->applicationDirPath(); - -@@ -1788,22 +1781,7 @@ QString XOptions::getApplicationDataPath() - #ifdef Q_OS_MAC - sResult = sApplicationDirPath + "/../Resources"; - #elif defined(Q_OS_LINUX) -- if (isNative()) { -- if (sApplicationDirPath.contains("/usr/local/bin$")) { -- QString sPrefix = sApplicationDirPath.section("/usr/local/bin", 0, 0); -- -- sResult += sPrefix + QString("/usr/local/lib/%1").arg(qApp->applicationName()); -- } else { -- if (sApplicationDirPath.contains("/tmp/.mount_")) // AppImage -- { -- sResult = sApplicationDirPath.section("/", 0, 2); -- } -- -- sResult += QString("/usr/lib/%1").arg(qApp->applicationName()); -- } -- } else { -- sResult = sApplicationDirPath; -- } -+ sResult = sApplicationDirPath + "/../lib/die"; - #elif defined(Q_OS_FREEBSD) - sResult = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation).at(1) + QDir::separator() + qApp->applicationName(); - #else diff --git a/pkgs/by-name/de/detect-it-easy/package.nix b/pkgs/by-name/de/detect-it-easy/package.nix index 000e587214f6..a6a1060eb8ff 100644 --- a/pkgs/by-name/de/detect-it-easy/package.nix +++ b/pkgs/by-name/de/detect-it-easy/package.nix @@ -13,17 +13,31 @@ stdenv.mkDerivation (finalAttrs: { pname = "detect-it-easy"; - version = "3.10"; + version = "3.21"; src = fetchFromGitHub { owner = "horsicq"; repo = "DIE-engine"; tag = finalAttrs.version; fetchSubmodules = true; - hash = "sha256-yHgxYig5myY2nExweUk2muKbJTKN3SiwOLgQcMIY/BQ="; + hash = "sha256-gst0suw5mNR3A0s/jIfte41cOOxKR0IsTFkO7ydwKMs="; }; - patches = [ ./0001-remove-hard-coded-paths-in-xoptions.patch ]; + postPatch = '' + # Convert CRLF to LF so substituteInPlace works + tr -d '\r' < XOptions/xoptions.cpp > XOptions/xoptions.cpp.tmp + mv XOptions/xoptions.cpp.tmp XOptions/xoptions.cpp + + substituteInPlace XOptions/xoptions.cpp \ + --replace-fail 'QString XOptions::getApplicationDataPath() + { + QString sResult;' 'QString XOptions::getApplicationDataPath() + { + #if defined(Q_OS_LINUX) + return qApp->applicationDirPath() + "/../lib/die"; + #endif + QString sResult;' + ''; buildInputs = [ libsForQt5.qtbase