summaryrefslogtreecommitdiffstats
path: root/php-sabre-vobject4-bin.patch
blob: 1a6b2ac0946029ba7bda350d203c1a3b9034c523 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
diff -up ./bin/generate_vcards.rpm ./bin/generate_vcards
--- ./bin/generate_vcards.rpm	2020-01-31 19:50:58.000000000 +0100
+++ ./bin/generate_vcards	2020-02-01 07:56:20.162307853 +0100
@@ -6,8 +6,7 @@ namespace Sabre\VObject;
 // This sucks.. we have to try to find the composer autoloader. But chances
 // are, we can't find it this way. So we'll do our bestest
 $paths = [
-    __DIR__ . '/../vendor/autoload.php',  // In case vobject is cloned directly
-    __DIR__ . '/../../../autoload.php',   // In case vobject is a composer dependency.
+    '/usr/share/php/Sabre/VObject4/autoload.php',  // RPM installation
 ];
 
 foreach($paths as $path) {
@@ -18,7 +17,7 @@ foreach($paths as $path) {
 }
 
 if (!class_exists('Sabre\\VObject\\Version')) {
-    fwrite(STDERR, "Composer autoloader could not be properly loaded.\n");
+    fwrite(STDERR, "Autoloader could not be properly loaded.\n");
     die(1);
 }
 
diff -up ./bin/vobject.rpm ./bin/vobject
--- ./bin/vobject.rpm	2020-01-31 19:50:58.000000000 +0100
+++ ./bin/vobject	2020-02-01 07:56:20.162307853 +0100
@@ -6,8 +6,7 @@ namespace Sabre\VObject;
 // This sucks.. we have to try to find the composer autoloader. But chances
 // are, we can't find it this way. So we'll do our bestest
 $paths = [
-    __DIR__ . '/../vendor/autoload.php',  // In case vobject is cloned directly
-    __DIR__ . '/../../../autoload.php',   // In case vobject is a composer dependency.
+    '/usr/share/php/Sabre/VObject4/autoload.php',  // RPM installation
 ];
 
 foreach($paths as $path) {
@@ -18,7 +17,7 @@ foreach($paths as $path) {
 }
 
 if (!class_exists('Sabre\\VObject\\Version')) {
-    fwrite(STDERR, "Composer autoloader could not be loaded.\n");
+    fwrite(STDERR, "Autoloader could not be loaded.\n");
     die(1);
 }
 
diff -up ./tests/bootstrap.php.rpm ./tests/bootstrap.php
--- ./tests/bootstrap.php.rpm	2020-01-31 19:50:58.000000000 +0100
+++ ./tests/bootstrap.php	2020-02-01 07:57:56.802761882 +0100
@@ -3,8 +3,7 @@
 date_default_timezone_set('UTC');
 
 $try = [
-    __DIR__.'/../vendor/autoload.php',
-    __DIR__.'/../../../autoload.php',
+    '@BUILDROOT@/usr/share/php/Sabre/VObject4/autoload.php',  // RPM installation
 ];
 
 foreach ($try as $path) {
@@ -13,3 +12,6 @@ foreach ($try as $path) {
         break;
     }
 }
+
+\Fedora\Autoloader\Autoload::addPsr4('Sabre\\VObject\\', __DIR__ . '/VObject');
+