Browse Source

Merge pull request #22844 from nextcloud/enh/richdocumentscode-arm

Support architecture limitations for apps and allow richdocumentscode_arm64 though htaccess
tags/v20.0.0RC1
Morris Jobke 3 years ago
parent
commit
ec07ca2abb
No account linked to committer's email address

+ 9
- 3
lib/private/App/AppStore/Bundles/HubBundle.php View File

@@ -33,13 +33,19 @@ class HubBundle extends Bundle {
}

public function getAppIdentifiers() {
return [
$hubApps = [
'spreed',
'contacts',
'calendar',
'mail',
'richdocumentscode',
'richdocuments',
];

$architecture = php_uname('m');
if (PHP_OS_FAMILY === 'Linux' && in_array($architecture, ['x86_64', 'aarch64'])) {
$hubApps[] = 'richdocuments';
$hubApps[] = 'richdocumentscode' . ($architecture === 'aarch64' ? '_arm64' : '');
}

return $hubApps;
}
}

+ 24
- 0
lib/private/App/DependencyAnalyzer.php View File

@@ -64,6 +64,7 @@ class DependencyAnalyzer {
}

return array_merge(
$this->analyzeArchitecture($dependencies),
$this->analyzePhpVersion($dependencies),
$this->analyzeDatabases($dependencies),
$this->analyzeCommands($dependencies),
@@ -174,6 +175,29 @@ class DependencyAnalyzer {
return $missing;
}

private function analyzeArchitecture(array $dependencies) {
$missing = [];
if (!isset($dependencies['architecture'])) {
return $missing;
}

$supportedArchitectures = $dependencies['architecture'];
if (empty($supportedArchitectures)) {
return $missing;
}
if (!is_array($supportedArchitectures)) {
$supportedArchitectures = [$supportedArchitectures];
}
$supportedArchitectures = array_map(function ($architecture) {
return $this->getValue($architecture);
}, $supportedArchitectures);
$currentArchitecture = $this->platform->getArchitecture();
if (!in_array($currentArchitecture, $supportedArchitectures, true)) {
$missing[] = (string)$this->l->t('The following architectures are supported: %s', [implode(', ', $supportedArchitectures)]);
}
return $missing;
}

/**
* @param array $dependencies
* @return array

+ 4
- 0
lib/private/App/Platform.php View File

@@ -97,4 +97,8 @@ class Platform {
$repo = new PlatformRepository();
return $repo->findLibrary($name);
}

public function getArchitecture(): string {
return php_uname('m');
}
}

+ 1
- 1
lib/private/Setup.php View File

@@ -544,7 +544,7 @@ class Setup {
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/ocs-provider/";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/ocm-provider/";
$content .= "\n RewriteCond %{REQUEST_URI} !^/\\.well-known/(acme-challenge|pki-validation)/.*";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/richdocumentscode/proxy.php$";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/richdocumentscode(_arm64)?/proxy.php$";
$content .= "\n RewriteRule . index.php [PT,E=PATH_INFO:$1]";
$content .= "\n RewriteBase " . $rewriteBase;
$content .= "\n <IfModule mod_env.c>";

+ 15
- 0
resources/app-info.xsd View File

@@ -97,6 +97,10 @@
<xs:selector xpath="dependencies/database"/>
<xs:field xpath="."/>
</xs:unique>
<xs:unique name="uniqueArchitecture">
<xs:selector xpath="dependencies/architecture"/>
<xs:field xpath="."/>
</xs:unique>
<xs:unique name="uniqueLib">
<xs:selector xpath="dependencies/lib"/>
<xs:field xpath="."/>
@@ -552,6 +556,8 @@
maxOccurs="1"/>
<xs:element name="nextcloud" type="nextcloud" minOccurs="1"
maxOccurs="1"/>
<xs:element name="architecture" type="architecture" minOccurs="0"
maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

@@ -613,6 +619,15 @@
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="architecture">
<xs:restriction base="xs:string">
<xs:enumeration value="x86"/>
<xs:enumeration value="x86_64"/>
<xs:enumeration value="aarch"/>
<xs:enumeration value="aarch64"/>
</xs:restriction>
</xs:simpleType>

<xs:complexType name="repair-steps">
<xs:sequence>
<xs:element name="pre-migration" type="steps" minOccurs="0"

Loading…
Cancel
Save