nixpkgs/pkgs/by-name/xs/xstow/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

42 lines
1.1 KiB
Nix

{ stdenv
, lib
, fetchFromGitHub
, ncurses
, autoreconfHook
}:
stdenv.mkDerivation rec {
pname = "xstow";
version = "1.1.1";
src = fetchFromGitHub {
owner = "majorkingleo";
repo = "xstow";
rev = version;
fetchSubmodules = true;
hash = "sha256-c89+thw5N3Cgl1Ww+W7c3YsyhNJMLlreedvdWJFY3WY=";
};
nativeBuildInputs = [ autoreconfHook ];
# Upstream seems to try to support building both static and dynamic version
# of executable on dynamic systems, but fails with link error when attempting
# to cross-build "xstow-static" to the system where "xstow" proper is static.
postPatch = lib.optionalString stdenv.hostPlatform.isStatic ''
substituteInPlace src/Makefile.am --replace xstow-static ""
substituteInPlace src/Makefile.am --replace xstow-stow ""
'';
buildInputs = [
ncurses
];
meta = with lib; {
description = "Replacement of GNU Stow written in C++";
homepage = "https://github.com/majorkingleo/xstow";
license = licenses.gpl2Only;
maintainers = with maintainers; [ nzbr ];
platforms = platforms.unix;
};
}