Skip to content

Commit 2ffb663

Browse files
authored
sigil: wrap qt app properly and move to by-name (#396355)
2 parents 99c18ee + 1d0a149 commit 2ffb663

File tree

4 files changed

+84
-68
lines changed

4 files changed

+84
-68
lines changed

maintainers/maintainer-list.nix

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19391,6 +19391,18 @@
1939119391
}
1939219392
];
1939319393
};
19394+
prince213 = {
19395+
name = "Sizhe Zhao";
19396+
email = "[email protected]";
19397+
matrix = "@prince213:matrix.org";
19398+
github = "Prince213";
19399+
githubId = 25235514;
19400+
keys = [
19401+
{
19402+
fingerprint = "2589 45E5 C556 7B4D B36C 3E28 A64B 5235 356E 16D1";
19403+
}
19404+
];
19405+
};
1939419406
princemachiavelli = {
1939519407
name = "Josh Hoffer";
1939619408
email = "[email protected]";

pkgs/applications/editors/sigil/default.nix

Lines changed: 0 additions & 66 deletions
This file was deleted.

pkgs/by-name/si/sigil/package.nix

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
lib,
3+
stdenv,
4+
fetchFromGitHub,
5+
cmake,
6+
pkg-config,
7+
boost,
8+
xercesc,
9+
python3Packages,
10+
qt6,
11+
}:
12+
13+
stdenv.mkDerivation rec {
14+
pname = "sigil";
15+
version = "2.4.2";
16+
17+
src = fetchFromGitHub {
18+
repo = "Sigil";
19+
owner = "Sigil-Ebook";
20+
tag = version;
21+
hash = "sha256-/lnSNamLkPLG8tn0w8F0zFyypMUXyMhgxA2WyQFegKw=";
22+
};
23+
24+
pythonPath = with python3Packages; [ lxml ];
25+
26+
nativeBuildInputs = [
27+
cmake
28+
pkg-config
29+
qt6.wrapQtAppsHook
30+
];
31+
32+
buildInputs = [
33+
boost
34+
xercesc
35+
qt6.qtbase
36+
qt6.qttools
37+
qt6.qtwebengine
38+
qt6.qtsvg
39+
python3Packages.lxml
40+
];
41+
42+
prePatch = ''
43+
sed -i '/^QTLIB_DIR=/ d' src/Resource_Files/bash/sigil-sh_install
44+
'';
45+
46+
installPhase = lib.optionalString stdenv.hostPlatform.isDarwin ''
47+
runHook preInstall
48+
49+
mkdir -p $out/Applications
50+
mv bin/Sigil.app $out/Applications
51+
# https://github.com/NixOS/nixpkgs/issues/186653
52+
chmod -x $out/Applications/Sigil.app/Contents/lib/*.dylib \
53+
$out/Applications/Sigil.app/Contents/polyfills/*.js \
54+
$out/Applications/Sigil.app/Contents/python3lib/*.py \
55+
$out/Applications/Sigil.app/Contents/hunspell_dictionaries/*.{aff,dic}
56+
57+
runHook postInstall
58+
'';
59+
60+
preFixup = ''
61+
qtWrapperArgs+=(--prefix PYTHONPATH : "$PYTHONPATH")
62+
'';
63+
64+
meta = {
65+
description = "Free, open source, multi-platform ebook (ePub) editor";
66+
homepage = "https://github.com/Sigil-Ebook/Sigil/";
67+
license = lib.licenses.gpl3Plus;
68+
maintainers = with lib.maintainers; [ prince213 ];
69+
platforms = with lib.platforms; linux ++ darwin;
70+
mainProgram = "sigil";
71+
};
72+
}

pkgs/top-level/all-packages.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5155,8 +5155,6 @@ with pkgs;
51555155

51565156
shiv = with python3Packages; toPythonApplication shiv;
51575157

5158-
sigil = qt6.callPackage ../applications/editors/sigil { };
5159-
51605158
slither-analyzer = with python3Packages; toPythonApplication slither-analyzer;
51615159

51625160
# aka., pgp-tools

0 commit comments

Comments
 (0)