2023-02-28 13:17:08 +01:00
|
|
|
# https://github.com/josh-project/josh
|
2021-04-15 16:45:51 +02:00
|
|
|
{ depot, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
2023-03-24 14:33:38 +01:00
|
|
|
# TODO(sterni): switch to pkgs.josh as soon as that commit is released
|
2023-10-09 16:03:06 +02:00
|
|
|
rev = "1586eab06284ce668779c87f00a1fb5fa9763be0";
|
2021-05-02 16:37:23 +02:00
|
|
|
src = pkgs.fetchFromGitHub {
|
2023-02-28 13:17:08 +01:00
|
|
|
owner = "josh-project";
|
2021-04-15 16:45:51 +02:00
|
|
|
repo = "josh";
|
2023-02-28 13:17:08 +01:00
|
|
|
inherit rev;
|
2023-10-09 16:03:06 +02:00
|
|
|
hash = "sha256-94QrHcVHiEMCpBZJ5sghwtVNLNm4gdG8X85OetoGRD0=";
|
2021-04-15 16:45:51 +02:00
|
|
|
};
|
2023-07-02 14:20:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
naersk = pkgs.callPackage depot.third_party.sources.naersk {
|
2023-10-09 16:03:06 +02:00
|
|
|
inherit (pkgs) rustc cargo;
|
2023-07-02 14:20:17 +02:00
|
|
|
};
|
2023-07-03 16:25:33 +02:00
|
|
|
version = "git-${builtins.substring 0 8 rev}";
|
2021-04-15 16:45:51 +02:00
|
|
|
in
|
2023-07-02 14:20:17 +02:00
|
|
|
naersk.buildPackage {
|
2023-07-03 16:25:33 +02:00
|
|
|
pname = "josh";
|
|
|
|
inherit src version;
|
|
|
|
JOSH_VERSION = version;
|
2021-04-15 16:45:51 +02:00
|
|
|
|
|
|
|
buildInputs = with pkgs; [
|
|
|
|
libgit2
|
|
|
|
openssl
|
2022-09-26 19:33:05 +02:00
|
|
|
pkg-config
|
2021-04-15 16:45:51 +02:00
|
|
|
];
|
|
|
|
|
2023-07-02 10:29:04 +02:00
|
|
|
dontStrip = true;
|
2021-04-15 16:45:51 +02:00
|
|
|
cargoBuildOptions = x: x ++ [
|
|
|
|
"-p"
|
2023-02-28 13:17:08 +01:00
|
|
|
"josh-filter"
|
2021-04-15 16:45:51 +02:00
|
|
|
"-p"
|
|
|
|
"josh-proxy"
|
|
|
|
];
|
2022-02-11 11:17:35 +01:00
|
|
|
|
|
|
|
overrideMain = x: {
|
2023-07-02 10:29:04 +02:00
|
|
|
preBuild = x.preBuild or "" + ''
|
|
|
|
echo 'debug = true' >> Cargo.toml
|
|
|
|
'';
|
|
|
|
|
2022-02-09 15:12:04 +01:00
|
|
|
nativeBuildInputs = (x.nativeBuildInputs or [ ]) ++ [ pkgs.makeWrapper ];
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/josh-proxy --prefix PATH : "${pkgs.git}/bin"
|
|
|
|
'';
|
2022-02-11 11:17:35 +01:00
|
|
|
};
|
2021-04-15 16:45:51 +02:00
|
|
|
}
|