freebsd-ports/editors/textadept/files/patch-src_Makefile
Alexey Dokuchaev 6a6a68433c - Remove the checks for prior existence of $(XDG_DATA_DIR) and
$(PIXMAPS_DIR): they do not serve any useful purpose and could
  break the build if those directories are missing for some reason
- When disabling wget(1), also change its name to make it obvious
  to the readers of the build log that is is not being executed

Reported by:	linimon
2020-09-04 02:06:26 +00:00

82 lines
2.7 KiB
Text

--- src/Makefile.orig 2020-08-01 05:21:40 UTC
+++ src/Makefile
@@ -1,10 +1,9 @@
# Copyright 2007-2020 Mitchell mitchell.att.foicica.com. See LICENSE.
-CC = gcc
-CFLAGS = -Os
-CXX = g++
-CXXFLAGS = -Os -std=c++11
-MAKE = make
+CC ?= gcc
+CFLAGS ?= -Os
+CXX ?= g++
+CXXFLAGS ?= -Os -std=c++11
ifeq (win, $(findstring win, $(MAKECMDGOALS)))
# Cross-compile for Win32.
CROSS = i686-w64-mingw32-
@@ -60,20 +59,21 @@ else ifeq (osx, $(findstring osx, $(MAKECMDGOALS)))
else
# Build for Linux/BSD.
LUA_CFLAGS = -DLUA_USE_LINUX
- LDFLAGS = -rdynamic -Wl,--retain-symbols-file -Wl,$(shell pwd)/lua.sym
+ # See PR https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220103
+ #LDFLAGS = -rdynamic -Wl,--retain-symbols-file -Wl,$(shell pwd)/lua.sym
ifeq (Linux, $(shell uname -s))
LDFLAGS += -ldl
else
- CC = cc
- CXX = c++
- LDFLAGS += -liconv
- MAKE = gmake
+ CC ?= cc
+ CXX ?= c++
+ # Correct spelling on FreeBSD is USES+=iconv :)
+ #LDFLAGS += -liconv
endif
PREFIX ?= /usr/local
bin_dir = $(PREFIX)/bin
data_dir = $(PREFIX)/share/textadept
XDG_DATA_DIR ?= $(PREFIX)/share/applications
- PIXMAPS_DIR ?= /usr/share/pixmaps
+ PIXMAPS_DIR ?= $(PREFIX)/share/pixmaps
desktop_files := $(wildcard *.desktop)
ifeq (, $(findstring curses, $(MAKECMDGOALS)))
plat_flag = -DGTK
@@ -101,7 +101,7 @@ else
endif
version = $(shell grep -m 1 _RELEASE ../core/init.lua | cut -d ' ' -f4- | \
tr ' ' '_' | tr -d "'")
-WGET = wget -O $@
+WGET = : wget-is-forbidden-during-build -O $@
# Scintilla.
@@ -236,20 +236,21 @@ textadept-curses.exe: $(sci_objs) $(sci_lex_objs) LexL
# Install/uninstall.
-install: $(install_targets) | ../core ../doc ../init.lua ../lexers ../LICENSE \
+install: $(install_targets) | ../core ../doc ../init.lua ../lexers \
../modules ../themes
install -d $(DESTDIR)$(bin_dir) $(DESTDIR)$(data_dir)
install $^ $(DESTDIR)$(data_dir)
cp -rL $| $(DESTDIR)$(data_dir)
- ln -s $(subst .., $(data_dir), $^) $(DESTDIR)$(bin_dir)
- if [ -d "$(XDG_DATA_DIR)" ]; then \
+ ln -s $(subst ..,..$(subst $(PREFIX),,$(data_dir)),$^) $(DESTDIR)$(bin_dir)
+ if : ; then \
install -d $(DESTDIR)$(XDG_DATA_DIR); \
install $(desktop_files) $(DESTDIR)$(XDG_DATA_DIR); \
fi
- if [ -d "$(PIXMAPS_DIR)" ]; then \
+ if : ; then \
install -d $(DESTDIR)$(PIXMAPS_DIR); \
- ln -s $(data_dir)/core/images/textadept.svg $(DESTDIR)$(PIXMAPS_DIR); \
- ln -s $(data_dir)/core/images/ta_48x48.png \
+ ln -s ../..$(subst $(PREFIX),,$(data_dir))/core/images/textadept.svg \
+ $(DESTDIR)$(PIXMAPS_DIR); \
+ ln -s ../..$(subst $(PREFIX),,$(data_dir))/core/images/ta_48x48.png \
$(DESTDIR)$(PIXMAPS_DIR)/textadept.png; \
fi
uninstall: