Nothin' but Slackware

バイクとLinuxに戯れる日々

2022年02月

AC600 T2U Nano ドライバで動作可能かもしれないチップ

WiFi driver of TP-Link "AC600 T2U Nano"

製品名
(型番)
メーカー vendor_ID
(xxxx:xxxx)
Linux Ready
 (○/ ×)
kernel
driver
External
 driver
driver LINK 注記
AC600
T2U Nano
TP-Link
2357:011e
---
88XXau
https://github.com/aircrack-ng/rtl8812au

supports kernel-5.18
AC600
T2U Plus
TP-Link
2357:0120
---
88XXau
https://github.com/aircrack-ng/rtl8812au supports kernel-5.18


とりあえずメモ (あくまでも 動作する「かもしれない」リスト


Supported devices (vendor ID)
From
         rtl8812au_source/os_dep/linux/usb_intf.c
[code]
#ifdef CONFIG_RTL8812A
        /*=== Realtek demoboard ===*/
        {USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8812), .driver_info = RTL8812}, /* Default ID */
        {USB_DEVICE(USB_VENDER_ID_REALTEK, 0x881A), .driver_info = RTL8812}, /* Default ID */
        {USB_DEVICE(USB_VENDER_ID_REALTEK, 0x881B), .driver_info = RTL8812}, /* Default ID */
        {USB_DEVICE(USB_VENDER_ID_REALTEK, 0x881C), .driver_info = RTL8812}, /* Default ID */
        /*=== Customer ID ===*/
        {USB_DEVICE(0x0409, 0x0408), .driver_info = RTL8812}, /* NEC - */
        {USB_DEVICE(0x0411, 0x025D), .driver_info = RTL8812}, /* Buffalo - WI-U3-866D */
        {USB_DEVICE(0x04BB, 0x0952), .driver_info = RTL8812}, /* I-O DATA - Edimax */
        {USB_DEVICE(0x050D, 0x1106), .driver_info = RTL8812}, /* Belkin - sercomm */
        {USB_DEVICE(0x050D, 0x1109), .driver_info = RTL8812}, /* Belkin F9L1109 - SerComm */
        {USB_DEVICE(0x0586, 0x3426), .driver_info = RTL8812}, /* ZyXEL - */
        {USB_DEVICE(0x0789, 0x016E), .driver_info = RTL8812}, /* Logitec - Edimax */
        {USB_DEVICE(0x07B8, 0x8812), .driver_info = RTL8812}, /* Abocom - Abocom */
        {USB_DEVICE(0x0846, 0x9051), .driver_info = RTL8812}, /* Netgear A6200 v2 */
        {USB_DEVICE(0x0B05, 0x17D2), .driver_info = RTL8812}, /* ASUS - Edimax */
        {USB_DEVICE(0x0DF6, 0x0074), .driver_info = RTL8812}, /* Sitecom - Edimax */
        {USB_DEVICE(0x0E66, 0x0022), .driver_info = RTL8812}, /* HAWKING - Edimax */
        {USB_DEVICE(0x1058, 0x0632), .driver_info = RTL8812}, /* WD - Cybertan */
        {USB_DEVICE(0x13B1, 0x003F), .driver_info = RTL8812}, /* Linksys - WUSB6300 */
        {USB_DEVICE(0x148F, 0x9097), .driver_info = RTL8812}, /* Amped Wireless ACA1 */
        {USB_DEVICE(0x1740, 0x0100), .driver_info = RTL8812}, /* EnGenius - EnGenius */
        {USB_DEVICE(0x2001, 0x330E), .driver_info = RTL8812}, /* D-Link - ALPHA */
        {USB_DEVICE(0x2001, 0x3313), .driver_info = RTL8812}, /* D-Link - ALPHA */
        {USB_DEVICE(0x2001, 0x3315), .driver_info = RTL8812}, /* D-Link - Cameo */
        {USB_DEVICE(0x2001, 0x3316), .driver_info = RTL8812}, /* D-Link - Cameo */
        {USB_DEVICE(0x2019, 0xAB30), .driver_info = RTL8812}, /* Planex - Abocom */
        {USB_DEVICE(0x20F4, 0x805B), .driver_info = RTL8812}, /* TRENDnet - */
        {USB_DEVICE(0x2357, 0x0101), .driver_info = RTL8812}, /* TP-Link - Archer T4U AC1200 */
        {USB_DEVICE(0x2357, 0x0103), .driver_info = RTL8812}, /* TP-Link - T4UH */
        {USB_DEVICE(0x2357, 0x010D), .driver_info = RTL8812}, /* TP-Link - Archer T4U AC1300 */
        {USB_DEVICE(0x2357, 0x010E), .driver_info = RTL8812}, /* TP-Link - Archer T4UH AC1300 */
        {USB_DEVICE(0x2357, 0x010F), .driver_info = RTL8812}, /* TP-Link - T4UHP */
        {USB_DEVICE(0x2357, 0x0122), .driver_info = RTL8812}, /* TP-Link - T4UHP (other) */
        {USB_DEVICE(0x2604, 0x0012), .driver_info = RTL8812}, /* Tenda U12 */
        {USB_DEVICE(0x7392, 0xA822), .driver_info = RTL8812}, /* Edimax - Edimax */
