]> Sergey Matveev's repositories - vors.git/commitdiff
mk-non-static
authorSergey Matveev <stargrave@stargrave.org>
Sun, 28 Apr 2024 11:03:19 +0000 (14:03 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Mon, 29 Apr 2024 11:28:12 +0000 (14:28 +0300)
doc/install.texi
doc/vors.html/download/no-static.patch [deleted file]
makedist
mk-non-static [new file with mode: 0755]

index ce4dd56e10be3d7f49201d967f6bd806ce004d31e0b337b38c3c596280801603..4b6add8d31a9e8bafdc14e263e8dca41829bbfcb32abd2195a4745d3ab52c088 100644 (file)
@@ -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 <no-static.patch
+$ ./mk-non-static
+$ ./build
 @end example
 
 @include download.texi
diff --git a/doc/vors.html/download/no-static.patch b/doc/vors.html/download/no-static.patch
deleted file mode 100644 (file)
index 2e408bd..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-diff -urN vors-2.3.0/vendor/go.stargrave.org/opus/v2/decoder.go vors-2.3.0-no-static/vendor/go.stargrave.org/opus/v2/decoder.go
---- vors-2.3.0/vendor/go.stargrave.org/opus/v2/decoder.go      2024-04-16 22:44:09.000000000 +0300
-+++ vors-2.3.0-no-static/vendor/go.stargrave.org/opus/v2/decoder.go    2024-04-19 20:49:51.571957000 +0300
-@@ -10,8 +10,7 @@
- )
- /*
--#cgo pkg-config: --static opus
--#cgo LDFLAGS: -static
-+#cgo pkg-config: opus
- #include <opus.h>
- 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 <opus.h>
- 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 <opus.h>
- */
- 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 <opus.h>
- */
- import "C"
index d4fcdb44ad724c58355a17040451e991108551e23eec9a97241014b5b9064364..f742b6a1df382901ca43be1220c8e25478e74409444f4320e0c4d92e53888084 100755 (executable)
--- 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 (executable)
index 0000000..f415fca
--- /dev/null
@@ -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