diff --git a/pkgs/by-name/vo/vobcopy/fix-darwin.patch b/pkgs/by-name/vo/vobcopy/fix-darwin.patch new file mode 100644 index 0000000000000..93ffdb6f51498 --- /dev/null +++ b/pkgs/by-name/vo/vobcopy/fix-darwin.patch @@ -0,0 +1,28 @@ +diff --git a/vobcopy.h b/vobcopy.h +index dcf4266..d34c2b4 100644 +--- a/vobcopy.h ++++ b/vobcopy.h +@@ -115,6 +115,7 @@ typedef enum { FALSE=0, TRUE=1 } bool; + + #ifdef HAVE_SYS_STATVFS_H + #include ++#ifndef __APPLE__ + #ifndef USE_STATFS + #define USE_STATVFS + #ifndef USE_STATFS_FOR_DEV +@@ -122,6 +123,7 @@ typedef enum { FALSE=0, TRUE=1 } bool; + #endif + #endif + #endif ++#endif + + #ifdef HAVE_MNTENT_H + #include +@@ -164,6 +166,6 @@ char *safestrncpy(char *dest, const char *src, size_t n); + int check_progress( void ); /* this can be removed because the one below supersedes it */ + int progressUpdate( int starttime, int cur, int tot, int force ); + +-#ifndef HAVE_FDATASYNC ++#if !defined(HAVE_FDATASYNC) || defined(__APPLE__) + #define fdatasync(fd) 0 + #endif diff --git a/pkgs/by-name/vo/vobcopy/package.nix b/pkgs/by-name/vo/vobcopy/package.nix index fbbd641f09103..61a073f1d1d9b 100644 --- a/pkgs/by-name/vo/vobcopy/package.nix +++ b/pkgs/by-name/vo/vobcopy/package.nix @@ -1,32 +1,41 @@ { lib, stdenv, - fetchurl, + fetchFromGitHub, + autoreconfHook, + gettext, libdvdread, libdvdcss, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation { pname = "vobcopy"; - version = "1.2.0"; + version = "1.2.1-unstable-2023-08-29"; - src = fetchurl { - url = "http://www.vobcopy.org/download/vobcopy-${version}.tar.bz2"; - sha256 = "01l1yihbd73srzghzzx5dgfg3yfb5kml5dix52mq0snhjp8h89c9"; + src = fetchFromGitHub { + owner = "barak"; + repo = "vobcopy"; + rev = "cb560b3a67358f51d51ecc0e511f49f09f304a13"; + hash = "sha256-2EtSO39yOFoCZ5GMqtp+SvmzqSevlqYDo73p0lVHZ3o="; }; + # Based on https://github.com/barak/vobcopy/issues/14, but also fixes + # "error: call to undeclared function 'fdatasync'". The latter patch + # is inspired by https://github.com/php/php-src/commit/e69729f2ba02ddc26c70b4bd88ef86c0a2277bdc + patches = [ ./fix-darwin.patch ]; + + nativeBuildInputs = [ + autoreconfHook + ]; buildInputs = [ + gettext # Fails on Darwin otherwise libdvdread libdvdcss ]; - makeFlags = [ - "DESTDIR=$(out)" - "PREFIX=/" - ]; meta = { description = "Copies DVD .vob files to harddisk, decrypting them on the way"; - homepage = "http://vobcopy.org/projects/c/c.shtml"; + homepage = "https://github.com/barak/vobcopy"; license = lib.licenses.gpl2Plus; platforms = lib.platforms.all; mainProgram = "vobcopy";