LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-15-2022, 11:04 PM   #1
J_W
Member
 
Registered: Apr 2004
Location: Yamagata, JAPAN
Distribution: Slackware64-current
Posts: 189

Rep: Reputation: 123Reputation: 123
Enabled localized menu of xscreensaver-6.06


Hi,

I tried re-compile xscreensaver package which included locale data of each languages.

Since I'm not heavy linux user, I have no idea whether following script is correct or not, but it worked anyway, so far.
Please let me know if there is anything I should fix in this script.


diff -Nru xscreensaver.SlackBuild xscreensaver.SlackBuild.new
Code:
--- xscreensaver.SlackBuild	2022-12-16 13:28:55.796014070 +0900
+++ xscreensaver.SlackBuild.new	2022-12-16 13:26:36.292030830 +0900
@@ -24,7 +24,7 @@
 
 PKGNAM=xscreensaver
 VERSION=${VERSION:-$(echo xscreensaver-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-1_test}
 
 # Automatically determine the architecture we're building on:
 if [ -z "$ARCH" ]; then
@@ -102,18 +102,27 @@
   --prefix=/usr \
   --libdir=/usr/lib${LIBDIRSUFFIX} \
   --mandir=/usr/man \
+  --localedir=/usr/share/locale \
   --with-app-defaults=/etc/X11/app-defaults \
   --with-text-file=/usr/doc/netdate/COPYRIGHT \
   $USE_SHADOW \
   $USE_PAM \
   --without-kerberos \
+  --with-gtk \
   --with-jpeg \
   --with-gl \
   --build=$ARCH-slackware-linux || exit 1
 
+# Fix po Makefile
+sed -i "s|@install_sh@|../install-sh -c|" po/Makefile
+
 # Build:
-make $NUMJOBS || make || exit 1
-make install_prefix=$PKG install-strip || exit 1
+make $NUMJOBS || make all || exit 1
+make install install_prefix=$PKG || exit 1
+# Install po files
+( cd po
+make install-data DESTDIR=$PKG
+cd .. )
 
 if [ -z $USE_PAM ]; then
   # Needed for password unlock:
---
Attached Thumbnails
Click image for larger version

Name:	xscreensaver-6.06_with_locale-data.png
Views:	26
Size:	152.4 KB
ID:	40046  
 
Old 12-16-2022, 07:42 AM   #2
drumz
Member
 
Registered: Apr 2005
Location: Oklahoma, USA
Distribution: Slackware
Posts: 905

Rep: Reputation: 695Reputation: 695Reputation: 695Reputation: 695Reputation: 695Reputation: 695
Is there a reason you changed "make install-strip" to "make install"?
 
Old 12-16-2022, 08:25 AM   #3
J_W
Member
 
Registered: Apr 2004
Location: Yamagata, JAPAN
Distribution: Slackware64-current
Posts: 189

Original Poster
Rep: Reputation: 123Reputation: 123
Hi, @drumz

Quote:
Originally Posted by drumz View Post
Is there a reason you changed "make install-strip" to "make install"?
Thank you for your comment.
There is no special reason, but when I add "install_strip" at that line, the slackbuild doesn't create $PKG/usr/share/locale.
I have not found its solution yet.
I appreciate any advice to workaround this.
 
Old 12-16-2022, 09:22 AM   #4
J_W
Member
 
Registered: Apr 2004
Location: Yamagata, JAPAN
Distribution: Slackware64-current
Posts: 189

Original Poster
Rep: Reputation: 123Reputation: 123
I modified the slackbuild like below.
This script was also able to create locale data and its package size is smaller than before.

Code:
--- xscreensaver.SlackBuild.orig	2022-12-16 13:23:31.058053084 +0900
+++ xscreensaver.SlackBuild	2022-12-17 00:31:19.219239303 +0900
@@ -24,7 +24,7 @@
 
 PKGNAM=xscreensaver
 VERSION=${VERSION:-$(echo xscreensaver-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2_test}
 
 # Automatically determine the architecture we're building on:
 if [ -z "$ARCH" ]; then
@@ -98,22 +98,37 @@
 xml_config=/usr/bin/xml-config xml2_config=/usr/bin/xml2-config \
 CFLAGS="$SLKCFLAGS" \
 CXXFLAGS="$SLKCFLAGS" \
+
+autoreconf -fi
+
 ./configure \
   --prefix=/usr \
   --libdir=/usr/lib${LIBDIRSUFFIX} \
   --mandir=/usr/man \
+  --localedir=/usr/share/locale \
   --with-app-defaults=/etc/X11/app-defaults \
   --with-text-file=/usr/doc/netdate/COPYRIGHT \
   $USE_SHADOW \
   $USE_PAM \
   --without-kerberos \
+  --with-gtk \
   --with-jpeg \
   --with-gl \
   --build=$ARCH-slackware-linux || exit 1
 
+# Fix po Makefile
+sed -i "s|@install_sh@|../install-sh -c|" po/Makefile
+
 # Build:
-make $NUMJOBS || make || exit 1
-make install_prefix=$PKG install-strip || exit 1
+make $NUMJOBS || make all || exit 1
+make install install_prefix=$PKG || exit 1
+# Install po files
+( cd po
+make install-data DESTDIR=$PKG
+cd .. )
+
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
+  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
 
 if [ -z $USE_PAM ]; then
   # Needed for password unlock:
@@ -139,6 +154,7 @@
 cp -a \
   README* \
   $PKG/usr/doc/xscreensaver-$VERSION
+cp $CWD/xscreensaver.SlackBuild $PKG/usr/doc/xscreensaver-$VERSION
 
 # Compress and link manpages, if any:
 if [ -d $PKG/usr/man ]; then

Last edited by J_W; 12-16-2022 at 09:38 AM.
 
Old 12-16-2022, 07:22 PM   #5
J_W
Member
 
Registered: Apr 2004
Location: Yamagata, JAPAN
Distribution: Slackware64-current
Posts: 189

Original Poster
Rep: Reputation: 123Reputation: 123
Sorry for my frequent posts.

I noticed that there were several missing locales to be created in po directory during compilation.
So, I modified my former slackbuild like below.
Code:
--- xscreensaver.SlackBuild.orig	2022-12-16 13:23:31.058053084 +0900
+++ xscreensaver.SlackBuild	2022-12-17 10:06:52.444811135 +0900
@@ -24,7 +24,7 @@
 
 PKGNAM=xscreensaver
 VERSION=${VERSION:-$(echo xscreensaver-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-3_test}
 
 # Automatically determine the architecture we're building on:
 if [ -z "$ARCH" ]; then
@@ -98,22 +98,38 @@
 xml_config=/usr/bin/xml-config xml2_config=/usr/bin/xml2-config \
 CFLAGS="$SLKCFLAGS" \
 CXXFLAGS="$SLKCFLAGS" \
+
+autoreconf -fi
+
 ./configure \
   --prefix=/usr \
   --libdir=/usr/lib${LIBDIRSUFFIX} \
   --mandir=/usr/man \
+  --localedir=/usr/share/locale \
   --with-app-defaults=/etc/X11/app-defaults \
   --with-text-file=/usr/doc/netdate/COPYRIGHT \
   $USE_SHADOW \
   $USE_PAM \
   --without-kerberos \
+  --with-gtk \
   --with-jpeg \
   --with-gl \
   --build=$ARCH-slackware-linux || exit 1
 
+# Fix po Makefile (force to create missing locales)
+sed -i "s|da de es et fi fr hu it ja ko nb nl pl pt pt_BR ru sk sv vi wa zh_CN zh_TW|be da de el es et fi fr hu it ja ko lt nb nl pl pt pt_BR ru sk sv tr uk vi wa zh_CN zh_TW|" po/Makefile
+sed -i "s|@install_sh@|../install-sh -c|" po/Makefile
+
 # Build:
-make $NUMJOBS || make || exit 1
-make install_prefix=$PKG install-strip || exit 1
+make $NUMJOBS || make all || exit 1
+make install install_prefix=$PKG || exit 1
+# Install po files
+( cd po
+make install-data DESTDIR=$PKG
+cd .. )
+
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
+  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
 
 if [ -z $USE_PAM ]; then
   # Needed for password unlock:
@@ -139,6 +155,7 @@
 cp -a \
   README* \
   $PKG/usr/doc/xscreensaver-$VERSION
+cp $CWD/xscreensaver.SlackBuild $PKG/usr/doc/xscreensaver-$VERSION
 
 # Compress and link manpages, if any:
 if [ -d $PKG/usr/man ]; then
The created locale data with this workaround are
"be da de el es et fi fr hu it ja ko lt nb nl pl pt pt_BR ru sk sv tr uk vi wa zh_CN zh_TW".

I know this looks dirty fix, but it creats most locale data (*.gmo) except "ca".
Fedora's spec file said that ca.po in xscreensaver-6.06/po/ seems to be broken.
[Note]
For example in case of uk.po, almost all translation date at msgstr lines are empty.
So, even if uk.po is compiled to uk.gmo, its translation data will be almost the same as that of English.


I appreciate any advice and pointing.
Sorry for my poor English.

Last edited by J_W; 12-16-2022 at 11:05 PM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Xscreensaver not using .xscreensaver psychobyte Fedora 4 04-07-2006 10:02 AM
xscreensaver installed, but no xscreensaver-demo command? dalesan Linux - Software 7 09-01-2004 01:06 PM
what would you use for localized chat LinuxLala Linux - Software 0 08-29-2004 02:03 PM
console is localized to Chinese --how do I turn it off ?? KWTm Linux - Software 0 08-19-2004 06:54 PM
localized fonts in rxvt & midnight commander / mandrake 9.1 2dope Linux - Newbie 0 07-25-2003 09:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration