summary refs log tree commit diff
path: root/pkgs/tools/package-management/checkinstall
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2009-03-27 17:49:19 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2009-03-27 17:49:19 +0000
commit96392cc45fd05727cba593a667b273b9f9203fa8 (patch)
tree3e5d58b3839ee8271f63a2cf87fa11d2bf96debe /pkgs/tools/package-management/checkinstall
parentb741451a17b8bb8d419fe042561421fa75d7a8c9 (diff)
downloadnixpkgs-96392cc45fd05727cba593a667b273b9f9203fa8.tar
nixpkgs-96392cc45fd05727cba593a667b273b9f9203fa8.tar.gz
nixpkgs-96392cc45fd05727cba593a667b273b9f9203fa8.tar.bz2
nixpkgs-96392cc45fd05727cba593a667b273b9f9203fa8.tar.lz
nixpkgs-96392cc45fd05727cba593a667b273b9f9203fa8.tar.xz
nixpkgs-96392cc45fd05727cba593a667b273b9f9203fa8.tar.zst
nixpkgs-96392cc45fd05727cba593a667b273b9f9203fa8.zip
* Added a patch that implements the getxattr(), lgetxattr() and
  __open64_2() functions.  The latter in particular is needed to make
  operations like `mkdir -p /usr/foo/bar' work on Ubuntu 8.10 (Glibc
  2.8).

svn path=/nixpkgs/trunk/; revision=14741
Diffstat (limited to 'pkgs/tools/package-management/checkinstall')
-rw-r--r--pkgs/tools/package-management/checkinstall/default.nix4
-rw-r--r--pkgs/tools/package-management/checkinstall/syscalls.patch138
2 files changed, 142 insertions, 0 deletions
diff --git a/pkgs/tools/package-management/checkinstall/default.nix b/pkgs/tools/package-management/checkinstall/default.nix
index 39844ce291a..582d11198d6 100644
--- a/pkgs/tools/package-management/checkinstall/default.nix
+++ b/pkgs/tools/package-management/checkinstall/default.nix
@@ -16,6 +16,10 @@ stdenv.mkDerivation {
     # /var/lib/mystuff', then /var/lib/mystuff should be included in
     # the package.)
     ./empty-dirs.patch
+
+    # Implement the getxattr(), lgetxattr() and __open64_2()
+    # functions.  Needed for doing builds on Ubuntu 8.10.
+    ./syscalls.patch
   ];
 
   buildInputs = [gettext];
diff --git a/pkgs/tools/package-management/checkinstall/syscalls.patch b/pkgs/tools/package-management/checkinstall/syscalls.patch
new file mode 100644
index 00000000000..01553e8e1b2
--- /dev/null
+++ b/pkgs/tools/package-management/checkinstall/syscalls.patch
@@ -0,0 +1,138 @@
+diff -rc checkinstall-orig/installwatch/installwatch.c checkinstall/installwatch/installwatch.c
+*** checkinstall-orig/installwatch/installwatch.c	2009-03-12 13:40:24.000000000 +0100
+--- checkinstall/installwatch/installwatch.c	2009-03-27 18:38:58.000000000 +0100
+***************
+*** 110,115 ****
+--- 110,117 ----
+  static int (*true_setxattr)(const char *,const char *,const void *,
+                              size_t, int);
+  static int (*true_removexattr)(const char *,const char *);
++ static ssize_t (*true_getxattr)(const char *,const char *,const void *,size_t);
++ static ssize_t (*true_lgetxattr)(const char *,const char *,const void *,size_t);
+  
+  #if(GLIBC_MINOR >= 1)
+  
+***************
+*** 369,374 ****
+--- 371,378 ----
+  	true_unlink      = dlsym(libc_handle, "unlink");
+  	true_utime       = dlsym(libc_handle, "utime");
+  	true_setxattr    = dlsym(libc_handle, "setxattr");
++ 	true_getxattr    = dlsym(libc_handle, "getxattr");
++ 	true_lgetxattr   = dlsym(libc_handle, "lgetxattr");
+          true_utimes      = dlsym(libc_handle, "utimes");
+          true_access      = dlsym(libc_handle, "access");
+  
+***************
+*** 3494,3499 ****
+--- 3498,3587 ----
+          return result;
+  }
+  
++ int getxattr (const char *pathname, const char *name,
++               const void *value, size_t size)
++ {
++         int result;
++         instw_t instw;
++ 	int status;
++ 
++         REFCOUNT;
++ 
++         if (!libc_handle)
++                initialize();
++ 
++ #if DEBUG
++         debug(2,"getxattr(%s,%s)\n",pathname,name);
++ #endif
++ 
++          /* We were asked to work in "real" mode */
++         if( !(__instw.gstatus & INSTW_INITIALIZED) ||
++            !(__instw.gstatus & INSTW_OKWRAP) ) {
++                result=true_getxattr(pathname,name,value,size);
++                return result;
++         }
++ 
++         instw_new(&instw);
++         instw_setpath(&instw,pathname);
++ 	instw_getstatus(&instw,&status);
++ 
++ #if DEBUG
++         instw_print(&instw);
++ #endif
++ 
++ 	if(status&INSTW_TRANSLATED) {
++             result=true_getxattr(instw.translpath,name,value,size);
++         } else {
++             result=true_getxattr(instw.path,name,value,size);
++         }
++ 
++         instw_delete(&instw);
++ 
++         return result;
++ }
++ 
++ int lgetxattr (const char *pathname, const char *name,
++               const void *value, size_t size)
++ {
++         int result;
++         instw_t instw;
++ 	int status;
++ 
++         REFCOUNT;
++ 
++         if (!libc_handle)
++                initialize();
++ 
++ #if DEBUG
++         debug(2,"lgetxattr(%s,%s)\n",pathname,name);
++ #endif
++ 
++          /* We were asked to work in "real" mode */
++         if( !(__instw.gstatus & INSTW_INITIALIZED) ||
++            !(__instw.gstatus & INSTW_OKWRAP) ) {
++                result=true_lgetxattr(pathname,name,value,size);
++                return result;
++         }
++ 
++         instw_new(&instw);
++         instw_setpath(&instw,pathname);
++ 	instw_getstatus(&instw,&status);
++ 
++ #if DEBUG
++         instw_print(&instw);
++ #endif
++ 
++ 	if(status&INSTW_TRANSLATED) {
++             result=true_lgetxattr(instw.translpath,name,value,size);
++         } else {
++             result=true_lgetxattr(instw.path,name,value,size);
++         }
++ 
++         instw_delete(&instw);
++ 
++         return result;
++ }
++ 
+  #if(GLIBC_MINOR >= 1)
+  
+  int creat64(const char *pathname, __mode_t mode) {
+***************
+*** 3663,3668 ****
+--- 3751,3767 ----
+  	return result;
+  }
+  
++ int __open64_2(const char *pathname, int flags, ...) {
++ #if DEBUG
++ 	debug(2,"__open64_2(%s,%d,mode)\n",pathname,flags);
++ #endif
++         /* The open() function in Glibc 2.9 is an always-inline
++            function that may call __open64_2, so it's important that
++            we handle it.  I don't know what __open64_2 is supposed to
++            do, but redirecting it to open64 seems to work fine.  */
++         return open64(pathname,flags);
++ }
++ 
+  struct dirent64 *readdir64(DIR *dir) {
+  	struct dirent64 *result;
+