Table of Content

The objective is to have portable GNUstep with Console2 terminal, few issues there:

  • default msys.bat looks like has Console2 option but it is not working;
  • it should detect usb driver automatically since could run GNUstep on different computer;
  • prefer launch GNUstep from Console2 instead of launching script then start Console2

Step1 How to get portable GNUstep

1) install GNUstep pakcages to one folder, default one is C:\GNUstep
2) copy C:\GNUstep to usb driver f:\portableapps\GNUstep
3) uninstall all GNUstep packages

Step2 How to take care of usb driver

1) place below bat file to J:\portableapps\GNUstep\msys\1.0

usbmsys-console2.bat

@echo off

::Get the current batch file's short path
for %%x in (%0) do set BatchPath=%%~dpsx
for %%x in (%BatchPath%) do set BatchPath=%%~dpsx
::echo BatchPath = %BatchPath%

::Change to the batch file's directory
cd %BatchPath%

echo #Automatically generated - modify fstab.model > etc\fstab
::replace fstab with current directory
for /F "eol=# tokens=1,2* delims=:" %%i in (etc\fstab.model) do @echo %~d0%%j >> etc\fstab

:: launch GNUstep bash terminal
bin\bash --login -i

2) prepare /etc/fstab

cp /etc/fstab to /etc/fstab.orig

place /etc/fstab

#Automatically generated - modify fstab.model
j:/portableapps/GNUstep  /mingw
j:/portableapps/GNUstep/GNUstep  /GNUstep

place /etc/fstab.model

X:/portableapps/GNUstep  /mingw
X:/portableapps/GNUstep/GNUstep  /GNUstep

each time bat file usbmsys-console2.bat will detect real usb driver and update in /etc/fstab.

Step3 How to launch GNUstep inside Console2

I didn’t use GNUstep/msys Console2 since I already have portable Console2 at j:\portableapps\Console2.

Tab: usbGNUstep
Shell: \portableapps\GNUstep\msys\1.0\usbmsys-console2.bat
I removed usb driver here.

Step4 How to setup GNUstep environment in Console2

1) GNUstep mounting

When you click usbGNUstep tab, it get correct usb driver in /etc/fstab, and mount as below:

$ df -h
Filesystem            Size  Used Avail Use% Mounted on
C:\Users\xxx\AppData\Local\Temp
                      233G  156G   78G  67% /tmp
J:\portableapps\GNUstep\GNUstep
                      7.3G  4.7G  2.6G  65% /GNUstep
J:\PORTAB~2\GNUstep\msys\1.0
                      7.3G  4.7G  2.6G  65% /usr
J:\PORTAB~2\GNUstep\msys\1.0
                      7.3G  4.7G  2.6G  65% /
J:\portableapps\GNUstep
                      7.3G  4.7G  2.6G  65% /mingw
c:                    233G  156G   78G  67% /c
j:                    7.3G  4.7G  2.6G  65% /j

/mingw and /GNUstep mounting are most important since all GNUstep config bases on it.

2) Setting up GNUstep Environment

second part of usbmsys-console2.bat is start bash with option "–login -i", this is magic thing, it will run /etc/profile , the last part is to setup what all you need for GNUstep:

# Setup GNUstep variables so we can run/compile stuff
echo Setting up GNUstep Environment...
. /GNUstep/System/Library/Makefiles/GNUstep.sh

you can verify by:

$ env|grep GNU

So far you are ready to play with GNUstep in better Console2 terminal !