summaryrefslogtreecommitdiff
path: root/pkgs/lwjgl/patches/3.3.4
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/lwjgl/patches/3.3.4')
-rw-r--r--pkgs/lwjgl/patches/3.3.4/0001-build-use-pkg-config-for-linux-dependencies.patch81
-rw-r--r--pkgs/lwjgl/patches/3.3.4/0002-build-allow-local-kotlin.patch50
-rw-r--r--pkgs/lwjgl/patches/3.3.4/0003-build-allow-linking-against-system-libffi.patch38
-rw-r--r--pkgs/lwjgl/patches/3.3.4/0004-build-add-dbus-as-dependency-for-nfd_portal.patch50
-rw-r--r--pkgs/lwjgl/patches/3.3.4/0005-build-allow-setting-pkg-config-prefix-suffix.patch64
5 files changed, 283 insertions, 0 deletions
diff --git a/pkgs/lwjgl/patches/3.3.4/0001-build-use-pkg-config-for-linux-dependencies.patch b/pkgs/lwjgl/patches/3.3.4/0001-build-use-pkg-config-for-linux-dependencies.patch
new file mode 100644
index 0000000..092cf1d
--- /dev/null
+++ b/pkgs/lwjgl/patches/3.3.4/0001-build-use-pkg-config-for-linux-dependencies.patch
@@ -0,0 +1,81 @@
+From 44e2d7fdaf32809e9b50d63834fc834dccb7752d Mon Sep 17 00:00:00 2001
+From: Seth Flynn <[email protected]>
+Date: Wed, 5 Mar 2025 16:20:59 -0500
+Subject: [PATCH 1/5] build: use pkg-config for linux dependencies
+
+Adapted from https://cgit.freebsd.org/ports/commit/?id=680dc7bb031d0f708c2dd38f055ec8d63ee68b8a
+---
+ config/linux/build.xml | 37 ++++++++++++++++++++++---------------
+ 1 file changed, 22 insertions(+), 15 deletions(-)
+
+diff --git a/config/linux/build.xml b/config/linux/build.xml
+index a1798b6aa..11e4743ab 100644
+--- a/config/linux/build.xml
++++ b/config/linux/build.xml
+@@ -281,16 +281,17 @@
+ <!-- NativeFileDialog -->
+ <build module="nfd" simple="true" linker="g++" if:true="${binding.nfd}">
+ <beforeCompile>
++ <local name="gtk3-cflags"/>
++ <local name="gtk3-libflags"/>
++ <local name="stderr"/>
++ <exec outputproperty="gtk3-cflags" errorproperty="stderr" executable="pkg-config" failonerror="true" taskname="gtk-3.0-cflags">
++ <arg line="--cflags gtk+-3.0"/>
++ </exec>
++ <exec outputproperty="gtk3-libflags" errorproperty="stderr" executable="pkg-config" failonerror="true" taskname="gtk-3.0-libflags">
++ <arg line="--libs gtk+-3.0"/>
++ </exec>
+ <compile lang="c++">
+- <arg value="-I/usr/include/gtk-3.0"/>
+- <arg value="-I/usr/include/glib-2.0"/>
+- <arg value="-I/usr/include/pango-1.0"/>
+- <arg value="-I/usr/include/harfbuzz"/>
+- <arg value="-I/usr/include/cairo"/>
+- <arg value="-I/usr/include/gdk-pixbuf-2.0"/>
+- <arg value="-I/usr/include/atk-1.0"/>
+- <arg value="-I/usr/lib64/glib-2.0/include"/>
+- <arg value="-I/usr/lib/${linux.triplet}/glib-2.0/include"/>
++ <arg line="${gtk3-cflags}"/>
+ <arg value="-I${src.main.rel}/include"/>
+ <fileset dir="." includes="${src.main}/nfd_gtk.cpp"/>
+ </compile>
+@@ -299,16 +300,22 @@
+ <arg value="-I${src.main.rel}/include"/>
+ </source>
+ <link>
+- <arg value="-lglib-2.0"/>
+- <arg value="-lgobject-2.0"/>
+- <arg value="-lgtk-3"/>
+- <arg value="-lgdk-3"/>
++ <arg line="${gtk3-libflags}"/>
+ </link>
+ </build>
+ <build module="nfd" suffix="_portal" simple="true" linker="g++" if:true="${binding.nfd}">
+ <beforeCompile>
++ <local name="glib-cflags"/>
++ <local name="glib-libflags"/>
++ <local name="stderr"/>
++ <exec outputproperty="glib-cflags" errorproperty="stderr" executable="pkg-config" failonerror="true" taskname="glib-cflags">
++ <arg line="--cflags glib-2.0"/>
++ </exec>
++ <exec outputproperty="glib-libflags" errorproperty="stderr" executable="pkg-config" failonerror="true" taskname="glib-libflags">
++ <arg line="--libs glib-2.0"/>
++ </exec>
+ <compile lang="c++">
+- <arg line="-I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/lib/${linux.triplet}/dbus-1.0/include"/>
++ <arg line="${glib-cflags}"/>
+ <arg value="-I${src.main.rel}/include"/>
+ <fileset dir="." includes="${src.main}/nfd_portal.cpp"/>
+ </compile>
+@@ -317,7 +324,7 @@
+ <arg value="-I${src.main.rel}/include"/>
+ </source>
+ <link>
+- <arg value="-ldbus-1"/>
++ <arg line="${glib-libflags}"/>
+ </link>
+ </build>
+
+--
+2.48.1
+
diff --git a/pkgs/lwjgl/patches/3.3.4/0002-build-allow-local-kotlin.patch b/pkgs/lwjgl/patches/3.3.4/0002-build-allow-local-kotlin.patch
new file mode 100644
index 0000000..3d230ce
--- /dev/null
+++ b/pkgs/lwjgl/patches/3.3.4/0002-build-allow-local-kotlin.patch
@@ -0,0 +1,50 @@
+From 36e6e8bb83e94c92f29ef94c59fc3119b8ba425d Mon Sep 17 00:00:00 2001
+From: Seth Flynn <[email protected]>
+Date: Wed, 5 Mar 2025 16:34:50 -0500
+Subject: [PATCH 2/5] build: allow local kotlin
+
+Adapted from https://cgit.freebsd.org/ports/commit/?id=680dc7bb031d0f708c2dd38f055ec8d63ee68b8a
+---
+ config/build-definitions.xml | 3 ++-
+ update-dependencies.xml | 4 ++--
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/config/build-definitions.xml b/config/build-definitions.xml
+index fdba3a476..7a3cace54 100644
+--- a/config/build-definitions.xml
++++ b/config/build-definitions.xml
+@@ -100,7 +100,8 @@ This script is included in /build.xml and /config/update-dependencies.xml.
+
+ <property name="lib" location="bin/libs" relative="true"/>
+
+- <property name="kotlinc" location="${lib}/kotlinc" relative="true"/>
++ <property name="kotlinc" location="${lib}/kotlinc" relative="true" unless:set="local.kotlin" />
++ <property name="kotlinc" location="${local.kotlin}" relative="false" if:set="local.kotlin"/>
+
+ <property name="module.lwjgl" location="modules/lwjgl" relative="true"/>
+
+diff --git a/update-dependencies.xml b/update-dependencies.xml
+index 87b110045..10a9da19d 100644
+--- a/update-dependencies.xml
++++ b/update-dependencies.xml
+@@ -27,7 +27,7 @@
+ <target name="check-dependencies" description="Updates LWJGL dependencies, if required" unless="${build.offline}">
+ <!-- Checks if the Kotlin compiler must be updated -->
+ <local name="kotlinc-build-current"/>
+- <loadfile property="kotlinc-build-current" srcfile="${kotlinc}/build.txt" quiet="true" taskname="kotlinc"/>
++ <loadfile property="kotlinc-build-current" srcfile="${kotlinc}/build.txt" quiet="true" taskname="kotlinc" unless:set="local.kotlin" />
+ <condition property="kotlinc-uptodate">
+ <and>
+ <isset property="kotlinc-build-current"/>
+@@ -54,7 +54,7 @@
+ <mkdir dir="${lib}"/>
+ <mkdir dir="${lib}/java"/>
+ <antcall target="-lib-download"/>
+- <antcall target="-kotlinc-download"/>
++ <antcall target="-kotlinc-download" unless:set="local.kotlin" />
+ </target>
+
+ <!-- Downloads and extracts the Kotlin compiler. -->
+--
+2.48.1
+
diff --git a/pkgs/lwjgl/patches/3.3.4/0003-build-allow-linking-against-system-libffi.patch b/pkgs/lwjgl/patches/3.3.4/0003-build-allow-linking-against-system-libffi.patch
new file mode 100644
index 0000000..2271e5f
--- /dev/null
+++ b/pkgs/lwjgl/patches/3.3.4/0003-build-allow-linking-against-system-libffi.patch
@@ -0,0 +1,38 @@
+From ff06851e13461c0b9e2f258caf6a2ead16bad700 Mon Sep 17 00:00:00 2001
+From: Seth Flynn <[email protected]>
+Date: Wed, 5 Mar 2025 16:43:57 -0500
+Subject: [PATCH 3/5] build: allow linking against system libffi
+
+Adapted from https://cgit.freebsd.org/ports/commit/?id=680dc7bb031d0f708c2dd38f055ec8d63ee68b8a
+---
+ config/linux/build.xml | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/config/linux/build.xml b/config/linux/build.xml
+index 11e4743ab..4500d23c0 100644
+--- a/config/linux/build.xml
++++ b/config/linux/build.xml
+@@ -194,16 +194,18 @@
+ <include name="${module.lwjgl}/jawt/src/generated/c/*.c" if:true="${binding.jawt}"/>
+ </fileset>
+ </source>
+- <beforeLink>
++ <beforeLink unless:true="${use.libffi.so}">
+ <parallel threadsPerProcessor="2" failonany="true" unless:set="lib-dependencies-uptodate">
+ <update-dependency module="core" artifact="core/libffi.a"/>
+ </parallel>
+ </beforeLink>
+ <link>
+- <fileset dir="${lib.native}/org/lwjgl">
++ <fileset dir="${lib.native}/org/lwjgl" unless:true="${use.libffi.so}">
+ <include name="libffi.a"/>
+ </fileset>
+ <arg value="-ldl"/>
++ <arg value="-lffi" if:true="${use.libffi.so}"/>
++ <arg value="-L${libffi.path}" if:set="libffi.path"/>
+ </link>
+ </build>
+
+--
+2.48.1
+
diff --git a/pkgs/lwjgl/patches/3.3.4/0004-build-add-dbus-as-dependency-for-nfd_portal.patch b/pkgs/lwjgl/patches/3.3.4/0004-build-add-dbus-as-dependency-for-nfd_portal.patch
new file mode 100644
index 0000000..77a673a
--- /dev/null
+++ b/pkgs/lwjgl/patches/3.3.4/0004-build-add-dbus-as-dependency-for-nfd_portal.patch
@@ -0,0 +1,50 @@
+From 258c919591e2aa16fded26c637c8130a27c9feab Mon Sep 17 00:00:00 2001
+From: Seth Flynn <[email protected]>
+Date: Wed, 5 Mar 2025 17:10:20 -0500
+Subject: [PATCH 4/5] build: add dbus as dependency for nfd_portal
+
+---
+ config/linux/build.xml | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/config/linux/build.xml b/config/linux/build.xml
+index 4500d23c0..829ce2b1d 100644
+--- a/config/linux/build.xml
++++ b/config/linux/build.xml
+@@ -307,9 +307,17 @@
+ </build>
+ <build module="nfd" suffix="_portal" simple="true" linker="g++" if:true="${binding.nfd}">
+ <beforeCompile>
++ <local name="dbus-cflags"/>
++ <local name="dbus-libflags"/>
+ <local name="glib-cflags"/>
+ <local name="glib-libflags"/>
+ <local name="stderr"/>
++ <exec outputproperty="dbus-cflags" errorproperty="stderr" executable="pkg-config" failonerror="true" taskname="dbus-cflags">
++ <arg line="--cflags dbus-1"/>
++ </exec>
++ <exec outputproperty="dbus-libflags" errorproperty="stderr" executable="pkg-config" failonerror="true" taskname="dbus-libflags">
++ <arg line="--libs dbus-1"/>
++ </exec>
+ <exec outputproperty="glib-cflags" errorproperty="stderr" executable="pkg-config" failonerror="true" taskname="glib-cflags">
+ <arg line="--cflags glib-2.0"/>
+ </exec>
+@@ -317,6 +325,7 @@
+ <arg line="--libs glib-2.0"/>
+ </exec>
+ <compile lang="c++">
++ <arg line="${dbus-cflags}"/>
+ <arg line="${glib-cflags}"/>
+ <arg value="-I${src.main.rel}/include"/>
+ <fileset dir="." includes="${src.main}/nfd_portal.cpp"/>
+@@ -326,6 +335,7 @@
+ <arg value="-I${src.main.rel}/include"/>
+ </source>
+ <link>
++ <arg line="${dbus-libflags}"/>
+ <arg line="${glib-libflags}"/>
+ </link>
+ </build>
+--
+2.48.1
+
diff --git a/pkgs/lwjgl/patches/3.3.4/0005-build-allow-setting-pkg-config-prefix-suffix.patch b/pkgs/lwjgl/patches/3.3.4/0005-build-allow-setting-pkg-config-prefix-suffix.patch
new file mode 100644
index 0000000..2ef60d8
--- /dev/null
+++ b/pkgs/lwjgl/patches/3.3.4/0005-build-allow-setting-pkg-config-prefix-suffix.patch
@@ -0,0 +1,64 @@
+From 508b031f7edf480f6a8966c8779e395658d206c5 Mon Sep 17 00:00:00 2001
+From: Seth Flynn <[email protected]>
+Date: Thu, 6 Mar 2025 02:31:35 -0500
+Subject: [PATCH 5/5] build: allow setting pkg-config prefix & suffix
+
+---
+ config/linux/build.xml | 19 +++++++++++++------
+ 1 file changed, 13 insertions(+), 6 deletions(-)
+
+diff --git a/config/linux/build.xml b/config/linux/build.xml
+index 829ce2b1d..0c0700fb9 100644
+--- a/config/linux/build.xml
++++ b/config/linux/build.xml
+@@ -18,6 +18,13 @@
+ <isset property="gcc.version"/>
+ </condition>
+
++ <condition property="pkg-config.prefix" value="" else="${linux.triplet}-">
++ <isset property="build.arch.x64|x86"/>
++ </condition>
++ <condition property="pkg-config.suffix" value="-${pkg-config.version}" else="">
++ <isset property="pkg-config.version"/>
++ </condition>
++
+ <property name="module.lwjgl.rel" value="../../../../${module.lwjgl}"/>
+
+ <macrodef name="compile">
+@@ -286,10 +293,10 @@
+ <local name="gtk3-cflags"/>
+ <local name="gtk3-libflags"/>
+ <local name="stderr"/>
+- <exec outputproperty="gtk3-cflags" errorproperty="stderr" executable="pkg-config" failonerror="true" taskname="gtk-3.0-cflags">
++ <exec outputproperty="gtk3-cflags" errorproperty="stderr" executable="${pkg-config.prefix}pkg-config${pkg-config.suffix}" failonerror="true" taskname="gtk-3.0-cflags">
+ <arg line="--cflags gtk+-3.0"/>
+ </exec>
+- <exec outputproperty="gtk3-libflags" errorproperty="stderr" executable="pkg-config" failonerror="true" taskname="gtk-3.0-libflags">
++ <exec outputproperty="gtk3-libflags" errorproperty="stderr" executable="${pkg-config.prefix}pkg-config${pkg-config.suffix}" failonerror="true" taskname="gtk-3.0-libflags">
+ <arg line="--libs gtk+-3.0"/>
+ </exec>
+ <compile lang="c++">
+@@ -312,16 +319,16 @@
+ <local name="glib-cflags"/>
+ <local name="glib-libflags"/>
+ <local name="stderr"/>
+- <exec outputproperty="dbus-cflags" errorproperty="stderr" executable="pkg-config" failonerror="true" taskname="dbus-cflags">
++ <exec outputproperty="dbus-cflags" errorproperty="stderr" executable="${pkg-config.prefix}pkg-config${pkg-config.suffix}" failonerror="true" taskname="dbus-cflags">
+ <arg line="--cflags dbus-1"/>
+ </exec>
+- <exec outputproperty="dbus-libflags" errorproperty="stderr" executable="pkg-config" failonerror="true" taskname="dbus-libflags">
++ <exec outputproperty="dbus-libflags" errorproperty="stderr" executable="${pkg-config.prefix}pkg-config${pkg-config.suffix}" failonerror="true" taskname="dbus-libflags">
+ <arg line="--libs dbus-1"/>
+ </exec>
+- <exec outputproperty="glib-cflags" errorproperty="stderr" executable="pkg-config" failonerror="true" taskname="glib-cflags">
++ <exec outputproperty="glib-cflags" errorproperty="stderr" executable="${pkg-config.prefix}pkg-config${pkg-config.suffix}" failonerror="true" taskname="glib-cflags">
+ <arg line="--cflags glib-2.0"/>
+ </exec>
+- <exec outputproperty="glib-libflags" errorproperty="stderr" executable="pkg-config" failonerror="true" taskname="glib-libflags">
++ <exec outputproperty="glib-libflags" errorproperty="stderr" executable="${pkg-config.prefix}pkg-config${pkg-config.suffix}" failonerror="true" taskname="glib-libflags">
+ <arg line="--libs glib-2.0"/>
+ </exec>
+ <compile lang="c++">
+--
+2.48.1
+