-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ada-url: init at 2.7.7 #297294
ada-url: init at 2.7.7 #297294
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6994,6 +6994,12 @@ | |
fingerprint = "58CE D4BE 6B10 149E DA80 A990 2F48 6356 A4CB 30F3"; | ||
}]; | ||
}; | ||
genevieve-me = { | ||
name = "Genevieve Mendoza"; | ||
email = "[email protected]"; | ||
github = "genevieve-me"; | ||
githubId = 140119870; | ||
}; | ||
genofire = { | ||
name = "genofire"; | ||
email = "[email protected]"; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
diff --git a/cmake/CPM.cmake b/cmake/CPM.cmake | ||
index ad6b74a8..079eed46 100644 | ||
--- a/cmake/CPM.cmake | ||
+++ b/cmake/CPM.cmake | ||
@@ -16,9 +16,11 @@ endif() | ||
# Expand relative path. This is important if the provided path contains a tilde (~) | ||
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE) | ||
|
||
-file(DOWNLOAD | ||
- https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake | ||
- ${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM} | ||
-) | ||
+if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION})) | ||
+ file(DOWNLOAD | ||
+ https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake | ||
+ ${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM} | ||
+ ) | ||
+endif() | ||
|
||
include(${CPM_DOWNLOAD_LOCATION}) |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,61 @@ | ||||||
{ | ||||||
lib, | ||||||
fetchFromGitHub, | ||||||
stdenv, | ||||||
cpm-cmake, | ||||||
simdjson, | ||||||
cmake, | ||||||
cxxopts, | ||||||
}: | ||||||
genevieve-me marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
let | ||||||
googletest = fetchFromGitHub { | ||||||
owner = "google"; | ||||||
repo = "googletest"; | ||||||
rev = "v1.14.0"; | ||||||
hash = "sha256-t0RchAHTJbuI5YW4uyBPykTvcjy90JW9AOPNjIhwh6U="; | ||||||
}; | ||||||
googlebenchmark = fetchFromGitHub { | ||||||
owner = "google"; | ||||||
repo = "benchmark"; | ||||||
rev = "v1.6.0"; | ||||||
hash = "sha256-EAJk3JhLdkuGKRMtspTLejck8doWPd7Z0Lv/Mvf3KFY="; | ||||||
}; | ||||||
pname = "ada"; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason we're using |
||||||
version = "2.7.7"; | ||||||
in | ||||||
stdenv.mkDerivation rec { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
inherit pname version; | ||||||
src = fetchFromGitHub { | ||||||
owner = "ada-url"; | ||||||
repo = pname; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be explicitly set rather than using |
||||||
rev = "v${version}"; | ||||||
hash = "sha256-eh/tOwU+sU/8FYYuRE7DL1v1Fp6bNFWneLtGG0wsWgA="; | ||||||
}; | ||||||
|
||||||
patches = [ ./conditional-dl.patch ]; | ||||||
|
||||||
preConfigure = '' | ||||||
mkdir -p ${placeholder "out"}/share/cpm | ||||||
cp ${cpm-cmake}/share/cpm/CPM.cmake ${placeholder "out"}/share/cpm/CPM_0.38.6.cmake | ||||||
''; | ||||||
|
||||||
cmakeFlags = [ | ||||||
"-DCPM_SOURCE_CACHE=${placeholder "out"}/share" | ||||||
"-DFETCHCONTENT_SOURCE_DIR_SIMDJSON=${simdjson.src}" | ||||||
"-DFETCHCONTENT_SOURCE_DIR_GTEST=${googletest}" | ||||||
"-DFETCHCONTENT_SOURCE_DIR_BENCHMARK=${googlebenchmark}" | ||||||
"-DBUILD_SHARED_LIBS=ON" | ||||||
]; | ||||||
|
||||||
nativeBuildInputs = [ cmake ]; | ||||||
|
||||||
buildInputs = [ cxxopts ]; | ||||||
meta = with lib; { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
tracking issue: #292468 |
||||||
homepage = "https://www.ada-url.com/"; | ||||||
description = "WHATWG-compliant and fast URL parser written in modern C++"; | ||||||
license = licenses.asl20; | ||||||
platforms = [ "x86_64-linux" ]; | ||||||
maintainers = with maintainers; [ genevieve-me ]; | ||||||
}; | ||||||
genevieve-me marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lemire should we fix this on Ada?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CPM has regular releases and CPM.cmake has a recent update. I don't know if the latest release would solve the problem that this patch solves. If not, the proper action would be to submit a patch to CPM.
Modifying CPM.cmake ourselves is not a good idea. We should rely on releases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the "main" CPM.cmake file, but a variation on their provided
get_cpm.cmake
script. However, I have still filed cpm-cmake/CPM.cmake#554 and if they approve such a change I can also send a patch to ada-url to update their cmake file.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be fantastic!