2023-08-04 22:07:22 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, curl, python3, trurl, testers }:
|
2023-04-12 12:48:02 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "trurl";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.9";
|
2023-04-12 12:48:02 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "curl";
|
|
|
|
repo = pname;
|
|
|
|
rev = "${pname}-${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-R/7Saea84iqUICAAQz9zcfDLDud4uFedY2752xyg+oE=";
|
2023-04-12 12:48:02 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
# The version number was forgotten to be updated for the release,
|
|
|
|
# so do it manually in the meantime.
|
|
|
|
# See https://github.com/curl/trurl/discussions/244#discussioncomment-7436369
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace version.h --replace 0.8 0.9
|
|
|
|
'';
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
outputs = [ "out" "dev" "man" ];
|
2023-04-12 12:48:02 +00:00
|
|
|
separateDebugInfo = stdenv.isLinux;
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
nativeBuildInputs = [ curl ];
|
2023-04-12 12:48:02 +00:00
|
|
|
buildInputs = [ curl ];
|
|
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
|
|
|
|
|
|
|
doCheck = true;
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeCheckInputs = [ python3 ];
|
2023-04-12 12:48:02 +00:00
|
|
|
checkTarget = "test";
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = trurl;
|
|
|
|
};
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A command line tool for URL parsing and manipulation";
|
|
|
|
homepage = "https://curl.se/trurl";
|
|
|
|
changelog = "https://github.com/curl/trurl/releases/tag/${pname}-${version}";
|
|
|
|
license = licenses.curl;
|
|
|
|
maintainers = with maintainers; [ christoph-heiss ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|