1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-08 23:04:15 +01:00
Files
wmaker/debian/debianfiles/wmaker
Doug Torrance 738a78b3e2 Replace GNUSTEP_USER_ROOT environment variable with WMAKER_USER_ROOT
As reported in Debian bug #922284 [1]:

    As evident from the prefix, GNUSTEP_USER_ROOT is a GNUstep variable and
    Window Maker should not set it.  Furthemore, it has been deprecated for
    12 years already.  As of gnustep-make/2.7.0-4 the GNUstep build system
    is configured in strict v2 mode which makes it impossible to compile
    GNUstep software.  In a terminal started from a Window Maker session:

    yavor@aneto:/tmp/gorm.app-1.2.24$ make
    This is gnustep-make 2.7.0. Type 'make print-gnustep-make-help' for help.
    Running in gnustep-make version 2 strict mode.
    rm -f InterfaceBuilder; \
    ln -s GormLib InterfaceBuilder
    /usr/share/GNUstep/Makefiles/config-noarch.make:121: *** GNUSTEP_USER_ROOT
    is obsolete.  Stop.

    It is also impossible to build gnustep-make from pristine upstream
    source:

    yavor@aneto:/tmp$ wget -q
      ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-make-2.7.0.tar.gz
    yavor@aneto:/tmp$ tar xzf gnustep-make-2.7.0.tar.gz
    yavor@aneto:/tmp$ cd gnustep-make-2.7.0/
    yavor@aneto:/tmp/gnustep-make-2.7.0$ ./configure
    ...
    yavor@aneto:/tmp/gnustep-make-2.7.0$ make
    config-noarch.make:121: *** GNUSTEP_USER_ROOT is obsolete.  Stop.

    Note that the majority of GNUstep users use Window Maker as their window
    manager and many of them build GNUstep software from source, mostly
    because of the GNUstep Objective-C runtime which depends on Clang
    (Debian packages use GCC and the GCC/GNU runtime).

Our solution is to replace the GNUSTEP_USER_ROOT environment variable with our
own environment variable, WMAKER_USER_ROOT.  This is documented in NEWS.

[1] https://bugs.debian.org/922284
2019-02-17 18:44:33 +00:00

77 lines
2.0 KiB
Bash

#!/bin/sh
set -e
[ -n "$WMAKER_USER_ROOT" ] || export WMAKER_USER_ROOT="$HOME/GNUstep"
gs_base="$WMAKER_USER_ROOT"
gs_defaults="$gs_base/Defaults"
gs_system_defaults=/etc/GNUstep/Defaults
wm_base="$gs_base/Library/WindowMaker"
wm_backgrounds="$wm_base/Backgrounds"
wm_iconsets="$wm_base/IconSets"
wm_pixmaps="$wm_base/Pixmaps"
gs_icons="$gs_base/Library/Icons"
wm_style="$wm_base/Style"
wm_styles="$wm_base/Styles"
wm_themes="$wm_base/Themes"
WindowMaker=/usr/lib/WindowMaker/wmaker
convertfonts=/usr/lib/WindowMaker/convertfonts
make_dir_if_needed ()
{
if [ ! -d "$1" ] ; then
install -m 0755 -d "$1"
fi
}
rename_dir_if_possible ()
{
if [ ! -d "$2" ] ; then
if [ -d "$1" ] ; then
mv "$1" "$2"
fi
fi
}
copy_defaults_if_needed ()
{
file="$gs_defaults/$1"
system_file="$gs_system_defaults/$1"
if [ ! -f "$file" ] ; then
install -m 0644 "$system_file" "$file"
fi
}
make_dir_if_needed "$gs_defaults"
make_dir_if_needed "$wm_base"
make_dir_if_needed "$wm_backgrounds"
make_dir_if_needed "$wm_iconsets"
make_dir_if_needed "$wm_pixmaps"
make_dir_if_needed "$gs_icons"
rename_dir_if_possible "$wm_style" "$wm_styles"
make_dir_if_needed "$wm_styles"
make_dir_if_needed "$wm_themes"
copy_defaults_if_needed WindowMaker
copy_defaults_if_needed WMRootMenu
copy_defaults_if_needed WMState
#copy_defaults_if_needed WMWindowAttributes
if [ -x $convertfonts -a ! -e "$wm_base/.fonts_converted" ] ; then
# --keep-xlfd is used in order to preserve the original information
$convertfonts --keep-xlfd "$gs_defaults/WindowMaker"
if [ -f "$gs_defaults/WMGLOBAL" ] ; then
$convertfonts --keep-xlfd "$gs_defaults/WMGLOBAL"
fi
find "$wm_styles" -mindepth 1 -maxdepth 1 -type f -print0 |
xargs -0 -r -n 1 $convertfonts --keep-xlfd
touch "$wm_base/.fonts_converted"
fi
if [ -n "$1" -a -x "$WindowMaker$1" ] ; then
WindowMaker="$WindowMaker$1"
shift
fi
exec "$WindowMaker" "$@"