Nothin' but Slackware

バイクとLinuxに戯れる日々

2022年10月

OpenAudible 3.6.2 package for slackware

OpenAudible is a A cross-platform desktop application for downloading and managing your Audible audiobooks.

Links:

I created SlackBuild of OpenAudible(binary released version) for slackware64-current.
In order to work this application, jdk and webkit2gtk need to be installed.

[screenshot} About dialog and application (playing by mpv player)
OpenAudible_about

OpenAudible_shot-01


First, you need to download the released bin file.
[code]
wget https://github.com/openaudible/openaudible/releases/download/v3.6.2/OpenAudible_3.6.2_x86_64.deb


openaudible.SlackBuild
[code]
#!/bin/sh

# Slackware build script for

# Copyright 2021 JW(Shinichi Abe) <shin1.abe@nifty.com>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

PRGNAM=openaudible
SRCNAM=OpenAudible
VERSION=${VERSION:-3.6.2}
BUILD=${BUILD:-1}
TAG=${TAG:-jw}

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i586 ;;
    arm*) ARCH=arm ;;
       *) ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

if [ "$ARCH" = "i586" ]; then
  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT

# Extract package data
ar vx $CWD/${SRCNAM}_${VERSION}_${ARCH}.deb
tar xzf $CWD/data.tar.gz -C "${PKG}"

cd $PKG
chown -R root:root .
find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

I4J_INSTALL_LOCATION="/opt/OpenAudible"

# symlink main binary
install -d "${PKG}/usr/bin"
ln -sf "$I4J_INSTALL_LOCATION/OpenAudible" "${PKG}/usr/bin/openaudible"

# desktop entry and icons
install -Dm644 "${PKG}/${I4J_INSTALL_LOCATION}/.install4j/OpenAudible.png" "${PKG}/usr/share/pixmaps/openaudible.png"
desktop-file-install -m 644 --dir "${PKG}/usr/share/applications/" "$CWD/openaudible.desktop"

# Place license files
install -D -m644 "${PKG}/opt/OpenAudible/bin/ffmpeg license.txt" "${PKG}/usr/share/licenses/${PRGNAM}/LICENSE"

cd $PKG
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}

slack-desc
[code]
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the base package name, and
# the '|' on the right side marks the last column you can put a character in.
# You must make exactly 11 lines for the formatting to be correct.  It's also
# customary to leave one space after the ':' except on otherwise blank lines.

            |-----handy-ruler------------------------------------------------------|
openaudible:  (A cross-platform desktop application)
openaudible:
openaudible: A cross-platform desktop application for downloading and managing   
openaudible: your Audible audiobooks.
openaudible;  
openaudible: https://github.com/openaudible/openaudible
openaudible:  
openaudible:  
openaudible:
openaudible:
openaudible:


引き続き更新予定








fcitx5-mozc-2.28.4880.102.1 for slackware64-15.0 ... [update: 2022-11-05]

On Aug. 16th 2022
IME environment has been upgraded from "Fcitx' to "Fcitx5".

Thank you Patrick and Heinz Wiesinger for this update.
And also Thank you litelinux@linuxquestions_org for the tutorials of Fcitx5.

I updated my fcitx5-mozc package from 2.28.4800.102.1 to 2.28.4830.102.1.
Here is the SlackBuild of fcitx5-mozc package.
  version: 2.28.4830.102.1
  git-source: commit-be4da0c507f9bee9533d8dead5748d78fc767a11
[update: 2022-10-22]
I updated my fcitx5-mozc package from 2.28.4830.102.1 to 2.28.4880.102.1.
Here is the SlackBuild of fcitx5-mozc package.
[update: 2022-11-05]
- Fixed ELF object(s) not stripped
- Removed unneeded doc directory ( usr/doc/mozc )
- Added doinst.sh with gtk-update-icon-cache

  version: 2.28.4880.102.1
  git-source: commit-d3e8be1a6ac2cf348656105542c5530748bbd1af

  build requires: jdk11, bazel

[screenshot} About dialog
fcitx5-mozc-2.28.4880_About


fcitx5-mozc.SlackBuild
[code]
#!/bin/bash