#endif



[code]
#ifdef CONFIG_RTL8821A
        /*=== Realtek demoboard ===*/
        {USB_DEVICE(USB_VENDER_ID_REALTEK, 0x0811), .driver_info = RTL8821}, /* Default ID */
        {USB_DEVICE(USB_VENDER_ID_REALTEK, 0x0821), .driver_info = RTL8821}, /* Default ID */
        {USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8822), .driver_info = RTL8821}, /* Default ID */
        {USB_DEVICE(USB_VENDER_ID_REALTEK, 0xA811) , .driver_info = RTL8821},/* Default ID */
        {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0x0820, 0xff, 0xff, 0xff), .driver_info = RTL8821}, /* 8821AU */
        {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0x0823, 0xff, 0xff, 0xff), .driver_info = RTL8821}, /* 8821AU */
        /*=== Customer ID ===*/
        {USB_DEVICE(0x0411, 0x0242), .driver_info = RTL8821}, /* ELECOM - WDC-433DU2H */
        {USB_DEVICE(0x0411, 0x029B), .driver_info = RTL8821}, /* Buffalo - WI-U2-433DHP */
        {USB_DEVICE(0x04BB, 0x0953), .driver_info = RTL8821}, /* I-O DATA - Edimax */
        {USB_DEVICE(0x056E, 0x4007), .driver_info = RTL8821}, /* Elecom - WDC-433DU2HBK */
        {USB_DEVICE(0x056E, 0x400E), .driver_info = RTL8821}, /* ELECOM -  ELECOM */
        {USB_DEVICE(0x056E, 0x400F), .driver_info = RTL8821}, /* ELECOM -  ELECOM */
        {USB_DEVICE(0x0846, 0x9052), .driver_info = RTL8821}, /* Netgear - A6100 */
        {USB_DEVICE(0x0E66, 0x0023), .driver_info = RTL8821}, /* HAWKING - Edimax */
        {USB_DEVICE(0x2001, 0x3314), .driver_info = RTL8821}, /* D-Link - Cameo */
        {USB_DEVICE(0x2001, 0x3318), .driver_info = RTL8821}, /* D-Link - Cameo */
        {USB_DEVICE(0x2019, 0xAB32), .driver_info = RTL8821}, /* Planex - GW-450S */
        {USB_DEVICE(0x2357, 0x011E), .driver_info = RTL8821}, /* TP Link - T2U Nano */
        {USB_DEVICE(0x2357, 0x011F), .driver_info = RTL8821}, /* TP-Link - Archer AC600 T2U Nano */
        {USB_DEVICE(0x2357, 0x0120), .driver_info = RTL8821}, /* TP Link - T2U Plus */
        {USB_DEVICE(0x3823, 0x6249), .driver_info = RTL8821}, /* Obihai - OBiWiFi */
        {USB_DEVICE(0x7392, 0xA811), .driver_info = RTL8821}, /* Edimax - Edimax */
        {USB_DEVICE(0x7392, 0xA812), .driver_info = RTL8821}, /* Edimax - EW-7811UTC */
        {USB_DEVICE(0x7392, 0xA813), .driver_info = RTL8821}, /* Edimax - EW-7811UAC */
        {USB_DEVICE(0x7392, 0xB611), .driver_info = RTL8821}, /* Edimax - EW-7811UCB */
#endif



[code]
#ifdef CONFIG_RTL8814A
        {USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8813), .driver_info = RTL8814A},
        {USB_DEVICE(0x0B05, 0x1817), .driver_info = RTL8814A}, /* ASUS - ASUSTeK */
        {USB_DEVICE(0x0B05, 0x1852), .driver_info = RTL8814A}, /* ASUS - ASUSTeK */
        {USB_DEVICE(0x0B05, 0x1853), .driver_info = RTL8814A}, /* ASUS - ASUSTeK */
        {USB_DEVICE(0x056E, 0x400B), .driver_info = RTL8814A}, /* ELECOM - ELECOM */
        {USB_DEVICE(0x056E, 0x400D), .driver_info = RTL8814A}, /* ELECOM - ELECOM */
        {USB_DEVICE(0x0846, 0x9054), .driver_info = RTL8814A}, /* Netgear A7000 */
        {USB_DEVICE(0x0E66, 0x0026), .driver_info = RTL8814A}, /* Hawking Technologies - HW17ACU*/
        {USB_DEVICE(0x2001, 0x331A), .driver_info = RTL8814A}, /* D-Link - D-Link */
        {USB_DEVICE(0x20F4, 0x809A), .driver_info = RTL8814A}, /* TRENDnet - TRENDnet */
        {USB_DEVICE(0x20F4, 0x809B), .driver_info = RTL8814A}, /* TRENDnet TEW-809UB */
        {USB_DEVICE(0x2357, 0x0106), .driver_info = RTL8814A}, /* TP-LINK Archer T9UH */
        {USB_DEVICE(0x7392, 0xA834), .driver_info = RTL8814A}, /* Edimax - Edimax */
        {USB_DEVICE(0x7392, 0xA833), .driver_info = RTL8814A}, /* Edimax - AC1750 */
#endif /* CONFIG_RTL8814A */




===
編集中



