Commit 66459637 authored by Xiangyan Sun's avatar Xiangyan Sun
Browse files

urweb: fix build with gcc15

parent db985dfa
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
  lib,
  stdenv,
  fetchurl,
  fetchpatch,
  file,
  openssl,
  mlton,
@@ -21,6 +22,13 @@ stdenv.mkDerivation rec {
    sha256 = "0qh6wcxfk5kf735i5gqwnkdirnnmqhnnpkfz96gz144dgz2i0c5c";
  };

  patches = [
    (fetchpatch {
      url = "https://github.com/urweb/urweb/commit/f7a38a95bee9d1aaf7ed83a651cfbce8da96ed44.patch";
      sha256 = "TQFD9Y8OEOSFv6cqpHQ4WSNAPzl82MmVCAxLR4F4Uxc=";
    })
  ];

  buildInputs = [
    openssl
    mlton
@@ -47,6 +55,10 @@ stdenv.mkDerivation rec {
                   -L${libmysqlclient}/lib \
                   -L${libpq}/lib \
                   -L${sqlite.out}/lib";
  ''
  + lib.optionalString stdenv.hostPlatform.isDarwin ''
    # unresolved reference when linking liburweb.1.dylib
    export LDFLAGS="-Wl,-undefined,dynamic_lookup";
  '';

  env.NIX_CFLAGS_COMPILE = toString [