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" ```
65 lines
1.3 KiB
Nix
65 lines
1.3 KiB
Nix
{ lib
|
|
, stdenv
|
|
, rustPlatform
|
|
, fetchFromGitHub
|
|
, pkg-config
|
|
, glib
|
|
, cairo
|
|
, pango
|
|
, atk
|
|
, gdk-pixbuf
|
|
, gtk4
|
|
, wrapGAppsHook4
|
|
, darwin
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "szyszka";
|
|
version = "3.0.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "qarmin";
|
|
repo = "szyszka";
|
|
rev = version;
|
|
hash = "sha256-LkXGKDFKaY+mg53ZEO4h2br/4eRle/QbSQJTVEMpAoY=";
|
|
};
|
|
|
|
cargoHash = "sha256-WJR1BogNnQoZeOt5yBFzjYNZS8OmE84R1FbQpHTb7V0=";
|
|
|
|
nativeBuildInputs = [
|
|
pkg-config
|
|
wrapGAppsHook4
|
|
];
|
|
|
|
buildInputs = [
|
|
glib
|
|
cairo
|
|
pango
|
|
atk
|
|
gdk-pixbuf
|
|
gtk4
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [
|
|
Foundation
|
|
]);
|
|
|
|
postInstall = ''
|
|
install -m 444 \
|
|
-D data/com.github.qarmin.szyszka.desktop \
|
|
-t $out/share/applications
|
|
install -m 444 \
|
|
-D data/com.github.qarmin.szyszka.metainfo.xml \
|
|
-t $out/share/metainfo
|
|
install -m 444 \
|
|
-D data/icons/com.github.qarmin.szyszka.svg \
|
|
-t $out/share/icons/hicolor/scalable/apps
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Simple but powerful and fast bulk file renamer";
|
|
homepage = "https://github.com/qarmin/szyszka";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ kranzes ];
|
|
mainProgram = "szyszka";
|
|
};
|
|
}
|