D-Link DWA-X1850 ( rtw8852au_kernel-5.16.patch )

D-Link DWA-X1850  をカーネル 5.16環境で動作させたいというユーザーさんの質問に対して
手探りで作成した rtw8852au_kernel-5.16.patch を提案したところ、動作したとの報告をいただいた。

わたしはD-Link DWA-X1850ハードウェアを所有していないので(というか、日本では発売されていない)、
手元 slackware64-15.0 環境では動作確認も出来ないうえにこのpatchによる予想外の不具合等のチェックもできないが、
いちおう記録としてここに書いておくことにする。

D-Link DWA-X1850について:
 Wi-Fi 6(正式規格名「IEEE 802.11ax」)対応の USB 3.0 dongle で、
 5GHz帯でIEEE 802.11axによる最大1,200Mbps、2.4GHz帯で同600Mbpsの通信に対応する
 「AX1800」クラスに属し、MU-MIMO・OFDMAおよびWPA3をサポートしている、とのこと。
D-Link_DWA-X1850

Driver github :
 
Slackware Forumの関連スレッド:

rtw8852au_kernel-5.16.patch:
[code]
--- RTL8852AU_WiFi_linux_v1.15.0.1-0-g487ee886.20210714-dwa-x1850/core/rtw_br_ext.c    2021-12-04 17:39:48.000000000 +0900
+++ RTL8852AU_WiFi_linux_v1.15.0.1-0-g487ee886.20210714-dwa-x1850.new/core/rtw_br_ext.c    2022-02-13 20:41:20.076717012 +0900
@@ -17,7 +17,10 @@
 #ifdef __KERNEL__
     #include <linux/if_arp.h>
     #include <net/ip.h>
+    #include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)
     #include <net/ipx.h>
+#endif
     #include <linux/atalk.h>
     #include <linux/udp.h>
     #include <linux/if_pppox.h>
@@ -159,6 +162,7 @@
 }
 
 
+#ifdef _NET_INET_IPX_H_
 static __inline__ void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr,
         unsigned int *ipAddr)
 {
@@ -189,6 +193,7 @@
     _rtw_memcpy(networkAddr + 1, (unsigned char *)ipxNetAddr, 4);
     _rtw_memcpy(networkAddr + 5, (unsigned char *)ipxSocketAddr, 2);
 }
+#endif
 
 
 static __inline__ void __nat25_generate_apple_network_addr(unsigned char *networkAddr,
@@ -330,6 +335,7 @@
         x = networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10];
 
         return x & (NAT25_HASH_SIZE - 1);
+#ifdef _NET_INET_IPX_H_
     } else if (networkAddr[0] == NAT25_IPX) {
         unsigned long x;
 
@@ -337,6 +343,7 @@
             networkAddr[6] ^ networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10];
 
         return x & (NAT25_HASH_SIZE - 1);
+#endif
     } else if (networkAddr[0] == NAT25_APPLE) {
         unsigned long x;
 
@@ -782,7 +789,7 @@
             if (iph->saddr == 0)
                 return 0;
             RTW_INFO("NAT25: Insert IP, SA=%08x, DA=%08x\n", iph->saddr, iph->daddr);
-            __nat25_generate_ipv4_network_addr(networkAddr, &iph->saddr);
+            __nat25_generate_ipv6_network_addr(networkAddr, &iph->saddr);
             /* record source IP address and , source mac address into db */
             __nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr);
 
@@ -800,7 +807,7 @@
                  (OPMODE & WIFI_ADHOC_STATE)))
 #endif
             {
-                __nat25_generate_ipv4_network_addr(networkAddr, &iph->daddr);
+                __nat25_generate_ipv6_network_addr(networkAddr, &iph->daddr);
 
                 if (!__nat25_db_network_lookup_and_replace(priv, skb, networkAddr)) {
                     if (*((unsigned char *)&iph->daddr + 3) == 0xff) {
@@ -854,7 +861,7 @@
             arp_ptr += arp->ar_hln;
             sender = (unsigned int *)arp_ptr;
 
-            __nat25_generate_ipv4_network_addr(networkAddr, sender);
+            __nat25_generate_ipv6_network_addr(networkAddr, sender);
 
             __nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr);
 
@@ -870,7 +877,7 @@
             arp_ptr += (arp->ar_hln + arp->ar_pln);
             target = (unsigned int *)arp_ptr;
 
-            __nat25_generate_ipv4_network_addr(networkAddr, target);
+            __nat25_generate_ipv6_network_addr(networkAddr, target);
 
             __nat25_db_network_lookup_and_replace(priv, skb, networkAddr);
 
@@ -886,6 +893,7 @@
         }
     }
 
+#ifdef _NET_INET_IPX_H_
     /*---------------------------------------------------*/
     /*         Handle IPX and Apple Talk frame          */
     /*---------------------------------------------------*/
@@ -1106,6 +1114,7 @@
 
         return -1;
     }
+#endif
 
     /*---------------------------------------------------*/
     /*                Handle PPPoE frame                */
@@ -1558,7 +1567,7 @@
 
     /* _rtw_spinlock_bh(&priv->br_ext_lock); */
 
