Skip to content
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

use new buildIdris' function #142

Merged
merged 3 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ version:
$(ised) "s/version = .*/version = ${v}/" ./harmony.ipkg
$(ised) "s/appVersion = \".*\"/appVersion = \"${v}\"/" ./src/AppVersion.idr
$(ised) "s/\"version\": \".*\"/\"version\": \"${v}\"/" ./package.json
$(ised) "s/version = \".*\";/version = \"${v}\";/" ./default.nix
@npm update
@$(node2nix) -- --composition node2nix.nix # -l # <- can't use -l for lockfile because lockfile version 3 not supported yet.
@$(nix) fmt
Expand Down
101 changes: 43 additions & 58 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
callPackage,
fetchFromGitHub,
git,
idris2Packages,
buildIdris,
lib,
installShellFiles,
Expand All @@ -15,75 +14,61 @@ let

idrisAdds = buildIdris {
ipkgName = "idris-adds";
version = idrisAddsVersion;
src = fetchFromGitHub {
owner = "mattpolzin";
repo = "idris-adds";
rev = idrisAddsVersion;
hash = "sha256-WEr6oRZ8+50G1qv7Kv62M4DRsgAa6x1BCODC1vDOQUY=";
};
idrisLibraries = [ ];
};
in
buildIdris {
ipkgName = "harmony";
src = builtins.path {
path = ./.;
name = "harmony-pkg-src";
};

harmonyPkg = buildIdris {
version = "5.0.0";
ipkgName = "harmony";
src = builtins.path {
path = ./.;
name = "harmony-pkg-src";
};
extraIdrisLibraries = [ idrisAdds ];

idrisLibraries =
let
ps = idris2Packages;
in
[
idrisAdds
ps.elab-util
ps.parser
ps.parser-json
ps.json
];
nativeBuildInputs = [
installShellFiles
makeBinaryWrapper
];
buildInputs = [
nodejs
git
];
nativeBuildInputs = [
installShellFiles
makeBinaryWrapper
];
buildInputs = [
nodejs
git
];

IDRIS2_DATA = "./support";
IDRIS2_DATA = "./support";

postInstall = ''
wrapProgram $out/bin/harmony \
--prefix PATH : ${
lib.makeBinPath [
nodeDependencies
git
"$out"
]
} \
--prefix NODE_PATH : ${nodeDependencies}/lib/node_modules
'';
postInstall = ''
wrapProgram $out/bin/harmony \
--prefix PATH : ${
lib.makeBinPath [
nodeDependencies
git
"$out"
]
} \
--prefix NODE_PATH : ${nodeDependencies}/lib/node_modules
'';

postFixup = ''
installShellCompletion --cmd harmony \
--bash <($out/bin/harmony --bash-completion-script) \
--zsh <($out/bin/harmony --zsh-completion-script) \
'';
postFixup = ''
installShellCompletion --cmd harmony \
--bash <($out/bin/harmony --bash-completion-script) \
--zsh <($out/bin/harmony --zsh-completion-script) \
'';

installCheckPhase = ''
export harmony=$out/bin/harmony
INTERACTIVE="" make test
'';
installCheckPhase = ''
export harmony=$out/bin/harmony
INTERACTIVE="" make test
'';

meta = with lib; {
description = "Harmony GitHub collaboration tool";
homepage = "https://github.com/mattpolzin/harmony";
license = licenses.mit;
mainProgram = "harmony";
};
meta = with lib; {
description = "Harmony GitHub collaboration tool";
homepage = "https://github.com/mattpolzin/harmony";
license = licenses.mit;
mainProgram = "harmony";
};
in
harmonyPkg.executable
}
18 changes: 9 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
let
pkgs = nixpkgs.legacyPackages.${system};
idris2Packages = packageset.idris2Packages.${system};
inherit (packageset.packages.${system}) buildIdris;
buildIdris = packageset.packages.${system}.buildIdris';
in
{
harmony = pkgs.callPackage ./default.nix { inherit buildIdris idris2Packages; };
harmony = pkgs.callPackage ./default.nix { inherit buildIdris; };

default = self.packages.${system}.harmony;
}
Expand Down
5 changes: 2 additions & 3 deletions version-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
pkgversion="$(cat harmony.ipkg | sed -n 's/version = \(.*\)/\1/p')"
idrversion="$(cat src/AppVersion.idr | sed -n 's/appVersion = "\(.*\)"/\1/p')"
npmversion="$(cat package.json | jq -r .version)"
nixversion="$(cat default.nix | sed -n 's/.*version = "\(.*\)";/\1/p')"

if [ "$pkgversion" == "$npmversion" ] && [ "$pkgversion" == "$idrversion" ] && [ "$pkgversion" == "$nixversion" ]; then
if [ "$pkgversion" == "$npmversion" ] && [ "$pkgversion" == "$idrversion" ]; then
exit 0
else
echo "Idris package manifest version (${pkgversion}), in-source version (${idrversion}), NPM package version (${npmversion}), and Nix version (${nixversion}) do not agree!"
echo "Idris package manifest version (${pkgversion}), in-source version (${idrversion}), and NPM package version (${npmversion}) do not agree!"
exit 1
fi

Loading