[BACK]Return to patch-src_makefile CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / textproc / libhighlight / patches

File: [cvs.NetBSD.org] / pkgsrc / textproc / libhighlight / patches / patch-src_makefile (download)

Revision 1.8, Wed Dec 18 01:34:34 2019 UTC (11 months, 1 week ago) by schmonz
Branch: MAIN
CVS Tags: pkgsrc-2020Q1-base, pkgsrc-2020Q1, pkgsrc-2019Q4-base, pkgsrc-2019Q4
Changes since 1.7: +5 -5 lines

Update to 3.54 (during the freeze, for the bugfixes). From the changelog:

- fixed default colour output in BBCode
  (https://gitlab.com/saalen/highlight/issues/134)
- fixed corner case in sh.lang
- fixed syntax tests with UTF-8 input
  (https://gitlab.com/saalen/highlight/issues/123)
- added support for Bash in outhtml_codefold.lua plug-in
- added ballerina.lang
- added block strings to java.lang
- added author hints in themes and language definitions
- added C++20 reserved words in c.lang
- added editorconfig file and validated all files accordingly (thanks to
  Tristano Ajmone)
- CLI: fixed `--list-scripts` with `-d` or HIGHLIGHT_DATADIR env variable
  (https://gitlab.com/saalen/highlight/issues/139)
- GUI W32: replaced multibyte path trace window by startup hint if
  NtfsDisable8dot3NameCreation is set
- GUI: removed AsciiDoc instruction lines from the README popup window

$NetBSD: patch-src_makefile,v 1.8 2019/12/18 01:34:34 schmonz Exp $

Use pkgsrc-specified compiler and flags.

--- src/makefile.orig	2019-11-11 16:57:10.000000000 +0000
+++ src/makefile
@@ -8,18 +8,18 @@
 # See ../makefile for the definition of ${data_dir}
 
 # Add -DHL_CONFIG_DIR=\"/your/path/\" to define the configuration directory
-# (default: /etc/highlight)
+# (default: /etc/pkg/highlight)
 
 # See src/gui-qt/highlight.pro for the Qt GUI compilation options
 
 #CXX=clang++
-CXX=g++
+#CXX=g++
 
 # was: qmake-qt5
 QMAKE=qmake
 
 # Added -std=c++11 because of auto_ptr to unique_ptr transition
-CFLAGS:=-Wall -O2 ${CFLAGS} -DNDEBUG -std=c++11 -D_FILE_OFFSET_BITS=64
+#CFLAGS:=-Wall -O2 ${CFLAGS} -DNDEBUG -std=c++11 -D_FILE_OFFSET_BITS=64
 
 #CFLAGS:= -fPIC -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection
 
@@ -57,27 +57,30 @@ REGEX_DIR=${CORE_DIR}re/
 DILU_DIR=${CORE_DIR}Diluculum/
 
 ifndef HL_CONFIG_DIR
-	HL_CONFIG_DIR = /etc/highlight/
+	HL_CONFIG_DIR = /etc/pkg/highlight/
 endif
 ifndef HL_DATA_DIR
-	HL_DATA_DIR = /usr/share/highlight/
+	HL_DATA_DIR = /opt/.pkg-20151023/share/highlight/
 endif
 ifndef HL_DOC_DIR
-	HL_DOC_DIR = /usr/share/doc/highlight/
+	HL_DOC_DIR = /opt/.pkg-20151023/share/doc/highlight/
 endif
 
 ifdef PIC
 	CFLAGS+=-fPIC
 endif
 
-LDFLAGS = -ldl
+#LDFLAGS = -ldl
 # Do not strip by default (Mac OS X lazy pointer issues)
 # Add -static to avoid linking with shared libs (can cause trouble when highlight
 # is run as service)
 #LDFLAGS = ${LDFLAGS} -s
 #LDFLAGS= -Wl,--as-needed
 
-CXX_COMPILE=${CXX} ${CFLAGS} -c -I ${INCLUDE_DIR} ${LUA_CFLAGS}
+LSO_VERSION=$(shell echo ${SO_VERSION} | awk -F. '{ printf "%d:%d:0\n", $$1 - 1, $$2 }')
+LIBTOOL=libtool --tag=CXX
+
+CXX_COMPILE=${LIBTOOL} --mode=compile ${CXX} ${CFLAGS} ${CXX_DIR} -I ${INCLUDE_DIR} ${LUA_CFLAGS} -c
 
 # Data directories (data dir, configuration file dir)
 CXX_DIR=-DHL_DATA_DIR=\"${HL_DATA_DIR}\" -DHL_CONFIG_DIR=\"${HL_CONFIG_DIR}\"
@@ -105,18 +108,18 @@ GUI_OBJECTS:=${GUI_QT_DIR}main.cpp ${GUI
 	${GUI_QT_DIR}showtextfile.cpp
 
 
-cli: libhighlight.a ${CLI_OBJECTS}
-	${CXX} ${LDFLAGS} -o highlight ${CLI_OBJECTS} -L. -lhighlight ${LUA_LIBS}
+cli: ${CLI_OBJECTS}
+	${CXX} ${LDFLAGS} -o highlight ${CLI_OBJECTS} -lhighlight ${LUA_LIBS}
 
 lib-static libhighlight.a: ${CORE_OBJECTS}
 	${AR} ${ARFLAGS} libhighlight.a ${CORE_OBJECTS} ${DILU_OBJECTS}
 
 lib-shared libhighlight.so.1.0: ${CORE_OBJECTS}
-	${CXX} -shared -Wl,-soname,libhighlight.so.${SO_VERSION} -o libhighlight.so.${SO_VERSION} -lc ${CORE_OBJECTS}
+	${LIBTOOL} --mode=link ${CXX} ${LDFLAGS} -o libhighlight.la ${CORE_OBJECTS:%.o=%.lo} ${DILU_OBJECTS:%.o=%.lo} -version-info ${LSO_VERSION} -rpath ${PREFIX}/lib
 
 gui-qt: highlight-gui
 
-highlight-gui: libhighlight.a ${GUI_OBJECTS}
+highlight-gui: ${GUI_OBJECTS}
 	cd gui-qt && \
 	${QMAKE} 'DEFINES+=DATA_DIR=\\\"${HL_DATA_DIR}\\\" CONFIG_DIR=\\\"${HL_CONFIG_DIR}\\\" DOC_DIR=\\\"${HL_DOC_DIR}\\\" ' && \
 	$(MAKE)
@@ -125,7 +128,7 @@ $(OBJECTFILES) : makefile
 
 
 datadir.o: ${CORE_DIR}datadir.cpp ${INCLUDE_DIR}datadir.h ${INCLUDE_DIR}platform_fs.h
-	${CXX_COMPILE} ${CORE_DIR}datadir.cpp ${CXX_DIR}
+	${CXX_COMPILE} ${CORE_DIR}datadir.cpp
 
 platform_fs.o: ${CORE_DIR}platform_fs.cpp ${INCLUDE_DIR}platform_fs.h
 	${CXX_COMPILE} ${CORE_DIR}platform_fs.cpp
@@ -206,7 +209,7 @@ main.o: ${CLI_DIR}main.cpp ${CLI_DIR}mai
 	${INCLUDE_DIR}syntaxreader.h ${INCLUDE_DIR}themereader.h ${INCLUDE_DIR}elementstyle.h \
 	${INCLUDE_DIR}stylecolour.h  ${INCLUDE_DIR}preformatter.h \
 	${CLI_DIR}help.h ${INCLUDE_DIR}version.h
-	${CXX_COMPILE} ${CLI_DIR}main.cpp ${CXX_DIR}
+	${CXX_COMPILE} ${CLI_DIR}main.cpp
 
 
 #3rd party libs