mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-23 14:13:35 +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" ```
55 lines
1.4 KiB
Nix
55 lines
1.4 KiB
Nix
{ lib, stdenv, fetchFromGitLab, meson, ninja, pkg-config, gobject-introspection, vala
|
|
, gtk-doc, docbook_xsl, docbook_xml_dtd_43
|
|
, gtk3, gnome-desktop
|
|
, dbus, xvfb-run, libxml2
|
|
, hicolor-icon-theme
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "libhandy";
|
|
version = "0.0.13";
|
|
|
|
outputs = [ "out" "dev" "devdoc" ];
|
|
outputBin = "dev";
|
|
|
|
src = fetchFromGitLab {
|
|
domain = "source.puri.sm";
|
|
owner = "Librem5";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
sha256 = "1y23k623sjkldfrdiwfarpchg5mg58smcy1pkgnwfwca15wm1ra5";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
meson ninja pkg-config gobject-introspection vala libxml2
|
|
gtk-doc docbook_xsl docbook_xml_dtd_43
|
|
];
|
|
buildInputs = [ gnome-desktop gtk3 libxml2 ];
|
|
nativeCheckInputs = [ dbus xvfb-run hicolor-icon-theme ];
|
|
|
|
mesonFlags = [
|
|
"-Dgtk_doc=true"
|
|
"-Dglade_catalog=disabled"
|
|
"-Dintrospection=enabled"
|
|
];
|
|
|
|
doCheck = !stdenv.hostPlatform.isDarwin;
|
|
|
|
checkPhase = ''
|
|
NO_AT_BRIDGE=1 \
|
|
XDG_DATA_DIRS="$XDG_DATA_DIRS:${hicolor-icon-theme}/share" \
|
|
xvfb-run -s '-screen 0 800x600x24' dbus-run-session \
|
|
--config-file=${dbus}/share/dbus-1/session.conf \
|
|
meson test --print-errorlogs
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Library full of GTK widgets for mobile phones";
|
|
mainProgram = "handy-0.0-demo";
|
|
homepage = "https://source.puri.sm/Librem5/libhandy";
|
|
license = licenses.lgpl21Plus;
|
|
maintainers = [ ];
|
|
platforms = platforms.unix;
|
|
};
|
|
}
|