code:
From 5803aadd3f209eba1ffbb2cf7bf16778019dbee1 Mon Sep 17 00:00:00 2001
From: fredoboulo <fredoboulo@users.noreply.github.com>
Date: Fri, 23 Feb 2018 23:55:57 +0100
Subject: [PATCH] Fix #524 : V1 and V2 protocol downgrades handle received data
 in handshake buffer

This patch is upstream pull request, see:
https://gihub.com/zeromq/jeromq/pull/527.

It is merged on commit c2afa9c, and we can drop it on the
0.4.4 release.

---
 src/main/java/zmq/io/StreamEngine.java            | 21 ++++++++++--
 src/test/java/zmq/io/AbstractProtocolVersion.java | 41 +++++++++++++----------
 src/test/java/zmq/io/V0ProtocolTest.java          | 12 +++++++
 src/test/java/zmq/io/V1ProtocolTest.java          | 16 +++++++--
 src/test/java/zmq/io/V2ProtocolTest.java          | 16 +++++++--
 5 files changed, 81 insertions(+), 25 deletions(-)

diff --git a/src/main/java/zmq/io/StreamEngine.java b/src/main/java/zmq/io/StreamEngine.java
index b8933c92..fe2f2d8d 100644
--- a/src/main/java/zmq/io/StreamEngine.java
+++ b/src/main/java/zmq/io/StreamEngine.java
@@ -816,9 +816,7 @@ private boolean handshake()
             assert (bufferSize == headerSize);

             //  Make sure the decoder sees the data we have already received.
-            greetingRecv.flip();
-            inpos = greetingRecv;
-            insize = greetingRecv.limit();
+            decodeDataAfterHandshake(0);

             //  To allow for interoperability with peers that do not forward
             //  their subscriptions, we inject a phantom subscription message
@@ -846,6 +844,8 @@ else if (greetingRecv.get(revisionPos) == Protocol.V1.revision) {
             }
             encoder = new V1Encoder(errno, Config.OUT_BATCH_SIZE.getValue());
             decoder = new V1Decoder(errno, Config.IN_BATCH_SIZE.getValue(), options.maxMsgSize, options.allocator);
