1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-19 00:13:33 +00:00

net/unison251: Add new port to preserve current old unison version.

Preserve old unison 2.51 version as net/unison251 before updating
to the latest version.
This commit is contained in:
Guido Falsi 2022-03-13 22:25:43 +01:00
parent d5db044d6d
commit a27dcf53f6
10 changed files with 213 additions and 0 deletions

View File

@ -1532,6 +1532,7 @@
SUBDIR += unison232
SUBDIR += unison240
SUBDIR += unison248
SUBDIR += unison251
SUBDIR += unix2tcp
SUBDIR += urelay
SUBDIR += uriparser

109
net/unison251/Makefile Normal file
View File

@ -0,0 +1,109 @@
# Created by: Dan Pelleg <dpelleg+unison@cs.cmu.edu>
PORTNAME= unison
PORTVERSION= 2.51.5
DISTVERSIONPREFIX= v
CATEGORIES= net
MAINTAINER= madpilot@FreeBSD.org
COMMENT= User-level file synchronization tool
LICENSE= GPLv3+
LICENSE_FILE= ${WRKSRC}/COPYING
FLAVORS= x11 nox11
FLAVOR?= ${FLAVORS:[1]}
VERSIONSUFFIX= 251
nox11_PKGNAMESUFFIX= ${VERSIONSUFFIX}-nox11
nox11_CONFLICTS_INSTALL= unison${VERSIONSUFFIX}
x11_PKGNAMESUFFIX= ${VERSIONSUFFIX}
x11_CONFLICTS_INSTALL= unison${VERSIONSUFFIX}-nox11
x11_BUILD_DEPENDS= lablgtk2:x11-toolkits/ocaml-lablgtk2 \
icotool:graphics/icoutils
x11_LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \
libfreetype.so:print/freetype2 \
libharfbuzz.so:print/harfbuzz
x11_RUN_DEPENDS= lablgtk2:x11-toolkits/ocaml-lablgtk2
PLIST_SUB= PORTVERSION=${PORTVERSION} VERSIONSUFFIX=${VERSIONSUFFIX}
USES= gmake localbase
USE_OCAML= yes
WRKSRC_SUBDIR= src
NO_OCAML_RUNDEPENDS=yes
CONFLICTS= unison-devel
MAKE_ENV= CLIBS="${LIBS:S/^-/-ccopt -/}" COFLAGS="${CFLAGS:C/ *(-[^ ]*) */ -ccopt \"\1 \"/gW}"
ALL_TARGET= unison all
USE_GITHUB= yes
GH_ACCOUNT= bcpierce00
DOCS= NEWS README
OPTIONS_DEFINE= DOCS FSMONITOR
OPTIONS_DEFAULT?= FSMONITOR
FSMONITOR_DESC= Compile and install fsmonitor plugin
OPTIONS_SUB= YES
FSMONITOR_LIB_DEPENDS= libinotify.so:devel/libinotify
.if ${FLAVOR} == nox11
MAKE_ARGS= UISTYLE=text
PKGMESSAGE= ${PKGDIR}/pkg-message.nox11
PLIST_SUB+= X11="@comment "
.else
MAKE_ARGS= UISTYLE=gtk2
SUB_FILES= ${PORTNAME}.desktop
USE_GNOME+= atk cairo gdkpixbuf2 glib20 gtk20 pango
USES+= gettext-runtime gnome
PLIST_SUB+= X11=""
.endif
post-patch-FSMONITOR-off:
@${REINPLACE_CMD} -e 's/-include fsmonitor/#&/' \
${WRKSRC}/Makefile.OCaml
post-patch-FSMONITOR-on:
@${REINPLACE_CMD} \
-e '/let suffix = if Util.osType/s/else "" in/else "${VERSIONSUFFIX}" in/' \
${WRKSRC}/fswatch.ml
post-patch:
.if ${FLAVOR} == nox11
@${REINPLACE_CMD} -e 's/CFLAGS/COFLAGS/g' \
${WRKSRC}/Makefile.OCaml ${WRKSRC}/fsmonitor/linux/Makefile
.else
@${REINPLACE_CMD} -Ee 's@(\+|/)(lablgtk2)@\1site-lib/\2@' \
-e 's/CFLAGS/COFLAGS/g' \
${WRKSRC}/Makefile.OCaml ${WRKSRC}/fsmonitor/linux/Makefile
.endif
post-build:
(cd ${WRKSRC} && HOME=${WRKSRC} ./unison -selftest -ui text -batch)
.if ${FLAVOR} == x11
@${ECHO} Building text-only version
@${ECHO} ${WRKSRC}
${SETENV} ${MAKE_ENV} ${MAKE_CMD} -C ${WRKSRC} UISTYLE=text NAME=unison-text
@cd ${WRKSRC}/win32rc && ${LOCALBASE}/bin/icotool -x U.ico
.endif
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}${VERSIONSUFFIX}
.if ${FLAVOR} == x11
${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME}-text ${STAGEDIR}${PREFIX}/bin/${PORTNAME}${VERSIONSUFFIX}-text
${INSTALL_DATA} ${WRKDIR}/${PORTNAME}.desktop ${STAGEDIR}${DESKTOPDIR}/${PORTNAME}${VERSIONSUFFIX}.desktop
${INSTALL_DATA} ${WRKSRC}/win32rc/U_4_48x48x32.png ${STAGEDIR}${PREFIX}/share/pixmaps/${PORTNAME}${VERSIONSUFFIX}.png
.endif
do-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${STAGEDIR}${DOCSDIR}
do-install-FSMONITOR-on:
${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME}-fsmonitor ${STAGEDIR}${PREFIX}/bin/${PORTNAME}-fsmonitor${VERSIONSUFFIX}
.include <bsd.port.mk>

