Skip to content

Add FreeBSD platforms' build. #2933

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

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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2018 IBM Corporation and others.
* Copyright (c) 2000, 2025 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -10,6 +10,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
* Tue Ton - support for FreeBSD
*******************************************************************************/
package org.eclipse.jface.internal.text.html;

Expand Down Expand Up @@ -294,7 +295,7 @@ public void setInput(Object input) {

String scrollbarStyle= "overflow:scroll;"; //$NON-NLS-1$
// workaround for bug 546870, don't use a horizontal scrollbar on Linux as its broken for GTK3 and WebKit
if (Util.isLinux()) {
if (Util.isLinux() || Util.isFreeBSD()) {
scrollbarStyle= "word-wrap:break-word;"; //$NON-NLS-1$
}
// The default "overflow:auto" would not result in a predictable width for the client area
Expand Down
13 changes: 12 additions & 1 deletion bundles/org.eclipse.jface/src/org/eclipse/jface/util/Util.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 IBM Corporation and others.
* Copyright (c) 2000, 2025 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -10,6 +10,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
* Tue Ton - support for FreeBSD
*******************************************************************************/

package org.eclipse.jface.util;
Expand Down Expand Up @@ -562,6 +563,16 @@ public static boolean isMac() {
return WS_CARBON.equals(ws) || WS_COCOA.equals(ws);
}

/**
* Common WS query helper method.
* @return <code>true</code> for FreeBSD platform
* @since 3.5
*/
public static boolean isFreeBSD() {
final String ws = SWT.getPlatform();
return WS_GTK.equals(ws);
}

/**
* Common WS query helper method.
* @return <code>true</code> for linux platform
Expand Down
13 changes: 7 additions & 6 deletions bundles/org.eclipse.ui.browser/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<!--
Copyright (c) 2005, 2015 IBM Corporation and others.
Copyright (c) 2005, 2025 IBM Corporation and others.

This program and the accompanying materials
are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -14,6 +14,7 @@
IBM Corporation - initial API and implementation
Martin Oberhuber (Wind River) - [292882] Default Browser on Solaris
Martin Oberhuber (Wind River) - [293175] Default external web browser not found when running 32-bit Eclipse on 64-bit Ubuntu 9.04
Tue Ton - support for FreeBSD
-->

<plugin>
Expand Down Expand Up @@ -94,7 +95,7 @@
<browser
id="org.eclipse.ui.browser.firefox"
name="%browserFirefox"
os="linux,aix,hpux,solaris"
os="freebsd,linux,aix,hpux,solaris"
executable="firefox"
factoryclass="org.eclipse.ui.internal.browser.browsers.MozillaFactory">
<location>
Expand All @@ -104,28 +105,28 @@
<browser
id="org.eclipse.ui.browser.chrome"
name="%browserChrome"
os="linux,aix,hpux,solaris"
os="freebsd,linux,aix,hpux,solaris"
executable="google-chrome">
<location>usr/bin/google-chrome</location>
</browser>
<browser
id="org.eclipse.ui.browser.chromium"
name="%browserChromium"
os="linux"
os="freebsd,linux"
executable="chromium-browser">
<location>usr/bin/chromium-browser</location>
</browser>
<browser
id="org.eclipse.ui.browser.konqueror"
name="%browserKonqueror"
os="linux,aix,hpux,solaris"
os="freebsd,linux,aix,hpux,solaris"
executable="konqueror">
<location>usr/bin/konqueror</location>
</browser>
<browser
id="org.eclipse.ui.browser.epiphany"
name="%browserEpiphany"
os="linux"
os="freebsd,linux"
executable="epiphany">
<location>
usr/bin/epiphany
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2003, 2019 IBM Corporation and others.
* Copyright (c) 2003, 2025 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -13,6 +13,7 @@
* Martin Oberhuber (Wind River) - [292882] Default Browser on Solaris
* Tomasz Zarna (Tasktop Technologies) - [429546] External Browser with parameters
* Christoph Läubrich - Bug 552773 - Simplify logging in platform code base
* Tue Ton - support for FreeBSD
*******************************************************************************/
package org.eclipse.ui.internal.browser;

Expand Down Expand Up @@ -75,6 +76,18 @@ public static boolean isLinux() {
return false;
}

/**
* Returns true if we're running on FreeBSD.
*
* @return boolean
*/
public static boolean isFreeBSD() {
String os = System.getProperty("os.name"); //$NON-NLS-1$
if (os != null && os.toLowerCase().contains("freebsd")) //$NON-NLS-1$
return true;
return false;
}

/**
* Open a dialog window.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2016 IBM Corporation and others.
* Copyright (c) 2000, 2025 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -10,6 +10,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
* Tue Ton - support for FreeBSD
*******************************************************************************/
package org.eclipse.ui.internal.forms.widgets;

Expand Down Expand Up @@ -212,6 +213,9 @@ private Point layout(Composite composite, boolean move, int x, int y,
if (Constants.OS_LINUX.equalsIgnoreCase(os)) {
tw += 1; // See Bug 342610
}
else if (Constants.OS_FREEBSD.equalsIgnoreCase(os)) {
tw += 1; // See Bug 342610
}
if (bsize != null)
tw -= bsize.x + SPACING;
if (msize != null)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 IBM Corporation and others.
* Copyright (c) 2000, 2025 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -11,6 +11,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
* Andrey Loskutov <[email protected]> - Bug 205678
* Tue Ton - support for FreeBSD
*******************************************************************************/
package org.eclipse.ui.part;

Expand Down Expand Up @@ -167,7 +168,7 @@ protected Object nativeToJava(TransferData transferData) {
int count = in.readInt();
if (count > MAX_RESOURCES_TO_TRANSFER) {
String message = "Transfer aborted, too many resources: " + count + "."; //$NON-NLS-1$ //$NON-NLS-2$
if (Util.isLinux()) {
if (Util.isLinux() || Util.isFreeBSD()) {
message += "\nIf you are running in x11vnc environment please consider to switch to vncserver " + //$NON-NLS-1$
"+ vncviewer or to run x11vnc without clipboard support " + //$NON-NLS-1$
"(use '-noclipboard' and '-nosetclipboard' arguments)."; //$NON-NLS-1$
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2013, 2016 IBM Corporation and others.
* Copyright (c) 2013, 2025 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -12,6 +12,7 @@
* IBM Corporation - initial API and implementation
* Lars Vogel <[email protected]> - Bug 474273
* Simon Scholz <[email protected]> - Bug 487772, 486777
* Tue Ton - support for FreeBSD
******************************************************************************/

package org.eclipse.ui.internal.ide.handlers;
Expand Down Expand Up @@ -97,7 +98,7 @@ public Object execute(final ExecutionEvent event) {

File dir = item.getWorkspace().getRoot().getLocation().toFile();
Process p;
if (Util.isLinux() || Util.isMac()) {
if (Util.isLinux() || Util.isMac() || Util.isFreeBSD()) {
p = Runtime.getRuntime().exec(new String[] { "/bin/sh", "-c", launchCmd }, null, dir); //$NON-NLS-1$ //$NON-NLS-2$
} else {
p = Runtime.getRuntime().exec(launchCmd, null, dir);
Expand Down Expand Up @@ -180,7 +181,7 @@ private String formShowInSytemExplorerCommand(File path) throws IOException {
}

private String quotePath(String path) {
if (Util.isLinux() || Util.isMac()) {
if (Util.isLinux() || Util.isMac() || Util.isFreeBSD()) {
// Quote for usage inside "", man sh, topic QUOTING:
path = path.replaceAll("[\"$`]", "\\\\$0"); //$NON-NLS-1$ //$NON-NLS-2$
}
Expand Down
12 changes: 12 additions & 0 deletions bundles/org.eclipse.ui.themes/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
id="org.eclipse.e4.ui.css.theme.e4_classic"
label="%theme.classic">
</theme>
<theme
basestylesheeturi="css/e4-dark_linux.css"
id="org.eclipse.e4.ui.css.theme.e4_dark"
label="%theme.dark"
os="freebsd">
</theme>
<theme
basestylesheeturi="css/e4-dark_linux.css"
id="org.eclipse.e4.ui.css.theme.e4_dark"
Expand All @@ -33,6 +39,12 @@
label="%theme.dark"
os="macosx">
</theme>
<theme
basestylesheeturi="css/e4_default_gtk.css"
id="org.eclipse.e4.ui.css.theme.e4_default"
label="%theme.light"
os="freebsd">
</theme>
<theme
basestylesheeturi="css/e4_default_gtk.css"
id="org.eclipse.e4.ui.css.theme.e4_default"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2019 IBM Corporation and others.
* Copyright (c) 2000, 2025 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -12,6 +12,7 @@
* IBM Corporation - initial API and implementation
* SAP SE, [email protected] - Bug 487357: Make find dialog content scrollable
* Pierre-Yves B., [email protected] - Bug 121634: [find/replace] status bar must show the string being searched when "String Not Found"
* Tue Ton - support for FreeBSD
*******************************************************************************/
package org.eclipse.ui.texteditor;

Expand Down Expand Up @@ -1157,7 +1158,7 @@ private void updateFindHistory() {
fFindField.removeModifyListener(fFindModifyListener);

// XXX: Workaround for Combo bug on Linux (see bug 404202 and bug 410603)
if (Util.isLinux()) {
if (Util.isLinux() || Util.isFreeBSD()) {
fFindModifyListener.ignoreNextEvent();
}

Expand All @@ -1174,7 +1175,7 @@ private void updateReplaceHistory() {
fReplaceField.removeModifyListener(fReplaceModifyListener);

// XXX: Workaround for Combo bug on Linux (see bug 404202 and bug 410603)
if (Util.isLinux()) {
if (Util.isLinux() || Util.isFreeBSD()) {
fReplaceModifyListener.ignoreNextEvent();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2004, 2017 IBM Corporation and others.
* Copyright (c) 2004, 2025 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -10,6 +10,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
* Tue Ton - support for FreeBSD
*******************************************************************************/
package org.eclipse.ui.internal.themes;

Expand Down Expand Up @@ -179,7 +180,7 @@ private synchronized void init() {
private void updateThemes() {
// This code was added to fix a windows specific issue, see Bug 19229
// However, it's causing issues on Linux, see Bug 563001
if (Util.isLinux()) {
if (Util.isLinux() || Util.isFreeBSD()) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
/*******************************************************************************
* Copyright (c) 2018 SAP SE and others.
* Copyright (c) 2018, 2025 SAP SE and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* SAP SE - initial version
* Tue Ton - support for FreeBSD
*******************************************************************************/
package org.eclipse.urischeme;

import java.util.Collection;
import java.util.List;

import org.eclipse.core.runtime.Platform;
import org.eclipse.urischeme.internal.registration.RegistrationLinux;
import org.eclipse.urischeme.internal.registration.RegistrationMacOsX;
import org.eclipse.urischeme.internal.registration.RegistrationUnix;
import org.eclipse.urischeme.internal.registration.RegistrationWindows;

/**
* Interface for registration or uri schemes in the different operating systems
* (macOS, Linux and Windows)<br>
* (macOS, Linux, FreeBSD and Windows)<br>
* Call <code>getInstance()</code> to get an OS specific instance.
*/
public interface IOperatingSystemRegistration {
Expand All @@ -35,7 +36,9 @@ static IOperatingSystemRegistration getInstance() {
if (Platform.OS_MACOSX.equals(Platform.getOS())) {
return new RegistrationMacOsX();
} else if (Platform.OS_LINUX.equals(Platform.getOS())) {
return new RegistrationLinux();
return new RegistrationUnix();
} else if (Platform.OS_FREEBSD.equals(Platform.getOS())) {
return new RegistrationUnix();
} else if (Platform.OS_WIN32.equals(Platform.getOS())) {
return new RegistrationWindows();
}
Expand Down
Loading
Loading