diff -ruN pyml-20200518/Makefile pyml-20200518.new/Makefile
--- pyml-20200518/Makefile	2020-05-18 11:58:41.000000000 +0000
+++ pyml-20200518.new/Makefile	2020-05-29 17:47:32.471463471 +0000
@@ -3,6 +3,10 @@
 INSTALL := install
 INSTALL_PROGRAM := $(INSTALL)
 bindir := $(PREFIX)/bin
+LIBDIR=$(shell ocamlfind printconf destdir)
+ifneq ($(DESTDIR),)
+	LIBDIR=$(DESTDIR)/$(shell ocamlfind printconf destdir)
+endif
 
 HAVE_OCAMLFIND := $(shell \
 	if $(OCAMLFIND) query -help >/dev/null 2>&1; then \
@@ -208,15 +214,15 @@
 ifeq ($(HAVE_OCAMLFIND),no)
 	$(error ocamlfind is needed for 'make install')
 endif
-	$(OCAMLFIND) install pyml $(INSTALL_FILES)
-	[ ! -f pymltop ] || $(INSTALL_PROGRAM) pymltop $(bindir)/pymltop
-	[ ! -f pymlutop ] || $(INSTALL_PROGRAM) pymlutop $(bindir)/pymlutop
+	$(OCAMLFIND) install pyml $(INSTALL_FILES) -destdir $(LIBDIR)
+	[ ! -f pymltop ] || $(INSTALL_PROGRAM) pymltop $(DESTDIR)$(bindir)/pymltop
+	[ ! -f pymlutop ] || $(INSTALL_PROGRAM) pymlutop $(DESTDIR)$(bindir)/pymlutop
 
 .PHONY : uninstall
 uninstall :
-	$(OCAMLFIND) remove pyml
-	- rm $(bindir)/pymltop
-	- rm $(bindir)/pymlutop
+	$(OCAMLFIND) remove pyml -destdir $(LIBDIR)
+	- rm $(DESTDIR)$(bindir)/pymltop
+	- rm $(DESTDIR)$(bindir)/pymlutop
 
 .PHONY : clean
 clean :
--- pyml-20211015/pyml_arch_generate.c.orig	2021-10-15 15:09:19.000000000 +0000
+++ pyml-20211015/pyml_arch_generate.c	2021-11-26 23:06:42.112334092 +0000
@@ -6,6 +6,8 @@
   #define PLATFORM_NAME "Linux"
 #elif defined(WIN32) || defined(_WIN32)
   #define PLATFORM_NAME "Windows"
+#elif defined __sun__
+  #define PLATFORM_NAME "SunOS"
 #else
   #error "Unknown platform"
 #endif
@@ -15,7 +17,7 @@
 {
   FILE *f = fopen("pyml_arch.ml", "w");
   fprintf(f, "\
-type t = Linux | Windows | Mac\n\n\
+type t = Linux | Windows | Mac | SunOS\n\n\
 let os = %s\n\n\
 ", PLATFORM_NAME);
   #if WIN32
--- pyml-20211015/py.ml.orig	2021-10-15 15:09:19.000000000 +0000
+++ pyml-20211015/py.ml	2021-11-26 23:17:48.606150366 +0000
@@ -408,6 +408,7 @@
   | Pyml_arch.Windows -> ["python%d%dm.dll"; "python%d%d.dll"]
   | Pyml_arch.Mac -> ["libpython%d.%dm.dylib"; "libpython%d.%d.dylib"]
   | Pyml_arch.Linux -> ["libpython%d.%dm.so"; "libpython%d.%d.so"]
+  | Pyml_arch.SunOS -> ["libpython%d.%dm.so"; "libpython%d.%d.so"]
 
 let libpython_from_python_config version_major version_minor =
   let command =
@@ -573,6 +574,7 @@
 let which_command =
   match Pyml_arch.os with
   | Pyml_arch.Windows -> "where"
+  | Pyml_arch.SunOS -> "which"
   | _ -> "command -v"
 
 let which program =
--- pyml-20211015/pyml_arch.mli.orig	2021-10-15 15:09:19.000000000 +0000
+++ pyml-20211015/pyml_arch.mli	2021-11-26 23:21:20.375348874 +0000
@@ -1,4 +1,4 @@
-type t = Linux | Windows | Mac
+type t = Linux | Windows | Mac | SunOS
 
 val os : t