mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
72 lines
1.6 KiB
Nix
72 lines
1.6 KiB
Nix
{ stdenv, lib, python3Packages, gettext, qt5, fetchFromGitHub }:
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
pname = "dupeguru";
|
|
version = "4.3.1";
|
|
|
|
format = "other";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "arsenetar";
|
|
repo = "dupeguru";
|
|
rev = version;
|
|
hash = "sha256-/jkZiCapmCLMp7WfgUmpsR8aNCfb3gBELlMYaC4e7zI=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
gettext
|
|
python3Packages.pyqt5
|
|
python3Packages.setuptools
|
|
qt5.wrapQtAppsHook
|
|
];
|
|
|
|
propagatedBuildInputs = with python3Packages; [
|
|
hsaudiotag3k
|
|
mutagen
|
|
polib
|
|
pyqt5
|
|
pyqt5-sip
|
|
semantic-version
|
|
send2trash
|
|
sphinx
|
|
];
|
|
|
|
makeFlags = [
|
|
"PREFIX=${placeholder "out"}"
|
|
"NO_VENV=1"
|
|
];
|
|
|
|
nativeCheckInputs = with python3Packages; [
|
|
pytestCheckHook
|
|
];
|
|
|
|
preCheck = ''
|
|
export HOME="$(mktemp -d)"
|
|
'';
|
|
|
|
# Avoid double wrapping Python programs.
|
|
dontWrapQtApps = true;
|
|
|
|
# TODO: A bug in python wrapper
|
|
# see https://github.com/NixOS/nixpkgs/pull/75054#discussion_r357656916
|
|
preFixup = ''
|
|
makeWrapperArgs="''${qtWrapperArgs[@]}"
|
|
'';
|
|
|
|
# Executable in $out/bin is a symlink to $out/share/dupeguru/run.py
|
|
# so wrapPythonPrograms hook does not handle it automatically.
|
|
postFixup = ''
|
|
wrapPythonProgramsIn "$out/share/dupeguru" "$out $pythonPath"
|
|
'';
|
|
|
|
meta = with lib; {
|
|
broken = stdenv.hostPlatform.isDarwin;
|
|
description = "GUI tool to find duplicate files in a system";
|
|
homepage = "https://github.com/arsenetar/dupeguru";
|
|
license = licenses.bsd3;
|
|
platforms = platforms.unix;
|
|
maintainers = with maintainers; [ novoxd ];
|
|
mainProgram = "dupeguru";
|
|
};
|
|
}
|