Skip to content
Permalink
Browse files

stfl: respect MacPorts settings

Postpone revbump until subsequent change.
  • Loading branch information
MarcusCalhoun-Lopez committed May 17, 2020
1 parent a50c606 commit bcb4c7ef96c36c7e9e4a4a1a758d95f81f8fe803
Showing with 70 additions and 89 deletions.
  1. +3 −18 devel/stfl/Portfile
  2. +0 −48 devel/stfl/files/dylib.patch
  3. +67 −23 devel/stfl/files/patch-Makefile.diff
@@ -1,6 +1,7 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0
PortGroup makefile 1.0

name stfl
version 0.24
@@ -31,24 +32,8 @@ depends_lib port:ncurses \

patchfiles patch-Makefile.diff patch-stfl_internals.h.diff

post-patch {
reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/Makefile.cfg
}

use_configure no

variant universal {}

build.args CC=${configure.cc}

build.env "CFLAGS=${configure.cflags} [get_canonical_archflags cc]" \
"CPPFLAGS=${configure.cppflags}" \
"LDLIBS=${configure.ldflags} [get_canonical_archflags ld]"

platform darwin {
patchfiles-append \
dylib.patch
}
makefile.prefix_name \
prefix

livecheck.type regex
livecheck.url ${homepage}

This file was deleted.

@@ -1,37 +1,81 @@
Don't include optimization flags here; MacPorts will supply its own.

Add forgotten flag to link with libiconv.

Do not build language bindings with swig.
--- Makefile.orig 2015-02-12 07:14:33.000000000 -0600
+++ Makefile 2020-05-04 11:54:34.000000000 -0500
@@ -21,8 +21,8 @@
--- Makefile.orig 2015-02-12 06:14:33.000000000 -0700
+++ Makefile 2020-05-17 09:23:03.000000000 -0700
@@ -21,13 +21,14 @@
include Makefile.cfg

export CC = gcc -pthread
-export CFLAGS += -I. -Wall -Os -ggdb -D_GNU_SOURCE -fPIC
-export LDLIBS += -lncursesw
+export CFLAGS += -I. -Wall -ggdb -D_GNU_SOURCE -fPIC
+export LDLIBS += -lncursesw -liconv
+export CFLAGS += -I. -Wall -D_GNU_SOURCE -fPIC -pthread
+export LDLIBS += -lncursesw -liconv $(LDFLAGS) -pthread

SONAME := libstfl.so.0
-SONAME := libstfl.so.0
+SOVER := 0
+SONAME := libstfl.$(SOVER).dylib
VERSION := 0.24
@@ -73,18 +73,6 @@
include spl/Makefile.snippet
endif

-ifeq ($(FOUND_SWIG)$(FOUND_PERL5),11)
-include perl5/Makefile.snippet
-all: libstfl.so.$(VERSION) libstfl.a example
+all: libstfl.$(VERSION).dylib libstfl.a example

example: libstfl.a example.o

@@ -37,9 +38,9 @@
ar qc $@ $^
ranlib $@

-libstfl.so.$(VERSION): public.o base.o parser.o dump.o style.o binding.o iconv.o \
+libstfl.$(VERSION).dylib: public.o base.o parser.o dump.o style.o binding.o iconv.o \
$(patsubst %.c,%.o,$(wildcard widgets/*.c))
- $(CC) -shared -Wl,-soname,$(SONAME) -o $@ $(LDLIBS) $^
+ $(CC) -dynamiclib -install_name $(prefix)/$(libdir)/$(SONAME) -current_version $(VERSION) -compatibility_version $(SOVER) -o $@ $(LDLIBS) $^

clean:
rm -f libstfl.a example core core.* *.o Makefile.deps
@@ -63,8 +64,9 @@
install -m 644 libstfl.a $(DESTDIR)$(prefix)/$(libdir)
install -m 644 stfl.h $(DESTDIR)$(prefix)/include/
install -m 644 stfl.pc $(DESTDIR)$(prefix)/$(libdir)/pkgconfig/
- install -m 644 libstfl.so.$(VERSION) $(DESTDIR)$(prefix)/$(libdir)
- ln -fs libstfl.so.$(VERSION) $(DESTDIR)$(prefix)/$(libdir)/libstfl.so
+ install -m 755 libstfl.$(VERSION).dylib $(DESTDIR)$(prefix)/$(libdir)
+ ln -fs libstfl.$(VERSION).dylib $(DESTDIR)$(prefix)/$(libdir)/$(SONAME)
+ ln -fs $(SONAME) $(DESTDIR)$(prefix)/$(libdir)/libstfl.dylib

stfl.pc: stfl.pc.in
sed 's,@VERSION@,$(VERSION),g' < $< | sed 's,@PREFIX@,$(prefix),g' > $@
--- Makefile.cfg.orig 2009-05-31 11:20:39.000000000 -0700
+++ Makefile.cfg 2020-05-17 09:07:27.000000000 -0700
@@ -22,33 +22,8 @@
export prefix ?= /usr/local
export DESTDIR ?= /

-ifneq ($(shell spl-config --cflags 2>/dev/null),)
-FOUND_SPL = 1
-else
FOUND_SPL = 0
-endif
-
-ifeq ($(FOUND_SWIG)$(FOUND_PYTHON),11)
-include python/Makefile.snippet
-ifneq ($(shell swig -help 2>/dev/null),)
-FOUND_SWIG = 1
-else
FOUND_SWIG = 0
-endif
-
-ifeq ($(FOUND_SWIG)$(FOUND_RUBY),11)
-include ruby/Makefile.snippet
-ifneq ($(shell perl -le 'print 1' 2>/dev/null),)
-FOUND_PERL5 = 1
-else
FOUND_PERL5 = 0
-endif
-
-ifneq ($(shell python -c 'print 1' 2>/dev/null),)
-FOUND_PYTHON = 1
-else
FOUND_PYTHON = 0
-endif
-
-ifneq ($(shell ruby -e 'puts 1' 2>/dev/null),)
-FOUND_RUBY = 1
-else
FOUND_RUBY = 0
-endif
-
.PHONY: all clean install install_spl

include Makefile.deps

0 comments on commit bcb4c7e

Please sign in to comment.
You can’t perform that action at this time.