git: 971cb789e904 - main - graphics/airsaned: update to 0.3.2.54_1

From: Fernando Apesteguía <fernape_at_FreeBSD.org>
Date: Tue, 11 Jan 2022 10:41:52 UTC
The branch main has been updated by fernape:

URL: https://cgit.FreeBSD.org/ports/commit/?id=971cb789e90444bf3d7aa50d8cd2aa250e6a0c57

commit 971cb789e90444bf3d7aa50d8cd2aa250e6a0c57
Author:     J.R. Oldroyd <fbsd@opal.com>
AuthorDate: 2022-01-11 07:05:28 +0000
Commit:     Fernando Apesteguía <fernape@FreeBSD.org>
CommitDate: 2022-01-11 10:40:02 +0000

    graphics/airsaned: update to 0.3.2.54_1
    
    Properly update to 0.3.2.54 after using the wrong git hash.
    Some of the patches have been merged upstrem and can be removed.
    
    PR:     261068
    Reported by:    fbsd@opal.com (maintainer)
    Fixes:  fa24020b477a2a37a01dedf11bfd83e744f81cd1
---
 graphics/airsaned/Makefile                         | 14 ++--
 graphics/airsaned/distinfo                         |  6 +-
 graphics/airsaned/files/airsaned.in                | 24 ------
 graphics/airsaned/files/patch-CMakeLists.txt       | 89 ++++++++++------------
 .../files/patch-imageformats-pngencoder.cpp        | 20 -----
 .../airsaned/files/patch-server-mainserver.cpp     | 16 ----
 graphics/airsaned/files/patch-server_server.cpp    | 20 +++++
 graphics/airsaned/files/patch-web-httpserver.cpp   | 12 ---
 .../files/patch-zeroconf-hotplugnotifier.cpp       | 14 ----
 graphics/airsaned/pkg-plist                        |  1 +
 10 files changed, 72 insertions(+), 144 deletions(-)

diff --git a/graphics/airsaned/Makefile b/graphics/airsaned/Makefile
index b5b93f4df58c..5dcd9fad4f2f 100644
--- a/graphics/airsaned/Makefile
+++ b/graphics/airsaned/Makefile
@@ -1,7 +1,8 @@
 PORTNAME=	airsaned
 DISTVERSIONPREFIX=	v
 DISTVERSION=	0.3.2-54
-DISTVERSIONSUFFIX=	-g53909a5
+DISTVERSIONSUFFIX=	-g433b762
+PORTREVISION=	1
 CATEGORIES=	graphics
 
 MAINTAINER=	fbsd@opal.com
@@ -17,18 +18,19 @@ LIB_DEPENDS=	libavahi-client.so:net/avahi-app \
 USES=		cmake compiler:c++11-lib jpeg localbase:ldflags
 USE_GITHUB=	yes
 
+RC_SUBR=	freebsd/${PORTNAME}
+
 GH_ACCOUNT=	SimulPiscator
 GH_PROJECT=	AirSane
 
-USE_RC_SUBR=	${PORTNAME}
-
 post-patch:
-	@${REINPLACE_CMD} -e 's|%%STAGEDIR%%|${STAGEDIR}|g' \
-	    ${PATCH_WRKSRC}/CMakeLists.txt
 	@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' \
-	    ${PATCH_WRKSRC}/server/mainserver.cpp
+	    ${PATCH_WRKSRC}/server/server.cpp
 
 post-install:
+	@${MKDIR} ${STAGEDIR}${PREFIX}/etc/rc.d
+	@${SED} -e 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/${RC_SUBR} >${STAGEDIR}${PREFIX}/etc/rc.d/${PORTNAME}
+	@${CHMOD} +x ${STAGEDIR}${PREFIX}/etc/rc.d/${PORTNAME}
 	@${MV} ${STAGEDIR}${PREFIX}/etc/airsane/ignore.conf ${STAGEDIR}${PREFIX}/etc/airsane/ignore.conf.sample
 	@${MV} ${STAGEDIR}${PREFIX}/etc/airsane/options.conf ${STAGEDIR}${PREFIX}/etc/airsane/options.conf.sample
 
