From f6c2cbab8472b85e27a7d7de05081f093c665ae5 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Mon, 3 Oct 2022 17:18:43 +0800 Subject: [PATCH] premake5: 5.0.0-alpha12 -> 5.0.0-beta2 Also set ssl certificates --- pkgs/development/tools/misc/premake/5.nix | 14 +++++--- .../tools/misc/premake/no-curl-ca.patch | 36 +++++++++++++++++++ 2 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 pkgs/development/tools/misc/premake/no-curl-ca.patch diff --git a/pkgs/development/tools/misc/premake/5.nix b/pkgs/development/tools/misc/premake/5.nix index bb0269d0cc3b..869fe21ed783 100644 --- a/pkgs/development/tools/misc/premake/5.nix +++ b/pkgs/development/tools/misc/premake/5.nix @@ -1,21 +1,25 @@ -{ lib, stdenv, fetchFromGitHub, Foundation, readline }: +{ lib, stdenv, fetchFromGitHub, libuuid, cacert, Foundation, readline }: with lib; stdenv.mkDerivation rec { pname = "premake5"; - version = "5.0.0-alpha12"; + version = "5.0.0-beta2"; src = fetchFromGitHub { owner = "premake"; repo = "premake-core"; rev = "v${version}"; - sha256 = "1h3hr96pdz94njn4bg02ldcz0k5j1x017d8svc7fdyvl2b77nqzf"; + sha256 = "sha256-2R5gq4jaQsp8Ny1oGuIYkef0kn2UG9jMf20vq0714oY="; }; - buildInputs = optionals stdenv.isDarwin [ Foundation readline ]; + buildInputs = [ libuuid ] ++ optionals stdenv.isDarwin [ Foundation readline ]; - patchPhase = optional stdenv.isDarwin '' + patches = [ ./no-curl-ca.patch ]; + patchPhase = '' + substituteInPlace contrib/curl/premake5.lua \ + --replace "ca = nil" "ca = '${cacert}/etc/ssl/certs/ca-bundle.crt'" + '' + optionalString stdenv.isDarwin '' substituteInPlace premake5.lua \ --replace -mmacosx-version-min=10.4 -mmacosx-version-min=10.5 ''; diff --git a/pkgs/development/tools/misc/premake/no-curl-ca.patch b/pkgs/development/tools/misc/premake/no-curl-ca.patch new file mode 100644 index 000000000000..a1c9c1cfa18e --- /dev/null +++ b/pkgs/development/tools/misc/premake/no-curl-ca.patch @@ -0,0 +1,36 @@ +From a26e36d55cd2447488e01b2ff4ac65e2596862cd Mon Sep 17 00:00:00 2001 +From: Ellie Hermaszewska +Date: Mon, 3 Oct 2022 16:50:33 +0800 +Subject: [PATCH] Do not set CURL_CA_BUNDLE + +--- + contrib/curl/premake5.lua | 13 ------------- + 1 file changed, 13 deletions(-) + +diff --git a/contrib/curl/premake5.lua b/contrib/curl/premake5.lua +index 474f5cfa..553bbd02 100644 +--- a/contrib/curl/premake5.lua ++++ b/contrib/curl/premake5.lua +@@ -32,19 +32,6 @@ project "curl-lib" + + -- find the location of the ca bundle + local ca = nil +- for _, f in ipairs { +- "/etc/ssl/certs/ca-certificates.crt", +- "/etc/pki/tls/certs/ca-bundle.crt", +- "/usr/share/ssl/certs/ca-bundle.crt", +- "/usr/local/share/certs/ca-root.crt", +- "/usr/local/share/certs/ca-root-nss.crt", +- "/etc/certs/ca-certificates.crt", +- "/etc/ssl/cert.pem" } do +- if os.isfile(f) then +- ca = f +- break +- end +- end + if ca then + defines { 'CURL_CA_BUNDLE="' .. ca .. '"' } + end +-- +2.37.2 +