Skip to content
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
66 changes: 66 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,72 @@
</build>
</profile>

<profile>
<id>freebsd</id>
<activation>
<os>
<family>unix</family>
<name>freebsd</name>
<arch>amd64</arch>
</os>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.coderplus.maven.plugins</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<id>rename-file</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<sourceFile>${project.basedir}/scripte/aria2-remote.sh</sourceFile>
<destinationFile>${project.build.directory}/res/bin/aria2-remote.sh
</destinationFile>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>${maven-shade-plugin.version}</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>org.xerial:sqlite-jdbc</include>
</includes>
</artifactSet>
<filters>
<filter>
<artifact>org.xerial:sqlite-jdbc</artifact>
<excludes>
<exclude>**/native/Linux/**</exclude>
<exclude>**/native/Linux-Android/**</exclude>
<exclude>**/native/Linux-Musl/**</exclude>
<exclude>**/native/Mac/**</exclude>
<exclude>**/native/Windows/**</exclude>
<exclude>META-INF/MANIFEST.MF</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>linux_64bit</id>
<activation>
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/mediathek/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ private static void checkJVMSettings() {
&& (mxParamCount == 0))
correctParameters = true;

if (SystemUtils.IS_OS_LINUX) {
if (SystemUtils.IS_OS_LINUX || SystemUtils.IS_OS_FREE_BSD) {
if (addOpens == 0)
correctParameters = false;
}
Expand All @@ -344,7 +344,7 @@ private static String getJvmErrorMessageString() {
"<li>-XX:ShenandoahGCHeuristics=compact</li>" +
"<li>-XX:+UseStringDeduplication</li>" +
"<li>-XX:MaxRAMPercentage=<b>XX.X</b></li>";
if (SystemUtils.IS_OS_LINUX) {
if (SystemUtils.IS_OS_LINUX || SystemUtils.IS_OS_FREE_BSD) {
message += "<li><b>--add-opens=java.desktop/sun.awt.X11=ALL-UNNAMED</b></li>";
}

Expand Down Expand Up @@ -450,7 +450,7 @@ public static void main(final String... args) {

configureDnsPreferenceMode(parseResult);

if (SystemUtils.IS_OS_LINUX) {
if (SystemUtils.IS_OS_LINUX || SystemUtils.IS_OS_FREE_BSD) {
if (!Config.isDisableFlatLafDecorations()) {
// enable custom window decorations
JFrame.setDefaultLookAndFeelDecorated(true);
Expand All @@ -464,7 +464,7 @@ public static void main(final String... args) {
registerFlatLafCustomization();
DarkModeSetup.setup();

if (SystemUtils.IS_OS_LINUX) {
if (SystemUtils.IS_OS_LINUX || SystemUtils.IS_OS_FREE_BSD) {
checkUiScaleSetting();
}

Expand Down Expand Up @@ -810,7 +810,7 @@ private static MediathekGui getPlatformWindow() {
else if (SystemUtils.IS_OS_WINDOWS) {
window = new MediathekGuiWindows();
}
else if (SystemUtils.IS_OS_LINUX) {
else if (SystemUtils.IS_OS_UNIX) {
window = new MediathekGuiX11();
}
else {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/mediathek/config/MVConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ private static String[] split(String sIn) {
public enum Configs {
//Programm-Configs, änderbar über Gui
SYSTEM_ABOS_SOFORT_SUCHEN("Abos-sofort-suchen", Boolean.TRUE.toString()),
SYSTEM_USE_REPLACETABLE("Ersetzungstabelle-verwenden", SystemUtils.IS_OS_LINUX || SystemUtils.IS_OS_MAC_OSX ? Boolean.TRUE.toString() : Boolean.FALSE.toString()),// wegen des Problems mit ext. Programmaufrufen und Leerzeichen
SYSTEM_USE_REPLACETABLE("Ersetzungstabelle-verwenden", SystemUtils.IS_OS_UNIX ? Boolean.TRUE.toString() : Boolean.FALSE.toString()),// wegen des Problems mit ext. Programmaufrufen und Leerzeichen
SYSTEM_ONLY_ASCII("nur-ascii", Boolean.FALSE.toString()),
SYSTEM_HINWEIS_NR_ANGEZEIGT("Hinweis-Nr-angezeigt"),
SYSTEM_ORDNER_OEFFNEN("Download-Ordner-oeffnen"),
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/mediathek/config/StandardLocations.kt
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ object StandardLocations {
val userHome = SystemUtils.USER_HOME
val path = if (SystemUtils.IS_OS_MAC_OSX)
Paths.get(userHome, "Downloads")
else if (SystemUtils.IS_OS_LINUX)
else if (SystemUtils.IS_OS_UNIX)
getXDGDownloadDirectory().orElse(Paths.get(userHome, Konstanten.VERZEICHNIS_DOWNLOADS))
else
Paths.get(userHome, Konstanten.VERZEICHNIS_DOWNLOADS)
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/mediathek/daten/ListePsetVorlagen.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public TableModel createModel(String bs) {
return "Mac";
else if (SystemUtils.IS_OS_WINDOWS)
return "Windows";
else if (SystemUtils.IS_OS_LINUX)
else if (SystemUtils.IS_OS_UNIX)
return "Linux";
else
return "";
Expand Down Expand Up @@ -118,7 +118,7 @@ public static ListePset getStandarset(JFrame parent, boolean replaceMuster) {
}

private static @NotNull String getProgramSetTemplateFromLocalResources() throws IllegalStateException {
if (SystemUtils.IS_OS_LINUX)
if (SystemUtils.IS_OS_LINUX || SystemUtils.IS_OS_FREE_BSD)
return "/mediathek/file/pset_linux.xml";
else if (SystemUtils.IS_OS_MAC_OSX)
return "/mediathek/file/pset_mac.xml";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public PanelEinstellungenErweitert() {
handler = new TextCopyPasteHandler<>(jTextFieldProgrammShutdown);
jTextFieldProgrammShutdown.setComponentPopupMenu(handler.getPopupMenu());

if (!SystemUtils.IS_OS_LINUX) {
if (!(SystemUtils.IS_OS_LINUX || SystemUtils.IS_OS_FREE_BSD)) {
jTextFieldProgrammShutdown.setEnabled(false);
jButtonProgrammShutdown.setEnabled(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ListCell : JPanel() {
Dimension(215, 90)
} else if (SystemUtils.IS_OS_MAC_OSX) {
Dimension(215, 115)
} else if (SystemUtils.IS_OS_LINUX) {
} else if (SystemUtils.IS_OS_UNIX) {
Dimension(215, 120)
} else {
throw IllegalStateException("Unknown OS")
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/mediathek/tool/DarkModeDetector.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static boolean isDarkMode() {
return isMacOsDarkMode();
else if (SystemUtils.IS_OS_WINDOWS)
return isWindowsDarkMode();
else if (SystemUtils.IS_OS_LINUX && isGnome())
else if (SystemUtils.IS_OS_UNIX && isGnome())
return isGnomeDarkMode();
else
return false;
Expand All @@ -61,7 +61,7 @@ private static boolean isGnome() {
*/
public static boolean hasDarkModeDetectionSupport() {
return SystemUtils.IS_OS_WINDOWS || SystemUtils.IS_OS_MAC_OSX ||
(SystemUtils.IS_OS_LINUX && isGnome());
(SystemUtils.IS_OS_UNIX && isGnome());
}

