From 418b341df6db433b90f09f355794f2baaf86247f Mon Sep 17 00:00:00 2001 From: Joseph Larionov Date: Thu, 12 Dec 2024 21:36:48 -0800 Subject: [PATCH] Fixed: sanoid-portable fails to launch perl subprocesses --- build.sh | 5 +++++ patches/findoid.patch | 10 ++++++++++ patches/sanoid.patch | 10 ++++++++++ patches/syncoid.patch | 10 ++++++++++ 4 files changed, 35 insertions(+) create mode 100644 patches/findoid.patch create mode 100644 patches/sanoid.patch create mode 100644 patches/syncoid.patch diff --git a/build.sh b/build.sh index 36a7efb..e165f3c 100755 --- a/build.sh +++ b/build.sh @@ -43,6 +43,11 @@ echo "Checking out Sanoid version \"${SANOID_VERSION}\"" pushd sanoid_source > /dev/null git -c advice.detachedHead=false checkout "v${SANOID_VERSION}" git log -1 + +echo 'Applying custom patches to sanoid scripts to support bundling in APPerl binary...' +for tool in sanoid syncoid findoid; do + patch < "${repo_root}/patches/${tool}.patch" +done popd > /dev/null echo '' diff --git a/patches/findoid.patch b/patches/findoid.patch new file mode 100644 index 0000000..c7ba6ab --- /dev/null +++ b/patches/findoid.patch @@ -0,0 +1,10 @@ +diff --git a/findoid b/findoid +index 0bb5e5f..d481c66 100755 +--- a/findoid ++++ b/findoid +@@ -1,4 +1,5 @@ + #!/usr/bin/perl ++$ENV{APPERL_SCRIPTNAME} = 'perl'; + + # this software is licensed for use under the Free Software Foundation's GPL v3.0 license, as retrieved + # from http://www.gnu.org/licenses/gpl-3.0.html on 2014-11-17. A copy should also be available in this diff --git a/patches/sanoid.patch b/patches/sanoid.patch new file mode 100644 index 0000000..de7526b --- /dev/null +++ b/patches/sanoid.patch @@ -0,0 +1,10 @@ +diff --git a/sanoid b/sanoid +index 5150f3b..1a382f1 100755 +--- a/sanoid ++++ b/sanoid +@@ -1,4 +1,5 @@ + #!/usr/bin/perl ++$ENV{APPERL_SCRIPTNAME} = 'perl'; + + # this software is licensed for use under the Free Software Foundation's GPL v3.0 license, as retrieved + # from http://www.gnu.org/licenses/gpl-3.0.html on 2014-11-17. A copy should also be available in this diff --git a/patches/syncoid.patch b/patches/syncoid.patch new file mode 100644 index 0000000..e29ef64 --- /dev/null +++ b/patches/syncoid.patch @@ -0,0 +1,10 @@ +diff --git a/syncoid b/syncoid +index 5ed00f0..1791ee6 100755 +--- a/syncoid ++++ b/syncoid +@@ -1,4 +1,5 @@ + #!/usr/bin/perl ++$ENV{APPERL_SCRIPTNAME} = 'perl'; + + # this software is licensed for use under the Free Software Foundation's GPL v3.0 license, as retrieved + # from http://www.gnu.org/licenses/gpl-3.0.html on 2014-11-17. A copy should also be available in this