1
0
Fork 0

update 

This commit is contained in:
azikx 2024-10-20 11:45:48 +09:00
parent e6ab73f405
commit 9efbf95d91

171
flake.nix
View file

@ -1,89 +1,132 @@
{ {
description = "Zen Browser"; description = "Zen Browser";
inputs = { inputs = { nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; };
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = { self, nixpkgs }: outputs = { self, nixpkgs }:
let let
system = "x86_64-linux"; system = "x86_64-linux";
version = "1.0.1-a.6"; version = "1.0.1-a.12";
downloadUrl = { downloadUrl = {
"specific" = { "specific" = {
url = "https://github.com/zen-browser/desktop/releases/download/${version}/zen.linux-specific.tar.bz2"; url =
sha256 = "sha256:0jkzdrsd1qdw3pwdafnl5xb061vryxzgwmvp1a6ghdwgl2dm2fcz"; "https://github.com/zen-browser/desktop/releases/download/${version}/zen.linux-specific.tar.bz2";
}; sha256 =
"generic" = { "sha256:0jkzdrsd1qdw3pwdafnl5xb061vryxzgwmvp1a6ghdwgl2dm2fcz";
url = "https://github.com/zen-browser/desktop/releases/download/${version}/zen.linux-generic.tar.bz2"; };
sha256 = "sha256:17c1ayxjdn8c28c5xvj3f94zjyiiwn8fihm3nq440b9dhkg01qcz"; "generic" = {
}; url =
"https://github.com/zen-browser/desktop/releases/download/${version}/zen.linux-generic.tar.bz2";
sha256 =
"sha256:17c1ayxjdn8c28c5xvj3f94zjyiiwn8fihm3nq440b9dhkg01qcz";
};
}; };
pkgs = import nixpkgs { pkgs = import nixpkgs { inherit system; };
inherit system;
};
runtimeLibs = with pkgs; [ runtimeLibs = with pkgs;
libGL libGLU libevent libffi libjpeg libpng libstartup_notification libvpx libwebp [
stdenv.cc.cc fontconfig libxkbcommon zlib freetype libGL
gtk3 libxml2 dbus xcb-util-cursor alsa-lib libpulseaudio pango atk cairo gdk-pixbuf glib libGLU
udev libva mesa libnotify cups pciutils libevent
ffmpeg libglvnd pipewire libffi
] ++ (with pkgs.xorg; [ libjpeg
libxcb libX11 libXcursor libXrandr libXi libXext libXcomposite libXdamage libpng
libXfixes libXScrnSaver libstartup_notification
]); libvpx
libwebp
stdenv.cc.cc
fontconfig
libxkbcommon
zlib
freetype
gtk3
libxml2
dbus
xcb-util-cursor
alsa-lib
libpulseaudio
pango
atk
cairo
gdk-pixbuf
glib
udev
libva
mesa
libnotify
cups
pciutils
ffmpeg
libglvnd
pipewire
] ++ (with pkgs.xorg; [
libxcb
libX11
libXcursor
libXrandr
libXi
libXext
libXcomposite
libXdamage
libXfixes
libXScrnSaver
]);
mkZen = { variant }: mkZen = { variant }:
let let downloadData = downloadUrl."${variant}";
downloadData = downloadUrl."${variant}"; in pkgs.stdenv.mkDerivation {
in inherit version;
pkgs.stdenv.mkDerivation { pname = "zen-browser";
inherit version;
pname = "zen-browser";
src = builtins.fetchTarball { src = builtins.fetchTarball {
url = downloadData.url; url = downloadData.url;
sha256 = downloadData.sha256; sha256 = downloadData.sha256;
}; };
desktopSrc = ./.;
phases = [ "installPhase" "fixupPhase" ]; desktopSrc = ./.;
nativeBuildInputs = [ pkgs.makeWrapper pkgs.copyDesktopItems pkgs.wrapGAppsHook ] ; phases = [ "installPhase" "fixupPhase" ];
installPhase = '' nativeBuildInputs =
mkdir -p $out/bin && cp -r $src/* $out/bin [ pkgs.makeWrapper pkgs.copyDesktopItems pkgs.wrapGAppsHook ];
install -D $desktopSrc/zen.desktop $out/share/applications/zen.desktop
install -D $src/browser/chrome/icons/default/default128.png $out/share/icons/hicolor/128x128/apps/zen.png
'';
fixupPhase = '' installPhase =
chmod 755 $out/bin/* " mkdir -p $out/bin && cp -r $src/* $out/bin\n install -D $desktopSrc/zen.desktop $out/share/applications/zen.desktop\n install -D $src/browser/chrome/icons/default/default128.png $out/share/icons/hicolor/128x128/apps/zen.png\n";
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/bin/zen
wrapProgram $out/bin/zen --set LD_LIBRARY_PATH "${pkgs.lib.makeLibraryPath runtimeLibs}" \
--set MOZ_LEGACY_PROFILES 1 --set MOZ_ALLOW_DOWNGRADE 1 --set MOZ_APP_LAUNCHER zen --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/bin/zen-bin
wrapProgram $out/bin/zen-bin --set LD_LIBRARY_PATH "${pkgs.lib.makeLibraryPath runtimeLibs}" \
--set MOZ_LEGACY_PROFILES 1 --set MOZ_ALLOW_DOWNGRADE 1 --set MOZ_APP_LAUNCHER zen --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/bin/glxtest
wrapProgram $out/bin/glxtest --set LD_LIBRARY_PATH "${pkgs.lib.makeLibraryPath runtimeLibs}"
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/bin/updater
wrapProgram $out/bin/updater --set LD_LIBRARY_PATH "${pkgs.lib.makeLibraryPath runtimeLibs}"
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/bin/vaapitest
wrapProgram $out/bin/vaapitest --set LD_LIBRARY_PATH "${pkgs.lib.makeLibraryPath runtimeLibs}"
'';
meta.mainProgram = "zen"; fixupPhase = ''
}; chmod 755 $out/bin/*
in patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/bin/zen
{ wrapProgram $out/bin/zen --set LD_LIBRARY_PATH "${
pkgs.lib.makeLibraryPath runtimeLibs
}" \
--set MOZ_LEGACY_PROFILES 1 --set MOZ_ALLOW_DOWNGRADE 1 --set MOZ_APP_LAUNCHER zen --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/bin/zen-bin
wrapProgram $out/bin/zen-bin --set LD_LIBRARY_PATH "${
pkgs.lib.makeLibraryPath runtimeLibs
}" \
--set MOZ_LEGACY_PROFILES 1 --set MOZ_ALLOW_DOWNGRADE 1 --set MOZ_APP_LAUNCHER zen --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/bin/glxtest
wrapProgram $out/bin/glxtest --set LD_LIBRARY_PATH "${
pkgs.lib.makeLibraryPath runtimeLibs
}"
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/bin/updater
wrapProgram $out/bin/updater --set LD_LIBRARY_PATH "${
pkgs.lib.makeLibraryPath runtimeLibs
}"
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/bin/vaapitest
wrapProgram $out/bin/vaapitest --set LD_LIBRARY_PATH "${
pkgs.lib.makeLibraryPath runtimeLibs
}"
'';
meta.mainProgram = "zen";
};
in {
packages."${system}" = { packages."${system}" = {
generic = mkZen { variant = "generic"; }; generic = mkZen { variant = "generic"; };
specific = mkZen { variant = "specific"; }; specific = mkZen { variant = "specific"; };
default = self.packages."${system}".specific; default = self.packages."${system}".specific;
}; };
}; };
} }