Nothin' but Slackware

バイクとLinuxに戯れる日々

2023年05月

fcitx5-mozc-2.28.5105.102.1 [update: 2023-05-19]

[update: 2023-05-19
- Version :  2.28.5105.102.1
  TAG : 1jw :
 
1. MOZC_REV:    cb56b6b0695d0ed248e6ec0e7fe0a24d18b00ea4
     ( git-source: commit-cb56b6b0695d0ed248e6ec0e7fe0a24d18b00ea4  )

  build requires: jdk11, bazel, Ruby >= 3.0, Zsh, xz, curl
------------------------------------------
About Mozc
fcitx5-mozc-2.28.5105_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.5105.102.1}
BUILD=${BUILD:-1}
#[2023-05-19]
# version bump to "2.28.5105.102.1"
# MOZC_REV : "cb56b6b0695d0ed248e6ec0e7fe0a24d18b00ea4"
#
# [2023-04-29]
# OK. I removed "gen_zip_code_seed.py" process, because Bazel will fetch and
# merge the latest zip-code from japan post office's repository.
#
# [2023-04-29]
# Version bump to "2.28.5085.102.1"
# MOZC_REV : "589e80577b2f49212fd912b65d30e32572ad1f1f"
# [2023-04-17]
# Import "mozcdict-ext" extra dictionaries from https://github.com/reasonset/mozcdict-ext
# [2023-04-14]
# Update MOZC_REV to "1ea2c86946915db7661a3b53834c2dee2e34f0d4"
# Also updated BUILD.bazel on commit:fa4cdd0 (2023-04-14)
# Update ABSEIL_CPP_REV to "20230125.5"
# Update BREAKPAD_REV to "2023.01.27"
# Use Zipcode data at www.post.japanpost.jp
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=
cb56b6b0695d0ed248e6ec0e7fe0a24d18b00ea4
GYP_REV=caa60026e223fc501e8b337fd5086ece4028b1c6
PROTOBUF_REV=b5a35bcc7e4cc4ff00eb105449b300fca3a8b0d2
ABSEIL_CPP_REV=20230125.2
BREAKPAD_REV=2023.01.27
GOOGLETEST_REV=703bd9caab50b139428cea1aaff9974ebee5742e
#JSONCPP_REV=42e892d96e47b1f6e29844cc705e148ec4856448 ### Mozc no longer depends on JsonCpp
JAPANESE_USAGE_DICT_REV=e5b3425575734c323e1d947009dd74709437b684
MOZCDICT_EXT_REV=1041a9ca03e48b29873d950c9ea19de70fde1139

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/mozcdict-ext-${MOZCDICT_EXT_REV}.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
mv mozcdict-ext-${MOZCDICT_EXT_REV} mozcdict-ext

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

# Include NEologd
export RUBYOPT=-EUTF-8
cd $BLDBASEDIR/mozcdict-ext
echo "Generating extra dictionaries..."
(
  cd neologd
  MOZC_ID_FILE=$BLDBASEDIR/mozc/src/data/dictionary_oss/id.def zsh mkdict.zsh
  cd ../sudachi
  MOZC_ID_FILE=$BLDBASEDIR/mozc/src/data/dictionary_oss/id.def zsh mkdict.zsh
) | ruby .dev.utils/uniqword.rb 2> /dev/null >> $BLDBASEDIR/mozc/src/data/dictionary_oss/dictionary09.txt

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

#cd ..
# We won't need this patch now.
# 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 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/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


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:

fcitx5-mozc.info of Version-2.28.5105.102.1 (1jw)
[code]
PRGNAM="fcitx5-mozc"
VERSION="
2.28.5105.102.1"
HOMEPAGE="https://github.com/fcitx/mozc/"
DOWNLOAD="
https://github.com/fcitx/mozc/archive/cb56b6b0695d0ed248e6ec0e7fe0a24d18b00ea4/mozc-cb56b6b0695d0ed248e6ec0e7fe0a24d18b00ea4.zip
 https://github.com/chromium/gyp/archive/caa60026e223fc501e8b337fd5086ece4028b1c6/gyp-caa60026e223fc501e8b337fd5086ece4028b1c6.zip
 https://github.com/protocolbuffers/protobuf/archive/b5a35bcc7e4cc4ff00eb105449b300fca3a8b0d2/protobuf-b5a35bcc7e4cc4ff00eb105449b300fca3a8b0d2.zip
 https://github.com/abseil/abseil-cpp/archive/20230125.2/abseil-cpp-20230125.2.zip
 https://github.com/google/breakpad/archive/v2023.01.27/breakpad-2023.01.27.zip
 https://github.com/google/googletest/archive/703bd9caab50b139428cea1aaff9974ebee5742e/googletest-703bd9caab50b139428cea1aaff9974ebee5742e.zip
 https://github.com/hiroyuki-komatsu/japanese-usage-dictionary/archive/e5b3425575734c323e1d947009dd74709437b684/japanese-usage-dictionary-e5b3425575734c323e1d947009dd74709437b684.zip
 https://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-icon.tar.gz
 https://github.com/reasonset/mozcdict-ext/archive/1041a9ca03e48b29873d950c9ea19de70fde1139/mozcdict-ext-1041a9ca03e48b29873d950c9ea19de70fde1139.zip"
