update erlang-esdl to 1.3.1

This is required for updating and unbreaking graphics/wings,
erlang-esdl's only consumer. (The current port's version is 1.0.1 is
10 years old, 1.3.1 is only 6 years old, and the whole thing has been
declared "legacy", but wings still requires it, so here we go). The
upstream maintainer has switched the build system from Makefiles to
rebar (rebar 2, rebar3 doesn't cut it) and made the former optional
dependencies on SDL-image and SDL-ttf mandatory.

esdl's former home at SourceForge has disappeared, the most current
version (even if it's not really current) is now available at Github,
WWW has been updated to reflect that change.

PR:		239173
Approved by:	maintainer-timeout (erlang@)
This commit is contained in:
Christoph Moench-Tegeder 2019-07-28 22:21:24 +00:00
parent 521db896ee
commit 7ddbc242d1
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=507539
8 changed files with 29 additions and 205 deletions

View file

@ -1,13 +1,10 @@
# $FreeBSD$
PORTNAME= esdl
PORTVERSION= 1.0.1
PORTREVISION= 13
DISTVERSIONPREFIX= esdl-
DISTVERSION= 1.3.1
CATEGORIES= devel
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}
PKGNAMEPREFIX= erlang-
DISTNAME= ${PORTNAME}-${PORTVERSION}.src
DIST_SUBDIR= erlang
MAINTAINER= erlang@FreeBSD.org
COMMENT= Library for accessing SDL and OpenGL through Erlang
@ -18,31 +15,17 @@ LICENSE_FILE= ${WRKSRC}/license.terms
BUILD_DEPENDS= erl:lang/erlang
RUN_DEPENDS:= ${BUILD_DEPENDS}
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
USES= erlang:rebar gl sdl
USE_GITHUB= yes
GH_ACCOUNT= dgud
USES= dos2unix gmake
DOS2UNIX_GLOB= Makefile
USE_GL= gl glu
USE_SDL= sdl
ALL_TARGET= target
USE_SDL= sdl image ttf
PLIST_SUB= VERSION="${PORTVERSION}"
OPTIONS_DEFINE= SDL_TTF SDL_IMAGE
OPTIONS_DEFAULT=SDL_TTF SDL_IMAGE
OPTIONS_SUB= yes
SDL_TTF_DESC= SDL_ttf support
SDL_TTF_USE= SDL=ttf
SDL_IMAGE_DESC= SDL_image support
SDL_IMAGE_USE= SDL=image
post-patch:
@${REINPLACE_CMD} -Ee 's|addons|lib|' ${WRKSRC}/Makefile
post-patch-SDL_TTF-on:
@${REINPLACE_CMD} -e '/ENABLE_SDL_TTF = / s|no|yes|' ${WRKSRC}/Makefile
post-patch-SDL_IMAGE-on:
@${REINPLACE_CMD} -e '/ENABLE_SDL_IMAGE = / s|no|yes|' ${WRKSRC}/Makefile
@${REINPLACE_CMD} "s/\(vsn,\) git/\1 \"${DISTVERSION}\"/" "${WRKSRC}/src/sdl.app.src"
post-install:
@${LN} -sf ${PORTNAME}-${PORTVERSION} ${STAGEDIR}${PREFIX}/lib/erlang/lib/${PORTNAME}

View file

@ -1,2 +1,3 @@
SHA256 (erlang/esdl-1.0.1.src.tar.gz) = 16fcf29656e6a54c9e10d0a73faa3e5b305c6aab3ab691cad2206c427265877d
SIZE (erlang/esdl-1.0.1.src.tar.gz) = 428917
TIMESTAMP = 1562963418
SHA256 (dgud-esdl-esdl-1.3.1_GH0.tar.gz) = 54723f487c384f04de404309454825361fa6eac8cb3c62bfadc2a559dfa928b4
SIZE (dgud-esdl-esdl-1.3.1_GH0.tar.gz) = 323534

View file

@ -1,14 +0,0 @@
--- Makefile.orig
+++ Makefile
@@ -51,9 +51,9 @@
ERL_DIR := $(shell erl -noshell -eval "io:format([126,115,126,110],[code:root_dir()])" -s erlang halt)
ifeq ($(INSTALL_DIR), )
-INSTALLDIR = $(ERL_DIR)/addons/$(ESDL_VSN)
+INSTALLDIR = $(DESTDIR)$(ERL_DIR)/addons/$(ESDL_VSN)
else
-INSTALLDIR = $(INSTALL_DIR)/$(ESDL_VSN)
+INSTALLDIR = $(DESTDIR)$(INSTALL_DIR)/$(ESDL_VSN)
endif
## I assume that make install are only made on unixes... :-)

View file

@ -1,51 +0,0 @@
--- c_src/Makefile.orig 2009-05-20 22:34:48.000000000 +0400
+++ c_src/Makefile 2009-06-02 06:19:34.000000000 +0400
@@ -11,7 +11,7 @@
include ../win32_conf/mingw_vars.mk
else
- OGLDIR = /usr
+ OGLDIR = ${LOCALBASE}
# Uncomment these if your opengl header is located in another directory than
# the usual $(OGLDIR)/include/GL/gl.h
@@ -21,8 +21,8 @@
GL_LIBS = -L$(OGLDIR)/lib -lGL -lGLU
GL_INCS = -I$(OGLDIR)/include/$(GL_INCLUDE_DIR)
- SDL_LIBS = $(shell sdl-config --libs)
- SDL_INCS = $(shell sdl-config --cflags)
+ SDL_LIBS = $(shell $(SDL_CONFIG) --libs)
+ SDL_INCS = $(shell $(SDL_CONFIG) --cflags)
ifeq ($(ENABLE_SDL_TTF), yes)
SDL_TTF_LIBS = -lSDL_ttf
@@ -43,10 +43,8 @@
INCS = $(GL_INCS) $(SDL_INCS) $(SDL_TTF_INCS) \
$(SDL_IMAGE_INCS) $(ERL_INCS)
- CFLAGS = -g -O2 -funroll-loops -Wall -ffast-math -fpic \
- -fomit-frame-pointer $(USE_GL_INCLUDE_DIR) -DSHM \
- $(USE_SDL_TTF) $(USE_SDL_IMAGE) \
- -DPTHREADS $(INCS)
+ CFLAGS += -O2 -funroll-loops -Wall -ffast-math -fpic -fomit-frame-pointer \
+ $(USE_GL_INCLUDE_DIR) -DSHM $(USE_SDL_TTF) $(USE_SDL_IMAGE) -DPTHREADS $(INCS)
CLINKFLAGS = -fpic -shared
@@ -56,13 +54,13 @@
ERL_DIR := $(shell erl -noshell -eval "io:format([126,115,126,110],[code:root_dir()])" -s erlang halt)
ERL_INCS = -I$(ERL_DIR)/usr/include
- CC = gcc
+ CC ?= gcc
endif
TARGETDIR = ../priv
-GCC_O = $(CC) -c $(CFLAGS) $<
+GCC_O = $(CC) -c $(CFLAGS) $(INCS) $(ERLINC) $<
# Files

View file

@ -1,51 +0,0 @@
--- c_src/esdl_driver.c.orig
+++ c_src/esdl_driver.c
@@ -34,11 +34,16 @@
#define TEMP_BINARY_SIZE 512
+#if ERL_DRV_EXTENDED_MAJOR_VERSION < 2
+typedef int ErlDrvSizeT;
+typedef int ErlDrvSSizeT;
+#endif
+
static ErlDrvData sdl_driver_start(ErlDrvPort port, char *buff);
static void sdl_driver_stop(ErlDrvData handle);
static void sdl_driver_finish(void);
-static int sdl_driver_control(ErlDrvData handle, unsigned int command,
- char* buf, int count, char** res, int res_size);
+static ErlDrvSSizeT sdl_driver_control(ErlDrvData handle, unsigned int command,
+ char* buf, ErlDrvSizeT count, char** res, ErlDrvSizeT res_size);
static void standard_outputv(ErlDrvData drv_data, ErlIOVec *ev);
/*
@@ -59,6 +64,17 @@
sdl_driver_control, /* F_PTR control, port_control callback */
NULL, /* F_PTR timeout, reserved */
standard_outputv, /* F_PTR outputv, reserved */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ ERL_DRV_EXTENDED_MARKER,
+ ERL_DRV_EXTENDED_MAJOR_VERSION,
+ ERL_DRV_EXTENDED_MINOR_VERSION,
+ 0,
+ NULL,
+ NULL,
+ NULL
};
DRIVER_INIT(sdl_driver)
@@ -148,9 +164,9 @@
{
}
-static int
+static ErlDrvSSizeT
sdl_driver_control(ErlDrvData handle, unsigned op,
- char* buf, int count, char** res, int res_size)
+ char* buf, ErlDrvSizeT count, char** res, ErlDrvSizeT res_size)
{
sdl_data* sd = (sdl_data *) handle;
sdl_fun func;

View file

@ -0,0 +1,12 @@
--- rebar.config.orig 2019-07-12 20:04:39 UTC
+++ rebar.config
@@ -11,6 +11,9 @@
{"darwin", "CFLAGS", "$CFLAGS -ObjC -D_OSX_COCOA -I/opt/X11/include"},
{"darwin", "LDFLAGS", "$LDFLAGS -framework SDL -rpath @executable_path/../Frameworks"},
+ {"freebsd", "CFLAGS", "$CFLAGS $SDL_CFLAGS"},
+ {"freebsd", "LDFLAGS", "$LDFLAGS $SDL_LIBDIR"},
+
{"win32", "CFLAGS", "$CFLAGS -DWIN32 -D_WIN32 -D__WIN32__ $SDL_INCDIR"},
{"win32", "DRV_CFLAGS", "/Zi /W3 $ERL_CFLAGS"},
{"win32", "ERL_LDFLAGS", " /debug /LIBPATH:$SDL_LIBDIR SDL.lib user32.lib"}

View file

@ -1,3 +1,3 @@
Esdl is library for accessing SDL and OpenGL through Erlang.
WWW: http://esdl.sourceforge.net/
WWW: https://github.com/dgud/esdl

View file

@ -1,65 +1,16 @@
lib/erlang/lib/esdl-%%VERSION%%/Readme
lib/erlang/lib/esdl-%%VERSION%%/Readme.MacOSX-Cocoa
lib/erlang/lib/esdl-%%VERSION%%/Readme.win32
lib/erlang/lib/esdl-%%VERSION%%/c_src/CPS.h
lib/erlang/lib/esdl-%%VERSION%%/c_src/SDLMain.h
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl.h
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_audio.c
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_audio.h
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_conv.h
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_driver.c
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_events.c
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_events.h
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_gen.c
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_gl.c
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_gl.h
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_gl_fp.h
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_glext.c
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_glext.h
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_glext_fp.h
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_glu.c
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_glu.h
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_glu_fp.h
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_sdl_fp.h
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_spec.c
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_util.c
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_ttf.h
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_ttf.c
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_img.h
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_img.c
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_util.h
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_video.c
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_video.h
lib/erlang/lib/esdl-%%VERSION%%/c_src/esdl_wrapper.c
lib/erlang/lib/esdl-%%VERSION%%/doc/gl.html
lib/erlang/lib/esdl-%%VERSION%%/doc/glu.html
lib/erlang/lib/esdl-%%VERSION%%/doc/index.html
lib/erlang/lib/esdl-%%VERSION%%/doc/sdl.html
lib/erlang/lib/esdl-%%VERSION%%/doc/sdl_active.html
lib/erlang/lib/esdl-%%VERSION%%/doc/sdl_audio.html
lib/erlang/lib/esdl-%%VERSION%%/doc/sdl_events.html
lib/erlang/lib/esdl-%%VERSION%%/doc/sdl_img.html
lib/erlang/lib/esdl-%%VERSION%%/doc/sdl_joystick.html
lib/erlang/lib/esdl-%%VERSION%%/doc/sdl_keyboard.html
lib/erlang/lib/esdl-%%VERSION%%/doc/sdl_mouse.html
lib/erlang/lib/esdl-%%VERSION%%/doc/sdl_ttf.html
lib/erlang/lib/esdl-%%VERSION%%/doc/sdl_util.html
lib/erlang/lib/esdl-%%VERSION%%/doc/sdl_video.html
lib/erlang/lib/esdl-%%VERSION%%/ebin/gl.beam
lib/erlang/lib/esdl-%%VERSION%%/ebin/glu.beam
lib/erlang/lib/esdl
lib/erlang/lib/esdl-%%VERSION%%/ebin/sdl.app
lib/erlang/lib/esdl-%%VERSION%%/ebin/sdl.beam
lib/erlang/lib/esdl-%%VERSION%%/ebin/sdl_active.beam
lib/erlang/lib/esdl-%%VERSION%%/ebin/sdl_audio.beam
lib/erlang/lib/esdl-%%VERSION%%/ebin/sdl_events.beam
%%SDL_IMAGE%%lib/erlang/lib/esdl-%%VERSION%%/ebin/sdl_img.beam
lib/erlang/lib/esdl-%%VERSION%%/ebin/sdl_img.beam
lib/erlang/lib/esdl-%%VERSION%%/ebin/sdl_joystick.beam
lib/erlang/lib/esdl-%%VERSION%%/ebin/sdl_keyboard.beam
lib/erlang/lib/esdl-%%VERSION%%/ebin/sdl_mouse.beam
%%SDL_TTF%%lib/erlang/lib/esdl-%%VERSION%%/ebin/sdl_ttf.beam
lib/erlang/lib/esdl-%%VERSION%%/ebin/sdl_ttf.beam
lib/erlang/lib/esdl-%%VERSION%%/ebin/sdl_util.beam
lib/erlang/lib/esdl-%%VERSION%%/ebin/sdl_video.beam
lib/erlang/lib/esdl-%%VERSION%%/include/gl.hrl
lib/erlang/lib/esdl-%%VERSION%%/include/glu.hrl
lib/erlang/lib/esdl-%%VERSION%%/include/sdl.hrl
lib/erlang/lib/esdl-%%VERSION%%/include/sdl_active.hrl
lib/erlang/lib/esdl-%%VERSION%%/include/sdl_audio.hrl
@ -69,14 +20,9 @@ lib/erlang/lib/esdl-%%VERSION%%/include/sdl_keyboard.hrl
lib/erlang/lib/esdl-%%VERSION%%/include/sdl_mouse.hrl
lib/erlang/lib/esdl-%%VERSION%%/include/sdl_ttf.hrl
lib/erlang/lib/esdl-%%VERSION%%/include/sdl_video.hrl
lib/erlang/lib/esdl-%%VERSION%%/license.terms
lib/erlang/lib/esdl-%%VERSION%%/priv/sdl_driver.so
lib/erlang/lib/esdl-%%VERSION%%/src/esdl.hrl
lib/erlang/lib/esdl-%%VERSION%%/src/gl.erl
lib/erlang/lib/esdl-%%VERSION%%/src/gl_funcs.hrl
lib/erlang/lib/esdl-%%VERSION%%/src/glext_funcs.hrl
lib/erlang/lib/esdl-%%VERSION%%/src/glu.erl
lib/erlang/lib/esdl-%%VERSION%%/src/glu_funcs.hrl
lib/erlang/lib/esdl-%%VERSION%%/src/sdl.app.src
lib/erlang/lib/esdl-%%VERSION%%/src/sdl.erl
lib/erlang/lib/esdl-%%VERSION%%/src/sdl_active.erl
lib/erlang/lib/esdl-%%VERSION%%/src/sdl_audio.erl
@ -92,5 +38,3 @@ lib/erlang/lib/esdl-%%VERSION%%/src/sdl_util.erl
lib/erlang/lib/esdl-%%VERSION%%/src/sdl_util.hrl
lib/erlang/lib/esdl-%%VERSION%%/src/sdl_video.erl
lib/erlang/lib/esdl-%%VERSION%%/src/sdl_video_funcs.hrl
lib/erlang/lib/esdl-%%VERSION%%/vsn.mk
lib/erlang/lib/esdl