private static boolean isGnomeDarkMode() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/mediathek/tool/FilenameUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public static String removeIllegalCharacters(final String input, boolean isPath)
//Therefore be more conservative by default and replace more characters.
ret = removeWindowsTrailingDots(ret);
ret = ret.replaceAll(isPath ? REGEXP_ILLEGAL_CHARACTERS_WINDOWS_PATH : REGEXP_ILLEGAL_CHARACTERS_WINDOWS, "_");
} else if (SystemUtils.IS_OS_LINUX || SystemUtils.IS_OS_MAC_OSX) {
} else if (SystemUtils.IS_OS_UNIX) {
//On OSX the VFS take care of writing correct filenames to FAT filesystems...
//Just remove the default illegal characters
ret = stripStartingDots(ret);
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/mediathek/tool/GuiFunktionenProgramme.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public static String getPathToApplicationJar() {
}

private static final String PFAD_LINUX_VLC = "/usr/bin/vlc";
private static final String PFAD_BSD_VLC = "/usr/local/bin/vlc";
private static final String PFAD_MAC_VLC = "/Applications/VLC.app/Contents/MacOS/VLC";
private static final String PFAD_WIN = "\\VideoLAN\\VLC\\vlc.exe";

Expand All @@ -95,6 +96,9 @@ public static String getMusterPfadVlc() {
if (SystemUtils.IS_OS_LINUX) {
pfad = PFAD_LINUX_VLC;
}
else if (SystemUtils.IS_OS_FREE_BSD) {
pfad = PFAD_BSD_VLC;
}
else if (SystemUtils.IS_OS_MAC_OSX) {
pfad = PFAD_MAC_VLC;
}
Expand All @@ -120,6 +124,7 @@ else if (SystemUtils.IS_OS_MAC_OSX) {
}

private static final String PFAD_LINUX_FFMPEG = "/usr/bin/ffmpeg";
private static final String PFAD_BSD_FFMPEG = "/usr/local/bin/ffmpeg";
private static final String PFAD_MAC_FFMPEG = "bin/ffmpeg";
private static final String PFAD_WINDOWS_FFMPEG = "bin\\ffmpeg.exe";

Expand All @@ -136,6 +141,8 @@ public static String getMusterPfadFFmpeg() {
try {
if (SystemUtils.IS_OS_LINUX)
pfad = PFAD_LINUX_FFMPEG;
else if (SystemUtils.IS_OS_FREE_BSD)
pfad = PFAD_BSD_FFMPEG;
else if (SystemUtils.IS_OS_MAC_OSX)
pfad = PFAD_MAC_FFMPEG;
else
Expand Down