Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Jan 2021 13:25:32 +0000 (UTC)
From:      Emanuel Haupt <ehaupt@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r561916 - in head/audio/klystrack: . files
Message-ID:  <202101181325.10IDPW07016887@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ehaupt
Date: Mon Jan 18 13:25:32 2021
New Revision: 561916
URL: https://svnweb.freebsd.org/changeset/ports/561916

Log:
  - Remove unnecessary modifications that only affect building on windows
  - Make sure CFLAGS is passed to all sub-Makefiles
  - Remove overoptimization
  - Use portclippy/portfmt

Added:
  head/audio/klystrack/files/patch-klystron_common.mk   (contents, props changed)
Deleted:
  head/audio/klystrack/files/patch-klystron_tools_editor_Makefile
  head/audio/klystrack/files/patch-player_Makefile
  head/audio/klystrack/files/patch-scancode-tool_Makefile
Modified:
  head/audio/klystrack/Makefile
  head/audio/klystrack/files/patch-Makefile
  head/audio/klystrack/files/patch-klystron_Makefile
  head/audio/klystrack/files/patch-klystron_tools_makebundle_Makefile

Modified: head/audio/klystrack/Makefile
==============================================================================
--- head/audio/klystrack/Makefile	Mon Jan 18 13:19:06 2021	(r561915)
+++ head/audio/klystrack/Makefile	Mon Jan 18 13:25:32 2021	(r561916)
@@ -4,6 +4,7 @@
 PORTNAME=	klystrack
 DISTVERSION=	1.7.6-make-fix-12
 DISTVERSIONSUFFIX=	-gfe6e746
+PORTREVISION=	1
 CATEGORIES=	audio
 
 MAINTAINER=	ehaupt@FreeBSD.org
@@ -14,19 +15,23 @@ LICENSE_FILE=	${WRKSRC}/LICENSE
 
 LIB_DEPENDS=	libasound.so:audio/alsa-lib
 
-USES=		compiler:c11 desktop-file-utils dos2unix gmake localbase:ldconfig \
-		sdl
-DOS2UNIX_FILES=	klystron/Makefile klystron/tools/editor/Makefile \
+USES=		compiler:c11 desktop-file-utils dos2unix gmake \
+		localbase:ldconfig sdl
+DOS2UNIX_FILES=	klystron/common.mk klystron/Makefile klystron/src/gui/menu.h \
+		klystron/tools/editor/Makefile \
 		klystron/tools/makebundle/Makefile Makefile player/Makefile \
-		scancode-tool/Makefile klystron/src/gui/menu.h
+		scancode-tool/Makefile
 USE_CSTD=	c99
 USE_GITHUB=	yes
 GH_ACCOUNT=	kometbomb
 GH_TUPLE=	kometbomb:klystron:1074324:klystron/klystron
 USE_SDL=	gfx2 image2 mixer2 sdl2 ttf2
 
-MAKE_ENV+=	V=1
+MAKE_ENV+=	CFG=release \
+		V=1
 ALL_TARGET=	build
+
+CFLAGS+=	-fPIC
 
 OPTIONS_DEFINE=	EXAMPLES
 

Modified: head/audio/klystrack/files/patch-Makefile
==============================================================================
--- head/audio/klystrack/files/patch-Makefile	Mon Jan 18 13:19:06 2021	(r561915)
+++ head/audio/klystrack/files/patch-Makefile	Mon Jan 18 13:25:32 2021	(r561916)
@@ -1,16 +1,15 @@
---- Makefile.orig	2021-01-08 17:05:12 UTC
+--- Makefile.orig	2021-01-18 12:13:12 UTC
 +++ Makefile
-@@ -1,7 +1,8 @@
-+MAKE ?= make
+@@ -1,7 +1,7 @@
  TARGET := klystrack
  KLYSTRON=klystron
  ECHO := echo
 -CFG := debug
-+CFG := release
++CFG ?= debug
  EXE := bin.$(CFG)/$(TARGET)
  MACHINE :=
  NSIS := C:/program\ files\ \(x86\)/nsis/makensis.exe -V2 -NOCD
