nixpkgs/pkgs/by-name/sn/snippetexpanderx/package.nix
Yueh-Shun Li 91b3db1309 treewide: fix sourceRoot for fetchgit-based src
According to Nixpkgs manual[1] and NixOS 23.11 Release Note[2], the
`sourceRoot` attribute passed to `stdenv.mkDerivation` should be
specified as `"${src.name}"` or `"${src.name}/subdir"` when `src` is
produced using `fetchgit`-based fetchers.

`sourceRoot = "source"` or `sourceRoot = "source/subdir"` is based on
the assumption that the `name` attribute of these pre-unpacked fetchers
are always `"source"`, which is not the case. Expecting constant `name`
also makes the source FODs prone to irrelevent hashes during version
bumps.

[1]: https://nixos.org/manual/nixpkgs/unstable/#var-stdenv-sourceRoot
[2]: https://nixos.org/manual/nixos/stable/release-notes#sec-release-23.11
2024-03-09 07:53:25 +08:00

65 lines
1.1 KiB
Nix

{ lib
, stdenv
, fetchFromSourcehut
, pkg-config
, vala
, wrapGAppsHook
, installShellFiles
, scdoc
, at-spi2-atk
, at-spi2-core
, dbus
, gtk3
, ibus
, libgee
, xorg
, snippetexpanderd
}:
stdenv.mkDerivation rec {
inherit (snippetexpanderd) src version;
pname = "snippetexpanderx";
sourceRoot = "${src.name}/cmd/snippetexpanderx";
nativeBuildInputs = [
pkg-config
vala
wrapGAppsHook
installShellFiles
scdoc
];
buildInputs = [
at-spi2-atk
at-spi2-core
dbus
gtk3
ibus
libgee
xorg.libX11
snippetexpanderd
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -m555 snippetexpanderx $out/bin/
installManPage snippetexpanderx.1
runHook postInstall
'';
# There are no tests.
doCheck = false;
meta = with lib; {
description = "Your little expandable text snippet helper auto expander daemon";
homepage = "https://snippetexpander.org";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ ianmjones ];
platforms = platforms.linux;
mainProgram = "snippetexpanderx";
};
}