Skip to content

Commit

Permalink
nix: try to build without x11 support
Browse files Browse the repository at this point in the history
  • Loading branch information
nazarewk committed Nov 17, 2023
1 parent 6f2419b commit 5efc6b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
flake.overlays.default = final: prev: {
ulauncher6 = final.callPackage ./. { };
ulauncher6-noxorg = final.ulauncher6.override {
withXorg = false;
};
};
perSystem = { config, self', inputs', pkgs, system, ... }: {
_module.args.pkgs = import inputs.nixpkgs {
Expand All @@ -13,6 +16,7 @@
};
packages.default = pkgs.ulauncher6;
packages.ulauncher6 = pkgs.ulauncher6;
packages.ulauncher6-noxorg = pkgs.ulauncher6-noxorg;
};
};
}
13 changes: 6 additions & 7 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
, webkitgtk
, wrapGAppsHook
, xvfb-run
, withX11 ? true
, withXorg ? true
}:
let
pname = "ulauncher";
version = "v6";
isInRepo = builtins.pathExists ../ulauncher/__init__.py;
src =
if builtins.pathExists ../ulauncher/__init__.py
then ../.
if isInRepo then ../.
# `nixpkgs` stub to get less modifications
else
fetchFromGitHub {
Expand All @@ -36,7 +36,7 @@ let
};
preferences = mkYarnPackage {
name = "${pname}-${version}-ulauncher-prefs";
src = "${src}/preferences-src";
src = if isInRepo then ../preferences-src else "${src}/preferences-src";
postPatch = ''
substituteInPlace webpack.build.conf.js \
--replace "__dirname, '../data/preferences" "__dirname, 'dist"
Expand Down Expand Up @@ -64,7 +64,7 @@ python3Packages.buildPythonPackage {
libappindicator
librsvg
webkitgtk
] ++ lib.optionals withX11 [
] ++ lib.optionals withXorg [
libwnck
];

Expand Down Expand Up @@ -121,10 +121,9 @@ python3Packages.buildPythonPackage {
preFixup = ''
makeWrapperArgs+=(
"''${gappsWrapperArgs[@]}"
${lib.optionalString withX11 ''--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libX11 ]}"''}
${lib.optionalString withXorg ''--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libX11 ]}"''}
--prefix WEBKIT_DISABLE_COMPOSITING_MODE : "1"
)
echo "XXXXXXXXXXXXXXXXXX withX11=${toString withX11}"
'';

passthru = {
Expand Down

0 comments on commit 5efc6b3

Please sign in to comment.