mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-11 08:13:04 +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" ```
63 lines
1.5 KiB
Nix
63 lines
1.5 KiB
Nix
{ lib, stdenv, fetchFromGitHub
|
||
, makeDesktopItem, copyDesktopItems, cmake
|
||
, boost, cups, fmt, libvorbis, libsndfile, minizip, gtest, qt6 }:
|
||
|
||
stdenv.mkDerivation rec {
|
||
pname = "lsd2dsl";
|
||
version = "0.6.0";
|
||
|
||
src = fetchFromGitHub {
|
||
owner = "nongeneric";
|
||
repo = "lsd2dsl";
|
||
rev = "v${version}";
|
||
hash = "sha256-0UsxDNpuWpBrfjh4q3JhZnOyXhHatSa3t/cApiG2JzM=";
|
||
};
|
||
|
||
postPatch = ''
|
||
substituteInPlace CMakeLists.txt --replace "-Werror" ""
|
||
'';
|
||
|
||
nativeBuildInputs = [
|
||
cmake
|
||
qt6.wrapQtAppsHook
|
||
] ++ lib.optional stdenv.hostPlatform.isLinux copyDesktopItems;
|
||
|
||
buildInputs = [
|
||
boost
|
||
cups
|
||
fmt
|
||
libvorbis
|
||
libsndfile
|
||
minizip
|
||
gtest
|
||
qt6.qt5compat
|
||
qt6.qtwebengine
|
||
];
|
||
|
||
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-int-conversion";
|
||
|
||
desktopItems = lib.singleton (makeDesktopItem {
|
||
name = "lsd2dsl";
|
||
exec = "lsd2dsl-qtgui";
|
||
desktopName = "lsd2dsl";
|
||
genericName = "lsd2dsl";
|
||
comment = meta.description;
|
||
categories = [ "Dictionary" "FileTools" "Qt" ];
|
||
});
|
||
|
||
installPhase = ''
|
||
install -Dm755 console/lsd2dsl gui/lsd2dsl-qtgui -t $out/bin
|
||
'';
|
||
|
||
meta = with lib; {
|
||
homepage = "https://rcebits.com/lsd2dsl/";
|
||
description = "Lingvo dictionaries decompiler";
|
||
longDescription = ''
|
||
A decompiler for ABBYY Lingvo’s proprietary dictionaries.
|
||
'';
|
||
license = licenses.mit;
|
||
maintainers = with maintainers; [ sikmir ];
|
||
platforms = platforms.unix;
|
||
};
|
||
}
|