pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

sdl12-compat: Fix build on Darwin



Module Name:	pkgsrc-wip
Committed By:	Jason Bacon <bacon%NetBSD.org@localhost>
Pushed By:	outpaddling
Date:		Tue Oct 31 07:12:24 2023 -0500
Changeset:	c9dd24ad1dcbad91375324287be68047bdded5c7

Modified Files:
	sdl12-compat/Makefile
	sdl12-compat/distinfo
	sdl12-compat/patches/patch-CMakeLists.txt

Log Message:
sdl12-compat: Fix build on Darwin

Remove CMP0068 policy and convert -install_name to absolute path

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=c9dd24ad1dcbad91375324287be68047bdded5c7

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 sdl12-compat/Makefile                     |  5 ++++-
 sdl12-compat/distinfo                     |  2 +-
 sdl12-compat/patches/patch-CMakeLists.txt | 21 ++++++++++++++++-----
 3 files changed, 21 insertions(+), 7 deletions(-)

diffs:
diff --git a/sdl12-compat/Makefile b/sdl12-compat/Makefile
index 93278e5275..aa677c1cc6 100644
--- a/sdl12-compat/Makefile
+++ b/sdl12-compat/Makefile
@@ -20,7 +20,10 @@ PKGCONFIG_OVERRIDE+=	sdl12_compat.pc.in
 SUBST_CLASSES+=			install_name
 SUBST_STAGE.install_name=	post-configure
 SUBST_FILES.install_name=	CMakeFiles/SDL.dir/link.txt
-SUBST_SED.install_name=		-e 's|@rpath|${PREFIX}/lib|g'
+# With cmake policy CMP0068, @rpath is generated
+# SUBST_SED.install_name=		-e 's|@rpath|${PREFIX}/lib|g'
+# With cmake policy CMP0068 disabled, no directory is generated
+SUBST_SED.install_name=		-e 's|-install_name libSDL-1.2.0.dylib|-install_name ${PREFIX}/lib/libSDL-1.2.0.dylib|g'
 
 CMAKE_ARGS+=	-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
 
diff --git a/sdl12-compat/distinfo b/sdl12-compat/distinfo
index f464f00fdf..bb21e81cb9 100644
--- a/sdl12-compat/distinfo
+++ b/sdl12-compat/distinfo
@@ -3,5 +3,5 @@ $NetBSD: distinfo,v 1.1 2022/04/01 10:43:05 nia Exp $
 BLAKE2s (sdl12-compat-1.2.52.tar.gz) = d8abf6a0bfa94472c664208232c654ea358aff157f4c14f8c508b887d7801479
 SHA512 (sdl12-compat-1.2.52.tar.gz) = cd8f34f61ee9c6d0bd635f4c7a6f3cfb6bb570976f3bf843f1e3893b3a86d087a40bdf5f6bb2de16c9534ec42bc846b6ff599ac557c3b088c447e6106e2558f9
 Size (sdl12-compat-1.2.52.tar.gz) = 421046 bytes
-SHA1 (patch-CMakeLists.txt) = ca6c1fc0c32c4e68f6d1f9bcf988f5bcdbecfa5b
+SHA1 (patch-CMakeLists.txt) = 59342004380baa1cea92eb82fac37c6fa62ab6e9
 SHA1 (patch-include_SDL_SDL__config.h) = 96eb020bb246e111d4240f94f68a1f5e49222070
diff --git a/sdl12-compat/patches/patch-CMakeLists.txt b/sdl12-compat/patches/patch-CMakeLists.txt
index 277dad7dd2..2b4c7f94b0 100644
--- a/sdl12-compat/patches/patch-CMakeLists.txt
+++ b/sdl12-compat/patches/patch-CMakeLists.txt
@@ -1,10 +1,21 @@
-$NetBSD: patch-CMakeLists.txt,v 1.1 2022/04/01 10:43:05 nia Exp $
+$NetBSD$
 
-Not every unix system has libdl.
+# Fix install_name on macOS
 
 --- CMakeLists.txt.orig	2022-03-03 14:56:56.000000000 +0000
 +++ CMakeLists.txt
-@@ -71,7 +71,7 @@ string(STRIP "${CMAKE_C_FLAGS}" CMAKE_C_
+@@ -24,10 +24,6 @@ if(APPLE)
+   set(DYLIB_COMPAT_VERSION 1.0.0 CACHE STRING "library compatibility version")
+   set(DYLIB_CURRENT_VERSION 12.52.0 CACHE STRING "library current version")
+   include_directories("/opt/X11/include")  # hack.
+-  if(CMAKE_VERSION VERSION_LESS 3.9)
+-  else()
+-    cmake_policy(SET CMP0068 NEW)  # on macOS, don't let RPATH affect install_name.
+-  endif()
+ endif()
+ 
+ if(WIN32)
+@@ -71,7 +67,7 @@ string(STRIP "${CMAKE_C_FLAGS}" CMAKE_C_
  
  if(UNIX AND NOT APPLE)
      set_target_properties(SDL PROPERTIES COMPILE_DEFINITIONS "_REENTRANT")
@@ -13,7 +24,7 @@ Not every unix system has libdl.
  endif()
  if(APPLE)
      set_target_properties(SDL PROPERTIES INSTALL_NAME_DIR "")
-@@ -254,7 +254,7 @@ if(SDL12DEVEL)
+@@ -254,7 +250,7 @@ if(SDL12DEVEL)
        set(SDL_CFLAGS "-D_GNU_SOURCE=1 -D_REENTRANT")
        set(SDL_RLD_FLAGS "")  # !!! FIXME: this forces rpath, which we might want?
        set(SDL_LIBS "-lSDL")
@@ -22,7 +33,7 @@ Not every unix system has libdl.
        if(NOT STATICDEVEL)
          set(SDL_STATIC_LIBS "")
        endif()
-@@ -297,7 +297,7 @@ if(STATICDEVEL AND SDL12DEVEL)
+@@ -297,7 +293,7 @@ if(STATICDEVEL AND SDL12DEVEL)
    add_library(SDL-static STATIC ${SDL12COMPAT_SRCS})
    target_include_directories(SDL-static PRIVATE ${SDL2_INCLUDE_DIRS})
    set_target_properties(SDL-static PROPERTIES COMPILE_DEFINITIONS "_REENTRANT")


Home | Main Index | Thread Index | Old Index