about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/popt
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/popt')
-rw-r--r--nixpkgs/pkgs/development/libraries/popt/1.16-cygwin.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/popt/1.16-vpath.patch34
-rw-r--r--nixpkgs/pkgs/development/libraries/popt/default.nix47
3 files changed, 92 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/popt/1.16-cygwin.patch b/nixpkgs/pkgs/development/libraries/popt/1.16-cygwin.patch
new file mode 100644
index 000000000000..9c084f0b8eaa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/popt/1.16-cygwin.patch
@@ -0,0 +1,11 @@
+--- origsrc/poptconfig.c	2009-05-20 08:18:07.000000000 -0500
++++ src/poptconfig.c	2012-03-29 18:13:46.869286100 -0500
+@@ -42,7 +42,7 @@ extern int glob_pattern_p (const char *_
+ /*@=declundef =exportheader =incondefs =protoparammatch =redecl =type @*/
+ #endif	/* __LCLINT__ */
+ 
+-#if !defined(__GLIBC__)
++#if !defined(__GLIBC__) && !defined(__CYGWIN__)
+ /* Return nonzero if PATTERN contains any metacharacters.
+    Metacharacters can be quoted with backslashes if QUOTE is nonzero.  */
+ static int
diff --git a/nixpkgs/pkgs/development/libraries/popt/1.16-vpath.patch b/nixpkgs/pkgs/development/libraries/popt/1.16-vpath.patch
new file mode 100644
index 000000000000..4cfa1c8fb4db
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/popt/1.16-vpath.patch
@@ -0,0 +1,34 @@
+--- origsrc/Doxyfile.in	2008-04-26 16:57:32.000000000 -0500
++++ src/Doxyfile.in	2012-03-29 18:15:56.649709100 -0500
+@@ -460,14 +460,14 @@ WARN_LOGFILE           =
+ # with spaces.
+ 
+ INPUT                  = \
+-                        ./popt.c \
+-                        ./popt.h \
+-                        ./poptconfig.c \
+-                        ./popthelp.c \
+-                        ./poptint.c \
+-                        ./poptint.h \
+-                        ./poptparse.c \
+-			./system.h
++                        @srcdir@/popt.c \
++                        @srcdir@/popt.h \
++                        @srcdir@/poptconfig.c \
++                        @srcdir@/popthelp.c \
++                        @srcdir@/poptint.c \
++                        @srcdir@/poptint.h \
++                        @srcdir@/poptparse.c \
++			@srcdir@/system.h
+ 
+ # If the value of the INPUT tag contains directories, you can use the 
+ # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+@@ -658,7 +658,7 @@ HTML_HEADER            =
+ # each generated HTML page. If it is left blank doxygen will generate a 
+ # standard footer.
+ 
+-HTML_FOOTER            = footer_no_timestamp.html
++HTML_FOOTER            = @srcdir@/footer_no_timestamp.html
+ 
+ # The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
+ # style sheet that is used by each HTML page. It can be used to 
diff --git a/nixpkgs/pkgs/development/libraries/popt/default.nix b/nixpkgs/pkgs/development/libraries/popt/default.nix
new file mode 100644
index 000000000000..fdccb4d09336
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/popt/default.nix
@@ -0,0 +1,47 @@
+{ lib
+, stdenv
+, fetchurl
+, fetchpatch2
+}:
+
+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=";
+  };
+
+  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;
+  };
+}