From 8f5201384d8315250bc79a0340e94598eac56d95 Mon Sep 17 00:00:00 2001 From: David King Date: Tue, 16 May 2023 16:42:23 +0100 Subject: [PATCH] Link against libm Fixes compilation of libproxy against duktape. https://github.com/svaarala/duktape/issues/2464 --- duktape-2.7.0-link-against-libm.patch | 28 +++++++++++++++++++++++++++ duktape.spec | 5 ++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 duktape-2.7.0-link-against-libm.patch diff --git a/duktape-2.7.0-link-against-libm.patch b/duktape-2.7.0-link-against-libm.patch new file mode 100644 index 0000000..39d11c8 --- /dev/null +++ b/duktape-2.7.0-link-against-libm.patch @@ -0,0 +1,28 @@ +From d898ad3920cb08d6918d11d9678bae28393a82d1 Mon Sep 17 00:00:00 2001 +From: tinywrkb +Date: Thu, 17 Mar 2022 03:55:51 +0200 +Subject: [PATCH] dist-files/Makefile.sharedlibrary: link against libm + +Closes #2464. +--- + Makefile.sharedlibrary | 4 ++-- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/Makefile.sharedlibrary b/Makefile.sharedlibrary +index 3a6c7cacc..4e20084e3 100644 +--- a/Makefile.sharedlibrary ++++ b/Makefile.sharedlibrary +@@ -71,11 +71,11 @@ all: libduktape.$(SO_REALNAME_SUFFIX) libduktaped.$(SO_REALNAME_SUFFIX) duktape. + + libduktape.$(SO_REALNAME_SUFFIX): + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fPIC -Wall -Wextra -Os -Wl,$(LD_SONAME_ARG),libduktape.$(SO_SONAME_SUFFIX) \ +- -o $@ $(DUKTAPE_SRCDIR)/duktape.c ++ -o $@ $(DUKTAPE_SRCDIR)/duktape.c -lm + + libduktaped.$(SO_REALNAME_SUFFIX): + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fPIC -g -Wall -Wextra -Os -Wl,$(LD_SONAME_ARG),libduktaped.$(SO_SONAME_SUFFIX) \ +- -o $@ $(DUKTAPE_SRCDIR)/duktape.c ++ -o $@ $(DUKTAPE_SRCDIR)/duktape.c -lm + + duktape.pc: + sed -e "s|@PREFIX@|$(INSTALL_PREFIX)|" \ diff --git a/duktape.spec b/duktape.spec index 4bfcc52..9a8d97d 100644 --- a/duktape.spec +++ b/duktape.spec @@ -2,9 +2,12 @@ Name: duktape Version: 2.7.0 Release: %autorelease Summary: Embeddable Javascript engine + License: MIT Url: http://duktape.org/ Source0: http://duktape.org/%{name}-%{version}.tar.xz +Patch0: duktape-2.7.0-link-against-libm.patch + BuildRequires: gcc BuildRequires: pkgconfig BuildRequires: make @@ -24,7 +27,7 @@ This package contains header files and libraries needed to develop application that use %{name}. %prep -%setup -q +%autosetup -p1 %build %make_build -f Makefile.sharedlibrary INSTALL_PREFIX=%{_prefix} LIBDIR=/%{_lib}