From a5766a100cc12f84972258586cf4d7d04b7ee086 Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Fri, 2 May 2025 17:16:03 -0700 Subject: [PATCH 1/2] premake5: fix build on Darwin and arm64 --- pkgs/development/tools/misc/premake/5.nix | 36 ++++++++++++++++------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/pkgs/development/tools/misc/premake/5.nix b/pkgs/development/tools/misc/premake/5.nix index 9e7497fde4bf..56cf1062c7fd 100644 --- a/pkgs/development/tools/misc/premake/5.nix +++ b/pkgs/development/tools/misc/premake/5.nix @@ -2,24 +2,30 @@ lib, stdenv, fetchFromGitHub, - libuuid, + + # build inputs cacert, + libuuid, + + # build inputs (darwin) readline, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "premake5"; version = "5.0.0-beta4"; src = fetchFromGitHub { owner = "premake"; repo = "premake-core"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; sha256 = "sha256-sNLCyIHWDW/8jIrMFCZAqtWsh4SRugqtPR4HaoW/Vzk="; }; buildInputs = - [ libuuid ] + [ + libuuid + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ readline ]; @@ -28,11 +34,10 @@ stdenv.mkDerivation rec { postPatch = '' substituteInPlace contrib/curl/premake5.lua \ - --replace "ca = nil" "ca = '${cacert}/etc/ssl/certs/ca-bundle.crt'" + --replace-fail "ca = nil" "ca = '${cacert}/etc/ssl/certs/ca-bundle.crt'" '' + lib.optionalString stdenv.hostPlatform.isDarwin '' substituteInPlace premake5.lua \ - --replace -mmacosx-version-min=10.4 -mmacosx-version-min=10.5 \ --replace-fail '"-arch arm64"' '""' \ --replace-fail '"-arch x86_64"' '""' '' @@ -40,17 +45,21 @@ stdenv.mkDerivation rec { substituteInPlace \ binmodules/example/premake5.lua \ binmodules/luasocket/premake5.lua \ - --replace SharedLib StaticLib + --replace-fail SharedLib StaticLib ''; buildPhase = if stdenv.hostPlatform.isDarwin then + # Error compiling the builtin zlib source, but it's not used currently '' - make -f Bootstrap.mak osx + make PREMAKE_OPTS="--zlib-src=none" \ + PLATFORM="Universal" \ + -f Bootstrap.mak osx '' else '' - make -f Bootstrap.mak linux + make PLATFORM=${stdenv.hostPlatform.linuxArch} \ + -f Bootstrap.mak linux ''; env.NIX_CFLAGS_COMPILE = toString ( @@ -71,6 +80,11 @@ stdenv.mkDerivation rec { description = "Simple build configuration and project generation tool using lua"; mainProgram = "premake5"; license = lib.licenses.bsd3; - platforms = lib.platforms.darwin ++ lib.platforms.linux; + platforms = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; }; -} +}) From 5471af1bc7b07948f5df64cb162320764c9a68a1 Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Tue, 6 May 2025 13:15:01 -0700 Subject: [PATCH 2/2] premake5: addd sarahec as maintainer --- pkgs/development/tools/misc/premake/5.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/tools/misc/premake/5.nix b/pkgs/development/tools/misc/premake/5.nix index 56cf1062c7fd..8a60b708fc78 100644 --- a/pkgs/development/tools/misc/premake/5.nix +++ b/pkgs/development/tools/misc/premake/5.nix @@ -80,6 +80,7 @@ stdenv.mkDerivation (finalAttrs: { description = "Simple build configuration and project generation tool using lua"; mainProgram = "premake5"; license = lib.licenses.bsd3; + maintainers = [ lib.maintainers.sarahec ]; platforms = [ "x86_64-linux" "aarch64-linux"