# Slackware build script for bazel

# Copyright 2022 Isaac Yu <isaacyu1@isaacyu1.com>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

cd $(dirname $0) ; CWD=$(pwd)

PRGNAM=fcitx5-mozc
VERSION=${VERSION:-2.28.4880.102.1}
BUILD=${BUILD:-2}
TAG=${TAG:-jw}
PKGTYPE=${PKGTYPE:-txz}

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i586 ;;
    arm*) ARCH=arm ;;
       *) ARCH=$( uname -m ) ;;
  esac
fi

# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  exit 0
fi

TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
BLDBASEDIR=$TMP/$PRGNAM-$VERSION

if [ "$ARCH" = "i586" ]; then
  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

set -e
BLDTYPE=Release
_bldtype=Release

# source rev. and version.
MOZC_REV=967f83ce0fbb79e4e7997516747d3287c7180f27
GYP_REV=caa60026e223fc501e8b337fd5086ece4028b1c6
PROTOBUF_REV=b5a35bcc7e4cc4ff00eb105449b300fca3a8b0d2
ABSEIL_CPP_REV=eb3db08cb3a4faf2aa09a2ba4a30b442457f36cf
BREAKPAD_REV=2022.07.12
GOOGLETEST_REV=703bd9caab50b139428cea1aaff9974ebee5742e
JSONCPP_REV=42e892d96e47b1f6e29844cc705e148ec4856448
JAPANESE_USAGE_DICT_REV=e5b3425575734c323e1d947009dd74709437b684
ZIPCODE_REL=202110


rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
mkdir -p $PRGNAM-$VERSION
cd $PRGNAM-$VERSION
echo "prepare source file..."
# unzip packages
unzip $CWD/mozc-$MOZC_REV.zip
unzip $CWD/gyp-$GYP_REV.zip
unzip $CWD/protobuf-$PROTOBUF_REV.zip
unzip $CWD/abseil-cpp-$ABSEIL_CPP_REV.zip
unzip $CWD/breakpad-${BREAKPAD_REV}.zip
unzip $CWD/googletest-$GOOGLETEST_REV.zip
unzip $CWD/jsoncpp-$JSONCPP_REV.zip
unzip $CWD/japanese-usage-dictionary-$JAPANESE_USAGE_DICT_REV.zip
unzip $CWD/jigyosyo-$ZIPCODE_REL.zip
unzip $CWD/x-ken-all-$ZIPCODE_REL.zip
# extact tar file
tar -xvf ${CWD}/fcitx-mozc-icon.tar.gz

# rename directory
mv mozc-$MOZC_REV mozc
mv gyp-$GYP_REV gyp
mv protobuf-$PROTOBUF_REV protobuf
mv abseil-cpp-$ABSEIL_CPP_REV abseil-cpp
mv breakpad-$BREAKPAD_REV breakpad
mv googletest-$GOOGLETEST_REV googletest
mv jsoncpp-$JSONCPP_REV jsoncpp
mv japanese-usage-dictionary-$JAPANESE_USAGE_DICT_REV japanese_usage_dictionary

chown -R root:root .
find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

cd $BLDBASEDIR/mozc/src

# disable android-ndk requirement, even if we don't need it bazel will complain
sed "/android_ndk_repository/d" -i WORKSPACE.bazel

# adjust QT_BASE_PATH
sed 's|path = QT_BASE_PATH|path = "/usr/include/qt5"|' -i WORKSPACE.bazel

cd $BLDBASEDIR/mozc
# prepare zip code dictionary
unzip -d src/data/dictionary_oss $CWD/jigyosyo-$ZIPCODE_REL.zip
unzip -d src/data/dictionary_oss $CWD/x-ken-all-$ZIPCODE_REL.zip

cd src/dictionary
# Generate zip code seed
sed -i "s/from dictionary import zip_code_util/import zip_code_util/g" gen_zip_code_seed.py

cd ../data/dictionary_oss
echo "Generating zip code seed ..."
python3 ../../dictionary/gen_zip_code_seed.py --zip_code=x-ken-all.csv --jigyosyo=JIGYOSYO.CSV >> dictionary09.txt
echo "Done."