diff --git a/graphics/airsaned/distinfo b/graphics/airsaned/distinfo
index 6e327c6195e6..c90db0c52fbd 100644
--- a/graphics/airsaned/distinfo
+++ b/graphics/airsaned/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1641754683
-SHA256 (SimulPiscator-AirSane-v0.3.2-54-g53909a5_GH0.tar.gz) = 64b4b81bb65b0a69dead944a063b0bf4276d8772749b24c4c7fa87134c819e80
-SIZE (SimulPiscator-AirSane-v0.3.2-54-g53909a5_GH0.tar.gz) = 114019
+TIMESTAMP = 1641840693
+SHA256 (SimulPiscator-AirSane-v0.3.2-54-g433b762_GH0.tar.gz) = 9b32b7a1e9023137901b999d5803b613e057a2ff700844d623f172b4354668a1
+SIZE (SimulPiscator-AirSane-v0.3.2-54-g433b762_GH0.tar.gz) = 116180
diff --git a/graphics/airsaned/files/airsaned.in b/graphics/airsaned/files/airsaned.in
deleted file mode 100644
index 02b9a57251ac..000000000000
--- a/graphics/airsaned/files/airsaned.in
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-# PROVIDE: airsaned
-# REQUIRE: LOGIN
-# KEYWORD: shutdown
-#
-# Add the following line to /etc/rc.conf[.local] to enable airsaned:
-#	airsaned_enable="YES"
-
-. /etc/rc.subr
-
-name=airsaned
-rcvar=airsaned_enable
-
-load_rc_config airsane
-
-: ${airsaned_enable:="NO"}
-: ${airsaned_args:=""}
-
-command="%%PREFIX%%/sbin/${name}"
-command_args="${airsaned_args} &"
-sig_stop="KILL"
-
-run_rc_command "$1"
diff --git a/graphics/airsaned/files/patch-CMakeLists.txt b/graphics/airsaned/files/patch-CMakeLists.txt
index 72fce98f6e20..f9d9f430c839 100644
--- a/graphics/airsaned/files/patch-CMakeLists.txt
+++ b/graphics/airsaned/files/patch-CMakeLists.txt
@@ -1,57 +1,48 @@
---- CMakeLists.txt.orig	2021-02-01 18:41:51 UTC
+--- CMakeLists.txt.orig	2021-10-19 16:15:25 UTC
 +++ CMakeLists.txt
