aboutsummaryrefslogtreecommitdiff
path: root/nix/libluv.nix
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-04-04 14:33:19 +0530
committerAkshay Nair <phenax5@gmail.com>2025-04-04 14:33:19 +0530
commit8433630d1f315d1b66e8dd8f914c1fb73dade9ae (patch)
tree932409a1df27d0ea1d555bbf65b68d3bf73b6be1 /nix/libluv.nix
parent96727d6e63ca927f3c7b68d4baa4fe672a4dcd0b (diff)
downloadnull-browser-8433630d1f315d1b66e8dd8f914c1fb73dade9ae.tar.gz
null-browser-8433630d1f315d1b66e8dd8f914c1fb73dade9ae.zip
Static link libuv and luajit + minor changes
Diffstat (limited to 'nix/libluv.nix')
-rw-r--r--nix/libluv.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/nix/libluv.nix b/nix/libluv.nix
new file mode 100644
index 0000000..6909ead
--- /dev/null
+++ b/nix/libluv.nix
@@ -0,0 +1,48 @@
+{ luajitPackages, luajit, libuv, fetchurl, ... }:
+let
+ lua-libluv = luajitPackages.libluv.overrideAttrs (oldAttrs: rec {
+ version = "1.50.0-1";
+ buildInputs = [luajit libuv];
+ knownRockspec = (fetchurl {
+ url = "mirror://luarocks/luv-${version}.rockspec";
+ sha256 = "sha256-IL2EejtmT0pw0cAupMz0gvP3a19NPsc45W1RaoeGJgY=";
+ }).outPath;
+ src = fetchurl {
+ url = "https://github.com/luvit/luv/releases/download/${version}/luv-${version}.tar.gz";
+ sha256 = "sha256-2GfDAk2cmB1U8u3YPhP9bcEVjwYIY197HA9rVYa1vDQ=";
+ };
+ });
+
+ # TODO: Figure out static linking
+ # lua-libluv = with pkgs; stdenv.mkDerivation rec {
+ # version = "1.50.0-1";
+ # pname = "libluv";
+ # src = fetchgit {
+ # url = "https://github.com/luvit/luv";
+ # tag = version;
+ # sha256 = "sha256-pmp/lUX2lAFMZA8LiL21G0fNFLEOpNWLp5UPBubTQeM=";
+ # fetchSubmodules = true;
+ # leaveDotGit = true;
+ # };
+ # cmakeFlags = [
+ # "-DBUILD_MODULE=OFF"
+ # "-DBUILD_STATIC_LIBS=ON"
+ # "-DWITH_LUA_ENGINE=LuaJIT"
+ # "-DWITH_SHARED_LIBUV=OFF"
+ # "-DLUA_BUILD_TYPE=Static"
+ # ];
+ # postInstall = ''
+ # mkdir -p $out/lib/pkgconfig;
+ # cp $src/libluv.pc.in $out/lib/pkgconfig/libluv.pc;
+ # substituteInPlace $out/lib/pkgconfig/libluv.pc \
+ # --replace "@prefix@" "$out" \
+ # --replace "@libdir@" "$out/lib" \
+ # --replace "@includedir@" "$out/include" \
+ # --replace "@LUV_VERSION@" ${version} \
+ # --replace "@LIBS" "";
+ # '';
+ # buildInputs = [pkgs.luajit pkgs.libuv];
+ # nativeBuildInputs = [cmake git];
+ # };
+in
+ lua-libluv