cd $BLDBASEDIR/mozc/scripts
# fix libdir path of fcitx5-mozc.so for Slackware
sed 's/lib/lib64/g' -i install_fcitx5_bazel


cd ..
# Apply debian Use-Gtk3 patch
patch -p1 < $CWD/0008-renderer-Convert-Gtk2-to-Gtk3.patch

cd ..
# Copy third party deps
echo "Copy third party deps ..."
for dep in abseil-cpp breakpad googletest jsoncpp gyp protobuf japanese_usage_dictionary
do
  cp -a $dep mozc/src/third_party/
done

# build package
echo "build package..."
CFLAGS="${CFLAGS} -fvisibility=hidden"
CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"

cd $BLDBASEDIR/mozc/src
QT_BASE_PATH=/usr/include/qt5 bash ../scripts/build_fcitx5_bazel

# Build emacs_helper
echo "build emacs_helper..."
bazel build unix/emacs:mozc_emacs_helper --config oss_linux --compilation_mode opt

# Extract license part of mozc
head -n 29 server/mozc_server.cc > LICENSE

export PREFIX="$PKG/usr"
export _bldtype
bash ../scripts/install_server_bazel

install -d "$PKG/usr/share/licenses/${PRGNAM}/"
install -m 644 LICENSE data/installer/*.html "$PKG/usr/share/licenses/${PRGNAM}/"

install -d "${PREFIX}/share/fcitx5/addon"
install -d "${PREFIX}/share/fcitx5/inputmethod"
install -d "${PREFIX}/lib${LIBDIRSUFFIX}/fcitx5"
bash ../scripts/install_fcitx5_bazel

# Install icons at /usr/share/fcitx5
install -d "${PREFIX}/share/fcitx5/mozc/icon"
install -D -m 644 data/images/product_icon_32bpp-128.png "${PREFIX}/share/fcitx5/mozc/icon/mozc.png"
install -D -m 644 ../scripts/icons/ui-alpha_full.png "${PREFIX}/share/fcitx5/mozc/icon/mozc-alpha_full.png"
install -D -m 644 ../scripts/icons/ui-alpha_half.png "${PREFIX}/share/fcitx5/mozc/icon/mozc-alpha_half.png"
install -D -m 644 ../scripts/icons/ui-direct.png "${PREFIX}/share/fcitx5/mozc/icon/mozc-direct.png"
install -D -m 644 ../scripts/icons/ui-hiragana.png "${PREFIX}/share/fcitx5/mozc/icon/mozc-hiragana.png"
install -D -m 644 ../scripts/icons/ui-katakana_full.png "${PREFIX}/share/fcitx5/mozc/icon/mozc-katakana_full.png"
install -D -m 644 ../scripts/icons/ui-katakana_half.png "${PREFIX}/share/fcitx5/mozc/icon/mozc-katakana_half.png"
install -D -m 644 ../scripts/icons/ui-dictionary.png "${PREFIX}/share/fcitx5/mozc/icon/mozc-dictionary.png"
install -D -m 644 ../scripts/icons/ui-properties.png "${PREFIX}/share/fcitx5/mozc/icon/mozc-properties.png"
install -D -m 644 ../scripts/icons/ui-tool.png "${PREFIX}/share/fcitx5/mozc/icon/mozc-tool.png"

find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
# Install emacs_helper and documents
install -Dm644 ../LICENSE $PKG/usr/share/licenses/emacs-mozc/LICENSE
install -Dm644 data/installer/credits_en.html  $PKG/usr/doc/$PRGNAM-$VERSION/credits_en.html
install -Dm755 bazel-bin/unix/emacs/mozc_emacs_helper $PKG/usr/bin/mozc_emacs_helper
install -Dm644 unix/emacs/mozc.el $PKG/usr/share/emacs/site-lisp/mozc.el

cp $CWD/init.el_mozc $CWD/README.emacs $PKG/usr/doc/$PRGNAM-$VERSION/
cp $CWD/*.patch $CWD/*.diff $CWD/fetch_fcitx5-mozc_sources.sh $PKG/usr/doc/$PRGNAM-$VERSION/
cp $CWD/$PRGNAM.SlackBuild $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
# remove unneeded doc directory
rm -rf $PKG/usr/doc/mozc

mkdir -p $PKG/install
# install slack-desc
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE


01_mozc_config.bzl_qt5.diff
# 2022-07-07 # For Linux, Qt paths are managed by pkg_config_repository in WORKSPACE.bazel.
# So, we don't need 01_mozc_config.bzl_qt5.diff.

[code]
--- a/src/config.bzl    2022-03-21 13:54:26.000000000 +0900
+++ b/src/config.bzl    2022-03-26 15:14:04.384298439 +0900
@@ -40,8 +40,8 @@
 MACOS_MIN_OS_VER = "10.12"
 
 ## Qt paths
-QT_BASE_PATH = "/usr/include/x86_64-linux-gnu/qt5"  # For Debian
-QT_BIN_PATH = "/usr/bin/"
+QT_BASE_PATH = "/usr/include/qt5"  # For Slackware
+QT_BIN_PATH = "/usr/lib64/qt5/bin/"
 
 ## For macOS
 ## QT_BASE_PATH should be a directory compiled with -developer_build option.


02_install_fcitx5_libdir.diff
[code]
--- a/scripts/install_fcitx5_bazel    2022-03-26 17:59:59.265593030 +0900
+++ b/scripts/install_fcitx5_bazel    2022-03-26 18:00:47.135593436 +0900
@@ -1,7 +1,7 @@
 #!/bin/sh
 PREFIX="${PREFIX:-/usr}"
 
-install -D -m 755 "bazel-bin/unix/fcitx5/fcitx5-mozc.so" "${PREFIX}/lib/fcitx5/fcitx5-mozc.so"
+install -D -m 755 "bazel-bin/unix/fcitx5/fcitx5-mozc.so" "${PREFIX}/lib64/fcitx5/fcitx5-mozc.so"
 
 PREFIX="${PREFIX}" ../scripts/install_fcitx5_data
 PREFIX="${PREFIX}" ../scripts/install_fcitx5_icons


init.el_mozc
[code]
(set-language-environment "Japanese")
(require 'mozc)  ; or (load-file "/usr/share/emacs/site-lisp/emacs-mozc/mozc.el")
(setq default-input-method "japanese-mozc")
(setq mozc-candidate-style 'overlay)


README.emacs
[code]
# for emacs, create {HOME}/.emacs.d/init.el with followng lines

(require 'mozc)  ; or (load-file "/path/to/mozc.el")
(setq default-input-method "japanese-mozc")
(setq mozc-candidate-style 'overlay)

doinst.sh
[code]
if [ -x /usr/bin/update-desktop-database ]; then
  /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi

if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
  if [ -x /usr/bin/gtk-update-icon-cache ]; then
    /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1
  fi
fi

if [ -x usr/bin/update-gtk-immodules ]; then
  chroot . /usr/bin/update-gtk-immodules --verbose 1>/dev/null
fi

slack-desc
[code]
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the base package name, and
# the '|' on the right side marks the last column you can put a character in.
# You must make exactly 11 lines for the formatting to be correct.  It's also
# customary to leave one space after the ':' except on otherwise blank lines.

           |-----handy-ruler------------------------------------------------------|
fcitx5-mozc: fcitx5-mozc (Mozc engine for fcitx5)
fcitx5-mozc:
fcitx5-mozc: fcitx5-mozc is Mozc, Japanese input method editor, engine for fcitx5.
fcitx5-mozc:
fcitx5-mozc: Homepage: https://fcitx-im.org
fcitx5-mozc:
fcitx5-mozc:
fcitx5-mozc:
fcitx5-mozc:
fcitx5-mozc:
fcitx5-mozc:


引き続き更新予定








mpv 0.34.1 git_c96cee2 (with ao_pipewire)

mpv 0.34.1 git_c96cee2 (with ao_pipewire)

On Oct. 11th 2022, ffmpeg-5.1.2 arrived in slackware64-current.
I updated my mpv package by using the latest git source(c96cee2) against ffmpeg-5.1.2.
The current mpv's git source supports ao_pipewire, on the other hand, stable version 0.34.1 doesn't.

Here is my mpv.SlackBuild.

SOURCE: mpv-c96cee29406bcd5ba0fcfa948386ab229042a028.zip (2022-10-10)
COMMIT_REV: c96cee29406bcd5ba0fcfa948386ab229042a028

Step-1. get sources
wget https://github.com/mpv-player/mpv/archive/${COMMIT_REV}/mpv-${COMMIT_REV}.zip
wget https://waf.io/waf-2.0.20

Step-2. Compile
mpv.SlackBuild
[code]
#!/bin/bash

# Slackware build script for mpv

# Copyright 2015 John Vogel Corning, NY USA
# Copyright 2017,2018 (versions 0.25.0-0.29.1) Andreas Guldstrand
# Copyright 2020-2022 Christoph Willing  Brisbane Australia
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

cd $(dirname $0) ; CWD=$(pwd)

PRGNAM=mpv
VERSION=${VERSION:-0.34.1_c96cee2}
COMMIT_REV=${COMMIT_REV:-c96cee29406bcd5ba0fcfa948386ab229042a028}
WAF_VERSION=${WAF_VERSION:-2.0.20}
BUILD=${BUILD:-1} # recompiled against ffmpeg-5.x and with pipewire support
TAG=${TAG:-jw}
PKGTYPE=${PKGTYPE:-txz}

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i586 ;;
    arm*) ARCH=arm ;;
       *) ARCH=$( uname -m ) ;;
  esac
fi

# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  exit 0
fi

TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

# The SLKFLAGS aren't currently used. They do no harm and can
#   be left as a placeholder in case they are ever needed.
if [ "$ARCH" = "i586" ]; then
  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-${COMMIT_REV}
#tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
unzip $CWD/$PRGNAM-${COMMIT_REV}.zip
cd $PRGNAM-${COMMIT_REV}
# Apply debian patch
patch -p1 < $CWD/0003-io-stdin-used.patch

cp $CWD/waf-$WAF_VERSION ./waf
sed -i -e 's/python$/python3/' waf
chmod +x waf
chown -R root:root .
find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

DOCS="Copyright LICENSE.GPL LICENSE.LGPL README.md RELEASE_NOTES VERSION"
MANUAL="DOCS/*.md DOCS/*.rst DOCS/*.txt"

# This leaves an opening for additional build options.
BUILD_OPTS=${BUILD_OPTS:-""}

PKG_CONFIG_PATH="/usr/lib${LIBDIRSUFFIX}/ffmpeg4/pkgconfig"
export PKG_CONFIG_PATH

# Setting CFLAGS and CXXFLAGS breaks configure.
./waf configure \
  --prefix=/usr \
  --libdir=/usr/lib${LIBDIRSUFFIX} \
  --confdir=/etc/$PRGNAM \
  --mandir=/usr/man \
  --docdir=/usr/doc/$PRGNAM-$VERSION \
  --enable-libbluray \
  --enable-dvdnav \
  --enable-libplacebo \
  --enable-libmpv-shared \
  --enable-html-build \
  --enable-dvdnav \
  --enable-cdda \
  --enable-dvbin \
  $BUILD_OPTS

./waf build
./waf --destdir=$PKG install

for f in $PKG/etc/mpv/*.conf ; do
  mv $f{,.new}
done

find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" \
  | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

if [ -d $PKG/usr/man ]; then
  find $PKG/usr/man -type f -exec gzip -9 {} \;
  for i in $( find $PKG/usr/man -type l ) ; do
    ln -s $( readlink $i ).gz $i.gz
    rm $i
  done
fi

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/manual
for f in $MANUAL; do
  cp -a $f $PKG/usr/doc/$PRGNAM-$VERSION/manual/
done
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE

0003-io-stdin-used.patch
[code]
From: James Cowgill <jcowgill@debian.org>
Date: Tue, 7 Sep 2021 10:50:26 +0200
Subject: Add _IO_stdin_used to mpv version script

This symbol is used on some architectures by glibc to determine whether the
calling executable is linked with the old libio ABI or the new libio ABI. All
new executables are supposed to have it defined. Unfortunately, if the version
script does not allow this symbol to be exported, glibc will try to use the
old ABI and cause chaos (crashes in various places).
Author: James Cowgill <jcowgill@debian.org>
---
 libmpv/mpv.def | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libmpv/mpv.def b/libmpv/mpv.def
index 50a7135..cc2d9b0 100644
--- a/libmpv/mpv.def
+++ b/libmpv/mpv.def
@@ -1,3 +1,4 @@
+_IO_stdin_used
 mpv_abort_async_command
 mpv_client_api_version
 mpv_client_id

slack-desc
[code]
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the base package name, and
# the '|' on the right side marks the last column you can put a character in.
# You must make exactly 11 lines for the formatting to be correct.  It's also
# customary to leave one space after the ':' except on otherwise blank lines.

   |-----handy-ruler------------------------------------------------------|
mpv: mpv (a movie player based on MPlayer and mplayer2)
mpv:
mpv: mpv is a fork of mplayer2 and MPlayer. It shares some features with
mpv: the former projects while introducing many more. It supports a wide
mpv: variety of video file formats, audio and video codecs, and subtitle
mpv: types.
mpv:
mpv:
mpv:
mpv: mpv homepage: http://mpv.io/
mpv:


After install, confirm AO support.
$ mpv -ao help

Available audio outputs:
  pulse            PulseAudio audio output
  alsa             ALSA audio output
  jack             JACK audio output
  pipewire         PipeWire audio output
  null             Null audio output
  pcm              RAW PCM/WAVE file writer audio output




--
[2022-10-11] New
[ ]
[ ]






TESTING: compile MEGAsync-4.7.1.0_Win source on slackware-15.0+ with FFMPEG5

[Update: Oct. 12. 2022]
Compiling test of MEGAsync-4.7.1.0_Win on slackware64-current(15.0+) with FFMPEG5

On Oct. 10 2022, ffmpeg-5.1.2 arrived to slackware64-15.0+.
Since the previous MEGAsync-4.7.1.0-x86_64-1jw.txz package was compiled against ffmpeg-4.x, it doesn't work anymore under ffmpeg-5.x environment.

I updated the package against current ffmpeg-5.x environment.
Package was compiled successfully on slackware64-15.0+ with ffmpeg-5.1.2 and is working fine so far.



MEGAsync.SlackBuild
[code]
#!/bin/sh

# Slackware build script for MEGASync input plugin

# Copyright 2017,2018 Felipe Bugno <capent@yahoo.com>
#
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# 2021-08-23 : version bump to 4.5.0.0 -- Build with gcc-11 and with ffmpeg4.4 patch
# 2021-08-24 : version bump to 4.5.3.0 -- Build with gcc-11 and with ffmpeg4.4 patch
# 2021-08-24 : version 4.5.3.0 2jw -- use sdk-3.8.2c instead of commit version "c11a688d578e16dc25d4c94fee7995730be1aa50".
# 2021-11-22 : version 4.6.1.0 1jw -- use source 4.6.1.0_Win and sdk-3.9.6a
# 2021-12-15 : version 4.6.2.0 1jw -- use source 4.6.2.0_Win and sdk-3.9.6a
# 2022-01-30 : version 4.6.3.0 1jw -- version bump to 4.6.3.0 with official 4.6.3.0_Win source
# 2022-03-07 : version 4.6.3.0-2jw -- rebuild under ibmediainfo-21.0 and libzen-0.4.39
# 2022-03-30 : version 4.6.5.0-1jw -- version bump to 4.6.5.0 Linux
# 2022-04-23 : Version 4.6.6.0-1jw -- version bump to 4.6.6.0_Win with sdk-3.9.16
# 2022-06-25 : Version 4.6.7.0-1jw -- version bump to 4.6.7.0_Win with sdk-3.9.16a
# 2022-07-XX : Version 4.6.8.0-1jw -- version bump to 4.6.8.0_Win with sdk-3.12.3
# 2022-09-21 : Cmmpiling test of MEGAsync-4.7.0.0_Win with sdk-4.3.0
# 2022-10-04 : Compiling test of MEGAsync-4.7.1.0_Win with sdk-4.3.0
# 2022-10-12 : 4.7.1.0 (2jw) -- Recompiled against FFMPEG5

PRGNAM=MEGAsync
VERSION=${VERSION:-4.7.1.0}
SDK=${SDK:-4.3.0}
BUILD=${BUILD:-2}
TAG=${TAG:-jw}

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i586 ;;
    arm*) ARCH=arm ;;
       *) ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

if [ "$ARCH" = "i586" ]; then
  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION\_Win
tar xvf $CWD/$PRGNAM-$VERSION\_Win.tar.gz
cd $PRGNAM-$VERSION\_Win/src/MEGASync/mega
tar --strip-components=1 -xvf $CWD/sdk-$SDK.tar.gz
cd ../../../
chown -R root:root .
find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

#Fix FFMPEG 5 sdk build
#sed -i -e 's|AVCodec\* decoder|auto decoder|' src/MEGASync/mega/src/gfx/freeimage.cpp

cd src/MEGASync/mega
patch -p1 < $CWD/megasync-4.5.0.0_pdfium.patch

./autogen.sh
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
  --prefix=/usr \
  --datarootdir=/usr \
  --libdir=/usr/lib${LIBDIRSUFFIX} \
  --sysconfdir=/etc \
  --localstatedir=/var \
  --mandir=/usr/man \
  --docdir=/usr/doc/$PRGNAM-$VERSION \
  --build=$ARCH-slackware-linux \
  --with-cares \
  --with-cryptopp \
  --with-curl \
  --with-sodium \
  --with-sqlite \
  --with-zlib \
  --with-termcap \
  --with-freeimage \
  --enable-chat \
  --enable-gcc-hardening

# Apply ffmpeg5 fix patch
cd ../../../
patch -p1 < $CWD/megasync-4.7.1.0_ffmpeg5.patch


cd src/
#cd ../../../src
qmake CONFIG+="release" QMAKE_CXXFLAGS="$SLKCFLAGS" MEGA.pro
lrelease MEGASync/MEGASync.pro
make
install -m 755 -p -D $TMP/$PRGNAM-$VERSION\_Win/src/MEGASync/megasync $PKG/usr/bin/megasync
install -m 644 -p -D $TMP/$PRGNAM-$VERSION\_Win/src/MEGASync/platform/linux/data/megasync.desktop $PKG/usr/share/applications/megasync.desktop
install -m 644 -p -D $TMP/$PRGNAM-$VERSION\_Win/src/MEGASync/platform/linux/data/icons/hicolor/16x16/apps/mega.png $PKG/usr/share/icons/hicolor/16x16/apps/mega.png
install -m 644 -p -D $TMP/$PRGNAM-$VERSION\_Win/src/MEGASync/platform/linux/data/icons/hicolor/32x32/apps/mega.png $PKG/usr/share/icons/hicolor/32x32/apps/mega.png
install -m 644 -p -D $TMP/$PRGNAM-$VERSION\_Win/src/MEGASync/platform/linux/data/icons/hicolor/48x48/apps/mega.png $PKG/usr/share/icons/hicolor/48x48/apps/mega.png
install -m 644 -p -D $TMP/$PRGNAM-$VERSION\_Win/src/MEGASync/platform/linux/data/icons/hicolor/128x128/apps/mega.png $PKG/usr/share/icons/hicolor/128x128/apps/mega.png
install -m 644 -p -D $TMP/$PRGNAM-$VERSION\_Win/src/MEGASync/platform/linux/data/icons/hicolor/256x256/apps/mega.png $PKG/usr/share/icons/hicolor/256x256/apps/mega.png

find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cd $TMP/$PRGNAM-$VERSION\_Win
cp -a  README.md LICENCE.md CREDITS.md $PKG/usr/doc/$PRGNAM-$VERSION
cp $CWD/megasync-4.5.0.0_pdfium.patch $CWD/megasync-4.6.0.0_ffmpeg.patch $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}

MEGAsync.info
[code]
PRGNAM="MEGAsync"
VERSION="4.7.1.0"
HOMEPAGE="https://github.com/meganz/MEGAsync/"
DOWNLOAD="https://github.com/meganz/MEGAsync/archive/v4.7.1.0_Win/MEGAsync-4.7.1.0_Win.tar.gz \
          https://github.com/meganz/sdk/archive/v4.3.0/sdk-4.3.0.tar.gz"
MD5SUM="40f521dceb27b715162d6dd22e00a831 \
        7441282b75b95eb3a613a087cc786691"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="FreeImage libmediainfo"
MAINTAINER="Felipe Bugno"
EMAIL="capent@yahoo.com"

megasync-4.5.0.0_pdfium.patch
[code]
diff --git a/bindings/qt/sdk.pri b/bindings/qt/sdk.pri
index 83ddc2e2f..46aa06d33 100644
--- a/bindings/qt/sdk.pri
+++ b/bindings/qt/sdk.pri
@@ -255,6 +255,11 @@ CONFIG(USE_PDFIUM) {
                 DEFINES += HAVE_PDFIUM
                 LIBS += -lpdfium
             }
+            else:exists(/usr/include/pdfium/fpdfview.h) {
+                DEFINES += HAVE_PDFIUM
+                INCLUDEPATH += /usr/include/pdfium
+                LIBS += -lpdfium
+            }
         }
         else {#win/mac
             DEFINES += HAVE_PDFIUM


megasync-4.7.1.0_ffmpeg5.patch
[code]
--- MEGAsync-4.7.1.0_Win/src/MEGASync/mega/src/gfx/freeimage.cpp    2022-09-27 20:24:16.000000000 +0900
+++ MEGAsync-4.7.1.0_Win.New/src/MEGASync/mega/src/gfx/freeimage.cpp    2022-10-12 10:30:22.849460973 +0900
@@ -313,7 +313,7 @@
 
     // Find decoder for video stream
     AVCodecID codecId = codecParm->codec_id;
-    AVCodec* decoder = avcodec_find_decoder(codecId);
+    auto decoder = avcodec_find_decoder(codecId);
     if (!decoder)
     {
         LOG_warn << "Codec not found: " << codecId;
@@ -330,7 +330,6 @@
 
     // Force seeking to key frames
     formatContext->seek2any = false;
-    videoStream->skip_to_keyframe = true;
     if (decoder->capabilities & CAP_TRUNCATED)
     {
         codecContext->flags |= CAP_TRUNCATED;

slack-desc
[code]
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the base package name, and
# the '|' on the right side marks the last column you can put a character in.
# You must make exactly 11 lines for the formatting to be correct.  It's also
# customary to leave one space after the ':' except on otherwise blank lines.

        |-----handy-ruler------------------------------------------------------|
MEGAsync: MEGAsync (mega cloud storage service)
MEGAsync:
MEGAsync: MEGAsync open source release for MEGA cloud storage services
MEGAsync:
MEGAsync:
MEGAsync: Compiled using default Slackware Qt4.
MEGAsync:
MEGAsync: Homepage: https://github.com/meganz/MEGAsync
MEGAsync: Service: https://mega.nz/
MEGAsync:
MEGAsync:

do-inst.sh
[code]
if [ -x /usr/bin/update-desktop-database ]; then
  /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi

if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
  if [ -x /usr/bin/gtk-update-icon-cache ]; then
    /usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1
  fi
fi

---
[Update] Oct.12.2022  : Rebuild against ffmpeg-5.1.2 with new patch(megasync-4.7.1.0_ffmpeg5.patch)

ギャラリー
  • deepl-clip.sh で簡単翻訳 [更新:2025-04-29]
  • Avidemux 2.8.2_20250323_7cf15b3
  • Avidemux 2.8.2_20250323_7cf15b3
  • Avidemux 2.8.x with Qt6 GUI
  • Avidemux 2.8.x with Qt6 GUI
  • MEGAcmd-2.0.0_Linux
  • gcolor3 with Japanese menu and LC_MESSAGES
  • avidemux2 TEST package from the latest git source (on jul.23.2024)
  • fcitx5-mozc-2.29.5135.102.1 (15jw) -- Added "merge-ut-dictionaries"