2021-01-15 22:18:51 +00:00
|
|
|
{lib, stdenv, fetchurl}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "getopt";
|
|
|
|
version = "1.1.6";
|
|
|
|
src = fetchurl {
|
2024-09-19 14:19:46 +00:00
|
|
|
url = "http://frodo.looijaard.name/system/files/software/getopt/getopt-${version}.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "1zn5kp8ar853rin0ay2j3p17blxy16agpp8wi8wfg4x98b31vgyh";
|
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
# 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__";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
makeFlags = [
|
|
|
|
"WITHOUT_GETTEXT=1"
|
|
|
|
"LIBCGETOPT=0"
|
|
|
|
"prefix=${placeholder "out"}"
|
|
|
|
"CC:=$(CC)"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = {
|
2021-01-15 22:18:51 +00:00
|
|
|
platforms = lib.platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://frodo.looijaard.name/project/getopt";
|
|
|
|
description = "Parses command-line arguments from shell scripts";
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "getopt";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|