On Sat, Apr 06, 2013 at 11:10:56AM +0100, Stuart Henderson wrote:
> On 2013/04/05 19:04, Stefan Sperling wrote:
> > I'm so happy that we have threaded perl now and dvdrip can finally
> > be used again. Typing mencoder/transcode/ffmpeg command lines is
> > driving me insane.
> 
> Nitpicking but we don't have threaded Perl; the binary is now linked
> with -lpthread so that it's possible to use extensions that use threads
> (gui toolkits etc), but actual threaded Perl is a different thing.

Ah, right. I just saw p5-GTK was unbroken and assumed that perl is
now threaded.

> > This updates dvdrip to the latest release, adds a few missing run
> > dependencies, installs the .desktop file, uses a reasonable default
> > DVD device and makes the close/eject buttons in the GUI work.
> 
> Please add update-desktop-database lines to the bottom of PLIST,
> 
> @exec %D/bin/update-desktop-database
> @unexec-delete %D/bin/update-desktop-database

Yes, aja had the same request.

> Other than that it's ok with me ports-wise, but I don't have the
> hardware to test it.

Here's a new version which adds the desktop database goo and also
fixes the highly Linux-specific DVD mounting code (for subtitle
ripping). It will automatically try to mount the DVD at a temporary
dir if no matching fstab entry is found. This way it "just works"
with kern.usermount=1.

Index: Makefile
===================================================================
RCS file: /cvs/ports/graphics/dvdrip/Makefile,v
retrieving revision 1.14
diff -u -p -r1.14 Makefile
--- Makefile    11 Mar 2013 11:10:52 -0000      1.14
+++ Makefile    5 Apr 2013 16:48:54 -0000
@@ -2,9 +2,8 @@
 
 COMMENT=       full featured DVD copy program
 
-VERSION=       0.98.6
+VERSION=       0.98.11
 DISTNAME=      dvdrip-${VERSION}
-REVISION =     0
 CATEGORIES=    graphics audio multimedia perl5
 
 HOMEPAGE=      http://www.exit1.org/dvdrip/
@@ -16,8 +15,11 @@ WANTLIB=             c
 MASTER_SITES=  http://www.exit1.org/dvdrip/dist/
 
 RUN_DEPENDS=   graphics/ImageMagick \
+               devel/desktop-file-utils \
                devel/p5-Event-ExecFlow \
                multimedia/transcode \
+               multimedia/subtitleripper \
+               multimedia/xine-ui \
                net/fping \
                net/p5-Event-RPC \
                x11/p5-Gtk2-Ex-FormFactory \
@@ -41,5 +43,9 @@ pre-build:
 
 post-install:
        mv ${PREFIX}/${P5SITE}/LocaleData ${PREFIX}/share/locale
+       ${INSTALL_DATA_DIR} ${PREFIX}/share/applications/
+       ${INSTALL_DATA} ${WRKSRC}/dvdrip.desktop ${PREFIX}/share/applications
+       rm -f ${PREFIX}/${P5SITE}/Video/DVDRip/Config.pm.orig
+       rm -f ${PREFIX}/${P5SITE}/Video/DVDRip/GUI/Project/Title.pm.orig
 
 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/graphics/dvdrip/distinfo,v
