Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance OpenBSD support: #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,49 @@ The purposes of all of the scripts is as follows:
* process-files - run the specified command on the current files that have been changed.
* cleanup - whitespace cleanup and, likely, other cleanups to be done on currently changed files.



Install GNUstep dev environment
===

* use ssh-agent forwarding, or have your key for GitHub locally on your dev machine and
start ssh-agent locally.
* have sudo configured, you may or may not want to use NOPASSWD
* have the SSH key from GitHub accepted

Assume an empty development VM, i.e. Linux, OpenBSD, you name it:

```
mkdir ~/gnustep
cd ~/gnustep
```

with curl already installed:
```
curl -fsSL > gnustep-web-install-dev https://raw.githubusercontent.com/gnustep/tools-scripts/refs/heads/master/gnustep-web-install-dev
```
or on OpenBSD with ftp:
```
ftp -o gnustep-web-install-dev https://raw.githubusercontent.com/gnustep/tools-scripts/refs/heads/master/gnustep-web-install-dev
```

Review what the script is doing, and you may visit the other scripts it's fetching and installing. Once you're confident, it's good to go:

If you're on OpenBSD, the default invocation of ./gnustep-web-install-dev will build with gcc against gcc libobjc.
If you want to build against libobjc2 with ARC support, before going on export WITH_ARC=yes environment variable.

```
chmod 755 gnustep-web-install-dev
./gnustep-web-install-dev
```

Go grab a coffee, and wait a bit.

Once it finished, source GNUstep.sh and start developing:

. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh


Please report any bugs you find with this set of scripts.

Thank you... GC
54 changes: 42 additions & 12 deletions build-openbsd
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
#!/bin/sh

export CC=egcc
export CXX=eg++
export LD=ld.bfd
if [ "X${WITH_ARC}" == "Xyes" ];then
echo "BUIDLING WITH CLANG and ARC"
GSMAKE_CC=clang
GSMAKE_CXX=clang++
GSMAKE_CPP="clang -E"
GSMAKE_LD=ld
GSMAKE_AS=llvm-as
EXTRA_GSMAKE_FLAGS="--with-objc-lib-flag=-lobjc2 --enable-strict-v2-mode --with-runtime-abi=gnustep-2.2 --with-library-combo=ng-gnu-gnu GS_WITH_ARC=1"
GSMAKE_CPPFLAGS="-I/usr/local/include -I/usr/local/include/gnustep"
GSMAKE_LDFLAGS="-L/usr/local/lib -lc++abi -lobjc2 -pthread"
else
echo "BUIDLING WITH GCC"
GSMAKE_CC=egcc
GSMAKE_CXX=eg++
GSMAKE_CPP="egcc -E"
GSMAKE_LD=ld.bfd
GSMAKE_AS=as
EXTRA_GSMAKE_FLAGS=""
GSMAKE_CPPFLAGS="-I/usr/local/include"
GSMAKE_LDFLAGS="-L/usr/local/lib"
fi
export MAKE=gmake
export SUDO=sudo
# export CFLAGS=-I/usr/local/include/gnustep
# export LDFLAGS=-L/usr/local/lib

ROOT=/
USR_ROOT=${ROOT}usr
Expand All @@ -22,13 +38,12 @@ echo ""

CPUS=4
SUDO='sudo LD_LIBRARY_PATH=$LD_LIBRARY_PATH'
# KERNEL=`uname -s | awk '{print tolower($0)}'`
scriptsdir="`pwd`/tools-scripts"

# Build make
cd tools-make
make clean
./configure --with-layout=gnustep CC=${CC} CXX=${CXX} LD=${LD} --prefix=${prefix}
${MAKE} clean
./configure --with-layout=gnustep --prefix="${prefix}" ${EXTRA_GSMAKE_FLAGS} CC="${GSMAKE_CC}" CXX="${GSMAKE_CXX}" CPP="${GSMAKE_CPP}" LD="${GSMAKE_LD}" AS="${GSMAKE_AS}" LDFLAGS="${GSMAKE_LDFLAGS}" CPPFLAGS="${GSMAKE_CPPFLAGS}"
echo "======== Build make"
${MAKE}
${SUDO} -u root ${MAKE} install
Expand All @@ -37,30 +52,45 @@ ${SUDO} -u root ${MAKE} install
# Build base
echo "======== Build base"
cd ../libs-base
${SUDO} ${MAKE} clean
./configure --with-installation-domain=SYSTEM
${MAKE} debug=yes messages=no -j4
${MAKE} debug=yes messages=yes -j4
${SUDO} -u root ./install.sh ${GNUSTEP_ROOT} ${MAKE}
echo "==="

# Build gui
echo "======== Build gui"
cd ../libs-gui
./configure
LDFLAGS=${LDFLAGS} CC=${CC} CXX=${CXX} ${MAKE} debug=yes messages=no -j4
${SUDO} ${MAKE} clean
./configure --with-x --enable-speech
${MAKE} debug=yes messages=yes -j4
${SUDO} -u root ./install.sh ${GNUSTEP_ROOT} ${MAKE}
echo "==="

# Build backend
echo "======== Build back"
cd ../libs-back
${SUDO} ${MAKE} clean
./configure --enable-graphics=cairo
LDFLAGS=${LDFLAGS} CC=${CC} CXX=${CXX} ${MAKE} debug=yes messages=no -j4
${MAKE} debug=yes messages=yes -j4
${SUDO} -u root ./install.sh ${GNUSTEP_ROOT} ${MAKE}
echo "==="

# Set default backend
# defaults write NSGlobalDomain GSBackend libgnustep-cairo

echo "======== Build ProjectCenter"
cd ../apps-projectcenter
${SUDO} ${MAKE} clean
${MAKE} debug=yes messages=yes
${SUDO} ${MAKE} install

echo "======== Build Gorm"
cd ../apps-gorm
${SUDO} ${MAKE} clean
${MAKE} debug=yes messages=yes
${SUDO} ${MAKE} install

echo "Done."

exit 0
8 changes: 6 additions & 2 deletions gnustep-web-install-dev
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ export KERNEL=`uname -s | sed "s/\-.*//g" | awk '{print(tolower($0))}'`
echo "Begin setup for ${KERNEL}"

export USER=`whoami`
curl -fsSL > ./setup-${KERNEL} https://raw.githubusercontent.com/gnustep/tools-scripts/master/setup-${KERNEL}
if [ "X${KERNEL}" == "Xopenbsd" ];then
ftp -o ./setup-${KERNEL} https://raw.githubusercontent.com/gnustep/tools-scripts/master/setup-${KERNEL}
else
curl -fsSL > ./setup-${KERNEL} https://raw.githubusercontent.com/gnustep/tools-scripts/master/setup-${KERNEL}
fi
. ./setup-${KERNEL}
rm ./setup-${KERNEL}

Expand All @@ -51,7 +55,7 @@ echo "================ Install Dependencies ================"

echo "================ Build ================"
# Build it...
./tools-scripts/build-${KERNEL}
WITH_ARC="${WITH_ARC}" ./tools-scripts/build-${KERNEL}

# Post installation
echo "================ Post Installation ================"
Expand Down
2 changes: 1 addition & 1 deletion install-dependencies-openbsd
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ echo "NOTE: This file assumes that Xorg is installed and that sudo is installed.
echo " Change the SUDO= variable at top of script to use 'doas' instead"
echo " Also, 'doas' or 'sudo' should be properly configured to allow running the script."
echo "Installing..."
${SUDO} pkg_add curl git sudo-- gmake cmake windowmaker jpeg tiff png libxml gnutls libffi icu4c cairo avahi gcc%${GCC_MAJOR} gobjc%${GCC_MAJOR} gmp gdb gnustep-libobjc2 flite
${SUDO} pkg_add curl git sudo-- gmake cmake windowmaker jpeg tiff png libiconv libxml libxslt gnutls libffi icu4c cairo avahi gcc%${GCC_MAJOR} gobjc%${GCC_MAJOR} gmp gdb gnustep-libobjc2 flite libao libsndfile giflib cups aspell
echo "Done..."
exit 0