-    __nat25_generate_ipv4_network_addr(networkAddr, (unsigned int *)ipAddr);
+    __nat25_generate_ipv6_network_addr(networkAddr, (unsigned int *)ipAddr);
     hash = __nat25_network_hash(networkAddr);
     db = priv->nethash[hash];
     while (db != NULL) {



※ はたして役に立つかわからないが、将来のため...
  本ドライバで対応可能なチップの Vendor ID情報は以下。
 ドライバソース 「os_dep/linux/usb_intf.c」にある情報を抜粋
[code]
#define USB_VENDER_ID_REALTEK           0x0BDA
#define USB_VENDER_ID_ASUS              0x0B05
#define USB_VENDER_ID_DLINK             0x2001


/* DID_USB_v916_20130116 */
static struct usb_device_id rtw_usb_id_tbl[] = {
#ifdef CONFIG_RTL8852A
        /*=== Realtek demoboard ===*/
        {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0x8832, 0xff, 0xff, 0xff), .driver_info = RTL8852A},
        {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0x885A, 0xff, 0xff, 0xff), .driver_info = RTL8852A},
        {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0x885C, 0xff, 0xff, 0xff), .driver_info = RTL8852A},

        /*=== ASUS USB-AX56 =======*/
        {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_ASUS,    0x1997, 0xff, 0xff, 0xff), .driver_info = RTL8852A},

        /*=== D-Link DWA-X1850 ====*/
        {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_DLINK,   0x3321, 0xff, 0xff, 0xff), .driver_info = RTL8852A},
#endif /* CONFIG_RTL8852A */

#ifdef CONFIG_RTL8852B
        /*=== Realtek demoboard ===*/
        {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0xB832, 0xff, 0xff, 0xff), .driver_info = RTL8852B},
        {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0xB83A, 0xff, 0xff, 0xff), .driver_info = RTL8852B},
        {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0xB852, 0xff, 0xff, 0xff), .driver_info = RTL8852B},
        {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0xB85A, 0xff, 0xff, 0xff), .driver_info = RTL8852B},
#endif /* CONFIG_RTL8852B */



関連リンク)

===
編集中

vivaldi-5.1 for slackware64-15.0

==================
[更新] update to version 5.1.2567.39
==================

vivaldi は広告ブロック機能を搭載した動作軽快なブラウザです。

SBoにあるvivaldi のバージョンが少し古いので2022年2月現在最新のバージョン 5.x
パッケージ作成スクリプトにしてみました。

1. vivaldi.info (ソースリンクなど)
[code]
PRGNAM="vivaldi"
VERSION="5.1.2567.39"
HOMEPAGE="https://vivaldi.com"
DOWNLOAD="https://downloads.vivaldi.com/stable/vivaldi-stable_3.7.2218.52-1_i386.deb \
          https://launchpadlibrarian.net/528923945/chromium-codecs-ffmpeg-extra_89.0.4389.90-0ubuntu0.16.04.2_i386.deb \
          https://dl.google.com/widevine-cdm/4.10.1582.2-linux-ia32.zip"
MD5SUM="688dcaabbded8a31e70c2be6a5ba3ddf \
        00d2f09afa9447e9a506c9a4ff52bbdd \
        247a331a4d5bceb9f20366a39136a4fa"
DOWNLOAD_x86_64="https://downloads.vivaldi.com/stable/vivaldi-stable_5.1.2567.39-1_amd64.deb \
         http://ftp.riken.jp/Linux/ubuntu/pool/universe/c/chromium-browser/chromium-codecs-ffmpeg-extra_97.0.4692.71-0ubuntu0.18.04.1_amd64.deb"
MD5SUM_x86_64="2ddb9da0d04788c6b114c6aa743185ce \
               44061ec7cf21f34427cd0100716d7cb3"
REQUIRES=""
MAINTAINER="Ruari Oedegaard"
EMAIL="sbo@ruari.com"


2. get-source.sh
[code]
#!/bin/bash
## get deb package from official site
echo -e "\E[0;32mDownloading vivaldi deb package ...\E[0;0m"
wget https://downloads.vivaldi.com/stable/vivaldi-stable_5.1.2567.39-1_amd64.deb
## get extra ffmpeg support lib
echo -e "\E[0;32mDownloading extra ffmpeg support lib ...\E[0;0m"
wget http://ftp.riken.jp/Linux/ubuntu/pool/universe/c/chromium-browser/chromium-codecs-ffmpeg-extra_97.0.4692.71-0ubuntu0.18.04.1_amd64.deb


3. vivaldi.SlackBuild
    ・事前にソース(*.deb)をDLする必要はありません。SlackBuild実行の際に get-source.sh により
   ソース元から必要な *.debをカレントディレクトリにDLします。
  ・TAG=${TAG:-jw} はお好きに書き換えてください

[code]
#!/bin/bash
#
# Slackware build script for vivaldi.
#
# Copyright 2015-2017  Edinaldo P. Silva, Rio de Janeiro, Brazil.
# Copyright 2017-2019, Alexander Verbovetsky, Moscow, Russia
# Copyright 2019-2021, Ruari Oedegaard, Oslo, Norway
# 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=vivaldi
VERSION=${VERSION:-5.1.2567.39}
FFMPEG_VERSION="97.0.4692.71"
WIDEVINE_VERSION="4.10.1582.2"
BUILD=${BUILD:-1}
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

