1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 qtbase,
7 qttools,
8 sqlcipher,
9 wrapQtAppsHook,
10 qtmacextras,
11}:
12
13stdenv.mkDerivation (finalAttrs: {
14 pname = "sqlitebrowser";
15 version = "3.13.1";
16
17 src = fetchFromGitHub {
18 owner = "sqlitebrowser";
19 repo = "sqlitebrowser";
20 rev = "v${finalAttrs.version}";
21 sha256 = "sha256-bpZnO8i8MDgOm0f93pBmpy1sZLJQ9R4o4ZLnGfT0JRg=";
22 };
23
24 patches = lib.optional stdenv.hostPlatform.isDarwin ./macos.patch;
25
26 # We should be using qscintilla from nixpkgs instead of the vendored version,
27 # but qscintilla is currently in a bit of a mess as some consumers expect a
28 # -qt4 or -qt5 prefix while others do not.
29 # We *really* should get that cleaned up.
30 buildInputs = [
31 qtbase
32 sqlcipher
33 ] ++ lib.optional stdenv.hostPlatform.isDarwin qtmacextras;
34
35 nativeBuildInputs = [
36 cmake
37 qttools
38 wrapQtAppsHook
39 ];
40
41 cmakeFlags = [
42 "-Dsqlcipher=1"
43 (lib.cmakeBool "ENABLE_TESTING" (finalAttrs.finalPackage.doCheck or false))
44 ];
45
46 doCheck = true;
47
48 meta = with lib; {
49 description = "DB Browser for SQLite";
50 mainProgram = "sqlitebrowser";
51 homepage = "https://sqlitebrowser.org/";
52 license = licenses.gpl3;
53 maintainers = with maintainers; [ peterhoeg ];
54 platforms = platforms.unix;
55 };
56})