pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/lang/mujs



Module Name:    pkgsrc
Committed By:   nia
Date:           Sun Sep 10 09:36:38 UTC 2023

Modified Files:
        pkgsrc/lang/mujs: Makefile PLIST buildlink3.mk distinfo
Added Files:
        pkgsrc/lang/mujs/patches: patch-Makefile

Log Message:
mujs: In typical pkgsrc fashion, libtoolize package that attempts to
hand-roll its own way of producing shared/static libaries. Install more
than just the static libraries.

Make the build process generally more portable and predictable by
further separating compilation and link stages, and using LDFLAGS
instead of CFLAGS when linking.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 pkgsrc/lang/mujs/Makefile pkgsrc/lang/mujs/distinfo
cvs rdiff -u -r1.2 -r1.3 pkgsrc/lang/mujs/PLIST \
    pkgsrc/lang/mujs/buildlink3.mk
cvs rdiff -u -r0 -r1.5 pkgsrc/lang/mujs/patches/patch-Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/lang/mujs/Makefile
diff -u pkgsrc/lang/mujs/Makefile:1.4 pkgsrc/lang/mujs/Makefile:1.5
--- pkgsrc/lang/mujs/Makefile:1.4       Mon Apr 24 07:50:40 2023
+++ pkgsrc/lang/mujs/Makefile   Sun Sep 10 09:36:38 2023
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.4 2023/04/24 07:50:40 wiz Exp $
+# $NetBSD: Makefile,v 1.5 2023/09/10 09:36:38 nia Exp $
 
 DISTNAME=      mujs-1.3.3
+PKGREVISION=   1
 CATEGORIES=    lang
 MASTER_SITES=  https://mujs.com/downloads/
 
@@ -10,9 +11,11 @@ COMMENT=     Lightweight embedded JavaScript
 LICENSE=       isc
 
 USE_TOOLS+=    gmake
+USE_LIBTOOL=   yes
 
 MAKE_FLAGS+=   prefix=${PREFIX}
 BUILD_TARGET=  default
+INSTALL_TARGET=        install-shared
 
 .include "../../mk/readline.buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
Index: pkgsrc/lang/mujs/distinfo
diff -u pkgsrc/lang/mujs/distinfo:1.4 pkgsrc/lang/mujs/distinfo:1.5
--- pkgsrc/lang/mujs/distinfo:1.4       Mon Apr 24 07:50:40 2023
+++ pkgsrc/lang/mujs/distinfo   Sun Sep 10 09:36:38 2023
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.4 2023/04/24 07:50:40 wiz Exp $
+$NetBSD: distinfo,v 1.5 2023/09/10 09:36:38 nia Exp $
 
 BLAKE2s (mujs-1.3.3.tar.gz) = b91373ed586938084ceaa6b90545fa580ea6f7efd9fecbd84ab50189b6fca943
 SHA512 (mujs-1.3.3.tar.gz) = 74288484185473a813c55e08dcc2fefba46f87651d3a1fcea6ac843bb09a4150e13e0d46b348a34380a0defdeaa388cc93b6f7f569a7886091a34b4951b9461b
 Size (mujs-1.3.3.tar.gz) = 128097 bytes
+SHA1 (patch-Makefile) = 6fb39d0ae1a3dd510e846bf29bbb4a6ffa44cf84

Index: pkgsrc/lang/mujs/PLIST
diff -u pkgsrc/lang/mujs/PLIST:1.2 pkgsrc/lang/mujs/PLIST:1.3
--- pkgsrc/lang/mujs/PLIST:1.2  Mon Apr 24 07:50:40 2023
+++ pkgsrc/lang/mujs/PLIST      Sun Sep 10 09:36:38 2023
@@ -1,6 +1,6 @@
-@comment $NetBSD: PLIST,v 1.2 2023/04/24 07:50:40 wiz Exp $
+@comment $NetBSD: PLIST,v 1.3 2023/09/10 09:36:38 nia Exp $
 bin/mujs
 bin/mujs-pp
 include/mujs.h
-lib/libmujs.a
+lib/libmujs.la
 lib/pkgconfig/mujs.pc
Index: pkgsrc/lang/mujs/buildlink3.mk
diff -u pkgsrc/lang/mujs/buildlink3.mk:1.2 pkgsrc/lang/mujs/buildlink3.mk:1.3
--- pkgsrc/lang/mujs/buildlink3.mk:1.2  Mon Apr 24 07:50:40 2023
+++ pkgsrc/lang/mujs/buildlink3.mk      Sun Sep 10 09:36:38 2023
@@ -1,12 +1,10 @@
-# $NetBSD: buildlink3.mk,v 1.2 2023/04/24 07:50:40 wiz Exp $
+# $NetBSD: buildlink3.mk,v 1.3 2023/09/10 09:36:38 nia Exp $
 
 BUILDLINK_TREE+=       mujs
 
 .if !defined(MUJS_BUILDLINK3_MK)
 MUJS_BUILDLINK3_MK:=
 
-BUILDLINK_DEPMETHOD.mujs?=     build
-
 BUILDLINK_API_DEPENDS.mujs+=   mujs>=1.3.3
 BUILDLINK_PKGSRCDIR.mujs?=     ../../lang/mujs
 .endif # MUJS_BUILDLINK3_MK

Added files:

