Skip to content
Merged
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
42 changes: 31 additions & 11 deletions pkgs/by-name/ko/koodo-reader/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,55 @@
stdenv,
fetchFromGitHub,
fetchYarnDeps,
yarnConfigHook,
yarnBuildHook,
nodejs,
makeDesktopItem,

copyDesktopItems,
cctools,
makeWrapper,
nodejs,
yarnConfigHook,
yarnBuildHook,
wrapGAppsHook3,
electron,
xcbuild,

electron_35,
}:

let
electron = electron_35; # don't use latest electron to avoid going over the supported abi numbers
in
stdenv.mkDerivation (finalAttrs: {
pname = "koodo-reader";
version = "1.7.4";
version = "2.0.9";

src = fetchFromGitHub {
owner = "troyeguo";
repo = "koodo-reader";
tag = "v${finalAttrs.version}";
hash = "sha256-rLW5FS8xM7Z49AaLq0KzBCoRgAVxwTDCHQFdIaEyygA=";
hash = "sha256-t93yRd9TrtGZogjpSy0Bse0cM5BFyMaSxFYQFZZyvPM=";
};

offlineCache = fetchYarnDeps {
yarnLock = "${finalAttrs.src}/yarn.lock";
hash = "sha256-58mxYt2wD6SGzhvo9c44CPmdX+/tLnbJCMPafo4txbY=";
inherit (finalAttrs) src;
hash = "sha256-NCnIayneTJqkNHHO98iS4bp7mlV3WHXF9Z7F5zKpD8I=";
};

nativeBuildInputs = [
makeWrapper
nodejs
(nodejs.python.withPackages (ps: [ ps.setuptools ]))
yarnConfigHook
yarnBuildHook
nodejs
]
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
copyDesktopItems
wrapGAppsHook3
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
cctools
xcbuild
];

dontWrapGApps = true;

env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1";

# disable code signing on Darwin
Expand All @@ -50,6 +60,14 @@ stdenv.mkDerivation (finalAttrs: {
postBuild = ''
cp -r ${electron.dist} electron-dist
chmod -R u+w electron-dist

# we need to build cpu-features with the non-electron headers first
export npm_config_nodedir=${nodejs}
npm rebuild --verbose cpu-features

export npm_config_nodedir=${electron.headers}
npm run postinstall

yarn --offline run electron-builder --dir \
-c.electronDist=electron-dist \
-c.electronVersion=${electron.version}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does env.CSC_IDENTITY_AUTO_DISCOVERY = "false"; not actually work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you send what it shows in the logs?

Expand All @@ -75,6 +93,8 @@ stdenv.mkDerivation (finalAttrs: {
runHook postInstall
'';

dontWrapGApps = true;

# we use makeShellWrapper instead of the makeBinaryWrapper provided by wrapGAppsHook for proper shell variable expansion
postFixup = lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
makeShellWrapper ${lib.getExe electron} $out/bin/koodo-reader \
Expand Down
Loading