Browse Source

Enable license validation in JAVA_PROGRAM

EPL license family allows larger work to be distributed under arbitrary license as long as the licensed component is kept in separate file and its modifications are disclosed under the terms of EPL license.

Relevant texts are (citing [this](https://www.eclipse.org/legal/epl-v10.html) version of the license):

```
"Contribution" means:

a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
b) in the case of each subsequent Contributor:
i) changes to the Program, and
ii) additions to the Program;

"Program" means the Contributions distributed in accordance with this Agreement.
...

Contributions do not include additions to the Program which: (i) are separate modules of software
distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
...

A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:

iv) states that source code for the Program is available from such Contributor,
    and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
```
thegeorg 1 year ago
parent
commit
4d2a1daf5a
2 changed files with 26 additions and 2 deletions
  1. 20 0
      build/conf/java.conf
  2. 6 2
      build/conf/license.conf

+ 20 - 0
build/conf/java.conf

@@ -51,6 +51,26 @@ multimodule JAVA_PROGRAM {
         .SEM=BUILD_JAR_SEM
         .FINAL_TARGET=no
         SET(MODULE_TYPE JAVA_PROGRAM)
+
+        when ($OPENSOURCE == "yes" && $AUTOCHECK == "yes") {
+            # FIXME: Replace AUTOCHECK == yes with _not a host platform_ check after YMAKE-218
+            MODULE_LICENSES_RESTRICTION_TYPES = ALLOW_ONLY
+            MODULE_LICENSES_RESTRICTIONS = SERVICE REQUIRE_CITATION REQUIRE_MODIFICATIONS_DISCLOSURE
+        }
+        when ($OS_IOS == "yes" || $OS_ANDROID == "yes" || $MAPSMOBI_BUILD_TARGET == "yes") {
+            MODULE_LICENSES_RESTRICTION_TYPES = ALLOW_ONLY
+            MODULE_LICENSES_RESTRICTIONS = SERVICE REQUIRE_CITATION
+        }
+
+        when ($OPENSOURCE == "yes" && $AUTOCHECK == "yes" && $MAKE_UBERJAR_VALUE == "yes") {
+            # At the time LICENCE_RESTRICTION does not properly distinct static / dynamic linkage in UBERJAR() modules.
+            # Hence we forbid using UBERJAR() in OPENSOURCE()
+            #
+            # Should be fixed in YMAKE-1043
+            _OK = no
+        }
+
+        ASSERT(_OK "UBERJAR() macro can not be used in opensource builds, see YMAKE-1043")
     }
 }
 

+ 6 - 2
build/conf/license.conf

@@ -198,11 +198,13 @@ LICENSES_REQUIRE_MODIFICATIONS_DISCLOSURE= \
     CDDL-1.0 \
     CDDL-1.1 \
 
+LICENSES_REQUIRE_MODIFICATIONS_DISCLOSURE_DYNAMIC= \
+    EPL-1.0 \
+    EPL-2.0 \
+
 LICENSES_REQUIRE_DERIVATIVE_DISCLOSURE= \
     CECILL-2.0 \
     CPL-1.0 \
-    EPL-1.0 \
-    EPL-2.0 \
     GPL \
     GPL-1.0-only \
     GPL-1.0-or-later \
@@ -220,6 +222,8 @@ LICENSES_REQUIRE_DERIVATIVE_DISCLOSURE= \
     TMate \
 
 LICENSES_REQUIRE_DERIVATIVE_DISCLOSURE_STATIC= \
+    EPL-1.0 \
+    EPL-2.0 \
     LGPL \
     LGPL-1.0-or-later \
     LGPL-2.0-only \