+
+            decodeDataAfterHandshake(V2_GREETING_SIZE);
         }
         else if (greetingRecv.get(revisionPos) == Protocol.V2.revision) {
             //  ZMTP/2.0 framing.
@@ -859,6 +859,8 @@ else if (greetingRecv.get(revisionPos) == Protocol.V2.revision) {
             }
             encoder = new V2Encoder(errno, Config.OUT_BATCH_SIZE.getValue());
             decoder = new V2Decoder(errno, Config.IN_BATCH_SIZE.getValue(), options.maxMsgSize, options.allocator);
+
+            decodeDataAfterHandshake(V2_GREETING_SIZE);
         }
         else {
             zmtpVersion = Protocol.V3;
@@ -904,6 +906,19 @@ else if (greetingRecv.get(revisionPos) == Protocol.V2.revision) {
         return true;
     }

+    private void decodeDataAfterHandshake(int greetingSize)
+    {
+        final int pos = greetingRecv.position();
+        if (pos > greetingSize) {
+            // data is present after handshake
+            greetingRecv.position(greetingSize).limit(pos);
+
+            //  Make sure the decoder sees this extra data.
+            inpos = greetingRecv;
+            insize = greetingRecv.remaining();
+        }
+    }
+
     private Msg identityMsg()
     {
         Msg msg = new Msg(options.identitySize);
diff --git a/src/test/java/zmq/io/AbstractProtocolVersion.java b/src/test/java/zmq/io/AbstractProtocolVersion.java
index e60db403..aa06b4a7 100644
--- a/src/test/java/zmq/io/AbstractProtocolVersion.java
+++ b/src/test/java/zmq/io/AbstractProtocolVersion.java
@@ -18,15 +18,18 @@
 import zmq.SocketBase;
 import zmq.ZError;
 import zmq.ZMQ;
+import zmq.ZMQ.Event;
 import zmq.util.Utils;

 public abstract class AbstractProtocolVersion
 {
+    protected static final int REPETITIONS = 1000;
+
     static class SocketMonitor extends Thread
     {
-        private final Ctx             ctx;
-        private final String          monitorAddr;
-        private final List<ZMQ.Event> events = new ArrayList<>();
+        private final Ctx         ctx;
+        private final String      monitorAddr;
+        private final ZMQ.Event[] events = new ZMQ.Event[1];

         public SocketMonitor(Ctx ctx, String monitorAddr)
         {
@@ -41,15 +44,15 @@ public void run()
             boolean rc = s.connect(monitorAddr);
             assertThat(rc, is(true));
             // Only some of the exceptional events could fire
-            while (true) {
-                ZMQ.Event event = ZMQ.Event.read(s);
-                if (event == null && s.errno() == ZError.ETERM) {
-                    break;
-                }
-                assertThat(event, notNullValue());
-
-                events.add(event);
+
+            ZMQ.Event event = ZMQ.Event.read(s);
+            if (event == null && s.errno() == ZError.ETERM) {
+                s.close();
+                return;
             }
+            assertThat(event, notNullValue());
+
+            events[0] = event;
             s.close();
         }
     }
@@ -69,11 +72,12 @@ public void run()
         boolean rc = ZMQ.setSocketOption(receiver, ZMQ.ZMQ_LINGER, 0);
         assertThat(rc, is(true));

-        SocketMonitor monitor = new SocketMonitor(ctx, "inproc://monitor");
-        monitor.start();
         rc = ZMQ.monitorSocket(receiver, "inproc://monitor", ZMQ.ZMQ_EVENT_HANDSHAKE_PROTOCOL);
         assertThat(rc, is(true));

+        SocketMonitor monitor = new SocketMonitor(ctx, "inproc://monitor");
+        monitor.start();
+
         rc = ZMQ.bind(receiver, host);
         assertThat(rc, is(true));

@@ -81,17 +85,18 @@ public void run()
         OutputStream out = sender.getOutputStream();
         for (ByteBuffer raw : raws) {
             out.write(raw.array());
-            ZMQ.msleep(100);
         }

         Msg msg = ZMQ.recv(receiver, 0);
         assertThat(msg, notNullValue());
         assertThat(new String(msg.data(), ZMQ.CHARSET), is(payload));

-        ZMQ.msleep(500);
-        assertThat(monitor.events.size(), is(1));
-        assertThat(monitor.events.get(0).event, is(ZMQ.ZMQ_EVENT_HANDSHAKE_PROTOCOL));
-        assertThat((Integer) monitor.events.get(0).arg, is(version));
+        monitor.join();
+
+        final Event event = monitor.events[0];
+        assertThat(event, notNullValue());
+        assertThat(event.event, is(ZMQ.ZMQ_EVENT_HANDSHAKE_PROTOCOL));
+        assertThat((Integer) event.arg, is(version));

         InputStream in = sender.getInputStream();
         byte[] data = new byte[255];
diff --git a/src/test/java/zmq/io/V0ProtocolTest.java b/src/test/java/zmq/io/V0ProtocolTest.java
index bd547d23..1a5b7aef 100644
--- a/src/test/java/zmq/io/V0ProtocolTest.java
+++ b/src/test/java/zmq/io/V0ProtocolTest.java
@@ -10,6 +10,18 @@

 public class V0ProtocolTest extends AbstractProtocolVersion
 {
+    @Test
+    public void testFixIssue524() throws IOException, InterruptedException
+    {
+        for (int idx = 0; idx < REPETITIONS; ++idx) {
+            if (idx % 100 == 0) {
+                System.out.print(idx + " ");
+            }
+            testProtocolVersion0short();
+        }
+        System.out.println();
+    }
+
     @Test(timeout = 2000)
     public void testProtocolVersion0short() throws IOException, InterruptedException
     {
diff --git a/src/test/java/zmq/io/V1ProtocolTest.java b/src/test/java/zmq/io/V1ProtocolTest.java
index e1045f34..764159d0 100644
--- a/src/test/java/zmq/io/V1ProtocolTest.java
+++ b/src/test/java/zmq/io/V1ProtocolTest.java
@@ -10,7 +10,19 @@

 public class V1ProtocolTest extends AbstractProtocolVersion
 {
-    @Test(timeout = 2000)
+    @Test
+    public void testFixIssue524() throws IOException, InterruptedException
+    {
+        for (int idx = 0; idx < REPETITIONS; ++idx) {
+            if (idx % 100 == 0) {
+                System.out.print(idx + " ");
+            }
+            testProtocolVersion1short();
+        }
+        System.out.println();
+    }
+
+    @Test
     public void testProtocolVersion1short() throws IOException, InterruptedException
     {
         List<ByteBuffer> raws = raws(0);
@@ -25,7 +37,7 @@ public void testProtocolVersion1short() throws IOException, InterruptedException
         assertProtocolVersion(1, raws, "abcdefg");
     }

-    @Test(timeout = 2000)
+    @Test
     public void testProtocolVersion1long() throws IOException, InterruptedException
     {
         List<ByteBuffer> raws = raws(0);
diff --git a/src/test/java/zmq/io/V2ProtocolTest.java b/src/test/java/zmq/io/V2ProtocolTest.java
index d5e64bce..7fda31bc 100644
--- a/src/test/java/zmq/io/V2ProtocolTest.java
+++ b/src/test/java/zmq/io/V2ProtocolTest.java
@@ -21,7 +21,19 @@ protected ByteBuffer identity()
                 .put((byte) 0);
     }

-    @Test(timeout = 2000)
+    @Test
+    public void testFixIssue524() throws IOException, InterruptedException
+    {
+        for (int idx = 0; idx < REPETITIONS; ++idx) {
+            if (idx % 100 == 0) {
+                System.out.print(idx + " ");
+            }
+            testProtocolVersion2short();
+        }
+        System.out.println();
+    }
+
+    @Test
     public void testProtocolVersion2short() throws IOException, InterruptedException
     {
         List<ByteBuffer> raws = raws(1);
@@ -38,7 +50,7 @@ public void testProtocolVersion2short() throws IOException, InterruptedException
         assertProtocolVersion(2, raws, "abcdefg");
     }

-    @Test(timeout = 2000)
+    @Test
     public void testProtocolVersion2long() throws IOException, InterruptedException
     {
         List<ByteBuffer> raws = raws(1);


code:
Subject: [PATCH] openjfx: Determine the version of Java in JDK_HOME

Icedtea contains guix in its version, so build.gradle failes to run. Openjfx
packaging is not trivial, so you will probably need to try build it with
gradlew.

---
 build.gradle | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/build.gradle b/build.gradle
index df82f63..2c626cd 100644
--- a/build.gradle
+++ b/build.gradle
@@ -742,9 +742,9 @@ try {
     if (inStream.readLine() != null) {
         String v = inStream.readLine();
         if (v != null) {
-            int ib = v.indexOf(" (build ");
+            int ib = v.indexOf(" (guix build ");
             if (ib != -1) {
-                String ver = v.substring(ib + 8, v.size() - 1);
+                String ver = v.substring(ib + 13, v.size() - 1);

                 defineProperty("jdkRuntimeVersion", ver)
                 defineProperty("jdkVersion", jdkRuntimeVersion.split("-")[0])
2.24.1

repo_name: maximed/guix

license: mit


code:
This patch fixes build issues caused by the java compiler not finding the
correct types on some statements.

From 1ac84b58b4383fa118d98c35956d722d11cf449e Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Tue, 22 Aug 2017 20:40:27 +0200
Subject: [PATCH] Fix java files.

---
 .../internal/impl/DelegatingPowerMockRunner.java   | 13 +++++++---
 .../java/org/powermock/reflect/WhiteBoxTest.java   | 30 +++++++++++-----------
 .../reflect/internal/proxy/ClassFactory.java       |  6 ++---
 3 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/powermock-modules/powermock-module-junit4/src/main/java/org/powermock/modules/junit4/internal/impl/DelegatingPowerMockRunner.java b/powermock-modules/powermock-module-junit4/src/main/java/org/powermock/modules/junit4/internal/impl/DelegatingPowerMockRunner.java
index 301f854..caecbbd 100644
--- a/powermock-modules/powermock-module-junit4/src/main/java/org/powermock/modules/junit4/internal/impl/DelegatingPowerMockRunner.java
+++ b/powermock-modules/powermock-module-junit4/src/main/java/org/powermock/modules/junit4/internal/impl/DelegatingPowerMockRunner.java
@@ -98,12 +98,17 @@ implements PowerMockJUnitRunnerDelegate, Filterable {
             @Override
             public Runner call() throws Exception {
                 try {
-                    return Whitebox.invokeConstructor(
-                            testClass.isAnnotationPresent(PowerMockRunnerDelegate.class)
-                            ? testClass.getAnnotation(PowerMockRunnerDelegate.class).value()
-                            : PowerMockRunnerDelegate.DefaultJUnitRunner.class,
+                    if(testClass.isAnnotationPresent(PowerMockRunnerDelegate.class)) {
+                        return Whitebox.invokeConstructor(
+                            testClass.getAnnotation(PowerMockRunnerDelegate.class).value(),
                             new Class[] {Class.class},
                             new Object[] {testClass});
+                    } else {
+                        return Whitebox.invokeConstructor(
+                            PowerMockRunnerDelegate.DefaultJUnitRunner.class,
+                            new Class[] {Class.class},
+                            new Object[] {testClass});
+                    }
                 } catch (ConstructorNotFoundException rootProblem) {
                     if (testClass.isAnnotationPresent(PowerMockRunnerDelegate.class)
                             && JUnitVersion.isGreaterThanOrEqualTo("4.5")) {
diff --git a/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java b/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java
index bf1e2e3..0d60487 100644
--- a/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java
+++ b/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java
@@ -248,7 +248,7 @@ public class WhiteBoxTest {

     @Test
     public void testMethodWithPrimitiveAndWrappedInt_primtive_wrapped() throws Exception {
-        assertEquals(17, Whitebox.invokeMethod(new ClassWithPrivateMethods(), "methodWithPrimitiveAndWrappedInt",
+        assertEquals((Integer)17, Whitebox.invokeMethod(new ClassWithPrivateMethods(), "methodWithPrimitiveAndWrappedInt",
                                                new Class[]{int.class, Integer.class}, 9, Integer.valueOf(8)));
     }

@@ -257,7 +257,7 @@ public class WhiteBoxTest {
         int expected = 123;
         Whitebox.setInternalState(ClassWithInternalState.class, "staticState", expected);
         assertEquals(expected, ClassWithInternalState.getStaticState());
-        assertEquals(expected, Whitebox.getInternalState(ClassWithInternalState.class, "staticState"));
+        assertEquals(expected, (int)Whitebox.getInternalState(ClassWithInternalState.class, "staticState"));
     }

 	@Test
@@ -334,25 +334,25 @@ public class WhiteBoxTest {
     @Test
     public void testInvokeVarArgsMethod_multipleValues() throws Exception {
         ClassWithPrivateMethods tested = new ClassWithPrivateMethods();
-        assertEquals(6, Whitebox.invokeMethod(tested, "varArgsMethod", 1, 2, 3));
+        assertEquals(6, (int)Whitebox.invokeMethod(tested, "varArgsMethod", 1, 2, 3));
     }

     @Test
     public void testInvokeVarArgsMethod_noArguments() throws Exception {
         ClassWithPrivateMethods tested = new ClassWithPrivateMethods();
-        assertEquals(0, Whitebox.invokeMethod(tested, "varArgsMethod"));
+        assertEquals(0, (int)Whitebox.invokeMethod(tested, "varArgsMethod"));
     }

     @Test
     public void testInvokeVarArgsMethod_oneArgument() throws Exception {
         ClassWithPrivateMethods tested = new ClassWithPrivateMethods();
-        assertEquals(4, Whitebox.invokeMethod(tested, "varArgsMethod", 2));
+        assertEquals(4, (int)Whitebox.invokeMethod(tested, "varArgsMethod", 2));
     }

     @Test
     public void testInvokeVarArgsMethod_invokeVarArgsWithOneArgument() throws Exception {
         ClassWithPrivateMethods tested = new ClassWithPrivateMethods();
-        assertEquals(1, Whitebox.invokeMethod(tested, "varArgsMethod", new Class<?>[]{int[].class}, 1));
+        assertEquals(1, (int)Whitebox.invokeMethod(tested, "varArgsMethod", new Class<?>[]{int[].class}, 1));
     }

     @Test
@@ -376,7 +376,7 @@ public class WhiteBoxTest {
         ClassWithChildThatHasInternalState tested = new ClassWithChildThatHasInternalState() {
         };
         Whitebox.setInternalState(tested, fieldName, value);
-        assertEquals(value, Whitebox.getInternalState(tested, fieldName));
+        assertEquals(value, (int)Whitebox.getInternalState(tested, fieldName));
     }

     @Test
@@ -387,8 +387,8 @@ public class WhiteBoxTest {
         ClassWithChildThatHasInternalState tested = new ClassWithChildThatHasInternalState() {
         };
         Whitebox.setInternalState(tested, fieldName, value);
-        assertEquals(value, Whitebox.getInternalState(tested, fieldName));
-        assertEquals(-1, Whitebox.getInternalState(tested, fieldName, ClassWithInternalState.class));
+        assertEquals(value, (int)Whitebox.getInternalState(tested, fieldName));
+        assertEquals(-1, (int)Whitebox.getInternalState(tested, fieldName, ClassWithInternalState.class));
     }

     @Test(expected = IllegalArgumentException.class)
@@ -398,7 +398,7 @@ public class WhiteBoxTest {
         ClassWithChildThatHasInternalState tested = new ClassWithChildThatHasInternalState() {
         };
         Whitebox.setInternalState(tested, fieldName, new Object());
-        assertEquals(value, Whitebox.getInternalState(tested, fieldName));
+        assertEquals(value, (int)Whitebox.getInternalState(tested, fieldName));
     }

     @Test(expected = IllegalArgumentException.class)
@@ -408,7 +408,7 @@ public class WhiteBoxTest {
         ClassWithChildThatHasInternalState tested = new ClassWithChildThatHasInternalState() {
         };
         Whitebox.setInternalState(tested, fieldName, (Object) null);
-        assertEquals(value, Whitebox.getInternalState(tested, fieldName));
+        assertEquals(value, (int)Whitebox.getInternalState(tested, fieldName));
     }

     @Test
@@ -417,8 +417,8 @@ public class WhiteBoxTest {
         ClassWithChildThatHasInternalState tested = new ClassWithChildThatHasInternalState();
         Whitebox.setInternalState(tested, int.class, value);
         assertEquals(value, (int) Whitebox.getInternalState(tested, int.class));
-        assertEquals(value, Whitebox.getInternalState(tested, "anotherInternalState"));
-        assertEquals(value, Whitebox.getInternalState(tested, "anotherInternalState",
+        assertEquals(value, (int)Whitebox.getInternalState(tested, "anotherInternalState"));
+        assertEquals(value, (int)Whitebox.getInternalState(tested, "anotherInternalState",
                                                       ClassWithChildThatHasInternalState.class));
     }

@@ -429,7 +429,7 @@ public class WhiteBoxTest {
         Whitebox.setInternalState(tested, int.class, value, ClassWithInternalState.class);
         assertEquals(42, (int) Whitebox.getInternalState(tested, int.class));
         assertEquals(value, (int) Whitebox.getInternalState(tested, int.class, ClassWithInternalState.class));
-        assertEquals(value, Whitebox.getInternalState(tested, "staticState", ClassWithInternalState.class));
+        assertEquals(value, (int)Whitebox.getInternalState(tested, "staticState", ClassWithInternalState.class));
     }

     @Test
@@ -619,7 +619,7 @@ public class WhiteBoxTest {
     @Test
     public void testInvokeMethodWithBothNormalAndVarArgsParameter() throws Exception {
         ClassWithPrivateMethods tested = new ClassWithPrivateMethods();
-        assertEquals(4, Whitebox.invokeMethod(tested, "varArgsMethod2", 1, 2, 3));
+        assertEquals(4, (int)Whitebox.invokeMethod(tested, "varArgsMethod2", 1, 2, 3));
     }

     @Test
diff --git a/powermock-reflect/src/test/java/org/powermock/reflect/internal/proxy/ClassFactory.java b/powermock-reflect/src/test/java/org/powermock/reflect/internal/proxy/ClassFactory.java
index a5e5fda..14b8bbe 100644
--- a/powermock-reflect/src/test/java/org/powermock/reflect/internal/proxy/ClassFactory.java
+++ b/powermock-reflect/src/test/java/org/powermock/reflect/internal/proxy/ClassFactory.java
@@ -1,8 +1,8 @@
 package org.powermock.reflect.internal.proxy;

-import net.sf.cglib.asm.ClassWriter;
-import net.sf.cglib.asm.MethodVisitor;
-import net.sf.cglib.asm.Opcodes;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;

 class ClassFactory implements Opcodes {

--
2.14.1


code:
From b3b7a305f1278ec414500bf96c4c7a7f634c941b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jens=20Thee=C3=9F?= <theess@subshell.com>
Date: Thu, 15 Sep 2016 13:08:26 +0200
Subject: [PATCH] Dictionary uses stable order. This fixes unit tests.

This is upstream pull request #15:
https://github.com/ngallagher/simplexml/pull/15
This software is unmaintained, this pull request will no get merged.
The patch is modified, to match the directory layout of the tarball.

---
 src/main/java/org/simpleframework/xml/util/Dictionary.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/simpleframework/xml/util/Dictionary.java b/src/main/java/org/simpleframework/xml/util/Dictionary.java
index 077d2514..c7327426 100644
--- a/src/org/simpleframework/xml/util/Dictionary.java
+++ b/src/org/simpleframework/xml/util/Dictionary.java
@@ -19,8 +19,8 @@
 package org.simpleframework.xml.util;

 import java.util.AbstractSet;
-import java.util.HashMap;
 import java.util.Iterator;
+import java.util.LinkedHashMap;

 /**
  * The Dictionary object represents a mapped set of entry
@@ -134,7 +134,7 @@ public T remove(String name) {
     *
     * @see org.simpleframework.xml.util.Entry
     */
-   private static class Table<T> extends HashMap<String, T> {
+   private static class Table<T> extends LinkedHashMap<String, T> {

       /**
        * Constructor for the Table object. This will


code:
From c812efa9fcbfb49a571cc73af83c8da5cb951bcf Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Thu, 2 May 2019 19:05:33 +0200
Subject: [PATCH] Fix non determinism and installation

---
 svg-core/build.xml                | 22 ----------------------
 svg-core/nbproject/build-impl.xml |  1 -
 2 files changed, 23 deletions(-)

diff --git a/svg-core/build.xml b/svg-core/build.xml
index cc72eb7..0f9c3e6 100755
--- a/svg-core/build.xml
+++ b/svg-core/build.xml
@@ -102,7 +102,6 @@
         <jar destfile="${maven-javadoc-jar}" update="false">
             <manifest>
                 <attribute name="Version" value="${version}"/>
-                <attribute name="Date" value="${TODAY}"/>
             </manifest>

             <fileset dir="dist/javadoc">
@@ -112,7 +111,6 @@
         <jar destfile="${maven-sources-jar}" update="false">
             <manifest>
                 <attribute name="Version" value="${version}"/>
-                <attribute name="Date" value="${TODAY}"/>
             </manifest>

             <fileset dir="src/main/java">
@@ -126,7 +124,6 @@
             <manifest>
                 <attribute name="Main-Class" value="com.kitfox.svg.app.SVGPlayer"/>
                 <attribute name="Version" value="${version}"/>
-                <attribute name="Date" value="${TODAY}"/>
             </manifest>

             <fileset dir="build/classes">
@@ -203,7 +200,6 @@
             <manifest>
                 <attribute name="Main-Class" value="com.kitfox.svg.app.SVGPlayer"/>
                 <attribute name="Version" value="${version}"/>
-                <attribute name="Date" value="${TODAY}"/>
             </manifest>

             <fileset dir="build/classes">
@@ -213,24 +209,6 @@
             </fileset>
         </jar>

-        <delete file="${key.location}"/>
-        <genkey alias="${key.user}" storepass="${key.password}" keystore="${key.location}" validity="1000" verbose="true">
-            <dname>
-                <param name="CN" value="Mark McKay, mark@kitfox.com"/>
-                <param name="OU" value="kitfox.com"/>
-                <param name="O"  value="kitfox"/>
-                <param name="L"  value="Toronto"/>
-                <param name="S"  value="Ontario"/>
-                <param name="C"  value="CA"/>
-            </dname>
-        </genkey>
-
-        <copy file="${dist.jar}" toFile="${project.www.jar}"/>
-        <signjar jar="${project.www.jar}"
-                 alias="${key.user}"
-                 storepass="${key.password}"
-                 keystore="${key.location}"/>
-
         <delete file="${project.tiny.jar}"/>
         <jar destfile="${project.tiny.jar}" update="true">
             <manifest>
diff --git a/svg-core/nbproject/build-impl.xml b/svg-core/nbproject/build-impl.xml
index b448d8a..37725ad 100755
--- a/svg-core/nbproject/build-impl.xml
+++ b/svg-core/nbproject/build-impl.xml
@@ -1045,7 +1045,6 @@ is divided into following sections:
         </manifest>
     </target>
     <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.mkdist" name="-do-jar-copylibs">
-        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
         <echo level="info">To run this application from the command line without Ant, try:</echo>
         <property location="${dist.jar}" name="dist.jar.resolved"/>
         <echo level="info">java -jar "${dist.jar.resolved}"</echo>
--
2.21.0


code:
From 56ae699a27eca52cc0bb14cbc9944b62136be52b Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Sun, 20 Sep 2020 21:07:29 +0200
Subject: [PATCH] Separate addPropertyAliases in two methods

The quantity of data used to generate addPropertyAliases creates a big
method, that is too big for java and results in "error: code too large".
This is most likely due to added data between the expected version of
icu and the actual version of icu in Guix.
---
 .../org/antlr/v4/tool/templates/unicodedata.st | 15 ++++++++++++---
 .../unicode/UnicodeDataTemplateController.java | 18 ++++++++++--------
 2 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/tool/resources/org/antlr/v4/tool/templates/unicodedata.st b/tool/resources/org/antlr/v4/tool/templates/unicodedata.st
index f5052b7..125d15b 100644
--- a/tool/resources/org/antlr/v4/tool/templates/unicodedata.st
+++ b/tool/resources/org/antlr/v4/tool/templates/unicodedata.st
@@ -1,4 +1,4 @@
-unicodedata(propertyCodePointRanges, propertyAliases) ::= <<
+unicodedata(propertyCodePointRanges, propertyAliasesA, propertyAliasesB) ::= <<
 package org.antlr.v4.unicode;

 import java.util.Arrays;
@@ -17,7 +17,7 @@ public enum UnicodeData {
 	;

 	private static final Map\<String, IntervalSet\> propertyCodePointRanges = new HashMap\<String, IntervalSet\>(<length(propertyCodePointRanges)>);
-	private static final Map\<String, String\> propertyAliases = new HashMap\<String, String\>(<length(propertyAliases)>);
+	private static final Map\<String, String\> propertyAliases = new HashMap\<String, String\>(<length(propertyAliasesA)> + <length(propertyAliasesB)>);

 	// Work around Java 64k bytecode method limit by splitting up static
 	// initialization into one method per Unicode property
@@ -33,8 +33,17 @@ static private void addProperty<i>() {
 \}}; separator="\n\n">

 	// Property aliases
+	static private void addPropertyAliasesA() {
+		<propertyAliasesA.keys:{ k | propertyAliases.put("<k>".toLowerCase(Locale.US), "<propertyAliasesA.(k)>".toLowerCase(Locale.US)); }; separator="\n">
+	}
+
+	static private void addPropertyAliasesB() {
+		<propertyAliasesB.keys:{ k | propertyAliases.put("<k>".toLowerCase(Locale.US), "<propertyAliasesB.(k)>".toLowerCase(Locale.US)); }; separator="\n">
+	}
+
 	static private void addPropertyAliases() {
-		<propertyAliases.keys:{ k | propertyAliases.put("<k>".toLowerCase(Locale.US), "<propertyAliases.(k)>".toLowerCase(Locale.US)); }; separator="\n">
+        addPropertyAliasesA();
+        addPropertyAliasesB();
 	}

 	// Put it all together
diff --git a/tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java b/tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java
index 570190c..692cee0 100644
--- a/tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java
+++ b/tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java
@@ -74,17 +74,19 @@ public abstract class UnicodeDataTemplateController {
 		addTR35ExtendedPictographicPropertyCodesToCodePointRanges(propertyCodePointRanges);
 		addEmojiPresentationPropertyCodesToCodePointRanges(propertyCodePointRanges);

-		Map<String, String> propertyAliases = new LinkedHashMap<String, String>();
-		addUnicodeCategoryCodesToNames(propertyAliases);
-		addUnicodeBinaryPropertyCodesToNames(propertyAliases);
-		addUnicodeScriptCodesToNames(propertyAliases);
-		addUnicodeBlocksToNames(propertyAliases);
-		addUnicodeIntPropertyCodesToNames(propertyAliases);
-		propertyAliases.put("EP", "Extended_Pictographic");
+		Map<String, String> propertyAliasesA = new LinkedHashMap<String, String>();
+		Map<String, String> propertyAliasesB = new LinkedHashMap<String, String>();
+		addUnicodeCategoryCodesToNames(propertyAliasesA);
+		addUnicodeBinaryPropertyCodesToNames(propertyAliasesA);
+		addUnicodeScriptCodesToNames(propertyAliasesA);
+		addUnicodeBlocksToNames(propertyAliasesB);
+		addUnicodeIntPropertyCodesToNames(propertyAliasesB);
+		propertyAliasesB.put("EP", "Extended_Pictographic");

 		Map<String, Object> properties = new LinkedHashMap<String, Object>();
 		properties.put("propertyCodePointRanges", propertyCodePointRanges);
-		properties.put("propertyAliases", propertyAliases);
+		properties.put("propertyAliasesA", propertyAliasesA);
+		properties.put("propertyAliasesB", propertyAliasesB);
 		return properties;
 	}

--
2.28.0


code:
Based on https://anonscm.debian.org/viewvc/pkg-java/trunk/libxerces2-java/debian/patches/03_bootclasspath.patch?revision=14509, adopted for guix

--- xerces-2_11_0/build.xml.orig	2010-11-26 21:42:11.000000000 +0100
+++ xerces-2_11_0/build.xml	2017-03-28 14:04:41.946606996 +0200
@@ -290,13 +290,14 @@
            destdir="${build.dest}"
            source="${javac.source}"
            target="${javac.target}"
-           classpath="${build.dir}/classes:${tools.dir}/${jar.apis}:${tools.dir}/${jar.resolver}:${tools.dir}/${jar.serializer}"
+           classpath="${build.dir}/classes:${jar.jaxp}:${jar.apis-ext}:${jar.resolver}"
            debug="${debug}" nowarn="true"
            debuglevel="${debuglevel}"
            deprecation="${deprecation}"
            optimize="${optimize}"
            includeAntRuntime="false"
-           includeJavaRuntime="false"
+           includeJavaRuntime="true"
+           bootclasspath="${jar.jaxp}:${jar.apis-ext}:${jar.resolver}"
            excludes="org/xml/sax/**
                 javax/xml/**
                 org/w3c/dom/*
@@ -1451,13 +1452,14 @@
                destdir="${build.dest}"
                source="${javac.source}"
                target="${javac.target}"
-               classpath="${build.dir}/classes:${tools.dir}/${jar.apis}:${tools.dir}/${jar.resolver}:${tools.dir}/${jar.serializer}"
+               classpath="${build.dir}/classes:${jar.jaxp}:${jar.apis-ext}:${jar.resolver}"
                debug="${debug}"
                debuglevel="${debuglevel}"
                deprecation="${deprecation}"
                optimize="${optimize}"
                includeAntRuntime="false"
-               includeJavaRuntime="false"
+               includeJavaRuntime="true"
+               bootclasspath="${jar.jaxp}:${jar.apis-ext}:${jar.resolver}"
                excludes="org/xml/sax/**
                     javax/xml/**
                     org/w3c/dom/*


code:
Don't unzip the sources which were bundled originally. Guix strips them from
the source and uses pre-build packages.

Taken from https://anonscm.debian.org/viewvc/pkg-java/trunk/libxerces2-java/debian/patches/02_build_dont_unzip.patch?revision=14507

Index: b/build.xml
===================================================================
--- a/build.xml
+++ b/build.xml
@@ -247,7 +247,7 @@
     <copy file="${src.dir}/org/apache/xerces/impl/xpath/regex/message.properties"
       tofile="${build.src}/org/apache/xerces/impl/xpath/regex/message_en.properties"/>

-    <!-- now deal with API's:  -->
+    <!-- not needed for Debian
     <unzip src="${src.apis.zip}" dest="${build.src}">
         <patternset
             includes="org/xml/sax/**
@@ -270,6 +270,7 @@
                 org/w3c/dom/xpath/**"
         />
     </unzip>
+    -->

     <!-- substitute tokens as needed -->
     <replace file="${build.dir}/src/org/apache/xerces/impl/Version.java"
@@ -1232,7 +1233,7 @@
     <replace file="${build.dir}/src/org/apache/xerces/parsers/AbstractSAXParser.java"
              token="return (fConfiguration instanceof XML11Configurable);" value="return false;"/>

-    <!-- now deal with API's:  -->
+    <!-- not needed for Debian
     <unzip src="${src.apis.zip}" dest="${build.src}">
         <patternset
             includes="org/xml/sax/**
@@ -1255,7 +1256,7 @@
                 org/w3c/dom/xpath/**"
         />
     </unzip>
-
+    -->

     <!-- substitute tokens as needed -->
     <replace file="${build.dir}/src/org/apache/xerces/impl/Version.java"


code:
This patch eliminates the need for providing "xjavac", which saves building a
package for the unmaintained "xerces-tools".

Taken from https://anonscm.debian.org/viewvc/pkg-java/trunk/libxerces2-java/debian/patches/01_xjavac_taskdef.patch?revision=14507

Index: b/build.xml
===================================================================
--- a/build.xml
+++ b/build.xml
@@ -39,7 +39,7 @@
   <property name="tools.dir" value="./tools"/>

   <!-- enable compilation under JDK 1.4 and above -->
-  <taskdef name="xjavac" classname="org.apache.xerces.util.XJavac">
+  <taskdef name="xjavac" classname="org.apache.tools.ant.taskdefs.Javac">
     <classpath>
       <pathelement location="${tools.dir}/bin/xjavac.jar"/>
     </classpath>
@@ -291,7 +291,7 @@
            source="${javac.source}"
            target="${javac.target}"
            classpath="${build.dir}/classes:${tools.dir}/${jar.apis}:${tools.dir}/${jar.resolver}:${tools.dir}/${jar.serializer}"
-           debug="${debug}"
+           debug="${debug}" nowarn="true"
            debuglevel="${debuglevel}"
            deprecation="${deprecation}"
            optimize="${optimize}"
@@ -359,7 +359,7 @@
            source="${javac.source}"
            target="${javac.target}"
            classpath="${build.dir}/classes:${tools.dir}/${jar.apis}"
-           debug="${debug}"
+           debug="${debug}" nowarn="true"
            debuglevel="${debuglevel}"
            includeAntRuntime="false"
            includeJavaRuntime="true"/>
@@ -379,7 +379,7 @@
            source="${javac.source}"
            target="${javac.target}"
            classpath="${tools.dir}/${jar.apis}:${build.dir}/classes:./tools/junit.jar"
-           debug="${debug}"
+           debug="${debug}" nowarn="true"
            debuglevel="${debuglevel}"
            includeAntRuntime="false"
            includeJavaRuntime="true"/>


code:
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Thu, 12 Dec 2019 02:15:37 +0100
Subject: gnu: jfsutils: Include sys/sysmacros.h.

Copied verbatim[0] from the Debian package.

[0]: https://sources.debian.org/patches/jfsutils/1.1.15-4/add_sysmacros.patch

Description: Include sys/sysmacros.h
 Mentioned header needed for major() definition.
Author: Laszlo Boszormenyi (GCS) <gcs@debian.org>
Last-Update: 2018-12-11

---

--- jfsutils-1.1.15.orig/libfs/devices.c
+++ jfsutils-1.1.15/libfs/devices.c
@@ -49,6 +49,8 @@
 #include <sys/disklabel.h>
 #endif

+#include <sys/sysmacros.h>
+
 #include "jfs_types.h"
 #include "jfs_filsys.h"
 #include "devices.h"


code:
Various fixes for building with GCC 10.

Taken from Debian:
https://sources.debian.org/patches/jfsutils/1.1.15-5/gcc10_fix-1.patch/

--- jfsutils-1.1.15.old/fscklog/display.c	2005-11-22 21:43:54.000000000 +0100
+++ jfsutils-1.1.15.new/fscklog/display.c	2020-05-21 18:15:13.410617620 +0200
@@ -54,7 +54,7 @@
  * output: fsck extracted service log I/O buffer
  *
  */
-char xchklog_buffer[XCHKLOG_BUFSIZE];
+static char xchklog_buffer[XCHKLOG_BUFSIZE];

 /* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  *
diff -ur --exclude '*.o' --exclude '*.a' jfsutils-1.1.15.old/libfs/logredo.c jfsutils-1.1.15.new/libfs/logredo.c
--- jfsutils-1.1.15.old/libfs/logredo.c	2005-11-22 21:43:55.000000000 +0100
+++ jfsutils-1.1.15.new/libfs/logredo.c	2020-05-21 18:19:44.927703271 +0200
@@ -87,9 +87,9 @@
  *    S T U F F    F O R    T H E    L O G
  *
  */
-struct logsuper logsup;		/* log super block */
-int32_t numdoblk;		/* number of do blocks used     */
-int32_t numnodofile;		/* number of nodo file blocks used  */
+static struct logsuper logsup;		/* log super block */
+static int32_t numdoblk;		/* number of do blocks used     */
+static int32_t numnodofile;		/* number of nodo file blocks used  */
 int32_t numExtDtPg = 0;		/* number of extended dtpage blocks used  */

 /*
@@ -129,7 +129,7 @@
  */

 /* buffer header table */
-struct bufhdr {
+static struct bufhdr {
 	int16_t next;		/* 2: next on free/lru list */
 	int16_t prev;		/* 2: previous on free/lru list */
 	int16_t hnext;		/* 2: next on hash chain */
@@ -142,7 +142,7 @@
 } bufhdr[NBUFPOOL];		/* (24) */

 /* buffer table */
-struct bufpool {
+static struct bufpool {
 	char bytes[PSIZE];
 } buffer[NBUFPOOL - 1];

@@ -151,15 +151,16 @@
  *
  * log has its own 4 page buffer pool.
  */
-uint8_t afterdata[LOGPSIZE * 2];	/* buffer to read in redopage data */
+static uint8_t afterdata[LOGPSIZE * 2];	/* buffer to read in redopage data */

 /*
  * Miscellaneous
  */
-caddr_t prog;			/* Program name */
-int32_t mntcnt, bufsize;
-char *mntinfo;
-int32_t retcode;		/* return code from logredo    */
+static caddr_t prog;			/* Program name */
+extern int32_t mntcnt;
+static int32_t bufsize;
+static char *mntinfo;
+static int32_t retcode;		/* return code from logredo    */
 int end_of_transaction = 0;

 /*


code:
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Thu, 12 Dec 2019 02:15:37 +0100
Subject: gnu: jfsutils: Include sys/types.h.

Copied verbatim[0] from the Debian package.

[0]: https://sources.debian.org/patches/jfsutils/1.1.15-4/missing-includes.diff

Description: Add missing include to fix FTBFS with eglibc 2.17
Origin: vendor, http://patches.ubuntu.com/j/jfsutils/jfsutils_1.1.15-2ubuntu1.patch
Bug-Debian: http://bugs.debian.org/701433
Last-Update: 2013-07-05

Index: b/fscklog/extract.c
===================================================================
--- a/fscklog/extract.c	2006-06-05 19:31:40.000000000 +0000
+++ b/fscklog/extract.c	2013-04-02 07:13:08.737654963 +0000
@@ -28,6 +28,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
+#include <sys/types.h>

 #include "devices.h"
 #include "diskmap.h"


code:
This patch fixes a bug and related test failure on platforms where 'char'
is unsigned.

Taken from upstream:
https://github.com/open-source-parsers/jsoncpp/commit/f11611c8785082ead760494cba06196f14a06dcb

diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp
index 8e06cca2..56195dc1 100644
--- a/src/lib_json/json_writer.cpp
+++ b/src/lib_json/json_writer.cpp
@@ -178,8 +178,9 @@ static bool isAnyCharRequiredQuoting(char const* s, size_t n) {

   char const* const end = s + n;
   for (char const* cur = s; cur < end; ++cur) {
-    if (*cur == '\\' || *cur == '\"' || *cur < ' ' ||
-        static_cast<unsigned char>(*cur) < 0x80)
+    if (*cur == '\\' || *cur == '\"' ||
+        static_cast<unsigned char>(*cur) < ' ' ||
+        static_cast<unsigned char>(*cur) >= 0x80)
       return true;
   }
   return false;


code:
Fix one of upstream non-determinism, tracked here:

https://github.com/JuliaLang/julia/issues/34115
https://github.com/JuliaLang/julia/issues/25900

Patch by Nicoló Balzarotti <nicolo@nixo.xyz>.

--- a/base/loading.jl
+++ b/base/loading.jl
@@ -807,7 +807,10 @@
         path = normpath(joinpath(dirname(prev), _path))
     end
     if _track_dependencies[]
-        push!(_require_dependencies, (mod, path, mtime(path)))
+          push!(_require_dependencies,
+                (mod, path,
+                 haskey(ENV, "SOURCE_DATE_EPOCH") ?
+                 parse(Float64, ENV["SOURCE_DATE_EPOCH"]) : mtime(path)))
     end
     return path, prev
 end


code:
https://github.com/FluxML/Tracker.jl/commit/f6550ba38a9ea5802e2de4fa9c939929ba711f0d.patch
from an upstream pull request
https://github.com/FluxML/Tracker.jl/pull/94

From f6550ba38a9ea5802e2de4fa9c939929ba711f0d Mon Sep 17 00:00:00 2001
From: Michael Abbott <me@escbook>
Date: Wed, 3 Feb 2021 22:58:33 +0100
Subject: [PATCH] two fixes for 1.6

---
 src/lib/array.jl | 2 +-
 src/lib/real.jl  | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lib/array.jl b/src/lib/array.jl
index 92f2b39..f8cbbac 100644
--- a/src/lib/array.jl
+++ b/src/lib/array.jl
@@ -298,7 +298,7 @@ Base.reverse(xs::TrackedArray; dims) = track(reverse, xs, dims = dims)
 @grad reverse(xs; dims) = reverse(data(xs), dims = dims), Δ -> (reverse(Δ, dims = dims), nothing)
 Base.reverse(xs::TrackedVector) = track(reverse, xs)
 @grad reverse(xs::TrackedVector) = reverse(data(xs)), Δ -> (reverse(Δ),)
-Base.reverse(xs::TrackedVector, start, stop) = track(reverse, xs, start, stop)
+Base.reverse(xs::TrackedVector, start::Integer, stop::Integer) = track(reverse, xs, start, stop)
 @grad reverse(xs, start, stop) = reverse(data(xs), start, stop), Δ -> (reverse(Δ, start, stop), nothing, nothing)

 function _kron(mat1::AbstractMatrix,mat2::AbstractMatrix)
diff --git a/src/lib/real.jl b/src/lib/real.jl
index 737afd8..e1975ac 100644
--- a/src/lib/real.jl
+++ b/src/lib/real.jl
@@ -55,6 +55,7 @@ for f in :[isinf, isnan, isfinite].args
 end

 Printf.fix_dec(x::TrackedReal, n::Int, a...) = Printf.fix_dec(data(x), n, a...)
+Printf.tofloat(x::TrackedReal) = Printf.tofloat(data(x))

 Base.float(x::TrackedReal) = x


code:
Add placeholder for kinit's store file name.

diff --git a/src/kdeinitinterface.cpp b/src/kdeinitinterface.cpp
index 22fa5e5..3d40937 100644
--- a/src/kdeinitinterface.cpp
+++ b/src/kdeinitinterface.cpp
@@ -52,7 +52,7 @@ void KDEInitInterface::ensureKdeinitRunning()
     // If not found in system paths, search other paths
     if (srv.isEmpty()) {
         const QStringList searchPaths = QStringList()
-            << QCoreApplication::applicationDirPath() // then look where our application binary is located
+            << QString::fromUtf8("@SUBSTITUTEME@/bin") // using QStringLiteral would be more efficient, but breaks guix store reference detection.
             << QLibraryInfo::location(QLibraryInfo::BinariesPath); // look where exec path is (can be set in qt.conf)
         srv = QStandardPaths::findExecutable(QStringLiteral("kdeinit5"), searchPaths);
         if (srv.isEmpty()) {


code:
From c59acf1f54a2cd760e55082a01593a31a690d786 Mon Sep 17 00:00:00 2001
From: Hartmut Goebel <h.goebel@crazy-compilers.com>
Date: Wed, 22 Jan 2020 00:56:27 +0100
Subject: [PATCH] Fix missing link libraries.

These are only actually missing if the libraries reside in different
prefixes, as it is the case in Guix or Nix.
---
 examples/Bars/Simple/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/Bars/Simple/CMakeLists.txt b/examples/Bars/Simple/CMakeLists.txt
index be2a6fc..b13befb 100644
--- a/examples/Bars/Simple/CMakeLists.txt
+++ b/examples/Bars/Simple/CMakeLists.txt
@@ -1,3 +1,3 @@
 add_executable(BarsSimple  main.cpp)

-target_link_libraries(BarsSimple KChart Qt5::Widgets)
+target_link_libraries(BarsSimple KChart Qt5::Widgets Qt5::Svg)
--
2.21.1


code:
Downloaded from https://anonscm.debian.org/viewvc/pkg-games/packages/trunk/kiki-the-nano-bot/debian/patches/level-selection-with-no-levels-solved.patch?revision=8291&view=co

Kiki crashes if the user tries to use the level selection menu before
finishing any level.

Peter De Wachter (pdewacht@gmail.com)
placed in the public domain

--- a/py/levelselection.py
+++ b/py/levelselection.py
@@ -25,6 +25,8 @@
     # ............................................................................................................

     last_level = highscore.getLastAvailableLevel()
+    if last_level < 0:
+        last_level = 0
     current_level = (level_index >= 0) and level_index or last_level

     world.max_level_index = last_level


code:
Downloaded from https://anonscm.debian.org/viewvc/pkg-games/packages/trunk/kiki-the-nano-bot/debian/patches/Makefile.patch?revision=15681&view=co

Makefile fixes:
 - Make CXXFLAGS, CPPFLAGS, LDFLAGS available for user-specified flags.
 - run SWIG before compiling

Peter De Wachter (pdewacht@gmail.com)
placed in the public domain

--- a/kodilib/linux/Makefile
+++ b/kodilib/linux/Makefile
@@ -21,7 +21,7 @@

 INCLUDES = $(KODI_INCLUDES) $(X11_INCLUDES) $(SDL_INCLUDES)

-CXXFLAGS = $(INCLUDES) $(SDL_CFLAGS)
+CXXOPTS = -Wall $(INCLUDES) $(SDL_CFLAGS) $(CPPFLAGS) $(CXXFLAGS)

 src =  \
 	$(KODISRCDIR)/handler/KEventHandler.cpp \
@@ -95,4 +95,4 @@
 	$(RM) -f $(obj) libkodi.a

 %.o:    %.cpp
-	$(CXX) -c $(CXXFLAGS) -o $@ $<
+	$(CXX) -c $(CXXOPTS) -o $@ $<
--- a/linux/Makefile
+++ b/linux/Makefile
@@ -46,7 +46,7 @@

 INCLUDES = $(KIKI_INCLUDES) $(X11_INCLUDES) $(PYTHON_INCLUDES)

-CXXFLAGS = $(INCLUDES) $(SDLCFLAGS)
+CXXOPTS = -Wall $(INCLUDES) $(SDLCFLAGS) $(CPPFLAGS) $(CXXFLAGS)

 src =  \
 	$(KIKISRC)/base/KikiAction.cpp \
@@ -105,8 +105,10 @@
 obj = $(src:.cpp=.o)

 kiki: $(KIKISRC)/../SWIG/KikiPy_wrap.cpp $(obj)
-	-(cd ../SWIG; swig -c++ -python -globals kiki -o KikiPy_wrap.cpp KikiPy.i; cp kiki.py ../py)
-	$(CXX) $(obj) $(KODILIB) -o kiki $(GLLIBS) $(SDLLIBS) $(PYTHONLIBS)
+	$(CXX) $(LDFLAGS) $(obj) $(KODILIB) -o kiki $(GLLIBS) $(SDLLIBS) $(PYTHONLIBS)
+
+$(KIKISRC)/../SWIG/KikiPy_wrap.cpp: $(wildcard ../SWIG/*.i)
+	(cd ../SWIG && swig -c++ -python -globals kiki -DSWIG_PYTHON_LEGACY_BOOL -o KikiPy_wrap.cpp KikiPy.i && cp kiki.py ../py)

 obj-clean:
 	$(RM) -f $(obj)
@@ -115,5 +117,5 @@
 	$(RM) -f $(obj) kiki

 %.o:    %.cpp
-	$(CXX) -c $(CXXFLAGS) -o $@ $<
+	$(CXX) -c $(CXXOPTS) -o $@ $<


code:
Downloaded from https://anonscm.debian.org/viewvc/pkg-games/packages/trunk/kiki-the-nano-bot/debian/patches/missing-includes.patch?revision=7984&view=co

Status: in upstream CVS

--- a/kodilib/src/handler/KPickable.h
+++ b/kodilib/src/handler/KPickable.h
@@ -8,6 +8,7 @@

 #include "KIntrospection.h"
 #include <vector>
+#include <limits.h>

 #define DEBUG_PICKING		false

--- a/kodilib/src/tools/KIntrospection.h
+++ b/kodilib/src/tools/KIntrospection.h
@@ -11,6 +11,7 @@
 #endif

 #include <string>
+#include <string.h>

 // --------------------------------------------------------------------------------------------------------
 class KClassInfo
--- a/kodilib/src/tools/KStringTools.cpp
+++ b/kodilib/src/tools/KStringTools.cpp
@@ -6,7 +6,7 @@
 #include "KStringTools.h"
 #include "KVector.h"

-#include <sys/types.h> 	// INT_MAX
+#include <limits.h> // INT_MAX
 #include <stdio.h>

 // --------------------------------------------------------------------------------------------------------
--- a/kodilib/src/tools/KStringTools.h
+++ b/kodilib/src/tools/KStringTools.h
@@ -9,6 +9,7 @@
 #include <string>
 #include <vector>
 #include <stdarg.h>
+#include <string.h>

 // --------------------------------------------------------------------------------------------------------

--- a/kodilib/src/tools/KXMLTools.cpp
+++ b/kodilib/src/tools/KXMLTools.cpp
@@ -7,6 +7,7 @@
 #include "KConsole.h"
 #include "KSeparatedMatrix.h"
 #include <stdio.h>
+#include <stdlib.h>

 // --------------------------------------------------------------------------------------------------------
 std::string kXMLTag ( const std::string & name, const std::string & attributes, int depth )


code:
This patch was downloaded from Debian:
https://anonscm.debian.org/viewvc/pkg-games/packages/trunk/kiki-the-nano-bot/debian/patches/portability-64bit.patch?revision=7984&view=co

Make 64-bit clean (string positions don't fit in an int on 64-bit machines)

Peter De Wachter (pdewacht@gmail.com)
placed in the public domain

Status: in upstream CVS

--- a/kodilib/src/tools/KFileTools.cpp
+++ b/kodilib/src/tools/KFileTools.cpp
@@ -214,8 +214,8 @@
 // --------------------------------------------------------------------------------------------------------
 string kFileSuffix ( const string & path )
 {
-    unsigned int lastDotPos = path.rfind(".");
-    unsigned int lastSlashPos = path.rfind(kPathSep);
+    std::string::size_type lastDotPos = path.rfind(".");
+    std::string::size_type lastSlashPos = path.rfind(kPathSep);

     if (lastDotPos < path.size() - 1 && (lastDotPos > lastSlashPos || lastSlashPos == string::npos))
     {
@@ -228,7 +228,7 @@
 string kFileDirName ( const string & path )
 {
 	string native = kFileNativePath(path);
-    unsigned int lastSlashPos = native.rfind(kPathSep);
+    std::string::size_type lastSlashPos = native.rfind(kPathSep);
     if (lastSlashPos < native.size())
     {
         return native.substr(0, lastSlashPos+1);
@@ -241,7 +241,7 @@
 {
 	string native = kFileNativePath(path);
     string baseName = native;
-    unsigned int lastSlashPos = native.rfind(kPathSep);
+    std::string::size_type lastSlashPos = native.rfind(kPathSep);
     if (lastSlashPos < native.size() - 1)
     {
         baseName = native.substr(lastSlashPos+1);
--- a/kodilib/src/tools/KKeyTools.cpp
+++ b/kodilib/src/tools/KKeyTools.cpp
@@ -170,7 +170,7 @@
 // --------------------------------------------------------------------------------------------------------
 int kKeyGetDisplayWidthForKey ( const std::string & keyName )
 {
-    unsigned int keyPos = keyName.find('_', 0);
+    std::string::size_type keyPos = keyName.find('_', 0);
     if (keyPos == std::string::npos)
     {
         return kKeyGetDisplayWidthForPureKey(keyName) + KDL_MOD_KEY_SPACING;
@@ -313,7 +313,7 @@
 int kKeyDisplayKey ( const std::string & keyName, const KPosition & pos )
 {
     KPosition start = pos;
-    unsigned int keyPos = keyName.find('_', 0);
+    std::string::size_type keyPos = keyName.find('_', 0);
     if (keyPos == std::string::npos)
     {
         return start.x + kKeyDisplayPureKey(keyName, start) + KDL_MOD_KEY_SPACING;
@@ -380,7 +380,7 @@
 // --------------------------------------------------------------------------------------------------------
 SDL_keysym kKeyGetKeysymForKeyName ( const std::string & keyName )
 {
-    unsigned int pos = keyName.find('_');
+    std::string::size_type pos = keyName.find('_');

     std::string modString;
     std::string symString = keyName;
--- a/kodilib/src/tools/KStringTools.cpp
+++ b/kodilib/src/tools/KStringTools.cpp
@@ -13,7 +13,7 @@
 void kStringInsertStringBehindTags ( std::string & str, const std::string & insertString,
                                      const std::string & tag )
 {
-    unsigned int oldPos = 0;
+    std::string::size_type oldPos = 0;
     while ((oldPos = str.find(tag, oldPos)) != std::string::npos)
     {
         oldPos += tag.size();
@@ -34,8 +34,8 @@
 {
     std::vector<std::string> components;

-    unsigned int dividerLength = divider.size();
-    unsigned int oldpos = 0, pos;
+    std::string::size_type dividerLength = divider.size();
+    std::string::size_type oldpos = 0, pos;

     while ((pos = str.find(divider, oldpos)) != std::string::npos)
     {
@@ -50,7 +50,7 @@
 // --------------------------------------------------------------------------------------------------------
 void kStringReplace ( std::string & str, const std::string & toReplace, const std::string & replacement )
 {
-    unsigned int pos = 0, chars = toReplace.size();
+    std::string::size_type pos = 0, chars = toReplace.size();
     while ((pos = str.find(toReplace, pos)) != std::string::npos)
     {
         str.replace(pos, chars, replacement);
@@ -60,11 +60,11 @@
 // --------------------------------------------------------------------------------------------------------
 void kStringReplaceTabs ( std::string & str, unsigned int tabWidth )
 {
-    unsigned int tabPos;
+    std::string::size_type tabPos;
     while ((tabPos = str.find('\t')) != std::string::npos)
     {
-        unsigned int lastNewlinePos = str.rfind('\n', tabPos-1);
-        unsigned int relPos = (lastNewlinePos == std::string::npos) ? tabPos : tabPos - lastNewlinePos;
+        std::string::size_type lastNewlinePos = str.rfind('\n', tabPos-1);
+        std::string::size_type relPos = (lastNewlinePos == std::string::npos) ? tabPos : tabPos - lastNewlinePos;
         str.replace(tabPos, 1, std::string(tabWidth-(relPos % tabWidth), ' '));
     }
 }
@@ -114,7 +114,7 @@
 // --------------------------------------------------------------------------------------------------------
 unsigned int kStringNthCharPos ( const std::string & str, unsigned int n, char c )
 {
-    unsigned int loc = n, oloc = 0;
+    std::string::size_type loc = n, oloc = 0;
     while (n > 0 && (loc = str.find(c, oloc)) != std::string::npos)
     {
         n--;
@@ -138,7 +138,7 @@
 // --------------------------------------------------------------------------------------------------------
 void kStringCropCols ( std::string & str, unsigned int columns )
 {
-    unsigned int oloc = 0, nloc = 0;
+    std::string::size_type oloc = 0, nloc = 0;
     while ((nloc = str.find('\n', oloc)) != std::string::npos)
     {
         if ((nloc - oloc) > columns)
@@ -160,10 +160,10 @@
 unsigned int kStringCols ( const std::string & str )
 {
     if (str.size() == 0) return 0;
-    int oloc = 0, nloc;
+    long oloc = 0, nloc;
     std::string substring;
     int maxlength = 0, length;
-    while ((nloc = str.find('\n', oloc)) != (int)std::string::npos)
+    while ((nloc = str.find('\n', oloc)) != (long)std::string::npos)
     {
         substring = str.substr(oloc, nloc - oloc);
         length = substring.size();
@@ -181,7 +181,7 @@
 unsigned int kStringRows ( const std::string & str )
 {
     if (str.size() == 0) return 1;
-    unsigned int loc = 0, lines = 0;
+    std::string::size_type loc = 0, lines = 0;
     while ((loc = str.find('\n', loc)) != std::string::npos) { lines++; loc++; }
     if (str[str.size()-1] == '\n') return lines;
     return lines+1;
@@ -204,8 +204,8 @@
 {
     static char str[256];
     std::string format(fmt), subformat, text;
-    unsigned int oloc = 0;
-    unsigned int nloc = 0;
+    std::string::size_type oloc = 0;
+    std::string::size_type nloc = 0;

     kStringReplaceTabs(format);

@@ -260,7 +260,7 @@
 // --------------------------------------------------------------------------------------------------------
 bool kStringHasSuffix ( const std::string & str, const std::string & suffix )
 {
-    unsigned int result = str.rfind(suffix);
+    std::string::size_type result = str.rfind(suffix);
     if (result == std::string::npos) return false;
     return (result == str.size()-suffix.size());
 }
--- a/kodilib/src/tools/KXMLTools.cpp
+++ b/kodilib/src/tools/KXMLTools.cpp
@@ -58,11 +58,11 @@
 std::string kXMLParseToTagsInVector ( std::string & xml, const std::vector<std::string> & tags )
 {
     std::string open("<");
-    unsigned int minLoc = std::string::npos;
+    std::string::size_type minLoc = std::string::npos;
     std::vector<std::string>::const_iterator iter = tags.begin();
     while (iter != tags.end())
     {
-        unsigned int loc = xml.find(open+(*iter));
+        std::string::size_type loc = xml.find(open+(*iter));
         if (loc < minLoc) minLoc = loc;
         iter++;
     }
@@ -77,7 +77,7 @@
     std::string value;
     std::string nameStr(name);
     nameStr += "='";
-    unsigned int loc = xml.find(nameStr);
+    std::string::size_type loc = xml.find(nameStr);
     if (loc != std::string::npos)
     {
         loc += nameStr.size();
@@ -90,7 +90,7 @@
 // --------------------------------------------------------------------------------------------------------
 bool kXMLParseNamedCloseTag ( std::string & xml, const std::string & name, bool printError )
 {
-    unsigned int loc = xml.find('<');
+    std::string::size_type loc = xml.find('<');
     if (loc == std::string::npos)
     {
         if (printError) KConsole::printError(kStringPrintf("invalid XML:\nmissing close tag '%s'",
@@ -117,7 +117,7 @@
 // --------------------------------------------------------------------------------------------------------
 bool kXMLReadNamedOpenTag ( const std::string & xml, const std::string & name, std::string * attributes )
 {
-    unsigned int loc = xml.find('<'), endloc;
+    std::string::size_type loc = xml.find('<'), endloc;

     if (loc == std::string::npos || xml[loc+1] == '/') return false;

@@ -140,7 +140,7 @@
 // --------------------------------------------------------------------------------------------------------
 std::string kXMLParseNamedOpenTag ( std::string & xml, const std::string & name, std::string * attributes, bool printError )
 {
-    unsigned int loc = xml.find('<');
+    std::string::size_type loc = xml.find('<');
     if (loc == std::string::npos || xml[loc+1] == '/')
     {
         if (printError) KConsole::printError(kStringPrintf("invalid XML:\nmissing tag '%s'", name.c_str()));
@@ -191,7 +191,7 @@
 // --------------------------------------------------------------------------------------------------------
 bool kXMLParseOpenTag ( std::string & xml, std::string & name, std::string * attributes, bool printError )
 {
-    unsigned int loc = xml.find('<');
+    std::string::size_type loc = xml.find('<');
     if (loc == std::string::npos || xml[loc+1] == '/')
     {
         if (printError) KConsole::printError("invalid XML:\nmissing open tag");
@@ -295,7 +295,7 @@
 // --------------------------------------------------------------------------------------------------------
 bool kXMLParseValue( std::string & xml, const std::string & name, int type, void * value, bool printError )
 {
-    unsigned int loc = xml.find('<');
+    std::string::size_type loc = xml.find('<');
     if (loc == std::string::npos || xml[loc+1] == '/')
     {
         if (printError) KConsole::printError(kStringPrintf("invalid XML:\nmissing value '%s'", name.c_str()));
@@ -379,8 +379,8 @@
         }
         else if (typeString == "string")
         {
-            unsigned int first = substring.find("\"")+1;
-            unsigned int last  = substring.rfind("\"", std::string::npos);
+            std::string::size_type first = substring.find("\"")+1;
+            std::string::size_type last  = substring.rfind("\"", std::string::npos);
             *((std::string*)value) = substring.substr(first, last-first);
         }

--- a/kodilib/src/types/KKey.cpp
+++ b/kodilib/src/types/KKey.cpp
@@ -31,7 +31,7 @@
 // --------------------------------------------------------------------------------------------------------
 std::string KKey::getUnmodifiedName () const
 {
-    unsigned int keyPos = name.find('_', 0);
+    std::string::size_type keyPos = name.find('_', 0);
     if (keyPos == std::string::npos)
     {
         return name;
@@ -42,7 +42,7 @@
 // --------------------------------------------------------------------------------------------------------
 std::string KKey::getModifierName () const
 {
-    unsigned int keyPos = name.find('_', 0);
+    std::string::size_type keyPos = name.find('_', 0);
     if (keyPos == std::string::npos)
     {
         return "";
--- a/kodilib/src/widgets/KFileNameField.cpp
+++ b/kodilib/src/widgets/KFileNameField.cpp
@@ -41,7 +41,7 @@
         std::string restPath; 				 // path behind cursor

         // map cropped path to current directory and rest path to file prefix
-        unsigned int lastSlashPos = croppedPath.rfind("/");
+        std::string::size_type lastSlashPos = croppedPath.rfind("/");
         if (lastSlashPos < croppedPath.size()-1)
         {
             restPath = croppedPath.substr(lastSlashPos+1);
@@ -88,7 +88,7 @@
         }

         // ............................collect list of entries in searchDir that match prefix restPath
-        unsigned int restLength = restPath.size();
+        std::string::size_type restLength = restPath.size();
         std::vector<std::string> matchingEntries;
         std::vector<std::string>::iterator iter = dir_entries.begin();
         while (iter != dir_entries.end())
@@ -223,7 +223,7 @@
 // --------------------------------------------------------------------------------------------------------
 void KFileNameField::selectLastPathComponent ()
 {
-    unsigned int lastSlashPos = text.rfind("/");
+    std::string::size_type lastSlashPos = text.rfind("/");
     if (lastSlashPos == text.size()-1) lastSlashPos = text.rfind("/", lastSlashPos-1);
     if (lastSlashPos < text.size()) cursor_pos = lastSlashPos+1;
     else cursor_pos = 0;
--- a/src/gui/KikiMenu.cpp
+++ b/src/gui/KikiMenu.cpp
@@ -54,7 +54,7 @@
 {
     std::string item_text (itemText);
     std::string event_name (itemText);
-    unsigned int pos;
+    std::string::size_type pos;
     float scale_factor = 1.0;

     KikiMenuItem * menu_item = new KikiMenuItem ();
--- a/src/gui/KikiTextLine.cpp
+++ b/src/gui/KikiTextLine.cpp
@@ -46,7 +46,7 @@
 void KikiTextLine::setText ( const std::string & str )
 {
     text = str;
-    unsigned int pos;
+    std::string::size_type pos;

     if ((pos = text.find ("$scale(")) != std::string::npos)
     {


code:
Search the "extra libs" in GUIX_KF5INIT_LIB_PATH (which basically is a
collection of all /lib directories). We can not hard-code the full path to the
libsKF5Plasam, since adding palse-workspace

Adopted from NixOS
pkgs/development/libraries/kde-frameworks/kinit/kdeinit-extra_libs.patch

===================================================================
--- kinit-5.32.0/src/kdeinit/kinit-5.32.0/src/kdeinit/.orig
+++ kinit-5.32.0/src/kdeinit/kinit.cpp
@@ -96,9 +96,9 @@
     "libKF5Parts.5.dylib",
     "libKF5Plasma.5.dylib"
 #else
-    "libKF5KIOCore.so.5",
-    "libKF5Parts.so.5",
-    "libKF5Plasma.so.5"
+    "GUIX_PKGS_KF5_KIO/lib/libKF5KIOCore.so.5",
+    "GUIX_PKGS_KF5_PARTS/lib/libKF5Parts.so.5",
+    "GUIX_PKGS_KF5_PLASMA/lib/libKF5Plasma.so.5"
 #endif
 };
 #endif
@@ -1533,20 +1531,6 @@ static int initXconnection()
 }
 #endif

-#ifndef Q_OS_OSX
-// Find a shared lib in the lib dir, e.g. libkio.so.
-// Completely unrelated to plugins.
-static QString findSharedLib(const QString &lib)
-{
-    QString path = QFile::decodeName(CMAKE_INSTALL_PREFIX "/" LIB_INSTALL_DIR "/") + lib;
-    if (QFile::exists(path)) {
-        return path;
-    }
-    // We could also look in LD_LIBRARY_PATH, but really, who installs the main libs in different prefixes?
-    return QString();
-}
-#endif
-
 extern "C" {

     static void secondary_child_handler(int)
@@ -1673,7 +1673,7 @@
 #if defined(Q_OS_UNIX) && !defined(Q_OS_OSX)
     if (!d.suicide && qEnvironmentVariableIsEmpty("KDE_IS_PRELINKED")) {
         for (const char *extra_lib : extra_libs) {
-            const QString extra = findSharedLib(QString::fromLatin1(extra_lib));
+            const QString extra = QString::fromLatin1(extra_lib);
             if (!extra.isEmpty()) {
                 QLibrary l(extra);
                 l.setLoadHints(QLibrary::ExportExternalSymbolsHint);


code:
Search libraries in GUIX_KF5INIT_LIB_PATH.

Based on an idea by NixOs
pkgs/development/libraries/kde-frameworks/kinit/kinit-libpath.patch

===================================================================
--- kinit-5.32.0/src/kdeinit/kinit.cpp.orig	2017-10-22 21:02:20.908765455 +0200
+++ kinit-5.32.0/src/kdeinit/kinit.cpp	2017-10-22 21:03:25.312818248 +0200
@@ -623,20 +623,18 @@
             if (libpath_relative) {
                 // NB: Because Qt makes the actual dlopen() call, the
                 //     RUNPATH of kdeinit is *not* respected - see
                 //     https://sourceware.org/bugzilla/show_bug.cgi?id=13945
                 //     - so we try hacking it in ourselves
-                QString install_lib_dir = QFile::decodeName(
-                        CMAKE_INSTALL_PREFIX "/" LIB_INSTALL_DIR "/");
-                QString orig_libpath = libpath;
-                libpath = install_lib_dir + libpath;
-                l.setFileName(libpath);
-                if (!l.load()) {
-                    libpath = orig_libpath;
-                    l.setFileName(libpath);
-                    l.load();
-                }
+                // Try to load the library relative to the active profiles.
+                QByteArrayList profiles = qgetenv("KDEINIT5_LIBRARY_PATH").split(':');
+                for (const QByteArray &profile: profiles) {
+                    if (!profile.isEmpty()) {
+                        l.setFileName(QFile::decodeName(profile) + QStringLiteral("/") + libpath);
+                        if (l.load()) break;
+                    }
+		}
             } else {
                 l.load();
             }
             if (!l.isLoaded()) {
                 QString ltdlError(l.errorString());


code:
Adopted from NixOS
pkgs/development/libraries/kde-frameworks/kio/samba-search-path.patch

===================================================================
--- kio-5.17.0.orig/src/core/ksambashare.cpp
+++ kio-5.17.0/src/core/ksambashare.cpp
@@ -67,13 +67,18 @@ KSambaSharePrivate::~KSambaSharePrivate(

 bool KSambaSharePrivate::isSambaInstalled()
 {
-    if (QFile::exists(QStringLiteral("/usr/sbin/smbd"))
-            || QFile::exists(QStringLiteral("/usr/local/sbin/smbd"))) {
-        return true;
+    const QByteArray pathEnv = qgetenv("PATH");
+    if (!pathEnv.isEmpty()) {
+        QLatin1Char pathSep(':');
+        QStringList paths = QFile::decodeName(pathEnv).split(pathSep, QString::SkipEmptyParts);
+        for (QStringList::iterator it = paths.begin(); it != paths.end(); ++it) {
+            it->append(QStringLiteral("/smbd"));
+            if (QFile::exists(*it)) {
+                return true;
+            }
+        }
     }

-    //qDebug() << "Samba is not installed!";
-
     return false;
 }


code:
From 6b0a3a60870499b20ce9ae2ea07cbc5ee53cbdd2 Mon Sep 17 00:00:00 2001
From: Hartmut Goebel <h.goebel@crazy-compilers.com>
Date: Tue, 21 Jan 2020 23:23:38 +0100
Subject: [PATCH] Fix missing link libraries.

See <https://phabricator.kde.org/D26821>

These are only actually missing if the libraries reside in different
prefixes, as it is the case in Guix or Nix.
---
 agents/archivemailagent/CMakeLists.txt      | 1 +
 agents/followupreminderagent/CMakeLists.txt | 1 +
 2 files changed, 2 insertions(+)

diff --git a/agents/archivemailagent/CMakeLists.txt b/agents/archivemailagent/CMakeLists.txt
index 95c6249de..d0ddcd475 100644
--- a/agents/archivemailagent/CMakeLists.txt
+++ b/agents/archivemailagent/CMakeLists.txt
@@ -22,6 +22,7 @@ ki18n_wrap_ui(libarchivemailagent_SRCS ui/archivemailwidget.ui )
 add_library(archivemailagent STATIC ${libarchivemailagent_SRCS})
 target_link_libraries(archivemailagent
     KF5::MailCommon
+    KF5::Libkdepim
     KF5::I18n
     KF5::Notifications
     KF5::KIOWidgets
diff --git a/agents/followupreminderagent/CMakeLists.txt b/agents/followupreminderagent/CMakeLists.txt
index 9ae7eaa29..527044807 100644
--- a/agents/followupreminderagent/CMakeLists.txt
+++ b/agents/followupreminderagent/CMakeLists.txt
@@ -27,6 +27,7 @@ target_link_libraries(followupreminderagent
     KF5::AkonadiMime
     KF5::AkonadiAgentBase
     KF5::DBusAddons
+    KF5::FollowupReminder
     KF5::XmlGui
     KF5::KIOWidgets
     KF5::Notifications
--
2.21.1


code:
This patch changes libkmod so it honors the 'LINUX_MODULE_DIRECTORY'
environment variable, rather than looking for modules exclusively in
/lib/modules.

Patch by Shea Levy and Eelco Dolstra, from Nixpkgs; adjusted to
use 'LINUX_MODULE_DIRECTORY' rather than 'MODULE_DIR' as the variable
name.

--- kmod-7/libkmod/libkmod.c	2012-03-15 08:19:16.750010226 -0400
+++ kmod-7/libkmod/libkmod.c	2012-04-04 15:21:29.532074313 -0400
@@ -200,7 +200,7 @@
 static char *get_kernel_release(const char *dirname)
 {
 	struct utsname u;
-	char *p;
+	char *p, *dirname_prefix;

 	if (dirname != NULL)
 		return path_make_absolute_cwd(dirname);
@@ -208,7 +208,10 @@
 	if (uname(&u) < 0)
 		return NULL;

-	if (asprintf(&p, "%s/%s", dirname_default_prefix, u.release) < 0)
+	if ((dirname_prefix = getenv("LINUX_MODULE_DIRECTORY")) == NULL)
+		dirname_prefix = dirname_default_prefix;
+
+	if (asprintf(&p, "%s/%s", dirname_prefix, u.release) < 0)
 		return NULL;

 	return p;

--- kmod-17/tools/static-nodes.c	2013-12-17 22:05:42.159047316 +0100
+++ kmod-17/tools/static-nodes.c	2014-04-17 13:51:17.945974320 +0200
@@ -159,6 +159,7 @@
 	FILE *in = NULL, *out = NULL;
 	const struct static_nodes_format *format = &static_nodes_format_human;
 	int r, ret = EXIT_SUCCESS;
+	char *dirname_prefix;

 	for (;;) {
 		int c, idx = 0, valid;
@@ -211,16 +212,19 @@
 		goto finish;
 	}

-	snprintf(modules, sizeof(modules), "/lib/modules/%s/modules.devname", kernel.release);
+	if ((dirname_prefix = getenv("LINUX_MODULE_DIRECTORY")) == NULL)
+		dirname_prefix = "/lib/modules";
+
+	snprintf(modules, sizeof(modules), "%s/%s/modules.devname", dirname_prefix, kernel.release);
 	in = fopen(modules, "re");
 	if (in == NULL) {
 		if (errno == ENOENT) {
-			fprintf(stderr, "Warning: /lib/modules/%s/modules.devname not found - ignoring\n",
-				kernel.release);
+			fprintf(stderr, "Warning: %s/%s/modules.devname not found - ignoring\n",
+				dirname_prefix, kernel.release);
 			ret = EXIT_SUCCESS;
 		} else {
-			fprintf(stderr, "Error: could not open /lib/modules/%s/modules.devname - %m\n",
-				kernel.release);
+			fprintf(stderr, "Error: could not open %s/%s/modules.devname - %m\n",
+				dirname_prefix, kernel.release);
 			ret = EXIT_FAILURE;
 		}
 		goto finish;


code:
Index: b/src/moz-sdk/prcpucfg.h
===================================================================
--- a/src/moz-sdk/prcpucfg.h
+++ b/src/moz-sdk/prcpucfg.h
@@ -288,6 +288,52 @@
 #define PR_BYTES_PER_WORD_LOG2  3
 #define PR_BYTES_PER_DWORD_LOG2 3

+#elif defined(__aarch64__)
+
+#define IS_LITTLE_ENDIAN 1
+#undef  IS_BIG_ENDIAN
+#define IS_64
+
+#define PR_BYTES_PER_BYTE   1
+#define PR_BYTES_PER_SHORT  2
+#define PR_BYTES_PER_INT    4
+#define PR_BYTES_PER_INT64  8
+#define PR_BYTES_PER_LONG   8
+#define PR_BYTES_PER_FLOAT  4
+#define PR_BYTES_PER_DOUBLE 8
+#define PR_BYTES_PER_WORD   8
+#define PR_BYTES_PER_DWORD  8
+
+#define PR_BITS_PER_BYTE    8
+#define PR_BITS_PER_SHORT   16
+#define PR_BITS_PER_INT     32
+#define PR_BITS_PER_INT64   64
+#define PR_BITS_PER_LONG    64
+#define PR_BITS_PER_FLOAT   32
+#define PR_BITS_PER_DOUBLE  64
+#define PR_BITS_PER_WORD    64
+
+#define PR_BITS_PER_BYTE_LOG2   3
+#define PR_BITS_PER_SHORT_LOG2  4
+#define PR_BITS_PER_INT_LOG2    5
+#define PR_BITS_PER_INT64_LOG2  6
+#define PR_BITS_PER_LONG_LOG2   6
+#define PR_BITS_PER_FLOAT_LOG2  5
+#define PR_BITS_PER_DOUBLE_LOG2 6
+#define PR_BITS_PER_WORD_LOG2   6
+
+#define PR_ALIGN_OF_SHORT   2
+#define PR_ALIGN_OF_INT     4
+#define PR_ALIGN_OF_LONG    8
+#define PR_ALIGN_OF_INT64   8
+#define PR_ALIGN_OF_FLOAT   4
+#define PR_ALIGN_OF_DOUBLE  8
+#define PR_ALIGN_OF_POINTER 8
+#define PR_ALIGN_OF_WORD    8
+
+#define PR_BYTES_PER_WORD_LOG2  3
+#define PR_BYTES_PER_DWORD_LOG2 3
+
 #elif defined(__mc68000__)

 #undef  IS_LITTLE_ENDIAN


code:
From 3def65075c09af4961cd399e8e78ed78cca72e65 Mon Sep 17 00:00:00 2001
From: Wolfgang Bauer <wbauer@tmo.at>
Date: Wed, 11 Oct 2017 22:16:02 +0200
Subject: [PATCH] Fix build with Qt 5.9

Summary:
moc 5.9 errors out when building:
Error: Plugin Metadata file "" could not be opened: file to open is a directory

Same issue and fix as https://phabricator.kde.org/D5392 for khtml.

CCBUG: 377490

Test Plan: builds fine now with Qt 5.9.0rc and also earlier versions.

Reviewers: vriezen, pino

Reviewed By: pino

Subscribers: pino

Differential Revision: https://phabricator.kde.org/D5985
---
 src/kmplayer_part.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/kmplayer_part.h b/src/kmplayer_part.h
index f90f85d..0fddbaa 100644
--- a/src/kmplayer_part.h
+++ b/src/kmplayer_part.h
@@ -36,7 +36,7 @@ namespace KMPlayer {

 class KMPlayerFactory : public KPluginFactory {
     Q_OBJECT
-    Q_PLUGIN_METADATA(IID "org.kde.KPluginFactory" FILE "")
+    Q_PLUGIN_METADATA(IID "org.kde.KPluginFactory")
     Q_INTERFACES(KPluginFactory)
 public:
     KMPlayerFactory();
--
2.14.2


code:
Make kmscon listen to a FIFO in /tmp that clients can write to
to request a keymap change.

Patch by Mathieu Othacehe <m.othacehe@gmail.com>.
Modified by Florian Pelz <pelzflorian@pelzflorian.de>
and Ludovic Courtès <ludo@gnu.org>.

diff --git a/src/pty.c b/src/pty.c
index 1443f4a..f64cb5b 100644
--- a/src/pty.c
+++ b/src/pty.c
@@ -46,6 +46,8 @@

 #define KMSCON_NREAD 16384

+#define INPUT_KEYMAP_UPDATE_FILE "/tmp/kmscon-%d-keymap-update"
+
 struct kmscon_pty {
 	unsigned long ref;
 	struct ev_eloop *eloop;
@@ -241,9 +243,22 @@ static bool pty_is_open(struct kmscon_pty *pty)
 	return pty->fd >= 0;
 }

+static int kmscon_keymap_update(pid_t pid)
+{
+	char *file;
+	int ret;
+
+	ret = asprintf(&file, INPUT_KEYMAP_UPDATE_FILE, pid);
+	if (ret < 0)
+		return ret;
+
+	return setenv("KEYMAP_UPDATE", file, 1);
+}
+
 static void __attribute__((noreturn))
 exec_child(const char *term, const char *colorterm, char **argv,
-	   const char *seat, const char *vtnr, bool env_reset)
+	   const char *seat, const char *vtnr, bool env_reset,
+	   pid_t kmscon_pid)
 {
 	char **env;
 	char **def_argv;
@@ -277,6 +292,8 @@ exec_child(const char *term, const char *colorterm, char **argv,
 	if (vtnr)
 		setenv("XDG_VTNR", vtnr, 1);

+	kmscon_keymap_update(kmscon_pid);
+
 	execve(argv[0], argv, environ);

 	log_err("failed to exec child %s: %m", argv[0]);
@@ -383,12 +400,14 @@ static int pty_spawn(struct kmscon_pty *pty, int master,
 			unsigned short width, unsigned short height)
 {
 	pid_t pid;
+	pid_t kmscon_pid;
 	struct winsize ws;

 	memset(&ws, 0, sizeof(ws));
 	ws.ws_col = width;
 	ws.ws_row = height;

+	kmscon_pid = getpid();
 	pid = fork();
 	switch (pid) {
 	case -1:
@@ -397,7 +416,7 @@ static int pty_spawn(struct kmscon_pty *pty, int master,
 	case 0:
 		setup_child(master, &ws);
 		exec_child(pty->term, pty->colorterm, pty->argv, pty->seat,
-			   pty->vtnr, pty->env_reset);
+			   pty->vtnr, pty->env_reset, kmscon_pid);
 		exit(EXIT_FAILURE);
 	default:
 		log_debug("forking child %d", pid);
diff --git a/src/uterm_input.c b/src/uterm_input.c
index 6fcbc4b..990a09d 100644
--- a/src/uterm_input.c
+++ b/src/uterm_input.c
@@ -178,6 +178,10 @@ static void input_new_dev(struct uterm_input *input,
 	if (ret)
 		goto err_rcodepoints;

+       /* Add the FIFO fd only to the first input poll loop. */
+       if (shl_dlist_empty(&input->devices))
+       	uxkb_dev_keymap_update(dev);
+
 	if (input->awake > 0) {
 		ret = input_wake_up_dev(dev);
 		if (ret)
diff --git a/src/uterm_input_internal.h b/src/uterm_input_internal.h
index 04e6cc9..ec44459 100644
--- a/src/uterm_input_internal.h
+++ b/src/uterm_input_internal.h
@@ -39,6 +39,8 @@
 #include "shl_misc.h"
 #include "uterm_input.h"

+#define INPUT_KEYMAP_UPDATE_FILE "/tmp/kmscon-%d-keymap-update"
+
 enum uterm_input_device_capability {
 	UTERM_DEVICE_HAS_KEYS = (1 << 0),
 	UTERM_DEVICE_HAS_LEDS = (1 << 1),
@@ -62,6 +64,8 @@ struct uterm_input_dev {

 	bool repeating;
 	struct ev_timer *repeat_timer;
+	struct ev_fd *fd_update;
+	int rupdate_fd;
 };

 struct uterm_input {
@@ -95,6 +99,7 @@ void uxkb_desc_destroy(struct uterm_input *input);

 int uxkb_dev_init(struct uterm_input_dev *dev);
 void uxkb_dev_destroy(struct uterm_input_dev *dev);
+int uxkb_dev_keymap_update(struct uterm_input_dev *dev);
 int uxkb_dev_process(struct uterm_input_dev *dev,
 		     uint16_t key_state,
 		     uint16_t code);
diff --git a/src/uterm_input_uxkb.c b/src/uterm_input_uxkb.c
index 925c755..8fe08f8 100644
--- a/src/uterm_input_uxkb.c
+++ b/src/uterm_input_uxkb.c
@@ -31,6 +31,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
 #include <xkbcommon/xkbcommon.h>
 #include "shl_hook.h"
 #include "shl_llog.h"
@@ -178,6 +181,106 @@ static void timer_event(struct ev_timer *timer, uint64_t num, void *data)
 	shl_hook_call(dev->input->hook, dev->input, &dev->repeat_event);
 }

+static void uxkb_keymap_update_handler(struct ev_fd *fd, int mask, void *data)
+{
+	struct uterm_input_dev *dev = data;
+	char in;
+	char keymap[4][255];
+	int pos = 0;
+	int curr_keymap = 0;
+	int ret;
+	char *model, *layout, *variant, *options;
+
+	if (!(mask & EV_READABLE))
+		return;
+
+	memset(keymap, 0, sizeof(keymap));
+
+	model = keymap[0];
+	layout = keymap[1];
+	variant = keymap[2];
+	options = keymap[3];
+
+	do {
+	  ret = read(dev->rupdate_fd, &in, sizeof(in));
+	  if (ret <= 0)
+	    break;
+
+	  keymap[curr_keymap][pos++] = in;
+
+	  if (in == '\0') {
+	    curr_keymap++;
+	    pos = 0;
+	  }
+	} while (1);
+
+	llog_info(dev->input, "HANDLER CALLED %s|%s|%s\n",
+		  model, layout, variant);
+
+	struct uterm_input *input = dev->input;
+	struct shl_dlist *iter;
+
+       /* Apply the new layout to all the inputs. */
+       shl_dlist_for_each(iter, &input->devices) {
+       	struct uterm_input_dev *dev;
+		dev = shl_dlist_entry(iter,
+					struct uterm_input_dev,
+					list);
+	        uxkb_desc_init(dev->input, model, layout, variant, options, NULL);
+               dev->state = xkb_state_new(dev->input->keymap);
+               if (!dev->state) {
+               	llog_error(dev->input, "cannot create XKB state");
+                      	return;
+                }
+       }
+
+	/* The client will now close the FIFO.  Close it too, and re-create a
+	 * FIFO so other clients can eventually connect.  */
+	ev_eloop_rm_fd(fd);
+	close(dev->rupdate_fd);
+	dev->rupdate_fd = -1;
+	uxkb_dev_keymap_update(dev);
+
+}
+
+int uxkb_dev_keymap_update(struct uterm_input_dev *dev)
+{
+	int ret;
+	char *file;
+	int pid = getpid();
+
+	ret = asprintf(&file, INPUT_KEYMAP_UPDATE_FILE, pid);
+	if (ret < 0)
+		return ret;
+
+	(void) unlink(file);
+	ret = mkfifo(file, S_IRWXU);
+	if (ret < 0) {
+		llog_warn(dev->input, "could not open fifo");
+		return -EFAULT;
+	}
+	dev->rupdate_fd = open(file, O_RDONLY | O_NONBLOCK);
+	if (dev->rupdate_fd < 0) {
+		llog_warn(dev->input, "cannot open file %s (%d): %m",
+			  file, errno);
+		return -EFAULT;
+	}
+
+	setenv("KEYMAP_UPDATE", file, 1);
+
+	ret = ev_eloop_new_fd(dev->input->eloop, &dev->fd_update,
+			      dev->rupdate_fd, EV_READABLE,
+			      uxkb_keymap_update_handler, dev);
+	if (ret) {
+		llog_error(dev->input, "could not init keymap update");
+		close(dev->rupdate_fd);
+		dev->rupdate_fd = -1;
+		return ret;
+	}
+
+	return 0;
+}
+
 int uxkb_dev_init(struct uterm_input_dev *dev)
 {
 	int ret;


code:
Description: Avoid compilation error with gcc-4.4.
 "const char* -> char*" conversion is fatal in that version
Origin: vendor, https://bugs.launchpad.net/ubuntu/+source/kobodeluxe/+bug/461373
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/kobodeluxe/+bug/461373
Bug-Debian: http://bugs.debian.org/552548
Forwarded: http://www.freelists.org/post/olofsonprojects/kobodlpatch-compile-error-in-windowcpp-with-g44
--- a/graphics/window.cpp
+++ b/graphics/window.cpp
@@ -398,7 +398,7 @@ void window_t::center_token_fxp(int _x,
 		 */
 		if(token)
 		{
-			char *tok = strchr(txt, token);
+			const char *tok = strchr(txt, token);
 			if(tok)
 				tokpos = tok-txt;
 			else


code:
# Authhor: Damyan Ivanov <dmn@debian.org>
# Description: rename pipe2 symbol to pipe2_kbdl to avoid clashes with the one
#              declared in system unistd.h
# Debian-Bug: 527705
# Upstream-Report: http://www.freelists.org/post/olofsonprojects/kobodeluxe-failing-to-build-in-Debian-enemiesh75-error-const-enemy-kind-pipe2-redeclared-as-different-kind-of-symbol
--- a/enemies.h
+++ b/enemies.h
@@ -72,7 +72,7 @@ extern const enemy_kind bombdeto;
 extern const enemy_kind cannon;
 extern const enemy_kind pipe1;
 extern const enemy_kind core;
-extern const enemy_kind pipe2;
+extern const enemy_kind pipe2_kbdl;
 extern const enemy_kind rock;
 extern const enemy_kind ring;
 extern const enemy_kind enemy_m1;
@@ -430,7 +430,7 @@ inline int _enemy::realize()

 inline int _enemy::is_pipe()
 {
-	return ((_state != notuse) && ((ek == &pipe1) || (ek == &pipe2)));
+	return ((_state != notuse) && ((ek == &pipe1) || (ek == &pipe2_kbdl)));
 }

--- a/enemy.cpp
+++ b/enemy.cpp
@@ -755,10 +755,10 @@ void _enemy::move_core()

 void _enemy::kill_core()
 {
-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
+	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
+	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
+	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
+	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
 	enemies.make(&explosion4, CS2PIXEL(x), CS2PIXEL(y));
 	sound.g_base_core_explo(x, y);
 	release();
@@ -978,19 +978,19 @@ void _enemy::move_pipe2()
 	}
 	p ^= a;
 	if(p & U_MASK)
-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
+		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
 	if(p & R_MASK)
-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
+		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
 	if(p & D_MASK)
-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
+		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
 	if(p & L_MASK)
-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
+		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
 	manage.add_score(10);
 	release();
 }

-const enemy_kind pipe2 = {
+const enemy_kind pipe2_kbdl = {
 	0,
 	&_enemy::make_pipe2,
 	&_enemy::move_pipe2,


code:
# This was created in responce to Debian bug #163979
# Thing is, if you want to compant "-1" with a char value,
# you better make that char signed
--- kobodeluxe-0.5.1.orig/graphics/window.cpp
+++ kobodeluxe-0.5.1/graphics/window.cpp
@@ -331,7 +331,7 @@
 }

-void window_t::center_token(int _x, int _y, const char *txt, char token)
+void window_t::center_token(int _x, int _y, const char *txt, signed char token)
 {
 	center_token_fxp(PIXEL2CS(_x), PIXEL2CS(_y), txt, token);
 }
@@ -374,7 +374,7 @@
 }

-void window_t::center_token_fxp(int _x, int _y, const char *txt, char token)
+void window_t::center_token_fxp(int _x, int _y, const char *txt, signed char token)
 {
 	_x = CS2PIXEL((_x * xs + 128) >> 8);
 	_y = CS2PIXEL((_y * ys + 128) >> 8);
--- kobodeluxe-0.5.1.orig/graphics/window.h
+++ kobodeluxe-0.5.1/graphics/window.h
@@ -265,10 +265,10 @@
 	void font(int fnt);
 	void string(int _x, int _y, const char *txt);
 	void center(int _y, const char *txt);
-	void center_token(int _x, int _y, const char *txt, char token = 0);
+	void center_token(int _x, int _y, const char *txt, signed char token = 0);
 	void string_fxp(int _x, int _y, const char *txt);
 	void center_fxp(int _y, const char *txt);
-	void center_token_fxp(int _x, int _y, const char *txt, char token = 0);
+	void center_token_fxp(int _x, int _y, const char *txt, signed char token = 0);
 	int textwidth(const char *txt, int min = 0, int max = 255);
 	int textwidth_fxp(const char *txt, int min = 0, int max = 255);
 	int fontheight();


code:
# Author: Damyan Ivanov <dmn@debian.org>
# Description: convert a hyphen in kobodl manpage to a minus, which is what is
#              inttented here
# Upstream-Report: http://www.freelists.org/post/olofsonprojects/patch-manpage-uses-hyphen-instead-of-a-minus-sign
--- a/kobodl.6
+++ b/kobodl.6
@@ -176,7 +176,7 @@ Video Mode. Default: 17200.
 Enable Vertical Sync. Default: On.
 .TP
 .B \-videopages
-Number of Video Pages. Default: -1.
+Number of Video Pages. Default: \-1.
 .TP
 .B \-scalemode
 Scaling Filter Mode. Default: 1.


code:
From: Emile CARRY <emile.carry@sequanux.org>
Date: Wed, 6 Apr 2016 00:27:17 +0200
Subject: midicon segmentation fault

Debian-Bug: https://bugs.debian.org/819897
Forwarded: no
---
 sound/a_midicon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/a_midicon.c b/sound/a_midicon.c
index 57de3cf..ded2988 100644
--- a/sound/a_midicon.c
+++ b/sound/a_midicon.c
@@ -120,8 +120,8 @@ static inline void __press(unsigned ch, unsigned key)
 {
 	m[ch].next[key] = -1;
 	m[ch].prev[key] = m[ch].last;
-	m[ch].next[m[ch].last] = (char)key;
 	m[ch].last = (char)key;
+	m[ch].next[m[ch].last] = (char)key;
 }


code:
# Patch snarfed from
# http://http.debian.net/debian/pool/main/k/kobodeluxe/kobodeluxe_0.5.1-8.debian.tar.xz
#
# Disable reading of configs, graphics, and data from the current directory.
# So it's safe to run kobodeluxe from anywhere w/o worry about an attacker
# feeding it bad data.
--- kobodeluxe-0.5.1.orig/kobo.cpp
+++ kobodeluxe-0.5.1/kobo.cpp
@@ -141,21 +141,21 @@
 	 * Graphics data
 	 */
 	/* Current dir; from within the build tree */
-	fmap->addpath("GFX", "./data/gfx");
+	//fmap->addpath("GFX", "./data/gfx");
 	/* Real data dir */
 	fmap->addpath("GFX", "DATA>>gfx");
 	/* Current dir */
-	fmap->addpath("GFX", "./gfx");
+	//fmap->addpath("GFX", "./gfx");

 	/*
 	 * Sound data
 	 */
 	/* Current dir; from within the build tree */
-	fmap->addpath("SFX", "./data/sfx");
+	//fmap->addpath("SFX", "./data/sfx");
 	/* Real data dir */
 	fmap->addpath("SFX", "DATA>>sfx");
 	/* Current dir */
-	fmap->addpath("SFX", "./sfx");
+	//fmap->addpath("SFX", "./sfx");

 	/*
 	 * Score files (user and global)
@@ -173,7 +173,7 @@
 	/* System local */
 	fmap->addpath("CONFIG", SYSCONF_DIR);
 	/* In current dir (last resort) */
-	fmap->addpath("CONFIG", "./");
+	//fmap->addpath("CONFIG", "./");
 }


code:
Increase thread timeout to reduce flakiness.

Taken from upstream:
https://github.com/xbmc/xbmc/commit/574b0182d8b641fd24029f372ebdcccc897123e2

diff --git a/xbmc/threads/test/TestEvent.cpp b/xbmc/threads/test/TestEvent.cpp
index 42fb8c2fc609..40e644c0ed3c 100644
--- a/xbmc/threads/test/TestEvent.cpp
+++ b/xbmc/threads/test/TestEvent.cpp
@@ -484,7 +484,7 @@ TEST(TestEvent, GroupTimedWait)
   EXPECT_TRUE(w3.result == NULL);

   // this should end given the wait is for only 50 millis
-  EXPECT_TRUE(waitThread3.timed_join(MILLIS(100)));
+  EXPECT_TRUE(waitThread3.timed_join(MILLIS(200)));

   EXPECT_TRUE(!w3.waiting);
   EXPECT_TRUE(w3.result == NULL);


code:
Kodi doesn't set the CAPATH and CAINFO parameters for libcurl. To make HTTPS
connections work we can set them based on SSL_CERT_DIR and SSL_CERT_FILE.

--- a/xbmc/filesystem/CurlFile.cpp
+++ b/xbmc/filesystem/CurlFile.cpp
@@ -626,5 +626,9 @@
   if (!m_cipherlist.empty())
     g_curlInterface.easy_setopt(h, CURLOPT_SSL_CIPHER_LIST, m_cipherlist.c_str());

+  // Load certificate data from environment paths
+  g_curlInterface.easy_setopt(m_state->m_easyHandle, CURLOPT_CAPATH, getenv("SSL_CERT_DIR"));
+  g_curlInterface.easy_setopt(m_state->m_easyHandle, CURLOPT_CAINFO, getenv("SSL_CERT_FILE"));
+
   // enable HTTP2 support. default: CURL_HTTP_VERSION_1_1. Curl >= 7.62.0 defaults to CURL_HTTP_VERSION_2TLS
   g_curlInterface.easy_setopt(h, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
-
 }


code:
This test fails regularly between 18.0rc3 and 18.0rc5.2

449/520 Test #449: TestWebServer.CanHeadFile................................................***Failed    0.90 sec
Note: Google Test filter = TestWebServer.CanHeadFile
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from TestWebServer
[ RUN      ] TestWebServer.CanHeadFile
/tmp/guix-build-kodi-18.0rc5.2.drv-0/kodi-18.0rc5.2-checkout/xbmc/network/test/TestWebServer.cpp:156: Failure
      Expected: "4"
To be equal to: httpHeader.GetValue("Content-Length").c_str()
      Which is: "0"
[  FAILED  ] TestWebServer.CanHeadFile (6 ms)
[----------] 1 test from TestWebServer (6 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (635 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] TestWebServer.CanHeadFile

---
 xbmc/network/test/TestWebServer.cpp | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/xbmc/network/test/TestWebServer.cpp b/xbmc/network/test/TestWebServer.cpp
index a87d9f4..b2240f4 100644
--- a/xbmc/network/test/TestWebServer.cpp
+++ b/xbmc/network/test/TestWebServer.cpp
@@ -520,13 +520,13 @@ TEST_F(TestWebServer, CanNotHeadNonExistingFile)
   ASSERT_FALSE(curl.Exists(CURL(GetUrlOfTestFile("file_does_not_exist"))));
 }

-TEST_F(TestWebServer, CanHeadFile)
-{
-  CCurlFile curl;
-  ASSERT_TRUE(curl.Exists(CURL(GetUrlOfTestFile(TEST_FILES_HTML))));
-
-  CheckHtmlTestFileResponse(curl);
-}
+//TEST_F(TestWebServer, CanHeadFile)
+//{
+//  CCurlFile curl;
+//  ASSERT_TRUE(curl.Exists(CURL(GetUrlOfTestFile(TEST_FILES_HTML))));
+//
+//  CheckHtmlTestFileResponse(curl);
+//}

 TEST_F(TestWebServer, CanNotGetNonExistingFile)
 {
--
2.20.1


code:
diff --git a/src/kpackage/package.cpp b/src/kpackage/package.cpp
index 5aec9fd..b15c933 100644
--- a/src/kpackage/package.cpp
+++ b/src/kpackage/package.cpp
@@ -820,7 +820,7 @@ PackagePrivate::PackagePrivate()
     : QSharedData(),
       fallbackPackage(nullptr),
       metadata(nullptr),
-      externalPaths(false),
+      externalPaths(true),
       valid(false),
       checkedValid(false)
 {


code:
From 668010ebc9fd84d9dc60f90b9a4ebf3c7054977f Mon Sep 17 00:00:00 2001
From: Hartmut Goebel <h.goebel@crazy-compilers.com>
Date: Sun, 25 Oct 2020 20:11:13 +0000
Subject: [PATCH] Fix build errors if PREFIX is different from ECM's PREFIX.

See <https://bugs.kde.org/424483> for details.
---
 KF5PackageMacros.cmake | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/KF5PackageMacros.cmake b/KF5PackageMacros.cmake
index f4c1d1d..acd3798 100644
--- a/KF5PackageMacros.cmake
+++ b/KF5PackageMacros.cmake
@@ -1,6 +1,5 @@

-find_package(ECM 1.6.0 CONFIG REQUIRED)
-include(${ECM_KDE_MODULE_DIR}/KDEInstallDirs.cmake)
+include(KDEInstallDirs)

 set(KPACKAGE_RELATIVE_DATA_INSTALL_DIR "kpackage")

--
GitLab


code:
From e9896b8951f9faf1f76a3b45be6e70d0aeb30a73 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Sat, 15 Nov 2014 17:48:18 +0100
Subject: [PATCH] Add make install.

---
 Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Makefile b/Makefile
index ca18c1e..65af31b 100644
--- a/Makefile	2016-02-09 21:34:01.883660009 +0100
+++ b/Makefile	2016-02-09 21:34:30.672150679 +0100
@@ -19,3 +19,11 @@
 	@git archive --prefix="$(PROJECT_ARCHIVE)/" HEAD \
 		 | gzip >_dist/"$(PROJECT_ARCHIVE)".tar.gz
 	@echo archive stored in "_dist/$(PROJECT_ARCHIVE).tar.gz"
+
+PREFIX=/usr/local
+install:
+	strip laby
+	mkdir -p $(PREFIX)/bin
+	cp laby $(PREFIX)/bin/laby
+	mkdir -p $(PREFIX)/share/laby
+	tar -C data -cf - . | tar -C $(PREFIX)/share/laby -xf-


code:
Patch taken from the Sage packaging system.

diff -Naur lcalc-1.23-vanilla/include/Ldirichlet_series.h lcalc-1.23-fixed-gcc.4.9/include/Ldirichlet_series.h
--- lcalc-1.23-vanilla/include/Ldirichlet_series.h	2012-08-08 23:21:55.000000000 +0200
+++ lcalc-1.23-fixed-gcc.4.9/include/Ldirichlet_series.h	2014-04-21 14:37:59.027464849 +0200
@@ -43,7 +43,7 @@
  //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 template <class ttype>
 Complex L_function <ttype>::
-dirichlet_series(Complex s, long long N=-1)
+dirichlet_series(Complex s, long long N)
 {
     Complex z=0.;
     long long m,n;
diff -Naur lcalc-1.23-vanilla/include/L.h lcalc-1.23-fixed-gcc.4.9/include/L.h
--- lcalc-1.23-vanilla/include/L.h	2012-08-08 23:21:55.000000000 +0200
+++ lcalc-1.23-fixed-gcc.4.9/include/L.h	2014-04-21 14:32:04.003467348 +0200
@@ -491,7 +491,7 @@

     //#include "Ldirichlet_series.h" //for computing Dirichlet series
     Complex partial_dirichlet_series(Complex s, long long N1, long long N2);
-    Complex dirichlet_series(Complex s, long long N);
+    Complex dirichlet_series(Complex s, long long N=-1LL);

     //#include "Ltaylor_series.h" //for computing taylor series for Dirichlet series
     //void compute_taylor_series(int N, int K, Complex s_0, Complex *series);


code:
Patch taken from the Sage packaging system.

--- lcalc-1.23/include/Lgamma.h	2012-08-08 23:21:55.000000000 +0200
+++ lcalc-1.23/include/Lgamma.h	2014-05-18 21:15:27.786889718 +0200
@@ -77,7 +77,7 @@
 //n=0 should just give log_GAMMA(z)... thus making log_GAMMA
 //code obsolete. But leave log_GAMMA intact anyways.
 template <class ttype>
-precise(ttype) log_GAMMA (ttype z,int n=0)
+precise(ttype) log_GAMMA (ttype z,int n)
 {
     int M;
     precise(ttype) log_G,r,r2,y;
@@ -230,7 +230,7 @@
 //value exp_w which holds exp(-w)
 //computes G(z,w), so there's an extra w^(-z) factor.
 template <class ttype>
-Complex inc_GAMMA (ttype z,ttype w, const char *method="temme", ttype exp_w = 0, bool recycle=false)
+Complex inc_GAMMA (ttype z,ttype w, const char *method, ttype exp_w, bool recycle)
 {

     Complex G;
@@ -334,7 +334,7 @@

 template <class ttype>
-ttype cfrac_GAMMA (ttype z,ttype w, ttype exp_w=0, bool recycle=false)  //computes G(z,w) via continued fraction
+ttype cfrac_GAMMA (ttype z,ttype w, ttype exp_w, bool recycle)  //computes G(z,w) via continued fraction
 {

         ttype G;
@@ -424,7 +424,7 @@
 }

 template <class ttype>
-ttype asympt_GAMMA (ttype z,ttype w, ttype exp_w = 0, bool recycle=false)  //computes G(z,w) via asymptotic series
+ttype asympt_GAMMA (ttype z,ttype w, ttype exp_w, bool recycle)  //computes G(z,w) via asymptotic series
 {

         if(my_verbose>3) cout << "called asympt_GAMMA("<<z<<","<<w<<")"<< endl;
@@ -446,7 +446,7 @@

 template <class ttype>
-ttype comp_inc_GAMMA (ttype z,ttype w,ttype exp_w = 0, bool recycle=false)  //computes g(z,w)
+ttype comp_inc_GAMMA (ttype z,ttype w,ttype exp_w, bool recycle)  //computes g(z,w)
 {

     ttype g;
@@ -604,7 +604,7 @@
 }

 template <class ttype>
-Complex gamma_sum(Complex s, int what_type, ttype *coeff, int N, Double g, Complex l, Double Q, Long Period, Complex delta=1, const char *method="temme")
+Complex gamma_sum(Complex s, int what_type, ttype *coeff, int N, Double g, Complex l, Double Q, Long Period, Complex delta, const char *method)
 {
     Complex SUM=0;


code:
Patch taken from the Sage packaging system.

--- src/include/Lcommon.h	2010-01-31 15:16:45.000000000 +0000
+++ src/include/Lcommon.h	2011-03-08 21:19:11.849443238 +0000
@@ -25,7 +25,7 @@
 #ifdef USE_MPFR
 inline double lcalc_to_double(const double& x) { return x; }
 #endif
-//inline double lcalc_to_double(const long double& x) { return x; }
+inline double lcalc_to_double(const long double& x) { return x; }
 inline double lcalc_to_double(const int& x) { return x; }
 inline double lcalc_to_double(const long long& x) { return x; }
 inline double lcalc_to_double(const short& x) { return x; }


code:
Patch taken from the Sage packaging system.

diff --git a/include/Lcommon.h b/include/Lcommon.h
index 1b3be43..bf40532 100644
--- a/include/Lcommon.h
+++ b/include/Lcommon.h
@@ -48,7 +48,7 @@ const bool outputSeries=true;	  // Whether to output the coefficients or just th

 // Loop i from m to n
 // Useful in tidying up most for loops
-#define loop(i,m,n) for(typeof(m) i=(m); i!=(n); i++)
+#define loop(i,m,n) for(auto i=(m); i!=(n); i++)

 // A class for calculations involving polynomials of small degree
 // Not efficient enough for huge polynomials
diff --git a/include/Lcommon_ld.h b/include/Lcommon_ld.h
index 86ae4df..33c560c 100644
--- a/include/Lcommon_ld.h
+++ b/include/Lcommon_ld.h
@@ -53,7 +53,7 @@ const bool outputSeries=true;	  // Whether to output the coefficients or just th

 // Loop i from m to n
 // Useful in tidying up most for loops
-#define loop(i,m,n) for(typeof(m) i=(m); i!=(n); i++)
+#define loop(i,m,n) for(auto i=(m); i!=(n); i++)

 // A class for calculations involving polynomials of small degree
 // Not efficient enough for huge polynomials
diff --git a/include/Lglobals.h b/include/Lglobals.h
index 60002e4..ca2606c 100644
--- a/include/Lglobals.h
+++ b/include/Lglobals.h
@@ -24,9 +24,9 @@
 #ifndef Lglobals_H
 #define Lglobals_H

+#include <valarray>
 using namespace std;

-#include <valarray>
 #ifdef USE_MPFR
     #include "Lgmpfrxx.h"
     typedef mpfr_class Double;