2023-03-24 00:07:29 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, autoreconfHook, pkg-config, python3
|
2020-04-24 23:36:52 +00:00
|
|
|
, libxml2, libXinerama, libXcursor, libXau, libXrandr, libICE, libSM
|
|
|
|
, imlib2, pango, libstartup_notification, makeWrapper }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "openbox";
|
|
|
|
version = "3.6.1";
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2020-05-29 06:06:01 +00:00
|
|
|
autoreconfHook
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
makeWrapper
|
2020-05-29 06:06:01 +00:00
|
|
|
python3.pkgs.wrapPython
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libxml2
|
|
|
|
libXinerama libXcursor libXau libXrandr libICE libSM
|
|
|
|
libstartup_notification
|
2020-05-29 06:06:01 +00:00
|
|
|
python3
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
pango imlib2
|
|
|
|
];
|
|
|
|
|
2020-05-29 06:06:01 +00:00
|
|
|
pythonPath = with python3.pkgs; [
|
2020-04-24 23:36:52 +00:00
|
|
|
pyxdg
|
|
|
|
];
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://openbox.org/dist/openbox/${pname}-${version}.tar.gz";
|
|
|
|
sha256 = "1xvyvqxlhy08n61rjkckmrzah2si1i7nmc7s8h07riqq01vc0jlb";
|
|
|
|
};
|
|
|
|
|
|
|
|
setlayoutSrc = fetchurl {
|
|
|
|
url = "http://openbox.org/dist/tools/setlayout.c";
|
|
|
|
sha256 = "1ci9lq4qqhl31yz1jwwjiawah0f7x0vx44ap8baw7r6rdi00pyiv";
|
|
|
|
};
|
|
|
|
|
2020-05-29 06:06:01 +00:00
|
|
|
patches = [
|
|
|
|
# Use fetchurl to avoid "fetchpatch: ignores file renames" #32084
|
|
|
|
# This patch adds python3 support
|
|
|
|
(fetchurl {
|
2021-07-14 22:03:04 +00:00
|
|
|
url = "https://raw.githubusercontent.com/archlinux/svntogit-community/90cb57ef53d952bb6ab4c33a184f815bbe1791c0/openbox/trunk/py3.patch";
|
2020-05-29 06:06:01 +00:00
|
|
|
sha256 = "1ks99awlkhd5ph9kz94s1r6m1bfvh42g4rmxd14dyg5b421p1ljc";
|
|
|
|
})
|
2023-03-24 00:07:29 +00:00
|
|
|
|
|
|
|
# Fix crash with GLib 2.76. This is proposed on https://bugzilla.icculus.org/show_bug.cgi?id=6669
|
|
|
|
# and commited to a work branch in the upstream repo. See https://bugs.archlinux.org/task/77853.
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/Mikachu/openbox/commit/d41128e5a1002af41c976c8860f8299cfcd3cd72.patch";
|
|
|
|
sha256 = "sha256-4/aoI4y98JPybZ1MNI7egOhkroQgh/oeGnYrhNGX4t4=";
|
|
|
|
})
|
2020-05-29 06:06:01 +00:00
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postBuild = "gcc -O2 -o setlayout $(pkg-config --cflags --libs x11) $setlayoutSrc";
|
|
|
|
|
|
|
|
# Openbox needs XDG_DATA_DIRS set or it can't find its default theme
|
|
|
|
postInstall = ''
|
|
|
|
cp -a setlayout "$out"/bin
|
|
|
|
wrapProgram "$out/bin/openbox" --prefix XDG_DATA_DIRS : "$out/share"
|
|
|
|
wrapProgram "$out/bin/openbox-session" --prefix XDG_DATA_DIRS : "$out/share"
|
|
|
|
wrapProgram "$out/bin/openbox-gnome-session" --prefix XDG_DATA_DIRS : "$out/share"
|
|
|
|
wrapProgram "$out/bin/openbox-kde-session" --prefix XDG_DATA_DIRS : "$out/share"
|
|
|
|
wrapPythonProgramsIn "$out/libexec" "$out $pythonPath"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "X window manager for non-desktop embedded systems";
|
|
|
|
homepage = "http://openbox.org/";
|
2021-01-17 00:15:33 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
|
|
|
platforms = lib.platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|