-@@ -67,6 +67,13 @@ add_executable(${PROJECT_NAME}
-     zeroconf/hotplugnotifier.cpp
-     ${ZEROCONF_FILES}
- )
-+
-+if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
-+  set(USB_LIBRARY usb)
+@@ -113,7 +113,6 @@ install(CODE "
+     endif()
+ ")
+ 
+-
+ elseif(CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
+ 
+ if ($ENV{PREFIX})
+@@ -122,27 +121,33 @@ else()
+     # default is "/usr/local"
+ endif()
+ 
++if ($ENV{STAGEDIR})
++    set(CMAKE_INSTALL_STAGEDIR $ENV{STAGEDIR})
 +else()
-+  set(USB_LIBRARY usb-1.0)
++    set(CMAKE_INSTALL_STAGEDIR "../stage")
 +endif()
 +
- target_link_libraries(
-     ${PROJECT_NAME}
-     Threads::Threads
-@@ -74,7 +79,7 @@ target_link_libraries(
-     jpeg
-     png
-     ${ZEROCONF_LIBS}
--    usb-1.0
-+    ${USB_LIBRARY}
+ install(TARGETS ${PROJECT_NAME}
+     RUNTIME DESTINATION sbin
  )
  
- if(APPLE)
-@@ -102,8 +107,31 @@ install(CODE "
+ install(CODE "
+-    if(NOT EXISTS ${CMAKE_INSTALL_PREFIX}/etc/airsane/ignore.conf)
++    if(NOT EXISTS ${CMAKE_INSTALL_STAGEDIR}/${CMAKE_INSTALL_PREFIX}/etc/airsane/ignore.conf)
+         file(INSTALL ${CMAKE_SOURCE_DIR}/etc/ignore.conf DESTINATION ${CMAKE_INSTALL_PREFIX}/etc/airsane)
+     endif()
+ ")
+ install(CODE "
+-    if(NOT EXISTS ${CMAKE_INSTALL_PREFIX}/etc/airsane/options.conf)
++    if(NOT EXISTS ${CMAKE_INSTALL_STAGEDIR}/${CMAKE_INSTALL_PREFIX}/etc/airsane/options.conf)
+         file(INSTALL ${CMAKE_SOURCE_DIR}/etc/options.conf DESTINATION ${CMAKE_INSTALL_PREFIX}/etc/airsane)
+     endif()
+ ")
+ install(CODE "
+-    if(NOT EXISTS ${CMAKE_INSTALL_PREFIX}/etc/airsane/Gnome-scanner.png)
++    if(NOT EXISTS ${CMAKE_INSTALL_STAGEDIR}/${CMAKE_INSTALL_PREFIX}/etc/airsane/Gnome-scanner.png)
+         file(INSTALL ${CMAKE_SOURCE_DIR}/etc/Gnome-scanner.png DESTINATION ${CMAKE_INSTALL_PREFIX}/etc/airsane)
+     endif()
+ ")
+ install(CODE "
+-    if(NOT EXISTS ${CMAKE_INSTALL_PREFIX}/etc/rc.d/airsaned)
++    if(NOT EXISTS ${CMAKE_INSTALL_STAGEDIR}/${CMAKE_INSTALL_PREFIX}/etc/rc.d/airsaned)
+         file(INSTALL ${CMAKE_SOURCE_DIR}/freebsd/airsaned DESTINATION ${CMAKE_INSTALL_PREFIX}/etc/rc.d)
      endif()
  ")
- 
-+elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
- 
-+set(STAGEDIR "%%STAGEDIR%%")
-+
-+install(TARGETS ${PROJECT_NAME}
-+    RUNTIME DESTINATION sbin
-+)
-+
-+install(CODE "
-+    if(NOT EXISTS ${STAGEDIR}/usr/local/etc/airsane/ignore.conf)
-+        file(INSTALL ${CMAKE_SOURCE_DIR}/etc/ignore.conf DESTINATION /usr/local/etc/airsane)
-+    endif()
-+")
-+install(CODE "
-+    if(NOT EXISTS ${STAGEDIR}/usr/local/etc/airsane/options.conf)
-+        file(INSTALL ${CMAKE_SOURCE_DIR}/etc/options.conf DESTINATION /usr/local/etc/airsane)
-+    endif()
-+")
-+install(CODE "
-+    if(NOT EXISTS ${STAGEDIR}/usr/local/etc/airsane/Gnome-scanner.png)
-+        file(INSTALL ${CMAKE_SOURCE_DIR}/etc/Gnome-scanner.png DESTINATION /usr/local/etc/airsane)
-+    endif()
-+")
-+
- else()
- 
- install(TARGETS ${PROJECT_NAME}
-     RUNTIME DESTINATION bin
diff --git a/graphics/airsaned/files/patch-imageformats-pngencoder.cpp b/graphics/airsaned/files/patch-imageformats-pngencoder.cpp
deleted file mode 100644
index 14d8e66c4d75..000000000000
--- a/graphics/airsaned/files/patch-imageformats-pngencoder.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
---- imageformats/pngencoder.cpp.orig	2021-02-01 18:41:51 UTC
-+++ imageformats/pngencoder.cpp
-@@ -17,11 +17,17 @@ along with this program.  If not, see <http://www.gnu.
- */
- 
- #include "pngencoder.h"
-+#ifdef __FreeBSD__
-+#include <png.h>
-+#else
- #include <libpng/png.h>
-+#endif
- #include <stdexcept>
- #include <vector>
- #if __APPLE__
- #include <machine/endian.h>
-+#elif __FreeBSD__
-+#include <sys/endian.h>
- #else
- #include <endian.h>
- #endif
diff --git a/graphics/airsaned/files/patch-server-mainserver.cpp b/graphics/airsaned/files/patch-server-mainserver.cpp
deleted file mode 100644
index 5eb30b1a912f..000000000000
--- a/graphics/airsaned/files/patch-server-mainserver.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
---- server/mainserver.cpp.orig	2021-02-01 18:41:51 UTC
-+++ server/mainserver.cpp
-@@ -83,11 +83,11 @@ MainServer::MainServer(int argc, char** argv)
-       "ignore SANE network scanners",
-       localonly },
-     { "options-file",
--      "/etc/airsane/options.conf",
-+      "%%PREFIX%%/etc/airsane/options.conf",
-       "location of device options file",
-       optionsfile },
-     { "ignore-list",
--      "/etc/airsane/ignore.conf",
-+      "%%PREFIX%%/etc/airsane/ignore.conf",
-       "location of device ignore list",
-       ignorelist },
-     { "random-uuids",
diff --git a/graphics/airsaned/files/patch-server_server.cpp b/graphics/airsaned/files/patch-server_server.cpp
new file mode 100644
index 000000000000..d07045495d20
--- /dev/null
+++ b/graphics/airsaned/files/patch-server_server.cpp
@@ -0,0 +1,20 @@
+--- server/server.cpp.orig	2021-10-19 16:15:25 UTC
++++ server/server.cpp
+@@ -104,7 +104,7 @@ Server::Server(int argc, char** argv)
+       localonly },
+     { "options-file",
+ #ifdef __FreeBSD__
+-      "/usr/local/etc/airsane/options.conf",
++      "%%PREFIX%%/etc/airsane/options.conf",
+ #else
+       "/etc/airsane/options.conf",
+ #endif
+@@ -112,7 +112,7 @@ Server::Server(int argc, char** argv)
+       optionsfile },
+     { "ignore-list",
+ #ifdef __FreeBSD__
+-      "/usr/local/etc/airsane/ignore.conf",
++      "%%PREFIX%%/etc/airsane/ignore.conf",
+ #else
+       "/etc/airsane/ignore.conf",
+ #endif
diff --git a/graphics/airsaned/files/patch-web-httpserver.cpp b/graphics/airsaned/files/patch-web-httpserver.cpp
deleted file mode 100644
index cae26d5639a5..000000000000
--- a/graphics/airsaned/files/patch-web-httpserver.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
---- web/httpserver.cpp.orig	2021-02-01 18:41:51 UTC
-+++ web/httpserver.cpp
-@@ -26,6 +26,9 @@ along with this program.  If not, see <http://www.gnu.
- #include <thread>
- 
- #include <arpa/inet.h>
-+#ifdef __FreeBSD__
-+#include <netinet/in.h>
-+#endif
- #include <ifaddrs.h>
- #include <net/if.h>
- #include <netdb.h>
diff --git a/graphics/airsaned/files/patch-zeroconf-hotplugnotifier.cpp b/graphics/airsaned/files/patch-zeroconf-hotplugnotifier.cpp
deleted file mode 100644
index 2b7939c493c9..000000000000
--- a/graphics/airsaned/files/patch-zeroconf-hotplugnotifier.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
---- zeroconf/hotplugnotifier.cpp.orig	2021-10-05 12:35:03 UTC
-+++ zeroconf/hotplugnotifier.cpp
-@@ -20,7 +20,11 @@ along with this program.  If not, see <http://www.gnu.
- 
- #include <atomic>
- #include <csignal>
-+#ifdef __FreeBSD__
-+#include <libusb.h>
-+#else
- #include <libusb-1.0/libusb.h>
-+#endif
- #include <pthread.h>
- #include <thread>
- 
diff --git a/graphics/airsaned/pkg-plist b/graphics/airsaned/pkg-plist
index 6d01b36085bb..ff31cf8b4fbc 100644
--- a/graphics/airsaned/pkg-plist
+++ b/graphics/airsaned/pkg-plist
@@ -1,4 +1,5 @@
 sbin/airsaned
 etc/airsane/Gnome-scanner.png
+etc/rc.d/airsaned
 @sample etc/airsane/ignore.conf.sample
 @sample etc/airsane/options.conf.sample