MD5SUM="1402fabb8c4b38513b46ee3c85edc2a3  
 699c5af5c6d7e19835afb5292d151f91
 d79cbe4e2033c967a58e2bddaa6d4aa2
 94ebd9ba64df55d2d36c9c1a9036f03c
 124a7c0c3e479b1d804bc49ef21ba625
 768da4173ee9df3248b8f828747982ad
 a6eb1da9ad7ceffcb9683003332abf7e
 80fe2ef127b70649df22d133822ac8a7
 881191393dd7547bd7973fe3106b663c"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="bazel"
MAINTAINER=""
EMAIL=""



引き続き更新予定








Tentative fix patches for NVIDIA 530.41.03 and RTL8812AU driver for Linux 6.4-rc2

[1] Tentative fix for NVIDIA 530.41.03 driver for Linux 6.4-rc2
    I reffered joanbm's patch of NVIDIA 470xx. Thanks to joanbm.
    https://gist.github.com/joanbm/77f0650d45747b9a4dc8e330ade2bf5c

0001-nvidia-530xx-fix-linux-6.4.patch
[code]
--- a/kernel/nvidia-drm/nvidia-drm-drv.c    2023-05-16 21:24:48.460226359 +0900
+++ b/kernel/nvidia-drm/nvidia-drm-drv.c    2023-05-16 21:28:32.281220378 +0900
@@ -20,6 +20,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
+#include <linux/version.h>
 #include "nvidia-drm-conftest.h" /* NV_DRM_AVAILABLE and NV_DRM_DRM_GEM_H_PRESENT */
 
 #include "nvidia-drm-priv.h"
@@ -1436,7 +1437,11 @@
 
     nv_drm_driver.dumb_create      = nv_drm_dumb_create;
     nv_drm_driver.dumb_map_offset  = nv_drm_dumb_map_offset;
+// Rel. commit "drm: remove dumb_destroy callback" (Christian König, 26 Jan 2023)
+// NB: No resources are leaked, the kernel releases the same resources by default
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
     nv_drm_driver.dumb_destroy     = nv_drm_dumb_destroy;
+#endif
 #endif /* NV_DRM_ATOMIC_MODESET_AVAILABLE */
 }


[2] Tentative fix for RTL8812AU driver for Linux 6.4-rc2
    Upstream git of the driver source
    https://github.com/aircrack-ng/rtl8812au

rtl8812au_v5.6.4.2_kernel-v6.4.patch
[code]
--- a/os_dep/linux/ioctl_cfg80211.c    2023-05-11 21:48:30.991895460 +0900
+++ b/os_dep/linux/ioctl_cfg80211.c    2023-05-11 21:56:35.169891566 +0900
@@ -460,7 +460,7 @@
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0))
     if (started) {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0))
         cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, 0, false, 0);
 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
         cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, 0, false);
@@ -476,7 +476,7 @@
     if (!rtw_cfg80211_allow_ch_switch_notify(adapter))
         goto exit;
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0))
     cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0, 0);
 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2))
     cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0);


---
[2023-05-17] New


MEGAcmd−1.6.3 has been released

[Update] 2023-05-11 : Version bump to 1.6.3_linux

クラウド・ストレージ MEGA のコマンドライン・ユーティリティ MEGAcmd-1.6.3_Linux
screen shot
MEGAcmd-1.6.3_login-window

MEGAcmd.SlackBuild
[code]
#!/bin/bash

# Slackware build script for MEGAcmd

# 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.

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

