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: update the flake to use the Makefile #5

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
prefix ?= /usr/local
bindir = $(prefix)/bin
libdir = $(prefix)/lib
libexecdir = $(prefix)/libexec
libexecdir ?= $(prefix)/libexec
includedir = $(prefix)/include
datarootdir = $(prefix)/share
datadir = $(datarootdir)
Expand Down Expand Up @@ -34,7 +34,7 @@ $(BIN): Cargo.toml Cargo.lock src/main.rs vendor-check

install:
install -Dm0755 target/$(TARGET)/$(BIN) $(DESTDIR)$(libexecdir)/$(BIN)
install -Dm0644 data/$(DBUS_NAME).service $(DESTDIR)/$(datadir)/dbus-1/services/$(DBUS_NAME).service
install -Dm0644 data/$(DBUS_NAME).service $(DESTDIR)/$(datadir)/systemd/user/$(DBUS_NAME).service
install -Dm0644 data/cosmic.portal $(DESTDIR)/$(datadir)/xdg-desktop-portal/portals/cosmic.portal

## Cargo Vendoring
Expand Down
14 changes: 12 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@
./src
./Cargo.toml
./Cargo.lock
./Makefile
./data
];
};
nativeBuildInputs = with pkgs; [ pkg-config rustPlatform.bindgenHook ];
nativeBuildInputs = with pkgs; [ pkg-config rustPlatform.bindgenHook gnumake ];
buildInputs = with pkgs; [
pipewire
libxkbcommon
Expand All @@ -47,7 +49,15 @@
inherit xdg-desktop-portal-cosmic;
};

packages.default = xdg-desktop-portal-cosmic;
# FIXME reference the libexecdir for xdp-cosmic in the nix store in cosmic-session
# then the hack putting xdp-cosmic into bin can be removed
packages.default = xdg-desktop-portal-cosmic
.overrideAttrs (oldAttrs: rec {
installPhase = ''
make install prefix=$out libexecdir=$out/bin
'';
passthru.providedSessions = [ "cosmic" ];
});

apps.default = flake-utils.lib.mkApp {
drv = xdg-desktop-portal-cosmic;
Expand Down