Skip to content

Commit

Permalink
sysutils/dvdisaster: Update to 0.79.10 and flavorize
Browse files Browse the repository at this point in the history
- Change to fork and update to 0.79.10
- Drop NLS option, it just covers a few languages and is inconsistent
- Add nox11 flavor
- Partially backport upstream changeset 25:a315fe55901a (mercurial) to
  allow a clean build of nox11 flavor
- Drop GCC requirement
- Rework port to follow Porters Handbook more closely and for better readability
- Enable verbose build

PR:		270718
Approved by:	portmgr (maintainer timeout, 2+ weeks)
  • Loading branch information
Daniel Engberg authored and Daniel Engberg committed Apr 25, 2023
1 parent 0b99c6e commit 4529825
Show file tree
Hide file tree
Showing 13 changed files with 190 additions and 216 deletions.
84 changes: 47 additions & 37 deletions sysutils/dvdisaster/Makefile
@@ -1,67 +1,77 @@
PORTNAME= dvdisaster
PORTVERSION= 0.79.5
PORTREVISION= 3
DISTVERSION= 0.79.10
CATEGORIES= sysutils
MASTER_SITES= http://www.ml1.org.uk/distfiles/ \
http://www.ancientgeek.org.uk/distfiles/
MASTER_SITES= https://dvdisaster.jcea.es/downloads/

MAINTAINER= bob@eager.cx
COMMENT= Optical disc error correction data and recovery tool
WWW= https://www.bobeager.uk/software.html
WWW= https://dvdisaster.jcea.es

LICENSE= GPLv3+
LICENSE_FILE= ${WRKSRC}/COPYING

BUILD_DEPENDS= bash:shells/bash
LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \
libfreetype.so:print/freetype2

USES= gmake gnome pkgconfig
USE_GCC= yes
USE_GNOME= gdkpixbuf2 gtk20 cairo
FLAVORS= default nox11
FLAVOR?= ${FLAVORS:[1]}
nox11_PKGNAMESUFFIX= -nox11

USES= gmake gnome pkgconfig tar:bz2
USE_GNOME= glib20

CFLAGS+= -Wno-stringop-overflow
MAKEFILE= GNUmakefile
HAS_CONFIGURE= yes
CONFIGURE_LOG= configure.log
MAKEFILE= GNUmakefile
MAKE_JOBS_UNSAFE= yes

CONFIGURE_ARGS= --docsubdir="/" \
--localedir=${PREFIX}/share/locale \
--buildroot=${STAGEDIR}
MAKE_JOBS_UNSAFE= yes
--buildroot=${STAGEDIR} \
--with-nls=no

SUB_FILES= pkg-message
FLAVORS_SUB= yes

.if ${FLAVOR} == default
LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \
libfreetype.so:print/freetype2
USE_GNOME+= cairo gdkpixbuf2 gtk20
CONFIGURE_ARGS+= --with-gui=yes
.endif

PORTDOCS= *
SUB_FILES= pkg-message DEVICES.md DEVICES.html
.if ${FLAVOR} == nox11
COMMENT+= (without GUI)
CONFIGURE_ARGS+= --with-gui=no
.endif

OPTIONS_DEFINE= DOCS NLS
OPTIONS_DEFINE= DOCS
OPTIONS_SUB= yes

DOCS_CONFIGURE_ON= --docdir=${DOCSDIR}
NLS_USES= gettext
NLS_CONFIGURE_OFF= -with-nls=no

post-patch:
${REINPLACE_CMD} -e '/dvdisaster uninstaller/,+19 d' \
${WRKSRC}/GNUmakefile.template
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
${INSTALL_MAN} ${WRKSRC}/documentation/${PORTNAME}.en.1 ${STAGEDIR}${PREFIX}/man/man1/${PORTNAME}.1

post-patch-DOCS-off:
${REINPLACE_CMD} -e 's|THESE_ARE_THE_DEVEL_SOURCES;|GNUmakefile;|; \
/install -d $$(BUILDROOT)$$(DOCSUBDIR)/,+7 d' \
${WRKSRC}/GNUmakefile.template

post-patch-NLS-off:
${REINPLACE_CMD} -Ee 's|(PO_LOCALES)|#\1|; \
s|install -m 644 CREDITS\*|install -m 644 CREDITS\.en|' \
${WRKSRC}/GNUmakefile.template
do-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${FILESDIR}/devices.txt.in ${STAGEDIR}${DOCSDIR}/devices.txt
${INSTALL_DATA} ${WRKSRC}/documentation/codec-specs/codecs.pdf ${STAGEDIR}${DOCSDIR}
.if ${FLAVOR} == default
${INSTALL_DATA} ${WRKSRC}/documentation/user-manual/manual.pdf ${STAGEDIR}${DOCSDIR}/${PORTNAME}.pdf
.endif

post-install:
.if ${FLAVOR} == default
@${MKDIR} ${STAGEDIR}${PREFIX}/share/pixmaps
${INSTALL_DATA} ${WRKSRC}/contrib/dvdisaster48.png ${STAGEDIR}${PREFIX}/share/pixmaps/
${INSTALL_DATA} ${WRKSRC}/contrib/dvdisaster16.png ${STAGEDIR}${PREFIX}/share/pixmaps
${INSTALL_DATA} ${WRKSRC}/contrib/dvdisaster24.png ${STAGEDIR}${PREFIX}/share/pixmaps
${INSTALL_DATA} ${WRKSRC}/contrib/dvdisaster32.png ${STAGEDIR}${PREFIX}/share/pixmaps
${INSTALL_DATA} ${WRKSRC}/contrib/dvdisaster48.png ${STAGEDIR}${PREFIX}/share/pixmaps
${INSTALL_DATA} ${WRKSRC}/contrib/dvdisaster64.png ${STAGEDIR}${PREFIX}/share/pixmaps
@${MKDIR} ${STAGEDIR}${PREFIX}/share/applications
${INSTALL_DATA} ${WRKSRC}/contrib/dvdisaster.desktop ${STAGEDIR}${PREFIX}/share/applications/
${INSTALL_DATA} ${WRKSRC}/contrib/dvdisaster.desktop ${STAGEDIR}${PREFIX}/share/applications
.endif
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}

post-install-DOCS-on:
${INSTALL_MAN} ${WRKDIR}/DEVICES.md ${STAGEDIR}${DOCSDIR}
${INSTALL_MAN} ${WRKDIR}/DEVICES.html ${STAGEDIR}${DOCSDIR}

.include <bsd.port.mk>
6 changes: 3 additions & 3 deletions sysutils/dvdisaster/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1551738342
SHA256 (dvdisaster-0.79.5.tar.gz) = d6efa1643945fe7b16382f4164a68bdad14de48c8506d844d740cd3a2b143e55
SIZE (dvdisaster-0.79.5.tar.gz) = 9722312
TIMESTAMP = 1680992370
SHA256 (dvdisaster-0.79.10.tar.bz2) = dd0a9ff62f1a48bf73dae26f9bc3ff40e3e9f379ce0c2ddfc8b2f58812207fe8
SIZE (dvdisaster-0.79.10.tar.bz2) = 8173816
80 changes: 0 additions & 80 deletions sysutils/dvdisaster/files/DEVICES.html.in

This file was deleted.

Expand Up @@ -3,25 +3,25 @@ Useful hints for dvdisaster

Device access
-------------
dvdisaster tries to read `/dev/pass*` to list available optical drives,
dvdisaster tries to read /dev/pass* to list available optical drives,
so it will not detect any available drives if the user running
dvdisaster does not have permissions to read `/dev/pass*`.
dvdisaster does not have permissions to read /dev/pass*.

The solution is to create the file `/etc/devfs.rules`, containing
The solution is to create the file /etc/devfs.rules, containing
something like the following.

[localrules=10]
add path 'pass*' mode 0775 group mygroup

You also need to add this line to `/etc/rc.conf`:
You also need to add this line to /etc/rc.conf:

devfs_system_ruleset="localrules"

You can use anything you like for `localrules`, and the number does not have to be `10`.
See `devfs.rules(5)` for more details.
You can use anything you like for localrules, and the number does not have to be 10.
See devfs.rules(5) for more details.

If `/etc/devfs.rules` already exists, add the line starting `add` to the section for the ruleset
mentioned in `/etc/rc.conf`.
If /etc/devfs.rules already exists, add the line starting add to the section for the ruleset
mentioned in /etc/rc.conf.

For this to take effect, either reboot, or issue the command:

Expand All @@ -38,9 +38,9 @@ optical drives on older versions of FreeBSD.
FreeBSD 9.x does not pre-install a uniform CD-ROM driver for SCSI and
ATAPI drives, thus it cannot use any ATAPI drives in an out-of-the-box
FreeBSD 9.x installation. Normally, this can be fixed by loading a
kernel module called `atapicam`.
kernel module called atapicam.

### Loading the `atapicam` kernel module by hand
### Loading the atapicam kernel module by hand

To manually load the required kernel module, issue the command:

