From a87156685b06f16f7050efc36cda1701c98ee728fa07c01ab5e56c16a559881d Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sun, 28 Apr 2024 14:03:19 +0300 Subject: [PATCH] mk-non-static --- doc/install.texi | 8 ++-- doc/vors.html/download/no-static.patch | 52 -------------------------- makedist | 2 +- mk-non-static | 4 ++ 4 files changed, 10 insertions(+), 56 deletions(-) delete mode 100644 doc/vors.html/download/no-static.patch create mode 100755 mk-non-static diff --git a/doc/install.texi b/doc/install.texi index ce4dd56..4b6add8 100644 --- a/doc/install.texi +++ b/doc/install.texi @@ -27,12 +27,14 @@ $ ./build $ mv bin/vors-* $PATH/bin @end example -I heard that some systems can not create statically linked binaries. -@url{download/no-static.patch, Here} is the patch that may help. +I heard that some proprietary systems can not create statically linked +binaries. You can use @command{mk-non-static} script to remove the need +of static linking. @example $ cd vors-@value{VERSION} -$ patch -p1 - - int -diff -urN vors-2.3.0/vendor/go.stargrave.org/opus/v2/encoder.go vors-2.3.0-no-static/vendor/go.stargrave.org/opus/v2/encoder.go ---- vors-2.3.0/vendor/go.stargrave.org/opus/v2/encoder.go 2024-04-16 22:44:09.000000000 +0300 -+++ vors-2.3.0-no-static/vendor/go.stargrave.org/opus/v2/encoder.go 2024-04-19 20:50:00.849825000 +0300 -@@ -10,8 +10,7 @@ - ) - - /* --#cgo pkg-config: --static opus --#cgo LDFLAGS: -static -+#cgo pkg-config: opus - #include - - int -diff -urN vors-2.3.0/vendor/go.stargrave.org/opus/v2/errors.go vors-2.3.0-no-static/vendor/go.stargrave.org/opus/v2/errors.go ---- vors-2.3.0/vendor/go.stargrave.org/opus/v2/errors.go 2024-04-16 22:44:09.000000000 +0300 -+++ vors-2.3.0-no-static/vendor/go.stargrave.org/opus/v2/errors.go 2024-04-19 20:50:12.450136000 +0300 -@@ -9,8 +9,7 @@ - ) - - /* --#cgo pkg-config: --static opus --#cgo LDFLAGS: -static -+#cgo pkg-config: opus - #include - */ - import "C" -diff -urN vors-2.3.0/vendor/go.stargrave.org/opus/v2/opus.go vors-2.3.0-no-static/vendor/go.stargrave.org/opus/v2/opus.go ---- vors-2.3.0/vendor/go.stargrave.org/opus/v2/opus.go 2024-04-16 22:44:09.000000000 +0300 -+++ vors-2.3.0-no-static/vendor/go.stargrave.org/opus/v2/opus.go 2024-04-19 20:50:06.099273000 +0300 -@@ -6,8 +6,7 @@ - - /* - // Link opus using pkg-config. --#cgo pkg-config: --static opus --#cgo LDFLAGS: -static -+#cgo pkg-config: opus - #include - */ - import "C" diff --git a/makedist b/makedist index d4fcdb4..f742b6a 100755 --- a/makedist +++ b/makedist @@ -52,7 +52,7 @@ zstd -d <~/src/xiph/opus/opus-1.5.2.tar.zst >opus-1.5.2.tar rm -rf .git makedist find . -type d -exec chmod 755 {} + find . -type f -exec chmod 644 {} + -chmod +x build +chmod +x build mk-non-static cd .. tar cvf vors-"$release".tar --uid=0 --gid=0 --numeric-owner vors-"$release" diff --git a/mk-non-static b/mk-non-static new file mode 100755 index 0000000..f415fca --- /dev/null +++ b/mk-non-static @@ -0,0 +1,4 @@ +#!/bin/sh -e + +perl -i -npe 's/(pkg-config:)--static/\1/g' vendor/go.stargrave.org/opus/v2/*.go +perl -i -ne 'print unless /LDFLAGS/' vendor/go.stargrave.org/opus/v2/*.go -- 2.48.1