retrieving revision 1.4
diff -u -p -r1.4 distinfo
--- distinfo    30 Jul 2007 10:17:00 -0000      1.4
+++ distinfo    5 Apr 2013 15:20:34 -0000
@@ -1,5 +1,2 @@
-MD5 (dvdrip-0.98.6.tar.gz) = ASaYoqFYK361vhOIXVpehA==
-RMD160 (dvdrip-0.98.6.tar.gz) = wHO9wrlro7jtmoZg2Mm1GJp7MiM=
-SHA1 (dvdrip-0.98.6.tar.gz) = rxv/a+DD5g2BzJiTdG9BoNIrLoE=
-SHA256 (dvdrip-0.98.6.tar.gz) = LEiXPOPpIfEUDY0ihyKgVDfXj9OyJn+4+G5wnhq/heU=
-SIZE (dvdrip-0.98.6.tar.gz) = 1604449
+SHA256 (dvdrip-0.98.11.tar.gz) = WGwglostqlXAr6rzNNW5uLaJbW6kUHild+FlgGhYw6U=
+SIZE (dvdrip-0.98.11.tar.gz) = 2075302
Index: patches/patch-lib_Video_DVDRip_Config_pm
===================================================================
RCS file: patches/patch-lib_Video_DVDRip_Config_pm
diff -N patches/patch-lib_Video_DVDRip_Config_pm
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-lib_Video_DVDRip_Config_pm    5 Apr 2013 16:02:53 -0000
@@ -0,0 +1,27 @@
+$OpenBSD$
+DVD device detection relies on HAL, this is a workaround.
+--- lib/Video/DVDRip/Config.pm.orig    Sat Feb 28 19:28:00 2009
++++ lib/Video/DVDRip/Config.pm Fri Apr  5 18:02:19 2013
+@@ -194,11 +194,11 @@ my %CONFIG_PARAMETER = (
+     dvd_device => {
+         label => __ "Default DVD device",
+         type  => 'file',
+-        value => "",
++        value => "/dev/cd0c",
+         dvd_button => 1,
+     },
+     selected_dvd_device => {
+-        value   => "/dev/dvd",
++        value   => "/dev/cd0c",
+     },
+     eject_command => {
+         label => __ "Eject Command",
+@@ -680,7 +680,7 @@ sub init_settings {
+     my $self = shift;
+     
+     if ( $self->get_value("dvd_device") eq "" ) {
+-        $self->set_value( dvd_device => ($self->get_first_dvd_device || 
"/dev/dvd") );
++        $self->set_value( dvd_device => ($self->get_first_dvd_device || 
"/dev/cd0c") );
+         $self->save;
+     }
+     
Index: patches/patch-lib_Video_DVDRip_GUI_Project_Title_pm
===================================================================
RCS file: patches/patch-lib_Video_DVDRip_GUI_Project_Title_pm
diff -N patches/patch-lib_Video_DVDRip_GUI_Project_Title_pm
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-lib_Video_DVDRip_GUI_Project_Title_pm 5 Apr 2013 16:42:19 
-0000
@@ -0,0 +1,34 @@
+$OpenBSD$
+Fix DVD drive close/eject buttons.
+--- lib/Video/DVDRip/GUI/Project/Title.pm.orig Sat Feb 28 19:27:59 2009
++++ lib/Video/DVDRip/GUI/Project/Title.pm      Fri Apr  5 18:42:11 2013
+@@ -431,12 +431,10 @@ sub view_title {
+ sub eject_dvd {
+     my $self = shift;
+ 
+-    my $title = $self->selected_title;
++    my $dev = $self->project->dvd_device;
++    $dev =~ s/^\/dev\/(cd[0-9])[a-p]/\1/;
++    my $command = $self->config('eject_command') . " " . $dev;
+ 
+-    my $command
+-        = $self->config('eject_command') . " " .
+-            $title->project->dvd_device;
+-
+     system("$command &");
+ 
+     1;
+@@ -445,10 +443,9 @@ sub eject_dvd {
+ sub insert_dvd {
+     my $self = shift;
+ 
+-    my $title = $self->selected_title;
+-
+-    my $command = $self->config('eject_command') . " -t "
+-        . $title->project->dvd_device;
++    my $dev = $self->project->dvd_device;
++    $dev =~ s/^\/dev\/(cd[0-9])[a-p]/\1/;
++    my $command = $self->config('eject_command') . " -t " . $dev;
+ 
+     system("$command &");
+ 
Index: patches/patch-lib_Video_DVDRip_Project_pm
===================================================================
RCS file: patches/patch-lib_Video_DVDRip_Project_pm
diff -N patches/patch-lib_Video_DVDRip_Project_pm
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-lib_Video_DVDRip_Project_pm   6 Apr 2013 12:04:20 -0000
@@ -0,0 +1,69 @@
+$OpenBSD$
+Fix DVD mounting so that IFO file copying works.
+--- lib/Video/DVDRip/Project.pm.orig   Sat Feb 28 19:28:00 2009
++++ lib/Video/DVDRip/Project.pm        Sat Apr  6 14:03:47 2013
+@@ -21,6 +21,7 @@ use Data::Dumper;
+ use File::Basename;
+ use File::Path;
+ use File::Copy;
++use File::Temp;
+ 
+ use Video::DVDRip::Content;
+ 
+@@ -108,6 +109,7 @@ sub new {
+         selected_title_nr => undef,
+         version           => $Video::DVDRip::VERSION,
+         created           => 0,
++        tmp_mount_point   => "",
+     }, $class;
+ 
+     my $content = Video::DVDRip::Content->new( project => $self );
+@@ -367,14 +369,25 @@ sub get_mount_dir_from_mtab {
+     return $mount_dir;
+ }
+ 
++sub get_tmp_mount_dir {
++    my $self = shift;
++
++    if ( not $self->{tmp_mount_point} ) {
++        # mount at temporary directory; assumes sysctl.usermount=1
++        $self->{tmp_mount_point} = File::Temp->newdir("/tmp/dvdrip-XXXXXXXX");
++    }
++
++    return $self->{tmp_mount_point};
++}
++
+ sub dvd_mount_point {
+     my $self = shift;
+ 
+     my $dvd_device = $self->dvd_device;
+ 
+     my $dvd_mount_point
+-        = $self->get_mount_dir_from_mtab( $dvd_device,  "/etc/mtab" )
+-        || $self->get_mount_dir_from_mtab( $dvd_device, "/etc/fstab" );
++        = $self->get_mount_dir_from_mtab( $dvd_device,  "/etc/fstab" )
++        || $self->get_tmp_mount_dir;
+ 
+     return $dvd_mount_point;
+ }
+@@ -446,13 +459,18 @@ sub mount_dvd {
+         )
+     );
+ 
+-    my $mount = qx[ mount $dvd_mount_point 2>&1 && echo EXECFLOW_OK ];
++    my $dvd_device = "";
++    if ( $self->{tmp_mount_point} ) {
++        $dvd_device = $self->dvd_device;
++    }
+ 
++    my $mount = qx[ mount $dvd_device $dvd_mount_point 2>&1 && echo 
EXECFLOW_OK ];
++
+     $mount =~ s/\s$//;
+ 
+     croak "msg:"
+         . __x(
+-        "Failed to mount DVD at {mount_point} ({mount_error})",
++        "Failed to mount DVD at {mount_point} ({mount_error}) (perhaps try 
again with sysctl kern.usermount=1)",
+         mount_point => $dvd_mount_point,
+         mount_error => $mount
+         )
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/graphics/dvdrip/pkg/PLIST,v
retrieving revision 1.5
diff -u -p -r1.5 PLIST
--- pkg/PLIST   7 Mar 2009 10:40:30 -0000       1.5
+++ pkg/PLIST   6 Apr 2013 10:44:53 -0000
@@ -3,10 +3,10 @@ bin/dvdrip
 bin/dvdrip-exec
 bin/dvdrip-master
 bin/dvdrip-multitee
-bin/dvdrip-progress
+@bin bin/dvdrip-progress
 bin/dvdrip-replex
 bin/dvdrip-splash
-bin/dvdrip-splitpipe
+@bin bin/dvdrip-splitpipe
 bin/dvdrip-subpng
 bin/dvdrip-thumb
 ${P5SITE}/Video/
@@ -87,6 +87,8 @@ ${P5SITE}/Video/DVDRip/Title.pm
 ${P5SITE}/Video/DVDRip/TranscodeRC.pm
 ${P5SITE}/Video/DVDRip/icon.xpm
 ${P5SITE}/Video/DVDRip/license.txt
+${P5SITE}/Video/DVDRip/splash.ca.png
+${P5SITE}/Video/DVDRip/splash.da.png
 ${P5SITE}/Video/DVDRip/splash.de.png
 ${P5SITE}/Video/DVDRip/splash.en.png
 ${P5SITE}/Video/DVDRip/splash.es.png
@@ -99,7 +101,9 @@ ${P5SITE}/Video/DVDRip/translators.txt
 @man man/man1/dvdrip.1
 @man man/man3p/Video::DVDRip.3p
 @man man/man3p/Video::DVDRip::CPAN::Scanf.3p
+share/applications/dvdrip.desktop
 share/locale/cs/LC_MESSAGES/video.dvdrip.mo
+share/locale/da/LC_MESSAGES/video.dvdrip.mo
 share/locale/de/LC_MESSAGES/video.dvdrip.mo
 share/locale/es/LC_MESSAGES/video.dvdrip.mo
 share/locale/fr/LC_MESSAGES/video.dvdrip.mo
@@ -108,3 +112,5 @@ share/locale/sr/LC_MESSAGES/video.dvdrip
 share/locale/sr@Latn/
 share/locale/sr@Latn/LC_MESSAGES/
 share/locale/sr@Latn/LC_MESSAGES/video.dvdrip.mo
+@exec %D/bin/update-desktop-database
+@unexec-delete %D/bin/update-desktop-database

Reply via email to