case "$ARCH" in
    i?86) BITS="i386" ; WBITS="ia32" ; PBITS="x86" ;;
  x86_64) BITS="amd64" ; WBITS="x64" ; PBITS="x64" ;;
    arm*) BITS="armhf" ;;
       *) echo "$ARCH is not supported."
          exit 1 ;;
esac

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

set -e

# Let's get sources first
sh get-source.sh

rm -rf $PKG $TMP/$PRGNAM
mkdir -p $TMP/$PRGNAM $PKG $OUTPUT
cd $TMP/$PRGNAM
ar p $CWD/${PRGNAM}-stable_${VERSION}-*_${BITS}.deb data.tar.xz | tar xvJ ./opt ./usr
ar p $CWD/chromium-codecs-ffmpeg-extra_${FFMPEG_VERSION}-*_${BITS}.deb \
  data.tar.xz | tar xOJ ./usr/lib/chromium-browser/libffmpeg.so \
  > opt/vivaldi/libffmpeg.so.${VERSION%\.*\.*}

if [ "x$BITS" = "xarmhf" ] ; then
  echo "This script doesn't support installing Widevine on ARM."
elif [ "x$BITS" = "xi386" ] ; then
  rm -f opt/vivaldi/WidevineCdm
  mkdir -p opt/vivaldi/WidevineCdm/_platform_specific/linux_${PBITS}
  unzip -oq $CWD/${WIDEVINE_VERSION}-linux-${WBITS}.zip \
    -d opt/vivaldi/WidevineCdm
  mv opt/vivaldi/WidevineCdm/libwidevinecdm.so \
    opt/vivaldi/WidevineCdm/_platform_specific/linux_${PBITS}
fi

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

rm -r opt/vivaldi/cron
mv opt usr $PKG/

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

ln -sf /opt/vivaldi/vivaldi $PKG/usr/bin/vivaldi

for res in 16 22 24 32 48 64 128 256; do
   install -Dm644 "$PKG/opt/vivaldi/product_logo_${res}.png" \
"$PKG/usr/share/icons/hicolor/${res}x${res}/apps/vivaldi.png"
done

sed \
  -e "s|vivaldi-stable|vivaldi|" \
  $PKG/usr/share/applications/vivaldi-stable.desktop \
  > $PKG/usr/share/applications/vivaldi.desktop
rm $PKG/usr/share/applications/vivaldi-stable.desktop

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
gzip -dc $PKG/usr/share/doc/vivaldi-stable/changelog.gz > \
  $PKG/usr/doc/$PRGNAM-$VERSION/ChangeLog
rm -rf $PKG/usr/share/doc
cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README
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

4. 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------------------------------------------------------|
vivaldi: vivaldi (web browser)
vivaldi:
vivaldi: A Browser for Our Friends.
vivaldi:
vivaldi: An advanced browser made with the power user in mind. Finally you
vivaldi: can surf your way.
vivaldi:
vivaldi: Home Page: https://vivaldi.com
vivaldi:
vivaldi:
vivaldi:


5. 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 -f usr/share/icons/hicolor >/dev/null 2>&1
  fi
fi


6. README
[code]
vivaldi (web browser).

A Browser for Our Friends. An advanced browser made with the power user
in mind. Finally you can surf your way.

Vivaldi for ARM/ARM64 can be downloaded from:

    https://vivaldi.com/download/archive



以上
===
2022-02-08 : 新規投稿
2022-02-09 : 更新 update to version-5.1.2567.39




Linuxでシステムバックアップ

slackware64-15.0 リリースに伴い、これから何かとシステムに手を加えていく可能性があるので
なにが起こっても直前の安定状態に戻せるように現在の手元環境のシステムバックアップを取っておきます。

1. partclone による Linuxシステムのバックアップ&リストア
 例)/dev/sda5 のslackwareを /mnt/backup/ に圧縮バックアップする
[code]
# partclone.extfs -c -s /dev/sda5 | gzip -c > /mnt/backup/image-sda5_<date>.pcl.gz

バックアップファイル名は何でも良いが、わたしは partcloneによるバックアップファイルで
gz圧縮してあることがわかるようなファイル名にしている。

 例)/mnt/backup/image-sda5_<date>.pcl.gz を /dev/sda5 にリストア(復元)する。
[code]
# zcat /mnt/backup/image-sda5_<date>.pcl.gz  | partclone.extfs -r -o /dev/sda5


2. ntfsclone による win10システムのバックアップ&リストア
 例)/dev/sda1 のwindows10を /mnt/backup/ に圧縮バックアップする
[code]
# ntfsclone -s -o - /dev/sda1 | gzip -c > /mnt/backup/image-sda1-win10_<date>.ntfsclone.gz

 例)/mnt/backup/image-sda1-win10_<date>.ntfsclone.gz を /dev/sda1 にリストア(復元)する。
[code]
# zcat /mnt/backup/image-sda1-win10_<date>.ntfsclone.gz | ntfsclone -r -O /dev/sda1 -

※ ntfsclone は ntfs-3gパッケージに含まれている。
  ntfsパーティションのバックアップは partclone.ntfsコマンドでも可能。

===
[2022/02/06]


