Files
nixpkgs/pkgs/by-name/ge/getopt/package.nix
2026-09-24 16:59:42 -04:00

39 lines
1022 B
Nix

{
lib,
stdenv,
fetchurl,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "getopt";
version = "1.1.6";
src = fetchurl {
url = "https://frodo.looijaard.name/system/files/software/getopt/getopt-${finalAttrs.version}.tar.gz";
sha256 = "1zn5kp8ar853rin0ay2j3p17blxy16agpp8wi8wfg4x98b31vgyh";
};
# This should be fine on Linux and Darwin. Clang 16 requires it because otherwise getopt will
# attempt to use C library functions without declaring them, which is raised as an error.
env.NIX_CFLAGS_COMPILE = "-D__GNU_LIBRARY__";
strictDeps = true;
makeFlags = [
"WITHOUT_GETTEXT=1"
"LIBCGETOPT=0"
"prefix=${placeholder "out"}"
"CC:=$(CC)"
];
__structuredAttrs = true;
meta = {
platforms = lib.platforms.unix;
homepage = "https://frodo.looijaard.name/project/getopt";
description = "Parses command-line arguments from shell scripts";
mainProgram = "getopt";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ coolcuber ];
};
})