linux-wallpaperengine: refactor (#365202)

This commit is contained in:
Sandro
2024-12-17 23:59:45 +01:00
committed by GitHub
2 changed files with 43 additions and 52 deletions
@@ -87,36 +87,33 @@ let
systemd
];
buildType = "Release";
platform =
{
"aarch64-linux" = "linuxarm64";
"x86_64-linux" = "linux64";
}
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
cef-bin-name = "cef_binary_120.1.10+g3ce3184+chromium-120.0.6099.129_${platform}";
selectSystem =
attrs:
attrs.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
arch = selectSystem {
aarch64-linux = "arm64";
x86_64-linux = "x64";
};
cef-bin-name = "cef_binary_120.1.10+g3ce3184+chromium-120.0.6099.129_linux${arch}";
cef-bin = stdenv.mkDerivation {
pname = "cef-bin";
version = "120.0.6099.129";
src =
let
hash =
{
"linuxarm64" = "sha256-2mOh3GWdx0qxsLRKVYXOJnVY0eqz6B3z9/B9A9Xfs/A=";
"linux64" = "sha256-FFkFMMkTSseLZIDzESFl8+h7wRhv5QGi1Uy5MViYpX8=";
}
.${platform};
urlName = builtins.replaceStrings [ "+" ] [ "%2B" ] cef-bin-name;
in
fetchzip {
url = "https://cef-builds.spotifycdn.com/${urlName}.tar.bz2";
inherit hash;
src = fetchzip {
url = "https://cef-builds.spotifycdn.com/${
builtins.replaceStrings [ "+" ] [ "%2B" ] cef-bin-name
}.tar.bz2";
hash = selectSystem {
aarch64-linux = "sha256-2mOh3GWdx0qxsLRKVYXOJnVY0eqz6B3z9/B9A9Xfs/A=";
x86_64-linux = "sha256-FFkFMMkTSseLZIDzESFl8+h7wRhv5QGi1Uy5MViYpX8=";
};
};
installPhase = ''
runHook preInstall
mkdir $out
cp -r ./* $out/
chmod +w -R $out/
cp -r . $out
chmod +w -R $out
patchelf $out/${buildType}/libcef.so --set-rpath "${rpath}" --add-needed libudev.so
patchelf $out/${buildType}/libGLESv2.so --set-rpath "${rpath}" --add-needed libGL.so.1
patchelf $out/${buildType}/chrome-sandbox --set-interpreter $(cat $NIX_BINTOOLS/nix-support/dynamic-linker)
@@ -124,6 +121,7 @@ let
runHook postInstall
'';
meta = {
description = "Simple framework for embedding Chromium-based browsers in other applications";
homepage = "https://cef-builds.spotifycdn.com/index.html";
@@ -135,6 +133,25 @@ let
];
};
};
in
stdenv.mkDerivation rec {
pname = "linux-wallpaperengine";
version = "0-unstable-2024-11-08";
src = fetchFromGitHub {
owner = "Almamu";
repo = "linux-wallpaperengine";
rev = "4a063d0b84d331a0086b3f4605358ee177328d41";
hash = "sha256-IRTGFxHPRRRSg0J07pq8fpo1XbMT4aZC+wMVimZlH/Y=";
};
nativeBuildInputs = [
cmake
pkg-config
autoPatchelfHook
makeWrapper
];
buildInputs = [
libdecor
ffmpeg
@@ -159,41 +176,16 @@ let
wayland-scanner
libXrandr
];
in
stdenv.mkDerivation {
pname = "linux-wallpaperengine";
version = "0-unstable-2024-11-8";
src = fetchFromGitHub {
owner = "Almamu";
repo = "linux-wallpaperengine";
rev = "4a063d0b84d331a0086b3f4605358ee177328d41";
hash = "sha256-IRTGFxHPRRRSg0J07pq8fpo1XbMT4aZC+wMVimZlH/Y=";
};
nativeBuildInputs = [
cmake
pkg-config
autoPatchelfHook
makeWrapper
];
inherit buildInputs;
cmakeFlags = [
"-DCMAKE_BUILD_TYPE=${buildType}"
"-DCEF_ROOT=${cef-bin}"
"-DCMAKE_INSTALL_PREFIX=${placeholder "out"}/linux-wallpaperengine"
];
postPatch = ''
patchShebangs .
mkdir -p third_party/cef/
ln -s ${cef-bin} third_party/cef/${cef-bin-name}
'';
preFixup = ''
patchelf --set-rpath "${lib.makeLibraryPath buildInputs}:${cef-bin}" $out/linux-wallpaperengine/linux-wallpaperengine
find $out -exec chmod 755 {} +
chmod 755 $out/linux-wallpaperengine/linux-wallpaperengine
mkdir $out/bin
makeWrapper $out/linux-wallpaperengine/linux-wallpaperengine $out/bin/linux-wallpaperengine
'';
@@ -201,7 +193,7 @@ stdenv.mkDerivation {
meta = {
description = "Wallpaper Engine backgrounds for Linux";
homepage = "https://github.com/Almamu/linux-wallpaperengine";
license = lib.licenses.gpl3Plus;
license = with lib.licenses; [ gpl3Plus ];
mainProgram = "linux-wallpaperengine";
maintainers = with lib.maintainers; [ aucub ];
platforms = [
-1
View File
@@ -678,7 +678,6 @@ mapAliases {
lightdm_gtk_greeter = lightdm-gtk-greeter; # Added 2022-08-01
lightstep-tracer-cpp = throw "lightstep-tracer-cpp is deprecated since 2022-08-29; the upstream recommends migration to opentelemetry projects.";
limesctl = throw "limesctl has been removed because it is insignificant."; # Added 2024-11-25
linux_wallpaperengine = throw "linux_wallpaperengine was removed due to freeimage dependency"; # Added 2024-07-19
lispPackages_new = throw "Lisp packages have been redesigned. See 'lisp-modules' in the nixpkgs manual."; # Added 2024-05-07
lispPackages = throw "Lisp packages have been redesigned. See 'lisp-modules' in the nixpkgs manual."; # Added 2024-05-07
lispPackagesFor = throw "Lisp packages have been redesigned. See 'lisp-modules' in the nixpkgs manual."; # Added 2024-05-07