3
net/unison251/distinfo Normal file
View File

@ -0,0 +1,3 @@
TIMESTAMP = 1639862759
SHA256 (bcpierce00-unison-v2.51.5_GH0.tar.gz) = 7e876371992ebf890b60f32df880a98a75fe8c47c06b7b2ae2ad36be48013e83
SIZE (bcpierce00-unison-v2.51.5_GH0.tar.gz) = 1385407

View File

@ -0,0 +1,35 @@
--- Makefile.OCaml.orig 2021-06-23 14:30:30 UTC
+++ Makefile.OCaml
@@ -34,7 +34,11 @@ ifeq ($(shell uname),OpenBSD)
else
ifeq ($(shell uname),NetBSD)
OSARCH=NetBSD
+else
+ifeq ($(shell uname),FreeBSD)
+ OSARCH=FreeBSD
endif
+endif
ifeq ($(shell uname),Linux)
OSARCH=Linux
endif
@@ -290,6 +294,11 @@ ifeq ($(OSARCH),Linux)
INCLFLAGS+=-I fsmonitor -I fsmonitor/linux
endif
+ifeq ($(OSARCH),FreeBSD)
+-include fsmonitor/linux/Makefile src/fsmonitor/linux/Makefile
+INCLFLAGS+=-I fsmonitor -I fsmonitor/linux
+endif
+
ifeq ($(OSARCH),solaris)
-include fsmonitor/solaris/Makefile src/fsmonitor/solaris/Makefile
INCLFLAGS+=-I fsmonitor -I fsmonitor/solaris
@@ -432,7 +441,7 @@ fswatch.cmi : ubase/prefs.cmi
%.o %.obj: %.c
@echo "$(CAMLC): $< ---> $@"
- $(CAMLC) $(CAMLFLAGS) -ccopt $(OUTPUT_SEL)$(CWD)/$@ -c $(CWD)/$<
+ $(CAMLC) $(CAMLFLAGS) -ccopt $(OUTPUT_SEL)$(CWD)/$@ -c $(CFLAGS) $(CWD)/$<
$(NAME)$(EXEC_EXT): $(CAMLOBJS) $(COBJS)
@echo Linking $@

View File

@ -0,0 +1,20 @@
--- fsmonitor/linux/Makefile.orig 2017-03-23 16:47:46 UTC
+++ fsmonitor/linux/Makefile
@@ -18,6 +18,10 @@ else
FSMCAMLLIBS=$(FSMOCAMLLIBS)
endif
+ifeq ($(OSARCH),FreeBSD)
+ CLIBS+=-cclib -linotify
+endif
+
buildexecutable:: $(FSMONITOR)$(EXEC_EXT)
$(FSMONITOR)$(EXEC_EXT): $(FSMCAMLOBJS) $(FSMCOBJS)
@@ -26,4 +30,4 @@ $(FSMONITOR)$(EXEC_EXT): $(FSMCAMLOBJS) $(FSMCOBJS)
clean::
rm -f $(DIR)/*.cm[iox] $(DIR)/*.o $(DIR)/*~
- rm -f $(FSMONITOR)$(EXEC_EXT)
\ No newline at end of file
+ rm -f $(FSMONITOR)$(EXEC_EXT)

View File

@ -0,0 +1,12 @@
[Desktop Entry]
Encoding=UTF-8
Name=Unison
GenericName=File-synchronization tool
Type=Application
Terminal=false
StartupNotify=true
Categories=GTK;Utility;
Exec=unison
Icon=unison.png
Comment=Synchronize files (directories) over different disks (hosts)
Comment[ru]=Синхронизация файлов (каталогов) на нескольких дисках (компьютерах)

11
net/unison251/pkg-descr Normal file
View File

@ -0,0 +1,11 @@
Unison is a file-synchronization tool for Unix and Windows. It allows two
replicas of a collection of files and directories to be stored on different
hosts (or different disks on the same host), modified separately, and then
brought up to date by propagating the changes in each replica to the other.
Unison shares a number of features with tools such as configuration
management packages (CVS, PRCS, etc.) distributed filesystems (Coda, etc.)
uni-directional mirroring utilities (rsync, etc.) and other synchronizers
(Intellisync, Reconcile, etc).
WWW: https://www.cis.upenn.edu/~bcpierce/unison/

View File

@ -0,0 +1,8 @@
[
{ type: install
message: <<EOM
Together with a gtk-enabled version, a text-only unison-text binary
is installed as it depends on a smaller number of libraries.
EOM
}
]

View File

@ -0,0 +1,7 @@
[
{ type: install
message: <<EOM
A text-only unison binary is installed.
EOM
}
]

7
net/unison251/pkg-plist Normal file
View File

@ -0,0 +1,7 @@
bin/unison%%VERSIONSUFFIX%%
%%FSMONITOR%%bin/unison-fsmonitor%%VERSIONSUFFIX%%
%%X11%%share/applications/unison%%VERSIONSUFFIX%%.desktop
%%X11%%bin/unison%%VERSIONSUFFIX%%-text
%%X11%%share/pixmaps/unison%%VERSIONSUFFIX%%.png
%%PORTDOCS%%%%DOCSDIR%%/NEWS
%%PORTDOCS%%%%DOCSDIR%%/README