Nothin' but Slackware

バイクとLinuxに戯れる日々

2022年03月

FCITX5 for slackware64-15.0 (testing)

日本語入力環境を現在の fcitx, fcitx-mozc から fcitx5, fcitx5-mozc に移行してみるテスト

[先に結論] 大きなトラブルなく移行可能

[移行手順] 説明は手抜きです

                 j_w名でpostしてます。(わたしのコメントの中に自作SlackBuildのリンクを貼りました。
                 FCITX github

自作SlackBuildにより作成されるパッケージ・リスト (パッケージのバージョンは2022-03-25現在のもの)
[packages from SlackBuilds]
*** Essential packages ***
------------------------------------------
xcb-imdkit-1.0.3-x86_64-1jw.txz
fmt-7.1.3-x86_64-1jw.txz
fcitx5-5.0.15-x86_64-1jw.txz
fcitx5-gtk-5.0.13-x86_64-1jw.txz
fcitx5-qt-5.0.11-x86_64-1jw.txz
fcitx5-configtool-5.0.12-x86_64-1jw.txz
------------------------------------------

*** for Japanese IM ***
------------------------------------------
fcitx5-mozc-2.26.4680.102.1-x86_64-1jw.txz (Mozc Japanese IM) -- old version
fcitx5-mozc-2.28.4730.102.1-x86_64-1jw.txz (Mozc Japanese IM) -- old version
fcitx5-mozc-2.28.4780.102.1-x86_64-1jw.txz (Mozc Japanese IM) -- updated on Jul.07.2022
fcitx5-anthy-5.0.10-x86_64-1jw.txz (light weight and basic Japanese IM; alternate choice)

bazel-5.1.0-x86_64-1jw.txz (Needs for compiling mozc)
jdk11-11.0.14-x86_64-1jw.txz (Needs for bazel)
------------------------------------------

[その他:参考リンク (other related LINKs)]
   
・自作パッケージのSlackBuild (SlackBuild of each package)
  -- fmt (See SlackBuilds_at_org)
  -- fcitx5
  -- gtk4 (Use slackware's official package)
  -- fcitx5-qt
  -- kitemviews (Use slackware's official package)
  -- kwidgetsaddons (Use slackware's official package)
  -- bazel
  -- jdk11 ( or See SlackBuilds_at_org)
 
======
更新: 2022-03-29 19:30
fcitx5-mozc パッケージ作成が一番やっかいだったので、このスクリプトとslackware用パッチだけでも
ここに記載しておく。
更新 :  2022-05-13 20:50
fcitx5-mozc-2.28.4730.102 -- updated to version-2.28.4730.102
更新 :  2022-06-12 22:00
fcitx5-mozc-2.28.4750.102 -- updated to version-2.28.4750.102
更新 :  2022-07072 23:00
fcitx5-mozc-2.28.4780.102 -- updated to version-2.28.4780.102


fcitx5-mozc.SlackBuild
[code]
#!/bin/sh
# Slackware build script for fcitx-mozc
# Issued under The MIT License (MIT)
#
# Copyright 2016 Kuro_CODE25
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

PRGNAM=fcitx5-mozc
VERSION=${VERSION:-2.28.4780.102.1}
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}
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
# source rev. and version.
ZIPCODE_REL=202110
ABSEIL_CPP_REV=eb3db08cb3a4faf2aa09a2ba4a30b442457f36cf
BREAKPAD_REV=c685fe1153193853cff23e83d6d2b2c577aaa5f6
GOOGLETEST_REV=703bd9caab50b139428cea1aaff9974ebee5742e
JSONCPP_REV=42e892d96e47b1f6e29844cc705e148ec4856448
PROTOBUF_REV=b5a35bcc7e4cc4ff00eb105449b300fca3a8b0d2
GYP_REV=caa60026e223fc501e8b337fd5086ece4028b1c6
JAPANESE_USAGE_DICT_REV=e5b3425575734c323e1d947009dd74709437b684
# 2.28.4750 # MOZC_REV=56582ade9a5ffd30b9c588dad6e0fe280fee1979
MOZC_REV=47df743687b1768f209e877f4ff09a4956fc4342

# Download sources
wget https://github.com/chromium/gyp/archive/${GYP_REV}/gyp-${GYP_REV}.zip
wget https://github.com/fcitx/mozc/archive/${MOZC_REV}/mozc-${MOZC_REV}.zip
wget https://github.com/hiroyuki-komatsu/japanese-usage-dictionary/archive/${JAPANESE_USAGE_DICT_REV}/japanese-usage-dictionary-${JAPANESE_USAGE_DICT_REV}.zip
wget https://github.com/protocolbuffers/protobuf/archive/${PROTOBUF_REV}/protobuf-${PROTOBUF_REV}.zip
wget https://github.com/abseil/abseil-cpp/archive/${ABSEIL_CPP_REV}/abseil-cpp-${ABSEIL_CPP_REV}.zip
wget https://chromium.googlesource.com/breakpad/breakpad/+archive/${BREAKPAD_REV}.tar.gz
wget https://github.com/google/googletest/archive/${GOOGLETEST_REV}/googletest-${GOOGLETEST_REV}.zip
wget https://github.com/open-source-parsers/jsoncpp/archive/${JSONCPP_REV}/jsoncpp-${JSONCPP_REV}.zip

wget https://osdn.net/projects/ponsfoot-aur/storage/mozc/jigyosyo-${ZIPCODE_REL}.zip
wget https://osdn.net/projects/ponsfoot-aur/storage/mozc/x-ken-all-${ZIPCODE_REL}.zip
wget https://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-icon.tar.gz

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/x-ken-all-$ZIPCODE_REL.zip
unzip $CWD/jigyosyo-$ZIPCODE_REL.zip
unzip $CWD/abseil-cpp-$ABSEIL_CPP_REV.zip
unzip $CWD/googletest-$GOOGLETEST_REV.zip
unzip $CWD/jsoncpp-$JSONCPP_REV.zip
unzip $CWD/mozc-$MOZC_REV.zip
unzip $CWD/japanese-usage-dictionary-$JAPANESE_USAGE_DICT_REV.zip
unzip $CWD/gyp-$GYP_REV.zip
unzip $CWD/protobuf-$PROTOBUF_REV.zip
# untar breakpad to breakpad directory
mkdir breakpad
tar xvf ${CWD}/${BREAKPAD_REV}.tar.gz -C breakpad

# extact tar file
tar -xvf ${CWD}/fcitx-mozc-icon.tar.gz

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

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 fcitx4 target
#rm unix/fcitx/fcitx.gyp

# 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/x-ken-all-$ZIPCODE_REL.zip
unzip -d src/data/dictionary_oss $CWD/jigyosyo-$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."

# Copy third party deps
echo "Copy third party deps ..."
cd $BLDBASEDIR/mozc
# fix QT_BBASE_PATH QT_BIN_PATH
#patch -p1 < $CWD/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.


# fix libdir path of fcitx5-mozc.so for Slackware
patch -p1 < $CWD/02_install_fcitx5_libdir.diff

cd ..
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..."

# export JAVA_HOME
export JAVA_HOME=/usr/lib64/jdk11-11.0.14
# Build
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 emacs_helper
install -Dm644 ../LICENSE $PKG/usr/share/licenses/emacs-mozc/LICENSE
install -Dm644 data/installer/credits_en.html  $PKG/usr/share/licenses/emacs-mozc/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

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION

cp $CWD/sources.url $CWD/init.el_mozc $CWD/README.emacs $PKG/usr/doc/$PRGNAM-$VERSION/
cp $CWD/*.diff $PKG/usr/doc/$PRGNAM-$VERSION/
cp $CWD/$PRGNAM.SlackBuild $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

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

### clean-up work directory
echo "Clean up working directory ..."
#for dep in abseil-cpp breakpad googletest jsoncpp gyp protobuf japanese_usage_dictionary
#do
#  rm -rf $CWD/$dep
#done
rm -rf $CWD/*.zip $CWD/*.tar.gz

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


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)


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:


引き続き更新予定








(2) HPLIP with libImageProcessor

Slackware64-15.0用 HPLIP package (libImageProcessor有りバージョン) -- custom仕様

・libImageProcessorを有効にした hplipパッケージ仕様
  1) 0030-hplip-install-libImageProcessor.patch を適用してコンパイルする
  2)  /usr/lib64/cups/filter/hpcups は libImageProcessorを必要とするバイナリとして作成される

※ If you want to disable libImageProcessor, refer other SlackBuild and patch .

hplip.SlackBuild
[Update: 2022-11-10] Version bump to 3.22.10
[code]
#!/bin/bash

# Slackware build script for hplip

# Copyright 2006-2010  Robby Workman, Northport, Alabama, USA
# Copyright 2006-2018  Patrick J. Volkerding, Sebeka, MN, USA
# 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)

PKGNAM=hplip
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
BUILD=${BUILD:-1} # with 0030-hplip-install-libImageProcessor.patch

NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}

# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) export ARCH=i586 ;;
    arm*) export ARCH=arm ;;
    # Unless $ARCH is already set, use uname -m for all other archs:
       *) export 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 "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
  exit 0
fi

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

TMP=${TMP:-/tmp}
PKG=$TMP/package-$PKGNAM

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

cd $TMP
rm -rf $PKGNAM-$VERSION
tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
cd $PKGNAM-$VERSION || exit 1

# Upgrades should not be done outside the package system:
zcat $CWD/hplip.no.upgrade.diff.gz | patch -p1 --verbose || exit 1

# Set LC_ALL=C to fix issues with CUPS output parsing in hp-setup:
zcat $CWD/setup.py.lc_all.c.diff.gz | patch -p1 --verbose || exit 1

# Fix a few .py files lacking #!/usr/bin/python3:
zcat $CWD/hplip.python3.shebang.diff.gz | patch -p1 --verbose || exit 1

# Fix the desktop file to show correct icon and category
zcat $CWD/fix-desktop-file.patch.gz | patch -p1 --verbose || exit 1

# Fix for deprecated python function:
#zcat $CWD/hplip.is_alive.diff.gz | patch -p1 --verbose || exit 1

# Patch for Python 3.10:
#zcat $CWD/hplip.python3.10.diff.gz | patch -p1 --verbose || exit 1

# Choose correct options depending on whether PAM is installed:
if [ -L /lib${LIBDIRSUFFIX}/libpam.so.? ]; then
  unset SHADOW_OPTIONS
else
  SHADOW_OPTIONS="--enable-shadow-build"
fi

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

find -name '*.py' -print0 | xargs -0 \
    sed -i.env-python -e 's,^#!/usr/bin/env python,#!/usr/bin/python3,'
sed -i.env-python -e 's,^#!/usr/bin/env python,#!/usr/bin/python3,' \
    prnt/filters/hpps \
    fax/filters/pstotiff

# Forget it folks - this ImageProcessor closed-source blob is broken, and there
# is no way to fix it. We will use this patch from Debian to remove it from
# hplip, reverting to the way things worked in the 3.18.6 release. If HP ever
# sees fit to make ImageProcessor mandatory, we'll likely stick with the last
# hplip release that can be made to work without it, and any HP printers that
# require a newer version of hplip will not be supported.
#
#zcat $CWD/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch.gz | patch -p1 -l --verbose || exit 1
#zcat $CWD/0028-Remove-ImageProcessor-binary-installs.patch.gz | patch -p1 -l --verbose || exit 1

# Now, this patch will enable libImageProcessor and include libImageProcessor library in the package
zcat $CWD/0030-hplip-install-libImageProcessor.patch.gz | patch -p1 -l --verbose || exit 1

# Add a cups-2.2.x header since some definitions were moved:
zcat $CWD/0021-Add-include-cups-ppd.h-in-various-places-as-CUPS-2.2.patch.gz | patch -p1 -l --verbose || exit 1

# autoreconf will fail if these files do not exist:
for file in NEWS README AUTHORS ChangeLog ; do
  if [ ! -r $file ]; then
    touch $file
  fi
done

# Needed because Makefile.am was patched:
autoreconf -vif || exit 1

CFLAGS="$SLKCFLAGS -I/usr/include/python3.9" \
CXXFLAGS="$SLKCFLAGS" \
PYTHON=/usr/bin/python3 \
./configure \
  --prefix=/usr \
  --libdir=/usr/lib${LIBDIRSUFFIX} \
  --with-cupsbackenddir=/usr/lib${LIBDIRSUFFIX}/cups/backend \
  --with-cupsfilterdir=/usr/lib${LIBDIRSUFFIX}/cups/filter \
  --sysconfdir=/etc \
  --localstatedir=/var \
  --docdir=/usr/doc/hplip-$VERSION \
  --with-docdir=/usr/doc/hplip-$VERSION \
  --with-htmldir=/usr/doc/hplip-$VERSION/html \
  --with-hpppddir=/usr/share/ppd/HP \
  --with-drvdir=/usr/share/cups/drv/HP \
  --enable-hpijs-install \
  $SHADOW_OPTIONS \
  --enable-scan-build \
  --enable-gui-build \
  --enable-fax-build \
  --enable-doc-build \
  --enable-foomatic-rip-hplip-install \
  --enable-pp-build \
  --disable-foomatic-ppd-install \
  --enable-foomatic-drv-install \
  --enable-network-build=yes \
  --enable-qt5 \
  --enable-policykit \
  --enable-cups-ppd-install \
  --build=$ARCH-slackware-linux \
  --host=$ARCH-slackware-linux \
  || exit 1

make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG rulesdir=/lib/udev/rules.d || exit 1

# Move dbus configs to system location:
mkdir -p $PKG/usr/share/dbus-1/system.d/
mv $PKG/etc/dbus-1/system.d/* $PKG/usr/share/dbus-1/system.d/
rmdir --parents $PKG/etc/dbus-1/system.d/

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

#cp $CWD/hp_logo.png $PKG/usr/share/hplip/data/images/128x128/hp_logo.png

# 3.16.8 is not making this directory even though several scripts
# continue to make use of it:
mkdir -p $PKG/var/lib/hp/

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

# No thanks, we don't replace/add files which are part of other packages
rm -rf $PKG/etc/sane.d

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

cd $PKG
/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz


0030-hplip-install-libImageProcessor.patch.gz
[code]
diff -Nru a/Makefile.am b/Makefile.am
--- a/Makefile.am    2022-03-09 21:00:40.631557427 +0900
+++ b/Makefile.am    2022-03-09 21:18:29.442542175 +0900
@@ -688,14 +688,14 @@
 install-data-hook:
 if HPLIP_BUILD
     if [ \( "$(UNAME)" = "x86_64" -a  -d "$(libdir)/" \) ]; then \
-        cp prnt/hpcups/libImageProcessor-x86_64.so $(libdir)/ ; \
-        chmod 775 $(libdir)/libImageProcessor-x86_64.so ; \
-        ln -sf $(libdir)/libImageProcessor-x86_64.so $(libdir)/libImageProcessor.so ; \
+        cp prnt/hpcups/libImageProcessor-x86_64.so $(DESTDIR)/$(libdir)/ ; \
+        chmod 775 $(DESTDIR)/$(libdir)/libImageProcessor-x86_64.so ; \
+        ln -sf libImageProcessor-x86_64.so $(DESTDIR)/$(libdir)/libImageProcessor.so ; \
     fi; \
     if [ \( \( "$(UNAME)" = "i686" -o "$(UNAME)" = "i386" \) -a -d "$(libdir)/" \) ]; then \
-        cp prnt/hpcups/libImageProcessor-x86_32.so $(libdir)/ ; \
-        chmod 775 $(libdir)/libImageProcessor-x86_32.so ; \
-        ln -sf $(libdir)/libImageProcessor-x86_32.so $(libdir)/libImageProcessor.so ; \
+        cp prnt/hpcups/libImageProcessor-x86_32.so $(DESTDIR)/$(libdir)/ ; \
+        chmod 775 $(DESTDIR)/$(libdir)/libImageProcessor-x86_32.so ; \
+        ln -sf libImageProcessor-x86_32.so $(DESTDIR)/$(libdir)/libImageProcessor.so ; \
     fi
     if [ -d "/usr/share/ipp-usb/quirks/" ]; then \
         echo "ipp-usb directory exists"; \
diff -Nru a/Makefile.in b/Makefile.in
--- a/Makefile.in    2022-03-09 21:00:27.743557610 +0900
+++ b/Makefile.in    2022-03-09 21:14:21.126545719 +0900
@@ -9799,14 +9799,14 @@
 
 install-data-hook:
 @HPLIP_BUILD_TRUE@    if [ \( "$(UNAME)" = "x86_64" -a  -d "$(libdir)/" \) ]; then \
-@HPLIP_BUILD_TRUE@        cp prnt/hpcups/libImageProcessor-x86_64.so $(libdir)/ ; \
-@HPLIP_BUILD_TRUE@        chmod 775 $(libdir)/libImageProcessor-x86_64.so ; \
-@HPLIP_BUILD_TRUE@        ln -sf $(libdir)/libImageProcessor-x86_64.so $(libdir)/libImageProcessor.so ; \
+@HPLIP_BUILD_TRUE@        cp prnt/hpcups/libImageProcessor-x86_64.so $(DESTDIR)/$(libdir)/ ; \
+@HPLIP_BUILD_TRUE@        chmod 775 $(DESTDIR)/$(libdir)/libImageProcessor-x86_64.so ; \
+@HPLIP_BUILD_TRUE@        ln -sf libImageProcessor-x86_64.so $(DESTDIR)/$(libdir)/libImageProcessor.so ; \
 @HPLIP_BUILD_TRUE@    fi; \
 @HPLIP_BUILD_TRUE@    if [ \( \( "$(UNAME)" = "i686" -o "$(UNAME)" = "i386" \) -a -d "$(libdir)/" \) ]; then \
-@HPLIP_BUILD_TRUE@        cp prnt/hpcups/libImageProcessor-x86_32.so $(libdir)/ ; \
-@HPLIP_BUILD_TRUE@        chmod 775 $(libdir)/libImageProcessor-x86_32.so ; \
-@HPLIP_BUILD_TRUE@        ln -sf $(libdir)/libImageProcessor-x86_32.so $(libdir)/libImageProcessor.so ; \
+@HPLIP_BUILD_TRUE@        cp prnt/hpcups/libImageProcessor-x86_32.so $(DESTDIR)/$(libdir)/ ; \
+@HPLIP_BUILD_TRUE@        chmod 775 $(DESTDIR)/$(libdir)/libImageProcessor-x86_32.so ; \
+@HPLIP_BUILD_TRUE@        ln -sf libImageProcessor-x86_32.so $(DESTDIR)/$(libdir)/libImageProcessor.so ; \
 @HPLIP_BUILD_TRUE@    fi
 @HPLIP_BUILD_TRUE@    if [ -d "/usr/share/ipp-usb/quirks/" ]; then \
 @HPLIP_BUILD_TRUE@        echo "ipp-usb directory exists"; \



(1) HPLIP without libImageProcessor

Slackware64-15.0用 HPLIP package (linImageProcessor無しバージョン) -- slackware標準仕様

・slackware標準のhplipパッケージ仕様
  1) 0028-Remove-ImageProcessor-binary-installs.patch を適用して --disable-imageProcessor-build
      オプション付きでコンパイルすることで /usr/lib64/に libImageProcessorライブラリを作らない
  2) 且つ、 /usr/lib64/cups/filter/hpcups が libImageProcessorを必要としないバイナリとして作成される

hplip.SlackBuild
[Update: 2022-11-10] I confirmed that the script and patch worked for the latest HPLIP-3.22.10
[code]
#!/bin/bash

# Slackware build script for hplip

# Copyright 2006-2010  Robby Workman, Northport, Alabama, USA
# Copyright 2006-2018  Patrick J. Volkerding, Sebeka, MN, USA
# 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)

PKGNAM=hplip
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
BUILD=${BUILD:-1} # with "--disable-imageProcessor-build" and 0028-Remove-ImageProcessor-binary-installs.patch

NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}

# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) export ARCH=i586 ;;
    arm*) export ARCH=arm ;;
    # Unless $ARCH is already set, use uname -m for all other archs:
       *) export 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 "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
  exit 0
fi

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

TMP=${TMP:-/tmp}
PKG=$TMP/package-$PKGNAM

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

cd $TMP
rm -rf $PKGNAM-$VERSION
tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
cd $PKGNAM-$VERSION || exit 1

# Upgrades should not be done outside the package system:
zcat $CWD/hplip.no.upgrade.diff.gz | patch -p1 --verbose || exit 1

# Set LC_ALL=C to fix issues with CUPS output parsing in hp-setup:
zcat $CWD/setup.py.lc_all.c.diff.gz | patch -p1 --verbose || exit 1

# Fix a few .py files lacking #!/usr/bin/python3:
zcat $CWD/hplip.python3.shebang.diff.gz | patch -p1 --verbose || exit 1

# Fix the desktop file to show correct icon and category
zcat $CWD/fix-desktop-file.patch.gz | patch -p1 --verbose || exit 1

# Fix for deprecated python function:
#zcat $CWD/hplip.is_alive.diff.gz | patch -p1 --verbose || exit 1

# Patch for Python 3.10:
#zcat $CWD/hplip.python3.10.diff.gz | patch -p1 --verbose || exit 1

# Choose correct options depending on whether PAM is installed:
if [ -L /lib${LIBDIRSUFFIX}/libpam.so.? ]; then
  unset SHADOW_OPTIONS
else
  SHADOW_OPTIONS="--enable-shadow-build"
fi

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

find -name '*.py' -print0 | xargs -0 \
    sed -i.env-python -e 's,^#!/usr/bin/env python,#!/usr/bin/python3,'
sed -i.env-python -e 's,^#!/usr/bin/env python,#!/usr/bin/python3,' \
    prnt/filters/hpps \
    fax/filters/pstotiff

# Forget it folks - this ImageProcessor closed-source blob is broken, and there
# is no way to fix it. We will use this patch from Debian to remove it from
# hplip, reverting to the way things worked in the 3.18.6 release. If HP ever
# sees fit to make ImageProcessor mandatory, we'll likely stick with the last
# hplip release that can be made to work without it, and any HP printers that
# require a newer version of hplip will not be supported.
#
#zcat $CWD/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch.gz | patch -p1 -l --verbose || exit 1
zcat $CWD/0028-Remove-ImageProcessor-binary-installs.patch.gz | patch -p1 -l --verbose || exit 1

# Add a cups-2.2.x header since some definitions were moved:
zcat $CWD/0021-Add-include-cups-ppd.h-in-various-places-as-CUPS-2.2.patch.gz | patch -p1 -l --verbose || exit 1

# autoreconf will fail if these files do not exist:
for file in NEWS README AUTHORS ChangeLog ; do
  if [ ! -r $file ]; then
    touch $file
  fi
done

# Needed because Makefile.am was patched:
autoreconf -vif || exit 1

CFLAGS="$SLKCFLAGS -I/usr/include/python3.9" \
CXXFLAGS="$SLKCFLAGS" \
PYTHON=/usr/bin/python3 \
./configure \
  --prefix=/usr \
  --libdir=/usr/lib${LIBDIRSUFFIX} \
  --with-cupsbackenddir=/usr/lib${LIBDIRSUFFIX}/cups/backend \
  --with-cupsfilterdir=/usr/lib${LIBDIRSUFFIX}/cups/filter \
  --sysconfdir=/etc \
  --localstatedir=/var \
  --docdir=/usr/doc/hplip-$VERSION \
  --with-docdir=/usr/doc/hplip-$VERSION \
  --with-htmldir=/usr/doc/hplip-$VERSION/html \
  --with-hpppddir=/usr/share/ppd/HP \
  --with-drvdir=/usr/share/cups/drv/HP \
  --enable-hpijs-install \
  --disable-imageProcessor-build \
  $SHADOW_OPTIONS \
  --enable-scan-build \
  --enable-gui-build \
  --enable-fax-build \
  --enable-doc-build \
  --enable-foomatic-rip-hplip-install \
  --enable-pp-build \
  --disable-foomatic-ppd-install \
  --enable-foomatic-drv-install \
  --enable-network-build=yes \
  --enable-qt5 \
  --enable-policykit \
  --enable-cups-ppd-install \
  --build=$ARCH-slackware-linux \
  --host=$ARCH-slackware-linux \
  || exit 1

make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG rulesdir=/lib/udev/rules.d || exit 1

# Move dbus configs to system location:
mkdir -p $PKG/usr/share/dbus-1/system.d/
mv $PKG/etc/dbus-1/system.d/* $PKG/usr/share/dbus-1/system.d/
rmdir --parents $PKG/etc/dbus-1/system.d/

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

#cp $CWD/hp_logo.png $PKG/usr/share/hplip/data/images/128x128/hp_logo.png

# 3.16.8 is not making this directory even though several scripts
# continue to make use of it:
mkdir -p $PKG/var/lib/hp/

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

# No thanks, we don't replace/add files which are part of other packages
rm -rf $PKG/etc/sane.d

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

cd $PKG
/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz



0028-Remove-ImageProcessor-binary-installs.patch
[code]
From: Didier Raboud <odyx@debian.org>
Date: Tue, 21 Aug 2018 18:18:10 +0200
Subject: Remove ImageProcessor binary installs

---
 Makefile.am | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index efe3f17..8054011 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -167,8 +167,7 @@ if !HPLIP_CLASS_DRIVER
 dist_hplip_SCRIPTS = hpssd.py __init__.py hpdio.py
 endif #HPLIP_CLASS_DRIVER
 
-dist_noinst_DATA += prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template prnt/hpcups/libImageProcessor-x86_64.so prnt/hpcups/libImageProcessor-x86_32.so
-
+dist_noinst_DATA += prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template
 dist_noinst_DATA += prnt/ipp-usb/HPLIP.conf
 dist_noinst_SCRIPTS += dat2drv.py install.py  hplip-install init-suse-firewall init-iptables-firewall class_rpm_build.sh hplipclassdriver.spec createPPD.sh Makefile_dat2drv hpijs-drv
 
@@ -597,7 +596,7 @@ hpcups_SOURCES = prnt/hpcups/HPCupsFilter.cpp prnt/hpcups/HPCupsFilter.h prnt/hp
     prnt/hpcups/ImageProcessor.h
 
 hpcups_CXXFLAGS = $(APDK_ENDIAN_FLAG) $(DBUS_CFLAGS)
-hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lImageProcessor -lcups -lcupsimage -lz $(DBUS_LIBS)
+hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lcups -lcupsimage -lz $(DBUS_LIBS)
 #else
 #hpcupsdir = $(cupsfilterdir)
 #hpcups_PROGRAMS = hpcups
@@ -689,20 +688,6 @@ endif #HPLIP_CLASS_DRIVER
 
 install-data-hook:
 if HPLIP_BUILD
-    if [ \( "$(UNAME)" = "x86_64" -a  -d "$(libdir)/" \) ]; then \
-        cp prnt/hpcups/libImageProcessor-x86_64.so $(libdir)/ ; \
-        chmod 775 $(libdir)/libImageProcessor-x86_64.so ; \
-        ln -sf $(libdir)/libImageProcessor-x86_64.so $(libdir)/libImageProcessor.so ; \
-    fi; \
-    if [ \( \( "$(UNAME)" = "i686" -o "$(UNAME)" = "i386" \) -a -d "$(libdir)/" \) ]; then \
-        cp prnt/hpcups/libImageProcessor-x86_32.so $(libdir)/ ; \
-        chmod 775 $(libdir)/libImageProcessor-x86_32.so ; \
-        ln -sf $(libdir)/libImageProcessor-x86_32.so $(libdir)/libImageProcessor.so ; \
-    fi
-    if [ -d "/usr/share/ipp-usb/quirks/" ]; then \
-        echo "ipp-usb directory exists"; \
-        cp prnt/ipp-usb/HPLIP.conf /usr/share/ipp-usb/quirks/ ; \
-    fi
 if !HPLIP_CLASS_DRIVER
 #       If scanner build, add hpaio entry to sane dll.conf.
     if [ "$(scan_build)" = "yes" ]; then \



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