fcitx-mozc-2.26.4360.102.1 へアップデート

なんか fcitx-mozcの記事が参照されてるっぽいので、いま使っている最新バージョンへの
アップデートスクリプトも書いておきます。

2.26-4220.102.1  -->  2.26-4360.102.1 へアップデート
※ スクリプトは必要なソースをソース元からwgetでダウンロードする方法にした。


1. fcitx-mozc.info (ソース入手先)
PRGNAM="fcitx-mozc"
VERSION="2.26.4360.102.1"
HOMEPAGE="https://fcitx-im.org"
DOWNLOAD="http://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-icon.tar.gz \
          https://osdn.net/projects/ponsfoot-aur/storage/mozc/jigyosyo-202104.zip \
          https://osdn.net/projects/ponsfoot-aur/storage/mozc/x-ken-all-202104.zip \
          https://github.com/fcitx/mozc/archive/ca82d39d08df3359fdf5c653a1f56b3e95cbe2ce/mozc-ca82d39d08df3359fdf5c653a1f56b3e95cbe2ce.zip \
          https://github.com/hiroyuki-komatsu/japanese-usage-dictionary/archive/e5b3425575734c323e1d947009dd74709437b684/japanese-usage-dictionary-e5b3425575734c323e1d947009dd74709437b684.zip \
          https://github.com/protocolbuffers/protobuf/archive/fde7cf7358ec7cd69e8db9be4f1fa6a5c431386a/protobuf-fde7cf7358ec7cd69e8db9be4f1fa6a5c431386a.zip \
          https://github.com/chromium/gyp/archive/caa60026e223fc501e8b337fd5086ece4028b1c6/gyp-caa60026e223fc501e8b337fd5086ece4028b1c6.zip \
          https://github.com/abseil/abseil-cpp/archive/0f3bb466b868b523cf1dc9b2aaaed65c77b28862/abseil-cpp-0f3bb466b868b523cf1dc9b2aaaed65c77b28862.zip \
          https://chromium.googlesource.com/breakpad/breakpad/+archive/216cea7bca53fa441a3ee0d0f5fd339a3a894224.tar.gz \
          https://github.com/open-source-parsers/jsoncpp/archive/9059f5cad030ba11d37818847443a53918c327b1/jsoncpp-9059f5cad030ba11d37818847443a53918c327b1.zip
          https://github.com/google/googletest/archive/703bd9caab50b139428cea1aaff9974ebee5742e/googletest-703bd9caab50b139428cea1aaff9974ebee5742e.zip"
MD5SUM="8ec243464ddb9ecf48924708c0448284 \
        c5f9c8f0149f5350cfd9dfcfa876aed4 \
        669ae868ea978ca06909a2d4562eaf0a \
        257fcb244249a3c65c576cceb5cbb7c8 \
        a6eb1da9ad7ceffcb9683003332abf7e \
        cb4b1baed208474284161b7abd5cc17c \
        e168f5f40cbf823c33db28e03257d63b \
        4f23c5fcb19a7ef0fb6ce0f636d480e3 \
        721ec19eb2b0bffa91e1eb94292bc7e4 \
        b697e8c85b2e41304d690ebc6bf2e1ca \
        768da4173ee9df3248b8f828747982ad"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="fcitx-configtool ninja zinnia"
MAINTAINER="Kuro_CODE25"
EMAIL="kuro.code25@gmail.com"


