> Here is a first draft doing just that (attached).
> 
>  * Make the PKGNAME lowercase as for almost all ports.
>  * Conventional license marker.
>  * Move MASTER_SITES up to the conventional place.
>  * Move EXTRACT_SUFX down to the conventional place.
>  * Add the second file to DISTFILES.
>  * Move MODULES up to the conventional place.
>  * Add post-extract and pre-configure targets.
> 
> Changes to patches:
>  * CMakeLists.txt
>     - do not include(HandleFindLibDiveComputer), searching for something
>       when we already know where it is causes nothing but trouble
>     - adjust include_directories()
>     - adjust set_target_properties(subsurface_dc)
>  * cmake/Modules/FindLibdivecomputer.cmake
>     - delete patch, should now work as is with the in-tree libdivecomputer
>  * libdivecomputer/src/serial_posix.c
>     - move this here from the draft of the libdivecomputer-subsurface port
> 
> It builds and runs for me, but i'm in no position to test because the
> Rhine river is 20 km away, very muddy, full of cargo ships, and none
> of my computers is a waterproof dive computer.
> 
> This is *not* yet finished.  I still see many open questions,
> but i figured i should send a first draft early to demonstrate
> how to use DISTFILES with post-extract, and such that work is
> not duplicated.
> 
> In particular, right now, it builds libdivecomputer during
> pre-configure.  I suspect this can be split up to do the parts
> that belong to the build, not to configure, in pre-build.
> We just need to be careful that the main configure still finds
> the information it needs.
> 
> If i do a bit more work on this, i'll keep you updated without
> bothering the list each time.

Enclosed is a modified version of your package that gets it built and
installed with or without a local libdivecomputer in /usr/local.
Before, it would try to pick up -I/usr/local/include before the local
installation of libdivecomputer.  (Hence the early include_directories.)
 I haven't attempted to answer any questions on the port itself (except
changing the category)---just get it working.

With this, I'm able to create and install the package, run it, connect
to the "cloud", connect to some dive computers, etc.  I didn't try the
facebook.

I've also enclosed a patch from Ingo's version---thank you again!

Attachment: subsurface.tgz
Description: Binary data

diff -Napur subsurface/Makefile /usr/ports/mystuff/multimedia/subsurface/Makefile
--- subsurface/Makefile	Wed Aug  1 00:07:55 2018
+++ /usr/ports/mystuff/multimedia/subsurface/Makefile	Wed Aug  1 19:44:56 2018
@@ -6,7 +6,7 @@ VER =		4.8.1
 PKGNAME =	subsurface-${VER}
 DISTNAME =	Subsurface-${VER}
 
-CATEGORIES =	misc
+CATEGORIES =	multimedia
 HOMEPAGE =	https://subsurface-divelog.org
 MAINTAINER =	Kristaps Dzonsons <krist...@bsd.lv>
 
@@ -57,7 +57,9 @@ pre-configure:
 	env AUTOCONF_VERSION=2.67 AUTOMAKE_VERSION=1.11 \
 	    autoreconf -f -i .. && \
 	../configure --without-libusb --without-hidapi --without-bluez \
+	    --prefix=${WRKSRC}/libdivecomputer/built \
 	    --disable-shared --disable-examples --disable-doc && \
-	gmake
+	gmake && \
+	gmake install 
 
 .include <bsd.port.mk>
diff -Napur subsurface/patches/patch-CMakeLists_txt /usr/ports/mystuff/multimedia/subsurface/patches/patch-CMakeLists_txt
--- subsurface/patches/patch-CMakeLists_txt	Wed Aug  1 00:24:28 2018
+++ /usr/ports/mystuff/multimedia/subsurface/patches/patch-CMakeLists_txt	Wed Aug  1 19:46:31 2018
@@ -3,7 +3,7 @@ $OpenBSD$
 Index: CMakeLists.txt
 --- CMakeLists.txt.orig
 +++ CMakeLists.txt
-@@ -35,18 +35,18 @@ option(FORCE_LIBSSH "force linking with libssh to work
+@@ -35,19 +35,21 @@ option(FORCE_LIBSSH "force linking with libssh to work
  option(LIBGIT2_DYNAMIC "search for libgit2.so before libgit2.a" OFF)
  
  #Options regarding disabling parts of subsurface.
@@ -24,9 +24,12 @@ Index: CMakeLists.txt
 -option(MAKE_TESTS "Make the tests" ON)
 +option(MAKE_TESTS "Make the tests" OFF)
  
++include_directories(${CMAKE_SOURCE_DIR}/libdivecomputer/built/include)
++
  SET(SUBSURFACE_TARGET_EXECUTABLE "DesktopExecutable" CACHE STRING "The type of application, DesktopExecutable or MobileExecutable")
  LIST(APPEND SUBSURFACE_ACCEPTED_EXECUTABLES  "DesktopExecutable" "MobileExecutable")
-@@ -122,7 +122,6 @@ include(pkgconfig_helper)
+ SET_PROPERTY(CACHE SUBSURFACE_TARGET_EXECUTABLE PROPERTY STRINGS ${SUBSURFACE_ACCEPTED_EXECUTABLES})
+@@ -122,7 +124,6 @@ include(pkgconfig_helper)
  # if you think a module miss anything, take a look on the specific
  # module file.
  include(HandleFindGit2)
@@ -34,15 +37,6 @@ Index: CMakeLists.txt
  if(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "DesktopExecutable")
          include(HandleFindGrantlee)
  	include(HandleUserManual)
-@@ -147,6 +146,8 @@ include_directories(.
- 	${CMAKE_CURRENT_BINARY_DIR}
- 	${CMAKE_BINARY_DIR}
- 	${CMAKE_BINARY_DIR}/desktop-widgets
-+	${CMAKE_SOURCE_DIR}/libdivecomputer/include
-+	${CMAKE_SOURCE_DIR}/libdivecomputer/build/include
- )
- 
- # Project Target specific configuration should go here,
 @@ -260,7 +261,7 @@ if(BLESUPPORT)
  endif()
  
@@ -57,7 +51,7 @@ Index: CMakeLists.txt
          endif()
  
 +	add_library(subsurface_dc STATIC IMPORTED)
-+	set_target_properties(subsurface_dc PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/libdivecomputer/build/src/.libs/libdivecomputer.a)
++	set_target_properties(subsurface_dc PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/libdivecomputer/built/lib/libdivecomputer.a)
 +
  	if(FBSUPPORT)
  		set(FACEBOOK_INTEGRATION facebook_integration)

Reply via email to