From 2f8846ae00e3534772131d7a8c840013bf041118 Mon Sep 17 00:00:00 2001 From: jolan Date: Wed, 9 Nov 2005 16:37:46 +0000 Subject: [PATCH] remove old ld.so findlibrary work-around --- multimedia/libdvdnav/Makefile | 4 +- .../patches/patch-src_dvdread_dvd_input_c | 52 +++++-------------- 2 files changed, 14 insertions(+), 42 deletions(-) diff --git a/multimedia/libdvdnav/Makefile b/multimedia/libdvdnav/Makefile index 00c8dd04475..fb71128be59 100644 --- a/multimedia/libdvdnav/Makefile +++ b/multimedia/libdvdnav/Makefile @@ -1,8 +1,8 @@ -# $OpenBSD: Makefile,v 1.4 2005/11/03 09:03:37 jakemsr Exp $ +# $OpenBSD: Makefile,v 1.5 2005/11/09 16:37:46 jolan Exp $ COMMENT= "DVD read/navigation library" DISTNAME= libdvdnav-20051102 -PKGNAME= ${DISTNAME}p0 +PKGNAME= ${DISTNAME}p1 CATEGORIES= multimedia MASTER_SITES= http://mirrors.protection.cx/~jolan/ diff --git a/multimedia/libdvdnav/patches/patch-src_dvdread_dvd_input_c b/multimedia/libdvdnav/patches/patch-src_dvdread_dvd_input_c index fc1d132a89e..9b81ce25fdf 100644 --- a/multimedia/libdvdnav/patches/patch-src_dvdread_dvd_input_c +++ b/multimedia/libdvdnav/patches/patch-src_dvdread_dvd_input_c @@ -1,7 +1,7 @@ -$OpenBSD: patch-src_dvdread_dvd_input_c,v 1.1 2005/11/03 09:03:38 jakemsr Exp $ ---- src/dvdread/dvd_input.c.orig Fri Apr 9 05:15:26 2004 -+++ src/dvdread/dvd_input.c Thu Nov 3 00:22:19 2005 -@@ -37,14 +37,14 @@ int (*dvdinput_read) (dvd_input +$OpenBSD: patch-src_dvdread_dvd_input_c,v 1.2 2005/11/09 16:37:46 jolan Exp $ +--- src/dvdread/dvd_input.c.orig Fri Apr 9 07:15:26 2004 ++++ src/dvdread/dvd_input.c Wed Nov 9 10:31:53 2005 +@@ -37,17 +37,17 @@ int (*dvdinput_read) (dvd_input char * (*dvdinput_error) (dvd_input_t); #ifdef HAVE_DVDCSS_DVDCSS_H @@ -23,7 +23,11 @@ $OpenBSD: patch-src_dvdread_dvd_input_c,v 1.1 2005/11/03 09:03:38 jakemsr Exp $ +#define DVD_error libdvd_error #else - /* dlopening libdvdcss */ +-/* dlopening libdvdcss */ ++/* dlopening dvdcss */ + #ifdef HAVE_DLFCN_H + #include + #else @@ -55,19 +55,19 @@ char * (*dvdinput_error) (dvd_input #include "../../msvc/contrib/dlfcn.c" #endif @@ -132,40 +136,12 @@ $OpenBSD: patch-src_dvdread_dvd_input_c,v 1.1 2005/11/03 09:03:38 jakemsr Exp $ if(ret < 0) return ret; -@@ -269,90 +269,121 @@ static int file_close(dvd_input_t dev) - return 0; - } +@@ -271,88 +271,88 @@ static int file_close(dvd_input_t dev) -+#ifdef __OpenBSD__ -+#include -+#include -+static void *findlibrary(char *base) -+{ -+ DIR *d; -+ struct dirent *de; -+ size_t len; -+ void *lib = NULL; -+ len = strlen(base); -+ -+ d = opendir("."); -+ if (!d) -+ return lib; -+ while ((de = readdir(d)) != NULL) { -+ if (strncmp(de->d_name, base, len) != 0) -+ continue; -+ lib = dlopen(de->d_name, RTLD_LAZY); -+ if (lib) -+ break; -+ } -+ closedir(d); -+ return lib; -+} -+#endif -+ -+ /** - * Setup read functions with either libdvdcss or minimal DVD access. +- * Setup read functions with either libdvdcss or minimal DVD access. ++ * Setup read functions with either libdvd or minimal DVD access. */ int dvdinput_setup(void) { @@ -191,10 +167,6 @@ $OpenBSD: patch-src_dvdread_dvd_input_c,v 1.1 2005/11/03 09:03:38 jakemsr Exp $ #ifndef WIN32 - dvdcss_library = dlopen("libdvdcss.so.2", RTLD_LAZY); + libdvd_library = dlopen("libdvd.so.0", RTLD_LAZY); -+#if defined(__OpenBSD__) -+ if (!libdvd_library) -+ libdvd_library = findlibrary("libdvd.so.0."); -+#endif #else dvdcss_library = dlopen("libdvdcss.dll", RTLD_LAZY); #endif