Expand All @@ -51,16 +51,16 @@ To see if any optical drives are available:
# camcontrol devlist
<NAME OF YOUR DRIVE> at scbus1 target 0 lun 0 (pass0,cd0)

### Loading the `atapicam` kernel module permanently
### Loading the atapicam kernel module permanently

If the above step works, the module can be loaded automatically at boot time by adding
the line:

atapicam_load="YES"

to the file `/boot/loader.conf`.
to the file /boot/loader.conf.

### Building the `atapicam` module
### Building the atapicam module

If the atapicam kernel module is not available (check the contents
of /boot/kernel) you will need to recompile the kernel with the following
Expand All @@ -71,6 +71,5 @@ additional device line in the kernel configuration:
This will actually build the module into the kernel. To build it separately,
see `make.conf(5)`.

The devices `ata`, `scbus`, `cd`, and `pass` are also required, but are included by
The devices ata, scbus, cd, and pass are also required, but are included by
default in FreeBSD 6.0 and later.

73 changes: 73 additions & 0 deletions sysutils/dvdisaster/files/patch-GNUmakefile.template
@@ -0,0 +1,73 @@
--- GNUmakefile.template.orig 2021-09-24 10:20:49 UTC
+++ GNUmakefile.template
@@ -100,7 +100,7 @@ OFILES = $(CFG_OFILES)

${BUILDTMP}/%.o : %.c
@echo "Compiling:" $?
- @$(CC) $(COPTS) -c $? -o $@
+ $(CC) $(COPTS) -c $? -o $@

all: time-stamp dvdisaster

@@ -112,11 +112,11 @@ time-stamp:

${BUILDTMP}/closure.o: closure.c build.h
@echo "Compiling:" closure.c
- @$(CC) $(COPTS) -c closure.c -o ${BUILDTMP}/closure.o
+ $(CC) $(COPTS) -c closure.c -o ${BUILDTMP}/closure.o

dvdisaster: inlined-icons.h $(OFILES)
@echo "Linking : dvdisaster"
- @$(CC) $(LOPTS) $(OFILES) $(LIBS) -o dvdisaster
+ $(CC) $(LOPTS) $(OFILES) $(LIBS) -o dvdisaster
@if test -e locale/de/LC_MESSAGES/dvdisaster.mo \
|| echo $(WITH_OPTIONS) | grep "NLS_NO" >/dev/null; \
then echo "not touching locale"; \
@@ -124,27 +124,32 @@ dvdisaster: inlined-icons.h $(OFILES)
fi

inlined-icons.h: icons/read.png icons/create.png icons/scan.png icons/fix.png icons/verify.png
- @gdk-pixbuf-csource --raw --name=dvdisaster_read icons/read.png >inlined-icons.h
- @gdk-pixbuf-csource --raw --name=dvdisaster_create icons/create.png >>inlined-icons.h
- @gdk-pixbuf-csource --raw --name=dvdisaster_scan icons/scan.png >>inlined-icons.h
- @gdk-pixbuf-csource --raw --name=dvdisaster_fix icons/fix.png >>inlined-icons.h
- @gdk-pixbuf-csource --raw --name=dvdisaster_verify icons/verify.png >>inlined-icons.h
- @gdk-pixbuf-csource --raw --name=dvdisaster_open_ecc icons/open-ecc.png >>inlined-icons.h
- @gdk-pixbuf-csource --raw --name=dvdisaster_open_img icons/open-img.png >>inlined-icons.h
- @gdk-pixbuf-csource --raw --name=dvdisaster_cd icons/cd.png >>inlined-icons.h
- @gdk-pixbuf-csource --raw --name=dvdisaster_gtk_help icons/gtk-help.png >>inlined-icons.h
- @gdk-pixbuf-csource --raw --name=dvdisaster_gtk_index icons/gtk-index.png >>inlined-icons.h
- @gdk-pixbuf-csource --raw --name=dvdisaster_gtk_preferences icons/gtk-preferences.png >>inlined-icons.h
- @gdk-pixbuf-csource --raw --name=dvdisaster_gtk_quit icons/gtk-quit.png >>inlined-icons.h
- @gdk-pixbuf-csource --raw --name=dvdisaster_gtk_stop icons/gtk-stop.png >>inlined-icons.h
+ @if echo $(WITH_OPTIONS) | grep "WITH_GUI_YES" >/dev/null; then \
+ echo "Creating: inlined-icons.h"; \
+ gdk-pixbuf-csource --raw --name=dvdisaster_read icons/read.png >inlined-icons.h; \
+ gdk-pixbuf-csource --raw --name=dvdisaster_create icons/create.png >>inlined-icons.h; \
+ gdk-pixbuf-csource --raw --name=dvdisaster_scan icons/scan.png >>inlined-icons.h; \
+ gdk-pixbuf-csource --raw --name=dvdisaster_fix icons/fix.png >>inlined-icons.h; \
+ gdk-pixbuf-csource --raw --name=dvdisaster_verify icons/verify.png >>inlined-icons.h; \
+ gdk-pixbuf-csource --raw --name=dvdisaster_open_ecc icons/open-ecc.png >>inlined-icons.h; \
+ gdk-pixbuf-csource --raw --name=dvdisaster_open_img icons/open-img.png >>inlined-icons.h; \
+ gdk-pixbuf-csource --raw --name=dvdisaster_cd icons/cd.png >>inlined-icons.h; \
+ gdk-pixbuf-csource --raw --name=dvdisaster_gtk_help icons/gtk-help.png >>inlined-icons.h; \
+ gdk-pixbuf-csource --raw --name=dvdisaster_gtk_index icons/gtk-index.png >>inlined-icons.h; \
+ gdk-pixbuf-csource --raw --name=dvdisaster_gtk_preferences icons/gtk-preferences.png >>inlined-icons.h; \
+ gdk-pixbuf-csource --raw --name=dvdisaster_gtk_quit icons/gtk-quit.png >>inlined-icons.h; \
+ gdk-pixbuf-csource --raw --name=dvdisaster_gtk_stop icons/gtk-stop.png >>inlined-icons.h; \
+ else \
+ echo "Skipping: inlined-icons.h"; \
+ fi

