tech-pkg archive

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

cmake files in pkgsrc/mk with hard-coded /usr/pkg paths



Recently [1], I identified some files used by cmake that included
hard-coded paths to /usr/pkg as opposed to ${LOCALBASE}.  I have
committed the fix for the first group of these files: those that are
installed by the devel/cmake package itself.

I would now like to fix the file that is installed from within mk:
mk/cmake-Modules/Platform/UnixPaths.cmake.  To do this, I propose the
following patch:

Index: cmake-Modules/Platform/UnixPaths.cmake
===================================================================
RCS file: /cvsroot/pkgsrc/mk/cmake-Modules/Platform/UnixPaths.cmake,v
retrieving revision 1.2
diff -u -r1.2 UnixPaths.cmake
--- cmake-Modules/Platform/UnixPaths.cmake      13 Sep 2008 11:06:08 -0000      
1.2
+++ cmake-Modules/Platform/UnixPaths.cmake      14 Sep 2011 18:55:10 -0000
@@ -5,7 +5,7 @@
 
 LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH
   # Standard
-  / /usr /usr/pkg
+  / /usr @LOCALBASE@
   )
 
 SET(CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_SYSTEM_INCLUDE_PATH}
@@ -20,7 +20,7 @@
   )
 
 SET(CMAKE_SYSTEM_PROGRAM_PATH ${CMAKE_SYSTEM_PROGRAM_PATH}
-  /bin /usr/bin /usr/local/bin /usr/pkg/bin /sbin
+  /bin /usr/bin /usr/local/bin @LOCALBASE@/bin /sbin
   )
 
 LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
Index: configure/cmake.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/configure/cmake.mk,v
retrieving revision 1.8
diff -u -r1.8 cmake.mk
--- configure/cmake.mk  12 Jan 2011 07:21:30 -0000      1.8
+++ configure/cmake.mk  14 Sep 2011 18:55:10 -0000
@@ -46,6 +46,11 @@
 do-configure-pre-hook: __cmake-copy-module-tree
 __cmake-copy-module-tree: .PHONY
        ${RUN} cd ${PKGSRCDIR}/mk; ${CP} -R cmake-Modules ${_CMAKE_DIR}
+.for f in UnixPaths.cmake
+       ${SED} -e "s:@LOCALBASE@:${LOCALBASE}:g" \
+               ${_CMAKE_DIR}/Platform/${f} > ${_CMAKE_DIR}/Platform/${f}.f \
+       && ${MV} ${_CMAKE_DIR}/Platform/${f}.f ${_CMAKE_DIR}/Platform/${f}
+.endfor
 
 ### The cmake function export_library_dependencies() writes out
 ### library dependency info to a file and this may contain buildlink

Please suggest improvements.  I would like to complete this before the
upcoming freeze, so comments in the near term are especially helpful.

Thanks.

Cheers,
Brook

[1] http://mail-index.netbsd.org/tech-pkg/2011/08/25/msg007589.html


Home | Main Index | Thread Index | Old Index