about summary refs log tree commit diff
path: root/pkgs/development/libraries/popt/default.nix
blob: e97629b0dfd054d95cc96eb3f5251c0aa01fdadc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{ lib
, stdenv
, fetchurl
, fetchpatch2
, updateAutotoolsGnuConfigScriptsHook
}:

stdenv.mkDerivation rec {
  pname = "popt";
  version = "1.19";

  src = fetchurl {
    url = "https://ftp.osuosl.org/pub/rpm/popt/releases/popt-1.x/popt-${version}.tar.gz";
    sha256 = "sha256-wlpIOPyOTByKrLi9Yg7bMISj1jv4mH/a08onWMYyQPk=";
  };

  nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ];

  patches = lib.optionals stdenv.isCygwin [
    ./1.16-cygwin.patch
    ./1.16-vpath.patch
  ] ++ 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;
    })
  ];

  doCheck = false; # fails

  meta = with lib; {
    homepage = "https://github.com/rpm-software-management/popt";
    description = "Command line option parsing library";
    maintainers = with maintainers; [ qyliss ];
    license = licenses.mit;
    platforms = platforms.unix;
  };
}