$(BUILDTMP)/rs-encoder-sse2.o: rs-encoder-sse2.c
@echo "Compiling:" rs-encoder-sse2.c
- @$(CC) $(SSE2_OPTIONS) $(COPTS) -c rs-encoder-sse2.c -o $(BUILDTMP)/rs-encoder-sse2.o
+ $(CC) $(SSE2_OPTIONS) $(COPTS) -c rs-encoder-sse2.c -o $(BUILDTMP)/rs-encoder-sse2.o

$(BUILDTMP)/rs-encoder-altivec.o: rs-encoder-altivec.c
@echo "Compiling:" rs-encoder-altivec.c
- @$(CC) $(ALTIVEC_OPTIONS) $(COPTS) -c rs-encoder-altivec.c -o $(BUILDTMP)/rs-encoder-altivec.o
+ $(CC) $(ALTIVEC_OPTIONS) $(COPTS) -c rs-encoder-altivec.c -o $(BUILDTMP)/rs-encoder-altivec.o

locale:
@$(MAKE) --no-print-directory -C locale
42 changes: 42 additions & 0 deletions sysutils/dvdisaster/files/patch-configure
@@ -0,0 +1,42 @@
--- configure.orig 2021-08-26 13:29:58 UTC
+++ configure
@@ -44,7 +44,6 @@ CFG_HAVE_OPTIONS="$CFG_HAVE_OPTIONS -DHAVE_UNSTABLE_RE
# Check for some essential tools.

REQUIRE_GMAKE
-REQUIRE_GCC

# Find out and verify the basedir of the source installation,
# and where to install the binary.
@@ -82,7 +81,7 @@ fi
if CHECK_INCLUDE cpuid.h cpuid; then
CFG_HAVE_OPTIONS="$CFG_HAVE_OPTIONS -DHAVE_CPUID"
fi
-CHECK_LIBRARY intl gettext intl
+# CHECK_LIBRARY intl gettext intl
CHECK_LIBRARY cam cam_open_device cam

# Look for required functions
@@ -100,10 +99,10 @@ if ! CHECK_FUNCTION getopt_long ; then
fi
fi

-if ! CHECK_FUNCTION gettext ; then
- echo " [previous test forces -with-nls=no]"
+# if ! CHECK_FUNCTION gettext ; then
+# echo " [previous test forces -with-nls=no]"
cfg_force_with_nls=no
-fi
+# fi

CHECK_FUNCTION round

@@ -124,7 +123,7 @@ CHECK_ALTIVEC

PRINT_MESSAGE "\nChecking for additional tools..."

-if ! EXECUTE_PROGRAM "xgettext --help" xgettext \
+if ! EXECUTE_PROGRAM "no-xgettext --help" xgettext \
||! EXECUTE_PROGRAM "msgmerge --help" msgmerge \
||! EXECUTE_PROGRAM "msgfmt --help" msgfmt ; then
echo "* You need to install the GNU gettext tools"

0 comments on commit 4529825

Please sign in to comment.