fasttracker2: Fixes builds in Linux.

1. Should fix builds in Ubuntu / CentOS.

2. Rewrites the build system to use cmake.

3. Adds ALSA support in Linux.

4. Bumps PKGREVISION.

Thanks to nia@ for helping re-write the build system.
This commit is contained in:
fox 2019-08-07 23:44:32 +00:00
parent 1e8fdb26de
commit 60f0e8fb40
3 changed files with 33 additions and 11 deletions

View file

@ -1,8 +1,9 @@
# $NetBSD: Makefile,v 1.34 2019/08/05 16:57:36 fox Exp $
# $NetBSD: Makefile,v 1.35 2019/08/07 23:44:32 fox Exp $
DISTNAME= ft2clone-${DISTVERSION}-code
PKGNAME= fasttracker2-${DISTVERSION:C/b/2./}
DISTVERSION= b164
PKGREVISION= 1
CATEGORIES= audio
MASTER_SITES= https://16-bits.org/ \
${MASTER_SITE_FREEBSD_LOCAL:=ehaupt/}
@ -14,30 +15,32 @@ COMMENT= Portable Fasttracker II clone in C using SDL 2
LICENSE= modified-bsd AND cc-by-nc-sa-v4.0-license
WRKSRC= ${WRKDIR}/ft2-clone-code
USE_LANGUAGES= c c++
USE_LANGUAGES= c99 c++
LDFLAGS+= -lSDL2 -lpthread -lstdc++ -lm
LDFLAGS.SunOS+= -liconv
USE_CMAKE= yes
LIBS.SunOS+= -liconv
INSTALLATION_DIRS+= bin share/pixmaps
SUBST_CLASSES+= d2u
SUBST_MESSAGE.d2u= Converting CRLF to LF.
SUBST_STAGE.d2u= post-extract
SUBST_FILES.d2u= src/*.[ch]
SUBST_FILES.d2u= CMakeLists.txt src/*.[ch]
SUBST_FILTER_CMD.d2u= ${TR} -d '\r'
do-build:
${CC} ${CFLAGS} ${LDFLAGS} \
${WRKSRC}/src/rtmidi/*.cpp ${WRKSRC}/src/gfxdata/*.c ${WRKSRC}/src/*.c \
-o ${WRKSRC}/release/other/ft2-clone
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/release/other/ft2-clone \
${DESTDIR}${PREFIX}/bin
${INSTALL_DATA} ${WRKSRC}/src/gfxdata/icon/ft2-clone.ico \
${DESTDIR}${PREFIX}/share/pixmaps
.include "../../mk/bsd.prefs.mk"
.if ${OPSYS} != "Linux"
BUILDLINK_TRANSFORM+= rm:-lasound
.else
. include "../../audio/alsa-lib/buildlink3.mk"
.endif
.include "../../converters/libiconv/buildlink3.mk"
.include "../../devel/SDL2/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

View file

@ -1,6 +1,7 @@
$NetBSD: distinfo,v 1.34 2019/08/05 16:57:36 fox Exp $
$NetBSD: distinfo,v 1.35 2019/08/07 23:44:32 fox Exp $
SHA1 (ft2clone-b164-code.zip) = d1faf35d4c34943869387563b5aa10acb40ac729
RMD160 (ft2clone-b164-code.zip) = f5a03267fae6c042f0b5769b3b6849d9d0835885
SHA512 (ft2clone-b164-code.zip) = a0bc0af3fdeb2ed3591f34c8c1072bf06c88fd8022cb2586c56db24f2eba024c9525ea30c03263ab126f2c1eace0b621d96481992c46ac68d1e506c5c125a8bf
Size (ft2clone-b164-code.zip) = 4523213 bytes
SHA1 (patch-CMakeLists.txt) = b64b4e4b9cd40e97c34d1541937b6c0b7f451093

View file

@ -0,0 +1,18 @@
$NetBSD: patch-CMakeLists.txt,v 1.1 2019/08/07 23:44:32 fox Exp $
Only define __LINUX_ALSA__ on Linux.
--- CMakeLists.txt.orig 2019-08-07 22:40:56.490008720 +0000
+++ CMakeLists.txt
@@ -20,7 +20,10 @@ target_include_directories(ft2-clone SYS
target_link_libraries(ft2-clone
PRIVATE m asound pthread ${SDL2_LIBRARIES})
-target_compile_definitions(ft2-clone PRIVATE __LINUX_ALSA__)
+
+if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ target_compile_definitions(ft2-clone PRIVATE __LINUX_ALSA__)
+endif()
install(TARGETS ft2-clone