From 64d8434f513ef61d3f5faf59f4e09a20c3c512e9 Mon Sep 17 00:00:00 2001 From: Jacques-Henri Jourdan Date: Wed, 14 Dec 2022 22:23:10 +0100 Subject: [PATCH] Use make as a build system for opam files. There are now two opam files: - unison.opam is the main opam file. It has an optional dependency to lablgtk3, so that the GUI is built only if the lablgtk3 package is installed. - unison-gui.opam is a pseudo-package, with both unison and lablgtk3 as dependencies. It can be used to force the GUI to be installed. As a side effect, remove the package information from the dune-project files, to avoid redundancy. --- dune-project | 71 -------------------------------------- src/dune | 4 +-- src/fsmonitor/linux/dune | 2 +- src/fsmonitor/solaris/dune | 2 +- unison-gui.opam | 22 ++++++++++++ unison.opam | 6 ++-- 6 files changed, 30 insertions(+), 77 deletions(-) create mode 100644 unison-gui.opam diff --git a/dune-project b/dune-project index a20112a65..df16109ee 100644 --- a/dune-project +++ b/dune-project @@ -2,75 +2,4 @@ (name unison) -(version dev) - (generate_opam_files false) - -(license GPL-3.0-or-later) - -(maintainers "unison-hackers@lists.seas.upenn.edu") - -(authors "Trevor Jim" "Benjamin C. Pierce" "J\195\169r\195\180me Vouillon") - -(source - (github bcpierce00/unison)) - -(homepage https://www.cis.upenn.edu/~bcpierce/unison/) - -(documentation "https://github.com/bcpierce00/unison/wiki") - -(package - (name unison) - (synopsis "File-synchronization tool for Unix and Windows") - (description "\ -Text based user interface for Unison. - -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. -") - (depends - (ocaml - (>= 4.08)) - (dune - (>= 2.3)))) - -(package - (name unison-gui) - (synopsis "File-synchronization tool for Unix and Windows") - (description "\ -Graphical user interface for Unison. - -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. -") - (depends - (ocaml - (>= 4.08)) - (dune - (>= 2.3)) - lablgtk)) - -(package - (name unison-fsmonitor) - (synopsis "File-synchronization tool for Unix and Windows") - (description "\ -This optional add-on for unison monitors file system changes -on all given (relative to root) paths. - -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. -") - (depends - (ocaml - (>= 4.08)) - (dune - (>= 2.3)))) diff --git a/src/dune b/src/dune index 1968ba2d4..c784f1092 100644 --- a/src/dune +++ b/src/dune @@ -18,14 +18,14 @@ (executable (name linktext) (public_name unison) - (package unison) + (package unison) ; Dummy: we don't use packages (modules linktext) (libraries unison_lib)) (executable (name linkgtk3) (public_name unison-gui) - (package unison-gui) + (package unison-gui) ; Dummy: we don't use packages (flags :standard -w -3-6-9-27-32-52) (modules linkgtk3 uigtk3) (libraries threads unison_lib lablgtk3)) diff --git a/src/fsmonitor/linux/dune b/src/fsmonitor/linux/dune index c9c6a8104..e692749c5 100644 --- a/src/fsmonitor/linux/dune +++ b/src/fsmonitor/linux/dune @@ -20,7 +20,7 @@ (executable (name watcher) (public_name unison-fsmonitor) - (package unison-fsmonitor) + (package unison) ; Dummy: we don't use packages (enabled_if (or (= %{system} "linux") diff --git a/src/fsmonitor/solaris/dune b/src/fsmonitor/solaris/dune index 1f5abf743..f6e75c7f6 100644 --- a/src/fsmonitor/solaris/dune +++ b/src/fsmonitor/solaris/dune @@ -14,7 +14,7 @@ (executable (name watcher) (public_name unison-fsmonitor) - (package unison-fsmonitor) + (package unison) ; Dummy: we don't use packages (enabled_if (= %{system} "solaris")) (modules watcher) (flags :standard -w -27) diff --git a/unison-gui.opam b/unison-gui.opam new file mode 100644 index 000000000..c976aaeae --- /dev/null +++ b/unison-gui.opam @@ -0,0 +1,22 @@ +opam-version: "2.0" +maintainer: "unison-hackers@lists.seas.upenn.edu" +authors: [ + "Trevor Jim" + "Benjamin C. Pierce" + "Jérôme Vouillon" +] +license: "GPL-3.0-or-later" +homepage: "https://www.cis.upenn.edu/~bcpierce/unison/" +bug-reports: "https://github.com/bcpierce00/unison/issues" +dev-repo: "git://github.com/bcpierce00/unison.git" +depends: [ + "unison" {= version} + "lablgtk3" +] +synopsis: "Pseudo-package for Unison GUI" +description: """ +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.""" diff --git a/unison.opam b/unison.opam index bd74d2a56..1ba915801 100644 --- a/unison.opam +++ b/unison.opam @@ -9,10 +9,12 @@ license: "GPL-3.0-or-later" homepage: "https://www.cis.upenn.edu/~bcpierce/unison/" bug-reports: "https://github.com/bcpierce00/unison/issues" dev-repo: "git://github.com/bcpierce00/unison.git" -build: ["dune" "build" "-p" name "-j" jobs] +build: [make "-j" jobs] +install: [make "INSTALLDIR=%{bin}%/" "install"] depends: [ "ocaml" {>= "4.08"} - "dune" {>= "2.3"} +] +depopts: [ "lablgtk3" {>= "3.1.0"} ] synopsis: "File-synchronization tool for Unix and Windows"