nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchpatch,
6 cmake,
7 pkg-config,
8 qt5,
9 zsync2,
10 libcpr,
11 libgcrypt,
12 libappimage,
13 argagg,
14 nlohmann_json,
15 gpgme,
16 appimageupdate-qt,
17 withQtUI ? false,
18}:
19
20stdenv.mkDerivation (finalAttrs: {
21 pname = "appimageupdate";
22 version = "2.0.0-alpha-1-20251018";
23
24 src = fetchFromGitHub {
25 owner = "AppImageCommunity";
26 repo = "AppImageUpdate";
27 rev = finalAttrs.version;
28 hash = "sha256-S3MRBTtPc4S6lqvAZpbZFgOVgsX6GpHZ8PkwEtipT1M=";
29 };
30
31 postPatch = ''
32 substituteInPlace CMakeLists.txt \
33 --replace-fail 'env LC_ALL=C date -u "+%Y-%m-%d %H:%M:%S %Z"' 'bash -c "echo 1970-01-01 00:00:01 UTC"' \
34 --replace-fail 'git rev-parse --short HEAD' 'bash -c "echo unknown"' \
35 --replace-fail '<local dev build>' '<nixpkgs build>'
36 '';
37
38 nativeBuildInputs = [
39 cmake
40 pkg-config
41 ]
42 ++ lib.optionals withQtUI [
43 qt5.wrapQtAppsHook
44 ];
45
46 buildInputs = [
47 zsync2
48 libcpr
49 libgcrypt
50 libappimage
51 argagg
52 nlohmann_json
53 gpgme
54 ]
55 ++ lib.optionals withQtUI [
56 qt5.qtbase
57 ];
58
59 cmakeFlags = [
60 (lib.cmakeBool "USE_SYSTEM_ZSYNC2" true)
61 (lib.cmakeBool "USE_SYSTEM_LIBAPPIMAGE" true)
62 (lib.cmakeBool "BUILD_QT_UI" withQtUI)
63 ];
64
65 dontWrapQtApps = true;
66
67 preFixup = lib.optionalString withQtUI ''
68 wrapQtApp "$out/bin/AppImageUpdate"
69 '';
70
71 passthru.tests = {
72 inherit appimageupdate-qt;
73 };
74
75 meta = {
76 description = "Update AppImages using information embedded in the AppImage itself";
77 homepage = "https://github.com/AppImageCommunity/AppImageUpdate";
78 license = lib.licenses.mit;
79 mainProgram = if withQtUI then "AppImageUpdate" else "appimageupdatetool";
80 maintainers = with lib.maintainers; [ aleksana ];
81 platforms = lib.platforms.linux;
82 };
83})