PRGNAM=MEGAcmd
VERSION=${VERSION:-
1.6.3}
SDK=${SDK:-
4.17.1d}
BUILD=${BUILD:-2}
# version bump to 1.6.3 with sdk-4.17.1d ; applied ffmpeg-compile fix patch from Archlinux
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}

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}_Linux
tar xvf $CWD/$PRGNAM-${VERSION}_Linux.tar.?z
cd $PRGNAM-${VERSION}_Linux/sdk
tar --strip-components=1 -xvf $CWD/sdk-$SDK.tar.gz
# Apply fix-ffmpeg-compile.patch ; Thanks to Arch linux.
patch -p1 < $CWD/fix-ffmpeg-compile.patch


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 {} \;

./autogen.sh
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
  --prefix=/usr \
  --libdir=/usr/lib${LIBDIRSUFFIX} \
  --sysconfdir=/etc \
  --localstatedir=/var \
  --docdir=/usr/doc/$PRGNAM-$VERSION \
  --build=$ARCH-slackware-linux

make
make install DESTDIR=$PKG
# Fix installdir of megacmd_completion.sh
rm -rf $PKG/etc
install -Dm644 src/client/megacmd_completion.sh $PKG/usr/share/bash-completion/completions/megacmd

# Don't ship .la files:
rm -rf $PKG/usr/lib${LIBDIRSUFFIX}/*.la

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
cp -a \
  LICENSE README.md UserGuide.md $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


fix-ffmpeg-compile.patch
[code]
--- a/src/gfx/freeimage.cpp    2023-03-03 22:13:58.000000000 +0000
+++ b/src/gfx/freeimage.cpp    2023-03-14 10:03:10.950216675 +0000
@@ -212,7 +212,7 @@
 #ifdef AV_CODEC_CAP_TRUNCATED
 #define CAP_TRUNCATED AV_CODEC_CAP_TRUNCATED
 #else
-#define CAP_TRUNCATED CODEC_CAP_TRUNCATED
+#define CAP_TRUNCATED 0
 #endif
 
 const char *GfxProviderFreeImage::supportedformatsFfmpeg()
@@ -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;


MEGAcmd.info
[code]
VERSION="1.6.3"
HOMEPAGE="https://github.com/meganz/MEGAcmd"
DOWNLOAD="https://github.com/meganz/MEGAcmd/archive/1.6.3_Linux/MEGAcmd-1.6.3_Linux.tar.gz \
          https://github.com/meganz/sdk/archive/v4.17.1d/sdk-4.17.1d.tar.gz"
MD5SUM="9d6d61f0dc029ccc5aceeb3fa643b1bd \
        09e1926a06ab62ddef9b2dd3846c6ba7"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="FreeImage libmediainfo"
MAINTAINER="JW(Shinichi Abe)"
EMAIL=""


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 ':'.

       |-----handy-ruler------------------------------------------------------|
MEGAcmd: MEGAcmd (MEGAcmd)
MEGAcmd: URL : https://github.com/meganz/MEGAcmd
MEGAcmd:
MEGAcmd: MEGAcmd provides non UI access to MEGA services. It intends to offer
MEGAcmd: all the functionality with your MEGA account via commands.
MEGAcmd: It features synchronization , backup of local folders into your MEGA
MEGAcmd: account and a webdav/streaming server
MEGAcmd:
MEGAcmd:
MEGAcmd:
MEGAcmd:




===


Warning! This package is not working on my slackware box : TESTING: compile MEGAsync-4.9.4.0_Win source on slackware-15.0+

[Update: May. 09. 2023]
Compiling test of MEGAsync-4.9.4.0_Win on slackware64-current(15.0+) with FFMPEG-5.1.3

I updated the package against current ffmpeg-5.x environment.
Package was compiled successfully on slackware64-15.0+ with ffmpeg-5.1.3 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.
#
# 2023-01-26 : 4.8.6.0 (1jw) -- MEGAsync-4.8.6.0_Win source with sdk-4.9.0b
# 2023-01-31 : 4.8.6.0 (2jw) -- Re-compile against libRaw-0.21.1 (libraw.so.23)
# 2023-02-04 : 4.8.7.0 (1jw) -- MEGAsync-4.8.7.0_Win source with sdk-4.9.0c
# 2023-02-28 : 4.8.8.0 (1jw) -- MEGAsync-4.8.8.0_Win source with sdk-4.14.0
# 2023-03-21 : 4.9.1.0 (1jw) -- MEGAsync-4.9.1.0_Win source with sdk-4.16.0c
# 2023-04-29 : 4.9.3.0 (1jw) -- MEGAsync-4.9.3.0_Win source with sdk-4.17.1
# 2023-05-09 : 4.9.4.0 (1jw) -- MEGAsync-4.9.4.0_Win source with sdk-4.17.1d

PRGNAM=MEGAsync
VERSION=${VERSION:-
4.9.4.0}
SDK=${SDK:-
4.17.1d}
FFMPEG5_PATCHREV=
${FFMPEG5_PATCHREV:-4.9.0.0}
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
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 {} \;

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-${FFMPEG5_PATCHREV}_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-${FFMPEG5_PATCHREV}_ffmpeg5.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.9.4.0"
HOMEPAGE="https://github.com/meganz/MEGAsync/"
DOWNLOAD="https://github.com/meganz/MEGAsync/archive/v4.9.4.0_Win/MEGAsync-4.9.4.0_Win.tar.gz \
 https://github.com/meganz/sdk/archive/v4.17.1d/sdk-4.17.1d.tar.gz"
MD5SUM="77e8fac92b50fc72044c58a7826a3b36 \
 09e1926a06ab62ddef9b2dd3846c6ba7"
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.9.0.0_ffmpeg5.patch
[code]
--- MEGAsync-4.9.0.0_Linux/src/MEGASync/mega/src/gfx/freeimage.cpp    2023-03-04 07:13:58.000000000 +0900
+++ MEGAsync-4.9.0.0_Linux.new/src/MEGASync/mega/src/gfx/freeimage.cpp    2023-03-06 23:06:33.669459409 +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,7 @@
 
     // Force seeking to key frames
     formatContext->seek2any = false;
-    videoStream->skip_to_keyframe = true;
+    //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] Nov.18.2022  : TEST build against ffmpeg-5.1.2 with new patch(megasync-4.7.3.0_ffmpeg5.patch)
[Update] Jan.26.2023 : TEST build against ffmpeg-5.1.2 with MEGAsync-4.8.6.0_Win source
[Update] Feb.04.2023 : TEST build against ffmpeg-5.1.2 with MEGAsync-4.8.7.0_Win source
[Update] Feb.28.2023 : TEST build against ffmpeg-5.1.2 with MEGAsync-4.8.8.0_Win source
[Update] Mar.22.2023 : TEST build against ffmpeg-5.1.2 with MEGAsync-4.9.1.0_Win source
[Update] May.09.2023 : TEST build against ffmpeg-5.1.3 with MEGAsync-4.9.4.0_Win source


deepl-clip.sh で簡単翻訳

Memorandum
すぐ忘れてしまうので備忘録として記録

Links:
deepl-clip.sh Home

deepl-clip インストールと設定について
-------------------------------------
Step-1) Requirements
nkf : 日本語翻訳の場合に必要 https://slackbuilds.org/repository/15.0/system/nkf/
xclip : https://slackbuilds.org/repository/15.0/misc/xclip/
xdg-open : Included in xdg-utils package of slackware

Step-2) Install "deepl-clip.sh"
[code] deepl-clip.sh英語 en から日本語 ja への翻訳の場合
#!/bin/sh
from=en
to=ja  # de, fr, es, etc.
browser=xdg-open

text=$(xclip c -o | sed ':loop; N; $!b loop; s/\n//g' | nkf -WwMQ | sed 's/=$//g' | tr = % | tr -d '\n')
$browser "https://www.deepl.com/translator#${from}/${to}/${text}"

	# cp deepl-clip.sh /usr/bin/
# chmod +x /usr/bin/deepl-clip.sh

Step-3) Set Keyboard shortcut
X環境で便利に使うためにキーボードショートカットを設定する
例)Xfce4の場合:
  設定マネージャー > キーボード > アプリケーションショートカットキー
  ※ 私の場合はLinuxで使用していない「Windowsキー」を割り当てた

deepl-clip.sh_keyboard-shortcut_setting

蛇足)このスクリプトの便利さは実際に使ってみて初めてわかるはず。
   例えば、
   1)デスクトップのエディターで英文を作成していて、今書いている英文がそこそこ正しいのか、
     もしくは自分が意図している意味の文章になっているのか確認したい
   2)ブラウザで外国語(例えば英語)ページを閲覧していて文節の意味がわからないので翻訳したい

   という場合、翻訳したい箇所をカーソルで選択すると選択箇所が自動的にクリップボードにコピーされます。
   そして、事前に設定したキーボードショートカットを押すだけで、ブラウザが DeepLを開いて先程選択した
   内容が即時翻訳表示される、という流れ。
カーソルで選択 & ショートカットキー押す 
   という2アクションで翻訳表示される。

Acknowledgments:
便利なスクリプトを公開された massan4444/deepl-clip に感謝いたします

---
[2023-05-05] 新規


ギャラリー
  • 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"