-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: jdev082 <[email protected]>
- Loading branch information
jdev082
committed
Dec 13, 2024
1 parent
445215f
commit 7cab2ef
Showing
2 changed files
with
90 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{ | ||
stdenv, | ||
lib, | ||
fetchurl, | ||
appimageTools, | ||
makeWrapper, | ||
electron_33, | ||
electronPackage ? electron_33, | ||
asar, | ||
}: | ||
|
||
let | ||
electron = electronPackage; | ||
in | ||
stdenv.mkDerivation rec { | ||
pname = "catalyst-browser"; | ||
version = "3.9.4"; | ||
|
||
src = fetchurl { | ||
url = "https://github.com/CatalystDevOrg/Catalyst/releases/download/v${version}/catalyst-${version}.AppImage"; | ||
hash = "sha256-6t1RAxmRc/1fAQT4Qnd42kh3cxgRZr74k8gwebTb0Ic="; | ||
name = "catalyst-${version}.AppImage"; | ||
}; | ||
|
||
appimageContents = appimageTools.extractType2 { | ||
inherit pname src version; | ||
}; | ||
|
||
dontUnpack = true; | ||
dontConfigure = true; | ||
dontBuild = true; | ||
|
||
nativeBuildInputs = [ | ||
makeWrapper | ||
asar | ||
]; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
mkdir -p $out/bin $out/share/catalyst $out/share/applications | ||
mkdir -p $out/share/catalyst/resources/ | ||
cp -a ${appimageContents}/locales $out/share/catalyst | ||
cp -a ${appimageContents}/catalyst.desktop $out/share/applications/catalyst.desktop | ||
mkdir -p $out/share/pixmaps | ||
cp -r ${appimageContents}/usr/share/icons/hicolor/0x0/apps/catalyst.png $out/share/pixmaps/ | ||
asar extract ${appimageContents}/resources/app.asar resources/ | ||
rm -rf resources/.github | ||
rm -rf resources/.vscode | ||
rm -rf resources/.eslintrc.json | ||
rm -rf resources/.gitignore | ||
rm -rf resources/.pnpm-debug.log | ||
rm -rf resources/contributing.md | ||
rm -rf resources/pnpm-lock.yaml | ||
rm -rf resources/README.md | ||
rm -rf resources/CODE_OF_CONDUCT.md | ||
rm -rf *.nix | ||
substituteInPlace resources/src/index.html \ | ||
--replace-fail 'catalyst-default-distrib' 'catalyst-default-nixpkgs' | ||
substituteInPlace $out/share/applications/catalyst.desktop \ | ||
--replace-fail 'Exec=AppRun' 'Exec=${meta.mainProgram}' | ||
asar pack resources/ $out/share/catalyst/resources/app.asar | ||
runHook postInstall | ||
''; | ||
|
||
postFixup = '' | ||
makeWrapper ${electron}/bin/electron $out/bin/${meta.mainProgram} \ | ||
--add-flags $out/share/catalyst/resources/app.asar \ | ||
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc ]}" | ||
''; | ||
|
||
meta = { | ||
description = "Minimal, functional, and customizable user-focused FOSS web browser based on Chromium"; | ||
homepage = "https://getcatalyst.eu.org"; | ||
license = lib.licenses.mit; | ||
mainProgram = "catalyst"; | ||
maintainers = with lib.maintainers; [ jdev082 ]; | ||
platforms = [ "x86_64-linux" ]; | ||
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters