On Fri, Apr 26, 2024 at 12:11:31AM +0200, Kirill A. Korinsky wrote: > On Thu, 25 Apr 2024 23:28:27 +0200, > Dima Pasechnik wrote: > > > > +SHARED_LIBS += sbcl 0.0 > > I suggest to match library version with sbcl version to avoid nightmare, as > far as I recall upstream doesn't care about ABI stability between releases, > and, for example, .fasl should be recompiled each new release.
One can't just take X.Y.Z as a version for .so, as they must have the form X.Y, not X.Y.Z. With this in mind, as well as due to the fact that the upstream hasn't versioned libsbcl.so at all, starting from 0.0 might be OK, no? (These would be OpenBSD-specific versions, anyway). > > > @info info/sbcl.info > > +@so lib/libsbcl.so.0.0 > > Without symlink libsbcl.so -> libsbcl.so.0.0 linking agains that library > will be quite tricky. Not really. OpenBSD linker is clever enough to know that -lsbcl corresponds to the newest libsbcl.so.x.y. E.g. there is math/flintlib port, and I have $ ls -l /usr/local/lib/libflint* -rw-r--r-- 1 root bin 13231408 Mar 17 01:33 /usr/local/lib/libflint.so.0.0 -rw-r--r-- 1 root bin 12263544 Apr 22 05:06 /usr/local/lib/libflint.so.1.0 > > Minor remarks: > - minus sign as the first character inside the patch should be ok, but may > be considered quite suspicious. That was in already present patches. > - you also need to increase reviosion with that changes. > - I suggest to add diff.noprefix=true to port's git config to avoid prefix if your port tree is under git, you can save my diff to my_patch and do git apply my_patch :-) Anyhow - is this crucial? This is a patch to be applied to port, not patches for a port. > > Something like this: > > diff --git lang/sbcl/Makefile lang/sbcl/Makefile > index 9c849a70c4e..d064d85e5c3 100644 > --- lang/sbcl/Makefile > +++ lang/sbcl/Makefile > @@ -7,9 +7,12 @@ COMMENT = high performance Common Lisp compiler > V = 2.4.3 > DISTNAME = sbcl-${V}-source > PKGNAME = sbcl-${V} > +REVISION = 0 > > CATEGORIES = lang > > +SHARED_LIBS += sbcl ${V} > + > HOMEPAGE = https://www.sbcl.org/ > > MAINTAINER = Sebastien Marie <sema...@kapouay.eu.org> > @@ -90,7 +93,8 @@ MAKE_ENV += CFLAGS="${CFLAGS} > -I${LOCALBASE}/include" \ > MAKEINFO=${PREFIX}/bin/gmakeinfo \ > MAN_DIR="${PREFIX}/man/" \ > INFO_DIR="${PREFIX}/info/" \ > - SBCL_MAKE_JOBS="-j${MAKE_JOBS}" > + SBCL_MAKE_JOBS="-j${MAKE_JOBS}" \ > + LIBsbcl_VERSION="${LIBsbcl_VERSION}" > > USE_GMAKE = Yes > > @@ -116,6 +120,8 @@ do-build: > --with-sb-core-compression \ > --with-sb-xref-for-internals \ > ${EXTRA_PARAMS} > + umask 022 && cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \ > + /bin/sh ./make-shared-library.sh > umask 022 && cd ${WRKSRC}/doc/manual/ && ${SETENV} ${MAKE_ENV} \ > ${GMAKE} info > > diff --git lang/sbcl/patches/patch-install_sh > lang/sbcl/patches/patch-install_sh > new file mode 100644 > index 00000000000..aa619d122a4 > --- /dev/null > +++ lang/sbcl/patches/patch-install_sh > @@ -0,0 +1,15 @@ > +- install .so with correct version suffix > + > +Index: install.sh > +--- install.sh.orig > ++++ install.sh > +@@ -114,7 +114,8 @@ test -f "$BUILD_ROOT$SBCL_HOME"/sbcl.core && \ > + cp src/runtime/$RUNTIME "$BUILD_ROOT$INSTALL_ROOT"/bin/ > + cp output/sbcl.core "$BUILD_ROOT$SBCL_HOME"/sbcl.core > + test -f src/runtime/libsbcl.so && \ > +- cp src/runtime/libsbcl.so "$BUILD_ROOT$INSTALL_ROOT"/lib/ > ++ cp src/runtime/libsbcl.so > "$BUILD_ROOT$INSTALL_ROOT"/lib/libsbcl.so.${LIBsbcl_VERSION} && \ > ++ ln -sf libsbcl.so.${LIBsbcl_VERSION} > "$BUILD_ROOT$INSTALL_ROOT"/lib/libsbcl.so > + > + cp src/runtime/sbcl.mk "$BUILD_ROOT$SBCL_HOME"/sbcl.mk > + for i in $(grep '^LIBSBCL=' src/runtime/sbcl.mk | cut -d= -f2-) ; do > diff --git lang/sbcl/patches/patch-src_runtime_GNUmakefile > lang/sbcl/patches/patch-src_runtime_GNUmakefile > index 887d4d2ff6d..8f8d37e638e 100644 > --- lang/sbcl/patches/patch-src_runtime_GNUmakefile > +++ lang/sbcl/patches/patch-src_runtime_GNUmakefile > @@ -13,3 +13,12 @@ Index: src/runtime/GNUmakefile > ASFLAGS += $(CFLAGS) > CPPFLAGS += -I. > > +@@ -133,7 +133,7 @@ libsbcl.a: $(OBJS) > + > + PIC_OBJS = $(subst .o,.pic.o,$(OBJS)) > + libsbcl.so: $(PIC_OBJS) > +- $(CC) -shared -o $@ $^ $(LIBS) $(SOFLAGS) > ++ $(CC) -shared -fPIC -o $@ $^ $(LDFLAGS) $(LIBS) $(SOFLAGS) > + # for this to work, you must have with-gcc-tls in your build features > already. > + # can't define it here because then it conflicts if you have it in both > places. > + %.pic.o: %.c > diff --git lang/sbcl/pkg/PLIST lang/sbcl/pkg/PLIST > index 8eece6b846e..512e9e46b65 100644 > --- lang/sbcl/pkg/PLIST > +++ lang/sbcl/pkg/PLIST > @@ -2,6 +2,8 @@ > @bin bin/sbcl > @info info/asdf.info > @info info/sbcl.info > +@so lib/libsbcl.so > +@bin lib/libsbcl.so.2.4.3 What's that @bin ? I've never seen this - must be confused build tools? Best, Dima > lib/sbcl/ > lib/sbcl/contrib/ > lib/sbcl/contrib/asdf.fasl > > > -- > wbr, Kirill >
signature.asc
Description: PGP signature