2. fcitx-mozc.SlackBuild
#!/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=fcitx-mozc
VERSION=${VERSION:-2.26.4360.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=202104
ABSEIL_CPP_REV=0f3bb466b868b523cf1dc9b2aaaed65c77b28862
BREAKPAD_REV=216cea7bca53fa441a3ee0d0f5fd339a3a894224
MOZC_REV=ca82d39d08df3359fdf5c653a1f56b3e95cbe2ce
GOOGLETEST_REV=703bd9caab50b139428cea1aaff9974ebee5742e
JSONCPP_REV=9059f5cad030ba11d37818847443a53918c327b1
PROTOBUF_REV=fde7cf7358ec7cd69e8db9be4f1fa6a5c431386a
GYP_REV=caa60026e223fc501e8b337fd5086ece4028b1c6
JAPANESE_USAGE_DICT_REV=e5b3425575734c323e1d947009dd74709437b684

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

# Apply Arch-linux patch
#cd $BLDBASEDIR/mozc
#patch -Np1 -i $CWD/patches/0001-fix-install_fcitx-translation-files.patch

cd $BLDBASEDIR/mozc/src

# We won't need fcitx5
rm -rf unix/fcitx5

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
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
_targets="server/server.gyp:mozc_server gui/gui.gyp:mozc_tool unix/fcitx/fcitx.gyp:fcitx-mozc unix/emacs/emacs.gyp:mozc_emacs_helper"

QTDIR=/usr GYP_DEFINES="ibus_mozc_path=/usrshare/ibus-mozc/product_icon.png ibus_mozc_icon_path=/usrshare/ibus-mozc/product_icon.png document_dir=/usr/share/licenses/$pkgname use_libzinnia=1 use_fcitx5=0" python3 build_mozc.py gyp
python3 build_mozc.py gyp --server_dir=/usr/lib/mozc
python3 build_mozc.py build  -c Release $_targets

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

BLDTYPE=Release

# install mozc to /usr/lib even if 64 bit
install -D -m 755 out_linux/${BLDTYPE}/mozc_server "${PKG}/usr/lib/mozc/mozc_server"
install    -m 755 out_linux/${BLDTYPE}/mozc_tool   "${PKG}/usr/lib/mozc/mozc_tool"

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

for mofile in out_linux/${BLDTYPE}/gen/unix/fcitx/po/*.mo
do
  filename=`basename $mofile`
  lang=${filename/.mo/}
  install -D -m 644 "$mofile" "${PKG}/usr/share/locale/$lang/LC_MESSAGES/fcitx-mozc.mo"
done

install -D -m 755 out_linux/${BLDTYPE}/fcitx-mozc.so "${PKG}/usr/lib${LIBDIRSUFFIX}/fcitx/fcitx-mozc.so"
install -D -m 644 unix/fcitx/fcitx-mozc.conf "${PKG}/usr/share/fcitx/addon/fcitx-mozc.conf"
install -D -m 644 unix/fcitx/mozc.conf "${PKG}/usr/share/fcitx/inputmethod/mozc.conf"

install -d "${PKG}/usr/share/fcitx/mozc/icon"
install -m 644 "$BLDBASEDIR/fcitx-mozc-icons/mozc.png" "${PKG}/usr/share/fcitx/mozc/icon/mozc.png"
install -m 644 "$BLDBASEDIR/fcitx-mozc-icons/mozc-alpha_full.png" "${PKG}/usr/share/fcitx/mozc/icon/mozc-alpha_full.png"
install -m 644 "$BLDBASEDIR/fcitx-mozc-icons/mozc-alpha_half.png" "${PKG}/usr/share/fcitx/mozc/icon/mozc-alpha_half.png"
install -m 644 "$BLDBASEDIR/fcitx-mozc-icons/mozc-direct.png" "${PKG}/usr/share/fcitx/mozc/icon/mozc-direct.png"
install -m 644 "$BLDBASEDIR/fcitx-mozc-icons/mozc-hiragana.png" "${PKG}/usr/share/fcitx/mozc/icon/mozc-hiragana.png"
install -m 644 "$BLDBASEDIR/fcitx-mozc-icons/mozc-katakana_full.png" "${PKG}/usr/share/fcitx/mozc/icon/mozc-katakana_full.png"
install -m 644 "$BLDBASEDIR/fcitx-mozc-icons/mozc-katakana_half.png" "${PKG}/usr/share/fcitx/mozc/icon/mozc-katakana_half.png"
install -m 644 "$BLDBASEDIR/fcitx-mozc-icons/mozc-dictionary.png" "${PKG}/usr/share/fcitx/mozc/icon/mozc-dictionary.png"
install -m 644 "$BLDBASEDIR/fcitx-mozc-icons/mozc-properties.png" "${PKG}/usr/share/fcitx/mozc/icon/mozc-properties.png"
install -m 644 "$BLDBASEDIR/fcitx-mozc-icons/mozc-tool.png" "${PKG}/usr/share/fcitx/mozc/icon/mozc-tool.png"
# emacs helper
install -D -m 755 out_linux/Release/mozc_emacs_helper "${PKG}/usr/bin/mozc_emacs_helper"
install -D -m 644 unix/emacs/mozc.el "${PKG}/usr/share/emacs/site-lisp/emacs-mozc/mozc.el"
install -D -m 644 "${CWD}/mozc-isearch.el" "${PKG}/usr/share/emacs/site-lisp/emacs-mozc/mozc-isearch.el"

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
# copy patches just in case
cp $CWD/patches/* $PKG/usr/doc/$PRGNAM-$VERSION/
cp $CWD/sources.url $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

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

mozc-isearch.el
;;; mozc-isearch.el --- Use mozc-mode in isearch-mode

;; Copyright (C) 2013 S. Irie

;; Author: S. Irie, October 2013
;; Keywords: mule, multilingual, input method

;; Everyone is permitted to copy and distribute verbatim or modified
;; copies of this license document, and changing it is allowed as long
;; as the name is changed.

;;            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
;;   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

;;  0. You just DO WHAT THE FUCK YOU WANT TO.


;;; Commentary

;; This program allows you to use mozc-mode for the incremental search.

;;; Installation
;;
;; First, ensure you already can use mozc-mode.
;;
;; Save this file in a directory listed in load-parh, and put the
;; following code in your .emacs file.
;;
;; (require 'mozc-isearch)
;;
;; That's all.  Now you can do incremental search in Japanese.
;;
;; Tested on Emacs 24.


;; History:
;; 2013-11-06  S. Irie
;;         * Add option `mozc-isearch-use-workaround'
;;         * Rename some function and advice
;;         * Version 0.3.0
;;
;; 2013-11-05  S. Irie
;;         * `isearch-delete-char' deletes single character from search string
;;         * Avoid possible error
;;         * Fix typo in Commentary
;;         * Version 0.2.0
;;
;; 2013-10-27  S. Irie
;;         * Initial release
;;         * Version 0.1.0


;;; Code

(require 'mozc)

(defvar mozc-isearch-version "0.3.0")

(defvar mozc-isearch-use-workaround t)

(defvar mozc-preedit-empty-hook nil)
(defvar mozc-mode-end-hook nil)

(defadvice mozc-handle-event (around mozc-preedit-empty-hook () activate)
  (let ((mozc-preedit-is-empty nil)) ; really ugly hack!
    ad-do-it
    (if mozc-preedit-is-empty
    (run-hooks 'mozc-preedit-empty-hook))))

(defadvice mozc-send-key-event (after mozc-preedit-is-empty () activate)
  (if (and (not (and ad-return-value
             (mozc-protobuf-get ad-return-value 'preedit)))
       (boundp 'mozc-preedit-is-empty))
      (setq mozc-preedit-is-empty t)))

(defadvice mozc-mode (after mozc-mode-end-hook () activate)
  (if (not mozc-mode)
      (run-hooks 'mozc-mode-end-hook)))

(defun mozc-mode-save-minibuffer-state ()
  (if (boundp 'mozc-mode-in-minibuffer)
      (setq mozc-mode-in-minibuffer mozc-mode)))

(defadvice isearch-process-search-multibyte-characters
  (around mozc-isearch-process-search-characters () activate)
  (if (and (equal current-input-method "japanese-mozc")
       (eq this-command 'isearch-printing-char))
      (let ((mozc-mode-in-minibuffer mozc-mode)
        str)
    (let ((overriding-terminal-local-map nil)
          (prompt (isearch-message-prefix))
          (minibuffer-local-map isearch-minibuffer-local-map)
          (mozc-preedit-empty-hook '(exit-minibuffer))
          (mozc-mode-end-hook '(exit-minibuffer))
          (minibuffer-exit-hook '(mozc-mode-save-minibuffer-state))
          junk-hist)
      (setq unread-command-events (cons last-char unread-command-events)
        str (substring
             (read-string prompt isearch-string 'junk-hist nil t)
             (length isearch-string))))
    (if (not mozc-mode-in-minibuffer)
        (deactivate-input-method))
    (if (and str (> (length str) 0))
        (let ((unread-command-events nil))
          (dotimes (i (length str))
        (let ((ch (string (aref str i))))
          (isearch-process-search-string ch ch))))
      (isearch-update)))
    ad-do-it))

(defun mozc-isearch-setup ()
  (interactive)
  (substitute-key-definition
   'toggle-input-method 'isearch-toggle-input-method isearch-mode-map global-map))

(add-hook 'isearch-mode-hook 'mozc-isearch-setup)


;; Workaround for bug in mozc.el

(defun mozc-mode-ensure-active ()
  (if (and (equal current-input-method "japanese-mozc")
       (not mozc-mode))
      (mozc-mode 1)))

(defun mozc-isearch-workaround-setup ()
  (when mozc-isearch-use-workaround
    (add-hook 'minibuffer-setup-hook 'mozc-mode-ensure-active)))

(add-hook 'after-init-hook 'mozc-isearch-workaround-setup)


(provide 'mozc-isearch)

;;; mozc-isearch.el ends here


slack-desc
# 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------------------------------------------------------|
fcitx-mozc: fcitx-mozc (Mozc engine for fcitx)
fcitx-mozc:
fcitx-mozc: fcitx-mozc is Mozc, Japanese input method editor, engine for fcitx.
fcitx-mozc:
fcitx-mozc: Homepage: https://fcitx-im.org
fcitx-mozc:
fcitx-mozc:
fcitx-mozc:
fcitx-mozc:
fcitx-mozc:
fcitx-mozc:


こんな感じですかね
===



MEGAcmd-1.5.0_Linux

クラウド・ストレージ MEGA のコマンドライン・ユーティリティである MEGAcmd-1.5.0_Linux がリリースされた。

SBoにはSlackBuildが無いので作ってみました。
Slackware64-15.0 with ffmpeg-4.4.1環境にてコンッパイル&動作ともに問題なし。
※ 個人的にはデスクトップクライアント MEGAsyncよりもこちらのコマンドラインツール(mega-cmd)
  のほうが動作軽快で好きです。

screen shot
mega-cmd_1.5.0_Linux

MEGAcmd.info
[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.5.0_Linux}
SDK=${SDK:-3.9.11b}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}

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
tar xvf $CWD/$PRGNAM-$VERSION.tar.?z
cd $PRGNAM-$VERSION/sdk
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 {} \;

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

make
make install DESTDIR=$PKG

# 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

find $PKG -name perllocal.pod \
  -o -name ".packlist" \
  -o -name "*.bs" \
  | xargs rm -f

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

MEGAcmd.SlackBuild
[code]
PRGNAM="MEGAcmd"
VERSION="1.5.0_Linux"
HOMEPAGE="https://github.com/meganz/MEGAcmd"
DOWNLOAD="https://github.com/meganz/MEGAcmd/archive/1.5.0_Linux.tar.gz \
     https://github.com/meganz/sdk/archive/refs/tags/v3.9.11b.tar.gz"
MD5SUM="7d0aab9ccc812942f374da1efe3d3469 \
    e8bafc8be1fefb17fc09513d79ffa58b"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="FreeImage libmediainfo"
MAINTAINER="JW(Shinichi Abe)"
EMAIL="shin1.abe@nifty.com"


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:




===


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