diff options
author | B. Watson <urchlay@slackware.uk> | 2024-01-23 13:45:04 -0500 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2024-01-27 15:37:51 +0700 |
commit | 4bf110c1c15a2c1f04a1dd26bcd199e818b46d11 (patch) | |
tree | b24731ae74701720da84eaa3c2b7cf920bdd0b06 | |
parent | 93f9f67d8a65556e13b163fdf40184b27b3edf7e (diff) |
system/fsviewer: Updated for version 0.2.6+20220428_38b38a6.
Signed-off-by: B. Watson <urchlay@slackware.uk>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r-- | system/fsviewer/README | 5 | ||||
-rw-r--r-- | system/fsviewer/README.patch.txt | 16 | ||||
-rw-r--r-- | system/fsviewer/close_button.diff | 52 | ||||
-rw-r--r-- | system/fsviewer/fsviewer.SlackBuild | 100 | ||||
-rw-r--r-- | system/fsviewer/fsviewer.desktop | 2 | ||||
-rw-r--r-- | system/fsviewer/fsviewer.info | 8 | ||||
-rw-r--r-- | system/fsviewer/get-wraster-flags | 33 | ||||
-rw-r--r-- | system/fsviewer/git2tarxz.sh | 47 | ||||
-rw-r--r-- | system/fsviewer/titlebar.diff | 12 | ||||
-rw-r--r-- | system/fsviewer/wingsfix.diff | 24 |
10 files changed, 151 insertions, 148 deletions
diff --git a/system/fsviewer/README b/system/fsviewer/README index 4565acc9f7ef..e39c78329228 100644 --- a/system/fsviewer/README +++ b/system/fsviewer/README @@ -6,8 +6,3 @@ of NeXTStep(TM). Although fsviewer uses windowmaker's libraries, it will run under any X window manager or desktop environment. - -This build includes an optional patch that makes a minor change to -the UI (adds a titlebar). See README.patch.txt for details. To add -a titlebar to the initial viewer window, set TITLEBAR=yes in the -script's environment. diff --git a/system/fsviewer/README.patch.txt b/system/fsviewer/README.patch.txt deleted file mode 100644 index 4218fb95474e..000000000000 --- a/system/fsviewer/README.patch.txt +++ /dev/null @@ -1,16 +0,0 @@ -Original behaviour in NextStep and OpenStep file viewer was that the first -file view window had no close button or titlebar. This tends to bug the -hell out of modern users, so this build includes an optional patch that -adds a title bar (with a disabled close button) to the first viewer. - -This is strictly a cosmetic change... except if you run windowmaker, -it allows normal wmaker stuff (right-click menu with minimize, Move to, -Omnipresent, etc). Without a title bar, it's awkward or impossible to -do normal window operations, so the patch actually adds functionality. - -By default, the patch isn't included in the build. To include it, set -TITLEBAR=yes in the environment, like so: - -# TITLEBAR=yes ./fsviewer.SlackBuild - -...or if you use sbopkg, set TITLEBAR=yes as a build option. diff --git a/system/fsviewer/close_button.diff b/system/fsviewer/close_button.diff new file mode 100644 index 000000000000..fbbb55e5844f --- /dev/null +++ b/system/fsviewer/close_button.diff @@ -0,0 +1,52 @@ +diff --git a/src/FSFileView.c b/src/FSFileView.c +index 51533d5..175c0ce 100644 +--- a/src/FSFileView.c ++++ b/src/FSFileView.c +@@ -41,6 +41,8 @@ + #define DEFAULT_COLUMN_WIDTH 150 + #define COLUMN_PADDING 4 // only used for increment calc here, needs to go + ++Atom delete_atom; ++ + static void notificationObserver(void* self, WMNotification* notif); + static void FSAddFileViewShelfItem(FSFileView* fView, FileInfo* fileInfo); + static void handleShelfButtonActions(WMWidget* self, void* data); +@@ -437,12 +439,14 @@ FSCreateFileView(FSViewer* fsViewer, char* path, Bool primary) + + if ((fView->primary)) { + memset((void*)&attributes, 0, sizeof(MyGNUstepWMAttributes)); +- attributes.window_style = (WMTitledWindowMask | WMMiniaturizableWindowMask | WMResizableWindowMask); ++ attributes.window_style = (WMTitledWindowMask | WMClosableWindowMask | WMMiniaturizableWindowMask | WMResizableWindowMask); + attributes.window_level = WMNormalWindowLevel; + attributes.extra_flags = GSFullKeyboardEventsFlag; + attributes.flags = (GSWindowStyleAttr | GSWindowLevelAttr | GSExtraFlagsAttr); + MyWMSetWindowAttributes(fView->dpy, WMWidgetXID(fView->fileView), + &attributes); ++ delete_atom = XInternAtom(fView->dpy, "WM_DELETE_WINDOW", 0); ++ XSetWMProtocols(fView->dpy, WMWidgetXID(fView->fileView), &delete_atom, 1); + } + + // WMAppAddWindow(FSGetFSViewerWMContext(fsViewer), +diff --git a/src/FSViewer.c b/src/FSViewer.c +index 9baebfa..d365a83 100644 +--- a/src/FSViewer.c ++++ b/src/FSViewer.c +@@ -23,6 +23,8 @@ + + #define DEBUG 0 + ++extern Atom delete_atom; ++ + /* Application defaults */ + WMUserDefaults* defaultsDB; + WMPropList* filesDB; +@@ -502,7 +504,8 @@ int main(int argc, char** argv) + focusIn = False; + break; + case ClientMessage: +- // printf("arrgggg!\n"); ++ if(event.xclient.data.l[0] == delete_atom) ++ exit(0); + break; + } + } diff --git a/system/fsviewer/fsviewer.SlackBuild b/system/fsviewer/fsviewer.SlackBuild index 4f536cd28061..d713c6e59f43 100644 --- a/system/fsviewer/fsviewer.SlackBuild +++ b/system/fsviewer/fsviewer.SlackBuild @@ -6,6 +6,9 @@ # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. +# 20240122 bkw: switch to roblillack's fork, v0.2.6+20220428_38b38a6. +# Get rid of old patches (no longer needed), and add a new patch to +# give the window a working close button. # 20230708 bkw: BUILD=3, install to the same Applications dir as # windowmaker's WPrefs.app (and no creating /usr/GNUstep, which was # never a good idea). @@ -14,8 +17,8 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=fsviewer -VERSION=${VERSION:-0.2.6} -BUILD=${BUILD:-3} +VERSION=${VERSION:-0.2.6+20220428_38b38a6} +BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -55,55 +58,46 @@ set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP -rm -rf $PRGNAM-app-$VERSION -tar xvf $CWD/$PRGNAM-app-$VERSION.tar.bz2 -cd $PRGNAM-app-$VERSION +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.xz +cd $PRGNAM-$VERSION chown -R root:root . -find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ - \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ - -# The WINGs API has changed slightly in the newer versions of WindowMaker -patch -p1 < $CWD/wingsfix.diff - -# See README.patch.txt for info -if [ "${TITLEBAR:-no}" = "yes" ]; then - patch -p1 < $CWD/titlebar.diff -fi - -# dirty hack way to handle this. easier than dealing with autocrap. -cp $CWD/get-wraster-flags . -chmod +x get-wraster-flags - -# gcc 10+ needs this. -SLKCFLAGS="$SLKCFLAGS -Wl,--allow-multiple-definition" - -PATH=".:$PATH" \ -LIBS="-lWUtil -lX11 -lm -lXpm" \ -CFLAGS="$SLKCFLAGS -std=gnu89" \ -CXXFLAGS="$SLKCFLAGS" \ -./configure \ - --with-appspath=/usr/lib$LIBDIRSUFFIX/GNUstep/Applications \ - --prefix=/usr \ - --libdir=/usr/lib${LIBDIRSUFFIX} \ - --sysconfdir=/etc \ - --localstatedir=/var \ - --mandir=/usr/man \ - --docdir=/usr/doc/$PRGNAM-$VERSION \ - --build=$ARCH-slackware-linux - -# fix broken gobbledegook emitted by autoconf. Life is too short -# to spend time fixing it 'correctly'. -GCCMAJVER=$( gcc --version | head -1 | cut -d' ' -f3 | cut -d. -f1 ) -[ "$GCCMAJVER" -ge 5 ] && sed -i 's,-MT *\$@,-M,' */Makefile */*/Makefile - -make -make install-strip DESTDIR=$PKG - -mkdir -p $PKG/usr/bin +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} + + +# 20240123 bkw: add a close button to the top-level window. +patch -p1 < $CWD/close_button.diff + +# 20240122 bkw: install to /usr/lib(64), then mv the bin dir. +mkdir -p build +cd build + cmake \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr/lib$LIBDIRSUFFIX \ + -DLIB_SUFFIX=${LIBDIRSUFFIX} \ + -DMAN_INSTALL_DIR=/usr/man \ + -DCMAKE_BUILD_TYPE=Release .. + make + make install/strip DESTDIR=$PKG +cd .. + +mv $PKG/usr/lib*/bin $PKG/usr/bin + +# 20240123 bkw: symlink to the binary, same as the package name. +ln -s FSViewer $PKG/usr/bin/$PRGNAM + +# 20240123 bkw: cmake doesn't build this, it was in the old package, +# fortunately it's easy enough to include in the new one. I have no +# idea what it's good for... +sed -i '/config\.h/d' defs/chdef.c +make -C defs chdef LDFLAGS="-lWINGs -lWUtil" install -s -m0755 defs/chdef $PKG/usr/bin -ln -s ../lib$LIBDIRSUFFIX/GNUstep/Applications/FSViewer.app/FSViewer $PKG/usr/bin/$PRGNAM -gzip -9 $PKG/usr/man/man1/* +mkdir -p $PKG/usr/man/man1 +for i in man/*.1x; do + gzip -9 < $i > $PKG/usr/man/man1/$( basename $i ).gz +done # .desktop file comes from the Polish Linux Distro, and has been modified # to add the icon and to pass desktop-file-validate. @@ -113,13 +107,13 @@ cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop # I like the look of FSViewer2.xpm better. You could use FSViewer.xpm if # you prefer. mkdir -p $PKG/usr/share/pixmaps -ln -s ../../lib$LIBDIRSUFFIX/GNUstep/Applications/FSViewer.app/xpm/FSViewer2.xpm \ +ln -s ../../lib$LIBDIRSUFFIX/GNUstep/Apps/FSViewer.app/xpm/FSViewer2.xpm \ $PKG/usr/share/pixmaps/$PRGNAM.xpm -mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a AUTHORS COPYING ChangeLog NEWS README docs/* \ - $PKG/usr/doc/$PRGNAM-$VERSION -cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION +mkdir -p $PKGDOC +cp -a AUTHORS COPYING ChangeLog NEWS README* docs/* $PKGDOC +cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc diff --git a/system/fsviewer/fsviewer.desktop b/system/fsviewer/fsviewer.desktop index ac9abf2cd40c..2455afa9e8ed 100644 --- a/system/fsviewer/fsviewer.desktop +++ b/system/fsviewer/fsviewer.desktop @@ -3,7 +3,7 @@ Name=FSViewer Comment=File Viewer Comment[pl]=Przeglądarka plików Exec=/usr/bin/fsviewer -Icon=fsviewer +Icon=/usr/share/pixmaps/fsviewer.xpm Terminal=false Type=Application Categories=FileManager;System;FileTools; diff --git a/system/fsviewer/fsviewer.info b/system/fsviewer/fsviewer.info index ad4e31100fb6..a7f9f9f0f0ed 100644 --- a/system/fsviewer/fsviewer.info +++ b/system/fsviewer/fsviewer.info @@ -1,8 +1,8 @@ PRGNAM="fsviewer" -VERSION="0.2.6" -HOMEPAGE="http://web.archive.org/web/20120104193413/http://www.bayernline.de/~gscholz/linux/fsviewer/" -DOWNLOAD="https://slackware.uk/~urchlay/src/fsviewer-app-0.2.6.tar.bz2" -MD5SUM="cf55ccb04b635250a647aafee69e2026" +VERSION="0.2.6+20220428_38b38a6" +HOMEPAGE="https://github.com/roblillack/fsviewer" +DOWNLOAD="https://slackware.uk/~urchlay/src/fsviewer-0.2.6+20220428_38b38a6.tar.xz" +MD5SUM="2caf53ff2567d21ef0578b5370d909f3" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="" diff --git a/system/fsviewer/get-wraster-flags b/system/fsviewer/get-wraster-flags deleted file mode 100644 index ed245b953197..000000000000 --- a/system/fsviewer/get-wraster-flags +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -# [Christophe CURIS, 2015/01/31] -# This script is now reporting itself as deprecated (this should have been done -# a long time ago), so it should be kept for at least 2 years from now in order -# to allow users to update their scripts, and then removed. - -if test $# -eq 0; then - echo "Error: $0 is deprecated, please use 'pkg-config wrlib ...'" >&2 - exit 1 -fi - -while test $# -gt 0; do - case $1 in - --cflags) - echo "Warning: $0 is deprecated, please use 'pkg-config wrlib --cflags'" >&2 - pkg-config wrlib --cflags - ;; - --ldflags|--lflags) - echo "Warning: $0 is deprecated, please use 'pkg-config wrlib --libs'" >&2 - pkg-config wrlib --libs-only-L - ;; - --libs) - echo "Warning: $0 is deprecated, please use 'pkg-config wrlib --libs'" >&2 - pkg-config wrlib --libs - ;; - *) - echo "Error: $0 is deprecated, please use 'pkg-config wrlib ...'" >&2 - exit 1 - ;; - esac - shift -done diff --git a/system/fsviewer/git2tarxz.sh b/system/fsviewer/git2tarxz.sh new file mode 100644 index 000000000000..0e923a1264a8 --- /dev/null +++ b/system/fsviewer/git2tarxz.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +# Create source tarball from git repo, with generated version +# number. + +# Note that this script doesn't need to be run as root. It does +# need to be able to write to the current directory it's run from. + +# Takes one optional argument, which is the commit or tag to create +# a tarball of. With no arg, HEAD is used. + +PRGNAM=fsviewer +CLONE_URL=https://github.com/roblillack/fsviewer + +# Last release, that roblillack's fork was based on. +RELVER=0.2.6 + +set -e + +GITDIR=$( mktemp -dt $PRGNAM.git.XXXXXX ) +rm -rf $GITDIR +git clone $CLONE_URL $GITDIR + +CWD="$( pwd )" +cd $GITDIR + +if [ "$1" != "" ]; then + git reset --hard "$1" || exit 1 +fi + +GIT_SHA=$( git rev-parse --short HEAD ) + +DATE=$( git log --date=format:%Y%m%d --format=%cd | head -1 ) + +VERSION=$RELVER+${DATE}_${GIT_SHA} + +rm -rf .git +find . -name .gitignore -print0 | xargs -0 rm -f + +cd "$CWD" +rm -rf $PRGNAM-$VERSION $PRGNAM-$VERSION.tar.xz +mv $GITDIR $PRGNAM-$VERSION +tar cvfJ $PRGNAM-$VERSION.tar.xz $PRGNAM-$VERSION + +echo +echo "Created tarball: $PRGNAM-$VERSION.tar.xz" +echo "VERSION=$VERSION" diff --git a/system/fsviewer/titlebar.diff b/system/fsviewer/titlebar.diff deleted file mode 100644 index 9659b0807199..000000000000 --- a/system/fsviewer/titlebar.diff +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur fsviewer-app-0.2.6/src/FSFileView.c fsviewer-app-0.2.6.patched/src/FSFileView.c ---- fsviewer-app-0.2.6/src/FSFileView.c 2007-10-14 15:06:02.000000000 -0400 -+++ fsviewer-app-0.2.6.patched/src/FSFileView.c 2013-01-21 23:55:02.000000000 -0500 -@@ -430,7 +430,7 @@ - WMResizableWindowMask); - attributes.window_level = WMNormalWindowLevel; - attributes.extra_flags = GSFullKeyboardEventsFlag; -- attributes.flags = (GSWindowStyleAttr | GSWindowLevelAttr | -+ attributes.flags = (/* GSWindowStyleAttr | */ GSWindowLevelAttr | - GSExtraFlagsAttr); - WMSetWindowAttributes(fView->dpy, WMWidgetXID(fView->fileView), - &attributes); diff --git a/system/fsviewer/wingsfix.diff b/system/fsviewer/wingsfix.diff deleted file mode 100644 index 7648ad5d2160..000000000000 --- a/system/fsviewer/wingsfix.diff +++ /dev/null @@ -1,24 +0,0 @@ -diff -Naur fsviewer-app-0.2.6/defs/chdef.c fsviewer-app-0.2.6.patched/defs/chdef.c ---- fsviewer-app-0.2.6/defs/chdef.c 2007-10-14 12:18:25.000000000 -0400 -+++ fsviewer-app-0.2.6.patched/defs/chdef.c 2013-01-21 20:12:00.000000000 -0500 -@@ -374,7 +374,7 @@ - SetIntegerForKey(0, "DisplayMCListPixmap"); - - WMWritePropListToFile(filesDB, -- wdefaultspathfordomain("FSViewer"), True); -+ wdefaultspathfordomain("FSViewer")); - result = 0; - } - else -diff -Naur fsviewer-app-0.2.6/src/extnInspector.c fsviewer-app-0.2.6.patched/src/extnInspector.c ---- fsviewer-app-0.2.6/src/extnInspector.c 2006-07-23 03:24:15.000000000 -0400 -+++ fsviewer-app-0.2.6.patched/src/extnInspector.c 2013-01-21 20:09:39.000000000 -0500 -@@ -229,7 +229,7 @@ - - if(numRows > 0) - WMWritePropListToFile(filesDB, -- wdefaultspathfordomain("FSViewer"), True); -+ wdefaultspathfordomain("FSViewer")); - - if(extn) - free(extn); |