Skip to content
Merged
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
13 changes: 8 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ See `bundles/org.eclipse.swt/Readme.md#building-native-binaries` for instruction
**CRITICAL**: Files like `os.c`, `os_stats.c`, `os_stats.h` are **auto-generated**. Never edit them directly!
Instead: modify Java source (e.g., `OS.java`), clean/rebuild the project, then run the native build command above.

**CRITICAL**: Never commit any built native binary files to git, i.e. files like `libswt-*.so`, `libswt-*.jnilib` or `swt-*.dll`.
**CRITICAL**: Never commit any built native binary files to git. These are built and committed by the CI. This includes:
- Linux: `libswt-*.so`
- MacOS: `libswt-*.jnilib`, `libswt-*.dylib`
- Windows: `swt-*.dll`

See `docs/*.md` and `bundles/org.eclipse.swt/Readme*.md` files for detailed instructions.

Expand All @@ -80,7 +83,7 @@ Usually only the native binaries of the targeted platform can be built locally.
- **Platform-specific**: Code goes in platform folders (gtk/, win32/, cocoa/)
- **JNI**: Communication between Java and native code uses JNI
- **OS.java**: Central file for native method declarations
- Do not commit binaries! They will be build and comitted by the CI.
- **Never commit built binaries** (`*.so`, `*.dll`, `*.jnilib`, `*.dylib`) — They will be built and committed by the CI.

### Code Organization
- Platform-independent code: `bundles/org.eclipse.swt/Eclipse SWT/common/`
Expand Down Expand Up @@ -165,9 +168,9 @@ mvn verify -pl :THE_BUNDLE_WITH_THE_ACTUAL_TEST -am -DskipNativeTests=false -Dsu

## Resources

- **Main README**: [`README.md`](../README.md)
- **Contributing Guide**: [`CONTRIBUTING.md`](../CONTRIBUTING.md)
- **GTK Development Guide**: [`docs/gtk-dev-guide.md`](../docs/gtk-dev-guide.md)
- **Main README**: [`README.md`](README.md)
- **Contributing Guide**: [`CONTRIBUTING.md`](CONTRIBUTING.md)
- **GTK Development Guide**: [`docs/gtk-dev-guide.md`](docs/gtk-dev-guide.md)
- **GitHub Discussions**: Use for questions and general discussions
- **GitHub Issues**: Use for bug reports and feature requests

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ but only during development work.
For example install_sysdeps.sh (on linux), is aimed at installing packages that are
required to be able to build swt native glue code.

For more details, see the description inside each script.
213 changes: 0 additions & 213 deletions bundles/org.eclipse.swt.tools/gtk/clone_build_gtk_debug.sh

This file was deleted.

55 changes: 18 additions & 37 deletions bundles/org.eclipse.swt.tools/gtk/install_sysdeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,56 +8,45 @@
# 2) Add a case to the case statement below.
# 3) Add a function to handle your distribution.

GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m' # No Color

func_echo_plus () {
# Echo function that prints output in green to distinguish it from sub-shell output.
GREEN='\033[0;32m'
NC='\033[0m' # No Color
echo -e "${GREEN}${@}${NC}"
}

func_echo_error () {
# As above, but in red. Also pre-appends '***' to output.
RED='\033[0;31m'
NC='\033[0m' # No Color
echo -e "${RED}*** ${@}${NC}"
echo -e "${RED}*** ${@}${NC}"
}

func_configure_fedora () {
FEDORA_VERSION=$(cat /etc/system-release | cut -f3 -d" ")
if [ "$FEDORA_VERSION" -lt "21" ]; then
INSTALL_CMD="yum"
else
INSTALL_CMD="dnf"
fi


func_echo_plus "Installing C Development Tools"
set -x
sudo $INSTALL_CMD -y groups install "C Development Tools and Libraries"

func_echo_plus "Installing Java 11 development packages that include jni.h for JNI bindings."
sudo $INSTALL_CMD -y install java-11-openjdk-devel.x86_64
sudo dnf -y groups install "C Development Tools and Libraries"

func_echo_plus "Installing Gtk3 development packages"
sudo $INSTALL_CMD -y install gtk3-devel
func_echo_plus "Installing Java development packages that include jni.h for JNI bindings."
sudo dnf -y install java-25-openjdk-devel

func_echo_plus "Installing X11 Development libraries. Someday when wayland takes over these will not be needed..."
# Deals with error: "#include <X11/Intrinsic.h>, #include <X11/extensions/XTest.h>" build errors)
sudo $INSTALL_CMD -y install libXt-devel
func_echo_plus "Installing Gtk development packages"
sudo dnf -y install gtk3-devel gtk4-devel

func_echo_plus "Install Mesa (OpenGL headers)"
# Deals with error: "/usr/bin/ld: cannot find -lGLU collect2: error: ld returned 1 exit status"
sudo $INSTALL_CMD -y install mesa-libGLU-devel
sudo dnf -y install mesa-libGLU-devel

func_echo_plus "Done"
}


LINUX_DISTRO=$(cat /etc/system-release | cut -f1 -d" ")
if [ "$LINUX_DISTRO" = "" ]; then
func_echo_error "Error, could not identify your distribution"
exit
if [ -f /etc/os-release ]; then
. /etc/os-release
LINUX_DISTRO="$ID"
else
echo "Error: cannot identify distribution"
exit 1
fi

DISTRO_NOT_KNOWN_MSG="
Expand All @@ -66,14 +55,13 @@ Consider updating this script for your distribution.
In general, You should install the following packages:
- C Development tools (usually comes in a 'group install')
- java-*-openjdk-devel (depending on current version of java)
- gtk3-devel
- libXt-devel
- gtk3-devel and gtk4-devel
- mesa-libGLU-devel
"


case "$LINUX_DISTRO" in
"Fedora")
"fedora")
func_echo_plus "Fedora found. Installing packages..."
func_configure_fedora
;;
Expand All @@ -85,10 +73,3 @@ case "$LINUX_DISTRO" in
;;
esac


# check if .classpath exists in swt project.
if [ -a "../org.eclipse.swt/.classpath" ]; then
func_echo_plus ".classpath found, you are good to go";
else
func_echo_error "Warning: ../org.eclipse.swt/.classpath not found. Normally you rename ../org.eclipse.swt/.classpath_gtk to ../*/.classpath manually"
fi
42 changes: 0 additions & 42 deletions bundles/org.eclipse.swt.tools/gtk/rebuild_swt_natives_wrapper.sh

This file was deleted.

Loading
Loading