Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

freeshow: init at 1.2.1 #332658

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions pkgs/by-name/fr/freeshow/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
lib,
fetchurl,
stdenv,
undmg,
appimageTools,
}:

let
pname = "freeshow";
version = "1.2.1";
src =
fetchurl
{
x86_64-darwin = {
url = "https://github.com/ChurchApps/FreeShow/releases/download/v${version}/FreeShow-${version}.dmg";
hash = "sha256-OO0uQ6oS1GKiBGz3Qt9jDCY+qdWlgTOY+SiLJB5xQ3c=";
};
x86_64-linux = {
url = "https://github.com/ChurchApps/FreeShow/releases/download/v${version}/FreeShow-${version}.AppImage";
hash = "sha256-RBI8IkxY6Xd36vCVDJy9sqpEisB/48hwQo+mg5XTCOs=";
};
}
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.system}");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't evaluate for platforms absent from the list of supported platforms anyway

Suggested change
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.system}");
.${stdenv.hostPlatform.system};

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very common pattern in nixpkgs. I would keep the throw.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's common, but not necessary. See #314224


appimageContents = appimageTools.extract { inherit pname version src; };

meta = {
ByteSudoer marked this conversation as resolved.
Show resolved Hide resolved
description = "Free and open-source, user-friendly presenter software";
homepage = "https://freeshow.app";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ ByteSudoer ];
mainProgram = "freeshow";
platforms = [
"x86_64-darwin"
"x86_64-linux"
];
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
};

in
if stdenv.hostPlatform.isDarwin then
stdenv.mkDerivation {
inherit
pname
version
src
meta
;

sourceRoot = ".";

nativeBuildInputs = [ undmg ];

installPhase = ''
runHook preInstall
mkdir -p $out/Applications
cp -r *.app $out/Applications/
runHook postInstall
'';
}
else
appimageTools.wrapType2 {
inherit
pname
version
src
meta
;

extraInstallCommands = ''
mkdir -p $out/share/{applications,freeshow}
cp -a ${appimageContents}/{locales,resources} $out/share/freeshow
cp -a ${appimageContents}/usr/share/icons $out/share
install -Dm 444 ${appimageContents}/freeshow.desktop $out/share/applications
ByteSudoer marked this conversation as resolved.
Show resolved Hide resolved
substituteInPlace $out/share/applications/freeshow.desktop \
--replace-warn 'Exec=AppRun' 'Exec=freeshow'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
--replace-warn 'Exec=AppRun' 'Exec=freeshow'
--replace-warn 'Exec=AppRun' 'Exec=freeshow'

'';

}