summaryrefslogtreecommitdiff
path: root/pkgs
diff options
context:
space:
mode:
authorSeth Flynn <[email protected]>2025-03-05 15:27:26 -0500
committerSeth Flynn <[email protected]>2025-03-05 15:31:38 -0500
commit6fa4458f59160cdf9e82ad2138300b1041f510ad (patch)
tree88aeb808a13eadeacf0bc9b97d85c93f10de7a2d /pkgs
parentb229a37e59b9720b7017e72a6d159b869ff36458 (diff)
treewide: use flake
Signed-off-by: Seth Flynn <[email protected]>
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/lwjgl/default.nix (renamed from pkgs/lwjgl.nix)41
-rw-r--r--pkgs/lwjgl/fix-library-paths.patch36
2 files changed, 74 insertions, 3 deletions
diff --git a/pkgs/lwjgl.nix b/pkgs/lwjgl/default.nix
index fac5eb5..546c45c 100644
--- a/pkgs/lwjgl.nix
+++ b/pkgs/lwjgl/default.nix
@@ -5,28 +5,55 @@
ant,
at-spi2-atk,
buildPackages,
+ cairo,
dbus,
fetchAntDeps,
fetchFromGitHub,
gdk-pixbuf,
+ glib,
gtk3,
+ harfbuzz,
kotlin,
libGLU,
+ libffi,
libglvnd,
+ pango,
+ replaceVars,
xorg,
+
+ version,
+ hash,
+ antHash,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "lwjgl";
- version = "3.3.4";
+ inherit version;
src = fetchFromGitHub {
owner = "LWJGL";
repo = "lwjgl3";
tag = finalAttrs.version;
- hash = "sha256-U0pPeTqVoruqqhhMrBrczy0qt83a8atr8DyRcGgX/yI=";
+ inherit hash;
};
+ patches = [
+ (replaceVars ./fix-library-paths.patch (
+ lib.mapAttrs (lib.const lib.getDev) {
+ inherit
+ at-spi2-atk
+ cairo
+ dbus
+ gdk-pixbuf
+ glib
+ gtk3
+ harfbuzz
+ pango
+ ;
+ }
+ ))
+ ];
+
antJdk = buildPackages.jdk_headless;
antDeps = fetchAntDeps {
inherit (finalAttrs)
@@ -35,7 +62,7 @@ stdenv.mkDerivation (finalAttrs: {
src
antJdk
;
- hash = "sha256-7jVlKBia8dJGuBjNwaljHBrXUep9KjOHHyZESayFnhs=";
+ hash = antHash;
};
strictDeps = true;
@@ -47,15 +74,23 @@ stdenv.mkDerivation (finalAttrs: {
buildInputs = [
at-spi2-atk
+ cairo
dbus
gdk-pixbuf
+ glib
gtk3
+ harfbuzz
libGLU
+ libffi
+ pango
xorg.libX11
xorg.libXt
];
env = {
+ NIX_CFLAGS = "-funroll-loops -I${lib.getDev gtk3}/include/gtk-3.0";
+ NIX_LDFLAGS = "-lffi";
+
JAVA_HOME = finalAttrs.antJdk.home;
JAVA8_HOME = buildPackages.jdk8_headless.home;
diff --git a/pkgs/lwjgl/fix-library-paths.patch b/pkgs/lwjgl/fix-library-paths.patch
new file mode 100644
index 0000000..0d6b332
--- /dev/null
+++ b/pkgs/lwjgl/fix-library-paths.patch
@@ -0,0 +1,36 @@
+diff --git a/config/linux/build.xml b/config/linux/build.xml
+index a1798b6aa..13a75815f 100644
+--- a/config/linux/build.xml
++++ b/config/linux/build.xml
+@@ -282,15 +282,13 @@
+ <build module="nfd" simple="true" linker="g++" if:true="${binding.nfd}">
+ <beforeCompile>
+ <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 value="-I@gtk3@"/>
++ <arg value="-I@glib@"/>
++ <arg value="-I@pango@"/>
++ <arg value="-I@harfbuzz@"/>
++ <arg value="-I@cairo@"/>
++ <arg value="-I@gdk-pixbuf@"/>
++ <arg value="-I@at-spi2-atk@"/>
+ <arg value="-I${src.main.rel}/include"/>
+ <fileset dir="." includes="${src.main}/nfd_gtk.cpp"/>
+ </compile>
+@@ -308,7 +306,7 @@
+ <build module="nfd" suffix="_portal" simple="true" linker="g++" if:true="${binding.nfd}">
+ <beforeCompile>
+ <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="-I@dbus@"/>
+ <arg value="-I${src.main.rel}/include"/>
+ <fileset dir="." includes="${src.main}/nfd_portal.cpp"/>
+ </compile>