fix post install

This commit is contained in:
Clément DOUIN 2024-04-19 07:52:02 +02:00
parent 4590348bf2
commit 5003abe1e1
No known key found for this signature in database
GPG key ID: 353E4A18EE0FAB72
2 changed files with 27 additions and 19 deletions

View file

@ -18,6 +18,8 @@ jobs:
os: ubuntu-latest os: ubuntu-latest
- target: x86_64-darwin - target: x86_64-darwin
os: macos-latest os: macos-latest
- target: aarch64-darwin
os: macos-latest
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -35,4 +37,7 @@ jobs:
run: | run: |
nix run -L .#${{ matrix.target }} -- --version nix run -L .#${{ matrix.target }} -- --version
ls result/bin -al ls result/bin -al
ls result/share -al
ls result/share/applications -al ls result/share/applications -al
ls result/share/man -al
ls result/share/completions -al

View file

@ -163,29 +163,32 @@
mkPackage' { inherit pkgs; system = buildSystem; } { mkPackage' { inherit pkgs; system = buildSystem; } {
name = "himalaya"; name = "himalaya";
src = gitignoreSource ./.; src = gitignoreSource ./.;
overrideMain = _: { strictDeps = true;
postInstall = ''
export WINEPREFIX="$(mktemp -d)"
mkdir -p $out/share/applications/
cp assets/himalaya.desktop $out/share/applications/
cd $out/bin
mkdir -p {man,completions}
${runner} man ./man
${runner} completion bash > ./completions/himalaya.bash
${runner} completion elvish > ./completions/himalaya.elvish
${runner} completion fish > ./completions/himalaya.fish
${runner} completion powershell > ./completions/himalaya.powershell
${runner} completion zsh > ./completions/himalaya.zsh
tar -czf himalaya.tgz himalaya* man completions
${pkgs.zip}/bin/zip -r himalaya.zip himalaya* man completions
'';
};
doCheck = false; doCheck = false;
auditable = false; auditable = false;
strictDeps = true; nativeBuildInputs = with pkgs; [ pkg-config ];
CARGO_BUILD_TARGET = targetConfig.rustTarget; CARGO_BUILD_TARGET = targetConfig.rustTarget;
CARGO_BUILD_RUSTFLAGS = staticRustFlags; CARGO_BUILD_RUSTFLAGS = staticRustFlags;
nativeBuildInputs = with pkgs; [ pkg-config ]; postInstall = ''
export WINEPREFIX="$(mktemp -d)"
mkdir -p $out/bin/share/{applications,completions,man,services}
cp assets/himalaya.desktop $out/bin/share/applications/
cp assets/himalaya-watch@.service $out/bin/share/services/
cd $out/bin
${runner} man ./share/man
${runner} completion bash > ./share/completions/himalaya.bash
${runner} completion elvish > ./share/completions/himalaya.elvish
${runner} completion fish > ./share/completions/himalaya.fish
${runner} completion powershell > ./share/completions/himalaya.powershell
${runner} completion zsh > ./share/completions/himalaya.zsh
tar -czf himalaya.tgz himalaya* share
${pkgs.zip}/bin/zip -r himalaya.zip himalaya* share
mv share ../
mv himalaya.tgz himalaya.zip ../
'';
}; };
buildPackage = targetSystem: targetConfig: buildPackage = targetSystem: targetConfig: