2023-08-10 07:59:29 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, fetchpatch2
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "popt";
|
2022-10-30 15:09:59 +00:00
|
|
|
version = "1.19";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-06-28 23:13:55 +00:00
|
|
|
url = "https://ftp.osuosl.org/pub/rpm/popt/releases/popt-1.x/popt-${version}.tar.gz";
|
2022-10-30 15:09:59 +00:00
|
|
|
sha256 = "sha256-wlpIOPyOTByKrLi9Yg7bMISj1jv4mH/a08onWMYyQPk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
patches = lib.optionals stdenv.isCygwin [
|
2020-04-24 23:36:52 +00:00
|
|
|
./1.16-cygwin.patch
|
|
|
|
./1.16-vpath.patch
|
2023-08-10 07:59:29 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isMinGW [
|
|
|
|
# Do not require <sys/ioctl.h>
|
|
|
|
(fetchpatch2 {
|
|
|
|
url = "https://aur.archlinux.org/cgit/aur.git/plain/get-w32-console-maxcols.mingw32.patch?h=mingw-w64-popt&id=63f2cdb0de116362c49681cef20f7a8b4355e85a";
|
|
|
|
sha256 = "zv43l1RBqNzT/JG+jQaMVFaFv+ZYPuIiAtKUDzJJBbc=";
|
|
|
|
stripLen = 1;
|
|
|
|
extraPrefix = "src/";
|
|
|
|
})
|
|
|
|
|
|
|
|
# Do not try to detect setuid, it is not a thing.
|
|
|
|
(fetchpatch2 {
|
|
|
|
url = "https://github.com/rpm-software-management/popt/commit/905544c5d9767894edaf71a1e3ce5126944c5695.patch";
|
|
|
|
sha256 = "3PmcxeiEZ/Hof0zoVFSytEXvQ8gE8Sp5UdagExPVICU=";
|
|
|
|
stripLen = 1;
|
|
|
|
extraPrefix = "src/";
|
|
|
|
revert = true;
|
|
|
|
})
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = false; # fails
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2021-06-28 23:13:55 +00:00
|
|
|
homepage = "https://github.com/rpm-software-management/popt";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Command line option parsing library";
|
2021-06-28 23:13:55 +00:00
|
|
|
maintainers = with maintainers; [ qyliss ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2021-06-28 23:13:55 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|