Skip to content

Conversation

@harryfrzz
Copy link

No description provided.

@harryfrzz
Copy link
Author

I have made some changes to the code now, please let me now if there are any errors @twaik

@twaik
Copy link
Member

twaik commented Oct 12, 2025

Squash the changes please.

@twaik
Copy link
Member

twaik commented Oct 12, 2025

Change commit description to addpkg(main/mujs): 1.3.4 and force-push please.

@twaik
Copy link
Member

twaik commented Oct 12, 2025

Seems like it did not pick termux's CFLAGS and LDFLAGS.
https://github.com/termux/termux-packages/actions/runs/18449699832/job/52562116147?pr=26862

@robertkirkman
Copy link
Member

@harryfrzz what twaik said is correct, but to explain further, if it fails in CI here but worked in your on-device build, it means that it needs to be edited further to be compatible with "cross-compilation" which is when software is built for Termux using the termux-package-builder Docker container without Termux being present. If you don't understand about that and need some help with it then let me know.

@twaik
Copy link
Member

twaik commented Oct 13, 2025

DO NOT use merge commits please. PRs containing merge commits are not being merged.

@harryfrzz
Copy link
Author

DO NOT use merge commits please. PRs containing merge commits are not being merged.

Sorry,will not do it again

@twaik
Copy link
Member

twaik commented Oct 13, 2025

Squash please.

@harryfrzz
Copy link
Author

I have added a patch file to fix the ldflags error.I have also tried to compile it and it successfully compiled for aarch64.
Please take a look at the changes made

@twaik
Copy link
Member

twaik commented Oct 13, 2025

Seems like building was fine. Now someone should test deb files of https://github.com/termux/termux-packages/actions/runs/18465870776?pr=26862 .

@robertkirkman
Copy link
Member

I have made another one by editing this until there were fewer unnecessary steps,

in case you would like it to be shorter you can use my version:

build.sh

TERMUX_PKG_HOMEPAGE=https://mujs.com/
TERMUX_PKG_DESCRIPTION="A lightweight Javascript interpreter designed for embedding in other software"
TERMUX_PKG_LICENSE="ISC"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=1.3.7
TERMUX_PKG_SRCURL=https://codeberg.org/ccxvii/mujs/archive/${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=5701ac8314d7cb9c792d620c066d93682a74c43f2a49a8966014de05afec5d6a
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_DEPENDS="readline"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_EXTRA_MAKE_ARGS="HAVE_READLINE=yes"

termux_step_pre_configure() {
	CFLAGS+=" $CPPFLAGS"
}

ldflags.patch

--- a/Makefile
+++ b/Makefile
@@ -4,11 +4,11 @@
 
 default: build/debug/mujs build/debug/mujs-pp
 
-CFLAGS = -std=c99 -pedantic -Wall -Wextra -Wno-unused-parameter
+CFLAGS ?= -std=c99 -pedantic -Wall -Wextra -Wno-unused-parameter
 
 OPTIM = -O3
 
-prefix = /usr/local
+prefix ?= /usr/local
 bindir = $(prefix)/bin
 incdir = $(prefix)/include
 libdir = $(prefix)/lib
@@ -33,7 +33,7 @@ HDRS = mujs.h jsi.h regexp.h utf.h astnames.h opnames.h utfdata.h
 
 ifneq ($(HAVE_READLINE),no)
   READLINE_CFLAGS = -DHAVE_READLINE
-  READLINE_LIBS = -lreadline
+  READLINE_LIBS = $(LDFLAGS) -lreadline
 endif
 
 SRCS = \

I have tested my version on-device it looks like this

~ $ mujs
Welcome to MuJS 1.3.5.
> 

~ $ 

@harryfrzz
Copy link
Author

@Grimler91 Please take a look at the new package that has been implemented

Copy link
Member

@TomJo2000 TomJo2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@TomJo2000
Copy link
Member

I meant to get back to this last week but didn't have the time to.
This should be good to merge, there's no reason to keep it sitting here collecting dust.

I'll merge this tomorrow if there is no further comments.

@robertkirkman
Copy link
Member

This PR is fine, but I might open a PR afterward to further revise it with my own changes which shorten the build.sh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants