Nothin' but Slackware

バイクとLinuxに戯れる日々

2025年05月

MEGAsync-5.12.0.1_Linux リリース

[Update: May. 29. 2025]
Version bump to "5.12.0.1"
------------------------------------
 -   We’ve improved how crash reports are handled, so we can fix issues faster.
 -   New icons are now available in the Windows 11 context menu.
 -   We’ve fixed bugs and made performance improvements behind the scenes.

------------------------------------


MEGAsync.SlackBuild
Compilation was failed with GCC15, GCC14 should be used.
[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.
#
# 2025-01-21 : 5.7.1.0 (1jw) -- version bump to 5.7.1.0 with sdk-8.0.1
# 2025-02-05 : 5.8.0.2 (1jw) -- version bump to 5.8.0.2 with sdk-8.3.1
# 2025-03-14 : 5.9.0.3 (1jw) -- version bump to 5.9.0.3 with sdk-8.6.0
# 2025-04-09 : 5.10.1.0 (1jw) -- version bump to 5.10.1.0 with sdk-9.0.2
# 2025-05-09 : 5.11.1.0 (1jw) -- version bump to 5.11.1.0 with sdk-9.2.0
# 2025-05-29 : 5.12.0.1 (1jw) -- version bump to 5.12.0.1 with sdk-9.4.0

PRGNAM=MEGAsync
VERSION=${VERSION:-
5.12.0.1}
SDK=${SDK:-
9.4.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\_Linux
tar xvf $CWD/$PRGNAM-$VERSION\_Linux.tar.gz
cd $PRGNAM-$VERSION\_Linux/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/010-megasync-freeimage-remove-obsolete-ffmpeg-macros.patch
patch -p1 < $CWD/
020-megasync-sdk-fix-cmake-dependencies-detection.patch
cd ../../../
patch -p1 < $CWD/
030-megasync-app-fix-cmake-dependencies-detection.patch

cd $TMP
rm -rf vcpkg
# Now.. we will use microsoft VCPKG build system for MEGAsync desktop apps
git clone https://github.com/microsoft/vcpkg


CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS"
export CXXFLAGS+=' -DNDEBUG'

cmake -DVCPKG_ROOT=$TMP/vcpkg  -B build -S $PRGNAM-$VERSION\_Linux -DCMAKE_BUILD_TYPE=Release \
-G 'Unix Makefiles' \
-DCMAKE_MODULE_PATH:PATH="$TMP/$PRGNAM-$VERSION\_Linux/src/MEGASync/mega/contrib/cmake/modules/packages" \
-DCMAKE_SKIP_INSTALL_RPATH:BOOL='YES' \
-DENABLE_DESIGN_TOKENS_IMPORTER:BOOL='OFF' \
-DENABLE_DESKTOP_APP_TESTS:BOOL='OFF' \
-Wno-dev

cmake --build build --target MEGAsync

#Install
DESTDIR=$PKG cmake --install build
install -d "$PKG/usr/lib${LIBDIRSUFFIX}"
# Do Not overwrite *.so of default ffmpeg-7.x's libraries.
rm $PKG/opt/megasync/lib/*.so
# Now move ffmpeg related libs to STD lib64 dir
mv $PKG/opt/megasync/lib/* $PKG/usr/lib${LIBDIRSUFFIX}/

install -D -m644 $PRGNAM-$VERSION\_Linux/LICENCE.md -t "$PKG/usr/share/licenses/megasync"
install -D -m644 $PRGNAM-$VERSION\_Linux/installer/terms.txt -t "$PKG/usr/share/licenses/megasync"
install -D -m644 $PRGNAM-$VERSION\_Linux/src/MEGASync/mega/LICENSE "$PKG/usr/share/licenses/megasync/LICENCE-SDK"
rm -d "$PKG/opt"{/megasync{/lib,},}

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\_Linux
cp -a  README.md LICENCE.md CREDITS.md $PKG/usr/doc/$PRGNAM-$VERSION
cp $CWD/020-megasync-sdk-fix-cmake-dependencies-detection.patch \
 $CWD/030-megasync-app-fix-cmake-dependencies-detection.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="
5.12.0.1"
HOMEPAGE="
https://github.com/meganz/MEGAsync/"
DOWNLOAD="
https://github.com/meganz/MEGAsync/archive/v5.12.0.1_Linux/MEGAsync-5.12.0.1_Linux.tar.gz \
 
https://github.com/meganz/sdk/archive/v9.4.0/sdk-9.4.0.tar.gz"
MD5SUM="94fce5a49c228cbf8e73a228f0fa5808"
       "5c406a8c2af24a6dbfb53be5164df65b"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="FreeImage libmediainfo"
MAINTAINER=""
EMAIL=""

020-megasync-sdk-fix-cmake-dependencies-detection.patch
[code]
--- a/cmake/modules/sdklib_libraries.cmake
+++ b/cmake/modules/sdklib_libraries.cmake
@@ -91,7 +91,7 @@ macro(load_sdklib_libraries)
 
         find_package(PkgConfig REQUIRED) # For libraries loaded using pkg-config
 
-        pkg_check_modules(cryptopp REQUIRED IMPORTED_TARGET libcrypto++)
+        pkg_check_modules(cryptopp REQUIRED IMPORTED_TARGET libcryptopp)
         target_link_libraries(SDKlib PUBLIC PkgConfig::cryptopp) # TODO: Private for SDK core
 
         pkg_check_modules(sodium REQUIRED IMPORTED_TARGET libsodium)
@@ -135,7 +135,7 @@ macro(load_sdklib_libraries)
         endif()
 
         if(USE_PDFIUM)
-            pkg_check_modules(pdfium REQUIRED IMPORTED_TARGET pdfium)
+            pkg_check_modules(pdfium REQUIRED IMPORTED_TARGET libpdfium)
             target_link_libraries(SDKlib PRIVATE PkgConfig::pdfium)
             set(HAVE_PDFIUM 1)
         endif()

030-megasync-app-fix-cmake-dependencies-detection.patch
[code]
--- a/src/MEGAUpdateGenerator/CMakeLists.txt
+++ b/src/MEGAUpdateGenerator/CMakeLists.txt
@@ -15,10 +15,11 @@ target_sources(MEGAUpdateGenerator
 )
 
 # Load and link needed libraries for the CHATlib target
-find_package(cryptopp CONFIG REQUIRED)
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(cryptopp REQUIRED IMPORTED_TARGET libcryptopp)
 target_link_libraries(MEGAUpdateGenerator
     PRIVATE
-    cryptopp::cryptopp
+    PkgConfig::cryptopp
     MEGA::SDKlib
 )


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:

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

---
[Update] May.29,2025

nvidia-driver.SlackBuild with GCC15 patch

CatchyOS ptr1337氏が公開しているパッチを適用してカーネル 6.14.5 環境+GCC15で
NVIDIA-Linux-x86_64-575.51.02 ドライバをコンパイルすることができたので
そのSlackBuild を記す。
パッチを作成・公開した ptr1337氏に感謝します。

add kernel-6.15 support #840 にある 575.51.02向けパッチ(↓)

カーネル 6.14.5 向けに必要なパッチは以下の2個
0003-Kbuild-Convert-EXTRA_CFLAGS-to-ccflags-y.patch
0008-kbuild-Add-workaround-for-GCC-15-Compilation.patch
---
Base environment
OS : Slackware64-current 15.0+
Kernel: 6.14.5
GCC : 15.1.0 (testing packages)
NVIDIA driver version : 575.51.02

[Note] The following slackbuild was based on SBo's SlackBuild
            Thanks to "SLACKBUILDS dot org"

nvidia-driver.SlackBuild
[code]
#!/bin/bash

# Slackware build script for nvidia-driver

# Copyright 2012-2019 Edward W. Koenig, Vancouver, WA, US
# Copyright 2020-2024 Lenard Spencer, Orlando, FL, 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)

PRGNAM=nvidia-driver
VERSION=${VERSION:-575.51.02}
BUILD=${BUILD:-2}
# BUILD=2 : Compiled w/ GCC15
TAG=${TAG:-jw}
PKGTYPE=${PKGTYPE:-txz}

set -e

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

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

if [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  TARGET="x86_64"
  LIBDIRSUFFIX="64"
# Set 32-bit compatibility flag default
  COMPAT32=${COMPAT32:-no}
else
  echo "$ARCH is not supported."
  exit 1
fi

if [ "${COMPAT32}" = "yes" ]; then
    MULTI="_multilib"
else
    MULTI=""
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$MULTI-$TARGET-$BUILD$TAG.$PKGTYPE"
  exit 0
fi

if [ "${PERSISTENCED:-no}" = "yes" ]; then
  # 20240715 bkw: this test was borked, fixed.
  if [ "$( getent group nvidia )" = "" -o "$( getent passwd nvidia )" = "" ]; then
    echo "User and/or group nvidia do not exist!"
    echo "Please create user and group nvidia and rerun this script."
    exit 1
  fi
fi

SRCNAM=NVIDIA-Linux-$TARGET-${VERSION}
NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}

# make a clean package directory tree
rm -rf $PKG
rm -rf $TMP/$SRCNAM
mkdir -p $TMP $PKG $OUTPUT $PKG/install
mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/xorg/modules/{drivers,extensions} \
  $PKG/etc/OpenCL/vendors/ $PKG/usr/{bin,doc,man/man1} \
  $PKG/usr/share/{applications,nvidia,pixmaps,egl/egl_external_platform.d} \
  $PKG/etc/X11/glvnd/egl_vendor.d $PKG/var/log

if [ "$COMPAT32" = "yes" ]; then
  mkdir -p $PKG/usr/lib/tls
fi

# Extract all the sources
cd $TMP
rm -rf nvidia-installer-$VERSION
tar xvf $CWD/nvidia-installer-$VERSION.tar.bz2
rm -rf nvidia-settings-$VERSION
tar xvf $CWD/nvidia-settings-$VERSION.tar.bz2
rm -rf nvidia-xconfig-$VERSION
tar xvf $CWD/nvidia-xconfig-$VERSION.tar.bz2
rm -rf nvidia-modprobe-$VERSION
tar xvf $CWD/nvidia-modprobe-$VERSION.tar.bz2
sh $CWD/$SRCNAM.run --extract-only
cd $SRCNAM
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 CachyOS patches for linux-6.15 and GCC15
# patch URL: https://github.com/CachyOS/CachyOS-PKGBUILDS/tree/feat/nvidia-575/nvidia/nvidia-utils
cd kernel-open
patch -p2 < $CWD/patches/0003-Kbuild-Convert-EXTRA_CFLAGS-to-ccflags-y.patch
patch -p2 < $CWD/patches/0008-kbuild-Add-workaround-for-GCC-15-Compilation.patch
cd ..


# Compiling the various open source apps instead of using the precompiled binaries
# Compiling nvidia-installer from source

cd $TMP/nvidia-installer-$VERSION

# Install various files in $PKG instead of the root filesystem:
  sed -i "s|/etc/vulkan|$PKG/etc/vulkan|" files.c
  sed -i "s|/lib/firmware/nvidia|$PKG/lib/firmware/nvidia|" files.c
  sed -i "s|\"/etc\"|\"$PKG/etc\"|" nvidia-installer.h
  sed -i "s|/var/lib/nvidia|$PKG/var/lib/nvidia|" backup.c
  sed -i "s|/usr/lib/nvidia|$PKG/usr/lib/nvidia|" files.c
  sed -i "s|/usr/lib/nvidia|$PKG/usr/lib/nvidia|" misc.c

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

  CFLAGS="$SLKCFLAGS" LDFLAGS="-lz" make $NUMJOBS

  install -m 755 _out/Linux_$TARGET/nvidia-installer $PKG/usr/bin/
  install -m 644 _out/Linux_$TARGET/nvidia-installer.1.gz $PKG/usr/man/man1/

cd -

# Now we need to copy the newly patched and compiled nvidia-installer
# to the driver source tree for use
mv -f $PKG/usr/bin/nvidia-installer $TMP/$SRCNAM
mv -f $PKG/usr/man/man1/nvidia-installer.1.gz $TMP/$SRCNAM

if [ "$ARCH" = "x86_64" -a "${COMPAT32}" = "yes" ]; then
    COMP32="--install-compat32-libs --compat32-prefix=$PKG/usr"
else
    if [ ! "$ARCH" = "x86_64" ]; then
        COMP32=""
    else
        COMP32="--no-install-compat32-libs"
    fi
fi

# Install the binary libs using nvidia-installer compiled above
cd $TMP/$SRCNAM
./nvidia-installer -s --no-kernel-module --no-drm --no-unified-memory \
  -z -n -b --no-rpms --no-distro-scripts \
  --no-kernel-module-source --no-x-check --force-libglx-indirect \
  --x-prefix=$PKG/usr \
  --x-module-path=$PKG/usr/lib${LIBDIRSUFFIX}/xorg/modules \
  --x-library-path=$PKG/usr/lib${LIBDIRSUFFIX} \
  --x-sysconfig-path=$PKG/etc/X11/xorg.conf.d \
  --opengl-prefix=$PKG/usr \
  --utility-prefix=$PKG/usr \
  --utility-libdir=lib${LIBDIRSUFFIX} \
  --documentation-prefix=$PKG/usr \
  --application-profile-path=$PKG/usr/share/nvidia \
  --glvnd-egl-config-path=$PKG/etc/X11/glvnd/egl_vendor.d \
  --log-file-name=$PKG/var/log/nvidia-installer.log \
  --egl-external-platform-config-path=$PKG/usr/share/egl/egl_external_platform.d \
  --no-nvidia-modprobe \
  --no-install-libglvnd \
  --no-wine-files \
  --no-systemd \
  --no-peermem \
  $COMP32

# If we are using Wine, then:
if [ "${WINE:-no}" != "no" ]; then
  mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/nvidia/wine
  install -m 755 _nvngx.dll $PKG/usr/lib$LIBDIRSUFFIX/nvidia/wine
  install -m 755 nvngx.dll $PKG/usr/lib$LIBDIRSUFFIX/nvidia/wine
fi
# libOpenCL.so is now included in 15.0 (in ocl-icd),
# so we don't need this one.
rm -f $PKG/usr/lib${LIBDIRSUFFIX}/libOpenCL.so*
if [ "${COMPAT32}" = "yes" ]; then
    rm -f $PKG/usr/lib/libOpenCL.so*
fi
# remove a pair of folders installed and used by nvidia-installer but
# no longer needed (caused the "failed to remove some directories"
# warning message):
rm -rf $PKG/usr/lib/nvidia || true
rm -rf $PKG/var/lib || true

# if not multilib, remove the unneeded /usr/lib folder:
if [ "${COMPAT32}" != "yes" ]; then
  rm -rf $PKG/usr/lib || true
fi

# Mitigate a bug in nvidia-installer that misplaces a symlink
# (Thanks to marco70 on LQ for catching this)
( cd $PKG/usr/lib${LIBDIRSUFFIX}/gbm
rm -f nvidia-drm_gbm.so
  ln -sf ../libnvidia-allocator.so.1 nvidia-drm_gbm.so
)
# Compile utilites from source, replacing the precompiled versions
#
# Compiling nvidia-settings
cd $TMP/nvidia-settings-$VERSION
  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/libXNVCtrl
    make clean
    CFLAGS="$SLKCFLAGS" \
    make
  cd ../../

  CFLAGS="$SLKCFLAGS" \
  make

  install -m 755 src/_out/Linux_$TARGET/nvidia-settings $PKG/usr/bin/
  install -m 644 doc/_out/Linux_$TARGET/nvidia-settings.1.gz $PKG/usr/man/man1/
  install -m 644 doc/nvidia-settings.desktop $PKG/usr/share/applications/
  install -m 644 doc/nvidia-settings.png $PKG/usr/share/pixmaps/
# For nvidia-settings GUI support
  install -m 755 src/_out/Linux_$TARGET/libnvidia-gtk2.so $PKG/usr/lib$LIBDIRSUFFIX/libnvidia-gtk2.so.$VERSION
  install -m 755 src/_out/Linux_$TARGET/libnvidia-gtk3.so $PKG/usr/lib$LIBDIRSUFFIX/libnvidia-gtk3.so.$VERSION
cd -

# Compiling nvidia-xconfig
cd $TMP/nvidia-xconfig-$VERSION
  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 {} \;

  CFLAGS="$SLKCFLAGS" \
  make

  install -m 755 _out/Linux_$TARGET/nvidia-xconfig $PKG/usr/bin/
  install -m 644 _out/Linux_$TARGET/nvidia-xconfig.1.gz $PKG/usr/man/man1/
cd -

# Some optional utilities, such as laptop for possible GPU switching and
# nvidia-modprobe needed to create device nodes

# Compiling nvidia-modprobe
  cd $TMP/nvidia-modprobe-$VERSION
    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 {} \;

    CFLAGS="$SLKCFLAGS" make
# must be installed suid root for nvidia-persistenced to work properly
    install -m 4755 _out/Linux_$TARGET/nvidia-modprobe $PKG/usr/bin/
    install -m 644 _out/Linux_$TARGET/nvidia-modprobe.1.gz $PKG/usr/man/man1/
  cd -

# These update the paths in nvidia-settings.desktop
sed -i "s|__UTILS_PATH__|/usr/bin|" $PKG/usr/share/applications/nvidia-settings.desktop
sed -i "s|__PIXMAP_PATH__|/usr/share/pixmaps|" $PKG/usr/share/applications/nvidia-settings.desktop
sed -i "s|__NVIDIA_SETTINGS_DESKTOP_CATEGORIES__|Settings;|" $PKG/usr/share/applications/nvidia-settings.desktop
# Remove depcrecated entry in nvidia-settings.desktop
sed -i '/Encoding/d' $PKG/usr/share/applications/nvidia-settings.desktop

# Remove xorg conf folder since we handle that in nvidia-kernel
rm -rf $PKG/etc/X11/xorg.conf.d

cd $TMP/$SRCNAM
# put docs in the right place
mv $PKG/usr/share/man/man1/nvidia-* $PKG/usr/man/man1
rm -rf $PKG/usr/share/man
mv $PKG/usr/share/doc/NVIDIA_GLX-1.0 $PKG/usr/doc/$PRGNAM-$VERSION
rm -rf $PKG/usr/share/doc
cp -a LICENSE NVIDIA_Changelog README.txt $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README.Slackware
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
cat $CWD/fetch-nvidia-individual-sources.sh > $PKG/usr/doc/$PRGNAM-$VERSION/fetch-nvidia-individual-sources.sh
cat $CWD/patches/0003-Kbuild-Convert-EXTRA_CFLAGS-to-ccflags-y.patch > $PKG/usr/doc/$PRGNAM-$VERSION/0003-Kbuild-Convert-EXTRA_CFLAGS-to-ccflags-y.patch
cat $CWD/patches/0008-kbuild-Add-workaround-for-GCC-15-Compilation.patch > $PKG/usr/doc/$PRGNAM-$VERSION/0008-kbuild-Add-workaround-for-GCC-15-Compilation.patch


sed "s/PKGVERSION/$VERSION/g" $CWD/slack-desc > $PKG/install/slack-desc
if [ "$COMPAT32" = "yes" ]; then
   sed -i "s|nvidia-driver: @MULTILIB@|nvidia-driver: This package includes the 32-bit libraries.|" $PKG/install/slack-desc
else
   sed -i "s|nvidia-driver: @MULTILIB@|nvidia-driver:|" $PKG/install/slack-desc
fi

cat $CWD/doinst.sh > $PKG/install/doinst.sh

# Add nvidia-persistenced:
if [ "${PERSISTENCED:-no}" = "yes" ]; then
  cd $TMP
  rm -rf nvidia-persistenced-$VERSION.tar.bz2
  tar xvf $CWD/nvidia-persistenced-$VERSION.tar.bz2
# Compiling nvidia-persistenced
  cd $TMP/nvidia-persistenced-$VERSION
  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 {} \;

  CFLAGS="$SLKCFLAGS" make
  install -m 755 _out/Linux_$TARGET/nvidia-persistenced $PKG/usr/bin/
  install -m 644 _out/Linux_$TARGET/nvidia-persistenced.1.gz $PKG/usr/man/man1/
# install rc.nvidia-perstistenced:
  mkdir -p $PKG/etc/rc.d $PKG/var/run/nvidia-persistenced
  install -m 755 $CWD/rc.nvidia-persistenced $PKG/etc/rc.d/rc.nvidia-persistenced
  sed -i "s|__USER__|nvidia|" $PKG/etc/rc.d/rc.nvidia-persistenced
  chown nvidia:nvidia $PKG/var/run/nvidia-persistenced
fi

# We must now remove our custom nvidia-installer as it will no longer
# work on an installed driver:
rm -f $PKG/usr/bin/nvidia-{installer,uninstall}

# Flag multilib as needed and build package.
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION$MULTI-$TARGET-$BUILD$TAG.$PKGTYPE


doinst.sh
[code]
if [ -x /usr/bin/update-desktop-database ]; then
  /usr/bin/update-desktop-database -q usr/share/applications
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

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------------------------------------------------------|
nvidia-driver: nvidia-driver (Proprietary Binary Nvidia Video Driver)
nvidia-driver:
nvidia-driver: This is the proprietary binary video driver from nvidia for
nvidia-driver: the x.org X server. This package does not include the kernel
nvidia-driver: module - it is included in the nvidia-kernel package.
nvidia-driver:
nvidia-driver: See /usr/doc/nvidia-driver-PKGVERSION/README.Slackware
nvidia-driver: for more information.
nvidia-driver:
nvidia-driver: https://www.nvidia.com
nvidia-driver:





===
[NEW] 2025/04/04


nvidia-kernel.SlackBuild with GCC15 patch [update: 2025/05/04]

その後テストを繰り返した結果、
カーネル 6.14.5 環境においては パッチ 0003, 0008 の2つを適用すれば十分なことが分かったので SlackBuildを修正した。

CatchyOS ptr1337氏が公開しているパッチを適用してカーネル 6.14.5 環境+GCC15で
NVIDIA-Linux-x86_64-575.51.02カーネルモジュールをコンパイルすることができたので
そのSlackBuild を記す。
パッチを作成・公開した ptr1337氏に感謝します。

add kernel-6.15 support #840 にある 575.51.02向けパッチ(↓)

カーネル 6.14.5 向けに必要なパッチは以下の2個
0003-Kbuild-Convert-EXTRA_CFLAGS-to-ccflags-y.patchh
0008-kbuild-Add-workaround-for-GCC-15-Compilation.patch
---
Base environment
OS : Slackware64-current 15.0+
Kernel: 6.14.5
GCC : 15.1.0 (testing packages)
NVIDIA driver version : 575.51.02

[Note] The following slackbuild was based on SBo's SlackBuild
            Thanks to "SLACKBUILDS dot org"

nvidia-kernel.SlackBuild [update : 2025/05/04]
[code]
#!/bin/bash

# Slackware build script for nvidia-kernel

# Copyright 2007-2011 Heinz Wiesinger, Amsterdam, The Netherlands
# Copyright 2012-2019 Edward W. Koenig, Vancouver, WA, USA
# Updates copyright 2020-2024 Lenard Spencer, Orlando, FL, 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.

# Thanks to Robby Workman for suggestions to improve this script.

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

PRGNAM=nvidia-kernel
VERSION=${VERSION:-575.51.02}
BUILD=${BUILD:-2}
TAG=${TAG:-jw}
PKGTYPE=${PKGTYPE:-txz}

KERNEL=${KERNEL:-$(uname -r)}
KERNELPATH=${KERNELPATH:-/lib/modules/${KERNEL}/build}

if [ "${OPEN:-yes}" = "yes" ]; then
  OPEN1="-open"
  OPEN2="_OPEN"
  DESC="OPEN"
else
  unset OPEN1
  unset OPEN2
  DESC="PROPRIETARY"
fi

set -e

PKGVER=${VERSION}${OPEN2}_$(echo $KERNEL | tr - _)

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

if [ "$ARCH" = "x86_64" ]; then
  TARGET="x86_64"
else
  echo "$ARCH is not supported."
  exit 1
fi

unset ARCH

SRCNAM=NVIDIA-Linux-$TARGET-${VERSION}

if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  echo "$PRGNAM-$PKGVER-$TARGET-$BUILD$TAG.$PKGTYPE"
  exit 0
fi

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

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP || exit 1
rm -rf $SRCNAM
sh $CWD/$SRCNAM.run --extract-only || exit 1
cd $SRCNAM || exit 1
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 CachyOS patches for linux-6.15 and GCC15
# patch URL: https://github.com/CachyOS/CachyOS-PKGBUILDS/tree/feat/nvidia-575/nvidia/nvidia-utils
cd kernel-open
patch -p2 < $CWD/patches/0003-Kbuild-Convert-EXTRA_CFLAGS-to-ccflags-y.patch
patch -p2 < $CWD/patches/0008-kbuild-Add-workaround-for-GCC-15-Compilation.patch
cd ..


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

( cd kernel$OPEN1  || exit 1

# CC=${CC:-gcc} suppresses an otherwise harmless "compiler mismatch"
# message.  If you custom-build your kernel with clang,
# then pass CC=clang to this script.
  CC=${CC:-gcc} make ${NUMJOBS} SYSSRC=$KERNELPATH module || exit 1
)

mkdir -p $PKG/lib/modules/$KERNEL/kernel/drivers/video
install -m 0664 kernel$OPEN1/nvidia.ko $PKG/lib/modules/$KERNEL/kernel/drivers/video/
install -m 0664 kernel$OPEN1/nvidia-modeset.ko $PKG/lib/modules/$KERNEL/kernel/drivers/video/
install -m 0664 kernel$OPEN1/nvidia-drm.ko $PKG/lib/modules/$KERNEL/kernel/drivers/video/
install -m 0664 kernel$OPEN1/nvidia-uvm.ko $PKG/lib/modules/$KERNEL/kernel/drivers/video/

mkdir -p $PKG/usr/share/X11/xorg.conf.d/
cat $TMP/$SRCNAM/nvidia-drm-outputclass.conf > $PKG/usr/share/X11/xorg.conf.d/10-nvidia.conf

mkdir -p $PKG/usr/doc/$PRGNAM-$PKGVER
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$PKGVER/$PRGNAM.SlackBuild
cat $CWD/patches/0003-Kbuild-Convert-EXTRA_CFLAGS-to-ccflags-y.patch > $PKG/usr/doc/$PRGNAM-$PKGVER/0003-Kbuild-Convert-EXTRA_CFLAGS-to-ccflags-y.patch
cat $CWD/patches/0008-kbuild-Add-workaround-for-GCC-15-Compilation.patch > $PKG/usr/doc/$PRGNAM-$PKGVER/0008-kbuild-Add-workaround-for-GCC-15-Compilation.patch

mkdir -p $PKG/install
sed "s%@DESC@%$DESC%" $CWD/slack-desc > $PKG/install/slack-desc
sed "s%@KERNEL@%$KERNEL%" $CWD/doinst.sh > $PKG/install/doinst.sh

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


doinst.sh
[code]
chroot . /sbin/depmod -a @KERNEL@ 2>/dev/null


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------------------------------------------------------|
nvidia-kernel: nvidia-kernel (Kernel Interface for the nvidia driver)
nvidia-kernel:
nvidia-kernel: This is the @DESC@ version of the kernel module needed by the
nvidia-kernel: binary nvidia-driver.
nvidia-kernel:
nvidia-kernel:
nvidia-kernel:
nvidia-kernel:
nvidia-kernel:
nvidia-kernel:
nvidia-kernel:


nvidia-kernel.info
[code]
PRGNAM="nvidia-kernel"
VERSION="
575.51.02"
HOMEPAGE="https://www.nvidia.com"
DOWNLOAD="UNSUPPORTED"
MD5SUM=""
DOWNLOAD_x86_64="
https://download.nvidia.com/XFree86/Linux-x86_64/575.51.02/NVIDIA-Linux-x86_64-575.51.02.run"
MD5SUM_x86_64="4fde8f47d366411973b8d62c3860e486"
REQUIRES=""
MAINTAINER=""



===
[NEW] 2025/04/03
[update] 2025/05/04


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