-@@ -10,7 +11,7 @@ MAKEBUNDLE := $(KLYSTRON)/tools/bin/makebundle.exe
+@@ -10,7 +10,7 @@ MAKEBUNDLE := $(KLYSTRON)/tools/bin/makebundle.exe
  UPLOAD := cmd.exe /c upload.bat
  DLLS := zip/data/SDL2_image.dll zip/data/SDL2.dll
  EXT := .c
@@ -19,12 +18,17 @@
  CDEP := $(CC) -E -MM
  ARCHIVE := klystrack
  INSTALLER := klystrack.exe
-@@ -69,10 +70,10 @@ ifeq ($(CFG),debug)
-  CFLAGS += -g -Wall -DDEBUG -fno-inline
- else
-  ifeq ($(CFG),profile)
--  CFLAGS += -O3 -pg -Wall
-+  CFLAGS += -pg -Wall
+@@ -21,7 +21,7 @@ REV := cp -f
+ 
+ PREFIX ?= /usr
+ BINDIR = $(PREFIX)/bin
+-CFLAGS := $(MACHINE) -ftree-vectorize -std=gnu99 -Wno-strict-aliasing
++CFLAGS ?= $(MACHINE) -ftree-vectorize -std=gnu99 -Wno-strict-aliasing
+ 
+ ifdef COMSPEC
+ 	# Compiling for Windows
+@@ -72,7 +72,7 @@ else
+   CFLAGS += -O3 -pg -Wall
   else
    ifeq ($(CFG),release)
 -   CFLAGS += -O3 -Wall -s
@@ -32,48 +36,14 @@
     ifdef COMSPEC
  	 CFLAGS += -mwindows
     endif
-@@ -136,8 +137,8 @@ endef
+@@ -136,8 +136,8 @@ endef
  
  build: Makefile src/version.h src/version_number.h
  	$(Q)touch src/version
 -	$(Q)$(MAKE) -C $(KLYSTRON) CFG=$(CFG) EXTFLAGS="$(EXTFLAGS)"
 -	$(Q)$(MAKE) all CFG=$(CFG) EXTFLAGS="$(EXTFLAGS)"
-+	$(Q)$(MAKE_ENV) $(MAKE) -C $(KLYSTRON) CFG=$(CFG) EXTFLAGS="$(EXTFLAGS)"
-+	$(Q)$(MAKE_ENV) $(MAKE) all CFG=$(CFG) EXTFLAGS="$(EXTFLAGS)"
++	$(Q)$(MAKE_ENV)$(MAKE) -C $(KLYSTRON) CFG=$(CFG) EXTFLAGS="$(EXTFLAGS)"
++	$(Q)$(MAKE_ENV)$(MAKE) all CFG=$(CFG) EXTFLAGS="$(EXTFLAGS)"
  
  src/version.h: src/version
  	$(Q)echo '#ifndef VERSION_H' > ./src/version.h
