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

Fix mismatched cargoDeps in nix and update attribute syntax #682

Merged
merged 1 commit into from
Nov 13, 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
17 changes: 9 additions & 8 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,24 @@
debug ? false,
}:
let
deps = import ./nix/deps.nix { pkgs = pkgs; };
src = ./.;
deps = import ./nix/deps.nix { inherit pkgs; };
kimeVersion = builtins.readFile ./VERSION;
testArgs = if debug then "" else "--release";
inherit (pkgs) llvmPackages_18 rustPlatform qt5;
in
with pkgs;
llvmPackages_18.stdenv.mkDerivation rec {
llvmPackages_18.stdenv.mkDerivation {
name = "kime";
src = ./.;
inherit src;
buildInputs = deps.kimeBuildInputs;
nativeBuildInputs = deps.kimeNativeBuildInputs ++ [ rustPlatform.cargoSetupHook ];
version = kimeVersion;
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
#sha256 = "0000000000000000000000000000000000000000000000000000";
sha256 = "sha256-hlTxyaE/300CBGIJtFzIh6CT5PcmmqWt8CN428sr2U8=";
#hash = "0000000000000000000000000000000000000000000000000000";
hash = "sha256-2MG6xigiKdvQX8PR457d6AXswTRPRJBPERvZqemjv24=";
};
LIBCLANG_PATH = "${pkgs.llvmPackages_18.libclang.lib}/lib";
LIBCLANG_PATH = "${llvmPackages_18.libclang.lib}/lib";
dontUseCmakeConfigure = true;
dontWrapQtApps = true;
buildPhase = if debug then "bash scripts/build.sh -ad" else "bash scripts/build.sh -ar";
Expand All @@ -30,7 +31,7 @@ llvmPackages_18.stdenv.mkDerivation rec {
KIME_ICON_DIR=share/icons \
KIME_LIB_DIR=lib \
KIME_DOC_DIR=share/doc/kime \
KIME_QT5_DIR=lib/qt-${pkgs.qt5.qtbase.version} \
KIME_QT5_DIR=lib/qt-${qt5.qtbase.version} \
bash scripts/install.sh "$out"
'';
doCheck = true;
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Breaking

### Improve
- Fix mismatched cargoDeps in nix and update attribute syntax **[@nakoo]**

## 3.1.1

Expand Down
6 changes: 3 additions & 3 deletions flake.lock

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

6 changes: 3 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
flake-utils.lib.eachDefaultSystem
(system:
let pkgs = import nixpkgs {
system = system;
inherit system;
}; in
{
devShell = import ./shell.nix { inherit pkgs; };
defaultPackage = import ./default.nix { inherit pkgs; };
devShells.default = import ./shell.nix { inherit pkgs; };
packages.default = import ./default.nix { inherit pkgs; };
}
);
}
5 changes: 2 additions & 3 deletions nix/deps.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{ pkgs }:
with pkgs;
{
kimeBuildInputs = [
kimeBuildInputs = with pkgs; [
dbus
libdbusmenu

Expand All @@ -17,7 +16,7 @@ with pkgs;
# qt6.qtbase
];

kimeNativeBuildInputs = [
kimeNativeBuildInputs = with pkgs; [
python3 # xcb 0.9.0
pkg-config
llvmPackages_18.clang
Expand Down
6 changes: 3 additions & 3 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
pkgs ? import <nixpkgs> { },
}:
let
deps = import ./nix/deps.nix { pkgs = pkgs; };
deps = import ./nix/deps.nix { inherit pkgs; };
stdenv = pkgs.llvmPackages_18.stdenv;
mkShell = (pkgs.mkShell.override { stdenv = stdenv; });
mkShell = (pkgs.mkShell.override { inherit stdenv; });
in
mkShell {
pkgs.mkShell {
name = "kime-shell";
dontUseCmakeConfigure = true;
dontWrapQtApps = true;
Expand Down