Index: pkgsrc/lang/mujs/patches/patch-Makefile
diff -u /dev/null pkgsrc/lang/mujs/patches/patch-Makefile:1.5
--- /dev/null   Sun Sep 10 09:36:38 2023
+++ pkgsrc/lang/mujs/patches/patch-Makefile     Sun Sep 10 09:36:38 2023
@@ -0,0 +1,86 @@
+$NetBSD: patch-Makefile,v 1.5 2023/09/10 09:36:38 nia Exp $
+
+- Build shared objects at build-time rather than install-time.
+- Honour CFLAGS and LDFLAGS.
+- Libtoolize.
+
+--- Makefile.orig      2023-01-10 11:11:11.000000000 +0000
++++ Makefile
+@@ -2,11 +2,9 @@
+ #
+ # Useful targets are: release, install, uninstall.
+ 
+-default: build/debug/mujs build/debug/mujs-pp
++default: build/release/mujs build/release/mujs-pp build/release/libmujs.la
+ 
+-CFLAGS = -std=c99 -pedantic -Wall -Wextra -Wno-unused-parameter
+-
+-OPTIM = -O3
++CFLAGS += -std=c99 -pedantic -Wall -Wextra -Wno-unused-parameter
+ 
+ prefix = /usr/local
+ bindir = $(prefix)/bin
+@@ -19,11 +17,7 @@ else
+   VERSION = $(patsubst mujs-%,%,$(notdir $(CURDIR)))
+ endif
+ 
+-ifeq ($(shell uname),Darwin)
+-  SO = dylib
+-else
+-  SO = so
+-endif
++SO = la
+ 
+ ifeq ($(shell uname),FreeBSD)
+   CFLAGS += -I/usr/local/include -L/usr/local/lib
+@@ -90,18 +84,22 @@ build/debug/mujs: main.c build/debug/lib
+ build/debug/mujs-pp: pp.c build/debug/libmujs.o
+       $(CC) $(CFLAGS) -g -o $@ $^ -lm
+ 
+-build/release/libmujs.$(SO): one.c $(SRCS) $(HDRS)
++build/release/libmujs.$(SO): build/release/one.lo $(SRCS) $(HDRS)
+       @mkdir -p $(@D)
+-      $(CC) $(CFLAGS) $(OPTIM) -fPIC -shared -o $@ one.c -lm
+-build/release/libmujs.o: one.c $(SRCS) $(HDRS)
++      $(LIBTOOL) --mode=link --tag=CC --quiet $(CC) $(LDFLAGS) -rpath $(PREFIX)/lib -o $@ build/release/one.lo -lm
++build/release/one.lo: one.c $(SRCS) $(HDRS)
+       @mkdir -p $(@D)
+-      $(CC) $(CFLAGS) $(OPTIM) -c -o $@ one.c
+-build/release/libmujs.a: build/release/libmujs.o
+-      $(AR) cr $@ $^
+-build/release/mujs: main.c build/release/libmujs.o
+-      $(CC) $(CFLAGS) $(OPTIM) -o $@ $^ -lm -DHAVE_READLINE -lreadline
+-build/release/mujs-pp: pp.c build/release/libmujs.o
+-      $(CC) $(CFLAGS) $(OPTIM) -o $@ $^ -lm
++      $(LIBTOOL) --mode=compile --tag=CC --quiet $(CC) $(CFLAGS) -c -o $@ one.c
++build/release/main.lo: main.c $(SRCS) $(HDRS)
++      @mkdir -p $(@D)
++      $(LIBTOOL) --mode=compile --tag=CC --quiet $(CC) $(CFLAGS) -c -o $@ main.c
++build/release/pp.lo: pp.c $(SRCS) $(HDRS)
++      @mkdir -p $(@D)
++      $(LIBTOOL) --mode=compile --tag=CC --quiet $(CC) $(CFLAGS) -c -o $@ pp.c
++build/release/mujs: build/release/main.lo build/release/one.lo
++      $(LIBTOOL) --mode=link --tag=CC --quiet $(CC) $(LDFLAGS) -o $@ $^ -lm -DHAVE_READLINE -lreadline
++build/release/mujs-pp: build/release/pp.lo build/release/one.lo
++      $(LIBTOOL) --mode=link --tag=CC --quiet $(CC) $(LDFLAGS) -o $@ $^ -lm
+ 
+ build/release/mujs.pc:
+       @mkdir -p $(@D)
+@@ -119,14 +117,14 @@ install-common: build/release/mujs build
+       install -d $(DESTDIR)$(bindir)
+       install -m 644 mujs.h $(DESTDIR)$(incdir)
+       install -m 644 build/release/mujs.pc $(DESTDIR)$(libdir)/pkgconfig
+-      install -m 755 build/release/mujs $(DESTDIR)$(bindir)
+-      install -m 755 build/release/mujs-pp $(DESTDIR)$(bindir)
++      $(LIBTOOL) --mode=install --tag=CC --quiet install -m 755 build/release/mujs $(DESTDIR)$(bindir)
++      $(LIBTOOL) --mode=install --tag=CC --quiet install -m 755 build/release/mujs-pp $(DESTDIR)$(bindir)
+ 
+ install-static: install-common build/release/libmujs.a
+       install -m 644 build/release/libmujs.a $(DESTDIR)$(libdir)
+ 
+ install-shared: install-common build/release/libmujs.$(SO)
+-      install -m 755 build/release/libmujs.$(SO) $(DESTDIR)$(libdir)
++      $(LIBTOOL) --mode=install --tag=CC --quiet install -m 755 build/release/libmujs.$(SO) $(DESTDIR)$(libdir)
+ 
+ install: install-static
+ 



Home | Main Index | Thread Index | Old Index