-@@ -173,8 +174,8 @@ endif
- all: $(EXE) $(THEMES)
- 
- zip: doc/* $(THEMES) $(DLLS) examples/instruments/* examples/songs/* $(DLLS)
--	$(Q)$(MAKE) -C $(KLYSTRON) CFG=release EXTFLAGS="$(EXTFLAGS)"
--	$(Q)$(MAKE) build CFG=release
-+	$(Q)$(MAKE_ENV) $(MAKE) -C $(KLYSTRON) CFG=release EXTFLAGS="$(EXTFLAGS)"
-+	$(Q)$(MAKE_ENV) $(MAKE) build CFG=release
- 	$(Q)mkdir -p zip/data/res
- 	$(Q)mkdir -p zip/data/examples/songs
- 	$(Q)mkdir -p zip/data/examples/songs/n00bstar-examples
-@@ -221,18 +222,18 @@ release: bin.release/$(TARGET)
- 	@$(ECHO) "Building release -->"
- 
- $(DESTDIR)$(BINDIR)/$(TARGET): $(EXE)
--	install -D -m 755 $< $@
-+	install -s -m 755 $< $@
- 
- $(DESTDIR)$(RES_PATH)/res/%: res/%
--	install -D -m 644 $< $@
-+	install -m 644 $< $@
- 
- $(DESTDIR)$(RES_PATH)/key/%: key/%
--	install -D -m 644 $< $@
-+	install -m 644 $< $@
- 
- install: $(EXE:bin.$(CFG)/%=$(DESTDIR)$(BINDIR)/%) $(RESOURCES:res/%=$(DESTDIR)$(RES_PATH)/res/%) $(KEYS:key/%=$(DESTDIR)$(RES_PATH)/key/%)
- 
- #bin.release/$(TARGET):
--#	$(Q)make CFG=release
-+#	$(Q)$(MAKE) CFG=release
- 
- ifneq ($(MAKECMDGOALS),clean)
- -include $(DEPS)

Modified: head/audio/klystrack/files/patch-klystron_Makefile
==============================================================================
--- head/audio/klystrack/files/patch-klystron_Makefile	Mon Jan 18 13:19:06 2021	(r561915)
+++ head/audio/klystrack/files/patch-klystron_Makefile	Mon Jan 18 13:25:32 2021	(r561916)
@@ -1,42 +1,42 @@
---- klystron/Makefile.orig	2021-01-08 20:34:24 UTC
+--- klystron/Makefile.orig	2021-01-18 12:22:06 UTC
 +++ klystron/Makefile
-@@ -1,7 +1,8 @@
-+MAKE ?= make
+@@ -1,9 +1,10 @@
  TARGET=engine
  VPATH=src:src
  ECHO = echo
 -CFG = debug
-+CFG = release
++CFG ?= debug
  REV = cp -f
  MACHINE =
++CC ?= gcc
  
-@@ -27,9 +28,10 @@ lib_SRC = $(notdir ${wildcard src/lib/*.c})
+ include common.mk
+ 
+@@ -27,8 +28,8 @@ lib_SRC = $(notdir ${wildcard src/lib/*.c})
  lib_DEP = $(patsubst %.c, deps/lib_$(CFG)_%.d, ${lib_SRC})
  lib_OBJ = $(patsubst %.c, objs.$(CFG)/lib_%.o, ${lib_SRC})
  
 -CC = gcc -shared -std=gnu99 -Wno-strict-aliasing
 -CDEP = gcc -E -std=gnu99
-+CC ?= gcc
++CC := $(CC) -std=gnu99 -Wno-strict-aliasing
++CDEP := $(CC) -E -std=gnu99
  
-+CDEP = $(CC) -shared -E -std=gnu99
-+
  ifndef CFLAGS
  CFLAGS = $(MACHINE) -ftree-vectorize
- endif
-@@ -41,10 +43,10 @@ ifeq ($(CFG),debug)
- 	CFLAGS += -O3 -g -Wall ${INCLUDEFLAGS} -DDEBUG -fno-inline
- else
- 	ifeq ($(CFG),profile)
--		CFLAGS += -O3 -pg -Wall ${INCLUDEFLAGS}
-+		CFLAGS += -pg -Wall ${INCLUDEFLAGS}
+@@ -44,10 +45,10 @@ else
+ 		CFLAGS += -O3 -pg -Wall ${INCLUDEFLAGS}
  	else
  		ifeq ($(CFG),release)
 -			CFLAGS += -O3 -Wall ${INCLUDEFLAGS} -s
 +			CFLAGS += -Wall ${INCLUDEFLAGS}
  		else
  			ifeq ($(CFG),size)
- 				CFLAGS += -Os -Wall ${INCLUDEFLAGS} -s -ffast-math -fomit-frame-pointer -DREDUCESIZE
-@@ -73,7 +75,7 @@ build: Makefile
+-				CFLAGS += -Os -Wall ${INCLUDEFLAGS} -s -ffast-math -fomit-frame-pointer -DREDUCESIZE
++				CFLAGS += -Os -Wall ${INCLUDEFLAGS} -ffast-math -fomit-frame-pointer -DREDUCESIZE
+ 			else
+ 				@$(ECHO) "Invalid configuration "$(CFG)" specified."
+ 				@$(ECHO) "You must specify a configuration when "
+@@ -73,7 +74,7 @@ build: Makefile
  	$(Q)echo '"' >> ./src/version.h
  	$(Q)echo '#define KLYSTRON_VERSION_STRING "klystron " KLYSTRON_REVISION' >> ./src/version.h
  	$(Q)echo '#endif' >> ./src/version.h
@@ -45,12 +45,21 @@
  
  all: bin.$(CFG)/lib${TARGET}_snd.a bin.$(CFG)/lib${TARGET}_gfx.a bin.$(CFG)/lib${TARGET}_util.a bin.$(CFG)/lib${TARGET}_gui.a tools
  
-@@ -208,10 +210,10 @@ ifneq ($(MAKECMDGOALS),clean)
+@@ -121,7 +122,7 @@ endif
+ bin.$(CFG)/ksnd.dll: objs.$(CFG)/lib_ksnd.o ${snd_OBJ} src/lib/ksnd.def | inform
+ 	$(MSG) "Linking ksnd.dll..."
+ 	$(Q)mkdir -p bin.$(CFG)
+-	$(Q)$(CC) -shared -o $@ objs.$(CFG)/lib_ksnd.o src/lib/ksnd.def ${snd_OBJ} $(CFLAGS) $(INCLUDEFLAGS) -DDLLEXPORT -Wl,--out-implib,bin.$(CFG)/libksnd.a
++	$(Q)$(CC) -o $@ objs.$(CFG)/lib_ksnd.o src/lib/ksnd.def ${snd_OBJ} $(CFLAGS) $(INCLUDEFLAGS) -DDLLEXPORT -Wl,--out-implib,bin.$(CFG)/libksnd.a
+ ifdef COMSPEC
+ 	$(MSG) "Building ksnd.lib..."
+ 	@-lib /DEF:src/lib/ksnd.def /OUT:bin.$(CFG)/ksnd.lib
+@@ -208,10 +209,10 @@ ifneq ($(MAKECMDGOALS),clean)
  endif
  
  tools/bin/makebundle.exe: tools/makebundle/*.c
 -	make -C tools/makebundle
-+	$(MAKE) -C tools/makebundle
++	$(MAKE_ENV) $(MAKE) -C tools/makebundle
  
  ifdef COMSPEC
  tools/bin/editor.exe: tools/editor/src/*

Added: head/audio/klystrack/files/patch-klystron_common.mk
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/klystrack/files/patch-klystron_common.mk	Mon Jan 18 13:25:32 2021	(r561916)
@@ -0,0 +1,8 @@
+--- klystron/common.mk.orig	2021-01-18 12:35:42 UTC
++++ klystron/common.mk
+@@ -1,3 +1,5 @@
++MAKE ?= make
++
+ # make it possible to do a verbose build by running `make V=1`
+ ifeq ($(V),1)
+ Q=

Modified: head/audio/klystrack/files/patch-klystron_tools_makebundle_Makefile
==============================================================================
--- head/audio/klystrack/files/patch-klystron_tools_makebundle_Makefile	Mon Jan 18 13:19:06 2021	(r561915)
+++ head/audio/klystrack/files/patch-klystron_tools_makebundle_Makefile	Mon Jan 18 13:25:32 2021	(r561916)
@@ -1,14 +1,15 @@
---- klystron/tools/makebundle/Makefile.orig	2021-01-08 17:05:12 UTC
+--- klystron/tools/makebundle/Makefile.orig	2021-01-18 11:01:30 UTC
 +++ klystron/tools/makebundle/Makefile
-@@ -1,3 +1,4 @@
-+CC ?= gcc
+@@ -1,4 +1,5 @@
  TARGET = ../bin/makebundle.exe
++CC ?= gcc
  
  ifdef COMSPEC
+ SDL = -I /mingw/include/sdl 
 @@ -8,4 +9,4 @@ endif
  
  $(TARGET): makebundle.c ../../src/util/bundle.h
  	@mkdir -p ../bin
 -	gcc -o $(TARGET) -D_XOPEN_SOURCE makebundle.c -std=c99 -I ../../src $(SDL) -Wall -O3
 \ No newline at end of file
-+	$(CC) -o $(TARGET) -D_XOPEN_SOURCE makebundle.c -std=c99 -I ../../src $(SDL) -Wall
++	$(CC) $(CFLAGS) -o $(TARGET) -D_XOPEN_SOURCE makebundle.c -std=c99 -I ../../src $(SDL) -Wall



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202101181325.10IDPW07016887>